@spartan-ng/brain 0.0.1-alpha.488 → 0.0.1-alpha.490
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.
- package/avatar/lib/brn-avatar.component.d.ts +2 -2
- package/calendar/lib/brn-calendar-cell-button.directive.d.ts +2 -2
- package/calendar/lib/brn-calendar-grid.directive.d.ts +1 -1
- package/calendar/lib/brn-calendar-next-button.directive.d.ts +1 -1
- package/calendar/lib/brn-calendar-previous-button.directive.d.ts +1 -1
- package/calendar/lib/brn-calendar-week.directive.d.ts +1 -1
- package/calendar/lib/brn-calendar-weekday.directive.d.ts +1 -1
- package/calendar/lib/brn-calendar.directive.d.ts +3 -3
- package/calendar/lib/mode/brn-calendar-multiple.directive.d.ts +3 -3
- package/checkbox/lib/brn-checkbox.component.d.ts +3 -3
- package/collapsible/lib/brn-collapsible-content.component.d.ts +3 -3
- package/collapsible/lib/brn-collapsible-trigger.directive.d.ts +1 -1
- package/command/lib/brn-command-group.directive.d.ts +1 -1
- package/command/lib/brn-command-item.directive.d.ts +1 -1
- package/dialog/lib/brn-dialog-description.directive.d.ts +1 -1
- package/dialog/lib/brn-dialog-title.directive.d.ts +1 -1
- package/dialog/lib/brn-dialog.component.d.ts +1 -1
- package/fesm2022/spartan-ng-brain-avatar.mjs +4 -4
- package/fesm2022/spartan-ng-brain-avatar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-calendar.mjs +80 -80
- package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-checkbox.mjs +30 -30
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-collapsible.mjs +22 -22
- package/fesm2022/spartan-ng-brain-collapsible.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-command.mjs +10 -9
- package/fesm2022/spartan-ng-brain-command.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-input-otp.mjs +18 -18
- package/fesm2022/spartan-ng-brain-input-otp.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-menu.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-progress.mjs +8 -8
- package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-radio-group.mjs +36 -33
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-select.mjs +44 -43
- package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-separator.mjs +5 -5
- package/fesm2022/spartan-ng-brain-separator.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-slider.mjs +34 -35
- package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-switch.mjs +28 -28
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tabs.mjs +51 -50
- package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-toggle-group.mjs +13 -13
- package/fesm2022/spartan-ng-brain-toggle-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-toggle.mjs +4 -4
- package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tooltip.mjs +31 -31
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
- package/hover-card/lib/brn-hover-card-content.service.d.ts +5 -5
- package/input-otp/lib/brn-input-otp-slot.component.d.ts +2 -2
- package/input-otp/lib/brn-input-otp.component.d.ts +2 -2
- package/menu/lib/brn-context-menu-trigger.directive.d.ts +2 -2
- package/package.json +1 -1
- package/progress/lib/brn-progress-indicator.component.d.ts +1 -1
- package/progress/lib/brn-progress.component.d.ts +2 -2
- package/radio-group/lib/brn-radio-group.directive.d.ts +1 -1
- package/radio-group/lib/brn-radio.component.d.ts +6 -6
- package/select/lib/brn-select-content.component.d.ts +6 -6
- package/select/lib/brn-select-value.component.d.ts +4 -4
- package/select/lib/brn-select.component.d.ts +4 -4
- package/separator/lib/brn-separator.component.d.ts +2 -2
- package/sheet/lib/brn-sheet-trigger.directive.d.ts +1 -1
- package/slider/lib/brn-slider-range.directive.d.ts +1 -1
- package/slider/lib/brn-slider-thumb.directive.d.ts +2 -2
- package/slider/lib/brn-slider-track.directive.d.ts +1 -1
- package/slider/lib/brn-slider.directive.d.ts +3 -3
- package/switch/lib/brn-switch.component.d.ts +6 -5
- package/tabs/lib/brn-tabs-content.directive.d.ts +2 -2
- package/tabs/lib/brn-tabs-paginated-list.directive.d.ts +12 -12
- package/tabs/lib/brn-tabs-trigger.directive.d.ts +2 -2
- package/tabs/lib/brn-tabs.directive.d.ts +2 -2
- package/toggle/lib/brn-toggle.directive.d.ts +1 -1
- package/toggle-group/lib/brn-toggle-item.directive.d.ts +2 -2
- package/tooltip/lib/brn-tooltip-content.component.d.ts +5 -5
- package/tooltip/lib/brn-tooltip-trigger.directive.d.ts +5 -5
|
@@ -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,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,IAAI,EAAE,cAAc;AACpB,wBAAA,SAAS,EAAE,yBAAyB;AACpC,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;ACmBM,MAAM,yBAAyB,GAAG;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,kBAAkB,CAAC;AACjD,IAAA,KAAK,EAAE,IAAI;;AAGZ,MAAM,kBAAkB,GAAG,SAAS;AAEpC,IAAI,eAAe,GAAG,CAAC;MA2CV,kBAAkB,CAAA;AACb,IAAA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A,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
|
+
{"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 { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_SWITCH_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => 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, ControlValueAccessor {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _cdr = inject(ChangeDetectorRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\n\tprotected readonly _focusVisible = signal(false);\n\tprotected readonly _focused = signal(false);\n\n\t/**\n\t * Whether switch is checked/toggled on.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<boolean>(false);\n\n\t/**\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,IAAI,EAAE,cAAc;AACpB,wBAAA,SAAS,EAAE,yBAAyB;AACpC,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;ACmBM,MAAM,yBAAyB,GAAG;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,kBAAkB,CAAC;AACjD,IAAA,KAAK,EAAE,IAAI;;AAGZ,MAAM,kBAAkB,GAAG,SAAS;AAEpC,IAAI,eAAe,GAAG,CAAC;MA2CV,kBAAkB,CAAA;AACb,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAC7B,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACnD,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,I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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;;;;"}
|
|
@@ -16,9 +16,9 @@ class BrnTabsDirective {
|
|
|
16
16
|
direction = input('ltr');
|
|
17
17
|
/** internal **/
|
|
18
18
|
$direction = this.direction;
|
|
19
|
-
|
|
19
|
+
activeTab = model(undefined, { alias: 'brnTabs' });
|
|
20
20
|
/** internal **/
|
|
21
|
-
$activeTab = this.
|
|
21
|
+
$activeTab = this.activeTab.asReadonly();
|
|
22
22
|
activationMode = input('automatic');
|
|
23
23
|
/** internal **/
|
|
24
24
|
$activationMode = this.activationMode;
|
|
@@ -33,8 +33,8 @@ class BrnTabsDirective {
|
|
|
33
33
|
}
|
|
34
34
|
unregisterTrigger(key) {
|
|
35
35
|
this.updateEntry(key, { trigger: undefined });
|
|
36
|
-
if (this.
|
|
37
|
-
this.
|
|
36
|
+
if (this.activeTab() === key) {
|
|
37
|
+
this.activeTab.set(undefined);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
unregisterContent(key) {
|
|
@@ -56,10 +56,10 @@ class BrnTabsDirective {
|
|
|
56
56
|
this.tabActivated.emit(key);
|
|
57
57
|
}
|
|
58
58
|
setActiveTab(key) {
|
|
59
|
-
this.
|
|
59
|
+
this.activeTab.set(key);
|
|
60
60
|
}
|
|
61
61
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
62
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsDirective, isStandalone: true, selector: "[brnTabs]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null },
|
|
62
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsDirective, isStandalone: true, selector: "[brnTabs]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "brnTabs", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeTab: "brnTabsChange", tabActivated: "tabActivated" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.dir": "direction()" } }, exportAs: ["brnTabs"], ngImport: i0 });
|
|
63
63
|
}
|
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsDirective, decorators: [{
|
|
65
65
|
type: Directive,
|
|
@@ -78,8 +78,8 @@ class BrnTabsContentDirective {
|
|
|
78
78
|
_elementRef = inject(ElementRef);
|
|
79
79
|
contentFor = input.required({ alias: 'brnTabsContent' });
|
|
80
80
|
_isSelected = computed(() => this._root.$activeTab() === this.contentFor());
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
_contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);
|
|
82
|
+
_labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);
|
|
83
83
|
constructor() {
|
|
84
84
|
effect(() => {
|
|
85
85
|
const contentFor = this.contentFor();
|
|
@@ -93,7 +93,7 @@ class BrnTabsContentDirective {
|
|
|
93
93
|
this._root.unregisterContent(this.contentFor());
|
|
94
94
|
}
|
|
95
95
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
96
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsContentDirective, isStandalone: true, selector: "[brnTabsContent]", inputs: { contentFor: { classPropertyName: "contentFor", publicName: "brnTabsContent", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "id": "
|
|
96
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsContentDirective, isStandalone: true, selector: "[brnTabsContent]", inputs: { contentFor: { classPropertyName: "contentFor", publicName: "brnTabsContent", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "id": "_contentId()", "attr.aria-labelledby": "_labelId()", "hidden": "_isSelected() === false" } }, exportAs: ["brnTabsContent"], ngImport: i0 });
|
|
97
97
|
}
|
|
98
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsContentDirective, decorators: [{
|
|
99
99
|
type: Directive,
|
|
@@ -102,8 +102,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
102
102
|
host: {
|
|
103
103
|
role: 'tabpanel',
|
|
104
104
|
tabindex: '0',
|
|
105
|
-
'[id]': '
|
|
106
|
-
'[attr.aria-labelledby]': '
|
|
105
|
+
'[id]': '_contentId()',
|
|
106
|
+
'[attr.aria-labelledby]': '_labelId()',
|
|
107
107
|
'[hidden]': '_isSelected() === false',
|
|
108
108
|
},
|
|
109
109
|
exportAs: 'brnTabsContent',
|
|
@@ -116,8 +116,9 @@ class BrnTabsTriggerDirective {
|
|
|
116
116
|
_orientation = this._root.$orientation;
|
|
117
117
|
triggerFor = input.required({ alias: 'brnTabsTrigger' });
|
|
118
118
|
selected = computed(() => this._root.$activeTab() === this.triggerFor());
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
_contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);
|
|
120
|
+
_labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
121
122
|
_disabled = input(false, {
|
|
122
123
|
alias: 'disabled',
|
|
123
124
|
transform: booleanAttribute,
|
|
@@ -150,19 +151,19 @@ class BrnTabsTriggerDirective {
|
|
|
150
151
|
this._root.unregisterTrigger(this.triggerFor());
|
|
151
152
|
}
|
|
152
153
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
153
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsTriggerDirective, isStandalone: true, selector: "button[brnTabsTrigger]", inputs: { triggerFor: { classPropertyName: "triggerFor", publicName: "brnTabsTrigger", isSignal: true, isRequired: true, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "tab" }, listeners: { "click": "activate()" }, properties: { "id": "
|
|
154
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnTabsTriggerDirective, isStandalone: true, selector: "button[brnTabsTrigger]", inputs: { triggerFor: { classPropertyName: "triggerFor", publicName: "brnTabsTrigger", isSignal: true, isRequired: true, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "tab" }, listeners: { "click": "activate()" }, properties: { "id": "_labelId()", "tabindex": "selected() ? \"0\": \"-1\"", "attr.aria-selected": "selected()", "attr.aria-controls": "_contentId()", "attr.aria-disabled": "_disabled()", "attr.data-state": "selected() ? 'active' : 'inactive'", "attr.data-orientation": "_orientation()", "attr.data-disabled": "_disabled() ? '' : undefined", "attr.disabled": "_disabled() ? '' : undefined" } }, exportAs: ["brnTabsTrigger"], ngImport: i0 });
|
|
154
155
|
}
|
|
155
156
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnTabsTriggerDirective, decorators: [{
|
|
156
157
|
type: Directive,
|
|
157
158
|
args: [{
|
|
158
159
|
selector: 'button[brnTabsTrigger]',
|
|
159
160
|
host: {
|
|
160
|
-
'[id]': '
|
|
161
|
+
'[id]': '_labelId()',
|
|
161
162
|
type: 'button',
|
|
162
163
|
role: 'tab',
|
|
163
164
|
'[tabindex]': 'selected() ? "0": "-1"',
|
|
164
165
|
'[attr.aria-selected]': 'selected()',
|
|
165
|
-
'[attr.aria-controls]': '
|
|
166
|
+
'[attr.aria-controls]': '_contentId()',
|
|
166
167
|
'[attr.aria-disabled]': '_disabled()',
|
|
167
168
|
'[attr.data-state]': "selected() ? 'active' : 'inactive'",
|
|
168
169
|
'[attr.data-orientation]': '_orientation()',
|
|
@@ -274,11 +275,11 @@ class BrnTabsPaginatedListDirective {
|
|
|
274
275
|
/** Emits when the component is destroyed. */
|
|
275
276
|
_destroyed = new Subject();
|
|
276
277
|
/** Whether the controls for pagination should be displayed */
|
|
277
|
-
|
|
278
|
+
showPaginationControls = signal(false);
|
|
278
279
|
/** Whether the tab list can be scrolled more towards the end of the tab label list. */
|
|
279
|
-
|
|
280
|
+
disableScrollAfter = true;
|
|
280
281
|
/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
|
|
281
|
-
|
|
282
|
+
disableScrollBefore = true;
|
|
282
283
|
/**
|
|
283
284
|
* The number of tab labels that are displayed on the header. When this changes, the header
|
|
284
285
|
* should re-evaluate the scroll position.
|
|
@@ -302,10 +303,10 @@ class BrnTabsPaginatedListDirective {
|
|
|
302
303
|
const currentTabKey = this._activeTab();
|
|
303
304
|
const tabs = this._tabs();
|
|
304
305
|
let activeIndex = 0;
|
|
305
|
-
if (currentTabKey && this.
|
|
306
|
+
if (currentTabKey && this.items()) {
|
|
306
307
|
const currentTab = tabs[currentTabKey];
|
|
307
308
|
if (currentTab) {
|
|
308
|
-
activeIndex = this.
|
|
309
|
+
activeIndex = this.items().indexOf(currentTab.trigger);
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
return activeIndex;
|
|
@@ -322,7 +323,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
322
323
|
_dir = inject(Directionality, { optional: true });
|
|
323
324
|
_ngZone = inject(NgZone);
|
|
324
325
|
_platform = inject(Platform);
|
|
325
|
-
|
|
326
|
+
animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
|
|
326
327
|
constructor() {
|
|
327
328
|
// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
|
|
328
329
|
this._ngZone.runOutsideAngular(() => {
|
|
@@ -344,12 +345,12 @@ class BrnTabsPaginatedListDirective {
|
|
|
344
345
|
}
|
|
345
346
|
ngAfterViewInit() {
|
|
346
347
|
// We need to handle these events manually, because we want to bind passive event listeners.
|
|
347
|
-
fromEvent(this.
|
|
348
|
+
fromEvent(this.previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
348
349
|
.pipe(takeUntil(this._destroyed))
|
|
349
350
|
.subscribe(() => {
|
|
350
351
|
this._handlePaginatorPress('before');
|
|
351
352
|
});
|
|
352
|
-
fromEvent(this.
|
|
353
|
+
fromEvent(this.nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)
|
|
353
354
|
.pipe(takeUntil(this._destroyed))
|
|
354
355
|
.subscribe(() => {
|
|
355
356
|
this._handlePaginatorPress('after');
|
|
@@ -371,7 +372,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
371
372
|
const realign = () => {
|
|
372
373
|
this.updatePagination();
|
|
373
374
|
};
|
|
374
|
-
this._keyManager = new FocusKeyManager(this.
|
|
375
|
+
this._keyManager = new FocusKeyManager(this.items())
|
|
375
376
|
.withHorizontalOrientation(this._getLayoutDirection())
|
|
376
377
|
.withHomeAndEnd()
|
|
377
378
|
.withWrap()
|
|
@@ -384,7 +385,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
384
385
|
afterNextRender(realign, { injector: this._injector });
|
|
385
386
|
// On dir change or resize, realign the ink bar and update the orientation of
|
|
386
387
|
// the key manager if the direction has changed.
|
|
387
|
-
merge(dirChange, viewportResize, resize, this.
|
|
388
|
+
merge(dirChange, viewportResize, resize, this.itemsChanges, this._itemsResized())
|
|
388
389
|
.pipe(takeUntil(this._destroyed))
|
|
389
390
|
.subscribe(() => {
|
|
390
391
|
// We need to defer this to give the browser some time to recalculate
|
|
@@ -412,7 +413,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
412
413
|
if (typeof ResizeObserver !== 'function') {
|
|
413
414
|
return EMPTY;
|
|
414
415
|
}
|
|
415
|
-
return this.
|
|
416
|
+
return this.itemsChanges.pipe(startWith(this.items()), switchMap((tabItems) => new Observable((observer) => this._ngZone.runOutsideAngular(() => {
|
|
416
417
|
const resizeObserver = new ResizeObserver((entries) => observer.next(entries));
|
|
417
418
|
for (const tabItem of tabItems) {
|
|
418
419
|
resizeObserver.observe(tabItem.elementRef.nativeElement);
|
|
@@ -430,9 +431,9 @@ class BrnTabsPaginatedListDirective {
|
|
|
430
431
|
}
|
|
431
432
|
ngAfterContentChecked() {
|
|
432
433
|
// If the number of tab labels have changed, check if scrolling should be enabled
|
|
433
|
-
if (this._tabLabelCount !== this.
|
|
434
|
+
if (this._tabLabelCount !== this.items().length) {
|
|
434
435
|
this.updatePagination();
|
|
435
|
-
this._tabLabelCount = this.
|
|
436
|
+
this._tabLabelCount = this.items().length;
|
|
436
437
|
this._changeDetectorRef.markForCheck();
|
|
437
438
|
}
|
|
438
439
|
// If the selected index has changed, scroll to the label and check if the scrolling controls
|
|
@@ -467,7 +468,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
467
468
|
case ENTER:
|
|
468
469
|
case SPACE:
|
|
469
470
|
if (this.focusIndex !== this._selectedIndex()) {
|
|
470
|
-
const item = this.
|
|
471
|
+
const item = this.items()[this.focusIndex];
|
|
471
472
|
if (item && !item.disabled) {
|
|
472
473
|
this.selectFocusedIndex.emit(this.focusIndex);
|
|
473
474
|
this._itemSelected(event);
|
|
@@ -524,22 +525,22 @@ class BrnTabsPaginatedListDirective {
|
|
|
524
525
|
* providing a valid index and return true.
|
|
525
526
|
*/
|
|
526
527
|
_isValidIndex(index) {
|
|
527
|
-
return this.
|
|
528
|
+
return this.items() ? !!this.items()[index] : true;
|
|
528
529
|
}
|
|
529
530
|
/**
|
|
530
531
|
* Sets focus on the HTML element for the label wrapper and scrolls it into the view if
|
|
531
532
|
* scrolling is enabled.
|
|
532
533
|
*/
|
|
533
534
|
_setTabFocus(tabIndex) {
|
|
534
|
-
if (this.
|
|
535
|
+
if (this.showPaginationControls()) {
|
|
535
536
|
this._scrollToLabel(tabIndex);
|
|
536
537
|
}
|
|
537
|
-
if (this.
|
|
538
|
-
this.
|
|
538
|
+
if (this.items()?.length) {
|
|
539
|
+
this.items()[tabIndex].focus();
|
|
539
540
|
// Do not let the browser manage scrolling to focus the element, this will be handled
|
|
540
541
|
// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
|
|
541
542
|
// should be the full width minus the offset width.
|
|
542
|
-
const containerEl = this.
|
|
543
|
+
const containerEl = this.tabListContainer().nativeElement;
|
|
543
544
|
const dir = this._getLayoutDirection();
|
|
544
545
|
if (dir === 'ltr') {
|
|
545
546
|
containerEl.scrollLeft = 0;
|
|
@@ -566,13 +567,13 @@ class BrnTabsPaginatedListDirective {
|
|
|
566
567
|
// See: https://github.com/angular/components/issues/10276
|
|
567
568
|
// We round the `transform` here, because transforms with sub-pixel precision cause some
|
|
568
569
|
// browsers to blur the content of the element.
|
|
569
|
-
this.
|
|
570
|
+
this.tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
|
|
570
571
|
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
|
|
571
572
|
// position to be thrown off in some cases. We have to reset it ourselves to ensure that
|
|
572
573
|
// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
|
|
573
574
|
// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
|
|
574
575
|
if (this._platform.TRIDENT || this._platform.EDGE) {
|
|
575
|
-
this.
|
|
576
|
+
this.tabListContainer().nativeElement.scrollLeft = 0;
|
|
576
577
|
}
|
|
577
578
|
}
|
|
578
579
|
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
|
|
@@ -591,7 +592,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
591
592
|
* should be called sparingly.
|
|
592
593
|
*/
|
|
593
594
|
_scrollHeader(direction) {
|
|
594
|
-
const viewLength = this.
|
|
595
|
+
const viewLength = this.tabListContainer().nativeElement.offsetWidth;
|
|
595
596
|
// Move the scroll distance one-third the length of the tab list's viewport.
|
|
596
597
|
const scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;
|
|
597
598
|
return this._scrollTo(this._scrollDistance + scrollAmount);
|
|
@@ -611,12 +612,12 @@ class BrnTabsPaginatedListDirective {
|
|
|
611
612
|
if (this.disablePagination()) {
|
|
612
613
|
return;
|
|
613
614
|
}
|
|
614
|
-
const selectedLabel = this.
|
|
615
|
+
const selectedLabel = this.items() ? this.items()[labelIndex] : null;
|
|
615
616
|
if (!selectedLabel) {
|
|
616
617
|
return;
|
|
617
618
|
}
|
|
618
619
|
// The view length is the visible width of the tab labels.
|
|
619
|
-
const viewLength = this.
|
|
620
|
+
const viewLength = this.tabListContainer().nativeElement.offsetWidth;
|
|
620
621
|
const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
|
|
621
622
|
let labelBeforePos;
|
|
622
623
|
let labelAfterPos;
|
|
@@ -625,7 +626,7 @@ class BrnTabsPaginatedListDirective {
|
|
|
625
626
|
labelAfterPos = labelBeforePos + offsetWidth;
|
|
626
627
|
}
|
|
627
628
|
else {
|
|
628
|
-
labelAfterPos = this.
|
|
629
|
+
labelAfterPos = this.tabListInner().nativeElement.offsetWidth - offsetLeft;
|
|
629
630
|
labelBeforePos = labelAfterPos - offsetWidth;
|
|
630
631
|
}
|
|
631
632
|
const beforeVisiblePos = this.scrollDistance;
|
|
@@ -649,17 +650,17 @@ class BrnTabsPaginatedListDirective {
|
|
|
649
650
|
*/
|
|
650
651
|
_checkPaginationEnabled() {
|
|
651
652
|
if (this.disablePagination()) {
|
|
652
|
-
this.
|
|
653
|
+
this.showPaginationControls.set(false);
|
|
653
654
|
}
|
|
654
655
|
else {
|
|
655
|
-
const isEnabled = this.
|
|
656
|
+
const isEnabled = this.tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
|
|
656
657
|
if (!isEnabled) {
|
|
657
658
|
this.scrollDistance = 0;
|
|
658
659
|
}
|
|
659
|
-
if (isEnabled !== this.
|
|
660
|
+
if (isEnabled !== this.showPaginationControls()) {
|
|
660
661
|
this._changeDetectorRef.markForCheck();
|
|
661
662
|
}
|
|
662
|
-
this.
|
|
663
|
+
this.showPaginationControls.set(isEnabled);
|
|
663
664
|
}
|
|
664
665
|
}
|
|
665
666
|
/**
|
|
@@ -673,12 +674,12 @@ class BrnTabsPaginatedListDirective {
|
|
|
673
674
|
*/
|
|
674
675
|
_checkScrollingControls() {
|
|
675
676
|
if (this.disablePagination()) {
|
|
676
|
-
this.
|
|
677
|
+
this.disableScrollAfter = this.disableScrollBefore = true;
|
|
677
678
|
}
|
|
678
679
|
else {
|
|
679
680
|
// Check if the pagination arrows should be activated.
|
|
680
|
-
this.
|
|
681
|
-
this.
|
|
681
|
+
this.disableScrollBefore = this.scrollDistance === 0;
|
|
682
|
+
this.disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();
|
|
682
683
|
this._changeDetectorRef.markForCheck();
|
|
683
684
|
}
|
|
684
685
|
}
|
|
@@ -690,8 +691,8 @@ class BrnTabsPaginatedListDirective {
|
|
|
690
691
|
* should be called sparingly.
|
|
691
692
|
*/
|
|
692
693
|
_getMaxScrollDistance() {
|
|
693
|
-
const lengthOfTabList = this.
|
|
694
|
-
const viewLength = this.
|
|
694
|
+
const lengthOfTabList = this.tabListInner().nativeElement.scrollWidth;
|
|
695
|
+
const viewLength = this.tabListContainer().nativeElement.offsetWidth;
|
|
695
696
|
return lengthOfTabList - viewLength || 0;
|
|
696
697
|
}
|
|
697
698
|
/** Stops the currently-running paginator interval. */
|