UNPKG

@synergy-design-system/angular

Version:
1 lines 12.4 kB
{"version":3,"file":"synergy-design-system-angular-components-nav-item.mjs","sources":["../../components/nav-item/nav-item.component.ts","../../components/nav-item/synergy-design-system-angular-components-nav-item.ts"],"sourcesContent":["// ---------------------------------------------------------------------\n// 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components\n// Please do not edit this file directly!\n// It will get recreated when running pnpm build.\n// ---------------------------------------------------------------------\nimport {\n Component,\n ElementRef,\n NgZone,\n Input,\n Output,\n EventEmitter,\n AfterContentInit,\n} from '@angular/core';\nimport type { SynNavItem } from '@synergy-design-system/components';\nimport type { SynShowEvent } from '@synergy-design-system/components';\nimport type { SynHideEvent } from '@synergy-design-system/components';\nimport type { SynBlurEvent } from '@synergy-design-system/components';\nimport type { SynFocusEvent } from '@synergy-design-system/components';\nimport '@synergy-design-system/components/components/nav-item/nav-item.js';\n\n/**\n * @summary Flexible button / link component that can be used to quickly build navigations.\n * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-nav-item--docs\n * Takes one of 3 forms:\n * - button (default),\n * - link (overrides button if a 'href' is provided),\n * - or accordion (overrides all other if 'children' slot is defined).\n *\n * @status stable\n * @since 1.14.0\n *\n * @dependency syn-divider\n * @dependency syn-icon\n *\n * @event syn-show - Emitted when the navigation item:\n * - has children,\n * - and is clicked while HTML details are hidden.\n *\n * @event syn-hide - Emitted when the navigation item:\n * - has children,\n * - and is clicked while HTML details are shown.\n *\n * @event syn-blur - Emitted when the button loses focus.\n * @event syn-focus - Emitted when the button gains focus.\n *\n * @slot - The navigation item's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n * @slot children - Slot used to provide nested child navigation elements.\n * If provided, details and summary elements will be used.\n * A chevron will be shown on the right side regardless of the chevron property.\n *\n * @csspart base - The component's base wrapper including children.\n * @csspart children - The wrapper that holds the children\n * @csspart content-wrapper - The component's content wrapper.\n * @csspart content - The component's content excluding children.\n * @csspart current-indicator - The indicator used when current is set to true\n * @csspart chevron - The container that wraps the chevron.\n * @csspart details - The details element rendered when there are children available\n * @csspart divider - The components optional top divider.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart suffix - The container that wraps the suffix.\n *\n * @cssproperty --indentation - Numeric value, indicating the level the item is placed at.\n * @cssproperty --indentation-stepping - The amount of pixels each level will indent.\n * @cssproperty --display-children - Display property of the children. Defaults to \"contents\"\n */\n@Component({\n selector: 'syn-nav-item',\n standalone: true,\n template: '<ng-content></ng-content>',\n})\nexport class SynNavItemComponent {\n public nativeElement: SynNavItem;\n private _ngZone: NgZone;\n\n constructor(e: ElementRef, ngZone: NgZone) {\n this.nativeElement = e.nativeElement;\n this._ngZone = ngZone;\n this.nativeElement.addEventListener('syn-show', (e: SynShowEvent) => {\n this.synShowEvent.emit(e);\n });\n this.nativeElement.addEventListener('syn-hide', (e: SynHideEvent) => {\n this.synHideEvent.emit(e);\n });\n this.nativeElement.addEventListener('syn-blur', (e: SynBlurEvent) => {\n this.synBlurEvent.emit(e);\n });\n this.nativeElement.addEventListener('syn-focus', (e: SynFocusEvent) => {\n this.synFocusEvent.emit(e);\n });\n }\n\n /**\n* The navigation item's href target.\nIf provided, the navigation item will use an anchor tag otherwise it will use a button tag.\n\nIf the 'children' slot is provided, the navigation item will ignore the 'href' and use\naccordion behavior.\n */\n @Input()\n set href(v: SynNavItem['href']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.href = v));\n }\n get href(): SynNavItem['href'] {\n return this.nativeElement.href;\n }\n\n /**\n * Tells the browser where to open the link.\n * Only used when `href` is present.\n */\n @Input()\n set target(v: SynNavItem['target']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.target = v));\n }\n get target(): SynNavItem['target'] {\n return this.nativeElement.target;\n }\n\n /**\n* When using `href`, this attribute will map to the underlying link's `rel` attribute.\nUnlike regular links, the default is `noreferrer noopener` to prevent security exploits.\n\nHowever, if you're using `target` to point to a specific tab/window,\nthis will prevent that from working correctly.\n\nYou can remove or change the default value by setting the attribute\nto an empty string or a value of your choice, respectively.\n */\n @Input()\n set rel(v: SynNavItem['rel']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.rel = v));\n }\n get rel(): SynNavItem['rel'] {\n return this.nativeElement.rel;\n }\n\n @Input()\n set current(v: '' | SynNavItem['current']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.current = v === '' || v),\n );\n }\n get current(): SynNavItem['current'] {\n return this.nativeElement.current;\n }\n\n /**\n * Disables the navigation item.\n */\n @Input()\n set disabled(v: '' | SynNavItem['disabled']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.disabled = v === '' || v),\n );\n }\n get disabled(): SynNavItem['disabled'] {\n return this.nativeElement.disabled;\n }\n\n /**\n * The navigation item's orientation.\n */\n @Input()\n set horizontal(v: '' | SynNavItem['horizontal']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.horizontal = v === '' || v),\n );\n }\n get horizontal(): SynNavItem['horizontal'] {\n return this.nativeElement.horizontal;\n }\n\n /**\n* Appends a chevron to the right side of a navigation item.\nOnly used if `horizontal` is false.\n */\n @Input()\n set chevron(v: '' | SynNavItem['chevron']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.chevron = v === '' || v),\n );\n }\n get chevron(): SynNavItem['chevron'] {\n return this.nativeElement.chevron;\n }\n\n /**\n* Reflects HTML details element state and allows control from parent.\nOnly used if `horizontal` is false and `children` is defined.\n */\n @Input()\n set open(v: '' | SynNavItem['open']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.open = v === '' || v),\n );\n }\n get open(): SynNavItem['open'] {\n return this.nativeElement.open;\n }\n\n /**\n* Toggle to true to show a divider above the element.\nOnly available when horizontal is false.\n */\n @Input()\n set divider(v: '' | SynNavItem['divider']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.divider = v === '' || v),\n );\n }\n get divider(): SynNavItem['divider'] {\n return this.nativeElement.divider;\n }\n\n /**\n * Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.\n */\n @Output() synShowEvent = new EventEmitter<SynShowEvent>();\n\n /**\n * Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.\n */\n @Output() synHideEvent = new EventEmitter<SynHideEvent>();\n\n /**\n * Emitted when the button loses focus.\n */\n @Output() synBlurEvent = new EventEmitter<SynBlurEvent>();\n\n /**\n * Emitted when the button gains focus.\n */\n @Output() synFocusEvent = new EventEmitter<SynFocusEvent>();\n}\n\nexport type { SynShowEvent } from '@synergy-design-system/components';\nexport type { SynHideEvent } from '@synergy-design-system/components';\nexport type { SynBlurEvent } from '@synergy-design-system/components';\nexport type { SynFocusEvent } from '@synergy-design-system/components';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './nav-item.component';\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CG;MAMU,mBAAmB,CAAA;AACvB,IAAA,aAAa;AACZ,IAAA,OAAO;IAEf,WAAY,CAAA,CAAa,EAAE,MAAc,EAAA;AACvC,QAAA,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,aAAa;AACpC,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM;QACrB,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAe,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3B,SAAC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAe,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3B,SAAC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAe,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;A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