@spartan-ng/brain 0.0.1-alpha.513 → 0.0.1-alpha.514

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.
@@ -95,11 +95,6 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
95
95
  * Reference to the checkbox button element in the template.
96
96
  */
97
97
  readonly checkbox: import("@angular/core").Signal<ElementRef<HTMLButtonElement>>;
98
- /**
99
- * Event emitted when checkbox value changes.
100
- * Emits new checked state (true/false/'indeterminate').
101
- */
102
- readonly changed: import("@angular/core").OutputEmitterRef<BrnCheckboxValue>;
103
98
  /**
104
99
  * Event emitted when checkbox is blurred (loses focus).
105
100
  * Used for form validation.
@@ -152,7 +147,7 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
152
147
  */
153
148
  setDisabledState(isDisabled: boolean): void;
154
149
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnCheckbox, never>;
155
- static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "changed": "changed"; "touched": "touched"; }, never, ["*"], true, never>;
150
+ static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "touched": "touched"; }, never, ["*"], true, never>;
156
151
  }
157
152
  type BrnCheckboxValue = boolean | 'indeterminate';
158
153
  export {};
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, computed, effect, untracked, Directive, ElementRef, HostListener, signal, contentChildren, linkedSignal, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
2
+ import { inject, input, computed, effect, untracked, Directive, ElementRef, isDevMode, HostListener, signal, contentChildren, linkedSignal, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
3
  import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
4
4
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -80,7 +80,13 @@ class BrnAccordionTrigger {
80
80
  }
81
81
  const parent = element.parentElement;
82
82
  if (!parent) {
83
- throw Error('BrnAccordionTrigger: The trigger button must be wrapped in a heading element.');
83
+ const message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';
84
+ if (isDevMode()) {
85
+ throw Error(message);
86
+ }
87
+ else {
88
+ console.warn(message);
89
+ }
84
90
  }
85
91
  const isNativeHeading = /^H[1-6]$/.test(parent.tagName);
86
92
  const hasHeadingRole = parent.getAttribute('role') === 'heading';
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { FocusableOption, FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tElementRef,\n\tHostListener,\n\tinject,\n\tinput,\n\ttype OnDestroy,\n\tsignal,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n\texportAs: 'brnAccordionItem',\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = inject(BrnAccordion);\n\t/**\n\t * Whether the accordion item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\tpublic readonly state = computed(() => (this._accordion.openItemIds().includes(this.id) ? 'open' : 'closed'));\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis._accordion.openItem(this.id);\n\t\t\t\t} else {\n\t\t\t\t\tthis._accordion.closeItem(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n@Directive({\n\tselector: '[brnAccordionTrigger]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-expanded]': 'state() === \"open\"',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[id]': 'id',\n\t\t'[attr.role]': '\"button\"',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _accordion = inject(BrnAccordion);\n\tprivate readonly _item = inject(BrnAccordionItem);\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._accordion.setActiveItem(this);\n\t\t\t});\n\t}\n\n\t@HostListener('click', ['$event'])\n\t@HostListener('keyup.space', ['$event'])\n\t@HostListener('keyup.enter', ['$event'])\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tthrow Error('BrnAccordionTrigger: The trigger button must be wrapped in a heading element.');\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n\texportAs: 'brnAccordion',\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this.triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this.dir() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical'),\n\t);\n\n\tprivate readonly _focused = signal<boolean>(false);\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tpublic triggers = contentChildren(BrnAccordionTrigger, { descendants: true });\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\t/**\n\t * The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n\t * @default null\n\t */\n\tpublic readonly dir = input<'ltr' | 'rtl' | null>(null);\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused()) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tViewEncapsulation,\n\tcomputed,\n\tinject,\n\tinput,\n\tlinkedSignal,\n} from '@angular/core';\nimport type { CustomElementClassSettable } from '@spartan-ng/brain/core';\nimport type { ClassValue } from 'clsx';\nimport { BrnAccordionItem } from './brn-accordion';\n\n@Component({\n\tselector: 'brn-accordion-content',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t},\n\ttemplate: `\n\t\t<div [attr.inert]=\"_addInert()\" style=\"overflow: hidden\">\n\t\t\t<p [class]=\"_contentClass()\">\n\t\t\t\t<ng-content />\n\t\t\t</p>\n\t\t</div>\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnAccordionContent implements CustomElementClassSettable {\n\tprivate readonly _item = inject(BrnAccordionItem);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-content-${this._item.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item.id}`;\n\n\tprotected readonly _addInert = computed(() => (this.state() === 'closed' ? true : undefined));\n\t/**\n\t * The class to be applied to the content element.\n\t */\n\tpublic readonly contentClass = input<ClassValue>('');\n\n\tprotected readonly _contentClass = linkedSignal(() => this.contentClass());\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t}\n\n\tpublic setClassToCustomElement(classes: ClassValue) {\n\t\tthis._contentClass.set(classes);\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnAccordion, BrnAccordionItem, BrnAccordionTrigger } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\n\nexport const BrnAccordionImports = [BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger] as const;\n\n@NgModule({\n\timports: [...BrnAccordionImports],\n\texports: [...BrnAccordionImports],\n})\nexport class BrnAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA0Ba,gBAAgB,CAAA;AACpB,IAAA,OAAO,gBAAgB,GAAG,CAAC;AACnB,IAAA,EAAE,GAAG,EAAE,gBAAgB,CAAC,gBAAgB;AACvC,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAClD;;;AAGG;IACa,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAA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AAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CANK,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAAxE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,CAAA,EAAA,CAAA;2HAM/F,kBAAkB,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;AACjC,oBAAA,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;AACjC,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { FocusableOption, FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tElementRef,\n\tHostListener,\n\tinject,\n\tinput,\n\tisDevMode,\n\ttype OnDestroy,\n\tsignal,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n\texportAs: 'brnAccordionItem',\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = inject(BrnAccordion);\n\t/**\n\t * Whether the accordion item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\tpublic readonly state = computed(() => (this._accordion.openItemIds().includes(this.id) ? 'open' : 'closed'));\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis._accordion.openItem(this.id);\n\t\t\t\t} else {\n\t\t\t\t\tthis._accordion.closeItem(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n@Directive({\n\tselector: '[brnAccordionTrigger]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-expanded]': 'state() === \"open\"',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[id]': 'id',\n\t\t'[attr.role]': '\"button\"',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _accordion = inject(BrnAccordion);\n\tprivate readonly _item = inject(BrnAccordionItem);\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._accordion.setActiveItem(this);\n\t\t\t});\n\t}\n\n\t@HostListener('click', ['$event'])\n\t@HostListener('keyup.space', ['$event'])\n\t@HostListener('keyup.enter', ['$event'])\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tconst message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';\n\t\t\tif (isDevMode()) {\n\t\t\t\tthrow Error(message);\n\t\t\t} else {\n\t\t\t\tconsole.warn(message);\n\t\t\t}\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n\texportAs: 'brnAccordion',\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this.triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this.dir() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical'),\n\t);\n\n\tprivate readonly _focused = signal<boolean>(false);\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tpublic triggers = contentChildren(BrnAccordionTrigger, { descendants: true });\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\t/**\n\t * The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n\t * @default null\n\t */\n\tpublic readonly dir = input<'ltr' | 'rtl' | null>(null);\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused()) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tViewEncapsulation,\n\tcomputed,\n\tinject,\n\tinput,\n\tlinkedSignal,\n} from '@angular/core';\nimport type { CustomElementClassSettable } from '@spartan-ng/brain/core';\nimport type { ClassValue } from 'clsx';\nimport { BrnAccordionItem } from './brn-accordion';\n\n@Component({\n\tselector: 'brn-accordion-content',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t},\n\ttemplate: `\n\t\t<div [attr.inert]=\"_addInert()\" style=\"overflow: hidden\">\n\t\t\t<p [class]=\"_contentClass()\">\n\t\t\t\t<ng-content />\n\t\t\t</p>\n\t\t</div>\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnAccordionContent implements CustomElementClassSettable {\n\tprivate readonly _item = inject(BrnAccordionItem);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-content-${this._item.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item.id}`;\n\n\tprotected readonly _addInert = computed(() => (this.state() === 'closed' ? true : undefined));\n\t/**\n\t * The class to be applied to the content element.\n\t */\n\tpublic readonly contentClass = input<ClassValue>('');\n\n\tprotected readonly _contentClass = linkedSignal(() => this.contentClass());\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t}\n\n\tpublic setClassToCustomElement(classes: ClassValue) {\n\t\tthis._contentClass.set(classes);\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnAccordion, BrnAccordionItem, BrnAccordionTrigger } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\n\nexport const BrnAccordionImports = [BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger] as const;\n\n@NgModule({\n\timports: [...BrnAccordionImports],\n\texports: [...BrnAccordionImports],\n})\nexport class BrnAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Ba,gBAAgB,CAAA;AACpB,IAAA,OAAO,gBAAgB,GAAG,CAAC;AACnB,IAAA,EAAE,GAAG,EAAE,gBAAgB,CAAC,gBAAgB;AACvC,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAClD;;;AAGG;IACa,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AACpF,IAAA,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAE7G,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AACrB,YAAA,MAAM,KAAK,CAAC,oFAAoF,CAAC;;QAElG,MAAM,CAAC,MAAK;AACX,YAAA,MAAM,QAAQ,GAAG,IAAI,CAA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mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAAxE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,CAAA,EAAA,CAAA;2HAM/F,kBAAkB,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;AACjC,oBAAA,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;AACjC,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -115,11 +115,6 @@ class BrnCheckbox {
115
115
  * Reference to the checkbox button element in the template.
116
116
  */
117
117
  checkbox = viewChild.required('checkBox');
118
- /**
119
- * Event emitted when checkbox value changes.
120
- * Emits new checked state (true/false/'indeterminate').
121
- */
122
- changed = output();
123
118
  /**
124
119
  * Event emitted when checkbox is blurred (loses focus).
125
120
  * Used for form validation.
@@ -158,7 +153,6 @@ class BrnCheckbox {
158
153
  const previousChecked = this.checked();
159
154
  this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
160
155
  this._onChange(this.checked());
161
- this.changed.emit(this.checked());
162
156
  this.checkedChange.emit(this.checked());
163
157
  }
164
158
  ngAfterContentInit() {
@@ -245,7 +239,7 @@ class BrnCheckbox {
245
239
  this._cdr.markForCheck();
246
240
  }
247
241
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
248
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnCheckbox, isStandalone: true, selector: "brn-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", checkedChange: "checkedChange", changed: "changed", touched: "touched" }, host: { properties: { "style": "{display: \"contents\"}", "attr.id": "_state().id", "attr.name": "_state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.data-state": "_dataState()", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_CHECKBOX_VALUE_ACCESSOR], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], ngImport: i0, template: `
242
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnCheckbox, isStandalone: true, selector: "brn-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", checkedChange: "checkedChange", touched: "touched" }, host: { properties: { "style": "{display: \"contents\"}", "attr.id": "_state().id", "attr.name": "_state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.data-state": "_dataState()", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_CHECKBOX_VALUE_ACCESSOR], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], ngImport: i0, template: `
249
243
  <button
250
244
  #checkBox
251
245
  role="checkbox"
@@ -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 { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tDestroyRef,\n\tElementRef,\n\ttype OnDestroy,\n\tPLATFORM_ID,\n\tRenderer2,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckbox),\n\tmulti: true,\n};\n\nlet uniqueIdCounter = 0;\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\ttemplate: `\n\t\t<button\n\t\t\t#checkBox\n\t\t\trole=\"checkbox\"\n\t\t\ttype=\"button\"\n\t\t\t[id]=\"getCheckboxButtonId(_state().id) ?? ''\"\n\t\t\t[name]=\"getCheckboxButtonId(_state().name) ?? ''\"\n\t\t\t[class]=\"class()\"\n\t\t\t[attr.aria-checked]=\"_ariaChecked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel() || null\"\n\t\t\t[attr.aria-labelledby]=\"mutableAriaLabelledby() || null\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby() || null\"\n\t\t\t[attr.data-state]=\"_dataState()\"\n\t\t\t[attr.data-focus-visible]=\"_focusVisible()\"\n\t\t\t[attr.data-focus]=\"_focused()\"\n\t\t\t[attr.data-disabled]=\"_state().disabled()\"\n\t\t\t[disabled]=\"_state().disabled()\"\n\t\t\t[tabIndex]=\"_state().disabled() ? -1 : 0\"\n\t\t\t(click)=\"$event.preventDefault(); toggle()\"\n\t\t>\n\t\t\t<ng-content />\n\t\t</button>\n\t`,\n\thost: {\n\t\t'[style]': '{display: \"contents\"}',\n\t\t'[attr.id]': '_state().id',\n\t\t'[attr.name]': '_state().name',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.data-state]': '_dataState()',\n\t\t'[attr.data-focus-visible]': '_focusVisible()',\n\t\t'[attr.data-focus]': '_focused()',\n\t\t'[attr.data-disabled]': '_state().disabled()',\n\t},\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class 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 _document = inject(DOCUMENT);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n\tprotected readonly _focusVisible = signal(false);\n\tprotected readonly _focused = signal(false);\n\n\t/**\n\t * Current checked state of checkbox.\n\t * Can be boolean (true/false) or 'indeterminate'.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<BrnCheckboxValue>(false);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<BrnCheckboxValue>();\n\n\t/**\n\t * Read-only signal of current checkbox state.\n\t * Use this when you only need to read state without changing it.\n\t */\n\tpublic readonly isChecked = this.checked.asReadonly();\n\n\t/**\n\t * Computed data-state attribute value based on checked state.\n\t * Returns 'checked', 'unchecked', or 'indeterminate'.\n\t */\n\tprotected readonly _dataState = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'indeterminate';\n\t\treturn checked ? 'checked' : 'unchecked';\n\t});\n\n\t/**\n\t * Computed aria-checked attribute value for accessibility.\n\t * Returns 'true', 'false', or 'mixed' (for indeterminate).\n\t */\n\tprotected readonly _ariaChecked = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'mixed';\n\t\treturn checked ? 'true' : 'false';\n\t});\n\n\t/**\n\t * Unique identifier for checkbox component.\n\t * When provided, inner button gets ID without '-checkbox' suffix.\n\t * Auto-generates ID if not provided.\n\t */\n\tpublic readonly id = input<string | null>(++uniqueIdCounter + '');\n\n\t/**\n\t * Form control name for checkbox.\n\t * When provided, inner button gets name without '-checkbox' suffix.\n\t */\n\tpublic readonly name = input<string | null>(null);\n\n\t/**\n\t * CSS classes applied to inner button element.\n\t */\n\tpublic readonly class = input<string | null>(null);\n\n\t/**\n\t * Accessibility label for screen readers.\n\t * Use when no visible label exists.\n\t */\n\tpublic readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n\t/**\n\t * ID of element that labels this checkbox for accessibility.\n\t * Auto-set when checkbox is inside label element.\n\t */\n\tpublic readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\tpublic readonly mutableAriaLabelledby = linkedSignal(() => this.ariaLabelledby());\n\n\t/**\n\t * ID of element that describes this checkbox for accessibility.\n\t */\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\t/**\n\t * Whether checkbox is required in a form.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether checkbox is disabled.\n\t * Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Computed state for checkbox container and accessibility.\n\t * Manages ID, name, and disabled state.\n\t */\n\tprotected readonly _state = computed(() => {\n\t\tconst name = this.name();\n\t\tconst id = this.id();\n\t\treturn {\n\t\t\tdisabled: signal(this.disabled()),\n\t\t\tname: name ? name + CONTAINER_POST_FIX : null,\n\t\t\tid: id ? id + CONTAINER_POST_FIX : null,\n\t\t};\n\t});\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<BrnCheckboxValue> = () => {};\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onTouched: TouchFn = () => {};\n\n\t/**\n\t * Reference to the checkbox button element in the template.\n\t */\n\tpublic readonly checkbox = viewChild.required<ElementRef<HTMLButtonElement>>('checkBox');\n\n\t/**\n\t * Event emitted when checkbox value changes.\n\t * Emits new checked state (true/false/'indeterminate').\n\t */\n\tpublic readonly changed = output<BrnCheckboxValue>();\n\n\t/**\n\t * Event emitted when checkbox is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst state = this._state();\n\t\t\tconst isDisabled = state.disabled();\n\n\t\t\tif (!this._elementRef.nativeElement || !this._isBrowser) return;\n\n\t\t\tconst newLabelId = state.id + '-label';\n\t\t\tconst checkboxButtonId = this.getCheckboxButtonId(state.id);\n\t\t\tconst labelElement =\n\t\t\t\tthis._elementRef.nativeElement.closest('label') ??\n\t\t\t\tthis._document.querySelector(`label[for=\"${checkboxButtonId}\"]`);\n\n\t\t\tif (!labelElement) return;\n\t\t\tconst existingLabelId = labelElement.id;\n\n\t\t\tthis._renderer.setAttribute(labelElement, 'data-disabled', isDisabled ? 'true' : 'false');\n\t\t\tthis.mutableAriaLabelledby.set(existingLabelId || newLabelId);\n\n\t\t\tif (!existingLabelId || existingLabelId.length === 0) {\n\t\t\t\tthis._renderer.setAttribute(labelElement, 'id', newLabelId);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Toggles checkbox between checked/unchecked states.\n\t * If checkbox is indeterminate, sets to checked.\n\t * Does nothing if checkbox is disabled.\n\t */\n\ttoggle() {\n\t\tif (this._state().disabled()) return;\n\n\t\tthis._onTouched();\n\t\tthis.touched.emit();\n\n\t\tconst previousChecked = this.checked();\n\t\tthis.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);\n\t\tthis._onChange(this.checked());\n\t\tthis.changed.emit(this.checked());\n\t\tthis.checkedChange.emit(this.checked());\n\t}\n\n\tngAfterContentInit() {\n\t\tthis._focusMonitor\n\t\t\t.monitor(this._elementRef, true)\n\t\t\t.pipe(takeUntilDestroyed(this._destroyRef))\n\t\t\t.subscribe((focusOrigin) => {\n\t\t\t\tif (focusOrigin) this._focused.set(true);\n\t\t\t\tif (focusOrigin === 'keyboard' || focusOrigin === 'program') {\n\t\t\t\t\tthis._focusVisible.set(true);\n\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t}\n\t\t\t\tif (!focusOrigin) {\n\t\t\t\t\t// When a focused element becomes disabled, the browser *immediately* fires a blur event.\n\t\t\t\t\t// Angular does not expect events to be raised during change detection, so any state\n\t\t\t\t\t// change (such as a form control's ng-touched) will cause a changed-after-checked error.\n\t\t\t\t\t// See https://github.com/angular/angular/issues/17793. To work around this, we defer\n\t\t\t\t\t// telling the form control it has been touched until the next tick.\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\tthis._focusVisible.set(false);\n\t\t\t\t\t\tthis._focused.set(false);\n\t\t\t\t\t\tthis._onTouched();\n\t\t\t\t\t\tthis.touched.emit();\n\t\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/**\n\t * Gets proper ID for inner button element.\n\t * Removes '-checkbox' suffix if present in container ID.\n\t *\n\t * @param idPassedToContainer - ID applied to container element\n\t * @returns ID to use for inner button or null\n\t */\n\tprotected getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null {\n\t\treturn idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;\n\t}\n\n\t/**\n\t * Updates internal state when control value changes from outside.\n\t * Handles boolean and 'indeterminate' values.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param value - New checkbox state (true/false/'indeterminate')\n\t */\n\twriteValue(value: BrnCheckboxValue): void {\n\t\tif (value === 'indeterminate') {\n\t\t\tthis.checked.set('indeterminate');\n\t\t} else {\n\t\t\tthis.checked.set(value);\n\t\t}\n\t}\n\n\t/**\n\t * Registers callback for value changes.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when value changes\n\t */\n\tregisterOnChange(fn: ChangeFn<BrnCheckboxValue>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/**\n\t * Registers callback for touched events.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when control is touched\n\t */\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/**\n\t * Updates disabled state from form control.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param isDisabled - Whether checkbox should be disabled\n\t */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._state().disabled.set(isDisabled);\n\t\tthis._cdr.markForCheck();\n\t}\n}\n\ntype BrnCheckboxValue = boolean | 'indeterminate';\n","import { NgModule } from '@angular/core';\n\nimport { BrnCheckbox } from './lib/brn-checkbox';\n\nexport * from './lib/brn-checkbox';\n\nexport const BrnCheckboxImports = [BrnCheckbox] as const;\n\n@NgModule({\n\timports: [...BrnCheckboxImports],\n\texports: [...BrnCheckboxImports],\n})\nexport class BrnCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA6BO,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;MA0CzB,WAAW,CAAA;AACN,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC5B,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAEjD,IAAA,aA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BAAiB,EAAA,OAAA,EAAA,CANK,WAAW,CAAA,EAAA,OAAA,EAAA,CAAX,WAAW,CAAA,EAAA,CAAA;2HAMjC,iBAAiB,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,iBAAA;;;ACXD;;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 { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\teffect,\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 { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckbox),\n\tmulti: true,\n};\n\nlet uniqueIdCounter = 0;\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\ttemplate: `\n\t\t<button\n\t\t\t#checkBox\n\t\t\trole=\"checkbox\"\n\t\t\ttype=\"button\"\n\t\t\t[id]=\"getCheckboxButtonId(_state().id) ?? ''\"\n\t\t\t[name]=\"getCheckboxButtonId(_state().name) ?? ''\"\n\t\t\t[class]=\"class()\"\n\t\t\t[attr.aria-checked]=\"_ariaChecked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel() || null\"\n\t\t\t[attr.aria-labelledby]=\"mutableAriaLabelledby() || null\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby() || null\"\n\t\t\t[attr.data-state]=\"_dataState()\"\n\t\t\t[attr.data-focus-visible]=\"_focusVisible()\"\n\t\t\t[attr.data-focus]=\"_focused()\"\n\t\t\t[attr.data-disabled]=\"_state().disabled()\"\n\t\t\t[disabled]=\"_state().disabled()\"\n\t\t\t[tabIndex]=\"_state().disabled() ? -1 : 0\"\n\t\t\t(click)=\"$event.preventDefault(); toggle()\"\n\t\t>\n\t\t\t<ng-content />\n\t\t</button>\n\t`,\n\thost: {\n\t\t'[style]': '{display: \"contents\"}',\n\t\t'[attr.id]': '_state().id',\n\t\t'[attr.name]': '_state().name',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.data-state]': '_dataState()',\n\t\t'[attr.data-focus-visible]': '_focusVisible()',\n\t\t'[attr.data-focus]': '_focused()',\n\t\t'[attr.data-disabled]': '_state().disabled()',\n\t},\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class 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 _document = inject(DOCUMENT);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n\tprotected readonly _focusVisible = signal(false);\n\tprotected readonly _focused = signal(false);\n\n\t/**\n\t * Current checked state of checkbox.\n\t * Can be boolean (true/false) or 'indeterminate'.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<BrnCheckboxValue>(false);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<BrnCheckboxValue>();\n\n\t/**\n\t * Read-only signal of current checkbox state.\n\t * Use this when you only need to read state without changing it.\n\t */\n\tpublic readonly isChecked = this.checked.asReadonly();\n\n\t/**\n\t * Computed data-state attribute value based on checked state.\n\t * Returns 'checked', 'unchecked', or 'indeterminate'.\n\t */\n\tprotected readonly _dataState = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'indeterminate';\n\t\treturn checked ? 'checked' : 'unchecked';\n\t});\n\n\t/**\n\t * Computed aria-checked attribute value for accessibility.\n\t * Returns 'true', 'false', or 'mixed' (for indeterminate).\n\t */\n\tprotected readonly _ariaChecked = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'mixed';\n\t\treturn checked ? 'true' : 'false';\n\t});\n\n\t/**\n\t * Unique identifier for checkbox component.\n\t * When provided, inner button gets ID without '-checkbox' suffix.\n\t * Auto-generates ID if not provided.\n\t */\n\tpublic readonly id = input<string | null>(++uniqueIdCounter + '');\n\n\t/**\n\t * Form control name for checkbox.\n\t * When provided, inner button gets name without '-checkbox' suffix.\n\t */\n\tpublic readonly name = input<string | null>(null);\n\n\t/**\n\t * CSS classes applied to inner button element.\n\t */\n\tpublic readonly class = input<string | null>(null);\n\n\t/**\n\t * Accessibility label for screen readers.\n\t * Use when no visible label exists.\n\t */\n\tpublic readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n\t/**\n\t * ID of element that labels this checkbox for accessibility.\n\t * Auto-set when checkbox is inside label element.\n\t */\n\tpublic readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\tpublic readonly mutableAriaLabelledby = linkedSignal(() => this.ariaLabelledby());\n\n\t/**\n\t * ID of element that describes this checkbox for accessibility.\n\t */\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\t/**\n\t * Whether checkbox is required in a form.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether checkbox is disabled.\n\t * Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Computed state for checkbox container and accessibility.\n\t * Manages ID, name, and disabled state.\n\t */\n\tprotected readonly _state = computed(() => {\n\t\tconst name = this.name();\n\t\tconst id = this.id();\n\t\treturn {\n\t\t\tdisabled: signal(this.disabled()),\n\t\t\tname: name ? name + CONTAINER_POST_FIX : null,\n\t\t\tid: id ? id + CONTAINER_POST_FIX : null,\n\t\t};\n\t});\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<BrnCheckboxValue> = () => {};\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onTouched: TouchFn = () => {};\n\n\t/**\n\t * Reference to the checkbox button element in the template.\n\t */\n\tpublic readonly checkbox = viewChild.required<ElementRef<HTMLButtonElement>>('checkBox');\n\n\t/**\n\t * Event emitted when checkbox is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst state = this._state();\n\t\t\tconst isDisabled = state.disabled();\n\n\t\t\tif (!this._elementRef.nativeElement || !this._isBrowser) return;\n\n\t\t\tconst newLabelId = state.id + '-label';\n\t\t\tconst checkboxButtonId = this.getCheckboxButtonId(state.id);\n\t\t\tconst labelElement =\n\t\t\t\tthis._elementRef.nativeElement.closest('label') ??\n\t\t\t\tthis._document.querySelector(`label[for=\"${checkboxButtonId}\"]`);\n\n\t\t\tif (!labelElement) return;\n\t\t\tconst existingLabelId = labelElement.id;\n\n\t\t\tthis._renderer.setAttribute(labelElement, 'data-disabled', isDisabled ? 'true' : 'false');\n\t\t\tthis.mutableAriaLabelledby.set(existingLabelId || newLabelId);\n\n\t\t\tif (!existingLabelId || existingLabelId.length === 0) {\n\t\t\t\tthis._renderer.setAttribute(labelElement, 'id', newLabelId);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Toggles checkbox between checked/unchecked states.\n\t * If checkbox is indeterminate, sets to checked.\n\t * Does nothing if checkbox is disabled.\n\t */\n\ttoggle() {\n\t\tif (this._state().disabled()) return;\n\n\t\tthis._onTouched();\n\t\tthis.touched.emit();\n\n\t\tconst previousChecked = this.checked();\n\t\tthis.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);\n\t\tthis._onChange(this.checked());\n\t\tthis.checkedChange.emit(this.checked());\n\t}\n\n\tngAfterContentInit() {\n\t\tthis._focusMonitor\n\t\t\t.monitor(this._elementRef, true)\n\t\t\t.pipe(takeUntilDestroyed(this._destroyRef))\n\t\t\t.subscribe((focusOrigin) => {\n\t\t\t\tif (focusOrigin) this._focused.set(true);\n\t\t\t\tif (focusOrigin === 'keyboard' || focusOrigin === 'program') {\n\t\t\t\t\tthis._focusVisible.set(true);\n\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t}\n\t\t\t\tif (!focusOrigin) {\n\t\t\t\t\t// When a focused element becomes disabled, the browser *immediately* fires a blur event.\n\t\t\t\t\t// Angular does not expect events to be raised during change detection, so any state\n\t\t\t\t\t// change (such as a form control's ng-touched) will cause a changed-after-checked error.\n\t\t\t\t\t// See https://github.com/angular/angular/issues/17793. To work around this, we defer\n\t\t\t\t\t// telling the form control it has been touched until the next tick.\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\tthis._focusVisible.set(false);\n\t\t\t\t\t\tthis._focused.set(false);\n\t\t\t\t\t\tthis._onTouched();\n\t\t\t\t\t\tthis.touched.emit();\n\t\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/**\n\t * Gets proper ID for inner button element.\n\t * Removes '-checkbox' suffix if present in container ID.\n\t *\n\t * @param idPassedToContainer - ID applied to container element\n\t * @returns ID to use for inner button or null\n\t */\n\tprotected getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null {\n\t\treturn idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;\n\t}\n\n\t/**\n\t * Updates internal state when control value changes from outside.\n\t * Handles boolean and 'indeterminate' values.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param value - New checkbox state (true/false/'indeterminate')\n\t */\n\twriteValue(value: BrnCheckboxValue): void {\n\t\tif (value === 'indeterminate') {\n\t\t\tthis.checked.set('indeterminate');\n\t\t} else {\n\t\t\tthis.checked.set(value);\n\t\t}\n\t}\n\n\t/**\n\t * Registers callback for value changes.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when value changes\n\t */\n\tregisterOnChange(fn: ChangeFn<BrnCheckboxValue>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/**\n\t * Registers callback for touched events.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when control is touched\n\t */\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/**\n\t * Updates disabled state from form control.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param isDisabled - Whether checkbox should be disabled\n\t */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._state().disabled.set(isDisabled);\n\t\tthis._cdr.markForCheck();\n\t}\n}\n\ntype BrnCheckboxValue = boolean | 'indeterminate';\n","import { NgModule } from '@angular/core';\n\nimport { BrnCheckbox } from './lib/brn-checkbox';\n\nexport * from './lib/brn-checkbox';\n\nexport const BrnCheckboxImports = [BrnCheckbox] as const;\n\n@NgModule({\n\timports: [...BrnCheckboxImports],\n\texports: [...BrnCheckboxImports],\n})\nexport class BrnCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA6BO,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;MA0CzB,WAAW,CAAA;AACN,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC5B,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAEjD,IAAA,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;AAC7B,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;AAE3C;;;;AAIG;AACa,IAAA,OAAO,GAAG,KAAK,CAAmB,KAAK,CAAC;;IAGxC,aAAa,GAAG,MAAM,EAAoB;AAE1D;;;AAGG;AACa,IAAA,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AAErD;;;AAGG;AACgB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAC7C,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;QAC9B,IAAI,OAAO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AAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;AAsBT,CAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACL,wBAAA,SAAS,EAAE,uBAAuB;AAClC,wBAAA,WAAW,EAAE,aAAa;AAC1B,wBAAA,aAAa,EAAE,eAAe;AAC9B,wBAAA,wBAAwB,EAAE,MAAM;AAChC,wBAAA,mBAAmB,EAAE,MAAM;AAC3B,wBAAA,yBAAyB,EAAE,MAAM;AACjC,wBAAA,mBAAmB,EAAE,cAAc;AACnC,wBAAA,2BAA2B,EAAE,iBAAiB;AAC9C,wBAAA,mBAAmB,EAAE,YAAY;AACjC,wBAAA,sBAAsB,EAAE,qBAAqB;AAC7C,qBAAA;oBACD,SAAS,EAAE,CAAC,2BAA2B,CAAC;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;ACxEM,MAAM,kBAAkB,GAAG,CAAC,WAAW;MAMjC,iBAAiB,CAAA;0HAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;2HAAjB,iBAAiB,EAAA,OAAA,EAAA,CANK,WAAW,CAAA,EAAA,OAAA,EAAA,CAAX,WAAW,CAAA,EAAA,CAAA;2HAMjC,iBAAiB,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -75,11 +75,6 @@ class BrnSwitch {
75
75
  * @default 0
76
76
  */
77
77
  tabIndex = input(0);
78
- /**
79
- * Event emitted when switch value changes.
80
- * Emits new checked state (true/false).
81
- */
82
- changed = output();
83
78
  /**
84
79
  * Event emitted when switch is blurred (loses focus).
85
80
  * Used for form validation.
@@ -130,7 +125,6 @@ class BrnSwitch {
130
125
  this.touched.emit();
131
126
  this.checked.update((checked) => !checked);
132
127
  this._onChange(this.checked());
133
- this.changed.emit(this.checked());
134
128
  this.checkedChange.emit(this.checked());
135
129
  }
136
130
  ngAfterContentInit() {
@@ -215,7 +209,7 @@ class BrnSwitch {
215
209
  this._cdr.markForCheck();
216
210
  }
217
211
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
218
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnSwitch, isStandalone: true, selector: "brn-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", checkedChange: "checkedChange", changed: "changed", touched: "touched" }, host: { properties: { "style": "{display: \"contents\"}", "attr.id": "_state().id", "attr.name": "_state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.data-state": "checked() ? \"checked\" : \"unchecked\"", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_SWITCH_VALUE_ACCESSOR], viewQueries: [{ propertyName: "switch", first: true, predicate: ["switch"], descendants: true, isSignal: true }], ngImport: i0, template: `
212
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnSwitch, isStandalone: true, selector: "brn-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", checkedChange: "checkedChange", touched: "touched" }, host: { properties: { "style": "{display: \"contents\"}", "attr.id": "_state().id", "attr.name": "_state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.data-state": "checked() ? \"checked\" : \"unchecked\"", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_SWITCH_VALUE_ACCESSOR], viewQueries: [{ propertyName: "switch", first: true, predicate: ["switch"], descendants: true, isSignal: true }], ngImport: i0, template: `
219
213
  <button
220
214
  #switch
221
215
  role="switch"
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-switch.mjs","sources":["../../../../libs/brain/switch/src/lib/brn-switch.ts","../../../../libs/brain/switch/src/lib/brn-switch-thumb.ts","../../../../libs/brain/switch/src/index.ts","../../../../libs/brain/switch/src/spartan-ng-brain-switch.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\teffect,\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 { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_SWITCH_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnSwitch),\n\tmulti: true,\n};\n\nconst CONTAINER_POST_FIX = '-switch';\n\nlet uniqueIdCounter = 0;\n\n@Component({\n\tselector: 'brn-switch',\n\ttemplate: `\n\t\t<button\n\t\t\t#switch\n\t\t\trole=\"switch\"\n\t\t\ttype=\"button\"\n\t\t\t[class]=\"class()\"\n\t\t\t[id]=\"getSwitchButtonId(_state().id) ?? ''\"\n\t\t\t[name]=\"getSwitchButtonId(_state().name) ?? ''\"\n\t\t\t[value]=\"checked() ? 'on' : 'off'\"\n\t\t\t[attr.aria-checked]=\"checked()\"\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]=\"checked() ? 'checked' : 'unchecked'\"\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]=\"tabIndex()\"\n\t\t\t(click)=\"$event.preventDefault(); toggle()\"\n\t\t>\n\t\t\t<ng-content select=\"brn-switch-thumb\" />\n\t\t</button>\n\t`,\n\thost: {\n\t\t'[style]': '{display: \"contents\"}',\n\t\t'[attr.id]': '_state().id',\n\t\t'[attr.name]': '_state().name',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n\t\t'[attr.data-focus-visible]': '_focusVisible()',\n\t\t'[attr.data-focus]': '_focused()',\n\t\t'[attr.data-disabled]': '_state().disabled()',\n\t},\n\tproviders: [BRN_SWITCH_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnSwitch implements AfterContentInit, OnDestroy, ControlValueAccessor {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _cdr = inject(ChangeDetectorRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\n\tprotected readonly _focusVisible = signal(false);\n\tprotected readonly _focused = signal(false);\n\n\t/**\n\t * Whether switch is checked/toggled on.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<boolean>(false);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<boolean>();\n\n\t/**\n\t * Unique identifier for switch component.\n\t * When provided, inner button gets ID without '-switch' 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 switch.\n\t * When provided, inner button gets name without '-switch' 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 switch for accessibility.\n\t * Auto-set when switch 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 switch for accessibility.\n\t */\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\t/**\n\t * Whether switch is required in a form.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether switch is disabled.\n\t * Disabled switches cannot be toggled and indicate disabled state with data attribute.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Keyboard tab order for switch.\n\t * @default 0\n\t */\n\tpublic readonly tabIndex = input(0);\n\n\t/**\n\t * Event emitted when switch value changes.\n\t * Emits new checked state (true/false).\n\t */\n\tpublic readonly changed = output<boolean>();\n\n\t/**\n\t * Event emitted when switch is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\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\tpublic readonly switch = viewChild.required<ElementRef<HTMLInputElement>>('switch');\n\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\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst state = this._state();\n\t\t\tconst isDisabled = state.disabled();\n\n\t\t\tif (!this._elementRef.nativeElement || !this._isBrowser) return;\n\n\t\t\tconst newLabelId = state.id + '-label';\n\t\t\tconst switchButtonId = this.getSwitchButtonId(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=\"${switchButtonId}\"]`);\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 switch between checked/unchecked states.\n\t * Does nothing if switch is disabled.\n\t */\n\tprotected toggle(): void {\n\t\tif (this._state().disabled()) return;\n\n\t\tthis._onTouched();\n\t\tthis.touched.emit();\n\n\t\tthis.checked.update((checked) => !checked);\n\t\tthis._onChange(this.checked());\n\t\tthis.changed.emit(this.checked());\n\t\tthis.checkedChange.emit(this.checked());\n\t}\n\n\tpublic ngAfterContentInit(): void {\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\n\t\tif (!this.switch()) return;\n\t\tthis.switch().nativeElement.value = this.checked() ? 'on' : 'off';\n\t\tthis.switch().nativeElement.dispatchEvent(new Event('change'));\n\t}\n\n\tpublic ngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/**\n\t * Gets proper ID for inner button element.\n\t * Removes '-switch' 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 getSwitchButtonId(idPassedToContainer: string | null | undefined): string | null {\n\t\treturn idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;\n\t}\n\n\t/**\n\t * Updates internal state when control value changes from outside.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param value - New checked state\n\t */\n\tpublic writeValue(value: boolean): void {\n\t\tthis.checked.set(Boolean(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\tpublic registerOnChange(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\tpublic registerOnTouched(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 switch should be disabled\n\t */\n\tpublic setDisabledState(isDisabled: boolean): void {\n\t\tthis._state().disabled.set(isDisabled);\n\t\tthis._cdr.markForCheck();\n\t}\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n\tselector: 'brn-switch-thumb',\n\ttemplate: '',\n\thost: {\n\t\trole: 'presentation',\n\t\t'(click)': '$event.preventDefault()',\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnSwitchThumb {}\n","import { NgModule } from '@angular/core';\n\nimport { BrnSwitch } from './lib/brn-switch';\nimport { BrnSwitchThumb } from './lib/brn-switch-thumb';\n\nexport * from './lib/brn-switch';\nexport * from './lib/brn-switch-thumb';\n\nexport const BrnSwitchImports = [BrnSwitch, BrnSwitchThumb] as const;\n\n@NgModule({\n\timports: [...BrnSwitchImports],\n\texports: [...BrnSwitchImports],\n})\nexport class BrnSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA6BO,MAAM,yBAAyB,GAAG;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,SAAS,CAAC;AACxC,IAAA,KAAK,EAAE,IAAI;;AAGZ,MAAM,kBAAkB,GAAG,SAAS;AAEpC,IAAI,eAAe,GAAG,CAAC;MA2CV,SAAS,CAAA;AACJ,IAAA,WAAW,GAA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D;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-switch.mjs","sources":["../../../../libs/brain/switch/src/lib/brn-switch.ts","../../../../libs/brain/switch/src/lib/brn-switch-thumb.ts","../../../../libs/brain/switch/src/index.ts","../../../../libs/brain/switch/src/spartan-ng-brain-switch.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\teffect,\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 { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_SWITCH_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnSwitch),\n\tmulti: true,\n};\n\nconst CONTAINER_POST_FIX = '-switch';\n\nlet uniqueIdCounter = 0;\n\n@Component({\n\tselector: 'brn-switch',\n\ttemplate: `\n\t\t<button\n\t\t\t#switch\n\t\t\trole=\"switch\"\n\t\t\ttype=\"button\"\n\t\t\t[class]=\"class()\"\n\t\t\t[id]=\"getSwitchButtonId(_state().id) ?? ''\"\n\t\t\t[name]=\"getSwitchButtonId(_state().name) ?? ''\"\n\t\t\t[value]=\"checked() ? 'on' : 'off'\"\n\t\t\t[attr.aria-checked]=\"checked()\"\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]=\"checked() ? 'checked' : 'unchecked'\"\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]=\"tabIndex()\"\n\t\t\t(click)=\"$event.preventDefault(); toggle()\"\n\t\t>\n\t\t\t<ng-content select=\"brn-switch-thumb\" />\n\t\t</button>\n\t`,\n\thost: {\n\t\t'[style]': '{display: \"contents\"}',\n\t\t'[attr.id]': '_state().id',\n\t\t'[attr.name]': '_state().name',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n\t\t'[attr.data-focus-visible]': '_focusVisible()',\n\t\t'[attr.data-focus]': '_focused()',\n\t\t'[attr.data-disabled]': '_state().disabled()',\n\t},\n\tproviders: [BRN_SWITCH_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnSwitch implements AfterContentInit, OnDestroy, ControlValueAccessor {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _cdr = inject(ChangeDetectorRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\n\tprotected readonly _focusVisible = signal(false);\n\tprotected readonly _focused = signal(false);\n\n\t/**\n\t * Whether switch is checked/toggled on.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<boolean>(false);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<boolean>();\n\n\t/**\n\t * Unique identifier for switch component.\n\t * When provided, inner button gets ID without '-switch' 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 switch.\n\t * When provided, inner button gets name without '-switch' 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 switch for accessibility.\n\t * Auto-set when switch 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 switch for accessibility.\n\t */\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\t/**\n\t * Whether switch is required in a form.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether switch is disabled.\n\t * Disabled switches cannot be toggled and indicate disabled state with data attribute.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Keyboard tab order for switch.\n\t * @default 0\n\t */\n\tpublic readonly tabIndex = input(0);\n\n\t/**\n\t * Event emitted when switch is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\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\tpublic readonly switch = viewChild.required<ElementRef<HTMLInputElement>>('switch');\n\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\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst state = this._state();\n\t\t\tconst isDisabled = state.disabled();\n\n\t\t\tif (!this._elementRef.nativeElement || !this._isBrowser) return;\n\n\t\t\tconst newLabelId = state.id + '-label';\n\t\t\tconst switchButtonId = this.getSwitchButtonId(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=\"${switchButtonId}\"]`);\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 switch between checked/unchecked states.\n\t * Does nothing if switch is disabled.\n\t */\n\tprotected toggle(): void {\n\t\tif (this._state().disabled()) return;\n\n\t\tthis._onTouched();\n\t\tthis.touched.emit();\n\n\t\tthis.checked.update((checked) => !checked);\n\t\tthis._onChange(this.checked());\n\t\tthis.checkedChange.emit(this.checked());\n\t}\n\n\tpublic ngAfterContentInit(): void {\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\n\t\tif (!this.switch()) return;\n\t\tthis.switch().nativeElement.value = this.checked() ? 'on' : 'off';\n\t\tthis.switch().nativeElement.dispatchEvent(new Event('change'));\n\t}\n\n\tpublic ngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/**\n\t * Gets proper ID for inner button element.\n\t * Removes '-switch' 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 getSwitchButtonId(idPassedToContainer: string | null | undefined): string | null {\n\t\treturn idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;\n\t}\n\n\t/**\n\t * Updates internal state when control value changes from outside.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param value - New checked state\n\t */\n\tpublic writeValue(value: boolean): void {\n\t\tthis.checked.set(Boolean(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\tpublic registerOnChange(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\tpublic registerOnTouched(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 switch should be disabled\n\t */\n\tpublic setDisabledState(isDisabled: boolean): void {\n\t\tthis._state().disabled.set(isDisabled);\n\t\tthis._cdr.markForCheck();\n\t}\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n\tselector: 'brn-switch-thumb',\n\ttemplate: '',\n\thost: {\n\t\trole: 'presentation',\n\t\t'(click)': '$event.preventDefault()',\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnSwitchThumb {}\n","import { NgModule } from '@angular/core';\n\nimport { BrnSwitch } from './lib/brn-switch';\nimport { BrnSwitchThumb } from './lib/brn-switch-thumb';\n\nexport * from './lib/brn-switch';\nexport * from './lib/brn-switch-thumb';\n\nexport const BrnSwitchImports = [BrnSwitch, BrnSwitchThumb] as const;\n\n@NgModule({\n\timports: [...BrnSwitchImports],\n\texports: [...BrnSwitchImports],\n})\nexport class BrnSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA6BO,MAAM,yBAAyB,GAAG;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,SAAS,CAAC;AACxC,IAAA,KAAK,EAAE,IAAI;;AAGZ,MAAM,kBAAkB,GAAG,SAAS;AAEpC,IAAI,eAAe,GAAG,CAAC;MA2CV,SAAS,CAAA;AACJ,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAC7B,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACnD,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,IAAA,a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C,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,EAAE;AACZ,oBAAA,IAAI,EAAE;AACL,wBAAA,IAAI,EAAE,cAAc;AACpB,wBAAA,SAAS,EAAE,yBAAyB;AACpC,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;MCFY,gBAAgB,GAAG,CAAC,SAAS,EAAE,cAAc;MAM7C,eAAe,CAAA;0HAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAf,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YANK,SAAS,EAAE,cAAc,CAAA,EAAA,OAAA,EAAA,CAAzB,SAAS,EAAE,cAAc,CAAA,EAAA,CAAA;2HAM7C,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC9B,oBAAA,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC9B,iBAAA;;;ACbD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spartan-ng/brain",
3
- "version": "0.0.1-alpha.513",
3
+ "version": "0.0.1-alpha.514",
4
4
  "sideEffects": false,
5
5
  "exports": {
6
6
  "./hlm-tailwind-preset": {
@@ -118,14 +118,14 @@
118
118
  "types": "./slider/index.d.ts",
119
119
  "default": "./fesm2022/spartan-ng-brain-slider.mjs"
120
120
  },
121
- "./switch": {
122
- "types": "./switch/index.d.ts",
123
- "default": "./fesm2022/spartan-ng-brain-switch.mjs"
124
- },
125
121
  "./tabs": {
126
122
  "types": "./tabs/index.d.ts",
127
123
  "default": "./fesm2022/spartan-ng-brain-tabs.mjs"
128
124
  },
125
+ "./switch": {
126
+ "types": "./switch/index.d.ts",
127
+ "default": "./fesm2022/spartan-ng-brain-switch.mjs"
128
+ },
129
129
  "./toggle": {
130
130
  "types": "./toggle/index.d.ts",
131
131
  "default": "./fesm2022/spartan-ng-brain-toggle.mjs"
@@ -69,11 +69,6 @@ export declare class BrnSwitch implements AfterContentInit, OnDestroy, ControlVa
69
69
  * @default 0
70
70
  */
71
71
  readonly tabIndex: import("@angular/core").InputSignal<number>;
72
- /**
73
- * Event emitted when switch value changes.
74
- * Emits new checked state (true/false).
75
- */
76
- readonly changed: import("@angular/core").OutputEmitterRef<boolean>;
77
72
  /**
78
73
  * Event emitted when switch is blurred (loses focus).
79
74
  * Used for form validation.
@@ -132,5 +127,5 @@ export declare class BrnSwitch implements AfterContentInit, OnDestroy, ControlVa
132
127
  */
133
128
  setDisabledState(isDisabled: boolean): void;
134
129
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnSwitch, never>;
135
- static ɵcmp: i0.ɵɵComponentDeclaration<BrnSwitch, "brn-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "changed": "changed"; "touched": "touched"; }, never, ["brn-switch-thumb"], true, never>;
130
+ static ɵcmp: i0.ɵɵComponentDeclaration<BrnSwitch, "brn-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "touched": "touched"; }, never, ["brn-switch-thumb"], true, never>;
136
131
  }