@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
1 lines • 11.6 kB
Source Map (JSON)
{"version":3,"file":"synergy-design-system-angular-components-dropdown.mjs","sources":["../../components/dropdown/dropdown.component.ts","../../components/dropdown/synergy-design-system-angular-components-dropdown.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 { SynDropdown } from '@synergy-design-system/components';\nimport type { SynShowEvent } from '@synergy-design-system/components';\nimport type { SynAfterShowEvent } from '@synergy-design-system/components';\nimport type { SynHideEvent } from '@synergy-design-system/components';\nimport type { SynAfterHideEvent } from '@synergy-design-system/components';\nimport '@synergy-design-system/components/components/dropdown/dropdown.js';\n\n/**\n * @summary Dropdowns expose additional content that \"drops down\" in a panel.\n * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-dropdown--docs\n * @status stable\n * @since 2.0\n *\n * @dependency syn-popup\n *\n * @slot - The dropdown's main content.\n * @slot trigger - The dropdown's trigger, usually a `<syn-button>` element.\n *\n * @event syn-show - Emitted when the dropdown opens.\n * @event syn-after-show - Emitted after the dropdown opens and all animations are complete.\n * @event syn-hide - Emitted when the dropdown closes.\n * @event syn-after-hide - Emitted after the dropdown closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper, an `<syn-popup>` element.\n * @csspart base__popup - The popup's exported `popup` part. Use this to target the tooltip's popup container.\n * @csspart trigger - The container that wraps the trigger.\n * @csspart panel - The panel that gets shown when the dropdown is open.\n *\n * @animation dropdown.show - The animation to use when showing the dropdown.\n * @animation dropdown.hide - The animation to use when hiding the dropdown.\n */\n@Component({\n selector: 'syn-dropdown',\n standalone: true,\n template: '<ng-content></ng-content>',\n})\nexport class SynDropdownComponent {\n public nativeElement: SynDropdown;\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(\n 'syn-after-show',\n (e: SynAfterShowEvent) => {\n this.synAfterShowEvent.emit(e);\n },\n );\n this.nativeElement.addEventListener('syn-hide', (e: SynHideEvent) => {\n this.synHideEvent.emit(e);\n });\n this.nativeElement.addEventListener(\n 'syn-after-hide',\n (e: SynAfterHideEvent) => {\n this.synAfterHideEvent.emit(e);\n },\n );\n }\n\n /**\n* Indicates whether or not the dropdown is open.\n* You can toggle this attribute to show and hide the dropdown, or you\ncan use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.\n */\n @Input()\n set open(v: '' | SynDropdown['open']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.open = v === '' || v),\n );\n }\n get open(): SynDropdown['open'] {\n return this.nativeElement.open;\n }\n\n /**\n* The preferred placement of the dropdown panel.\n* Note that the actual placement may vary as needed to keep the panel\ninside of the viewport.\n */\n @Input()\n set placement(v: SynDropdown['placement']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.placement = v));\n }\n get placement(): SynDropdown['placement'] {\n return this.nativeElement.placement;\n }\n\n /**\n * Disables the dropdown so the panel will not open.\n */\n @Input()\n set disabled(v: '' | SynDropdown['disabled']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.disabled = v === '' || v),\n );\n }\n get disabled(): SynDropdown['disabled'] {\n return this.nativeElement.disabled;\n }\n\n /**\n* By default, the dropdown is closed when an item is selected.\n* This attribute will keep it open instead.\n* Useful for\ndropdowns that allow for multiple interactions.\n */\n @Input()\n set stayOpenOnSelect(v: '' | SynDropdown['stayOpenOnSelect']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.stayOpenOnSelect = v === '' || v),\n );\n }\n get stayOpenOnSelect(): SynDropdown['stayOpenOnSelect'] {\n return this.nativeElement.stayOpenOnSelect;\n }\n\n /**\n * The distance in pixels from which to offset the panel away from its trigger.\n */\n @Input()\n set distance(v: SynDropdown['distance']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.distance = v));\n }\n get distance(): SynDropdown['distance'] {\n return this.nativeElement.distance;\n }\n\n /**\n * The distance in pixels from which to offset the panel along its trigger.\n */\n @Input()\n set skidding(v: SynDropdown['skidding']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.skidding = v));\n }\n get skidding(): SynDropdown['skidding'] {\n return this.nativeElement.skidding;\n }\n\n /**\n* Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`.\n* Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @Input()\n set hoist(v: '' | SynDropdown['hoist']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.hoist = v === '' || v),\n );\n }\n get hoist(): SynDropdown['hoist'] {\n return this.nativeElement.hoist;\n }\n\n /**\n * Syncs the popup width or height to that of the trigger element.\n */\n @Input()\n set sync(v: SynDropdown['sync']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.sync = v));\n }\n get sync(): SynDropdown['sync'] {\n return this.nativeElement.sync;\n }\n\n /**\n* The dropdown will close when the user interacts outside of this element (e.g.\n* clicking).\n* Useful for composing other\ncomponents that use a dropdown internally.\n */\n @Input()\n set containingElement(v: SynDropdown['containingElement']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.containingElement = v),\n );\n }\n get containingElement(): SynDropdown['containingElement'] {\n return this.nativeElement.containingElement;\n }\n\n /**\n * Emitted when the dropdown opens.\n */\n @Output() synShowEvent = new EventEmitter<SynShowEvent>();\n\n /**\n * Emitted after the dropdown opens and all animations are complete.\n */\n @Output() synAfterShowEvent = new EventEmitter<SynAfterShowEvent>();\n\n /**\n * Emitted when the dropdown closes.\n */\n @Output() synHideEvent = new EventEmitter<SynHideEvent>();\n\n /**\n * Emitted after the dropdown closes and all animations are complete.\n */\n @Output() synAfterHideEvent = new EventEmitter<SynAfterHideEvent>();\n}\n\nexport type { SynShowEvent } from '@synergy-design-system/components';\nexport type { SynAfterShowEvent } from '@synergy-design-system/components';\nexport type { SynHideEvent } from '@synergy-design-system/components';\nexport type { SynAfterHideEvent } from '@synergy-design-system/components';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './dropdown.component';\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAiBA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;MAMU,oBAAoB,CAAA;AACxB,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,CACjC,gBAAgB,EAChB,CAAC,CAAoB,KAAI;AACvB,YAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,SAAC,CACF;QACD,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,CACjC,gBAAgB,EAChB,CAAC,CAAoB,KAAI;AACvB,YAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,SAAC,CACF;;AAGH;;;;AAIC;IACD,IACI,IAAI,CAAC,CAA2B,EAAA;QAClC,IAAI,CAAC,OAAO,CAAC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