{"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';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';\r\n\r\n@Component({\r\n    selector: 's-info-sign-component',\r\n    templateUrl: './info-sign.component.html',\r\n    styleUrls: ['./info-sign.component.scss'],\r\n    standalone: true,\r\n    imports: [NgTemplateOutlet, TooltipDirective],\r\n})\r\nexport class InfoSignComponent {\r\n    public templateRef: TemplateRef<any> | null = null;\r\n    public tooltip?: string;\r\n    public displayTime?: number;\r\n    public focusedInputRef: HTMLInputElement | null = null;\r\n}\r\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 {\r\n    ComponentRef,\r\n    Directive,\r\n    Input,\r\n    OnChanges,\r\n    OnDestroy,\r\n    OnInit,\r\n    TemplateRef,\r\n    ViewContainerRef,\r\n    inject,\r\n} from '@angular/core';\r\n\r\nimport { InfoSignComponent } from './components/info-sign/info-sign.component';\r\n\r\n/**\r\n * @description Diretiva estrutural que exibe um ícone de informação ao lado do elemento hospedeiro.\r\n * Ao interagir com o ícone, um tooltip com a mensagem configurada é exibido temporariamente.\r\n * Suporta sincronização de posição com um campo de input referenciado.\r\n *\r\n * @example\r\n * ```html\r\n * <input *sInfoSign=\"'Informe seu CPF'; displayTime: 4000\" type=\"text\" />\r\n * ```\r\n *\r\n * @category Overlay\r\n */\r\n@Directive({\r\n    selector: '[sInfoSign]',\r\n    standalone: true,\r\n})\r\nexport class InfoSignDirective implements OnChanges, OnInit, OnDestroy {\r\n    private readonly templateRef = inject<TemplateRef<any>>(TemplateRef);\r\n    private readonly viewContainer = inject(ViewContainerRef);\r\n\r\n    /**\r\n     * @description Mensagem exibida no tooltip do ícone de informação. Campo obrigatório.\r\n     */\r\n    @Input({ required: true })\r\n    public sInfoSign!: string;\r\n\r\n    /**\r\n     * @description Tempo em milissegundos que o tooltip permanece visível após ser exibido.\r\n     *\r\n     * @default 5000\r\n     */\r\n    @Input('sInfoSignDisplayTime')\r\n    public displayTime: number = 5000;\r\n\r\n    /**\r\n     * @description Referência a um elemento de input HTML para posicionamento relativo do info sign.\r\n     * Utilizado quando `useFocusedInputRef` é `true`.\r\n     */\r\n    @Input('sInfoSignFocusedInputRef')\r\n    public focusedInputRef: HTMLInputElement | HTMLElement | undefined | null = null;\r\n\r\n    /**\r\n     * @description Quando `true`, utiliza `focusedInputRef` para calcular o posicionamento do ícone.\r\n     *\r\n     * @default true\r\n     */\r\n    @Input('sInfoSignUseFocusedInputRef') public useFocusedInputRef = true;\r\n\r\n    private componentRef: ComponentRef<InfoSignComponent> | null = null;\r\n\r\n    public ngOnChanges(): void {\r\n        this.createInfoSign();\r\n    }\r\n\r\n    public ngOnInit(): void {\r\n        this.createInfoSign();\r\n    }\r\n\r\n    public ngOnDestroy(): void {\r\n        if (this.componentRef) {\r\n            this.componentRef.destroy();\r\n        }\r\n    }\r\n\r\n    private createInfoSign(): void {\r\n        if (!this.componentRef && this.sInfoSign) {\r\n            this.viewContainer.clear();\r\n            this.componentRef = this.viewContainer.createComponent(InfoSignComponent);\r\n            const _infoSignComponent = this.componentRef.instance as InfoSignComponent;\r\n            _infoSignComponent.templateRef = this.templateRef;\r\n            _infoSignComponent.tooltip = this.sInfoSign;\r\n            _infoSignComponent.displayTime = this.displayTime;\r\n            if (this.useFocusedInputRef && this.focusedInputRef) {\r\n                _infoSignComponent.focusedInputRef = this.focusedInputRef as HTMLInputElement;\r\n            }\r\n        } else if (this.componentRef && this.sInfoSign) {\r\n            this.componentRef.instance.tooltip = this.sInfoSign;\r\n        } else {\r\n            this.viewContainer.clear();\r\n            this.viewContainer.createEmbeddedView(this.templateRef);\r\n        }\r\n    }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { InfoSignDirective } from './info-sign.directive';\r\n\r\n@NgModule({\r\n    imports: [InfoSignDirective],\r\n    exports: [InfoSignDirective],\r\n})\r\nexport class InfoSignModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAWa,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,ECX9B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,+cAcA,EDLc,MAAA,EAAA,CAAA,8HAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,gBAAgB,oJAAE,gBAAgB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,iBAAA,EAAA,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