keevo-components 1.8.340 → 1.8.341

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, Injectable, Directive, Pipe, ViewChildren, ContentChildren, forwardRef, model, HostListener, NgModule, signal, input, viewChild, computed, inject, contentChildren, effect, ChangeDetectionStrategy, HostBinding, Injector } from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, ViewChild, Injectable, Directive, Pipe, ViewChildren, ContentChildren, forwardRef, model, HostListener, NgModule, signal, computed, input, viewChild, inject, contentChildren, effect, ChangeDetectionStrategy, HostBinding, Injector } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, NgClass } from '@angular/common';
5
5
  import * as i1$1 from 'primeng/button';
@@ -47,24 +47,26 @@ import { DividerModule } from 'primeng/divider';
47
47
  import * as i1$4 from '@angular/common/http';
48
48
  import { HttpHeaders } from '@angular/common/http';
49
49
  import { filter as filter$1 } from 'rxjs/operators';
50
+ import { DialogModule } from 'primeng/dialog';
51
+ import * as i2$2 from 'primeng/slider';
52
+ import { SliderModule } from 'primeng/slider';
53
+ import { FileUploadModule } from 'primeng/fileupload';
50
54
  import { AccordionModule } from 'primeng/accordion';
51
55
  import { BadgeModule } from 'primeng/badge';
52
56
  import * as i5$9 from 'primeng/breadcrumb';
53
57
  import { BreadcrumbModule } from 'primeng/breadcrumb';
54
58
  import * as i5$4 from 'primeng/calendar';
55
59
  import { CalendarModule } from 'primeng/calendar';
56
- import * as i2$2 from 'primeng/carousel';
60
+ import * as i2$3 from 'primeng/carousel';
57
61
  import { CarouselModule, Carousel } from 'primeng/carousel';
58
62
  import { ChipModule } from 'primeng/chip';
59
63
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
60
64
  import * as i7$2 from 'primeng/contextmenu';
61
65
  import { ContextMenuModule } from 'primeng/contextmenu';
62
66
  import { DataViewModule } from 'primeng/dataview';
63
- import { DialogModule } from 'primeng/dialog';
64
67
  import { EditorModule } from 'primeng/editor';
65
- import * as i2$4 from 'primeng/fieldset';
68
+ import * as i2$5 from 'primeng/fieldset';
66
69
  import { FieldsetModule } from 'primeng/fieldset';
67
- import { FileUploadModule } from 'primeng/fileupload';
68
70
  import { ImageModule } from 'primeng/image';
69
71
  import * as i5$5 from 'primeng/inputmask';
70
72
  import { InputMaskModule } from 'primeng/inputmask';
@@ -104,17 +106,15 @@ import { ToastModule } from 'primeng/toast';
104
106
  import { ToolbarModule } from 'primeng/toolbar';
105
107
  import * as i1$6 from 'primeng/tree';
106
108
  import { TreeModule } from 'primeng/tree';
107
- import * as i2$3 from 'primeng/selectbutton';
109
+ import * as i2$4 from 'primeng/selectbutton';
108
110
  import { SelectButtonModule } from 'primeng/selectbutton';
109
111
  import * as i3$3 from 'primeng/stepper';
110
112
  import { StepperModule } from 'primeng/stepper';
111
113
  import { InputGroupModule } from 'primeng/inputgroup';
112
114
  import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
113
- import * as i4$1 from 'primeng/slider';
114
- import { SliderModule } from 'primeng/slider';
115
- import Quill from 'quill';
116
115
  import * as i1$5 from 'ngx-loading';
117
116
  import { NgxLoadingModule } from 'ngx-loading';
117
+ import Quill from 'quill';
118
118
  import { ProgressSpinnerModule } from 'primeng/progressspinner';
119
119
  import { OrgChart } from 'd3-org-chart';
120
120
  import * as d3 from 'd3';
@@ -3684,6 +3684,118 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
3684
3684
  }]
3685
3685
  }], ctorParameters: () => [] });
3686
3686
 
3687
+ class KvLabelModule {
3688
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3689
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, declarations: [KvLabelComponent], imports: [CommonModule], exports: [KvLabelComponent] }); }
3690
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, imports: [CommonModule] }); }
3691
+ }
3692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, decorators: [{
3693
+ type: NgModule,
3694
+ args: [{
3695
+ declarations: [
3696
+ KvLabelComponent
3697
+ ],
3698
+ imports: [
3699
+ CommonModule
3700
+ ],
3701
+ exports: [
3702
+ KvLabelComponent
3703
+ ]
3704
+ }]
3705
+ }] });
3706
+
3707
+ class KvModalComponent {
3708
+ constructor(dynamicDialogRef) {
3709
+ this.dynamicDialogRef = dynamicDialogRef;
3710
+ /**
3711
+ * Ações do Dialog
3712
+ */
3713
+ this.actions = [];
3714
+ this.actionsPosition = 'right';
3715
+ this.justify_content = 'justify-content-start';
3716
+ }
3717
+ ngOnInit() {
3718
+ this.addSubTitle();
3719
+ this.setMarginBottom();
3720
+ this.defPositionButtons();
3721
+ }
3722
+ onWindowResize() {
3723
+ this.setMarginBottom();
3724
+ }
3725
+ /**
3726
+ * Adiciona sub-título à tela
3727
+ */
3728
+ addSubTitle() {
3729
+ if (this.subtitle) {
3730
+ const headerElement = document.querySelector('.p-dialog .p-dialog-header');
3731
+ if (headerElement) {
3732
+ const subtitleElement = document.createElement('span');
3733
+ subtitleElement.textContent = this.subtitle;
3734
+ subtitleElement.style.fontSize = '0.75rem';
3735
+ subtitleElement.style.width = '100%';
3736
+ subtitleElement.style.marginLeft = '2px';
3737
+ headerElement.appendChild(subtitleElement);
3738
+ }
3739
+ if (this.subHeader) {
3740
+ const headerElement = document.querySelector('.p-dialog .p-dialog-header');
3741
+ const subHeader = this.subHeader.nativeElement;
3742
+ if (headerElement && this.subHeader) {
3743
+ subHeader.style.width = '100%';
3744
+ subHeader.style.marginLeft = '2px';
3745
+ headerElement.appendChild(this.subHeader.nativeElement);
3746
+ }
3747
+ }
3748
+ }
3749
+ }
3750
+ defPositionButtons() {
3751
+ if (this.actionsPosition === 'right') {
3752
+ this.justify_content = 'justify-content-end';
3753
+ }
3754
+ if (this.actionsPosition === 'center') {
3755
+ this.justify_content = 'justify-content-center';
3756
+ }
3757
+ if (this.actionsPosition === 'left') {
3758
+ this.justify_content = 'justify-content-start';
3759
+ }
3760
+ }
3761
+ setMarginBottom() {
3762
+ let actionsFieldHeight = document.getElementById('actions-field')?.offsetHeight;
3763
+ let divBox = document.getElementById('content-modal');
3764
+ if (divBox) {
3765
+ if (actionsFieldHeight) {
3766
+ divBox.style.marginBottom = `${actionsFieldHeight + 30}px`;
3767
+ }
3768
+ else {
3769
+ divBox.style.marginBottom = `50px`;
3770
+ }
3771
+ }
3772
+ }
3773
+ clickExecute(action) {
3774
+ if (action.command) {
3775
+ action.command();
3776
+ if (action.closeAfterClick != false)
3777
+ this.dynamicDialogRef.close();
3778
+ }
3779
+ }
3780
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalComponent, deps: [{ token: i1$3.DynamicDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
3781
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: KvModalComponent, selector: "kv-modal", inputs: { actions: "actions", actionsPosition: "actionsPosition", subtitle: "subtitle", subHeader: "subHeader" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, ngImport: i0, template: "<!-- RENDERIZA\u00C7\u00C3O DO MODAL -->\r\n<div class=\"col-12 mb-4\" id=\"content-modal\">\r\n <!-- COLOCAR UM COMPONENTE SUBHEADER AQUI -->\r\n\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<!-- RENDERIZA\u00C7\u00C3O DOS BOT\u00D5ES -->\r\n\r\n<div class=\"bg-white flex flex-row flex-wrap gap-2 p-2 modal-barra-acoes {{justify_content}}\" *ngIf=\"actions\" id=\"actions-field\">\r\n <kv-button\r\n *ngFor=\" let action of actions\"\r\n [ngClass]=\"action.visible==false?'hidden':''\"\r\n icon=\"{{action.icon}}\"\r\n label=\"{{action.label}}\"\r\n [disabled]=\"action.disabled || false\"\r\n (onClick)=\"clickExecute(action)\"\r\n [severity]=\"action.severity ||'primary'\"\r\n />\r\n</div>\r\n", styles: ["*{padding-bottom:0rem;padding-top:0rem}.barra-acoes{position:fixed;bottom:0;left:0;right:0;background-color:#fff;padding:10px;z-index:999}#page-form-container{padding-bottom:40px}@media screen and (max-width: 991px){#page-form-container{padding-bottom:100px}}.modal-barra-acoes{position:fixed;bottom:0;left:0;right:0;z-index:999;margin-right:1.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["label", "icon", "loading", "disabled", "severity", "size", "fullWidth"], outputs: ["onClick"] }] }); }
3782
+ }
3783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalComponent, decorators: [{
3784
+ type: Component,
3785
+ args: [{ selector: 'kv-modal', template: "<!-- RENDERIZA\u00C7\u00C3O DO MODAL -->\r\n<div class=\"col-12 mb-4\" id=\"content-modal\">\r\n <!-- COLOCAR UM COMPONENTE SUBHEADER AQUI -->\r\n\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<!-- RENDERIZA\u00C7\u00C3O DOS BOT\u00D5ES -->\r\n\r\n<div class=\"bg-white flex flex-row flex-wrap gap-2 p-2 modal-barra-acoes {{justify_content}}\" *ngIf=\"actions\" id=\"actions-field\">\r\n <kv-button\r\n *ngFor=\" let action of actions\"\r\n [ngClass]=\"action.visible==false?'hidden':''\"\r\n icon=\"{{action.icon}}\"\r\n label=\"{{action.label}}\"\r\n [disabled]=\"action.disabled || false\"\r\n (onClick)=\"clickExecute(action)\"\r\n [severity]=\"action.severity ||'primary'\"\r\n />\r\n</div>\r\n", styles: ["*{padding-bottom:0rem;padding-top:0rem}.barra-acoes{position:fixed;bottom:0;left:0;right:0;background-color:#fff;padding:10px;z-index:999}#page-form-container{padding-bottom:40px}@media screen and (max-width: 991px){#page-form-container{padding-bottom:100px}}.modal-barra-acoes{position:fixed;bottom:0;left:0;right:0;z-index:999;margin-right:1.5rem}\n"] }]
3786
+ }], ctorParameters: () => [{ type: i1$3.DynamicDialogRef }], propDecorators: { actions: [{
3787
+ type: Input
3788
+ }], actionsPosition: [{
3789
+ type: Input
3790
+ }], subtitle: [{
3791
+ type: Input
3792
+ }], subHeader: [{
3793
+ type: Input
3794
+ }], onWindowResize: [{
3795
+ type: HostListener,
3796
+ args: ['window:resize', ['$event']]
3797
+ }] } });
3798
+
3687
3799
  class PrimeNgModule {
3688
3800
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: PrimeNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3689
3801
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: PrimeNgModule, exports: [AccordionModule,
@@ -3891,178 +4003,412 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
3891
4003
  }]
3892
4004
  }] });
3893
4005
 
