@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
206 lines (202 loc) • 8.09 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/dropdown/dropdown.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 Dropdowns expose additional content that "drops down" in a panel.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-dropdown--docs
* @status stable
* @since 2.0
*
* @dependency syn-popup
*
* @slot - The dropdown's main content.
* @slot trigger - The dropdown's trigger, usually a `<syn-button>` element.
*
* @event syn-show - Emitted when the dropdown opens.
* @event syn-after-show - Emitted after the dropdown opens and all animations are complete.
* @event syn-hide - Emitted when the dropdown closes.
* @event syn-after-hide - Emitted after the dropdown closes and all animations are complete.
*
* @csspart base - The component's base wrapper, an `<syn-popup>` element.
* @csspart base__popup - The popup's exported `popup` part. Use this to target the tooltip's popup container.
* @csspart trigger - The container that wraps the trigger.
* @csspart panel - The panel that gets shown when the dropdown is open.
*
* @animation dropdown.show - The animation to use when showing the dropdown.
* @animation dropdown.hide - The animation to use when hiding the dropdown.
*/
class SynDropdownComponent {
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-after-show', (e) => {
this.synAfterShowEvent.emit(e);
});
this.nativeElement.addEventListener('syn-hide', (e) => {
this.synHideEvent.emit(e);
});
this.nativeElement.addEventListener('syn-after-hide', (e) => {
this.synAfterHideEvent.emit(e);
});
}
/**
* Indicates whether or not the dropdown is open.
* You can toggle this attribute to show and hide the dropdown, or you
can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.
*/
set open(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.open = v === '' || v));
}
get open() {
return this.nativeElement.open;
}
/**
* The preferred placement of the dropdown panel.
* Note that the actual placement may vary as needed to keep the panel
inside of the viewport.
*/
set placement(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.placement = v));
}
get placement() {
return this.nativeElement.placement;
}
/**
* Disables the dropdown so the panel will not open.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* By default, the dropdown is closed when an item is selected.
* This attribute will keep it open instead.
* Useful for
dropdowns that allow for multiple interactions.
*/
set stayOpenOnSelect(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.stayOpenOnSelect = v === '' || v));
}
get stayOpenOnSelect() {
return this.nativeElement.stayOpenOnSelect;
}
/**
* The distance in pixels from which to offset the panel away from its trigger.
*/
set distance(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.distance = v));
}
get distance() {
return this.nativeElement.distance;
}
/**
* The distance in pixels from which to offset the panel along its trigger.
*/
set skidding(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.skidding = v));
}
get skidding() {
return this.nativeElement.skidding;
}
/**
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with
`overflow: auto|scroll`.
* Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.
*/
set hoist(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.hoist = v === '' || v));
}
get hoist() {
return this.nativeElement.hoist;
}
/**
* Syncs the popup width or height to that of the trigger element.
*/
set sync(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.sync = v));
}
get sync() {
return this.nativeElement.sync;
}
/**
* The dropdown will close when the user interacts outside of this element (e.g.
* clicking).
* Useful for composing other
components that use a dropdown internally.
*/
set containingElement(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.containingElement = v));
}
get containingElement() {
return this.nativeElement.containingElement;
}
/**
* Emitted when the dropdown opens.
*/
synShowEvent = new EventEmitter();
/**
* Emitted after the dropdown opens and all animations are complete.
*/
synAfterShowEvent = new EventEmitter();
/**
* Emitted when the dropdown closes.
*/
synHideEvent = new EventEmitter();
/**
* Emitted after the dropdown closes and all animations are complete.
*/
synAfterHideEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: SynDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: SynDropdownComponent, isStandalone: true, selector: "syn-dropdown", inputs: { open: "open", placement: "placement", disabled: "disabled", stayOpenOnSelect: "stayOpenOnSelect", distance: "distance", skidding: "skidding", hoist: "hoist", sync: "sync", containingElement: "containingElement" }, outputs: { synShowEvent: "synShowEvent", synAfterShowEvent: "synAfterShowEvent", synHideEvent: "synHideEvent", synAfterHideEvent: "synAfterHideEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: SynDropdownComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-dropdown',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { open: [{
type: Input
}], placement: [{
type: Input
}], disabled: [{
type: Input
}], stayOpenOnSelect: [{
type: Input
}], distance: [{
type: Input
}], skidding: [{
type: Input
}], hoist: [{
type: Input
}], sync: [{
type: Input
}], containingElement: [{
type: Input
}], synShowEvent: [{
type: Output
}], synAfterShowEvent: [{
type: Output
}], synHideEvent: [{
type: Output
}], synAfterHideEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynDropdownComponent };
//# sourceMappingURL=synergy-design-system-angular-components-dropdown.mjs.map