@spartan-ng/brain 0.0.1-alpha.477 → 0.0.1-alpha.479

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-switch.mjs","sources":["../../../../libs/brain/switch/src/lib/brn-switch-thumb.component.ts","../../../../libs/brain/switch/src/lib/brn-switch.component.ts","../../../../libs/brain/switch/src/index.ts","../../../../libs/brain/switch/src/spartan-ng-brain-switch.ts"],"sourcesContent":["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 BrnSwitchThumbComponent {}\n","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 { 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(() => BrnSwitchComponent),\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 BrnSwitchComponent implements AfterContentInit, OnDestroy {\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/**\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}\n\n\tpublic ngAfterContentInit() {\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 { NgModule } from '@angular/core';\n\nimport { BrnSwitchThumbComponent } from './lib/brn-switch-thumb.component';\nimport { BrnSwitchComponent } from './lib/brn-switch.component';\n\nexport * from './lib/brn-switch-thumb.component';\nexport * from './lib/brn-switch.component';\n\nexport const BrnSwitchImports = [BrnSwitchComponent, BrnSwitchThumbComponent] 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":";;;;;;;MAWa,uBAAuB,CAAA;0HAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,iLAPzB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA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switch.component.ts","../../../../libs/brain/switch/src/index.ts","../../../../libs/brain/switch/src/spartan-ng-brain-switch.ts"],"sourcesContent":["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 BrnSwitchThumbComponent {}\n","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 { 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(() => BrnSwitchComponent),\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 BrnSwitchComponent implements AfterContentInit, OnDestroy {\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/**\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}\n\n\tpublic ngAfterContentInit() {\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 { NgModule } from '@angular/core';\n\nimport { BrnSwitchThumbComponent } from './lib/brn-switch-thumb.component';\nimport { BrnSwitchComponent } from './lib/brn-switch.component';\n\nexport * from './lib/brn-switch-thumb.component';\nexport * from './lib/brn-switch.component';\n\nexport const BrnSwitchImports = [BrnSwitchComponent, BrnSwitchThumbComponent] 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":";;;;;;;MAWa,uBAAuB,CAAA;0HAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,iLAPzB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAOA,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBATnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,EAAE;AACZ,oBAAA,IAAI,EAAE;AACL,wBAAA,IA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,2BAA2B,EAAE,gBAAgB;AAC7C,wBAAA,mBAAmB,EAAE,WAAW;AAChC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,qBAAA;oBACD,SAAS,EAAE,CAAC,yBAAyB,CAAC;oBACtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;MCvEY,gBAAgB,GAAG,CAAC,kBAAkB,EAAE,uBAAuB;MAM/D,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,kBAAkB,EAAE,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAA3C,kBAAkB,EAAE,uBAAuB,CAAA,EAAA,CAAA;2HAM/D,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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-tabs.mjs","sources":["../../../../libs/brain/tabs/src/lib/brn-tabs.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-trigger.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-list.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-paginated-list.directive.ts","../../../../libs/brain/tabs/src/index.ts","../../../../libs/brain/tabs/src/spartan-ng-brain-tabs.ts"],"sourcesContent":["import { Directive, input, model, output, signal } from '@angular/core';\nimport { BrnTabsContentDirective } from './brn-tabs-content.directive';\nimport { BrnTabsTriggerDirective } from './brn-tabs-trigger.directive';\n\nexport type BrnTabsOrientation = 'horizontal' | 'vertical';\nexport type BrnTabsDirection = 'ltr' | 'rtl';\nexport type BrnActivationMode = 'automatic' | 'manual';\nexport type TabEntry = { trigger: BrnTabsTriggerDirective; content: BrnTabsContentDirective };\n\n@Directive({\n\tselector: '[brnTabs]',\n\thost: {\n\t\t'[attr.data-orientation]': 'orientation()',\n\t\t'[attr.dir]': 'direction()',\n\t},\n\texportAs: 'brnTabs',\n})\nexport class BrnTabsDirective {\n\tpublic readonly orientation = input<BrnTabsOrientation>('horizontal');\n\t/** internal **/\n\tpublic $orientation = this.orientation;\n\n\tpublic readonly direction = input<BrnTabsDirection>('ltr');\n\t/** internal **/\n\tpublic $direction = this.direction;\n\n\tpublic readonly _activeTab = model<string | undefined>(undefined, { alias: 'brnTabs' });\n\t/** internal **/\n\tpublic $activeTab = this._activeTab.asReadonly();\n\n\tpublic readonly activationMode = input<BrnActivationMode>('automatic');\n\t/** internal **/\n\tpublic $activationMode = this.activationMode;\n\n\tpublic readonly tabActivated = output<string>();\n\n\tprivate readonly _tabs = signal<{ [key: string]: TabEntry }>({});\n\tpublic readonly $tabs = this._tabs.asReadonly();\n\n\tpublic registerTrigger(key: string, trigger: BrnTabsTriggerDirective) {\n\t\tthis.updateEntry(key, { trigger });\n\t}\n\n\tpublic registerContent(key: string, content: BrnTabsContentDirective) {\n\t\tthis.updateEntry(key, { content });\n\t}\n\n\tpublic unregisterTrigger(key: string) {\n\t\tthis.updateEntry(key, { trigger: undefined });\n\t\tif (this._activeTab() === key) {\n\t\t\tthis._activeTab.set(undefined);\n\t\t}\n\t}\n\n\tpublic unregisterContent(key: string): void {\n\t\tthis.updateEntry(key, { content: undefined });\n\t}\n\n\tprivate updateEntry(key: string, patch: Partial<TabEntry>) {\n\t\tthis._tabs.update((tabs) => {\n\t\t\tconst existing = tabs[key] ?? {};\n\t\t\tconst merged = { ...existing, ...patch };\n\t\t\tconst entryEmpty = !merged.trigger && !merged.content;\n\t\t\tif (entryEmpty) {\n\t\t\t\tconst { [key]: removed, ...rest } = tabs;\n\t\t\t\treturn rest;\n\t\t\t}\n\t\t\treturn { ...tabs, [key]: merged };\n\t\t});\n\t}\n\n\temitTabActivated(key: string) {\n\t\tthis.tabActivated.emit(key);\n\t}\n\n\tsetActiveTab(key: string) {\n\t\tthis._activeTab.set(key);\n\t}\n}\n","import { computed, Directive, effect, ElementRef, inject, input, OnDestroy, untracked } from '@angular/core';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: '[brnTabsContent]',\n\thost: {\n\t\trole: 'tabpanel',\n\t\ttabindex: '0',\n\t\t'[id]': 'contentId()',\n\t\t'[attr.aria-labelledby]': 'labelId()',\n\t\t'[hidden]': '_isSelected() === false',\n\t},\n\texportAs: 'brnTabsContent',\n})\nexport class BrnTabsContentDirective implements OnDestroy {\n\tprivate readonly _root = inject(BrnTabsDirective);\n\tprivate readonly _elementRef = inject(ElementRef);\n\n\tpublic readonly contentFor = input.required<string>({ alias: 'brnTabsContent' });\n\tprotected readonly _isSelected = computed(() => this._root.$activeTab() === this.contentFor());\n\tprotected contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);\n\tprotected labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst contentFor = this.contentFor();\n\t\t\tuntracked(() => this._root.registerContent(contentFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterContent(this.contentFor());\n\t}\n}\n","import { Directive, ElementRef, Input, OnDestroy, computed, effect, inject, input, untracked } from '@angular/core';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: 'button[brnTabsTrigger]',\n\thost: {\n\t\t'[id]': 'labelId()',\n\t\ttype: 'button',\n\t\trole: 'tab',\n\t\t'[tabindex]': 'selected() ? \"0\": \"-1\"',\n\t\t'[attr.aria-selected]': 'selected()',\n\t\t'[attr.aria-controls]': 'contentId()',\n\t\t'[attr.data-state]': \"selected() ? 'active' : 'inactive'\",\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-disabled]': \"disabled ? '' : undefined\",\n\t\t'(click)': 'activate()',\n\t},\n\texportAs: 'brnTabsTrigger',\n})\nexport class BrnTabsTriggerDirective implements OnDestroy {\n\tpublic readonly elementRef = inject(ElementRef);\n\n\tprivate readonly _root = inject(BrnTabsDirective);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\n\tpublic readonly triggerFor = input.required<string>({ alias: 'brnTabsTrigger' });\n\tpublic readonly selected = computed(() => this._root.$activeTab() === this.triggerFor());\n\tprotected readonly contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);\n\tprotected readonly labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);\n\n\t// leaving this as an @input to be compatible with the `FocusKeyManager` used in the `BrnTabsListDirective`\n\t@Input()\n\tpublic disabled = false;\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst triggerFor = this.triggerFor();\n\t\t\tuntracked(() => this._root.registerTrigger(triggerFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis.elementRef.nativeElement.focus();\n\t\tif (this._root.$activationMode() === 'automatic') {\n\t\t\tthis.activate();\n\t\t}\n\t}\n\n\tpublic activate() {\n\t\tif (!this.triggerFor()) return;\n\t\tthis._root.setActiveTab(this.triggerFor());\n\t\tthis._root.emitTabActivated(this.triggerFor());\n\t}\n\n\tpublic get key(): string | undefined {\n\t\treturn this.triggerFor();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterTrigger(this.triggerFor());\n\t}\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { type AfterContentInit, Directive, ElementRef, contentChildren, inject } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BrnTabsTriggerDirective } from './brn-tabs-trigger.directive';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: '[brnTabsList]',\n\thost: {\n\t\trole: 'tablist',\n\t\t'[attr.aria-orientation]': '_orientation()',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t},\n\texportAs: 'brnTabsList',\n})\nexport class BrnTabsListDirective implements AfterContentInit {\n\tprivate readonly _root = inject(BrnTabsDirective);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\tprivate readonly _direction = this._root.$direction;\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _keyDownListener = fromEvent(this._elementRef.nativeElement, 'keydown');\n\n\tprivate _keyManager?: FocusKeyManager<BrnTabsTriggerDirective>;\n\n\tpublic triggers = contentChildren(BrnTabsTriggerDirective, { descendants: true });\n\n\tpublic ngAfterContentInit() {\n\t\tthis._keyManager = new FocusKeyManager<BrnTabsTriggerDirective>(this.triggers())\n\t\t\t.withHorizontalOrientation(this._direction())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap();\n\n\t\t// needed because by default the index is set to -1, which means first interaction is skipped\n\t\tthis._keyDownListener.pipe(take(1)).subscribe(() => {\n\t\t\tconst currentTabKey = this._activeTab();\n\t\t\tconst tabs = this._tabs();\n\t\t\tlet activeIndex = 0;\n\t\t\tif (currentTabKey) {\n\t\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\t\tif (currentTab) {\n\t\t\t\t\tactiveIndex = this.triggers().indexOf(currentTab.trigger);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.setActiveItem(activeIndex);\n\t\t});\n\n\t\tthis._keyDownListener.subscribe((event) => {\n\t\t\tif ('key' in event) {\n\t\t\t\tif (this._orientation() === 'horizontal') {\n\t\t\t\t\tif (event.key === 'ArrowUp' || event.key === 'ArrowDown') return;\n\t\t\t\t}\n\t\t\t\tif (this._orientation() === 'vertical') {\n\t\t\t\t\tif (event.key === 'ArrowLeft' || event.key === 'ArrowRight') return;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.onKeydown(event as KeyboardEvent);\n\t\t});\n\t}\n}\n","/**\n * We are building on shoulders of giants here and adapt the implementation provided by the incredible Angular\n * team: https://github.com/angular/components/blob/main/src/material/tabs/paginated-tab-header.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { FocusKeyManager, type FocusableOption } from '@angular/cdk/a11y';\nimport { type Direction, Directionality } from '@angular/cdk/bidi';\nimport { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport {\n\tANIMATION_MODULE_TYPE,\n\ttype AfterContentChecked,\n\ttype AfterContentInit,\n\ttype AfterViewInit,\n\tChangeDetectorRef,\n\tDirective,\n\tElementRef,\n\tInjector,\n\tNgZone,\n\ttype OnDestroy,\n\tSignal,\n\tafterNextRender,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { EMPTY, Observable, type Observer, Subject, fromEvent, merge, of as observableOf, timer } from 'rxjs';\nimport { debounceTime, filter, skip, startWith, switchMap, takeUntil } from 'rxjs/operators';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n/** Config used to bind passive event listeners */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({\n\tpassive: true,\n}) as EventListenerOptions;\n\n/**\n * The directions that scrolling can go in when the header's tabs exceed the header width. 'After'\n * will scroll the header towards the end of the tabs list and 'before' will scroll towards the\n * beginning of the list.\n */\nexport type ScrollDirection = 'after' | 'before';\n\n/**\n * Amount of milliseconds to wait before starting to scroll the header automatically.\n * Set a little conservatively in order to handle fake events dispatched on touch devices.\n */\nconst HEADER_SCROLL_DELAY = 650;\n\n/**\n * Interval in milliseconds at which to scroll the header\n * while the user is holding their pointer.\n */\nconst HEADER_SCROLL_INTERVAL = 100;\n\n/** Item inside a paginated tab header. */\nexport type BrnPaginatedTabHeaderItem = FocusableOption & { elementRef: ElementRef };\n\n/**\n * Base class for a tab header that supported pagination.\n * @docs-private\n */\n@Directive()\nexport abstract class BrnTabsPaginatedListDirective\n\timplements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy\n{\n\tpublic abstract _items: Signal<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract _itemsChanges: Observable<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract _tabListContainer: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _tabList: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _tabListInner: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _nextPaginator: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _previousPaginator: Signal<ElementRef<HTMLElement>>;\n\n\t/** The distance in pixels that the tab labels should be translated to the left. */\n\tprivate _scrollDistance = 0;\n\n\t/** Whether the header should scroll to the selected index after the view has been checked. */\n\tprivate _selectedIndexChanged = false;\n\n\tprivate readonly _root = inject(BrnTabsDirective);\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\n\t/** Emits when the component is destroyed. */\n\tprotected readonly _destroyed = new Subject<void>();\n\n\t/** Whether the controls for pagination should be displayed */\n\tpublic _showPaginationControls = signal(false);\n\n\t/** Whether the tab list can be scrolled more towards the end of the tab label list. */\n\tpublic _disableScrollAfter = true;\n\n\t/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */\n\tpublic _disableScrollBefore = true;\n\n\t/**\n\t * The number of tab labels that are displayed on the header. When this changes, the header\n\t * should re-evaluate the scroll position.\n\t */\n\tprivate _tabLabelCount!: number;\n\n\t/** Whether the scroll distance has changed and should be applied after the view is checked. */\n\tprivate _scrollDistanceChanged!: boolean;\n\n\t/** Used to manage focus between the tabs. */\n\tprivate _keyManager!: FocusKeyManager<BrnPaginatedTabHeaderItem>;\n\n\t/** Cached text content of the header. */\n\tprivate _currentTextContent!: string;\n\n\t/** Stream that will stop the automated scrolling. */\n\tprivate readonly _stopScrolling = new Subject<void>();\n\n\t/**\n\t * Whether pagination should be disabled. This can be used to avoid unnecessary\n\t * layout recalculations if it's known that pagination won't be required.\n\t */\n\tpublic disablePagination = input(false, { transform: booleanAttribute });\n\n\t/** The index of the active tab. */\n\tprivate readonly _selectedIndex = computed(() => {\n\t\tconst currentTabKey = this._activeTab();\n\t\tconst tabs = this._tabs();\n\n\t\tlet activeIndex = 0;\n\t\tif (currentTabKey && this._items()) {\n\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\tif (currentTab) {\n\t\t\t\tactiveIndex = this._items().indexOf(currentTab.trigger);\n\t\t\t}\n\t\t}\n\n\t\treturn activeIndex;\n\t});\n\n\t/** Event emitted when the option is selected. */\n\tpublic readonly selectFocusedIndex = output<number>();\n\n\t/** Event emitted when a label is focused. */\n\tpublic readonly indexFocused = output<number>();\n\n\tprivate readonly _sharedResizeObserver = inject(SharedResizeObserver);\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprotected _elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n\tprotected _changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\tprivate readonly _viewportRuler: ViewportRuler = inject(ViewportRuler);\n\tprivate readonly _dir = inject(Directionality, { optional: true });\n\tprivate readonly _ngZone: NgZone = inject(NgZone);\n\tprivate readonly _platform: Platform = inject(Platform);\n\tpublic _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n\tconstructor() {\n\t\t// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tfromEvent(this._elementRef.nativeElement, 'mouseleave')\n\t\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t\t.subscribe(() => {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst selectedIndex = this._selectedIndex();\n\n\t\t\tif (selectedIndex !== 0) {\n\t\t\t\tthis._selectedIndexChanged = true;\n\t\t\t\tif (this._keyManager) {\n\t\t\t\t\tthis._keyManager.updateActiveItem(selectedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Called when the user has selected an item via the keyboard. */\n\tprotected abstract _itemSelected(event: KeyboardEvent): void;\n\n\tngAfterViewInit() {\n\t\t// We need to handle these events manually, because we want to bind passive event listeners.\n\t\tfromEvent(this._previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('before');\n\t\t\t});\n\n\t\tfromEvent(this._nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('after');\n\t\t\t});\n\t}\n\n\tngAfterContentInit() {\n\t\tconst dirChange = this._dir ? this._dir.change : observableOf('ltr');\n\t\t// We need to debounce resize events because the alignment logic is expensive.\n\t\t// If someone animates the width of tabs, we don't want to realign on every animation frame.\n\t\t// Once we haven't seen any more resize events in the last 32ms (~2 animaion frames) we can\n\t\t// re-align.\n\t\tconst resize = this._sharedResizeObserver\n\t\t\t.observe(this._elementRef.nativeElement)\n\t\t\t.pipe(debounceTime(32), takeUntil(this._destroyed));\n\t\t// Note: We do not actually need to watch these events for proper functioning of the tabs,\n\t\t// the resize events above should capture any viewport resize that we care about. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tconst viewportResize = this._viewportRuler.change(150).pipe(takeUntil(this._destroyed));\n\n\t\tconst realign = () => {\n\t\t\tthis.updatePagination();\n\t\t};\n\n\t\tthis._keyManager = new FocusKeyManager<BrnPaginatedTabHeaderItem>(this._items())\n\t\t\t.withHorizontalOrientation(this._getLayoutDirection())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t// Allow focus to land on disabled tabs, as per https://w3c.github.io/aria-practices/#kbd_disabled_controls\n\t\t\t.skipPredicate(() => false);\n\n\t\tthis._keyManager.updateActiveItem(this._selectedIndex());\n\n\t\t// Note: We do not need to realign after the first render for proper functioning of the tabs\n\t\t// the resize events above should fire when we first start observing the element. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tafterNextRender(realign, { injector: this._injector });\n\n\t\t// On dir change or resize, realign the ink bar and update the orientation of\n\t\t// the key manager if the direction has changed.\n\t\tmerge(dirChange, viewportResize, resize, this._itemsChanges, this._itemsResized())\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\t// We need to defer this to give the browser some time to recalculate\n\t\t\t\t// the element dimensions. The call has to be wrapped in `NgZone.run`,\n\t\t\t\t// because the viewport change handler runs outside of Angular.\n\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\t// Clamp the scroll distance, because it can change with the number of tabs.\n\t\t\t\t\t\tthis._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), this._scrollDistance));\n\t\t\t\t\t\trealign();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tthis._keyManager.withHorizontalOrientation(this._getLayoutDirection());\n\t\t\t});\n\n\t\t// If there is a change in the focus key manager we need to emit the `indexFocused`\n\t\t// event in order to provide a public event that notifies about focus changes. Also we realign\n\t\t// the tabs container by scrolling the new focused tab into the visible section.\n\t\tthis._keyManager.change.subscribe((newFocusIndex) => {\n\t\t\tthis.indexFocused.emit(newFocusIndex);\n\t\t\tthis._setTabFocus(newFocusIndex);\n\t\t});\n\t}\n\n\t/** Sends any changes that could affect the layout of the items. */\n\tprivate _itemsResized(): Observable<ResizeObserverEntry[]> {\n\t\tif (typeof ResizeObserver !== 'function') {\n\t\t\treturn EMPTY;\n\t\t}\n\n\t\treturn this._itemsChanges.pipe(\n\t\t\tstartWith(this._items()),\n\t\t\tswitchMap(\n\t\t\t\t(tabItems: ReadonlyArray<BrnPaginatedTabHeaderItem>) =>\n\t\t\t\t\tnew Observable((observer: Observer<ResizeObserverEntry[]>) =>\n\t\t\t\t\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\t\t\t\t\tconst resizeObserver = new ResizeObserver((entries) => observer.next(entries));\n\t\t\t\t\t\t\tfor (const tabItem of tabItems) {\n\t\t\t\t\t\t\t\tresizeObserver.observe(tabItem.elementRef.nativeElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t// Skip the first emit since the resize observer emits when an item\n\t\t\t// is observed for new items when the tab is already inserted\n\t\t\tskip(1),\n\t\t\t// Skip emissions where all the elements are invisible since we don't want\n\t\t\t// the header to try and re-render with invalid measurements. See #25574.\n\t\t\tfilter((entries) => entries.some((e) => e.contentRect.width > 0 && e.contentRect.height > 0)),\n\t\t);\n\t}\n\n\tngAfterContentChecked(): void {\n\t\t// If the number of tab labels have changed, check if scrolling should be enabled\n\t\tif (this._tabLabelCount !== this._items().length) {\n\t\t\tthis.updatePagination();\n\t\t\tthis._tabLabelCount = this._items().length;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the selected index has changed, scroll to the label and check if the scrolling controls\n\t\t// should be disabled.\n\t\tif (this._selectedIndexChanged) {\n\t\t\tthis._scrollToLabel(this._selectedIndex());\n\t\t\tthis._checkScrollingControls();\n\t\t\tthis._selectedIndexChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the scroll distance has been changed (tab selected, focused, scroll controls activated),\n\t\t// then translate the header to reflect this.\n\t\tif (this._scrollDistanceChanged) {\n\t\t\tthis._updateTabScrollPosition();\n\t\t\tthis._scrollDistanceChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis._keyManager?.destroy();\n\t\tthis._destroyed.next();\n\t\tthis._destroyed.complete();\n\t\tthis._stopScrolling.complete();\n\t}\n\n\t/** Handles keyboard events on the header. */\n\t_handleKeydown(event: KeyboardEvent) {\n\t\t// We don't handle any key bindings with a modifier key.\n\t\tif (hasModifierKey(event)) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase ENTER:\n\t\t\tcase SPACE:\n\t\t\t\tif (this.focusIndex !== this._selectedIndex()) {\n\t\t\t\t\tconst item = this._items()[this.focusIndex];\n\n\t\t\t\t\tif (item && !item.disabled) {\n\t\t\t\t\t\tthis.selectFocusedIndex.emit(this.focusIndex);\n\t\t\t\t\t\tthis._itemSelected(event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis._keyManager.onKeydown(event);\n\t\t}\n\t}\n\n\t/**\n\t * Callback for when the MutationObserver detects that the content has changed.\n\t */\n\t_onContentChanges() {\n\t\tconst textContent = this._elementRef.nativeElement.textContent;\n\n\t\t// We need to diff the text content of the header, because the MutationObserver callback\n\t\t// will fire even if the text content didn't change which is inefficient and is prone\n\t\t// to infinite loops if a poorly constructed expression is passed in (see #14249).\n\t\tif (textContent !== this._currentTextContent) {\n\t\t\tthis._currentTextContent = textContent || '';\n\n\t\t\t// The content observer runs outside the `NgZone` by default, which\n\t\t\t// means that we need to bring the callback back in ourselves.\n\t\t\tthis._ngZone.run(() => {\n\t\t\t\tthis.updatePagination();\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the view whether pagination should be enabled or not.\n\t *\n\t * WARNING: Calling this method can be very costly in terms of performance. It should be called\n\t * as infrequently as possible from outside of the Tabs component as it causes a reflow of the\n\t * page.\n\t */\n\tupdatePagination() {\n\t\tthis._checkPaginationEnabled();\n\t\tthis._checkScrollingControls();\n\t\tthis._updateTabScrollPosition();\n\t}\n\n\t/** Tracks which element has focus; used for keyboard navigation */\n\tpublic get focusIndex(): number {\n\t\treturn this._keyManager ? (this._keyManager.activeItemIndex ?? 0) : 0;\n\t}\n\n\t/** When the focus index is set, we must manually send focus to the correct label */\n\tpublic set focusIndex(value: number) {\n\t\tif (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._keyManager.setActiveItem(value);\n\t}\n\n\t/**\n\t * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is\n\t * providing a valid index and return true.\n\t */\n\t_isValidIndex(index: number): boolean {\n\t\treturn this._items() ? !!this._items()[index] : true;\n\t}\n\n\t/**\n\t * Sets focus on the HTML element for the label wrapper and scrolls it into the view if\n\t * scrolling is enabled.\n\t */\n\t_setTabFocus(tabIndex: number) {\n\t\tif (this._showPaginationControls()) {\n\t\t\tthis._scrollToLabel(tabIndex);\n\t\t}\n\n\t\tif (this._items()?.length) {\n\t\t\tthis._items()[tabIndex].focus();\n\n\t\t\t// Do not let the browser manage scrolling to focus the element, this will be handled\n\t\t\t// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n\t\t\t// should be the full width minus the offset width.\n\t\t\tconst containerEl = this._tabListContainer().nativeElement;\n\t\t\tconst dir = this._getLayoutDirection();\n\n\t\t\tif (dir === 'ltr') {\n\t\t\t\tcontainerEl.scrollLeft = 0;\n\t\t\t} else {\n\t\t\t\tcontainerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The layout direction of the containing app. */\n\t_getLayoutDirection(): Direction {\n\t\treturn this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\t/** Performs the CSS transformation on the tab list that will cause the list to scroll. */\n\t_updateTabScrollPosition() {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollDistance = this.scrollDistance;\n\t\tconst translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;\n\n\t\t// Don't use `translate3d` here because we don't want to create a new layer. A new layer\n\t\t// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar\n\t\t// and ripples will exceed the boundaries of the visible tab bar.\n\t\t// See: https://github.com/angular/components/issues/10276\n\t\t// We round the `transform` here, because transforms with sub-pixel precision cause some\n\t\t// browsers to blur the content of the element.\n\t\tthis._tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;\n\n\t\t// Setting the `transform` on IE will change the scroll offset of the parent, causing the\n\t\t// position to be thrown off in some cases. We have to reset it ourselves to ensure that\n\t\t// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing\n\t\t// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).\n\t\tif (this._platform.TRIDENT || this._platform.EDGE) {\n\t\t\tthis._tabListContainer().nativeElement.scrollLeft = 0;\n\t\t}\n\t}\n\n\t/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */\n\tpublic get scrollDistance(): number {\n\t\treturn this._scrollDistance;\n\t}\n\tpublic set scrollDistance(value: number) {\n\t\tthis._scrollTo(value);\n\t}\n\n\t/**\n\t * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or\n\t * the end of the list, respectively). The distance to scroll is computed to be a third of the\n\t * length of the tab list view window.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollHeader(direction: ScrollDirection) {\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\n\t\t// Move the scroll distance one-third the length of the tab list's viewport.\n\t\tconst scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;\n\n\t\treturn this._scrollTo(this._scrollDistance + scrollAmount);\n\t}\n\n\t/** Handles click events on the pagination arrows. */\n\t_handlePaginatorClick(direction: ScrollDirection) {\n\t\tthis._stopInterval();\n\t\tthis._scrollHeader(direction);\n\t}\n\n\t/**\n\t * Moves the tab list such that the desired tab label (marked by index) is moved into view.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollToLabel(labelIndex: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selectedLabel = this._items() ? this._items()[labelIndex] : null;\n\n\t\tif (!selectedLabel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The view length is the visible width of the tab labels.\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\t\tconst { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;\n\n\t\tlet labelBeforePos: number;\n\t\tlet labelAfterPos: number;\n\t\tif (this._getLayoutDirection() === 'ltr') {\n\t\t\tlabelBeforePos = offsetLeft;\n\t\t\tlabelAfterPos = labelBeforePos + offsetWidth;\n\t\t} else {\n\t\t\tlabelAfterPos = this._tabListInner().nativeElement.offsetWidth - offsetLeft;\n\t\t\tlabelBeforePos = labelAfterPos - offsetWidth;\n\t\t}\n\n\t\tconst beforeVisiblePos = this.scrollDistance;\n\t\tconst afterVisiblePos = this.scrollDistance + viewLength;\n\n\t\tif (labelBeforePos < beforeVisiblePos) {\n\t\t\t// Scroll header to move label to the before direction\n\t\t\tthis.scrollDistance -= beforeVisiblePos - labelBeforePos;\n\t\t} else if (labelAfterPos > afterVisiblePos) {\n\t\t\t// Scroll header to move label to the after direction\n\t\t\tthis.scrollDistance += Math.min(labelAfterPos - afterVisiblePos, labelBeforePos - beforeVisiblePos);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the pagination controls should be displayed. If the scroll width of the\n\t * tab list is wider than the size of the header container, then the pagination controls should\n\t * be shown.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkPaginationEnabled() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis._showPaginationControls.set(false);\n\t\t} else {\n\t\t\tconst isEnabled = this._tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;\n\n\t\t\tif (!isEnabled) {\n\t\t\t\tthis.scrollDistance = 0;\n\t\t\t}\n\n\t\t\tif (isEnabled !== this._showPaginationControls()) {\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t}\n\n\t\t\tthis._showPaginationControls.set(isEnabled);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the before and after controls should be enabled or disabled.\n\t * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the\n\t * before button. If the header is at the end of the list (scroll distance is equal to the\n\t * maximum distance we can scroll), then disable the after button.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkScrollingControls() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis._disableScrollAfter = this._disableScrollBefore = true;\n\t\t} else {\n\t\t\t// Check if the pagination arrows should be activated.\n\t\t\tthis._disableScrollBefore = this.scrollDistance === 0;\n\t\t\tthis._disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\t/**\n\t * Determines what is the maximum length in pixels that can be set for the scroll distance. This\n\t * is equal to the difference in width between the tab list container and tab header container.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_getMaxScrollDistance(): number {\n\t\tconst lengthOfTabList = this._tabListInner().nativeElement.scrollWidth;\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\t\treturn lengthOfTabList - viewLength || 0;\n\t}\n\n\t/** Stops the currently-running paginator interval. */\n\t_stopInterval() {\n\t\tthis._stopScrolling.next();\n\t}\n\n\t/**\n\t * Handles the user pressing down on one of the paginators.\n\t * Starts scrolling the header after a certain amount of time.\n\t * @param direction In which direction the paginator should be scrolled.\n\t */\n\t_handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent) {\n\t\t// Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to\n\t\t// null check the `button`, but we do it so we don't break tests that use fake events.\n\t\tif (mouseEvent && mouseEvent.button !== null && mouseEvent.button !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Avoid overlapping timers.\n\t\tthis._stopInterval();\n\n\t\t// Start a timer after the delay and keep firing based on the interval.\n\t\ttimer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)\n\t\t\t// Keep the timer going until something tells it to stop or the component is destroyed.\n\t\t\t.pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))\n\t\t\t.subscribe(() => {\n\t\t\t\tconst { maxScrollDistance, distance } = this._scrollHeader(direction);\n\n\t\t\t\t// Stop the timer if we've reached the start or the end.\n\t\t\t\tif (distance === 0 || distance >= maxScrollDistance) {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Scrolls the header to a given position.\n\t * @param position Position to which to scroll.\n\t * @returns Information on the current scroll distance and the maximum.\n\t */\n\tprivate _scrollTo(position: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn { maxScrollDistance: 0, distance: 0 };\n\t\t}\n\n\t\tconst maxScrollDistance = this._getMaxScrollDistance();\n\t\tthis._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));\n\n\t\t// Mark that the scroll distance has changed so that after the view is checked, the CSS\n\t\t// transformation can move the header.\n\t\tthis._scrollDistanceChanged = true;\n\t\tthis._checkScrollingControls();\n\n\t\treturn { maxScrollDistance, distance: this._scrollDistance };\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnTabsContentDirective } from './lib/brn-tabs-content.directive';\nimport { BrnTabsListDirective } from './lib/brn-tabs-list.directive';\nimport { BrnTabsTriggerDirective } from './lib/brn-tabs-trigger.directive';\nimport { BrnTabsDirective } from './lib/brn-tabs.directive';\n\nexport * from './lib/brn-tabs-content.directive';\nexport * from './lib/brn-tabs-list.directive';\nexport * from './lib/brn-tabs-paginated-list.directive';\nexport * from './lib/brn-tabs-trigger.directive';\nexport * from './lib/brn-tabs.directive';\n\nexport const BrnTabsImports = [\n\tBrnTabsDirective,\n\tBrnTabsListDirective,\n\tBrnTabsTriggerDirective,\n\tBrnTabsContentDirective,\n] as const;\n\n@NgModule({\n\timports: [...BrnTabsImports],\n\texports: [...BrnTabsImports],\n})\nexport class BrnTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;MAiBa,gBAAgB,CAAA;AACZ,IAAA,WAAW,GAAG,KAAK,CAAqB,YAAY,CAAC;;AAE9D,IAAA,YAAY,GAAG,IAAI,CAAC,WAAW;AAEtB,IAAA,SAAS,GAAG,KAAK,CAAmB,KAAK,CAAC;;AAEnD,IAAA,UAAU,GAAG,IAAI,CAAC,SAAS;IAElB,UAAU,GAAG,KAAK,CAAqB,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;;AAEhF,IAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;AAEhC,IAAA,cAAc,GAAG,KAAK,CAAoB,WAAW,CAAC;;AAE/D,IAAA,eAAe,GAAG,IAAI,CAAC,cAAc;IAE5B,YAAY,GAAG,MAAM,EAAU;AAE9B,IAAA,KAAK,GAAG,MAAM,CAA8B,EAAE,CAAC;AAChD,IAAA,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;IAExC,eAAe,CAAC,GAAW,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EAAA,UAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADlD;;;AC/DY,MAAA,cAAc,GAAG;IAC7B,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;;MAOX,aAAa,CAAA;0HAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAb,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAVzB,gBAAgB;YAChB,oBAAoB;YACpB,uBAAuB;AACvB,YAAA,uBAAuB,aAHvB,gBAAgB;YAChB,oBAAoB;YACpB,uBAAuB;YACvB,uBAAuB,CAAA,EAAA,CAAA;2HAOX,aAAa,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;AAC5B,iBAAA;;;ACvBD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-tabs.mjs","sources":["../../../../libs/brain/tabs/src/lib/brn-tabs.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-trigger.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-list.directive.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-paginated-list.directive.ts","../../../../libs/brain/tabs/src/index.ts","../../../../libs/brain/tabs/src/spartan-ng-brain-tabs.ts"],"sourcesContent":["import { Directive, input, model, output, signal } from '@angular/core';\nimport { BrnTabsContentDirective } from './brn-tabs-content.directive';\nimport { BrnTabsTriggerDirective } from './brn-tabs-trigger.directive';\n\nexport type BrnTabsOrientation = 'horizontal' | 'vertical';\nexport type BrnTabsDirection = 'ltr' | 'rtl';\nexport type BrnActivationMode = 'automatic' | 'manual';\nexport type TabEntry = { trigger: BrnTabsTriggerDirective; content: BrnTabsContentDirective };\n\n@Directive({\n\tselector: '[brnTabs]',\n\thost: {\n\t\t'[attr.data-orientation]': 'orientation()',\n\t\t'[attr.dir]': 'direction()',\n\t},\n\texportAs: 'brnTabs',\n})\nexport class BrnTabsDirective {\n\tpublic readonly orientation = input<BrnTabsOrientation>('horizontal');\n\t/** internal **/\n\tpublic $orientation = this.orientation;\n\n\tpublic readonly direction = input<BrnTabsDirection>('ltr');\n\t/** internal **/\n\tpublic $direction = this.direction;\n\n\tpublic readonly _activeTab = model<string | undefined>(undefined, { alias: 'brnTabs' });\n\t/** internal **/\n\tpublic $activeTab = this._activeTab.asReadonly();\n\n\tpublic readonly activationMode = input<BrnActivationMode>('automatic');\n\t/** internal **/\n\tpublic $activationMode = this.activationMode;\n\n\tpublic readonly tabActivated = output<string>();\n\n\tprivate readonly _tabs = signal<{ [key: string]: TabEntry }>({});\n\tpublic readonly $tabs = this._tabs.asReadonly();\n\n\tpublic registerTrigger(key: string, trigger: BrnTabsTriggerDirective) {\n\t\tthis.updateEntry(key, { trigger });\n\t}\n\n\tpublic registerContent(key: string, content: BrnTabsContentDirective) {\n\t\tthis.updateEntry(key, { content });\n\t}\n\n\tpublic unregisterTrigger(key: string) {\n\t\tthis.updateEntry(key, { trigger: undefined });\n\t\tif (this._activeTab() === key) {\n\t\t\tthis._activeTab.set(undefined);\n\t\t}\n\t}\n\n\tpublic unregisterContent(key: string): void {\n\t\tthis.updateEntry(key, { content: undefined });\n\t}\n\n\tprivate updateEntry(key: string, patch: Partial<TabEntry>) {\n\t\tthis._tabs.update((tabs) => {\n\t\t\tconst existing = tabs[key] ?? {};\n\t\t\tconst merged = { ...existing, ...patch };\n\t\t\tconst entryEmpty = !merged.trigger && !merged.content;\n\t\t\tif (entryEmpty) {\n\t\t\t\tconst { [key]: removed, ...rest } = tabs;\n\t\t\t\treturn rest;\n\t\t\t}\n\t\t\treturn { ...tabs, [key]: merged };\n\t\t});\n\t}\n\n\temitTabActivated(key: string) {\n\t\tthis.tabActivated.emit(key);\n\t}\n\n\tsetActiveTab(key: string) {\n\t\tthis._activeTab.set(key);\n\t}\n}\n","import { computed, Directive, effect, ElementRef, inject, input, OnDestroy, untracked } from '@angular/core';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: '[brnTabsContent]',\n\thost: {\n\t\trole: 'tabpanel',\n\t\ttabindex: '0',\n\t\t'[id]': 'contentId()',\n\t\t'[attr.aria-labelledby]': 'labelId()',\n\t\t'[hidden]': '_isSelected() === false',\n\t},\n\texportAs: 'brnTabsContent',\n})\nexport class BrnTabsContentDirective implements OnDestroy {\n\tprivate readonly _root = inject(BrnTabsDirective);\n\tprivate readonly _elementRef = inject(ElementRef);\n\n\tpublic readonly contentFor = input.required<string>({ alias: 'brnTabsContent' });\n\tprotected readonly _isSelected = computed(() => this._root.$activeTab() === this.contentFor());\n\tprotected contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);\n\tprotected labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst contentFor = this.contentFor();\n\t\t\tuntracked(() => this._root.registerContent(contentFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterContent(this.contentFor());\n\t}\n}\n","import { Directive, ElementRef, Input, OnDestroy, computed, effect, inject, input, untracked } from '@angular/core';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: 'button[brnTabsTrigger]',\n\thost: {\n\t\t'[id]': 'labelId()',\n\t\ttype: 'button',\n\t\trole: 'tab',\n\t\t'[tabindex]': 'selected() ? \"0\": \"-1\"',\n\t\t'[attr.aria-selected]': 'selected()',\n\t\t'[attr.aria-controls]': 'contentId()',\n\t\t'[attr.data-state]': \"selected() ? 'active' : 'inactive'\",\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-disabled]': \"disabled ? '' : undefined\",\n\t\t'(click)': 'activate()',\n\t},\n\texportAs: 'brnTabsTrigger',\n})\nexport class BrnTabsTriggerDirective implements OnDestroy {\n\tpublic readonly elementRef = inject(ElementRef);\n\n\tprivate readonly _root = inject(BrnTabsDirective);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\n\tpublic readonly triggerFor = input.required<string>({ alias: 'brnTabsTrigger' });\n\tpublic readonly selected = computed(() => this._root.$activeTab() === this.triggerFor());\n\tprotected readonly contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);\n\tprotected readonly labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);\n\n\t// leaving this as an @input to be compatible with the `FocusKeyManager` used in the `BrnTabsListDirective`\n\t@Input()\n\tpublic disabled = false;\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst triggerFor = this.triggerFor();\n\t\t\tuntracked(() => this._root.registerTrigger(triggerFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis.elementRef.nativeElement.focus();\n\t\tif (this._root.$activationMode() === 'automatic') {\n\t\t\tthis.activate();\n\t\t}\n\t}\n\n\tpublic activate() {\n\t\tif (!this.triggerFor()) return;\n\t\tthis._root.setActiveTab(this.triggerFor());\n\t\tthis._root.emitTabActivated(this.triggerFor());\n\t}\n\n\tpublic get key(): string | undefined {\n\t\treturn this.triggerFor();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterTrigger(this.triggerFor());\n\t}\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { type AfterContentInit, Directive, ElementRef, contentChildren, inject } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BrnTabsTriggerDirective } from './brn-tabs-trigger.directive';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n@Directive({\n\tselector: '[brnTabsList]',\n\thost: {\n\t\trole: 'tablist',\n\t\t'[attr.aria-orientation]': '_orientation()',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t},\n\texportAs: 'brnTabsList',\n})\nexport class BrnTabsListDirective implements AfterContentInit {\n\tprivate readonly _root = inject(BrnTabsDirective);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\tprivate readonly _direction = this._root.$direction;\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _keyDownListener = fromEvent(this._elementRef.nativeElement, 'keydown');\n\n\tprivate _keyManager?: FocusKeyManager<BrnTabsTriggerDirective>;\n\n\tpublic triggers = contentChildren(BrnTabsTriggerDirective, { descendants: true });\n\n\tpublic ngAfterContentInit() {\n\t\tthis._keyManager = new FocusKeyManager<BrnTabsTriggerDirective>(this.triggers())\n\t\t\t.withHorizontalOrientation(this._direction())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap();\n\n\t\t// needed because by default the index is set to -1, which means first interaction is skipped\n\t\tthis._keyDownListener.pipe(take(1)).subscribe(() => {\n\t\t\tconst currentTabKey = this._activeTab();\n\t\t\tconst tabs = this._tabs();\n\t\t\tlet activeIndex = 0;\n\t\t\tif (currentTabKey) {\n\t\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\t\tif (currentTab) {\n\t\t\t\t\tactiveIndex = this.triggers().indexOf(currentTab.trigger);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.setActiveItem(activeIndex);\n\t\t});\n\n\t\tthis._keyDownListener.subscribe((event) => {\n\t\t\tif ('key' in event) {\n\t\t\t\tif (this._orientation() === 'horizontal') {\n\t\t\t\t\tif (event.key === 'ArrowUp' || event.key === 'ArrowDown') return;\n\t\t\t\t}\n\t\t\t\tif (this._orientation() === 'vertical') {\n\t\t\t\t\tif (event.key === 'ArrowLeft' || event.key === 'ArrowRight') return;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.onKeydown(event as KeyboardEvent);\n\t\t});\n\t}\n}\n","/**\n * We are building on shoulders of giants here and adapt the implementation provided by the incredible Angular\n * team: https://github.com/angular/components/blob/main/src/material/tabs/paginated-tab-header.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { FocusKeyManager, type FocusableOption } from '@angular/cdk/a11y';\nimport { type Direction, Directionality } from '@angular/cdk/bidi';\nimport { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport {\n\tANIMATION_MODULE_TYPE,\n\ttype AfterContentChecked,\n\ttype AfterContentInit,\n\ttype AfterViewInit,\n\tChangeDetectorRef,\n\tDirective,\n\tElementRef,\n\tInjector,\n\tNgZone,\n\ttype OnDestroy,\n\tSignal,\n\tafterNextRender,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { EMPTY, Observable, type Observer, Subject, fromEvent, merge, of as observableOf, timer } from 'rxjs';\nimport { debounceTime, filter, skip, startWith, switchMap, takeUntil } from 'rxjs/operators';\nimport { BrnTabsDirective } from './brn-tabs.directive';\n\n/** Config used to bind passive event listeners */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({\n\tpassive: true,\n}) as EventListenerOptions;\n\n/**\n * The directions that scrolling can go in when the header's tabs exceed the header width. 'After'\n * will scroll the header towards the end of the tabs list and 'before' will scroll towards the\n * beginning of the list.\n */\nexport type ScrollDirection = 'after' | 'before';\n\n/**\n * Amount of milliseconds to wait before starting to scroll the header automatically.\n * Set a little conservatively in order to handle fake events dispatched on touch devices.\n */\nconst HEADER_SCROLL_DELAY = 650;\n\n/**\n * Interval in milliseconds at which to scroll the header\n * while the user is holding their pointer.\n */\nconst HEADER_SCROLL_INTERVAL = 100;\n\n/** Item inside a paginated tab header. */\nexport type BrnPaginatedTabHeaderItem = FocusableOption & { elementRef: ElementRef };\n\n/**\n * Base class for a tab header that supported pagination.\n * @docs-private\n */\n@Directive()\nexport abstract class BrnTabsPaginatedListDirective\n\timplements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy\n{\n\tpublic abstract _items: Signal<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract _itemsChanges: Observable<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract _tabListContainer: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _tabList: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _tabListInner: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _nextPaginator: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract _previousPaginator: Signal<ElementRef<HTMLElement>>;\n\n\t/** The distance in pixels that the tab labels should be translated to the left. */\n\tprivate _scrollDistance = 0;\n\n\t/** Whether the header should scroll to the selected index after the view has been checked. */\n\tprivate _selectedIndexChanged = false;\n\n\tprivate readonly _root = inject(BrnTabsDirective);\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\n\t/** Emits when the component is destroyed. */\n\tprotected readonly _destroyed = new Subject<void>();\n\n\t/** Whether the controls for pagination should be displayed */\n\tpublic _showPaginationControls = signal(false);\n\n\t/** Whether the tab list can be scrolled more towards the end of the tab label list. */\n\tpublic _disableScrollAfter = true;\n\n\t/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */\n\tpublic _disableScrollBefore = true;\n\n\t/**\n\t * The number of tab labels that are displayed on the header. When this changes, the header\n\t * should re-evaluate the scroll position.\n\t */\n\tprivate _tabLabelCount!: number;\n\n\t/** Whether the scroll distance has changed and should be applied after the view is checked. */\n\tprivate _scrollDistanceChanged!: boolean;\n\n\t/** Used to manage focus between the tabs. */\n\tprivate _keyManager!: FocusKeyManager<BrnPaginatedTabHeaderItem>;\n\n\t/** Cached text content of the header. */\n\tprivate _currentTextContent!: string;\n\n\t/** Stream that will stop the automated scrolling. */\n\tprivate readonly _stopScrolling = new Subject<void>();\n\n\t/**\n\t * Whether pagination should be disabled. This can be used to avoid unnecessary\n\t * layout recalculations if it's known that pagination won't be required.\n\t */\n\tpublic disablePagination = input(false, { transform: booleanAttribute });\n\n\t/** The index of the active tab. */\n\tprivate readonly _selectedIndex = computed(() => {\n\t\tconst currentTabKey = this._activeTab();\n\t\tconst tabs = this._tabs();\n\n\t\tlet activeIndex = 0;\n\t\tif (currentTabKey && this._items()) {\n\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\tif (currentTab) {\n\t\t\t\tactiveIndex = this._items().indexOf(currentTab.trigger);\n\t\t\t}\n\t\t}\n\n\t\treturn activeIndex;\n\t});\n\n\t/** Event emitted when the option is selected. */\n\tpublic readonly selectFocusedIndex = output<number>();\n\n\t/** Event emitted when a label is focused. */\n\tpublic readonly indexFocused = output<number>();\n\n\tprivate readonly _sharedResizeObserver = inject(SharedResizeObserver);\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprotected _elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n\tprotected _changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\tprivate readonly _viewportRuler: ViewportRuler = inject(ViewportRuler);\n\tprivate readonly _dir = inject(Directionality, { optional: true });\n\tprivate readonly _ngZone: NgZone = inject(NgZone);\n\tprivate readonly _platform: Platform = inject(Platform);\n\tpublic _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n\tconstructor() {\n\t\t// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tfromEvent(this._elementRef.nativeElement, 'mouseleave')\n\t\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t\t.subscribe(() => {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst selectedIndex = this._selectedIndex();\n\n\t\t\tif (selectedIndex !== 0) {\n\t\t\t\tthis._selectedIndexChanged = true;\n\t\t\t\tif (this._keyManager) {\n\t\t\t\t\tthis._keyManager.updateActiveItem(selectedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Called when the user has selected an item via the keyboard. */\n\tprotected abstract _itemSelected(event: KeyboardEvent): void;\n\n\tngAfterViewInit() {\n\t\t// We need to handle these events manually, because we want to bind passive event listeners.\n\t\tfromEvent(this._previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('before');\n\t\t\t});\n\n\t\tfromEvent(this._nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('after');\n\t\t\t});\n\t}\n\n\tngAfterContentInit() {\n\t\tconst dirChange = this._dir ? this._dir.change : observableOf('ltr');\n\t\t// We need to debounce resize events because the alignment logic is expensive.\n\t\t// If someone animates the width of tabs, we don't want to realign on every animation frame.\n\t\t// Once we haven't seen any more resize events in the last 32ms (~2 animaion frames) we can\n\t\t// re-align.\n\t\tconst resize = this._sharedResizeObserver\n\t\t\t.observe(this._elementRef.nativeElement)\n\t\t\t.pipe(debounceTime(32), takeUntil(this._destroyed));\n\t\t// Note: We do not actually need to watch these events for proper functioning of the tabs,\n\t\t// the resize events above should capture any viewport resize that we care about. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tconst viewportResize = this._viewportRuler.change(150).pipe(takeUntil(this._destroyed));\n\n\t\tconst realign = () => {\n\t\t\tthis.updatePagination();\n\t\t};\n\n\t\tthis._keyManager = new FocusKeyManager<BrnPaginatedTabHeaderItem>(this._items())\n\t\t\t.withHorizontalOrientation(this._getLayoutDirection())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t// Allow focus to land on disabled tabs, as per https://w3c.github.io/aria-practices/#kbd_disabled_controls\n\t\t\t.skipPredicate(() => false);\n\n\t\tthis._keyManager.updateActiveItem(this._selectedIndex());\n\n\t\t// Note: We do not need to realign after the first render for proper functioning of the tabs\n\t\t// the resize events above should fire when we first start observing the element. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tafterNextRender(realign, { injector: this._injector });\n\n\t\t// On dir change or resize, realign the ink bar and update the orientation of\n\t\t// the key manager if the direction has changed.\n\t\tmerge(dirChange, viewportResize, resize, this._itemsChanges, this._itemsResized())\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\t// We need to defer this to give the browser some time to recalculate\n\t\t\t\t// the element dimensions. The call has to be wrapped in `NgZone.run`,\n\t\t\t\t// because the viewport change handler runs outside of Angular.\n\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\t// Clamp the scroll distance, because it can change with the number of tabs.\n\t\t\t\t\t\tthis._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), this._scrollDistance));\n\t\t\t\t\t\trealign();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tthis._keyManager.withHorizontalOrientation(this._getLayoutDirection());\n\t\t\t});\n\n\t\t// If there is a change in the focus key manager we need to emit the `indexFocused`\n\t\t// event in order to provide a public event that notifies about focus changes. Also we realign\n\t\t// the tabs container by scrolling the new focused tab into the visible section.\n\t\tthis._keyManager.change.subscribe((newFocusIndex) => {\n\t\t\tthis.indexFocused.emit(newFocusIndex);\n\t\t\tthis._setTabFocus(newFocusIndex);\n\t\t});\n\t}\n\n\t/** Sends any changes that could affect the layout of the items. */\n\tprivate _itemsResized(): Observable<ResizeObserverEntry[]> {\n\t\tif (typeof ResizeObserver !== 'function') {\n\t\t\treturn EMPTY;\n\t\t}\n\n\t\treturn this._itemsChanges.pipe(\n\t\t\tstartWith(this._items()),\n\t\t\tswitchMap(\n\t\t\t\t(tabItems: ReadonlyArray<BrnPaginatedTabHeaderItem>) =>\n\t\t\t\t\tnew Observable((observer: Observer<ResizeObserverEntry[]>) =>\n\t\t\t\t\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\t\t\t\t\tconst resizeObserver = new ResizeObserver((entries) => observer.next(entries));\n\t\t\t\t\t\t\tfor (const tabItem of tabItems) {\n\t\t\t\t\t\t\t\tresizeObserver.observe(tabItem.elementRef.nativeElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t// Skip the first emit since the resize observer emits when an item\n\t\t\t// is observed for new items when the tab is already inserted\n\t\t\tskip(1),\n\t\t\t// Skip emissions where all the elements are invisible since we don't want\n\t\t\t// the header to try and re-render with invalid measurements. See #25574.\n\t\t\tfilter((entries) => entries.some((e) => e.contentRect.width > 0 && e.contentRect.height > 0)),\n\t\t);\n\t}\n\n\tngAfterContentChecked(): void {\n\t\t// If the number of tab labels have changed, check if scrolling should be enabled\n\t\tif (this._tabLabelCount !== this._items().length) {\n\t\t\tthis.updatePagination();\n\t\t\tthis._tabLabelCount = this._items().length;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the selected index has changed, scroll to the label and check if the scrolling controls\n\t\t// should be disabled.\n\t\tif (this._selectedIndexChanged) {\n\t\t\tthis._scrollToLabel(this._selectedIndex());\n\t\t\tthis._checkScrollingControls();\n\t\t\tthis._selectedIndexChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the scroll distance has been changed (tab selected, focused, scroll controls activated),\n\t\t// then translate the header to reflect this.\n\t\tif (this._scrollDistanceChanged) {\n\t\t\tthis._updateTabScrollPosition();\n\t\t\tthis._scrollDistanceChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis._keyManager?.destroy();\n\t\tthis._destroyed.next();\n\t\tthis._destroyed.complete();\n\t\tthis._stopScrolling.complete();\n\t}\n\n\t/** Handles keyboard events on the header. */\n\t_handleKeydown(event: KeyboardEvent) {\n\t\t// We don't handle any key bindings with a modifier key.\n\t\tif (hasModifierKey(event)) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase ENTER:\n\t\t\tcase SPACE:\n\t\t\t\tif (this.focusIndex !== this._selectedIndex()) {\n\t\t\t\t\tconst item = this._items()[this.focusIndex];\n\n\t\t\t\t\tif (item && !item.disabled) {\n\t\t\t\t\t\tthis.selectFocusedIndex.emit(this.focusIndex);\n\t\t\t\t\t\tthis._itemSelected(event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis._keyManager.onKeydown(event);\n\t\t}\n\t}\n\n\t/**\n\t * Callback for when the MutationObserver detects that the content has changed.\n\t */\n\t_onContentChanges() {\n\t\tconst textContent = this._elementRef.nativeElement.textContent;\n\n\t\t// We need to diff the text content of the header, because the MutationObserver callback\n\t\t// will fire even if the text content didn't change which is inefficient and is prone\n\t\t// to infinite loops if a poorly constructed expression is passed in (see #14249).\n\t\tif (textContent !== this._currentTextContent) {\n\t\t\tthis._currentTextContent = textContent || '';\n\n\t\t\t// The content observer runs outside the `NgZone` by default, which\n\t\t\t// means that we need to bring the callback back in ourselves.\n\t\t\tthis._ngZone.run(() => {\n\t\t\t\tthis.updatePagination();\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the view whether pagination should be enabled or not.\n\t *\n\t * WARNING: Calling this method can be very costly in terms of performance. It should be called\n\t * as infrequently as possible from outside of the Tabs component as it causes a reflow of the\n\t * page.\n\t */\n\tupdatePagination() {\n\t\tthis._checkPaginationEnabled();\n\t\tthis._checkScrollingControls();\n\t\tthis._updateTabScrollPosition();\n\t}\n\n\t/** Tracks which element has focus; used for keyboard navigation */\n\tpublic get focusIndex(): number {\n\t\treturn this._keyManager ? (this._keyManager.activeItemIndex ?? 0) : 0;\n\t}\n\n\t/** When the focus index is set, we must manually send focus to the correct label */\n\tpublic set focusIndex(value: number) {\n\t\tif (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._keyManager.setActiveItem(value);\n\t}\n\n\t/**\n\t * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is\n\t * providing a valid index and return true.\n\t */\n\t_isValidIndex(index: number): boolean {\n\t\treturn this._items() ? !!this._items()[index] : true;\n\t}\n\n\t/**\n\t * Sets focus on the HTML element for the label wrapper and scrolls it into the view if\n\t * scrolling is enabled.\n\t */\n\t_setTabFocus(tabIndex: number) {\n\t\tif (this._showPaginationControls()) {\n\t\t\tthis._scrollToLabel(tabIndex);\n\t\t}\n\n\t\tif (this._items()?.length) {\n\t\t\tthis._items()[tabIndex].focus();\n\n\t\t\t// Do not let the browser manage scrolling to focus the element, this will be handled\n\t\t\t// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n\t\t\t// should be the full width minus the offset width.\n\t\t\tconst containerEl = this._tabListContainer().nativeElement;\n\t\t\tconst dir = this._getLayoutDirection();\n\n\t\t\tif (dir === 'ltr') {\n\t\t\t\tcontainerEl.scrollLeft = 0;\n\t\t\t} else {\n\t\t\t\tcontainerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The layout direction of the containing app. */\n\t_getLayoutDirection(): Direction {\n\t\treturn this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\t/** Performs the CSS transformation on the tab list that will cause the list to scroll. */\n\t_updateTabScrollPosition() {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollDistance = this.scrollDistance;\n\t\tconst translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;\n\n\t\t// Don't use `translate3d` here because we don't want to create a new layer. A new layer\n\t\t// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar\n\t\t// and ripples will exceed the boundaries of the visible tab bar.\n\t\t// See: https://github.com/angular/components/issues/10276\n\t\t// We round the `transform` here, because transforms with sub-pixel precision cause some\n\t\t// browsers to blur the content of the element.\n\t\tthis._tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;\n\n\t\t// Setting the `transform` on IE will change the scroll offset of the parent, causing the\n\t\t// position to be thrown off in some cases. We have to reset it ourselves to ensure that\n\t\t// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing\n\t\t// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).\n\t\tif (this._platform.TRIDENT || this._platform.EDGE) {\n\t\t\tthis._tabListContainer().nativeElement.scrollLeft = 0;\n\t\t}\n\t}\n\n\t/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */\n\tpublic get scrollDistance(): number {\n\t\treturn this._scrollDistance;\n\t}\n\tpublic set scrollDistance(value: number) {\n\t\tthis._scrollTo(value);\n\t}\n\n\t/**\n\t * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or\n\t * the end of the list, respectively). The distance to scroll is computed to be a third of the\n\t * length of the tab list view window.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollHeader(direction: ScrollDirection) {\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\n\t\t// Move the scroll distance one-third the length of the tab list's viewport.\n\t\tconst scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;\n\n\t\treturn this._scrollTo(this._scrollDistance + scrollAmount);\n\t}\n\n\t/** Handles click events on the pagination arrows. */\n\t_handlePaginatorClick(direction: ScrollDirection) {\n\t\tthis._stopInterval();\n\t\tthis._scrollHeader(direction);\n\t}\n\n\t/**\n\t * Moves the tab list such that the desired tab label (marked by index) is moved into view.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollToLabel(labelIndex: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selectedLabel = this._items() ? this._items()[labelIndex] : null;\n\n\t\tif (!selectedLabel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The view length is the visible width of the tab labels.\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\t\tconst { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;\n\n\t\tlet labelBeforePos: number;\n\t\tlet labelAfterPos: number;\n\t\tif (this._getLayoutDirection() === 'ltr') {\n\t\t\tlabelBeforePos = offsetLeft;\n\t\t\tlabelAfterPos = labelBeforePos + offsetWidth;\n\t\t} else {\n\t\t\tlabelAfterPos = this._tabListInner().nativeElement.offsetWidth - offsetLeft;\n\t\t\tlabelBeforePos = labelAfterPos - offsetWidth;\n\t\t}\n\n\t\tconst beforeVisiblePos = this.scrollDistance;\n\t\tconst afterVisiblePos = this.scrollDistance + viewLength;\n\n\t\tif (labelBeforePos < beforeVisiblePos) {\n\t\t\t// Scroll header to move label to the before direction\n\t\t\tthis.scrollDistance -= beforeVisiblePos - labelBeforePos;\n\t\t} else if (labelAfterPos > afterVisiblePos) {\n\t\t\t// Scroll header to move label to the after direction\n\t\t\tthis.scrollDistance += Math.min(labelAfterPos - afterVisiblePos, labelBeforePos - beforeVisiblePos);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the pagination controls should be displayed. If the scroll width of the\n\t * tab list is wider than the size of the header container, then the pagination controls should\n\t * be shown.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkPaginationEnabled() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis._showPaginationControls.set(false);\n\t\t} else {\n\t\t\tconst isEnabled = this._tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;\n\n\t\t\tif (!isEnabled) {\n\t\t\t\tthis.scrollDistance = 0;\n\t\t\t}\n\n\t\t\tif (isEnabled !== this._showPaginationControls()) {\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t}\n\n\t\t\tthis._showPaginationControls.set(isEnabled);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the before and after controls should be enabled or disabled.\n\t * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the\n\t * before button. If the header is at the end of the list (scroll distance is equal to the\n\t * maximum distance we can scroll), then disable the after button.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkScrollingControls() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis._disableScrollAfter = this._disableScrollBefore = true;\n\t\t} else {\n\t\t\t// Check if the pagination arrows should be activated.\n\t\t\tthis._disableScrollBefore = this.scrollDistance === 0;\n\t\t\tthis._disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\t/**\n\t * Determines what is the maximum length in pixels that can be set for the scroll distance. This\n\t * is equal to the difference in width between the tab list container and tab header container.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_getMaxScrollDistance(): number {\n\t\tconst lengthOfTabList = this._tabListInner().nativeElement.scrollWidth;\n\t\tconst viewLength = this._tabListContainer().nativeElement.offsetWidth;\n\t\treturn lengthOfTabList - viewLength || 0;\n\t}\n\n\t/** Stops the currently-running paginator interval. */\n\t_stopInterval() {\n\t\tthis._stopScrolling.next();\n\t}\n\n\t/**\n\t * Handles the user pressing down on one of the paginators.\n\t * Starts scrolling the header after a certain amount of time.\n\t * @param direction In which direction the paginator should be scrolled.\n\t */\n\t_handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent) {\n\t\t// Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to\n\t\t// null check the `button`, but we do it so we don't break tests that use fake events.\n\t\tif (mouseEvent && mouseEvent.button !== null && mouseEvent.button !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Avoid overlapping timers.\n\t\tthis._stopInterval();\n\n\t\t// Start a timer after the delay and keep firing based on the interval.\n\t\ttimer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)\n\t\t\t// Keep the timer going until something tells it to stop or the component is destroyed.\n\t\t\t.pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))\n\t\t\t.subscribe(() => {\n\t\t\t\tconst { maxScrollDistance, distance } = this._scrollHeader(direction);\n\n\t\t\t\t// Stop the timer if we've reached the start or the end.\n\t\t\t\tif (distance === 0 || distance >= maxScrollDistance) {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Scrolls the header to a given position.\n\t * @param position Position to which to scroll.\n\t * @returns Information on the current scroll distance and the maximum.\n\t */\n\tprivate _scrollTo(position: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn { maxScrollDistance: 0, distance: 0 };\n\t\t}\n\n\t\tconst maxScrollDistance = this._getMaxScrollDistance();\n\t\tthis._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));\n\n\t\t// Mark that the scroll distance has changed so that after the view is checked, the CSS\n\t\t// transformation can move the header.\n\t\tthis._scrollDistanceChanged = true;\n\t\tthis._checkScrollingControls();\n\n\t\treturn { maxScrollDistance, distance: this._scrollDistance };\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnTabsContentDirective } from './lib/brn-tabs-content.directive';\nimport { BrnTabsListDirective } from './lib/brn-tabs-list.directive';\nimport { BrnTabsTriggerDirective } from './lib/brn-tabs-trigger.directive';\nimport { BrnTabsDirective } from './lib/brn-tabs.directive';\n\nexport * from './lib/brn-tabs-content.directive';\nexport * from './lib/brn-tabs-list.directive';\nexport * from './lib/brn-tabs-paginated-list.directive';\nexport * from './lib/brn-tabs-trigger.directive';\nexport * from './lib/brn-tabs.directive';\n\nexport const BrnTabsImports = [\n\tBrnTabsDirective,\n\tBrnTabsListDirective,\n\tBrnTabsTriggerDirective,\n\tBrnTabsContentDirective,\n] as const;\n\n@NgModule({\n\timports: [...BrnTabsImports],\n\texports: [...BrnTabsImports],\n})\nexport class BrnTabsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;MAiBa,gBAAgB,CAAA;AACZ,IAAA,WAAW,GAAG,KAAK,CAAqB,YAAY,CAAC;;AAE9D,IAAA,YAAY,GAAG,IAAI,CAAC,WAAW;AAEtB,IAAA,SAAS,GAAG,KAAK,CAAmB,KAAK,CAAC;;AAEnD,IAAA,UAAU,GAAG,IAAI,CAAC,SAAS;IAElB,UAAU,GAAG,KAAK,CAAqB,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;;AAEhF,IAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;AAEhC,IAAA,cAAc,GAAG,KAAK,CAAoB,WAAW,CAAC;;AAE/D,IAAA,eAAe,GAAG,IAAI,CAAC,cAAc;IAE5B,YAAY,GAAG,MAAM,EAAU;AAE9B,IA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-group.token.ts","../../../../libs/brain/toggle-group/src/lib/brn-toggle-group.component.ts","../../../../libs/brain/toggle-group/src/lib/brn-toggle-item.directive.ts","../../../../libs/brain/toggle-group/src/index.ts","../../../../libs/brain/toggle-group/src/spartan-ng-brain-toggle-group.ts"],"sourcesContent":["import { ExistingProvider, InjectionToken, Type, inject } from '@angular/core';\nimport type { BrnToggleGroupComponent } from './brn-toggle-group.component';\n\nconst BrnToggleGroupToken = new InjectionToken<BrnToggleGroupComponent>('BrnToggleGroupToken');\n\nexport function injectBrnToggleGroup<T>(): BrnToggleGroupComponent<T> | null {\n\treturn inject(BrnToggleGroupToken, { optional: true }) as BrnToggleGroupComponent<T> | null;\n}\n\nexport function provideBrnToggleGroup<T>(value: Type<BrnToggleGroupComponent<T>>): ExistingProvider {\n\treturn { provide: BrnToggleGroupToken, useExisting: value };\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tbooleanAttribute,\n\tcomputed,\n\tforwardRef,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { provideBrnToggleGroup } from './brn-toggle-group.token';\nimport { BrnToggleGroupItemDirective } from './brn-toggle-item.directive';\n\nexport const BRN_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnToggleGroupComponent),\n\tmulti: true,\n};\n\nexport class BrnButtonToggleChange<T = unknown> {\n\tconstructor(\n\t\tpublic source: BrnToggleGroupItemDirective<T>,\n\t\tpublic value: ToggleValue<T>,\n\t) {}\n}\n\n@Component({\n\tselector: 'brn-toggle-group',\n\tproviders: [provideBrnToggleGroup(BrnToggleGroupComponent), BRN_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR],\n\thost: {\n\t\trole: 'group',\n\t\tclass: 'brn-button-toggle-group',\n\t\t'[attr.aria-disabled]': 'state().disabled()',\n\t\t'[attr.data-disabled]': 'state().disabled()',\n\t\t'[attr.data-vertical]': 'vertical()',\n\t\t'(focusout)': 'onTouched()',\n\t},\n\texportAs: 'brnToggleGroup',\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnToggleGroupComponent<T = unknown> implements ControlValueAccessor {\n\t/**\n\t * The method to be called in order to update ngModel.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onChange: (value: ToggleValue<T>) => void = () => {};\n\n\t/** onTouch function registered via registerOnTouch (ControlValueAccessor). */\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected onTouched: () => void = () => {};\n\n\t/** Whether the button toggle group has a vertical orientation */\n\tpublic readonly vertical = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Value of the toggle group. */\n\tpublic readonly value = model<ToggleValue<T>>(undefined);\n\n\t/** Whether no button toggles need to be selected. */\n\tpublic readonly nullable = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether multiple button toggles can be selected. */\n\tpublic readonly multiple = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the button toggle group is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The internal state of the component. This can be replaced with linkedSignal in the future. */\n\tpublic readonly state = computed(() => ({\n\t\tdisabled: signal(this.disabled()),\n\t}));\n\n\t/** Emit event when the group value changes. */\n\tpublic readonly change = output<BrnButtonToggleChange<T>>();\n\n\twriteValue(value: ToggleValue<T>): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: (value: ToggleValue<T>) => void) {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.state().disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Determines whether a value can be set on the group.\n\t */\n\tcanDeselect(value: ToggleValue<T>): boolean {\n\t\t// if null values are allowed, the group can always be nullable\n\t\tif (this.nullable()) return true;\n\n\t\tconst currentValue = this.value();\n\n\t\tif (this.multiple() && Array.isArray(currentValue)) {\n\t\t\treturn !(currentValue.length === 1 && currentValue[0] === value);\n\t\t}\n\n\t\treturn currentValue !== value;\n\t}\n\n\t/**\n\t * @internal\n\t * Selects a value.\n\t */\n\tselect(value: T, source: BrnToggleGroupItemDirective<T>): void {\n\t\tif (this.state().disabled() || this.isSelected(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentValue = this.value();\n\n\t\t// emit the valueChange event here as we should only emit based on user interaction\n\t\tif (this.multiple()) {\n\t\t\tthis.emitSelectionChange([...((currentValue ?? []) as T[]), value], source);\n\t\t} else {\n\t\t\tthis.emitSelectionChange(value, source);\n\t\t}\n\n\t\tthis._onChange(this.value());\n\t\tthis.change.emit(new BrnButtonToggleChange<T>(source, this.value()));\n\t}\n\n\t/**\n\t * @internal\n\t * Deselects a value.\n\t */\n\tdeselect(value: T, source: BrnToggleGroupItemDirective<T>): void {\n\t\tif (this.state().disabled() || !this.isSelected(value) || !this.canDeselect(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentValue = this.value();\n\n\t\tif (this.multiple()) {\n\t\t\tthis.emitSelectionChange(\n\t\t\t\t((currentValue ?? []) as T[]).filter((v) => v !== value),\n\t\t\t\tsource,\n\t\t\t);\n\t\t} else if (currentValue === value) {\n\t\t\tthis.emitSelectionChange(null, source);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t * Determines whether a value is selected.\n\t */\n\tisSelected(value: T): boolean {\n\t\tconst currentValue = this.value();\n\n\t\tif (\n\t\t\tcurrentValue == null ||\n\t\t\tcurrentValue === undefined ||\n\t\t\t(Array.isArray(currentValue) && currentValue.length === 0)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.multiple()) {\n\t\t\treturn (currentValue as T[])?.includes(value);\n\t\t}\n\t\treturn currentValue === value;\n\t}\n\n\t/** Update the value of the group */\n\tprivate emitSelectionChange(value: ToggleValue<T>, source: BrnToggleGroupItemDirective<T>): void {\n\t\tthis.value.set(value);\n\t\tthis._onChange(value);\n\t\tthis.change.emit(new BrnButtonToggleChange<T>(source, this.value()));\n\t}\n}\n\ntype ToggleValue<T> = T | T[] | null | undefined;\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, booleanAttribute, computed, inject, input, model } from '@angular/core';\nimport { injectBrnToggleGroup } from './brn-toggle-group.token';\n\n@Directive({\n\tselector: 'button[hlmToggleGroupItem], button[brnToggleGroupItem]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': 'disabled() || group?.disabled() ? true : null',\n\t\t'[attr.data-disabled]': 'disabled() || group?.disabled() ? true : null',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-pressed]': 'isOn()',\n\t\t'(click)': 'toggle()',\n\t},\n})\nexport class BrnToggleGroupItemDirective<T> {\n\tprivate static _uniqueId = 0;\n\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the toggle group if available. */\n\tprotected readonly group = injectBrnToggleGroup<T>();\n\n\t/** The id of the toggle. */\n\tpublic readonly id = input(`brn-toggle-group-item-${BrnToggleGroupItemDirective._uniqueId++}`);\n\n\t/** The value this toggle represents. */\n\tpublic readonly value = input<T>();\n\n\t/** Whether the toggle is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The current state of the toggle when not used in a group. */\n\tpublic readonly state = model<'on' | 'off'>('off');\n\n\t/** Whether the toggle is responds to click events. */\n\tpublic readonly disableToggleClick = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the toggle is in the on state. */\n\tprotected readonly isOn = computed(() => this._state() === 'on');\n\n\t/** The current state that reflects the group state or the model state. */\n\tprotected readonly _state = computed(() => {\n\t\tif (this.group) {\n\t\t\treturn this.group.isSelected(this.value() as T) ? 'on' : 'off';\n\t\t}\n\t\treturn this.state();\n\t});\n\n\ttoggle(): void {\n\t\tif (this.disableToggleClick()) return;\n\n\t\tif (this.group) {\n\t\t\tif (this.isOn()) {\n\t\t\t\tthis.group.deselect(this.value() as T, this);\n\t\t\t} else {\n\t\t\t\tthis.group.select(this.value() as T, this);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.state.set(this.isOn() ? 'off' : 'on');\n\t\t}\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { BrnToggleGroupComponent } from './lib/brn-toggle-group.component';\nimport { BrnToggleGroupItemDirective } from './lib/brn-toggle-item.directive';\n\nexport * from './lib/brn-toggle-group.component';\nexport * from './lib/brn-toggle-item.directive';\n\n@NgModule({\n\timports: [BrnToggleGroupItemDirective, BrnToggleGroupComponent],\n\texports: [BrnToggleGroupItemDirective, BrnToggleGroupComponent],\n})\nexport class BrnToggleGroupModule {}\n\n@NgModule({\n\timports: [BrnToggleGroupItemDirective],\n\texports: [BrnToggleGroupItemDirective],\n})\nexport class BrnToggleGroupItemModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAA0B,qBAAqB,CAAC;SAE9E,oBAAoB,GAAA;IACnC,OAAO,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAsC;AAC5F;AAEM,SAAU,qBAAqB,CAAI,KAAuC,EAAA;IAC/E,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,KAAK,EAAE;AAC5D;;ACKa,MAAA,sCAAsC,GAAG;AACrD,IAAA,OAAO,EAAE,iBAAiB;AAC1B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-ng-brain-toggle-group.mjs","sources":["../../../../libs/brain/toggle-group/src/lib/brn-toggle-group.token.ts","../../../../libs/brain/toggle-group/src/lib/brn-toggle-group.component.ts","../../../../libs/brain/toggle-group/src/lib/brn-toggle-item.directive.ts","../../../../libs/brain/toggle-group/src/index.ts","../../../../libs/brain/toggle-group/src/spartan-ng-brain-toggle-group.ts"],"sourcesContent":["import { ExistingProvider, InjectionToken, Type, inject } from '@angular/core';\nimport type { BrnToggleGroupComponent } from './brn-toggle-group.component';\n\nconst BrnToggleGroupToken = new InjectionToken<BrnToggleGroupComponent>('BrnToggleGroupToken');\n\nexport function injectBrnToggleGroup<T>(): BrnToggleGroupComponent<T> | null {\n\treturn inject(BrnToggleGroupToken, { optional: true }) as BrnToggleGroupComponent<T> | null;\n}\n\nexport function provideBrnToggleGroup<T>(value: Type<BrnToggleGroupComponent<T>>): ExistingProvider {\n\treturn { provide: BrnToggleGroupToken, useExisting: value };\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tbooleanAttribute,\n\tcomputed,\n\tforwardRef,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { provideBrnToggleGroup } from './brn-toggle-group.token';\nimport { BrnToggleGroupItemDirective } from './brn-toggle-item.directive';\n\nexport const BRN_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnToggleGroupComponent),\n\tmulti: true,\n};\n\nexport class BrnButtonToggleChange<T = unknown> {\n\tconstructor(\n\t\tpublic source: BrnToggleGroupItemDirective<T>,\n\t\tpublic value: ToggleValue<T>,\n\t) {}\n}\n\n@Component({\n\tselector: 'brn-toggle-group',\n\tproviders: [provideBrnToggleGroup(BrnToggleGroupComponent), BRN_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR],\n\thost: {\n\t\trole: 'group',\n\t\tclass: 'brn-button-toggle-group',\n\t\t'[attr.aria-disabled]': 'state().disabled()',\n\t\t'[attr.data-disabled]': 'state().disabled()',\n\t\t'[attr.data-vertical]': 'vertical()',\n\t\t'(focusout)': 'onTouched()',\n\t},\n\texportAs: 'brnToggleGroup',\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnToggleGroupComponent<T = unknown> implements ControlValueAccessor {\n\t/**\n\t * The method to be called in order to update ngModel.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onChange: (value: ToggleValue<T>) => void = () => {};\n\n\t/** onTouch function registered via registerOnTouch (ControlValueAccessor). */\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected onTouched: () => void = () => {};\n\n\t/** Whether the button toggle group has a vertical orientation */\n\tpublic readonly vertical = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Value of the toggle group. */\n\tpublic readonly value = model<ToggleValue<T>>(undefined);\n\n\t/** Whether no button toggles need to be selected. */\n\tpublic readonly nullable = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether multiple button toggles can be selected. */\n\tpublic readonly multiple = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the button toggle group is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The internal state of the component. This can be replaced with linkedSignal in the future. */\n\tpublic readonly state = computed(() => ({\n\t\tdisabled: signal(this.disabled()),\n\t}));\n\n\t/** Emit event when the group value changes. */\n\tpublic readonly change = output<BrnButtonToggleChange<T>>();\n\n\twriteValue(value: ToggleValue<T>): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: (value: ToggleValue<T>) => void) {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.state().disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Determines whether a value can be set on the group.\n\t */\n\tcanDeselect(value: ToggleValue<T>): boolean {\n\t\t// if null values are allowed, the group can always be nullable\n\t\tif (this.nullable()) return true;\n\n\t\tconst currentValue = this.value();\n\n\t\tif (this.multiple() && Array.isArray(currentValue)) {\n\t\t\treturn !(currentValue.length === 1 && currentValue[0] === value);\n\t\t}\n\n\t\treturn currentValue !== value;\n\t}\n\n\t/**\n\t * @internal\n\t * Selects a value.\n\t */\n\tselect(value: T, source: BrnToggleGroupItemDirective<T>): void {\n\t\tif (this.state().disabled() || this.isSelected(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentValue = this.value();\n\n\t\t// emit the valueChange event here as we should only emit based on user interaction\n\t\tif (this.multiple()) {\n\t\t\tthis.emitSelectionChange([...((currentValue ?? []) as T[]), value], source);\n\t\t} else {\n\t\t\tthis.emitSelectionChange(value, source);\n\t\t}\n\n\t\tthis._onChange(this.value());\n\t\tthis.change.emit(new BrnButtonToggleChange<T>(source, this.value()));\n\t}\n\n\t/**\n\t * @internal\n\t * Deselects a value.\n\t */\n\tdeselect(value: T, source: BrnToggleGroupItemDirective<T>): void {\n\t\tif (this.state().disabled() || !this.isSelected(value) || !this.canDeselect(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentValue = this.value();\n\n\t\tif (this.multiple()) {\n\t\t\tthis.emitSelectionChange(\n\t\t\t\t((currentValue ?? []) as T[]).filter((v) => v !== value),\n\t\t\t\tsource,\n\t\t\t);\n\t\t} else if (currentValue === value) {\n\t\t\tthis.emitSelectionChange(null, source);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t * Determines whether a value is selected.\n\t */\n\tisSelected(value: T): boolean {\n\t\tconst currentValue = this.value();\n\n\t\tif (\n\t\t\tcurrentValue == null ||\n\t\t\tcurrentValue === undefined ||\n\t\t\t(Array.isArray(currentValue) && currentValue.length === 0)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.multiple()) {\n\t\t\treturn (currentValue as T[])?.includes(value);\n\t\t}\n\t\treturn currentValue === value;\n\t}\n\n\t/** Update the value of the group */\n\tprivate emitSelectionChange(value: ToggleValue<T>, source: BrnToggleGroupItemDirective<T>): void {\n\t\tthis.value.set(value);\n\t\tthis._onChange(value);\n\t\tthis.change.emit(new BrnButtonToggleChange<T>(source, this.value()));\n\t}\n}\n\ntype ToggleValue<T> = T | T[] | null | undefined;\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, booleanAttribute, computed, inject, input, model } from '@angular/core';\nimport { injectBrnToggleGroup } from './brn-toggle-group.token';\n\n@Directive({\n\tselector: 'button[hlmToggleGroupItem], button[brnToggleGroupItem]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': 'disabled() || group?.disabled() ? true : null',\n\t\t'[attr.data-disabled]': 'disabled() || group?.disabled() ? true : null',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-pressed]': 'isOn()',\n\t\t'(click)': 'toggle()',\n\t},\n})\nexport class BrnToggleGroupItemDirective<T> {\n\tprivate static _uniqueId = 0;\n\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the toggle group if available. */\n\tprotected readonly group = injectBrnToggleGroup<T>();\n\n\t/** The id of the toggle. */\n\tpublic readonly id = input(`brn-toggle-group-item-${BrnToggleGroupItemDirective._uniqueId++}`);\n\n\t/** The value this toggle represents. */\n\tpublic readonly value = input<T>();\n\n\t/** Whether the toggle is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The current state of the toggle when not used in a group. */\n\tpublic readonly state = model<'on' | 'off'>('off');\n\n\t/** Whether the toggle is responds to click events. */\n\tpublic readonly disableToggleClick = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the toggle is in the on state. */\n\tprotected readonly isOn = computed(() => this._state() === 'on');\n\n\t/** The current state that reflects the group state or the model state. */\n\tprotected readonly _state = computed(() => {\n\t\tif (this.group) {\n\t\t\treturn this.group.isSelected(this.value() as T) ? 'on' : 'off';\n\t\t}\n\t\treturn this.state();\n\t});\n\n\ttoggle(): void {\n\t\tif (this.disableToggleClick()) return;\n\n\t\tif (this.group) {\n\t\t\tif (this.isOn()) {\n\t\t\t\tthis.group.deselect(this.value() as T, this);\n\t\t\t} else {\n\t\t\t\tthis.group.select(this.value() as T, this);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.state.set(this.isOn() ? 'off' : 'on');\n\t\t}\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { BrnToggleGroupComponent } from './lib/brn-toggle-group.component';\nimport { BrnToggleGroupItemDirective } from './lib/brn-toggle-item.directive';\n\nexport * from './lib/brn-toggle-group.component';\nexport * from './lib/brn-toggle-item.directive';\n\n@NgModule({\n\timports: [BrnToggleGroupItemDirective, BrnToggleGroupComponent],\n\texports: [BrnToggleGroupItemDirective, BrnToggleGroupComponent],\n})\nexport class BrnToggleGroupModule {}\n\n@NgModule({\n\timports: [BrnToggleGroupItemDirective],\n\texports: [BrnToggleGroupItemDirective],\n})\nexport class BrnToggleGroupItemModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAA0B,qBAAqB,CAAC;SAE9E,oBAAoB,GAAA;IACnC,OAAO,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAsC;AAC5F;AAEM,SAAU,qBAAqB,CAAI,KAAuC,EAAA;IAC/E,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,KAAK,EAAE;AAC5D;;ACKO,M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;AACtC,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-toggle.mjs","sources":["../../../../libs/brain/toggle/src/lib/brn-toggle.directive.ts","../../../../libs/brain/toggle/src/index.ts","../../../../libs/brain/toggle/src/spartan-ng-brain-toggle.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, booleanAttribute, computed, inject, input, model } from '@angular/core';\n\n@Directive({\n\tselector: 'button[hlmToggle], button[brnToggle]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': 'disabled() ? true : null',\n\t\t'[attr.data-disabled]': 'disabled() ? true : null',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-pressed]': 'isOn()',\n\t\t'(click)': 'toggle()',\n\t},\n})\nexport class BrnToggleDirective<T> {\n\tprivate static _uniqueId = 0;\n\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** The id of the toggle. */\n\tpublic readonly id = input(`brn-toggle-${BrnToggleDirective._uniqueId++}`);\n\n\t/** The value this toggle represents. */\n\tpublic readonly value = input<T>();\n\n\t/** Whether the toggle is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The current state of the toggle when not used in a group. */\n\tpublic readonly state = model<'on' | 'off'>('off');\n\n\t/** Whether the toggle is responds to click events. */\n\tpublic readonly disableToggleClick = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the toggle is in the on state. */\n\tprotected readonly isOn = computed(() => this._state() === 'on');\n\n\t/** The current state that reflects the group state or the model state. */\n\tprotected readonly _state = computed(() => {\n\t\treturn this.state();\n\t});\n\n\ttoggle(): void {\n\t\tif (this.disableToggleClick()) return;\n\n\t\tthis.state.set(this.isOn() ? 'off' : 'on');\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { BrnToggleDirective } from './lib/brn-toggle.directive';\n\nexport * from './lib/brn-toggle.directive';\n\n@NgModule({\n\timports: [BrnToggleDirective],\n\texports: [BrnToggleDirective],\n})\nexport class BrnToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAca,kBAAkB,CAAA;AACtB,IAAA,OAAO,SAAS,GAAG,CAAC;AAEX,IAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;;IAG5C,EAAE,GAAG,KAAK,CAAC,CAAc,WAAA,EAAA,kBAAkB,CAAC,SAAS,EAAE,CAAE,CAAA,CAAC;;IAG1D,KAAK,GAAG,KAAK,EAAK;;AAGlB,IAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AAC9D,QAAA,SAAS,EAAE,gBAAgB;AAC3B,KAAA,CAAC;;AAGc,IAAA,KAAK,GAAG,KAAK,CAAe,KAAK,CAAC;;AAGlC,IAAA,kBAAkB,GAAG,KAAK,CAAwB,KAAK,EAAE;AACxE,QAAA,SAAS,EAAE,gBAAgB;AAC3B,KAAA,CAAC;;AAGiB,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC;;AAG7C,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE;AACpB,KAAC,CAAC;IAEF,MAAM,GAAA;QACL,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAAE;AAE/B,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC;;0HAnC/B,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;8GAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,MAAA,EAAA,EAAA,EAAA,E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,EAAE,0BAA0B;AAC7C,wBAAA,sBAAsB,EAAE,0BAA0B;AAClD,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,qBAAqB,EAAE,QAAQ;AAC/B,wBAAA,SAAS,EAAE,UAAU;AACrB,qBAAA;AACD,iBAAA;;;MCJY,eAAe,CAAA;0HAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;2HAAf,eAAe,EAAA,OAAA,EAAA,CAHjB,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAClB,kBAAkB,CAAA,EAAA,CAAA;2HAEhB,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC7B,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-toggle.mjs","sources":["../../../../libs/brain/toggle/src/lib/brn-toggle.directive.ts","../../../../libs/brain/toggle/src/index.ts","../../../../libs/brain/toggle/src/spartan-ng-brain-toggle.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { ChangeDetectorRef, Directive, booleanAttribute, computed, inject, input, model } from '@angular/core';\n\n@Directive({\n\tselector: 'button[hlmToggle], button[brnToggle]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': 'disabled() ? true : null',\n\t\t'[attr.data-disabled]': 'disabled() ? true : null',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-pressed]': 'isOn()',\n\t\t'(click)': 'toggle()',\n\t},\n})\nexport class BrnToggleDirective<T> {\n\tprivate static _uniqueId = 0;\n\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** The id of the toggle. */\n\tpublic readonly id = input(`brn-toggle-${BrnToggleDirective._uniqueId++}`);\n\n\t/** The value this toggle represents. */\n\tpublic readonly value = input<T>();\n\n\t/** Whether the toggle is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The current state of the toggle when not used in a group. */\n\tpublic readonly state = model<'on' | 'off'>('off');\n\n\t/** Whether the toggle is responds to click events. */\n\tpublic readonly disableToggleClick = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether the toggle is in the on state. */\n\tprotected readonly isOn = computed(() => this._state() === 'on');\n\n\t/** The current state that reflects the group state or the model state. */\n\tprotected readonly _state = computed(() => {\n\t\treturn this.state();\n\t});\n\n\ttoggle(): void {\n\t\tif (this.disableToggleClick()) return;\n\n\t\tthis.state.set(this.isOn() ? 'off' : 'on');\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { BrnToggleDirective } from './lib/brn-toggle.directive';\n\nexport * from './lib/brn-toggle.directive';\n\n@NgModule({\n\timports: [BrnToggleDirective],\n\texports: [BrnToggleDirective],\n})\nexport class BrnToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAca,kBAAkB,CAAA;AACtB,IAAA,OAAO,SAAS,GAAG,CAAC;AAEX,IAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;;IAG5C,EAAE,GAAG,KAAK,CAAC,CAAA,WAAA,EAAc,kBAAkB,CAAC,SAAS,EAAE,CAAA,CAAE,CAAC;;IAG1D,KAAK,GAAG,KAAK,EAAK;;AAGlB,IAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AAC9D,QAAA,SAAS,EAAE,gBAAgB;AAC3B,KAAA,CAAC;;AAGc,IAAA,KAAK,GAAG,KAAK,CAAe,KAAK,CAAC;;AAGlC,IAAA,kBAAkB,GAAG,KAAK,CAAwB,KAAK,EAAE;AACxE,QAAA,SAAS,EAAE,gBAAgB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