3894
- class KvAvatarComponent {
3895
- constructor(imageService, notificationService) {
3896
- this.imageService = imageService;
3897
- this.notificationService = notificationService;
3898
- this.borderColor = '#002542';
3899
- this.btnsColor = '#002542';
3900
- this.width = 135;
3901
- this.height = 135;
3902
- this.imageUrlChange = new EventEmitter();
3903
- this.onModalOpen = new EventEmitter();
3904
- this.removerFotoEvent = new EventEmitter();
3905
- this.btnAlterarFoto = false;
3906
- this.existeLogo = false;
3907
- this.selectedImage = '';
3908
- this.showCropModal = false;
3909
- this.imageLoaded = false;
3910
- this.imageX = 0;
3911
- this.imageY = 0;
4006
+ class KvButtonModule {
4007
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4008
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, declarations: [KvButtonComponent], imports: [CommonModule,
4009
+ PrimeNgModule], exports: [KvButtonComponent] }); }
4010
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, imports: [CommonModule,
4011
+ PrimeNgModule] }); }
4012
+ }
4013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, decorators: [{
4014
+ type: NgModule,
4015
+ args: [{
4016
+ declarations: [
4017
+ KvButtonComponent
4018
+ ],
4019
+ imports: [
4020
+ CommonModule,
4021
+ PrimeNgModule
4022
+ ],
4023
+ exports: [
4024
+ KvButtonComponent
4025
+ ]
4026
+ }]
4027
+ }] });
4028
+
4029
+ class KvModalModule {
4030
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4031
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, declarations: [KvModalComponent], imports: [CommonModule, PrimeNgModule, KvButtonModule], exports: [KvModalComponent] }); }
4032
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, imports: [CommonModule, PrimeNgModule, KvButtonModule] }); }
4033
+ }
4034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, decorators: [{
4035
+ type: NgModule,
4036
+ args: [{
4037
+ declarations: [KvModalComponent],
4038
+ imports: [CommonModule, PrimeNgModule, KvButtonModule],
4039
+ exports: [KvModalComponent],
4040
+ }]
4041
+ }] });
4042
+
4043
+ class ImageCutterService {
4044
+ constructor(dialogservice) {
4045
+ this.dialogservice = dialogservice;
4046
+ }
4047
+ cut(imageBase64, width, height, indCircle = false) {
4048
+ const cutConfig = { imageBase64, width, height, indCircle };
4049
+ this.abrirModal(cutConfig);
4050
+ return new Promise((resolve, reject) => {
4051
+ window.addEventListener('cropImage', (event) => {
4052
+ if (event.detail.status == true) {
4053
+ resolve(event.detail.result);
4054
+ }
4055
+ else {
4056
+ reject('Operacao cancelada.');
4057
+ }
4058
+ });
4059
+ });
4060
+ }
4061
+ abrirModal(cutConfig) {
4062
+ const params = {
4063
+ closable: true,
4064
+ maximizable: false,
4065
+ popup: true,
4066
+ width: '75vw',
4067
+ header: `Cortar`,
4068
+ id: { imagem: cutConfig.imageBase64, width: cutConfig.width, height: cutConfig.height, indCircle: cutConfig.indCircle },
4069
+ styleClass: 'modal'
4070
+ };
4071
+ const dialogRef = FormService.openDialog(this.dialogservice, SimpleComponent, () => { }, params);
4072
+ }
4073
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ImageCutterService, deps: [{ token: i1$3.DialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4074
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ImageCutterService, providedIn: 'root' }); }
4075
+ }
4076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ImageCutterService, decorators: [{
4077
+ type: Injectable,
4078
+ args: [{
4079
+ providedIn: 'root'
4080
+ }]
4081
+ }], ctorParameters: () => [{ type: i1$3.DialogService }] });
4082
+ class SimpleComponent {
4083
+ constructor(dynamicDialogRef, dialogService) {
4084
+ this.dynamicDialogRef = dynamicDialogRef;
4085
+ this.dialogService = dialogService;
4086
+ // ? Variavies que recebem os valores do dialog
4087
+ this._variaviesDialog = signal(null);
4088
+ //? Referências para o contexto e canvas
4089
+ this.canvas = signal(null);
4090
+ this.ctx = signal(null);
4091
+ this._Image = signal(new Image());
4092
+ //? Coordenadas iniciais e finais do desenho
3912
4093
  this.startX = 0;
3913
4094
  this.startY = 0;
3914
- this.valueZoom = 20;
3915
- this.scaleFactor = 2;
3916
- this.canvasWidth = signal(null);
3917
- this.canvasHeight = signal(null);
3918
- this.imageUrl = input(this.imageService.userDefaultImage());
3919
- this.imageSource = signal(this.imageService.userDefaultImage());
3920
- this.imgCanva = signal(null);
3921
- this.widthTela = window.innerWidth;
4095
+ //? Fator de escala da imagem e zoom
4096
+ this.scaleFactorReadOnly = computed(() => {
4097
+ return Math.min(this.scaleFactor(), 3);
4098
+ });
4099
+ this.scaleFactor = signal(null);
4100
+ this.scaleFactorModel = 0;
4101
+ this.imageX = 0;
4102
+ this.imageY = 0;
4103
+ //#region Propriedades computadas de tamanho do canvas e da imagem
4104
+ //? Largura e altura do canvas baseado na tamanho da tela
4105
+ this.canvasWidth = computed(() => this.widthTela() * 0.5);
4106
+ this.canvasHeight = computed(() => this.heigthTela() * 0.5);
4107
+ //? Largura e altura da área de corte
4108
+ this.cutWidth = computed(() => {
4109
+ if (this._variaviesDialog()?.indCircle) {
4110
+ return this.radius() * 2;
4111
+ }
4112
+ else {
4113
+ const canvasWidth = this.canvasWidth();
4114
+ const maxWidth = canvasWidth * 0.8;
4115
+ const proportionalHeight = maxWidth * this.proporcaoImagem();
4116
+ return proportionalHeight > this.canvasHeight() * 0.8 ? this.canvasHeight() * 0.8 / this.proporcaoImagem() : maxWidth;
4117
+ }
4118
+ });
4119
+ this.cutHeight = computed(() => {
4120
+ if (this._variaviesDialog()?.indCircle) {
4121
+ return this.radius() * 2;
4122
+ }
4123
+ else {
4124
+ const canvasHeight = this.canvasHeight();
4125
+ const maxHeight = canvasHeight * 0.8;
4126
+ const proportionalWidth = maxHeight / this.proporcaoImagem();
4127
+ return proportionalWidth > this.canvasWidth() * 0.8 ? this.canvasWidth() * 0.8 * this.proporcaoImagem() : maxHeight;
4128
+ }
4129
+ });
4130
+ //? Largura e altura da imagem no canvas (baseado na escala) - tamanho real da imagem
4131
+ this.canvaImageWidth = computed(() => {
4132
+ return this._Image().width * this.scaleFactorReadOnly();
4133
+ });
4134
+ this.canvaImageHeight = computed(() => {
4135
+ return this._Image().height * this.scaleFactorReadOnly();
4136
+ });
4137
+ this.proporcaoImagem = computed(() => {
4138
+ return this._variaviesDialog()?.height / this._variaviesDialog()?.width;
4139
+ });
4140
+ this.radius = computed(() => {
4141
+ const minSize = Math.min(this.canvasHeight() * 0.8, this.canvasWidth() * 0.8);
4142
+ return minSize / 2;
4143
+ });
4144
+ //#endregion
4145
+ // #region Limites de movimentação da imagem
4146
+ //? Limites de movimentação da imagem
4147
+ this.indCircle = computed(() => {
4148
+ return this._variaviesDialog()?.indCircle;
4149
+ });
4150
+ this.xMin = computed(() => {
4151
+ return !this._variaviesDialog()?.indCircle ? (this.canvasWidth() - this.cutWidth()) / 2 : (this.canvasWidth() - (this.radius() * 2)) / 2;
4152
+ });
4153
+ this.yMin = computed(() => {
4154
+ return !this._variaviesDialog()?.indCircle ? (this.canvasHeight() - this.cutHeight()) / 2 : (this.canvasHeight() - (this.radius() * 2)) / 2;
4155
+ });
4156
+ this.xMax = computed(() => {
4157
+ return !this._variaviesDialog()?.indCircle ? -(this.canvaImageWidth() - (this.xMin()) - this.cutWidth()) : -(this.canvaImageWidth() - (this.xMin()) - (this.radius() * 2));
4158
+ });
4159
+ this.yMax = computed(() => {
4160
+ return !this._variaviesDialog()?.indCircle ? -(this.canvaImageHeight() - (this.yMin()) - this.cutHeight()) : -(this.canvaImageHeight() - (this.yMin()) - (this.radius() * 2));
4161
+ });
4162
+ // #endregion
4163
+ //? Proporção da imagem
4164
+ this.widthTela = signal(0);
4165
+ this.heigthTela = signal(0);
4166
+ this.atualizaTamanhoTela();
3922
4167
  }
3923
- ngOnInit() {
3924
- this.imageSource.set(this.imageUrl());
3925
- this.getImageSrc();
4168
+ setScaleFactorModel(valor) {
4169
+ this.scaleFactorModel = valor;
4170
+ this.scaleFactor.set(this.scaleFactorModel);
3926
4171
  }
3927
4172
  onWindowResize() {
3928
- this.widthTela = window.innerWidth;
3929
- this.heigthTela = window.innerHeight;
4173
+ this.atualizaTamanhoTela();
3930
4174
  this.updateCanvasSize();
3931
- this.updateCropBorderSize();
4175
+ this.atualizaCutBorder();
3932
4176
  }
3933
- getImageSrc() {
3934
- const imageUrl = this.imageUrl();
3935
- if (imageUrl && (imageUrl.startsWith('data:image') || imageUrl.startsWith('http') || imageUrl.startsWith('https'))) {
3936
- this.existeLogo = true;
4177
+ atualizaTamanhoTela() {
4178
+ this.widthTela.set(window.innerWidth);
4179
+ this.heigthTela.set(window.innerHeight);
4180
+ }
4181
+ ngAfterViewInit() {
4182
+ this.recuperarVariaviesDialog();
4183
+ this.inciarReferencias();
4184
+ this.iniciarCanvas();
4185
+ }
4186
+ inciarReferencias() {
4187
+ this.canvas.set(this.cropCanvas.nativeElement);
4188
+ this.ctx.set(this.canvas().getContext('2d'));
4189
+ this._Image().src = this._variaviesDialog()?.imagem;
4190
+ }
4191
+ iniciarCanvas() {
4192
+ this._Image().onload = () => {
4193
+ //? Define o tamanho do canvas
4194
+ this.canvas().height = this.canvasHeight();
4195
+ this.canvas().width = this.canvasWidth();
4196
+ this.ajustarZommEPosicaoInicial();
4197
+ this.initializeImageMove(this.canvas(), this.ctx(), this._Image());
4198
+ this.initializeMouseWheel(this.canvas(), this.ctx(), this._Image());
4199
+ this.redrawCanvas(this.ctx(), this._Image());
4200
+ };
4201
+ }
4202
+ ajustarZommEPosicaoInicial() {
4203
+ const cutWidth = this.cutWidth();
4204
+ const cutHeight = this.cutHeight();
4205
+ const imageWidth = this._Image().width;
4206
+ const imageHeight = this._Image().height;
4207
+ //? Ajusta possição e zoom inicial
4208
+ if (this._variaviesDialog()?.indCircle) {
4209
+ const scaleFactor = (this.radius() * 2) / Math.min(imageWidth, imageHeight);
4210
+ this.setScaleFactorModel(scaleFactor);
4211
+ this.scaleFactor.set(scaleFactor);
3937
4212
  }
3938
- else if (imageUrl && imageUrl.length > 0) {
3939
- this.existeLogo = true;
3940
- this.imageSource.set('data:image/jpg;base64,' + imageUrl);
4213
+ else {
4214
+ const scaleFactor = this.cutHeight() === this.cutWidth()
4215
+ ? this._Image().width > this._Image().height
4216
+ ? this.cutHeight() / imageHeight
4217
+ : this.cutWidth() / imageWidth
4218
+ : this.cutHeight() > this.cutWidth()
4219
+ ? this.cutHeight() / imageHeight
4220
+ : this.cutWidth() / imageWidth;
4221
+ this.setScaleFactorModel(scaleFactor);
4222
+ this.scaleFactor.set(scaleFactor);
4223
+ }
4224
+ this.imageX = Math.max((this.canvas().width - imageWidth * this.scaleFactorReadOnly()) / 2, this.xMin());
4225
+ this.imageY = Math.max((this.canvasHeight() - imageHeight * this.scaleFactorReadOnly()) / 2, this.yMin());
4226
+ }
4227
+ //#region Métodos de recuperação de dados
4228
+ recuperaInstanciaDialog() {
4229
+ const arr = this.dialogService.dialogComponentRefMap;
4230
+ const entries = arr.entries();
4231
+ const firstEntry = entries.next().value;
4232
+ const [firstKey, firstValue] = firstEntry;
4233
+ const instance = this.dialogService.getInstance(firstKey);
4234
+ this.dialogInstance = instance;
4235
+ return instance;
4236
+ }
4237
+ recuperarVariaviesDialog() {
4238
+ this._variaviesDialog.set(this.recuperaInstanciaDialog().data.id);
4239
+ }
4240
+ //#endregion
4241
+ //#region Métodos de atualizacao do canvas
4242
+ //? Atualiza o tamanho do canvas
4243
+ updateCanvasSize() {
4244
+ this.imageX = (this.canvas().width - this._Image().width * this.scaleFactorReadOnly()) / 2;
4245
+ this.imageY = (this.canvasHeight() / 2) - (this._Image().height * this.scaleFactorReadOnly()) / 2;
4246
+ this.canvas().height = this.canvasHeight();
4247
+ this.canvas().width = this.canvasWidth();
4248
+ this.redrawCanvas(this.ctx(), this._Image());
4249
+ }
4250
+ redrawCanvas(ctx, img) {
4251
+ if (!ctx)
4252
+ return;
4253
+ this.drawCropArea(ctx);
4254
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
4255
+ ctx.filter = 'blur(5px) opacity(0.9)';
4256
+ ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactorReadOnly(), img.height * this.scaleFactorReadOnly());
4257
+ ctx.filter = 'none';
4258
+ this.drawImageInCropArea(ctx, img);
4259
+ }
4260
+ //? Desenha a área de corte
4261
+ drawCropArea(ctx) {
4262
+ if (!ctx)
4263
+ return;
4264
+ this.atualizaCutBorder();
4265
+ const cropX = ctx.canvas.width / 2 - this.cutWidth() / 2;
4266
+ const cropY = ctx.canvas.height / 2 - this.cutHeight() / 2;
4267
+ const cropXCircle = ctx.canvas.width / 2 - this.radius() / 2;
4268
+ const cropYCircle = ctx.canvas.height / 2 - this.radius() / 2;
4269
+ ctx.beginPath();
4270
+ ctx.strokeStyle = 'transparent';
4271
+ ctx.lineWidth = 2;
4272
+ if (this._variaviesDialog()?.indCircle) {
4273
+ ctx.arc(cropXCircle, cropYCircle, this.radius(), 0, Math.PI * 2, true);
3941
4274
  }
3942
4275
  else {
3943
- this.existeLogo = false;
3944
- this.imageSource.set(this.imageService.userDefaultImage());
4276
+ ctx.rect(cropX, cropY, this.cutWidth(), this.cutHeight());
3945
4277
  }
4278
+ ctx.stroke();
3946
4279
  }
3947
- openFile() {
3948
- const inputElement = document.getElementById('fotoEscolhida');
3949
- if (inputElement) {
3950
- inputElement.click();
4280
+ //? Desenha a imagem na área de corte
4281
+ drawImageInCropArea(ctx, img) {
4282
+ if (!ctx)
4283
+ return;
4284
+ const cropX = (ctx.canvas.width - this.cutWidth()) / 2;
4285
+ const cropY = (ctx.canvas.height - this.cutHeight()) / 2;
4286
+ ctx.save();
4287
+ ctx.beginPath();
4288
+ if (this._variaviesDialog()?.indCircle) {
4289
+ ctx.arc(ctx.canvas.width / 2, ctx.canvas.height / 2, this.radius(), 0, Math.PI * 2, true);
3951
4290
  }
3952
- }
3953
- selectFotoSelecionada(event) {
3954
- const file = event.target.files[0];
3955
- if (file) {
3956
- const reader = new FileReader();
3957
- reader.readAsDataURL(file);
3958
- reader.onload = () => {
3959
- this.selectedImage = reader.result;
3960
- this.onModalOpen.emit(null);
3961
- this.openCropModal();
3962
- this.existeLogo = false;
3963
- };
4291
+ else {
4292
+ ctx.rect(cropX, cropY, this.cutWidth(), this.cutHeight());
3964
4293
  }
4294
+ ctx.clip();
4295
+ ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactorReadOnly(), img.height * this.scaleFactorReadOnly());
4296
+ ctx.restore();
3965
4297
  }
3966
- questionRemoverFoto() {
3967
- const msg = '<h3>Você tem certeza que deseja retirar a foto desse usuário?</h3>';
3968
- this.notificationService.question({
3969
- type: 'question',
3970
- message: msg,
3971
- accept: (data) => {
3972
- this.removerFoto();
3973
- },
3974
- reject: (data) => {
3975
- }
3976
- });
3977
- }
3978
- removerFoto() {
3979
- this.imageSource.set('');
3980
- this.removerFotoEvent.emit();
3981
- this.existeLogo = false;
3982
- this.imageUrlChange.emit(this.imageSource());
3983
- this.fileInput.nativeElement.value = '';
4298
+ atualizaCutBorder() {
4299
+ if (this.cropBorder && this.cropBorder.nativeElement) {
4300
+ const cropBorderElement = this.cropBorder.nativeElement;
4301
+ if (this._variaviesDialog()?.indCircle) {
4302
+ cropBorderElement.style.borderRadius = this.radius() * 2 + 'px';
4303
+ cropBorderElement.style.width = this.radius() * 2 + 'px';
4304
+ cropBorderElement.style.height = this.radius() * 2 + 'px';
4305
+ }
4306
+ else {
4307
+ cropBorderElement.style.width = this.cutWidth() + 'px';
4308
+ cropBorderElement.style.height = this.cutHeight() + 'px';
4309
+ }
4310
+ }
3984
4311
  }
3985
- handleImageError(event) {
3986
- event.target.src = this.imageService.userDefaultImage();
4312
+ //#endregion
4313
+ //#region handlers de eventos
4314
+ onZoomChange(e) {
4315
+ const prevZoom = this.scaleFactorReadOnly();
4316
+ const zoomValue = e.value;
4317
+ const direction = prevZoom < zoomValue ? 'up' : 'down';
4318
+ this.ajustarZoom(direction);
3987
4319
  }
3988
- //------- Recorte de imagem -------
3989
- openCropModal() {
3990
- this.showCropModal = true;
3991
- setTimeout(() => {
3992
- const canvas = this.cropCanvas.nativeElement;
3993
- const ctx = canvas.getContext('2d');
3994
- const img = new Image();
3995
- img.src = this.selectedImage;
3996
- img.onload = () => {
3997
- this.imageLoaded = true;
3998
- canvas.height = 400;
3999
- canvas.width = this.retornaTamanhoCanvas();
4000
- this.scaleFactor = canvas.height / img.height;
4001
- this.imageX = (canvas.width - img.width * this.scaleFactor) / 2;
4002
- this.imageY = 0;
4003
- this.canvasWidth.set(canvas.width);
4004
- this.canvasHeight.set(canvas.height);
4005
- this.redrawCanvas(ctx, img);
4006
- this.initializeImageMove(canvas, ctx, img);
4007
- this.initializeMouseWheel(canvas, ctx, img);
4008
- this.valueZoom = this.scaleFactor * 20;
4009
- };
4010
- }, 0);
4320
+ initializeMouseWheel(canvas, ctx, img) {
4321
+ canvas.onwheel = (e) => {
4322
+ e.preventDefault();
4323
+ //? Recuperando os valores de zoom e delta atuais
4324
+ const direction = e.deltaY > 0 ? 'down' : 'up';
4325
+ this.ajustarZoom(direction);
4326
+ };
4011
4327
  }
4012
- cropImage() {
4013
- const canvas = this.cropCanvas.nativeElement;
4014
- const ctx = canvas.getContext('2d');
4015
- if (ctx) {
4016
- const cropRadius = this.getCropRadius();
4017
- const centerX = canvas.width / 2;
4018
- const centerY = canvas.height / 2;
4019
- const imageData = ctx.getImageData(centerX - cropRadius, centerY - cropRadius, cropRadius * 2, cropRadius * 2);
4020
- const newCanvas = document.createElement('canvas');
4021
- const newCtx = newCanvas.getContext('2d');
4022
- newCanvas.width = cropRadius * 2;
4023
- newCanvas.height = cropRadius * 2;
4024
- if (newCtx) {
4025
- newCtx.putImageData(imageData, 0, 0);
4026
- this.imageSource.set(newCanvas.toDataURL());
4027
- this.imageUrlChange.emit(this.imageSource());
4028
- this.existeLogo = true;
4029
- this.closeCropModal();
4328
+ ajustarZoom(direction) {
4329
+ const prevScaleFactor = this.scaleFactorReadOnly();
4330
+ const delta = direction == 'down' ? -0.01 : 0.01;
4331
+ let scaleFactor = Math.min((prevScaleFactor + (delta * 1.2)), 3);
4332
+ const newHeight = this._Image().height * scaleFactor;
4333
+ const newWidth = this._Image().width * scaleFactor;
4334
+ if (this._variaviesDialog()?.indCircle) {
4335
+ if (newHeight < this.radius() * 2 || newWidth < this.radius() * 2) {
4336
+ scaleFactor = prevScaleFactor;
4337
+ }
4338
+ else {
4339
+ this.scaleFactor.set(scaleFactor);
4340
+ this.setScaleFactorModel(scaleFactor);
4030
4341
  }
4031
4342
  }
4032
- }
4033
- onZoomChange(event) {
4343
+ else {
4344
+ if (newHeight < this.cutHeight() || newWidth < this.cutWidth()) {
4345
+ scaleFactor = prevScaleFactor;
4346
+ }
4347
+ else {
4348
+ this.scaleFactor.set(scaleFactor);
4349
+ this.setScaleFactorModel(scaleFactor);
4350
+ }
4351
+ }
4352
+ this.scaleFactor.set(scaleFactor);
4353
+ this.setScaleFactorModel(scaleFactor);
4034
4354
  const canvas = this.cropCanvas.nativeElement;
4035
- const ctx = canvas.getContext('2d');
4036
- const img = new Image();
4037
- img.src = this.selectedImage;
4038
- img.onload = () => {
4039
- const zoomValue = event.value / 20;
4040
- this.scaleFactor = Math.max(zoomValue, 0.1); // Garantir que o fator de escala não seja menor que 0.1
4041
- this.redrawCanvas(ctx, img);
4042
- };
4043
- }
4044
- retornaTamanhoCanvas() {
4045
- return this.widthTela < 700 ? this.widthTela * 0.7 : this.widthTela * 0.4;
4046
- }
4047
- closeCropModal() {
4048
- this.showCropModal = false;
4049
- this.valueZoom = 20;
4050
- this.imageLoaded = false;
4051
- this.imageX = this.imgCanva()?.width / 2;
4052
- this.imageY = this.imgCanva()?.height / 2;
4053
- this.startX = 0;
4054
- this.startY = 0;
4055
- }
4056
- redrawCanvas(ctx, img) {
4057
- this.updateCropBorderSize();
4058
- if (!ctx)
4059
- return;
4060
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
4061
- ctx.filter = 'blur(5px) opacity(0.9)';
4062
- ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactor, img.height * this.scaleFactor);
4063
- ctx.filter = 'none';
4064
- this.drawImageInCropArea(ctx, img);
4065
- this.drawCropArea(ctx);
4355
+ const canvasWidth = canvas.offsetWidth;
4356
+ const canvasHeight = canvas.offsetHeight;
4357
+ const centerX = canvasWidth / 2;
4358
+ const centerY = canvasHeight / 2;
4359
+ const newCanvasX = centerX - (centerX - this.imageX) * (scaleFactor / prevScaleFactor);
4360
+ const newCanvasY = centerY - (centerY - this.imageY) * (scaleFactor / prevScaleFactor);
4361
+ this.imageX = newCanvasX;
4362
+ this.imageY = newCanvasY;
4363
+ if (!this.verificaImagemdentroDosLimiteXmin()) {
4364
+ const diffXmin = this.retornaDiffXmax();
4365
+ this.moveImage(this.imageX - diffXmin);
4366
+ }
4367
+ if (!this.verificaImagemdentroDosLimiteXmax()) {
4368
+ const diffXmax = this.retornaDiffXmin();
4369
+ this.moveImage(this.imageX + diffXmax);
4370
+ }
4371
+ if (!this.verificaImagemdentroDosLimiteYmax()) {
4372
+ const diffYmax = this.retornaDiffYmin();
4373
+ this.moveImage(undefined, this.imageY + diffYmax);
4374
+ }
4375
+ if (!this.verificaImagemdentroDosLimiteYmin()) {
4376
+ const diffYmin = this.retornaDiffYmax();
4377
+ this.moveImage(undefined, this.imageY - diffYmin);
4378
+ }
4379
+ this.redrawCanvas(this.ctx(), this._Image());
4380
+ }
4381
+ verificaImagemdentroDosLimiteXmin() {
4382
+ const newImageX = this.imageX;
4383
+ return newImageX < this.xMin();
4384
+ }
4385
+ verificaImagemdentroDosLimiteXmax() {
4386
+ const newImageX = this.imageX;
4387
+ return newImageX > this.xMax();
4388
+ }
4389
+ verificaImagemdentroDosLimiteYmin() {
4390
+ const newImageY = this.imageY;
4391
+ return newImageY < this.yMin();
4392
+ }
4393
+ verificaImagemdentroDosLimiteYmax() {
4394
+ const newImageY = this.imageY;
4395
+ return newImageY > this.yMax();
4396
+ }
4397
+ retornaDiffXmin() {
4398
+ const newImageX = this.imageX;
4399
+ return this.xMin() - newImageX;
4400
+ }
4401
+ retornaDiffXmax() {
4402
+ const newImageX = this.imageX;
4403
+ return newImageX - this.xMax();
4404
+ }
4405
+ retornaDiffYmin() {
4406
+ const newImageY = this.imageY;
4407
+ return this.yMin() - newImageY;
4408
+ }
4409
+ retornaDiffYmax() {
4410
+ const newImageY = this.imageY;
4411
+ return newImageY - this.yMax();
4066
4412
  }
4067
4413
  initializeImageMove(canvas, ctx, img) {
4068
4414
  let isDragging = false;
@@ -4073,13 +4419,6 @@ class KvAvatarComponent {
4073
4419
  this.startX = e.offsetX - this.imageX;
4074
4420
  this.startY = e.offsetY - this.imageY;
4075
4421
  };
4076
- canvas.onmousemove = (e) => {
4077
- if (isDragging) {
4078
- this.imageX = e.offsetX - this.startX;
4079
- this.imageY = e.offsetY - this.startY;
4080
- this.redrawCanvas(ctx, img);
4081
- }
4082
- };
4083
4422
  canvas.onmouseup = () => {
4084
4423
  isDragging = false;
4085
4424
  canvas.style.cursor = 'grab';
@@ -4088,84 +4427,276 @@ class KvAvatarComponent {
4088
4427
  isDragging = false;
4089
4428
  canvas.style.cursor = 'grab';
4090
4429
  };
4091
- }
4092
- initializeMouseWheel(canvas, ctx, img) {
4093
- canvas.onwheel = (e) => {
4094
- e.preventDefault();
4095
- const delta = e.deltaY > 0 ? -0.1 : 0.1;
4096
- this.scaleFactor = Math.min(Math.max(this.scaleFactor + delta, 0.1), 5); // limita o fator de escala entre 0.1 e 5
4097
- this.redrawCanvas(ctx, img);
4098
- this.valueZoom = this.scaleFactor * 20;
4430
+ canvas.onmousemove = (e) => {
4431
+ if (isDragging) {
4432
+ // Calcula o novo posicionamento da imagem
4433
+ let newImageX = e.offsetX - this.startX;
4434
+ let newImageY = e.offsetY - this.startY;
4435
+ if (newImageX < this.xMin() && newImageX > this.xMax()) {
4436
+ this.moveImage(newImageX);
4437
+ }
4438
+ if (newImageY < this.yMin() && newImageY > this.yMax()) {
4439
+ this.moveImage(undefined, newImageY);
4440
+ }
4441
+ this.redrawCanvas(ctx, img);
4442
+ }
4099
4443
  };
4100
4444
  }
4101
- drawImageInCropArea(ctx, img) {
4102
- if (!ctx)
4103
- return;
4104
- const cropRadius = this.getCropRadius();
4105
- const cropX = (ctx.canvas.width - cropRadius * 2) / 2;
4106
- const cropY = (ctx.canvas.height - cropRadius * 2) / 2;
4107
- ctx.save();
4108
- ctx.beginPath();
4109
- ctx.arc(cropX + cropRadius, cropY + cropRadius, cropRadius, 0, Math.PI * 2, true);
4110
- ctx.clip();
4111
- ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactor, img.height * this.scaleFactor);
4112
- ctx.restore();
4445
+ moveImage(dx, dy) {
4446
+ this.imageX = (dx ?? this.imageX);
4447
+ this.imageY = (dy ?? this.imageY);
4113
4448
  }
4114
- drawCropArea(ctx) {
4115
- if (!ctx)
4116
- return;
4117
- const cropRadius = this.getCropRadius();
4118
- const cropX = (ctx.canvas.width - cropRadius * 2) / 2;
4119
- const cropY = (ctx.canvas.height - cropRadius * 2) / 2;
4120
- ctx.beginPath();
4121
- ctx.arc(cropX + cropRadius, cropY + cropRadius, cropRadius, 0, Math.PI * 2, true);
4122
- ctx.strokeStyle = 'transparent';
4123
- ctx.lineWidth = 2;
4124
- ctx.stroke();
4449
+ //#endregion
4450
+ //#region Métodos de corte e fechamento do modal
4451
+ cropImage() {
4452
+ const ctx = this.ctx();
4453
+ if (ctx) {
4454
+ const X = ((this.canvas().width - this._Image().width * this.scaleFactorReadOnly()) / 2);
4455
+ const Y = ((this.canvasHeight() / 2) - (this._Image().height * this.scaleFactorReadOnly()) / 2);
4456
+ // Recuperar o imageData da imagem que está na área de corte
4457
+ let imageData;
4458
+ const cropX = (ctx.canvas.width - this.cutWidth()) / 2;
4459
+ const cropY = (ctx.canvas.height - this.cutHeight()) / 2;
4460
+ if (this._variaviesDialog()?.indCircle) {
4461
+ // Create a new canvas with the same dimensions as the circle
4462
+ const circleCanvas = document.createElement('canvas');
4463
+ const circleCtx = circleCanvas.getContext('2d');
4464
+ circleCanvas.width = this.radius() * 2;
4465
+ circleCanvas.height = this.radius() * 2;
4466
+ // Draw the circle on the new canvas
4467
+ circleCtx.beginPath();
4468
+ circleCtx.arc(this.radius(), this.radius(), this.radius(), 0, 2 * Math.PI);
4469
+ circleCtx.fill();
4470
+ // Set the composite operation to 'destination-in' to cut out the circle
4471
+ ctx.globalCompositeOperation = 'destination-in';
4472
+ // Draw the image on the main canvas using the circle as a mask
4473
+ ctx.drawImage(circleCanvas, cropX, cropY);
4474
+ // Reset the composite operation to the default value
4475
+ ctx.globalCompositeOperation = 'source-over';
4476
+ // Get the image data of the cropped circle
4477
+ imageData = ctx.getImageData(cropX, cropY, this.radius() * 2, this.radius() * 2);
4478
+ }
4479
+ else {
4480
+ imageData = ctx.getImageData(cropX, cropY, this.cutWidth(), this.cutHeight());
4481
+ }
4482
+ // Obter os valores de width e height da variável _variaviesDialog
4483
+ const variaveisDialog = this._variaviesDialog();
4484
+ if (variaveisDialog) {
4485
+ const { width, height } = variaveisDialog;
4486
+ // Criar um novo canvas e contexto com os valores de width e height
4487
+ const newCanvas = document.createElement('canvas');
4488
+ const newCtx = newCanvas.getContext('2d');
4489
+ newCanvas.width = width;
4490
+ newCanvas.height = height;
4491
+ if (newCtx) {
4492
+ // Redimensionar a imagem para o tamanho especificado
4493
+ const tempCanvas = document.createElement('canvas');
4494
+ const tempCtx = tempCanvas.getContext('2d');
4495
+ tempCanvas.width = this.cutWidth();
4496
+ tempCanvas.height = this.cutHeight();
4497
+ tempCtx.putImageData(imageData, 0, 0);
4498
+ newCtx.drawImage(tempCanvas, 0, 0, width, height);
4499
+ window.dispatchEvent(new CustomEvent('cropImage', { detail: {
4500
+ result: Promise.resolve(newCanvas.toDataURL()),
4501
+ status: true
4502
+ } }));
4503
+ this.closeCropModal();
4504
+ }
4505
+ }
4506
+ }
4125
4507
  }
4126
- getCropRadius() {
4127
- const baseRadius = 200; // Raio base para uma tela de referência
4128
- const referenceWidth = (this.widthTela + 100); // Largura da tela de referência
4129
- const scaleFactor = window.innerWidth / referenceWidth; // Fator de escala com base na largura da tela atual
4130
- const diagonal = Math.sqrt(Math.pow(this.canvasHeight(), 2) + Math.pow(this.canvasWidth(), 2));
4131
- const calculatedRadius = (diagonal / 4);
4132
- const maxRadius = baseRadius * scaleFactor; // Ajusta o raio com base no fator de escala
4133
- return Math.min(calculatedRadius, maxRadius);
4508
+ closeCropModal() {
4509
+ this.dialogInstance.close();
4134
4510
  }
4135
- updateCropBorderSize() {
4136
- if (this.cropBorder && this.cropBorder.nativeElement) {
4137
- const radius = this.getCropRadius();
4138
- const cropBorderElement = this.cropBorder.nativeElement;
4139
- cropBorderElement.style.width = `${radius * 2}px`;
4140
- cropBorderElement.style.height = `${radius * 2}px`;
4511
+ cancel() {
4512
+ window.dispatchEvent(new CustomEvent('cropImage', { detail: {
4513
+ result: Promise.resolve('cancel'),
4514
+ status: false
4515
+ } }));
4516
+ this.closeCropModal();
4517
+ }
4518
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: SimpleComponent, deps: [{ token: i1$3.DynamicDialogRef }, { token: i1$3.DialogService }], target: i0.ɵɵFactoryTarget.Component }); }
4519
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: SimpleComponent, isStandalone: true, selector: "app-simple-component", host: { listeners: { "window:resize": "onWindowResize($event)" } }, viewQueries: [{ propertyName: "cropCanvas", first: true, predicate: ["cropCanvas"], descendants: true }, { propertyName: "cropBorder", first: true, predicate: ["cropBorder"], descendants: true }], ngImport: i0, template: `
4520
+ <div class="modal-content">
4521
+ <div class="crop-container">
4522
+ <canvas #cropCanvas class="crop-canvas"></canvas>
4523
+ <div #cropBorder class="crop-border"></div>
4524
+ </div>
4525
+
4526
+ <div class="w-full mt-2">
4527
+ <kv-label label="Zoom" style="text-align: left;" />
4528
+ <p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.000001" [max]="3" (onChange)="onZoomChange($event)"></p-slider>
4529
+ </div>
4530
+
4531
+ <div class="button-container">
4532
+ <kv-button label="Cancelar" severity="tertiary" icon="close" (click)="cancel()"></kv-button>
4533
+ <kv-button label="Recortar" severity="primary" icon="crop" (click)="cropImage()" class="ml-2"></kv-button>
4534
+ </div>
4535
+
4536
+ </div>
4537
+
4538
+
4539
+
4540
+ `, isInline: true, styles: ["img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal-content{position:relative;background-color:#fefefe;margin:1% auto;padding:20px;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid #d1d5db;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px dashed #9ca3af;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: KvModalModule }, { kind: "ngmodule", type: SliderModule }, { kind: "component", type: i2$2.Slider, selector: "p-slider", inputs: ["animate", "disabled", "min", "max", "orientation", "step", "range", "style", "styleClass", "ariaLabel", "ariaLabelledBy", "tabindex", "autofocus"], outputs: ["onChange", "onSlideEnd"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: FileUploadModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: KvButtonModule }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["label", "icon", "loading", "disabled", "severity", "size", "fullWidth"], outputs: ["onClick"] }, { kind: "ngmodule", type: KvLabelModule }, { kind: "component", type: KvLabelComponent, selector: "kv-label", inputs: ["componentId", "label"] }] }); }
4541
+ }
4542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: SimpleComponent, decorators: [{
4543
+ type: Component,
4544
+ args: [{ selector: 'app-simple-component', template: `
4545
+ <div class="modal-content">
4546
+ <div class="crop-container">
4547
+ <canvas #cropCanvas class="crop-canvas"></canvas>
4548
+ <div #cropBorder class="crop-border"></div>
4549
+ </div>
4550
+
4551
+ <div class="w-full mt-2">
4552
+ <kv-label label="Zoom" style="text-align: left;" />
4553
+ <p-slider [(ngModel)]="this.scaleFactorModel" [step]="0.000001" [max]="3" (onChange)="onZoomChange($event)"></p-slider>
4554
+ </div>
4555
+
4556
+ <div class="button-container">
4557
+ <kv-button label="Cancelar" severity="tertiary" icon="close" (click)="cancel()"></kv-button>
4558
+ <kv-button label="Recortar" severity="primary" icon="crop" (click)="cropImage()" class="ml-2"></kv-button>
4559
+ </div>
4560
+
4561
+ </div>
4562
+
4563
+
4564
+
4565
+ `, standalone: true, imports: [
4566
+ DialogModule,
4567
+ KvModalModule,
4568
+ SliderModule,
4569
+ CommonModule,
4570
+ ButtonModule,
4571
+ FileUploadModule,
4572
+ SliderModule,
4573
+ FormsModule,
4574
+ ReactiveFormsModule,
4575
+ KvButtonModule,
4576
+ KvLabelModule,
4577
+ ], styles: ["img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal-content{position:relative;background-color:#fefefe;margin:1% auto;padding:20px;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid #d1d5db;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px dashed #9ca3af;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"] }]
4578
+ }], ctorParameters: () => [{ type: i1$3.DynamicDialogRef }, { type: i1$3.DialogService }], propDecorators: { cropCanvas: [{
4579
+ type: ViewChild,
4580
+ args: ['cropCanvas']
4581
+ }], cropBorder: [{
4582
+ type: ViewChild,
4583
+ args: ['cropBorder']
4584
+ }], onWindowResize: [{
4585
+ type: HostListener,
4586
+ args: ['window:resize', ['$event']]
4587
+ }] } });
4588
+
4589
+ class KvAvatarComponent {
4590
+ constructor(imageService, notificationService, imageCutterService) {
4591
+ this.imageService = imageService;
4592
+ this.notificationService = notificationService;
4593
+ this.imageCutterService = imageCutterService;
4594
+ this.borderColor = '#002542';
4595
+ this.btnsColor = '#002542';
4596
+ this.width = 135;
4597
+ this.height = 135;
4598
+ this.btnAlterarFoto = false;
4599
+ this.imageUrlChange = new EventEmitter();
4600
+ this.removerFotoEvent = new EventEmitter();
4601
+ this.file = null;
4602
+ this.existeLogo = false;
4603
+ this.selectedImage = '';
4604
+ this.imageUrl = input(this.imageService.userDefaultImage());
4605
+ this.imageSource = signal(this.imageService.userDefaultImage());
4606
+ this.imageLoaded = signal(false);
4607
+ }
4608
+ ngOnInit() {
4609
+ this.imageSource.set(this.imageUrl());
4610
+ this.carregaImagemInicial();
4611
+ }
4612
+ carregaImagemInicial() {
4613
+ const imageUrl = this.imageUrl();
4614
+ if (imageUrl && (imageUrl.startsWith('data:image') || imageUrl.startsWith('http') || imageUrl.startsWith('https'))) {
4615
+ this.existeLogo = true;
4616
+ }
4617
+ else if (imageUrl && imageUrl.length > 0) {
4618
+ this.existeLogo = true;
4619
+ this.imageSource.set('data:image/jpg;base64,' + imageUrl);
4620
+ }
4621
+ else {
4622
+ this.existeLogo = false;
4623
+ this.imageSource.set(this.imageService.userDefaultImage());
4141
4624
  }
4142
4625
  }
4143
- updateCanvasSize() {
4144
- if (this.cropCanvas && this.cropCanvas.nativeElement) {
4145
- const canvas = this.cropCanvas.nativeElement;
4146
- const ctx = canvas.getContext('2d');
4147
- const img = new Image();
4148
- img.src = this.selectedImage;
4149
- this.imgCanva.set(img);
4150
- img.onload = () => {
4151
- this.imageLoaded = true;
4152
- canvas.width = this.retornaTamanhoCanvas();
4153
- canvas.height = 400;
4154
- this.imageX = (canvas.width - img.width * this.scaleFactor) / 2;
4155
- this.imageY = 0; // A imagem começa no topo do canvas
4156
- this.canvasWidth.set(canvas.width);
4157
- this.canvasHeight.set(canvas.height);
4158
- this.redrawCanvas(ctx, img);
4159
- };
4626
+ onImageLoad() {
4627
+ this.imageLoaded.set(true);
4628
+ }
4629
+ openFile() {
4630
+ const inputElement = document.getElementById('fotoEscolhida');
4631
+ if (inputElement) {
4632
+ inputElement.click();
4160
4633
  }
4161
4634
  }
4162
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarComponent, deps: [{ token: ImagensService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
4163
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.8", type: KvAvatarComponent, selector: "kv-avatar", inputs: { borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: false, isRequired: false, transformFunction: null }, btnsColor: { classPropertyName: "btnsColor", publicName: "btnsColor", isSignal: false, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: false, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: false, isRequired: false, transformFunction: null }, btnAlterarFoto: { classPropertyName: "btnAlterarFoto", publicName: "btnAlterarFoto", isSignal: false, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { imageUrlChange: "imageUrlChange", onModalOpen: "onModalOpen", removerFotoEvent: "removerFotoEvent" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, viewQueries: [{ propertyName: "cropCanvas", first: true, predicate: ["cropCanvas"], descendants: true }, { propertyName: "cropBorder", first: true, predicate: ["cropBorder"], descendants: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"image-container\">\r\n <img [src]=\"imageSource()\" alt=\"Foto\" class=\"container-foto\" [style.border-color]=\"borderColor\" [style.width.px]=\"width\" [style.height.px]=\"height\" (error)=\"handleImageError($event)\">\r\n <div class=\"btn\">\r\n <input #fileInput *ngIf=\"btnAlterarFoto\" id=\"fotoEscolhida\" type=\"file\" accept=\"image/*\" style=\"display:none\" (change)=\"selectFotoSelecionada($any($event))\">\r\n <button *ngIf=\"btnAlterarFoto && !existeLogo\" class=\"botao-alterar-foto border-circle\" [style.background-color]=\"btnsColor\" (click)=\"openFile()\">\r\n <i class=\"material-symbols-outlined\">photo_camera</i>\r\n </button>\r\n \r\n <button *ngIf=\"btnAlterarFoto && existeLogo\" [style.background-color]=\"btnsColor\"\r\n class=\"botao-excluir-foto border-circle\r\n hover:shadow-3\r\n active:shadow-5\"\r\n (click)=\"questionRemoverFoto()\">\r\n <i class=\"material-symbols-outlined\">delete</i>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"showCropModal\" class=\"modal\">\r\n <div class=\"modal-content\">\r\n <div class=\"crop-container\">\r\n <canvas #cropCanvas class=\"crop-canvas\"></canvas>\r\n <div #cropBorder class=\"crop-border\"></div>\r\n </div>\r\n\r\n <div class=\"w-full mt-2\">\r\n <kv-label label=\"Zoom\" style=\"text-align: left;\"/>\r\n <p-slider [(ngModel)]=\"valueZoom\" (onChange)=\"onZoomChange($event)\"></p-slider>\r\n </div>\r\n \r\n <div class=\"button-container\"> \r\n <kv-button label=\"Cancelar\" severity=\"tertiary\" icon=\"close\" (click)=\"closeCropModal()\"></kv-button>\r\n <kv-button label=\"Recortar\" severity=\"primary\" icon=\"crop\" (click)=\"cropImage()\" class=\"ml-2\"></kv-button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0\";.material-symbols-outlined{font-family:Material Symbols Outlined!important}*{font-family:Inter var,Inter,sans-serif!important}::ng-deep .p-accordion,::ng-deep .p-accordion-header,::ng-deep .p-accordion-content,::ng-deep .p-badge,::ng-deep .p-overlay-badge,::ng-deep .p-breadcrumb,::ng-deep .p-breadcrumb-item,::ng-deep .p-breadcrumb-link,::ng-deep .p-button,::ng-deep .p-calendar,::ng-deep .p-card,::ng-deep .p-card-title,::ng-deep .p-card-subtitle,::ng-deep .p-card-content,::ng-deep .p-checkbox,::ng-deep .p-chip,::ng-deep .p-confirm-dialog,::ng-deep .p-confirm-dialog-message,::ng-deep .p-contextmenu,::ng-deep .p-contextmenu-item,::ng-deep .p-dataview,::ng-deep .p-dataview-content,::ng-deep .p-dialog,::ng-deep .p-dialog-title,::ng-deep .p-dialog-content,::ng-deep .p-dropdown,::ng-deep .p-dropdown-label,::ng-deep .p-dropdown-item,::ng-deep .p-dynamic-dialog,::ng-deep .p-dynamic-dialog-title,::ng-deep .p-dynamic-dialog-content,::ng-deep .p-editor,::ng-deep .p-fieldset,::ng-deep .p-fieldset-legend,::ng-deep .p-fieldset-content,::ng-deep .p-fileupload,::ng-deep .p-inputmask,::ng-deep .p-inputnumber,::ng-deep .p-inputtextarea,::ng-deep .p-inputtext,::ng-deep .p-menu,::ng-deep .p-menuitem,::ng-deep .p-menuitem-text,::ng-deep .p-message,::ng-deep .p-messages,::ng-deep .p-multiselect,::ng-deep .p-multiselect-label,::ng-deep .p-multiselect-item,::ng-deep .p-panelmenu,::ng-deep .p-panelmenu-header,::ng-deep .p-panelmenu-content,::ng-deep .p-panel,::ng-deep .p-panel-header,::ng-deep .p-panel-content,::ng-deep .p-password,::ng-deep .p-picklist,::ng-deep .p-progressbar,::ng-deep .p-radiobutton,::ng-deep .p-rating,::ng-deep .p-sidebar,::ng-deep .p-splitbutton,::ng-deep .p-steps,::ng-deep .p-step,::ng-deep .p-table,::ng-deep .p-datatable,::ng-deep .p-tabview,::ng-deep .p-tabpanel,::ng-deep .p-tag,::ng-deep .p-toast,::ng-deep .p-toolbar,::ng-deep .p-tooltip,::ng-deep .p-tree,::ng-deep .p-treetable,::ng-deep .p-selectbutton,::ng-deep .p-stepper,::ng-deep .p-inputgroup,::ng-deep .p-inputgroup-addon,::ng-deep .p-text{font-family:Inter var,Inter,sans-serif!important}:host ::ng-deep .inputs{height:35px}:root{--kv-primary-color: #29b92d, --kv-secondary-color: #002542, --kv-terciary-color: #f2f3f5, --kv-primary-hover-color: #249a29, --kv-secondary-hover-color: #002038, --kv-terciary-hover-color: #d9dadb, --kv-primary-active-color: #1c801f, --kv-secondary-active-color: #001729, --kv-terciary-active-color: #c0c1c2, --kv-primary-disable-color: #1c801f, --kv-secondary-disable-color: #001729, --kv-terciary-disable-color: #c0c1c2, }::ng-deep .p-dialog .p-dialog-header{color:#fff!important;background:#002542!important;display:flex!important;flex-wrap:wrap;word-wrap:break-word}::ng-deep .p-dialog .p-dialog-content{padding-top:1rem}::ng-deep .p-dialog{min-width:320px}::ng-deep .p-dialog-content{overflow-x:hidden}::ng-deep .p-dialog-content::-webkit-scrollbar{width:8px}::ng-deep .p-dialog-content::-webkit-scrollbar:hover{background-color:#dededebf}::ng-deep .p-dialog-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:transparent}::ng-deep .p-dialog-content:hover::-webkit-scrollbar-thumb{border-left:2px solid white;background-color:#00000080}::ng-deep .p-dialog-content::-webkit-scrollbar-track{border-left:2px solid white;background-color:#dededebf}::ng-deep .p-dialog-footer{display:flex;justify-content:flex-end;padding:10px;gap:10px}::ng-deep .p-dialog .p-dialog-header .p-dialog-header-icon{display:none}img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal{display:block;position:absolute;z-index:9999;left:0;top:0;width:100vw;height:100vh;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:1% auto;padding:20px;border:1px solid #888;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid black;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px solid black;border-radius:50%;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.Slider, selector: "p-slider", inputs: ["animate", "disabled", "min", "max", "orientation", "step", "range", "style", "styleClass", "ariaLabel", "ariaLabelledBy", "tabindex", "autofocus"], outputs: ["onChange", "onSlideEnd"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["label", "icon", "loading", "disabled", "severity", "size", "fullWidth"], outputs: ["onClick"] }, { kind: "component", type: KvLabelComponent, selector: "kv-label", inputs: ["componentId", "label"] }] }); }
4635
+ changeImage(event) {
4636
+ const file = event.target.files[0];
4637
+ if (file.type.startsWith('image/')) {
4638
+ if (this.btnAlterarFoto == true) {
4639
+ this.file = file;
4640
+ const reader = new FileReader();
4641
+ reader.onload = async () => {
4642
+ try {
4643
+ const result = await this.imageCutterService.cut(reader.result?.toString() ?? '', this.width, this.height, true);
4644
+ this.existeLogo = true;
4645
+ this.imageSource.set(result);
4646
+ this.selectedImage = result;
4647
+ this.imageUrlChange.emit(this.imageSource());
4648
+ }
4649
+ catch (error) {
4650
+ this.removerFoto();
4651
+ }
4652
+ };
4653
+ reader.readAsDataURL(file);
4654
+ }
4655
+ else {
4656
+ // ?! Comportamneto padrão --> Preservar <-- !!!
4657
+ this.file = file;
4658
+ const reader = new FileReader();
4659
+ reader.onload = (e) => {
4660
+ this.imageSource.set(reader.result + '');
4661
+ };
4662
+ reader.readAsDataURL(file);
4663
+ this.imageUrlChange.emit(this.imageSource());
4664
+ }
4665
+ }
4666
+ else {
4667
+ this.notificationService.toastError('Apenas arquivos de imagem são permitidos.');
4668
+ }
4669
+ }
4670
+ questionRemoverFoto() {
4671
+ const msg = '<h3>Você tem certeza que deseja retirar a foto desse usuário?</h3>';
4672
+ this.notificationService.question({
4673
+ type: 'question',
4674
+ message: msg,
4675
+ accept: (data) => {
4676
+ this.removerFoto();
4677
+ },
4678
+ reject: (data) => {
4679
+ }
4680
+ });
4681
+ }
4682
+ removerFoto() {
4683
+ this.imageSource.set('');
4684
+ this.removerFotoEvent.emit();
4685
+ this.existeLogo = false;
4686
+ this.imageUrlChange.emit(this.imageSource());
4687
+ this.fileInput.nativeElement.value = '';
4688
+ }
4689
+ handleImageError(event) {
4690
+ this.imageLoaded.set(true);
4691
+ event.target.src = this.imageService.userDefaultImage();
4692
+ }
4693
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarComponent, deps: [{ token: ImagensService }, { token: NotificationService }, { token: ImageCutterService }], target: i0.ɵɵFactoryTarget.Component }); }
4694
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.8", type: KvAvatarComponent, selector: "kv-avatar", inputs: { borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: false, isRequired: false, transformFunction: null }, btnsColor: { classPropertyName: "btnsColor", publicName: "btnsColor", isSignal: false, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: false, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: false, isRequired: false, transformFunction: null }, btnAlterarFoto: { classPropertyName: "btnAlterarFoto", publicName: "btnAlterarFoto", isSignal: false, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { imageUrlChange: "imageUrlChange", removerFotoEvent: "removerFotoEvent" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"image-container\" [style.width.px]=\"width\" [style.height.px]=\"height\" >\r\n\r\n <img\r\n [src]=\"imageSource()\"\r\n (load)=\"onImageLoad()\"\r\n (error)=\"handleImageError($event)\"\r\n alt=\"Foto\"\r\n class=\"container-foto\"\r\n [style.border-color]=\"borderColor\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n >\r\n\r\n <div class=\"btn\">\r\n <input #fileInput *ngIf=\"btnAlterarFoto\" id=\"fotoEscolhida\" type=\"file\" accept=\"image/*\" style=\"display:none\" (change)=\"changeImage($any($event))\">\r\n\r\n <button *ngIf=\"btnAlterarFoto && !existeLogo\"\r\n class=\"botao-alterar-foto border-circle\"\r\n [style.background-color]=\"btnsColor\" (click)=\"openFile()\">\r\n <i class=\"material-symbols-outlined\">photo_camera</i>\r\n </button>\r\n\r\n <button *ngIf=\"btnAlterarFoto && existeLogo\" [style.background-color]=\"btnsColor\"\r\n class=\"botao-excluir-foto border-circle\r\n hover:shadow-3\r\n active:shadow-5\"\r\n (click)=\"questionRemoverFoto()\">\r\n <i class=\"material-symbols-outlined\">delete</i>\r\n </button>\r\n </div>\r\n\r\n <ngx-loading [show]=\"!imageLoaded()\" full class=\"container-foto\" [config]=\"{backdropBorderRadius: '100%', fullScreenBackdrop: false }\"></ngx-loading>\r\n\r\n</div>\r\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0\";.material-symbols-outlined{font-family:Material Symbols Outlined!important}*{font-family:Inter var,Inter,sans-serif!important}::ng-deep .p-accordion,::ng-deep .p-accordion-header,::ng-deep .p-accordion-content,::ng-deep .p-badge,::ng-deep .p-overlay-badge,::ng-deep .p-breadcrumb,::ng-deep .p-breadcrumb-item,::ng-deep .p-breadcrumb-link,::ng-deep .p-button,::ng-deep .p-calendar,::ng-deep .p-card,::ng-deep .p-card-title,::ng-deep .p-card-subtitle,::ng-deep .p-card-content,::ng-deep .p-checkbox,::ng-deep .p-chip,::ng-deep .p-confirm-dialog,::ng-deep .p-confirm-dialog-message,::ng-deep .p-contextmenu,::ng-deep .p-contextmenu-item,::ng-deep .p-dataview,::ng-deep .p-dataview-content,::ng-deep .p-dialog,::ng-deep .p-dialog-title,::ng-deep .p-dialog-content,::ng-deep .p-dropdown,::ng-deep .p-dropdown-label,::ng-deep .p-dropdown-item,::ng-deep .p-dynamic-dialog,::ng-deep .p-dynamic-dialog-title,::ng-deep .p-dynamic-dialog-content,::ng-deep .p-editor,::ng-deep .p-fieldset,::ng-deep .p-fieldset-legend,::ng-deep .p-fieldset-content,::ng-deep .p-fileupload,::ng-deep .p-inputmask,::ng-deep .p-inputnumber,::ng-deep .p-inputtextarea,::ng-deep .p-inputtext,::ng-deep .p-menu,::ng-deep .p-menuitem,::ng-deep .p-menuitem-text,::ng-deep .p-message,::ng-deep .p-messages,::ng-deep .p-multiselect,::ng-deep .p-multiselect-label,::ng-deep .p-multiselect-item,::ng-deep .p-panelmenu,::ng-deep .p-panelmenu-header,::ng-deep .p-panelmenu-content,::ng-deep .p-panel,::ng-deep .p-panel-header,::ng-deep .p-panel-content,::ng-deep .p-password,::ng-deep .p-picklist,::ng-deep .p-progressbar,::ng-deep .p-radiobutton,::ng-deep .p-rating,::ng-deep .p-sidebar,::ng-deep .p-splitbutton,::ng-deep .p-steps,::ng-deep .p-step,::ng-deep .p-table,::ng-deep .p-datatable,::ng-deep .p-tabview,::ng-deep .p-tabpanel,::ng-deep .p-tag,::ng-deep .p-toast,::ng-deep .p-toolbar,::ng-deep .p-tooltip,::ng-deep .p-tree,::ng-deep .p-treetable,::ng-deep .p-selectbutton,::ng-deep .p-stepper,::ng-deep .p-inputgroup,::ng-deep .p-inputgroup-addon,::ng-deep .p-text{font-family:Inter var,Inter,sans-serif!important}:host ::ng-deep .inputs{height:35px}:root{--kv-primary-color: #29b92d, --kv-secondary-color: #002542, --kv-terciary-color: #f2f3f5, --kv-primary-hover-color: #249a29, --kv-secondary-hover-color: #002038, --kv-terciary-hover-color: #d9dadb, --kv-primary-active-color: #1c801f, --kv-secondary-active-color: #001729, --kv-terciary-active-color: #c0c1c2, --kv-primary-disable-color: #1c801f, --kv-secondary-disable-color: #001729, --kv-terciary-disable-color: #c0c1c2, }::ng-deep .p-dialog .p-dialog-header{color:#fff!important;background:#002542!important;display:flex!important;flex-wrap:wrap;word-wrap:break-word}::ng-deep .p-dialog .p-dialog-content{padding-top:1rem}::ng-deep .p-dialog{min-width:320px}::ng-deep .p-dialog-content{overflow-x:hidden}::ng-deep .p-dialog-content::-webkit-scrollbar{width:8px}::ng-deep .p-dialog-content::-webkit-scrollbar:hover{background-color:#dededebf}::ng-deep .p-dialog-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:transparent}::ng-deep .p-dialog-content:hover::-webkit-scrollbar-thumb{border-left:2px solid white;background-color:#00000080}::ng-deep .p-dialog-content::-webkit-scrollbar-track{border-left:2px solid white;background-color:#dededebf}::ng-deep .p-dialog-footer{display:flex;justify-content:flex-end;padding:10px;gap:10px}::ng-deep .p-dialog .p-dialog-header .p-dialog-header-icon{display:none}img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal{display:block;position:absolute;z-index:9999;left:0;top:0;width:100vw;height:100vh;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:1% auto;padding:20px;border:1px solid #888;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid black;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px solid black;border-radius:50%;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$5.NgxLoadingComponent, selector: "ngx-loading", inputs: ["show", "config", "template"] }] }); }
4164
4695
  }
4165
4696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarComponent, decorators: [{
4166
4697
  type: Component,
4167
- args: [{ selector: 'kv-avatar', template: "<div class=\"image-container\">\r\n <img [src]=\"imageSource()\" alt=\"Foto\" class=\"container-foto\" [style.border-color]=\"borderColor\" [style.width.px]=\"width\" [style.height.px]=\"height\" (error)=\"handleImageError($event)\">\r\n <div class=\"btn\">\r\n <input #fileInput *ngIf=\"btnAlterarFoto\" id=\"fotoEscolhida\" type=\"file\" accept=\"image/*\" style=\"display:none\" (change)=\"selectFotoSelecionada($any($event))\">\r\n <button *ngIf=\"btnAlterarFoto && !existeLogo\" class=\"botao-alterar-foto border-circle\" [style.background-color]=\"btnsColor\" (click)=\"openFile()\">\r\n <i class=\"material-symbols-outlined\">photo_camera</i>\r\n </button>\r\n \r\n <button *ngIf=\"btnAlterarFoto && existeLogo\" [style.background-color]=\"btnsColor\"\r\n class=\"botao-excluir-foto border-circle\r\n hover:shadow-3\r\n active:shadow-5\"\r\n (click)=\"questionRemoverFoto()\">\r\n <i class=\"material-symbols-outlined\">delete</i>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"showCropModal\" class=\"modal\">\r\n <div class=\"modal-content\">\r\n <div class=\"crop-container\">\r\n <canvas #cropCanvas class=\"crop-canvas\"></canvas>\r\n <div #cropBorder class=\"crop-border\"></div>\r\n </div>\r\n\r\n <div class=\"w-full mt-2\">\r\n <kv-label label=\"Zoom\" style=\"text-align: left;\"/>\r\n <p-slider [(ngModel)]=\"valueZoom\" (onChange)=\"onZoomChange($event)\"></p-slider>\r\n </div>\r\n \r\n <div class=\"button-container\"> \r\n <kv-button label=\"Cancelar\" severity=\"tertiary\" icon=\"close\" (click)=\"closeCropModal()\"></kv-button>\r\n <kv-button label=\"Recortar\" severity=\"primary\" icon=\"crop\" (click)=\"cropImage()\" class=\"ml-2\"></kv-button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0\";.material-symbols-outlined{font-family:Material Symbols Outlined!important}*{font-family:Inter var,Inter,sans-serif!important}::ng-deep .p-accordion,::ng-deep .p-accordion-header,::ng-deep .p-accordion-content,::ng-deep .p-badge,::ng-deep .p-overlay-badge,::ng-deep .p-breadcrumb,::ng-deep .p-breadcrumb-item,::ng-deep .p-breadcrumb-link,::ng-deep .p-button,::ng-deep .p-calendar,::ng-deep .p-card,::ng-deep .p-card-title,::ng-deep .p-card-subtitle,::ng-deep .p-card-content,::ng-deep .p-checkbox,::ng-deep .p-chip,::ng-deep .p-confirm-dialog,::ng-deep .p-confirm-dialog-message,::ng-deep .p-contextmenu,::ng-deep .p-contextmenu-item,::ng-deep .p-dataview,::ng-deep .p-dataview-content,::ng-deep .p-dialog,::ng-deep .p-dialog-title,::ng-deep .p-dialog-content,::ng-deep .p-dropdown,::ng-deep .p-dropdown-label,::ng-deep .p-dropdown-item,::ng-deep .p-dynamic-dialog,::ng-deep .p-dynamic-dialog-title,::ng-deep .p-dynamic-dialog-content,::ng-deep .p-editor,::ng-deep .p-fieldset,::ng-deep .p-fieldset-legend,::ng-deep .p-fieldset-content,::ng-deep .p-fileupload,::ng-deep .p-inputmask,::ng-deep .p-inputnumber,::ng-deep .p-inputtextarea,::ng-deep .p-inputtext,::ng-deep .p-menu,::ng-deep .p-menuitem,::ng-deep .p-menuitem-text,::ng-deep .p-message,::ng-deep .p-messages,::ng-deep .p-multiselect,::ng-deep .p-multiselect-label,::ng-deep .p-multiselect-item,::ng-deep .p-panelmenu,::ng-deep .p-panelmenu-header,::ng-deep .p-panelmenu-content,::ng-deep .p-panel,::ng-deep .p-panel-header,::ng-deep .p-panel-content,::ng-deep .p-password,::ng-deep .p-picklist,::ng-deep .p-progressbar,::ng-deep .p-radiobutton,::ng-deep .p-rating,::ng-deep .p-sidebar,::ng-deep .p-splitbutton,::ng-deep .p-steps,::ng-deep .p-step,::ng-deep .p-table,::ng-deep .p-datatable,::ng-deep .p-tabview,::ng-deep .p-tabpanel,::ng-deep .p-tag,::ng-deep .p-toast,::ng-deep .p-toolbar,::ng-deep .p-tooltip,::ng-deep .p-tree,::ng-deep .p-treetable,::ng-deep .p-selectbutton,::ng-deep .p-stepper,::ng-deep .p-inputgroup,::ng-deep .p-inputgroup-addon,::ng-deep .p-text{font-family:Inter var,Inter,sans-serif!important}:host ::ng-deep .inputs{height:35px}:root{--kv-primary-color: #29b92d, --kv-secondary-color: #002542, --kv-terciary-color: #f2f3f5, --kv-primary-hover-color: #249a29, --kv-secondary-hover-color: #002038, --kv-terciary-hover-color: #d9dadb, --kv-primary-active-color: #1c801f, --kv-secondary-active-color: #001729, --kv-terciary-active-color: #c0c1c2, --kv-primary-disable-color: #1c801f, --kv-secondary-disable-color: #001729, --kv-terciary-disable-color: #c0c1c2, }::ng-deep .p-dialog .p-dialog-header{color:#fff!important;background:#002542!important;display:flex!important;flex-wrap:wrap;word-wrap:break-word}::ng-deep .p-dialog .p-dialog-content{padding-top:1rem}::ng-deep .p-dialog{min-width:320px}::ng-deep .p-dialog-content{overflow-x:hidden}::ng-deep .p-dialog-content::-webkit-scrollbar{width:8px}::ng-deep .p-dialog-content::-webkit-scrollbar:hover{background-color:#dededebf}::ng-deep .p-dialog-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:transparent}::ng-deep .p-dialog-content:hover::-webkit-scrollbar-thumb{border-left:2px solid white;background-color:#00000080}::ng-deep .p-dialog-content::-webkit-scrollbar-track{border-left:2px solid white;background-color:#dededebf}::ng-deep .p-dialog-footer{display:flex;justify-content:flex-end;padding:10px;gap:10px}::ng-deep .p-dialog .p-dialog-header .p-dialog-header-icon{display:none}img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal{display:block;position:absolute;z-index:9999;left:0;top:0;width:100vw;height:100vh;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:1% auto;padding:20px;border:1px solid #888;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid black;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px solid black;border-radius:50%;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"] }]
4168
- }], ctorParameters: () => [{ type: ImagensService }, { type: NotificationService }], propDecorators: { borderColor: [{
4698
+ args: [{ selector: 'kv-avatar', template: "<div class=\"image-container\" [style.width.px]=\"width\" [style.height.px]=\"height\" >\r\n\r\n <img\r\n [src]=\"imageSource()\"\r\n (load)=\"onImageLoad()\"\r\n (error)=\"handleImageError($event)\"\r\n alt=\"Foto\"\r\n class=\"container-foto\"\r\n [style.border-color]=\"borderColor\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n >\r\n\r\n <div class=\"btn\">\r\n <input #fileInput *ngIf=\"btnAlterarFoto\" id=\"fotoEscolhida\" type=\"file\" accept=\"image/*\" style=\"display:none\" (change)=\"changeImage($any($event))\">\r\n\r\n <button *ngIf=\"btnAlterarFoto && !existeLogo\"\r\n class=\"botao-alterar-foto border-circle\"\r\n [style.background-color]=\"btnsColor\" (click)=\"openFile()\">\r\n <i class=\"material-symbols-outlined\">photo_camera</i>\r\n </button>\r\n\r\n <button *ngIf=\"btnAlterarFoto && existeLogo\" [style.background-color]=\"btnsColor\"\r\n class=\"botao-excluir-foto border-circle\r\n hover:shadow-3\r\n active:shadow-5\"\r\n (click)=\"questionRemoverFoto()\">\r\n <i class=\"material-symbols-outlined\">delete</i>\r\n </button>\r\n </div>\r\n\r\n <ngx-loading [show]=\"!imageLoaded()\" full class=\"container-foto\" [config]=\"{backdropBorderRadius: '100%', fullScreenBackdrop: false }\"></ngx-loading>\r\n\r\n</div>\r\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0\";.material-symbols-outlined{font-family:Material Symbols Outlined!important}*{font-family:Inter var,Inter,sans-serif!important}::ng-deep .p-accordion,::ng-deep .p-accordion-header,::ng-deep .p-accordion-content,::ng-deep .p-badge,::ng-deep .p-overlay-badge,::ng-deep .p-breadcrumb,::ng-deep .p-breadcrumb-item,::ng-deep .p-breadcrumb-link,::ng-deep .p-button,::ng-deep .p-calendar,::ng-deep .p-card,::ng-deep .p-card-title,::ng-deep .p-card-subtitle,::ng-deep .p-card-content,::ng-deep .p-checkbox,::ng-deep .p-chip,::ng-deep .p-confirm-dialog,::ng-deep .p-confirm-dialog-message,::ng-deep .p-contextmenu,::ng-deep .p-contextmenu-item,::ng-deep .p-dataview,::ng-deep .p-dataview-content,::ng-deep .p-dialog,::ng-deep .p-dialog-title,::ng-deep .p-dialog-content,::ng-deep .p-dropdown,::ng-deep .p-dropdown-label,::ng-deep .p-dropdown-item,::ng-deep .p-dynamic-dialog,::ng-deep .p-dynamic-dialog-title,::ng-deep .p-dynamic-dialog-content,::ng-deep .p-editor,::ng-deep .p-fieldset,::ng-deep .p-fieldset-legend,::ng-deep .p-fieldset-content,::ng-deep .p-fileupload,::ng-deep .p-inputmask,::ng-deep .p-inputnumber,::ng-deep .p-inputtextarea,::ng-deep .p-inputtext,::ng-deep .p-menu,::ng-deep .p-menuitem,::ng-deep .p-menuitem-text,::ng-deep .p-message,::ng-deep .p-messages,::ng-deep .p-multiselect,::ng-deep .p-multiselect-label,::ng-deep .p-multiselect-item,::ng-deep .p-panelmenu,::ng-deep .p-panelmenu-header,::ng-deep .p-panelmenu-content,::ng-deep .p-panel,::ng-deep .p-panel-header,::ng-deep .p-panel-content,::ng-deep .p-password,::ng-deep .p-picklist,::ng-deep .p-progressbar,::ng-deep .p-radiobutton,::ng-deep .p-rating,::ng-deep .p-sidebar,::ng-deep .p-splitbutton,::ng-deep .p-steps,::ng-deep .p-step,::ng-deep .p-table,::ng-deep .p-datatable,::ng-deep .p-tabview,::ng-deep .p-tabpanel,::ng-deep .p-tag,::ng-deep .p-toast,::ng-deep .p-toolbar,::ng-deep .p-tooltip,::ng-deep .p-tree,::ng-deep .p-treetable,::ng-deep .p-selectbutton,::ng-deep .p-stepper,::ng-deep .p-inputgroup,::ng-deep .p-inputgroup-addon,::ng-deep .p-text{font-family:Inter var,Inter,sans-serif!important}:host ::ng-deep .inputs{height:35px}:root{--kv-primary-color: #29b92d, --kv-secondary-color: #002542, --kv-terciary-color: #f2f3f5, --kv-primary-hover-color: #249a29, --kv-secondary-hover-color: #002038, --kv-terciary-hover-color: #d9dadb, --kv-primary-active-color: #1c801f, --kv-secondary-active-color: #001729, --kv-terciary-active-color: #c0c1c2, --kv-primary-disable-color: #1c801f, --kv-secondary-disable-color: #001729, --kv-terciary-disable-color: #c0c1c2, }::ng-deep .p-dialog .p-dialog-header{color:#fff!important;background:#002542!important;display:flex!important;flex-wrap:wrap;word-wrap:break-word}::ng-deep .p-dialog .p-dialog-content{padding-top:1rem}::ng-deep .p-dialog{min-width:320px}::ng-deep .p-dialog-content{overflow-x:hidden}::ng-deep .p-dialog-content::-webkit-scrollbar{width:8px}::ng-deep .p-dialog-content::-webkit-scrollbar:hover{background-color:#dededebf}::ng-deep .p-dialog-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:transparent}::ng-deep .p-dialog-content:hover::-webkit-scrollbar-thumb{border-left:2px solid white;background-color:#00000080}::ng-deep .p-dialog-content::-webkit-scrollbar-track{border-left:2px solid white;background-color:#dededebf}::ng-deep .p-dialog-footer{display:flex;justify-content:flex-end;padding:10px;gap:10px}::ng-deep .p-dialog .p-dialog-header .p-dialog-header-icon{display:none}img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal{display:block;position:absolute;z-index:9999;left:0;top:0;width:100vw;height:100vh;overflow:auto;background-color:#0006}.modal-content{background-color:#fefefe;margin:1% auto;padding:20px;border:1px solid #888;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid black;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px solid black;border-radius:50%;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"] }]
4699
+ }], ctorParameters: () => [{ type: ImagensService }, { type: NotificationService }, { type: ImageCutterService }], propDecorators: { borderColor: [{
4169
4700
  type: Input
4170
4701
  }], btnsColor: [{
4171
4702
  type: Input
@@ -4173,71 +4704,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
4173
4704
  type: Input
4174
4705
  }], height: [{
4175
4706
  type: Input
4707
+ }], btnAlterarFoto: [{
4708
+ type: Input
4176
4709
  }], imageUrlChange: [{
4177
4710
  type: Output
4178
- }], onModalOpen: [{
4179
- type: Output
4180
4711
  }], removerFotoEvent: [{
4181
4712
  type: Output
4182
- }], btnAlterarFoto: [{
4183
- type: Input
4184
- }], cropCanvas: [{
4185
- type: ViewChild,
4186
- args: ['cropCanvas']
4187
- }], cropBorder: [{
4188
- type: ViewChild,
4189
- args: ['cropBorder']
4190
4713
  }], fileInput: [{
4191
4714
  type: ViewChild,
4192
4715
  args: ['fileInput']
4193
- }], onWindowResize: [{
4194
- type: HostListener,
4195
- args: ['window:resize', ['$event']]
4196
4716
  }] } });
4197
4717
 
4198
- class KvButtonModule {
4199
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4200
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, declarations: [KvButtonComponent], imports: [CommonModule,
4201
- PrimeNgModule], exports: [KvButtonComponent] }); }
4202
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, imports: [CommonModule,
4203
- PrimeNgModule] }); }
4204
- }
4205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvButtonModule, decorators: [{
4206
- type: NgModule,
4207
- args: [{
4208
- declarations: [
4209
- KvButtonComponent
4210
- ],
4211
- imports: [
4212
- CommonModule,
4213
- PrimeNgModule
4214
- ],
4215
- exports: [
4216
- KvButtonComponent
4217
- ]
4218
- }]
4219
- }] });
4220
-
4221
- class KvLabelModule {
4222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4223
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, declarations: [KvLabelComponent], imports: [CommonModule], exports: [KvLabelComponent] }); }
4224
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, imports: [CommonModule] }); }
4225
- }
4226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvLabelModule, decorators: [{
4227
- type: NgModule,
4228
- args: [{
4229
- declarations: [
4230
- KvLabelComponent
4231
- ],
4232
- imports: [
4233
- CommonModule
4234
- ],
4235
- exports: [
4236
- KvLabelComponent
4237
- ]
4238
- }]
4239
- }] });
4240
-
4241
4718
  class KvAvatarModule {
4242
4719
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4243
4720
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarModule, declarations: [KvAvatarComponent], imports: [CommonModule,
@@ -4247,7 +4724,8 @@ class KvAvatarModule {
4247
4724
  FormsModule,
4248
4725
  ReactiveFormsModule,
4249
4726
  KvButtonModule,
4250
- KvLabelModule], exports: [KvAvatarComponent] }); }
4727
+ KvLabelModule,
4728
+ NgxLoadingModule], exports: [KvAvatarComponent] }); }
4251
4729
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarModule, imports: [CommonModule,
4252
4730
  ButtonModule,
4253
4731
  FileUploadModule,
@@ -4255,7 +4733,8 @@ class KvAvatarModule {
4255
4733
  FormsModule,
4256
4734
  ReactiveFormsModule,
4257
4735
  KvButtonModule,
4258
- KvLabelModule] }); }
4736
+ KvLabelModule,
4737
+ NgxLoadingModule] }); }
4259
4738
  }
