@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
135 lines (129 loc) • 6.1 kB
TypeScript
import * as i0 from '@angular/core';
import { ElementRef, NgZone, EventEmitter } from '@angular/core';
import { SynNavItem, SynShowEvent, SynHideEvent, SynBlurEvent, SynFocusEvent } from '@synergy-design-system/components';
export { SynBlurEvent, SynFocusEvent, SynHideEvent, SynShowEvent } from '@synergy-design-system/components';
/**
* @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"
*/
declare class SynNavItemComponent {
nativeElement: SynNavItem;
private _ngZone;
constructor(e: ElementRef, ngZone: NgZone);
/**
* 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: SynNavItem['href']);
get href(): SynNavItem['href'];
/**
* Tells the browser where to open the link.
* Only used when `href` is present.
*/
set target(v: SynNavItem['target']);
get target(): SynNavItem['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: SynNavItem['rel']);
get rel(): SynNavItem['rel'];
set current(v: '' | SynNavItem['current']);
get current(): SynNavItem['current'];
/**
* Disables the navigation item.
*/
set disabled(v: '' | SynNavItem['disabled']);
get disabled(): SynNavItem['disabled'];
/**
* The navigation item's orientation.
*/
set horizontal(v: '' | SynNavItem['horizontal']);
get horizontal(): SynNavItem['horizontal'];
/**
* Appends a chevron to the right side of a navigation item.
Only used if `horizontal` is false.
*/
set chevron(v: '' | SynNavItem['chevron']);
get chevron(): SynNavItem['chevron'];
/**
* Reflects HTML details element state and allows control from parent.
Only used if `horizontal` is false and `children` is defined.
*/
set open(v: '' | SynNavItem['open']);
get open(): SynNavItem['open'];
/**
* Toggle to true to show a divider above the element.
Only available when horizontal is false.
*/
set divider(v: '' | SynNavItem['divider']);
get divider(): SynNavItem['divider'];
/**
* Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.
*/
synShowEvent: EventEmitter<SynShowEvent>;
/**
* Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.
*/
synHideEvent: EventEmitter<SynHideEvent>;
/**
* Emitted when the button loses focus.
*/
synBlurEvent: EventEmitter<SynBlurEvent>;
/**
* Emitted when the button gains focus.
*/
synFocusEvent: EventEmitter<SynFocusEvent>;
static ɵfac: i0.ɵɵFactoryDeclaration<SynNavItemComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SynNavItemComponent, "syn-nav-item", never, { "href": { "alias": "href"; "required": false; }; "target": { "alias": "target"; "required": false; }; "rel": { "alias": "rel"; "required": false; }; "current": { "alias": "current"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "horizontal": { "alias": "horizontal"; "required": false; }; "chevron": { "alias": "chevron"; "required": false; }; "open": { "alias": "open"; "required": false; }; "divider": { "alias": "divider"; "required": false; }; }, { "synShowEvent": "synShowEvent"; "synHideEvent": "synHideEvent"; "synBlurEvent": "synBlurEvent"; "synFocusEvent": "synFocusEvent"; }, never, ["*"], true, never>;
}
export { SynNavItemComponent };