UNPKG

@synergy-design-system/angular

Version:
153 lines (149 loc) 6.78 kB
import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import '@synergy-design-system/components/components/tab-group/tab-group.js'; // --------------------------------------------------------------------- // 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components // Please do not edit this file directly! // It will get recreated when running pnpm build. // --------------------------------------------------------------------- /** * @summary Tab groups organize content into a container that shows one section at a time. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-tab-group--docs * @status stable * @since 2.0 * * @dependency syn-icon-button * * @slot - Used for grouping tab panels in the tab group. Must be `<syn-tab-panel>` elements. * @slot nav - Used for grouping tabs in the tab group. Must be `<syn-tab>` elements. * * @event {{ name: String }} syn-tab-show - Emitted when a tab is shown. The payload of the event returns the "panel" attribute of the shown tab. * @event {{ name: String }} syn-tab-hide - Emitted when a tab is hidden. The payload of the event returns the "panel" attribute of the hidden tab. * * @csspart base - The component's base wrapper. * @csspart nav - The tab group's navigation container where tabs are slotted in. * @csspart tabs - The container that wraps the tabs. * @csspart active-tab-indicator - The line that highlights the currently selected tab. * @csspart body - The tab group's body where tab panels are slotted in. * @csspart scroll-button - The previous/next scroll buttons that show when tabs are scrollable, an `<syn-icon-button>`. * @csspart scroll-button--start - The starting scroll button. * @csspart scroll-button--end - The ending scroll button. * @csspart scroll-button__base - The scroll button's exported `base` part. * * @cssproperty --indicator-color - The color of the active tab indicator. * @cssproperty --indicator-width - The width of the active tab indicator. * @cssproperty --track-color - The color of the indicator's track (the line that separates tabs from panels). * @cssproperty --track-width - The width of the indicator's track (the line that separates tabs from panels). */ class SynTabGroupComponent { nativeElement; _ngZone; constructor(e, ngZone) { this.nativeElement = e.nativeElement; this._ngZone = ngZone; this.nativeElement.addEventListener('syn-tab-show', (e) => { this.synTabShowEvent.emit(e); }); this.nativeElement.addEventListener('syn-tab-hide', (e) => { this.synTabHideEvent.emit(e); }); } /** * The placement of the tabs. */ set placement(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.placement = v)); } get placement() { return this.nativeElement.placement; } /** * When set to auto, navigating tabs with the arrow keys will instantly show the corresponding tab panel. * When set to manual, the tab will receive focus but will not show until the user presses spacebar or enter. */ set activation(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.activation = v)); } get activation() { return this.nativeElement.activation; } /** * Disables the scroll arrows that appear when tabs overflow. */ set noScrollControls(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.noScrollControls = v === '' || v)); } get noScrollControls() { return this.nativeElement.noScrollControls; } /** * Draws the tab group as a contained element. */ set contained(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.contained = v === '' || v)); } get contained() { return this.nativeElement.contained; } /** * Draws the tab group with edges instead of roundings. * Takes only effect if used with the 'contained' property */ set sharp(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.sharp = v === '' || v)); } get sharp() { return this.nativeElement.sharp; } /** * Prevent scroll buttons from being hidden when inactive. */ set fixedScrollControls(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.fixedScrollControls = v === '' || v)); } get fixedScrollControls() { return this.nativeElement.fixedScrollControls; } /** * Emitted when a tab is shown. * The payload of the event returns the "panel" attribute of the shown tab. */ synTabShowEvent = new EventEmitter(); /** * Emitted when a tab is hidden. * The payload of the event returns the "panel" attribute of the hidden tab. */ synTabHideEvent = new EventEmitter(); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynTabGroupComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynTabGroupComponent, isStandalone: true, selector: "syn-tab-group", inputs: { placement: "placement", activation: "activation", noScrollControls: "noScrollControls", contained: "contained", sharp: "sharp", fixedScrollControls: "fixedScrollControls" }, outputs: { synTabShowEvent: "synTabShowEvent", synTabHideEvent: "synTabHideEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynTabGroupComponent, decorators: [{ type: Component, args: [{ selector: 'syn-tab-group', standalone: true, template: '<ng-content></ng-content>', }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { placement: [{ type: Input }], activation: [{ type: Input }], noScrollControls: [{ type: Input }], contained: [{ type: Input }], sharp: [{ type: Input }], fixedScrollControls: [{ type: Input }], synTabShowEvent: [{ type: Output }], synTabHideEvent: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { SynTabGroupComponent }; //# sourceMappingURL=synergy-design-system-angular-components-tab-group.mjs.map