4260
4739
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvAvatarModule, decorators: [{
4261
4740
  type: NgModule,
@@ -4272,6 +4751,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
4272
4751
  ReactiveFormsModule,
4273
4752
  KvButtonModule,
4274
4753
  KvLabelModule,
4754
+ NgxLoadingModule
4275
4755
  ],
4276
4756
  exports: [
4277
4757
  KvAvatarComponent
@@ -4399,7 +4879,7 @@ class KvCarouselComponent {
4399
4879
  window.open(link, '_blank');
4400
4880
  }
4401
4881
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4402
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { heightCarousel: { classPropertyName: "heightCarousel", publicName: "heightCarousel", isSignal: true, isRequired: false, transformFunction: null }, carouselData: { classPropertyName: "carouselData", publicName: "carouselData", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "carouselContainer", first: true, predicate: Carousel, descendants: true, isSignal: true }], ngImport: i0, template: "<p-carousel\r\n [value]=\"carouselData\"\r\n [indicatorStyleClass]=\"'carousel-indicator'\"\r\n [autoplayInterval]=\"5000\"\r\n [showIndicators]=\"true\"\r\n [showNavigators]=\"false\"\r\n [numVisible]=\"1\"\r\n [numScroll]=\"1\"\r\n [circular]=\"true\"\r\n styleClass=\"h-full\"\r\n>\r\n >\r\n <ng-template\r\n pTemplate=\"item\"\r\n let-banner\r\n class=\"justify-content-center align-items-center\"\r\n >\r\n <img\r\n [src]=\"banner.img\"\r\n class=\"w-full border-round-banner\"\r\n [style.height.px]=\"heightComputed()\"\r\n (click)=\"navigateToLink(banner.link)\"\r\n />\r\n </ng-template>\r\n</p-carousel>\r\n", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round-banner{border-radius:20px!important;max-height:500px}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$2.Carousel, selector: "p-carousel", inputs: ["page", "numVisible", "numScroll", "responsiveOptions", "orientation", "verticalViewPortHeight", "contentClass", "indicatorsContentClass", "indicatorsContentStyle", "indicatorStyleClass", "indicatorStyle", "value", "circular", "showIndicators", "showNavigators", "autoplayInterval", "style", "styleClass"], outputs: ["onPage"] }] }); }
4882
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { heightCarousel: { classPropertyName: "heightCarousel", publicName: "heightCarousel", isSignal: true, isRequired: false, transformFunction: null }, carouselData: { classPropertyName: "carouselData", publicName: "carouselData", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "carouselContainer", first: true, predicate: Carousel, descendants: true, isSignal: true }], ngImport: i0, template: "<p-carousel\r\n [value]=\"carouselData\"\r\n [indicatorStyleClass]=\"'carousel-indicator'\"\r\n [autoplayInterval]=\"5000\"\r\n [showIndicators]=\"true\"\r\n [showNavigators]=\"false\"\r\n [numVisible]=\"1\"\r\n [numScroll]=\"1\"\r\n [circular]=\"true\"\r\n styleClass=\"h-full\"\r\n>\r\n >\r\n <ng-template\r\n pTemplate=\"item\"\r\n let-banner\r\n class=\"justify-content-center align-items-center\"\r\n >\r\n <img\r\n [src]=\"banner.img\"\r\n class=\"w-full border-round-banner\"\r\n [style.height.px]=\"heightComputed()\"\r\n (click)=\"navigateToLink(banner.link)\"\r\n />\r\n </ng-template>\r\n</p-carousel>\r\n", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round-banner{border-radius:20px!important;max-height:500px}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$3.Carousel, selector: "p-carousel", inputs: ["page", "numVisible", "numScroll", "responsiveOptions", "orientation", "verticalViewPortHeight", "contentClass", "indicatorsContentClass", "indicatorsContentStyle", "indicatorStyleClass", "indicatorStyle", "value", "circular", "showIndicators", "showNavigators", "autoplayInterval", "style", "styleClass"], outputs: ["onPage"] }] }); }
4403
4883
  }
