@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
105 lines (101 loc) • 4.07 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/tab/tab.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 Tabs are used inside [tab groups](/components/tab-group) to represent and activate [tab panels](/components/tab-panel).
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-tab--docs
* @status stable
* @since 2.0
*
* @dependency syn-icon-button
*
* @slot - The tab's label.
*
* @event syn-close - Emitted when the tab is closable and the close button is activated.
*
* @csspart base - The component's base wrapper.
* @csspart close-button - The close button, an `<syn-icon-button>`.
* @csspart close-button__base - The close button's exported `base` part.
*/
class SynTabComponent {
nativeElement;
_ngZone;
constructor(e, ngZone) {
this.nativeElement = e.nativeElement;
this._ngZone = ngZone;
this.nativeElement.addEventListener('syn-close', (e) => {
this.synCloseEvent.emit(e);
});
}
/**
* The name of the tab panel this tab is associated with.
* The panel must be located in the same tab group.
*/
set panel(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.panel = v));
}
get panel() {
return this.nativeElement.panel;
}
/**
* Draws the tab in an active state.
*/
set active(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.active = v === '' || v));
}
get active() {
return this.nativeElement.active;
}
/**
* Makes the tab closable and shows a close button.
*/
set closable(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.closable = v === '' || v));
}
get closable() {
return this.nativeElement.closable;
}
/**
* Disables the tab and prevents selection.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* Emitted when the tab is closable and the close button is activated.
*/
synCloseEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynTabComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynTabComponent, isStandalone: true, selector: "syn-tab", inputs: { panel: "panel", active: "active", closable: "closable", disabled: "disabled" }, outputs: { synCloseEvent: "synCloseEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynTabComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-tab',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { panel: [{
type: Input
}], active: [{
type: Input
}], closable: [{
type: Input
}], disabled: [{
type: Input
}], synCloseEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynTabComponent };
//# sourceMappingURL=synergy-design-system-angular-components-tab.mjs.map