{"version":3,"file":"seniorsistemas-angular-components-info-sign.mjs","sources":["../../projects/angular-components/info-sign/src/lib/info-sign/components/info-sign/info-sign.component.ts","../../projects/angular-components/info-sign/src/lib/info-sign/components/info-sign/info-sign.component.html","../../projects/angular-components/info-sign/src/lib/info-sign/info-sign.directive.ts","../../projects/angular-components/info-sign/src/lib/info-sign/info-sign.module.ts","../../projects/angular-components/info-sign/src/seniorsistemas-angular-components-info-sign.ts"],"sourcesContent":["import { Component, TemplateRef } from \"@angular/core\";\n\n@Component({\n    selector: \"s-info-sign-component\",\n    templateUrl: \"./info-sign.component.html\",\n    styleUrls: [\"./info-sign.component.scss\"],\n})\nexport class InfoSignComponent {\n    public templateRef: TemplateRef<any> | null = null;\n    public tooltip?: string;\n    public displayTime?: number;\n    public focusedInputRef: HTMLInputElement | null = null;\n}\n","<span class=\"info-sign\">\n    <span *ngTemplateOutlet=\"templateRef\"></span>\n    <i\n        class=\"info-sign__icon fa fa-info-circle\"\n        aria-hidden=\"true\"\n        [sTooltip]=\"tooltip\"\n        [escape]=\"false\"\n        [displayTime]=\"displayTime\"\n        mobileBehavior=\"tap\"\n        [showDelay]=\"0\"\n        [tooltipEvent]=\"focusedInputRef ? 'focus' : 'hover'\"\n        [focusedInputRef]=\"focusedInputRef\">\n    </i>\n</span>\n","import { ComponentRef, Directive, Input, OnChanges, OnDestroy, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\n\nimport { InfoSignComponent } from './components/info-sign/info-sign.component';\n\n/**\n * @description Diretiva estrutural que exibe um ícone de informação ao lado do elemento hospedeiro.\n * Ao interagir com o ícone, um tooltip com a mensagem configurada é exibido temporariamente.\n * Suporta sincronização de posição com um campo de input referenciado.\n *\n * @example\n * ```html\n * <input *sInfoSign=\"'Informe seu CPF'; displayTime: 4000\" type=\"text\" />\n * ```\n *\n * @category Overlay\n */\n@Directive({\n    selector: '[sInfoSign]',\n})\nexport class InfoSignDirective implements OnChanges, OnInit, OnDestroy {\n    private readonly templateRef = inject<TemplateRef<any>>(TemplateRef);\n    private readonly viewContainer = inject(ViewContainerRef);\n\n    /**\n     * @description Mensagem exibida no tooltip do ícone de informação. Campo obrigatório.\n     */\n    @Input({ required: true })\n    public sInfoSign!: string;\n\n    /**\n     * @description Tempo em milissegundos que o tooltip permanece visível após ser exibido.\n     *\n     * @default 5000\n     */\n    @Input('sInfoSignDisplayTime')\n    public displayTime: number = 5000;\n\n    /**\n     * @description Referência a um elemento de input HTML para posicionamento relativo do info sign.\n     * Utilizado quando `useFocusedInputRef` é `true`.\n     */\n    @Input('sInfoSignFocusedInputRef')\n    public focusedInputRef: HTMLInputElement | HTMLElement | undefined | null = null;\n\n    /**\n     * @description Quando `true`, utiliza `focusedInputRef` para calcular o posicionamento do ícone.\n     *\n     * @default true\n     */\n    @Input('sInfoSignUseFocusedInputRef') public useFocusedInputRef = true;\n\n    private componentRef: ComponentRef<InfoSignComponent> | null = null;\n\n    public ngOnChanges(): void {\n        this.createInfoSign();\n    }\n\n    public ngOnInit(): void {\n        this.createInfoSign();\n    }\n\n    public ngOnDestroy(): void {\n        if (this.componentRef) {\n            this.componentRef.destroy();\n        }\n    }\n\n    private createInfoSign(): void {\n        if (!this.componentRef && this.sInfoSign) {\n            this.viewContainer.clear();\n            this.componentRef = this.viewContainer.createComponent(InfoSignComponent);\n            const _infoSignComponent = this.componentRef.instance as InfoSignComponent;\n            _infoSignComponent.templateRef = this.templateRef;\n            _infoSignComponent.tooltip = this.sInfoSign;\n            _infoSignComponent.displayTime = this.displayTime;\n            if (this.useFocusedInputRef && this.focusedInputRef) {\n                _infoSignComponent.focusedInputRef = this.focusedInputRef as HTMLInputElement;\n            }\n        } else if (this.componentRef && this.sInfoSign) {\n            this.componentRef.instance.tooltip = this.sInfoSign;\n        } else {\n            this.viewContainer.clear();\n            this.viewContainer.createEmbeddedView(this.templateRef);\n        }\n    }\n}\n\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { InfoSignComponent } from './components/info-sign/info-sign.component';\nimport { InfoSignDirective } from './info-sign.directive';\nimport { TooltipModule } from '@seniorsistemas/angular-components/tooltip';\n\n@NgModule({\n    imports: [TooltipModule, CommonModule],\n    declarations: [InfoSignDirective, InfoSignComponent],\n    exports: [InfoSignDirective],\n})\nexport class InfoSignModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAOa,iBAAiB,CAAA;IACnB,WAAW,GAA4B,IAAI,CAAC;AAC5C,IAAA,OAAO,CAAU;AACjB,IAAA,WAAW,CAAU;IACrB,eAAe,GAA4B,IAAI,CAAC;wGAJ9C,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,6DCP9B,+cAcA,EAAA,MAAA,EAAA,CAAA,8HAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,cAAA,EAAA,QAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FDPa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACI,uBAAuB,EAAA,QAAA,EAAA,+cAAA,EAAA,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