4404
4884
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, decorators: [{
4405
4885
  type: Component,
@@ -4998,7 +5478,7 @@ class KvSelectButtonComponent {
4998
5478
  this.optionClick.emit(event);
4999
5479
  }
5000
5480
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvSelectButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5001
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvSelectButtonComponent, selector: "kv-select-button", inputs: { formGroup: "formGroup", formControlName: "formControlName", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", mutiple: "mutiple", disabled: "disabled", value: "value" }, outputs: { onSelectionChange: "onSelectionChange", optionClick: "optionClick" }, ngImport: i0, template: "@if(value) {\r\n<p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"value\"\r\n/>\r\n} @else {\r\n<div [formGroup]=\"formGroup\">\r\n <p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [formControlName]=\"formControlName\"\r\n [(ngModel)]=\"value\"\r\n />\r\n</div>\r\n}", styles: [":host ::ng-deep .p-selectbutton .p-button.p-highlight{background:#183462!important;border:#183462;box-shadow:0 4px 10px #00000008,0 0 2px #0000000f,0 2px 6px #0000001f}\n"], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$3.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
5481
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvSelectButtonComponent, selector: "kv-select-button", inputs: { formGroup: "formGroup", formControlName: "formControlName", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", mutiple: "mutiple", disabled: "disabled", value: "value" }, outputs: { onSelectionChange: "onSelectionChange", optionClick: "optionClick" }, ngImport: i0, template: "@if(value) {\r\n<p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"value\"\r\n/>\r\n} @else {\r\n<div [formGroup]=\"formGroup\">\r\n <p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [formControlName]=\"formControlName\"\r\n [(ngModel)]=\"value\"\r\n />\r\n</div>\r\n}", styles: [":host ::ng-deep .p-selectbutton .p-button.p-highlight{background:#183462!important;border:#183462;box-shadow:0 4px 10px #00000008,0 0 2px #0000000f,0 2px 6px #0000001f}\n"], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$4.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
5002
5482
  }
5003
5483
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvSelectButtonComponent, decorators: [{
5004
5484
  type: Component,
@@ -5589,112 +6069,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
5589
6069
  }]
5590
6070
  }] });
5591
6071
 
5592
- class KvModalComponent {
5593
- constructor(dynamicDialogRef) {
5594
- this.dynamicDialogRef = dynamicDialogRef;
5595
- /**
5596
- * Ações do Dialog
5597
- */
5598
- this.actions = [];
5599
- this.actionsPosition = 'right';
5600
- this.justify_content = 'justify-content-start';
5601
- }
5602
- ngOnInit() {
5603
- this.addSubTitle();
5604
- this.setMarginBottom();
5605
- this.defPositionButtons();
5606
- }
5607
- onWindowResize() {
5608
- this.setMarginBottom();
5609
- }
5610
- /**
5611
- * Adiciona sub-título à tela
5612
- */
5613
- addSubTitle() {
5614
- if (this.subtitle) {
5615
- const headerElement = document.querySelector('.p-dialog .p-dialog-header');
5616
- if (headerElement) {
5617
- const subtitleElement = document.createElement('span');
5618
- subtitleElement.textContent = this.subtitle;
5619
- subtitleElement.style.fontSize = '0.75rem';
5620
- subtitleElement.style.width = '100%';
5621
- subtitleElement.style.marginLeft = '2px';
5622
- headerElement.appendChild(subtitleElement);
5623
- }
5624
- if (this.subHeader) {
5625
- const headerElement = document.querySelector('.p-dialog .p-dialog-header');
5626
- const subHeader = this.subHeader.nativeElement;
5627
- if (headerElement && this.subHeader) {
5628
- subHeader.style.width = '100%';
5629
- subHeader.style.marginLeft = '2px';
5630
- headerElement.appendChild(this.subHeader.nativeElement);
5631
- }
5632
- }
5633
- }
5634
- }
5635
- defPositionButtons() {
5636
- if (this.actionsPosition === 'right') {
5637
- this.justify_content = 'justify-content-end';
5638
- }
5639
- if (this.actionsPosition === 'center') {
5640
- this.justify_content = 'justify-content-center';
5641
- }
5642
- if (this.actionsPosition === 'left') {
5643
- this.justify_content = 'justify-content-start';
5644
- }
5645
- }
5646
- setMarginBottom() {
5647
- let actionsFieldHeight = document.getElementById('actions-field')?.offsetHeight;
5648
- let divBox = document.getElementById('content-modal');
5649
- if (divBox) {
5650
- if (actionsFieldHeight) {
5651
- divBox.style.marginBottom = `${actionsFieldHeight + 30}px`;
5652
- }
5653
- else {
5654
- divBox.style.marginBottom = `50px`;
5655
- }
5656
- }
5657
- }
5658
- clickExecute(action) {
5659
- if (action.command) {
5660
- action.command();
5661
- if (action.closeAfterClick != false)
5662
- this.dynamicDialogRef.close();
5663
- }
5664
- }
5665
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalComponent, deps: [{ token: i1$3.DynamicDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
5666
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: KvModalComponent, selector: "kv-modal", inputs: { actions: "actions", actionsPosition: "actionsPosition", subtitle: "subtitle", subHeader: "subHeader" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, ngImport: i0, template: "<!-- RENDERIZA\u00C7\u00C3O DO MODAL -->\r\n<div class=\"col-12 mb-4\" id=\"content-modal\">\r\n <!-- COLOCAR UM COMPONENTE SUBHEADER AQUI -->\r\n\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<!-- RENDERIZA\u00C7\u00C3O DOS BOT\u00D5ES -->\r\n\r\n<div class=\"bg-white flex flex-row flex-wrap gap-2 p-2 modal-barra-acoes {{justify_content}}\" *ngIf=\"actions\" id=\"actions-field\">\r\n <kv-button\r\n *ngFor=\" let action of actions\"\r\n [ngClass]=\"action.visible==false?'hidden':''\"\r\n icon=\"{{action.icon}}\"\r\n label=\"{{action.label}}\"\r\n [disabled]=\"action.disabled || false\"\r\n (onClick)=\"clickExecute(action)\"\r\n [severity]=\"action.severity ||'primary'\"\r\n />\r\n</div>\r\n", styles: ["*{padding-bottom:0rem;padding-top:0rem}.barra-acoes{position:fixed;bottom:0;left:0;right:0;background-color:#fff;padding:10px;z-index:999}#page-form-container{padding-bottom:40px}@media screen and (max-width: 991px){#page-form-container{padding-bottom:100px}}.modal-barra-acoes{position:fixed;bottom:0;left:0;right:0;z-index:999;margin-right:1.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["label", "icon", "loading", "disabled", "severity", "size", "fullWidth"], outputs: ["onClick"] }] }); }
5667
- }
5668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalComponent, decorators: [{
5669
- type: Component,
5670
- args: [{ selector: 'kv-modal', template: "<!-- RENDERIZA\u00C7\u00C3O DO MODAL -->\r\n<div class=\"col-12 mb-4\" id=\"content-modal\">\r\n <!-- COLOCAR UM COMPONENTE SUBHEADER AQUI -->\r\n\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<!-- RENDERIZA\u00C7\u00C3O DOS BOT\u00D5ES -->\r\n\r\n<div class=\"bg-white flex flex-row flex-wrap gap-2 p-2 modal-barra-acoes {{justify_content}}\" *ngIf=\"actions\" id=\"actions-field\">\r\n <kv-button\r\n *ngFor=\" let action of actions\"\r\n [ngClass]=\"action.visible==false?'hidden':''\"\r\n icon=\"{{action.icon}}\"\r\n label=\"{{action.label}}\"\r\n [disabled]=\"action.disabled || false\"\r\n (onClick)=\"clickExecute(action)\"\r\n [severity]=\"action.severity ||'primary'\"\r\n />\r\n</div>\r\n", styles: ["*{padding-bottom:0rem;padding-top:0rem}.barra-acoes{position:fixed;bottom:0;left:0;right:0;background-color:#fff;padding:10px;z-index:999}#page-form-container{padding-bottom:40px}@media screen and (max-width: 991px){#page-form-container{padding-bottom:100px}}.modal-barra-acoes{position:fixed;bottom:0;left:0;right:0;z-index:999;margin-right:1.5rem}\n"] }]
5671
- }], ctorParameters: () => [{ type: i1$3.DynamicDialogRef }], propDecorators: { actions: [{
5672
- type: Input
5673
- }], actionsPosition: [{
5674
- type: Input
5675
- }], subtitle: [{
5676
- type: Input
5677
- }], subHeader: [{
5678
- type: Input
5679
- }], onWindowResize: [{
5680
- type: HostListener,
5681
- args: ['window:resize', ['$event']]
5682
- }] } });
5683
-
5684
- class KvModalModule {
5685
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5686
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, declarations: [KvModalComponent], imports: [CommonModule, PrimeNgModule, KvButtonModule], exports: [KvModalComponent] }); }
5687
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, imports: [CommonModule, PrimeNgModule, KvButtonModule] }); }
5688
- }
5689
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvModalModule, decorators: [{
5690
- type: NgModule,
5691
- args: [{
5692
- declarations: [KvModalComponent],
5693
- imports: [CommonModule, PrimeNgModule, KvButtonModule],
5694
- exports: [KvModalComponent],
5695
- }]
5696
- }] });
5697
-
5698
6072
  class KvOrgchartComponent {
5699
6073
  constructor(renderer) {
5700
6074
  this.renderer = renderer;
@@ -7128,12 +7502,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
7128
7502
  }] });
