@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
229 lines (222 loc) • 8.91 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/nav-item/nav-item.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 Flexible button / link component that can be used to quickly build navigations.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-nav-item--docs
* Takes one of 3 forms:
* - button (default),
* - link (overrides button if a 'href' is provided),
* - or accordion (overrides all other if 'children' slot is defined).
*
* @status stable
* @since 1.14.0
*
* @dependency syn-divider
* @dependency syn-icon
*
* @event syn-show - Emitted when the navigation item:
* - has children,
* - and is clicked while HTML details are hidden.
*
* @event syn-hide - Emitted when the navigation item:
* - has children,
* - and is clicked while HTML details are shown.
*
* @event syn-blur - Emitted when the button loses focus.
* @event syn-focus - Emitted when the button gains focus.
*
* @slot - The navigation item's label.
* @slot prefix - A presentational prefix icon or similar element.
* @slot suffix - A presentational suffix icon or similar element.
* @slot children - Slot used to provide nested child navigation elements.
* If provided, details and summary elements will be used.
* A chevron will be shown on the right side regardless of the chevron property.
*
* @csspart base - The component's base wrapper including children.
* @csspart children - The wrapper that holds the children
* @csspart content-wrapper - The component's content wrapper.
* @csspart content - The component's content excluding children.
* @csspart current-indicator - The indicator used when current is set to true
* @csspart chevron - The container that wraps the chevron.
* @csspart details - The details element rendered when there are children available
* @csspart divider - The components optional top divider.
* @csspart prefix - The container that wraps the prefix.
* @csspart suffix - The container that wraps the suffix.
*
* @cssproperty --indentation - Numeric value, indicating the level the item is placed at.
* @cssproperty --indentation-stepping - The amount of pixels each level will indent.
* @cssproperty --display-children - Display property of the children. Defaults to "contents"
*/
class SynNavItemComponent {
nativeElement;
_ngZone;
constructor(e, ngZone) {
this.nativeElement = e.nativeElement;
this._ngZone = ngZone;
this.nativeElement.addEventListener('syn-show', (e) => {
this.synShowEvent.emit(e);
});
this.nativeElement.addEventListener('syn-hide', (e) => {
this.synHideEvent.emit(e);
});
this.nativeElement.addEventListener('syn-blur', (e) => {
this.synBlurEvent.emit(e);
});
this.nativeElement.addEventListener('syn-focus', (e) => {
this.synFocusEvent.emit(e);
});
}
/**
* The navigation item's href target.
If provided, the navigation item will use an anchor tag otherwise it will use a button tag.
If the 'children' slot is provided, the navigation item will ignore the 'href' and use
accordion behavior.
*/
set href(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.href = v));
}
get href() {
return this.nativeElement.href;
}
/**
* Tells the browser where to open the link.
* Only used when `href` is present.
*/
set target(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.target = v));
}
get target() {
return this.nativeElement.target;
}
/**
* When using `href`, this attribute will map to the underlying link's `rel` attribute.
Unlike regular links, the default is `noreferrer noopener` to prevent security exploits.
However, if you're using `target` to point to a specific tab/window,
this will prevent that from working correctly.
You can remove or change the default value by setting the attribute
to an empty string or a value of your choice, respectively.
*/
set rel(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.rel = v));
}
get rel() {
return this.nativeElement.rel;
}
set current(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.current = v === '' || v));
}
get current() {
return this.nativeElement.current;
}
/**
* Disables the navigation item.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* The navigation item's orientation.
*/
set horizontal(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.horizontal = v === '' || v));
}
get horizontal() {
return this.nativeElement.horizontal;
}
/**
* Appends a chevron to the right side of a navigation item.
Only used if `horizontal` is false.
*/
set chevron(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.chevron = v === '' || v));
}
get chevron() {
return this.nativeElement.chevron;
}
/**
* Reflects HTML details element state and allows control from parent.
Only used if `horizontal` is false and `children` is defined.
*/
set open(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.open = v === '' || v));
}
get open() {
return this.nativeElement.open;
}
/**
* Toggle to true to show a divider above the element.
Only available when horizontal is false.
*/
set divider(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.divider = v === '' || v));
}
get divider() {
return this.nativeElement.divider;
}
/**
* Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.
*/
synShowEvent = new EventEmitter();
/**
* Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.
*/
synHideEvent = new EventEmitter();
/**
* Emitted when the button loses focus.
*/
synBlurEvent = new EventEmitter();
/**
* Emitted when the button gains focus.
*/
synFocusEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynNavItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynNavItemComponent, isStandalone: true, selector: "syn-nav-item", inputs: { href: "href", target: "target", rel: "rel", current: "current", disabled: "disabled", horizontal: "horizontal", chevron: "chevron", open: "open", divider: "divider" }, outputs: { synShowEvent: "synShowEvent", synHideEvent: "synHideEvent", synBlurEvent: "synBlurEvent", synFocusEvent: "synFocusEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynNavItemComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-nav-item',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { href: [{
type: Input
}], target: [{
type: Input
}], rel: [{
type: Input
}], current: [{
type: Input
}], disabled: [{
type: Input
}], horizontal: [{
type: Input
}], chevron: [{
type: Input
}], open: [{
type: Input
}], divider: [{
type: Input
}], synShowEvent: [{
type: Output
}], synHideEvent: [{
type: Output
}], synBlurEvent: [{
type: Output
}], synFocusEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynNavItemComponent };
//# sourceMappingURL=synergy-design-system-angular-components-nav-item.mjs.map