@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
199 lines (195 loc) • 8.01 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/tooltip/tooltip.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 Tooltips display additional information based on a specific action.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-tooltip--docs
* @status stable
* @since 2.0
*
* @dependency syn-popup
*
* @slot - The tooltip's target element. Avoid slotting in more than one element, as subsequent ones will be ignored.
* @slot content - The content to render in the tooltip. Alternatively, you can use the `content` attribute.
*
* @event syn-show - Emitted when the tooltip begins to show.
* @event syn-after-show - Emitted after the tooltip has shown and all animations are complete.
* @event syn-hide - Emitted when the tooltip begins to hide.
* @event syn-after-hide - Emitted after the tooltip has hidden 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 base__arrow - The popup's exported `arrow` part. Use this to target the tooltip's arrow.
* @csspart body - The tooltip's body where its content is rendered.
*
* @cssproperty --max-width - The maximum width of the tooltip before its content will wrap.
* @cssproperty --hide-delay - The amount of time to wait before hiding the tooltip when hovering.
* @cssproperty --show-delay - The amount of time to wait before showing the tooltip when hovering.
*
* @animation tooltip.show - The animation to use when showing the tooltip.
* @animation tooltip.hide - The animation to use when hiding the tooltip.
*/
class SynTooltipComponent {
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);
});
}
/**
* The tooltip's content.
* If you need to display HTML, use the `content` slot instead.
*/
set content(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.content = v));
}
get content() {
return this.nativeElement.content;
}
/**
* The preferred placement of the tooltip.
* Note that the actual placement may vary as needed to keep the tooltip
inside of the viewport.
*/
set placement(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.placement = v));
}
get placement() {
return this.nativeElement.placement;
}
/**
* Disables the tooltip so it won't show when triggered.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* The distance in pixels from which to offset the tooltip away from its target.
*/
set distance(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.distance = v));
}
get distance() {
return this.nativeElement.distance;
}
/**
* Indicates whether or not the tooltip is open.
* You can use this in lieu of the show/hide methods.
*/
set open(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.open = v === '' || v));
}
get open() {
return this.nativeElement.open;
}
/**
* The distance in pixels from which to offset the tooltip along its target.
*/
set skidding(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.skidding = v));
}
get skidding() {
return this.nativeElement.skidding;
}
/**
* Controls how the tooltip is activated.
* Possible options include `click`, `hover`, `focus`, and `manual`.
* Multiple
options can be passed by separating them with a space.
* When manual is used, the tooltip must be activated
programmatically.
*/
set trigger(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.trigger = v));
}
get trigger() {
return this.nativeElement.trigger;
}
/**
* Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with
`overflow: auto|hidden|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;
}
/**
* Emitted when the tooltip begins to show.
*/
synShowEvent = new EventEmitter();
/**
* Emitted after the tooltip has shown and all animations are complete.
*/
synAfterShowEvent = new EventEmitter();
/**
* Emitted when the tooltip begins to hide.
*/
synHideEvent = new EventEmitter();
/**
* Emitted after the tooltip has hidden and all animations are complete.
*/
synAfterHideEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynTooltipComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynTooltipComponent, isStandalone: true, selector: "syn-tooltip", inputs: { content: "content", placement: "placement", disabled: "disabled", distance: "distance", open: "open", skidding: "skidding", trigger: "trigger", hoist: "hoist" }, 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.1", ngImport: i0, type: SynTooltipComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-tooltip',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { content: [{
type: Input
}], placement: [{
type: Input
}], disabled: [{
type: Input
}], distance: [{
type: Input
}], open: [{
type: Input
}], skidding: [{
type: Input
}], trigger: [{
type: Input
}], hoist: [{
type: Input
}], synShowEvent: [{
type: Output
}], synAfterShowEvent: [{
type: Output
}], synHideEvent: [{
type: Output
}], synAfterHideEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynTooltipComponent };
//# sourceMappingURL=synergy-design-system-angular-components-tooltip.mjs.map