7129
7503
 
7130
7504
  class KvImageUploadComponent {
7131
- constructor(notificationService) {
7505
+ constructor(notificationService, imageCutterService) {
7132
7506
  this.notificationService = notificationService;
7507
+ this.imageCutterService = imageCutterService;
7133
7508
  this.file = null;
7134
7509
  this.fileSrc = null;
7135
7510
  this.widthComponent = '400px';
7136
7511
  this.heightComponent = 'auto';
7512
+ this.cutImage = input(false);
7513
+ this.cutWidth = input(0);
7514
+ this.cutHeight = input(0);
7515
+ this.cutCircle = input(false);
7137
7516
  this.maxHeightImage = '400px';
7138
7517
  this.fileEmit = new EventEmitter();
7139
7518
  this.deleteEmit = new EventEmitter();
@@ -7164,13 +7543,31 @@ class KvImageUploadComponent {
7164
7543
  }
7165
7544
  handleFile(file) {
7166
7545
  if (file.type.startsWith('image/')) {
7167
- this.file = file;
7168
- const reader = new FileReader();
7169
- reader.onload = (e) => {
7170
- this.fileSrc = reader.result;
7171
- };
7172
- reader.readAsDataURL(file);
7173
- this.fileEmit.emit(file);
7546
+ if (this.cutImage() == true) {
7547
+ this.file = file;
7548
+ const reader = new FileReader();
7549
+ reader.onload = async () => {
7550
+ try {
7551
+ const result = await this.imageCutterService.cut(reader.result?.toString() ?? '', this.cutWidth(), this.cutHeight(), this.cutCircle());
7552
+ this.fileSrc = result;
7553
+ this.fileEmit.emit(result);
7554
+ }
7555
+ catch (error) {
7556
+ this.deleteImage();
7557
+ }
7558
+ };
7559
+ reader.readAsDataURL(file);
7560
+ }
7561
+ else {
7562
+ // ?! Comportamneto padrão --> Preservar <-- !!!
7563
+ this.file = file;
7564
+ const reader = new FileReader();
7565
+ reader.onload = (e) => {
7566
+ this.fileSrc = reader.result;
7567
+ };
7568
+ reader.readAsDataURL(file);
7569
+ this.fileEmit.emit(file);
7570
+ }
7174
7571
  }
7175
7572
  else {
7176
7573
  this.notificationService.toastError('Apenas arquivos de imagem são permitidos.');
@@ -7187,15 +7584,18 @@ class KvImageUploadComponent {
7187
7584
  deleteImage() {
7188
7585
  this.file = null;
7189
7586
  this.fileSrc = null;
7587
+ if (this.fileInput) {
7588
+ this.fileInput.nativeElement.value = '';
7589
+ }
7190
7590
  this.deleteEmit.emit();
7191
7591
  }
7192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvImageUploadComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
7193
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvImageUploadComponent, selector: "kv-image-upload", inputs: { fileSrc: "fileSrc", widthComponent: "widthComponent", heightComponent: "heightComponent", maxHeightImage: "maxHeightImage", description: "description" }, outputs: { fileEmit: "fileEmit", deleteEmit: "deleteEmit" }, ngImport: i0, template: "<div\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n class=\"relative overflow-hidden border-dashed border-2 border-round-lg border-gray-400 flex justify-content-end\"\r\n [style.width]=\"widthComponent\"\r\n [style.height]=\"heightComponent\"\r\n>\r\n\r\n <div\r\n class=\"w-full flex align-items-center justify-content-center\"\r\n style=\"cursor: pointer;\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <input\r\n type=\"file\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileInput\r\n hidden\r\n accept=\"image/*\"\r\n >\r\n <div\r\n *ngIf=\"!fileSrc\"\r\n class=\"flex flex-column align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined mt-2\"\r\n style=\"font-size: 3rem;\"\r\n >\r\n cloud_upload\r\n </span>\r\n\r\n @if(description) {\r\n <p class=\"font-semibold\">{{description}}</p>\r\n } @else {\r\n <p class=\"font-semibold\">Arraste e solte uma imagem aqui, ou</p>\r\n <p class=\"font-semibold\">clique para selecion\u00E1-la</p>\r\n }\r\n\r\n </div>\r\n <div *ngIf=\"fileSrc || file\">\r\n <img\r\n [src]=\"fileSrc\"\r\n [alt]=\"file?.name\"\r\n class=\"w-full\"\r\n [style.maxHeight]=\"maxHeightImage\"\r\n >\r\n </div>\r\n </div>\r\n\r\n @if(fileSrc || file) {\r\n <button\r\n style=\"background-color: transparent;\"\r\n pButton\r\n (click)=\"deleteImage()\"\r\n class=\"absolute transition-colors transition-duration-500 text-red-700 hover:text-red-500 w-2rem h-2rem\"\r\n [text]=\"true\"\r\n [icon]=\"'pi pi-trash'\"\r\n >\r\n </button>\r\n }\r\n \r\n\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
7592
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvImageUploadComponent, deps: [{ token: NotificationService }, { token: ImageCutterService }], target: i0.ɵɵFactoryTarget.Component }); }
7593
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvImageUploadComponent, selector: "kv-image-upload", inputs: { fileSrc: { classPropertyName: "fileSrc", publicName: "fileSrc", isSignal: false, isRequired: false, transformFunction: null }, widthComponent: { classPropertyName: "widthComponent", publicName: "widthComponent", isSignal: false, isRequired: false, transformFunction: null }, heightComponent: { classPropertyName: "heightComponent", publicName: "heightComponent", isSignal: false, isRequired: false, transformFunction: null }, cutImage: { classPropertyName: "cutImage", publicName: "cutImage", isSignal: true, isRequired: false, transformFunction: null }, cutWidth: { classPropertyName: "cutWidth", publicName: "cutWidth", isSignal: true, isRequired: false, transformFunction: null }, cutHeight: { classPropertyName: "cutHeight", publicName: "cutHeight", isSignal: true, isRequired: false, transformFunction: null }, cutCircle: { classPropertyName: "cutCircle", publicName: "cutCircle", isSignal: true, isRequired: false, transformFunction: null }, maxHeightImage: { classPropertyName: "maxHeightImage", publicName: "maxHeightImage", isSignal: false, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { fileEmit: "fileEmit", deleteEmit: "deleteEmit" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n class=\"relative overflow-hidden border-dashed border-2 border-round-lg border-gray-400 flex justify-content-end\"\r\n [style.width]=\"widthComponent\"\r\n [style.height]=\"heightComponent\"\r\n>\r\n\r\n <div\r\n class=\"w-full flex align-items-center justify-content-center\"\r\n style=\"cursor: pointer;\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <input\r\n type=\"file\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileInput\r\n hidden\r\n accept=\"image/*\"\r\n >\r\n <div\r\n *ngIf=\"!fileSrc\"\r\n class=\"flex flex-column align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined mt-2\"\r\n style=\"font-size: 3rem;\"\r\n >\r\n cloud_upload\r\n </span>\r\n\r\n @if(description) {\r\n <p class=\"font-semibold\">{{description}}</p>\r\n } @else {\r\n <p class=\"font-semibold\">Arraste e solte uma imagem aqui, ou</p>\r\n <p class=\"font-semibold\">clique para selecion\u00E1-la</p>\r\n }\r\n\r\n </div>\r\n <div *ngIf=\"fileSrc || file\">\r\n <img\r\n [src]=\"fileSrc\"\r\n [alt]=\"file?.name\"\r\n class=\"w-full\"\r\n [style.maxHeight]=\"maxHeightImage\"\r\n >\r\n </div>\r\n </div>\r\n\r\n @if(fileSrc || file) {\r\n <button\r\n style=\"background-color: transparent;\"\r\n pButton\r\n (click)=\"deleteImage()\"\r\n class=\"absolute transition-colors transition-duration-500 text-red-700 hover:text-red-500 w-2rem h-2rem\"\r\n [text]=\"true\"\r\n [icon]=\"'pi pi-trash'\"\r\n >\r\n </button>\r\n }\r\n\r\n\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
7194
7594
  }
7195
7595
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvImageUploadComponent, decorators: [{
7196
7596
  type: Component,
7197
- args: [{ selector: 'kv-image-upload', template: "<div\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n class=\"relative overflow-hidden border-dashed border-2 border-round-lg border-gray-400 flex justify-content-end\"\r\n [style.width]=\"widthComponent\"\r\n [style.height]=\"heightComponent\"\r\n>\r\n\r\n <div\r\n class=\"w-full flex align-items-center justify-content-center\"\r\n style=\"cursor: pointer;\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <input\r\n type=\"file\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileInput\r\n hidden\r\n accept=\"image/*\"\r\n >\r\n <div\r\n *ngIf=\"!fileSrc\"\r\n class=\"flex flex-column align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined mt-2\"\r\n style=\"font-size: 3rem;\"\r\n >\r\n cloud_upload\r\n </span>\r\n\r\n @if(description) {\r\n <p class=\"font-semibold\">{{description}}</p>\r\n } @else {\r\n <p class=\"font-semibold\">Arraste e solte uma imagem aqui, ou</p>\r\n <p class=\"font-semibold\">clique para selecion\u00E1-la</p>\r\n }\r\n\r\n </div>\r\n <div *ngIf=\"fileSrc || file\">\r\n <img\r\n [src]=\"fileSrc\"\r\n [alt]=\"file?.name\"\r\n class=\"w-full\"\r\n [style.maxHeight]=\"maxHeightImage\"\r\n >\r\n </div>\r\n </div>\r\n\r\n @if(fileSrc || file) {\r\n <button\r\n style=\"background-color: transparent;\"\r\n pButton\r\n (click)=\"deleteImage()\"\r\n class=\"absolute transition-colors transition-duration-500 text-red-700 hover:text-red-500 w-2rem h-2rem\"\r\n [text]=\"true\"\r\n [icon]=\"'pi pi-trash'\"\r\n >\r\n </button>\r\n }\r\n \r\n\r\n</div>" }]
7198
- }], ctorParameters: () => [{ type: NotificationService }], propDecorators: { fileSrc: [{
7597
+ args: [{ selector: 'kv-image-upload', template: "<div\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n class=\"relative overflow-hidden border-dashed border-2 border-round-lg border-gray-400 flex justify-content-end\"\r\n [style.width]=\"widthComponent\"\r\n [style.height]=\"heightComponent\"\r\n>\r\n\r\n <div\r\n class=\"w-full flex align-items-center justify-content-center\"\r\n style=\"cursor: pointer;\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <input\r\n type=\"file\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileInput\r\n hidden\r\n accept=\"image/*\"\r\n >\r\n <div\r\n *ngIf=\"!fileSrc\"\r\n class=\"flex flex-column align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined mt-2\"\r\n style=\"font-size: 3rem;\"\r\n >\r\n cloud_upload\r\n </span>\r\n\r\n @if(description) {\r\n <p class=\"font-semibold\">{{description}}</p>\r\n } @else {\r\n <p class=\"font-semibold\">Arraste e solte uma imagem aqui, ou</p>\r\n <p class=\"font-semibold\">clique para selecion\u00E1-la</p>\r\n }\r\n\r\n </div>\r\n <div *ngIf=\"fileSrc || file\">\r\n <img\r\n [src]=\"fileSrc\"\r\n [alt]=\"file?.name\"\r\n class=\"w-full\"\r\n [style.maxHeight]=\"maxHeightImage\"\r\n >\r\n </div>\r\n </div>\r\n\r\n @if(fileSrc || file) {\r\n <button\r\n style=\"background-color: transparent;\"\r\n pButton\r\n (click)=\"deleteImage()\"\r\n class=\"absolute transition-colors transition-duration-500 text-red-700 hover:text-red-500 w-2rem h-2rem\"\r\n [text]=\"true\"\r\n [icon]=\"'pi pi-trash'\"\r\n >\r\n </button>\r\n }\r\n\r\n\r\n</div>\r\n" }]
7598
+ }], ctorParameters: () => [{ type: NotificationService }, { type: ImageCutterService }], propDecorators: { fileSrc: [{
7199
7599
  type: Input
7200
7600
  }], widthComponent: [{
7201
7601
  type: Input
@@ -7209,6 +7609,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
7209
7609
  type: Output
7210
7610
  }], deleteEmit: [{
7211
7611
  type: Output
7612
+ }], fileInput: [{
7613
+ type: ViewChild,
7614
+ args: ['fileInput']
7212
7615
  }] } });
7213
7616
 
7214
7617
  class KvImageUploadModule {
@@ -7866,7 +8269,7 @@ class KvFilterFieldsetComponent {
7866
8269
  this.collapsedEvent.emit(this.isCollapsed);
7867
8270
  }
7868
8271
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvFilterFieldsetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7869
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvFilterFieldsetComponent, selector: "kv-filter-fieldset", inputs: { isExpandable: "isExpandable" }, outputs: { collapsedEvent: "collapsedEvent" }, ngImport: i0, template: "<p-fieldset styleClass=\"p-0 mb-2\" >\r\n <ng-template pTemplate=\"header\">\r\n @if(isExpandable) {\r\n <div\r\n class=\"flex flex-row align-items-center justify-content-center p-1 cursor-pointer\"\r\n (click)=\"toggleField()\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined flex align-items-center justify-content-center mr-2\"\r\n style=\"font-size: 1.4rem\"\r\n >\r\n {{ isCollapsed ? \"remove\" : \"add\" }}\r\n </span>\r\n\r\n <span class=\"text-sm\"> Filtros Avan\u00E7ados </span>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n</p-fieldset>\r\n", styles: ["::ng-deep .p-fieldset .p-fieldset-legend{padding:.3rem;margin-left:1rem}::ng-deep .p-fieldset .p-fieldset-legend{background-color:#fff;border:none}::ng-deep .p-fieldset .p-fieldset-legend:hover{background-color:#f5f5f5}::ng-deep .p-fieldset .p-fieldset-legend:active{background-color:#e0e0e0}::ng-deep .p-fieldset .p-fieldset-content{padding-top:0rem}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$4.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
8272
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvFilterFieldsetComponent, selector: "kv-filter-fieldset", inputs: { isExpandable: "isExpandable" }, outputs: { collapsedEvent: "collapsedEvent" }, ngImport: i0, template: "<p-fieldset styleClass=\"p-0 mb-2\" >\r\n <ng-template pTemplate=\"header\">\r\n @if(isExpandable) {\r\n <div\r\n class=\"flex flex-row align-items-center justify-content-center p-1 cursor-pointer\"\r\n (click)=\"toggleField()\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined flex align-items-center justify-content-center mr-2\"\r\n style=\"font-size: 1.4rem\"\r\n >\r\n {{ isCollapsed ? \"remove\" : \"add\" }}\r\n </span>\r\n\r\n <span class=\"text-sm\"> Filtros Avan\u00E7ados </span>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n</p-fieldset>\r\n", styles: ["::ng-deep .p-fieldset .p-fieldset-legend{padding:.3rem;margin-left:1rem}::ng-deep .p-fieldset .p-fieldset-legend{background-color:#fff;border:none}::ng-deep .p-fieldset .p-fieldset-legend:hover{background-color:#f5f5f5}::ng-deep .p-fieldset .p-fieldset-legend:active{background-color:#e0e0e0}::ng-deep .p-fieldset .p-fieldset-content{padding-top:0rem}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$5.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
7870
8273
  }
7871
8274
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvFilterFieldsetComponent, decorators: [{
7872
8275
  type: Component,
@@ -8554,5 +8957,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
8554
8957
  * Generated bundle index. Do not edit.
8555
8958
  */
8556
8959
 
8557
- export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropDownExternal, BaseComponentInput, BaseComponentMultiSelect, BasecomponentTable, BreadcrumbsService, CapitalizePipe, ChatService, ComponentProviders, ComponentService, CpfCnpjPipe, DocsService, DragDirective, DynamicInputDirective, FormService, ImagensService, KeevoComponentsModule, KeevoValidators, KvAvatarComponent, KvAvatarModule, KvButtonComponent, KvButtonModule, KvButtonPersonalizeComponent, KvButtonPopupComponent, KvButtonSecondaryComponent, KvButtonSuccessComponent, KvButtonsModule, KvCarouselComponent, KvCarouselModule, KvChartComponent, KvChartModule, KvCheckComponent, KvDropdownComponent, KvEditorComponent, KvErrorComponent, KvFileUploadComponent, KvFileUploadModule, KvFileViewerComponent, KvFileViewerModule, KvFilterCardComponent, KvFilterCardModule, KvFilterFieldsetComponent, KvFilterFieldsetModule, KvGIconComponent, KvGIconModule, KvHomeCardComponent, KvHomeCardModule, KvImageUploadComponent, KvImageUploadModule, KvInputCalendarComponent, KvInputMaskComponent, KvInputNumberComponent, KvInputPasswordComponent, KvInputTextCheckboxComponent, KvInputTextComponent, KvInputTextareaComponent, KvInputTimeComponent, KvInputsModule, KvLayoutComponent, KvLayoutModule, KvLoaderComponent, KvLoaderModule, KvLoaderService, KvLoginComponent, KvLoginModule, KvModalComponent, KvModalModule, KvMultiSelectComponent, KvOrgchartComponent, KvOrgchartModule, KvPageFormComponent, KvPageFormModule, KvPageStepperComponent, KvPageStepperodule, KvPickListComponent, KvPickListModule, KvProgressBarModule, KvRadioGroupComponent, KvReportComponent, KvReportModule, KvSelectButtonComponent, KvSelectButtonsComponent, KvStepperComponent, KvStepperModule, KvSwitchComponent, KvTableComponent, KvTableEditComponent, KvTableEditModule, KvTableExpandableComponent, KvTableExpandableModule, KvTableModule, KvTreeViewComponent, KvTreetableComponent, KvTreetableModule, KvWorkspaceModule, KvtreeViewModule, MaskPipe, NotificationService, ObjectService, PeriodosChart, PipesModule, PrimeNgModule, ProgressBarComponent, TablePaginate, TelefonePipe, TemplateDirective, TranslatePrimeng, WorkspaceComponent, getOrExecute, kvErrorModule, loading, mapToMenuItem };
8960
+ export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropDownExternal, BaseComponentInput, BaseComponentMultiSelect, BasecomponentTable, BreadcrumbsService, CapitalizePipe, ChatService, ComponentProviders, ComponentService, CpfCnpjPipe, DocsService, DragDirective, DynamicInputDirective, FormService, ImageCutterService, ImagensService, KeevoComponentsModule, KeevoValidators, KvAvatarComponent, KvAvatarModule, KvButtonComponent, KvButtonModule, KvButtonPersonalizeComponent, KvButtonPopupComponent, KvButtonSecondaryComponent, KvButtonSuccessComponent, KvButtonsModule, KvCarouselComponent, KvCarouselModule, KvChartComponent, KvChartModule, KvCheckComponent, KvDropdownComponent, KvEditorComponent, KvErrorComponent, KvFileUploadComponent, KvFileUploadModule, KvFileViewerComponent, KvFileViewerModule, KvFilterCardComponent, KvFilterCardModule, KvFilterFieldsetComponent, KvFilterFieldsetModule, KvGIconComponent, KvGIconModule, KvHomeCardComponent, KvHomeCardModule, KvImageUploadComponent, KvImageUploadModule, KvInputCalendarComponent, KvInputMaskComponent, KvInputNumberComponent, KvInputPasswordComponent, KvInputTextCheckboxComponent, KvInputTextComponent, KvInputTextareaComponent, KvInputTimeComponent, KvInputsModule, KvLayoutComponent, KvLayoutModule, KvLoaderComponent, KvLoaderModule, KvLoaderService, KvLoginComponent, KvLoginModule, KvModalComponent, KvModalModule, KvMultiSelectComponent, KvOrgchartComponent, KvOrgchartModule, KvPageFormComponent, KvPageFormModule, KvPageStepperComponent, KvPageStepperodule, KvPickListComponent, KvPickListModule, KvProgressBarModule, KvRadioGroupComponent, KvReportComponent, KvReportModule, KvSelectButtonComponent, KvSelectButtonsComponent, KvStepperComponent, KvStepperModule, KvSwitchComponent, KvTableComponent, KvTableEditComponent, KvTableEditModule, KvTableExpandableComponent, KvTableExpandableModule, KvTableModule, KvTreeViewComponent, KvTreetableComponent, KvTreetableModule, KvWorkspaceModule, KvtreeViewModule, MaskPipe, NotificationService, ObjectService, PeriodosChart, PipesModule, PrimeNgModule, ProgressBarComponent, TablePaginate, TelefonePipe, TemplateDirective, TranslatePrimeng, WorkspaceComponent, getOrExecute, kvErrorModule, loading, mapToMenuItem };
8558
8961
  //# sourceMappingURL=keevo-components.mjs.map