@dev-tcloud/tcloud-ui 0.0.5 → 0.0.7

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.
Files changed (46) hide show
  1. package/README.md +5 -0
  2. package/esm2020/lib/_directives/directives.module.mjs +16 -0
  3. package/esm2020/lib/_directives/tooltip/tooltip.directive.mjs +165 -0
  4. package/esm2020/lib/_modules/tcloud-ui-data-list/services/data-list.service.mjs +39 -0
  5. package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list-option/tcloud-ui-data-list-option.component.mjs +56 -0
  6. package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.component.mjs +250 -0
  7. package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.mjs +3 -0
  8. package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.module.mjs +36 -0
  9. package/esm2020/lib/_modules/tcloud-ui-multi-input/tcloud-ui-multi-input.component.mjs +73 -0
  10. package/esm2020/lib/_modules/tcloud-ui-multi-input/tcloud-ui-multi-input.module.mjs +27 -0
  11. package/esm2020/lib/_modules/tcloud-ui-multi-select/tcloud-ui-multi-select.component.mjs +79 -0
  12. package/esm2020/lib/_modules/tcloud-ui-multi-select/tcloud-ui-multi-select.module.mjs +20 -0
  13. package/esm2020/lib/_pipes/cnpj.mjs +37 -0
  14. package/esm2020/lib/_pipes/cpf.mjs +37 -0
  15. package/esm2020/lib/_pipes/index.mjs +6 -0
  16. package/esm2020/lib/_pipes/monthname.mjs +25 -0
  17. package/esm2020/lib/_pipes/respective.mjs +68 -0
  18. package/esm2020/lib/_pipes/statusinfo.mjs +78 -0
  19. package/esm2020/lib/_pipes/tcloud-pipes.module.mjs +47 -0
  20. package/esm2020/lib/tcloud-ui.module.mjs +54 -7
  21. package/esm2020/public-api.mjs +21 -1
  22. package/fesm2015/dev-tcloud-tcloud-ui.mjs +1061 -11
  23. package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
  24. package/fesm2020/dev-tcloud-tcloud-ui.mjs +1054 -11
  25. package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
  26. package/lib/_directives/directives.module.d.ts +7 -0
  27. package/lib/_directives/tooltip/tooltip.directive.d.ts +34 -0
  28. package/lib/_modules/tcloud-ui-data-list/services/data-list.service.d.ts +20 -0
  29. package/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list-option/tcloud-ui-data-list-option.component.d.ts +22 -0
  30. package/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.component.d.ts +61 -0
  31. package/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.d.ts +4 -0
  32. package/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.module.d.ts +10 -0
  33. package/lib/_modules/tcloud-ui-multi-input/tcloud-ui-multi-input.component.d.ts +19 -0
  34. package/lib/_modules/tcloud-ui-multi-input/tcloud-ui-multi-input.module.d.ts +9 -0
  35. package/lib/_modules/tcloud-ui-multi-select/tcloud-ui-multi-select.component.d.ts +18 -0
  36. package/lib/_modules/tcloud-ui-multi-select/tcloud-ui-multi-select.module.d.ts +8 -0
  37. package/lib/_pipes/cnpj.d.ts +9 -0
  38. package/lib/_pipes/cpf.d.ts +9 -0
  39. package/lib/_pipes/index.d.ts +5 -0
  40. package/lib/_pipes/monthname.d.ts +8 -0
  41. package/lib/_pipes/respective.d.ts +11 -0
  42. package/lib/_pipes/statusinfo.d.ts +15 -0
  43. package/lib/_pipes/tcloud-pipes.module.d.ts +11 -0
  44. package/lib/tcloud-ui.module.d.ts +6 -1
  45. package/package.json +1 -1
  46. package/public-api.d.ts +11 -0
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, NgModule, Injectable, EventEmitter, Output, ViewChild } from '@angular/core';
2
+ import { Component, Input, NgModule, Injectable, EventEmitter, Output, ViewChild, forwardRef, Directive, HostListener, Pipe } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { Buffer } from 'buffer';
6
6
  import { Subject } from 'rxjs';
7
7
  import * as i1$1 from '@angular/router';
8
- import * as i3 from '@angular/forms';
9
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
8
+ import * as i2 from '@angular/forms';
9
+ import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl } from '@angular/forms';
10
10
  import { trigger, state, style, transition, animate } from '@angular/animations';
11
11
 
12
12
  class TCloudUiLinhaLogoComponent {
@@ -731,7 +731,7 @@ class TCloudUiModalFooterComponent {
731
731
  }
732
732
  }
733
733
  TCloudUiModalFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModalFooterComponent, deps: [{ token: TcloudModalService }], target: i0.ɵɵFactoryTarget.Component });
734
- TCloudUiModalFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiModalFooterComponent, selector: "tcloud-ui-modal-footer", inputs: { btnCloseText: "btnCloseText", btnCancelText: "btnCancelText", btnConfirmText: "btnConfirmText" }, viewQueries: [{ propertyName: "_formulario", first: true, predicate: ["_formulario"], descendants: true }], ngImport: i0, template: "<div class=\"tc-modal-footer\">\r\n\r\n <div class=\"input-confirm\" *ngIf=\"param_confirm && param_confirm.confirmText\">\r\n <p>Digite a palavra <strong>&quot;{{ param_confirm.confirmText }}&quot;</strong> para confirmar.</p>\r\n \r\n <form #_formulario=\"ngForm\" (ngSubmit)=\"toConfirm(_formulario.valid)\">\r\n <input \r\n [disabled]=\"loading\"\r\n placeholder=\"{{ param_confirm.confirmText }}\"\r\n name=\"txt_value\" \r\n [(ngModel)]=\"txt_value\" \r\n type=\"text\" \r\n class=\"form-control form-confirm\" \r\n required \r\n [class.different-text]=\"(txt_value).length >= (param_confirm.confirmText).length && (txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase()\" >\r\n </form>\r\n\r\n </div>\r\n\r\n <hr>\r\n\r\n <div class=\"actions-footer {{ (loading) ? 'state-loading' : '' }}\">\r\n <!-- {{ param_confirm | json }} -->\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && !param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toClose()\">{{ btnCloseText }}</button>\r\n\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toCancel()\">{{ btnCancelText }}</button>\r\n <button [disabled]=\"(txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase() || loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"ml-3 btn-new-green\" (click)=\"toConfirm(_formulario?.valid)\">{{ btnConfirmText }}</button>\r\n\r\n </div>\r\n</div>\r\n", styles: [".actions-footer{text-align:right}.ng-valid.ng-touched.different-text{border-color:#fb9c23}.form-confirm{max-width:200px}button:disabled{opacity:.7!important;cursor:not-allowed}.input-confirm{padding:5px 14px}.state-loading button{cursor:progress!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
734
+ TCloudUiModalFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiModalFooterComponent, selector: "tcloud-ui-modal-footer", inputs: { btnCloseText: "btnCloseText", btnCancelText: "btnCancelText", btnConfirmText: "btnConfirmText" }, viewQueries: [{ propertyName: "_formulario", first: true, predicate: ["_formulario"], descendants: true }], ngImport: i0, template: "<div class=\"tc-modal-footer\">\r\n\r\n <div class=\"input-confirm\" *ngIf=\"param_confirm && param_confirm.confirmText\">\r\n <p>Digite a palavra <strong>&quot;{{ param_confirm.confirmText }}&quot;</strong> para confirmar.</p>\r\n \r\n <form #_formulario=\"ngForm\" (ngSubmit)=\"toConfirm(_formulario.valid)\">\r\n <input \r\n [disabled]=\"loading\"\r\n placeholder=\"{{ param_confirm.confirmText }}\"\r\n name=\"txt_value\" \r\n [(ngModel)]=\"txt_value\" \r\n type=\"text\" \r\n class=\"form-control form-confirm\" \r\n required \r\n [class.different-text]=\"(txt_value).length >= (param_confirm.confirmText).length && (txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase()\" >\r\n </form>\r\n\r\n </div>\r\n\r\n <hr>\r\n\r\n <div class=\"actions-footer {{ (loading) ? 'state-loading' : '' }}\">\r\n <!-- {{ param_confirm | json }} -->\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && !param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toClose()\">{{ btnCloseText }}</button>\r\n\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toCancel()\">{{ btnCancelText }}</button>\r\n <button [disabled]=\"(txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase() || loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"ml-3 btn-new-green\" (click)=\"toConfirm(_formulario?.valid)\">{{ btnConfirmText }}</button>\r\n\r\n </div>\r\n</div>\r\n", styles: [".actions-footer{text-align:right}.ng-valid.ng-touched.different-text{border-color:#fb9c23}.form-confirm{max-width:200px}button:disabled{opacity:.7!important;cursor:not-allowed}.input-confirm{padding:5px 14px}.state-loading button{cursor:progress!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
735
735
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModalFooterComponent, decorators: [{
736
736
  type: Component,
737
737
  args: [{ selector: 'tcloud-ui-modal-footer', template: "<div class=\"tc-modal-footer\">\r\n\r\n <div class=\"input-confirm\" *ngIf=\"param_confirm && param_confirm.confirmText\">\r\n <p>Digite a palavra <strong>&quot;{{ param_confirm.confirmText }}&quot;</strong> para confirmar.</p>\r\n \r\n <form #_formulario=\"ngForm\" (ngSubmit)=\"toConfirm(_formulario.valid)\">\r\n <input \r\n [disabled]=\"loading\"\r\n placeholder=\"{{ param_confirm.confirmText }}\"\r\n name=\"txt_value\" \r\n [(ngModel)]=\"txt_value\" \r\n type=\"text\" \r\n class=\"form-control form-confirm\" \r\n required \r\n [class.different-text]=\"(txt_value).length >= (param_confirm.confirmText).length && (txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase()\" >\r\n </form>\r\n\r\n </div>\r\n\r\n <hr>\r\n\r\n <div class=\"actions-footer {{ (loading) ? 'state-loading' : '' }}\">\r\n <!-- {{ param_confirm | json }} -->\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && !param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toClose()\">{{ btnCloseText }}</button>\r\n\r\n <button [disabled]=\"loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"btn-new-grey\" (click)=\"toCancel()\">{{ btnCancelText }}</button>\r\n <button [disabled]=\"(txt_value).toLowerCase() !== (param_confirm.confirmText).toLowerCase() || loading\" *ngIf=\"param_confirm && param_confirm.confirm\" type=\"button\" class=\"ml-3 btn-new-green\" (click)=\"toConfirm(_formulario?.valid)\">{{ btnConfirmText }}</button>\r\n\r\n </div>\r\n</div>\r\n", styles: [".actions-footer{text-align:right}.ng-valid.ng-touched.different-text{border-color:#fb9c23}.form-confirm{max-width:200px}button:disabled{opacity:.7!important;cursor:not-allowed}.input-confirm{padding:5px 14px}.state-loading button{cursor:progress!important}\n"] }]
@@ -873,23 +873,1059 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
873
873
  }]
874
874
  }] });
875
875
 
876
+ class TCloudUiMultiSelectComponent {
877
+ constructor() {
878
+ this.placeholder = 'Selecione um item';
879
+ this.disabled = false;
880
+ this.loading = false;
881
+ this.count_actives = 0;
882
+ this.tcChange = new EventEmitter();
883
+ }
884
+ ngOnInit() {
885
+ setTimeout(() => {
886
+ this.toChange();
887
+ });
888
+ }
889
+ addItem(item) {
890
+ if (this.disabled) {
891
+ return;
892
+ }
893
+ if (this.tcList) {
894
+ for (let i = 0; i < (this.tcList).length; i++) {
895
+ const row = this.tcList[i];
896
+ if (item === row.value) {
897
+ this.tcList[i].active = true;
898
+ break;
899
+ }
900
+ }
901
+ this.toChange();
902
+ }
903
+ }
904
+ removeItem(item) {
905
+ if (this.disabled) {
906
+ return;
907
+ }
908
+ if (this.tcList) {
909
+ for (let i = 0; i < (this.tcList).length; i++) {
910
+ const row = this.tcList[i];
911
+ if (item === row.value) {
912
+ this.tcList[i].active = false;
913
+ break;
914
+ }
915
+ }
916
+ this.toChange();
917
+ }
918
+ }
919
+ toChange() {
920
+ let count_actives = 0;
921
+ let itens = [];
922
+ if (this.tcList) {
923
+ for (let i = 0; i < (this.tcList).length; i++) {
924
+ const row = this.tcList[i];
925
+ if (row.active) {
926
+ count_actives++;
927
+ (itens).push(row);
928
+ }
929
+ }
930
+ }
931
+ this.count_actives = count_actives;
932
+ this.tcChange.emit(itens);
933
+ }
934
+ }
935
+ TCloudUiMultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
936
+ TCloudUiMultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiMultiSelectComponent, selector: "tcloud-ui-multi-select", inputs: { tcList: "tcList", placeholder: "placeholder", disabled: "disabled", loading: "loading" }, outputs: { tcChange: "tcChange" }, ngImport: i0, template: "<div>\r\n <table>\r\n <tr *ngIf=\"tcList\">\r\n <td>\r\n <select\r\n #_select\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n [title]=\"tcList.length === 0 ? 'Nenhum item dispon\u00EDvel' : placeholder\">\r\n <option></option>\r\n <ng-container *ngFor=\"let item of tcList; let i = index\">\r\n <option [title]=\"item.description\" *ngIf=\"!item.active\" [value]=\"item.value\">{{ item.description }}</option>\r\n </ng-container>\r\n </select>\r\n </td>\r\n <td>\r\n <button\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n title=\"Adicionar\"\r\n class=\"btn-plus-select\"\r\n (click)=\"addItem(_select.value)\"\r\n type=\"button\">\r\n <i class=\"fas fa-plus\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n <div class=\"box-itens-selected\" *ngIf=\"count_actives > 0\">\r\n <ng-container *ngFor=\"let item of tcList\">\r\n\r\n <ng-container *ngIf=\"item.active\">\r\n <div class=\"box-label\">\r\n <div class=\"box-value\" [title]=\"item.value\">\r\n {{ item.value }} \r\n </div>\r\n <div class=\"box-action\">\r\n <button\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n title=\"Remover\"\r\n type=\"button\"\r\n (click)=\"removeItem(item.value)\">\r\n <i class=\"fas fa-times\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: ["table{width:100%;border-collapse:collapse;border:none}table td:first-child{width:100%}select{font-size:.8rem;height:40px;border:1px solid #999;border-radius:4px 0 0 4px;padding:6px 10px;white-space:nowrap;text-overflow:ellipsis;width:100%;background-color:#fff;color:#888}.btn-plus-select{width:30px;height:40px;border:none;color:#fff;background-color:var(--verde);border-radius:0 4px 4px 0}.box-itens-selected{display:flex;padding:9px;background-color:#ededed;border-radius:4px}select:disabled{opacity:.8!important;cursor:not-allowed!important;background-color:#ededed}button:disabled{opacity:.5!important;cursor:not-allowed!important}.box-label{display:flex;max-width:220px;height:35px;min-width:100px;background-color:var(--verde);color:#fff;padding:8px 15px 10px;border:none;border-radius:5px;margin:2px}.box-label .box-value{width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.box-label .box-action{width:8px}.box-label .box-action button{color:#d72020;background-color:var(--verde);border:none;font-weight:700;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectComponent, decorators: [{
938
+ type: Component,
939
+ args: [{ selector: 'tcloud-ui-multi-select', template: "<div>\r\n <table>\r\n <tr *ngIf=\"tcList\">\r\n <td>\r\n <select\r\n #_select\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n [title]=\"tcList.length === 0 ? 'Nenhum item dispon\u00EDvel' : placeholder\">\r\n <option></option>\r\n <ng-container *ngFor=\"let item of tcList; let i = index\">\r\n <option [title]=\"item.description\" *ngIf=\"!item.active\" [value]=\"item.value\">{{ item.description }}</option>\r\n </ng-container>\r\n </select>\r\n </td>\r\n <td>\r\n <button\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n title=\"Adicionar\"\r\n class=\"btn-plus-select\"\r\n (click)=\"addItem(_select.value)\"\r\n type=\"button\">\r\n <i class=\"fas fa-plus\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n <div class=\"box-itens-selected\" *ngIf=\"count_actives > 0\">\r\n <ng-container *ngFor=\"let item of tcList\">\r\n\r\n <ng-container *ngIf=\"item.active\">\r\n <div class=\"box-label\">\r\n <div class=\"box-value\" [title]=\"item.value\">\r\n {{ item.value }} \r\n </div>\r\n <div class=\"box-action\">\r\n <button\r\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\r\n title=\"Remover\"\r\n type=\"button\"\r\n (click)=\"removeItem(item.value)\">\r\n <i class=\"fas fa-times\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: ["table{width:100%;border-collapse:collapse;border:none}table td:first-child{width:100%}select{font-size:.8rem;height:40px;border:1px solid #999;border-radius:4px 0 0 4px;padding:6px 10px;white-space:nowrap;text-overflow:ellipsis;width:100%;background-color:#fff;color:#888}.btn-plus-select{width:30px;height:40px;border:none;color:#fff;background-color:var(--verde);border-radius:0 4px 4px 0}.box-itens-selected{display:flex;padding:9px;background-color:#ededed;border-radius:4px}select:disabled{opacity:.8!important;cursor:not-allowed!important;background-color:#ededed}button:disabled{opacity:.5!important;cursor:not-allowed!important}.box-label{display:flex;max-width:220px;height:35px;min-width:100px;background-color:var(--verde);color:#fff;padding:8px 15px 10px;border:none;border-radius:5px;margin:2px}.box-label .box-value{width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.box-label .box-action{width:8px}.box-label .box-action button{color:#d72020;background-color:var(--verde);border:none;font-weight:700;cursor:pointer}\n"] }]
940
+ }], ctorParameters: function () { return []; }, propDecorators: { tcList: [{
941
+ type: Input
942
+ }], placeholder: [{
943
+ type: Input
944
+ }], disabled: [{
945
+ type: Input
946
+ }], loading: [{
947
+ type: Input
948
+ }], tcChange: [{
949
+ type: Output
950
+ }] } });
951
+
952
+ class TCloudUiMultiSelectModule {
953
+ }
954
+ TCloudUiMultiSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
955
+ TCloudUiMultiSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectModule, declarations: [TCloudUiMultiSelectComponent], imports: [CommonModule], exports: [TCloudUiMultiSelectComponent] });
956
+ TCloudUiMultiSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectModule, imports: [CommonModule] });
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiSelectModule, decorators: [{
958
+ type: NgModule,
959
+ args: [{
960
+ declarations: [TCloudUiMultiSelectComponent],
961
+ exports: [TCloudUiMultiSelectComponent],
962
+ imports: [
963
+ CommonModule
964
+ ]
965
+ }]
966
+ }] });
967
+
968
+ class DataListService {
969
+ constructor() {
970
+ this._stateSourceValue = new Subject();
971
+ this.stateValue$ = this._stateSourceValue.asObservable();
972
+ this._stateSourceDescription = new Subject();
973
+ this.stateDescription$ = this._stateSourceDescription.asObservable();
974
+ this._stateSourceOptions = new Subject();
975
+ this.stateOptions$ = this._stateSourceOptions.asObservable();
976
+ this._stateSourceActive = new Subject();
977
+ this.stateActive$ = this._stateSourceActive.asObservable();
978
+ }
979
+ setItemValue(v) {
980
+ this.actived_value = v;
981
+ this._stateSourceValue.next(v);
982
+ }
983
+ setItemDescription(v) {
984
+ this._stateSourceDescription.next(v);
985
+ }
986
+ registerSelectionOptionsDescription(v) {
987
+ this._stateSourceOptions.next(v);
988
+ }
989
+ setActiveItem(v) {
990
+ // console.log('setActiveItem', v);
991
+ this._stateSourceActive.next(v);
992
+ }
993
+ getActiveItem() {
994
+ // console.log('getActiveItem', this.actived_value);
995
+ return this.actived_value;
996
+ }
997
+ }
998
+ DataListService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DataListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
999
+ DataListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DataListService });
1000
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DataListService, decorators: [{
1001
+ type: Injectable
1002
+ }] });
1003
+
1004
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
1005
+ provide: NG_VALUE_ACCESSOR,
1006
+ useExisting: forwardRef(() => TCloudUiDataListComponent),
1007
+ multi: true
1008
+ };
1009
+ const noop = () => {
1010
+ };
1011
+ class TCloudUiDataListComponent {
1012
+ constructor(dataListService, formBuilder) {
1013
+ this.dataListService = dataListService;
1014
+ this.formBuilder = formBuilder;
1015
+ this.viewport_width = 0;
1016
+ this.viewport_height = 0;
1017
+ this.box_height = 0;
1018
+ this.box_style = '';
1019
+ this.menu_on_top = '';
1020
+ this.placeholder = '';
1021
+ this._disabled = false;
1022
+ this._loading = false;
1023
+ this.search = true;
1024
+ this.onInputChange = new EventEmitter();
1025
+ this.onChange = new EventEmitter();
1026
+ this.list_selected_options = new Array();
1027
+ this.menu_show = false;
1028
+ this.search_text = '';
1029
+ this.id = '';
1030
+ //Placeholders for the callbacks which are later providesd
1031
+ //by the Control Value Accessor
1032
+ this.onTouchedCallback = noop;
1033
+ this.onChangeCallback = noop;
1034
+ }
1035
+ set disabled(v) {
1036
+ this._disabled = v;
1037
+ if (this._disabled) {
1038
+ this.selected_description = '';
1039
+ this.selected_item = '';
1040
+ this.toChange();
1041
+ }
1042
+ }
1043
+ get disabled() { return this._disabled; }
1044
+ set loading(v) {
1045
+ this._loading = v;
1046
+ if (this._loading) {
1047
+ this.selected_description = '';
1048
+ this.selected_item = '';
1049
+ this.toChange();
1050
+ }
1051
+ }
1052
+ get loading() { return this._loading; }
1053
+ set ngModel(v) {
1054
+ this.selected_item = v;
1055
+ this.selectDescription();
1056
+ }
1057
+ ngOnInit() {
1058
+ this.id = this.generateID();
1059
+ this.formulario = this.formBuilder.group({
1060
+ "selected_item": new FormControl('', []),
1061
+ });
1062
+ this.subscription_value = this.dataListService.stateValue$.subscribe(v => {
1063
+ this.selected_item = v;
1064
+ this.selectDescription();
1065
+ });
1066
+ this.subscription_description = this.dataListService.stateDescription$.subscribe(v => {
1067
+ this.selected_description = v;
1068
+ });
1069
+ this.subscription_options = this.dataListService.stateOptions$.subscribe((v) => {
1070
+ if (v && v.value) {
1071
+ (this.list_selected_options).push(v);
1072
+ }
1073
+ });
1074
+ this.toResize();
1075
+ this.toClick();
1076
+ }
1077
+ generateID() {
1078
+ return `data-list-${Math.floor(Math.random() * Math.floor(Math.random() * Date.now()))}`;
1079
+ }
1080
+ ngOnDestroy() {
1081
+ if (this.subscription_value) {
1082
+ this.subscription_value.unsubscribe();
1083
+ }
1084
+ if (this.subscription_description) {
1085
+ this.subscription_description.unsubscribe();
1086
+ }
1087
+ if (this.subscription_options) {
1088
+ this.subscription_options.unsubscribe();
1089
+ }
1090
+ }
1091
+ toSearch(e) {
1092
+ let input = (e && e.target && e.target.value) ? e.target.value : '';
1093
+ let filter = (((input).normalize('NFD').replace(/[\u0300-\u036f]/g, "")).trim()).toLowerCase();
1094
+ let ul = document.getElementById(`${this.id}-options`);
1095
+ let li = ul.getElementsByTagName("button");
1096
+ for (let i = 0; i < li.length; i++) {
1097
+ const a = li[i];
1098
+ const txtValue = (((a.textContent || a.innerText).normalize('NFD').replace(/[\u0300-\u036f]/g, "")).trim()).toLowerCase();
1099
+ if (txtValue.indexOf(filter) > -1) {
1100
+ li[i].style.display = "";
1101
+ }
1102
+ else {
1103
+ li[i].style.display = "none";
1104
+ }
1105
+ }
1106
+ }
1107
+ selectDescription() {
1108
+ if (this.list_selected_options && (this.list_selected_options).length > 0) {
1109
+ for (let i = 0; i < (this.list_selected_options).length; i++) {
1110
+ const item = this.list_selected_options[i];
1111
+ if (item.value === this.selected_item) {
1112
+ this.selected_description = item.description;
1113
+ this.toChange();
1114
+ return;
1115
+ }
1116
+ }
1117
+ }
1118
+ if (this.selected_item === undefined || this.selected_item === null || this.selected_item === '') {
1119
+ this.toChange();
1120
+ }
1121
+ }
1122
+ toInput(e) {
1123
+ this.onChange.emit(e);
1124
+ }
1125
+ toChange() {
1126
+ setTimeout(() => {
1127
+ var _a, _b;
1128
+ if (this.selected_item === undefined || this.selected_item === null) {
1129
+ this.selected_item = '';
1130
+ }
1131
+ this.toSearch('');
1132
+ this.search_text = '';
1133
+ this.dataListService.setActiveItem(this.selected_item);
1134
+ this.onInputChange.emit(this.selected_description);
1135
+ if (this.formulario) {
1136
+ (_b = (_a = this.formulario) === null || _a === void 0 ? void 0 : _a.get('selected_item')) === null || _b === void 0 ? void 0 : _b.setValue(this.selected_item);
1137
+ // const input_hidden = document.getElementById(`${this.id}-hidden`);
1138
+ this.toInput(this.formulario.get('selected_item'));
1139
+ }
1140
+ });
1141
+ }
1142
+ clearTextSearch() {
1143
+ this.search_text = '';
1144
+ this.toSearch('');
1145
+ }
1146
+ toOpen() {
1147
+ this.menu_show = !this.menu_show;
1148
+ this.resolve_position_dropdown(this.menu_show);
1149
+ }
1150
+ resolve_position_dropdown(open) {
1151
+ var _a;
1152
+ if (open) {
1153
+ this.box_style = '';
1154
+ this.menu_on_top = '';
1155
+ const id = `${this.id}`;
1156
+ const box = `box-${this.id}`;
1157
+ if (this.viewport_height === 0) {
1158
+ this.viewport_height = window.innerWidth;
1159
+ }
1160
+ const rect = (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1161
+ const box_position = (rect === null || rect === void 0 ? void 0 : rect.bottom) || 0;
1162
+ setTimeout(() => {
1163
+ var _a;
1164
+ this.box_height = ((_a = document.getElementById(box)) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0;
1165
+ if ((this.viewport_height - box_position) < this.box_height) {
1166
+ this.menu_on_top = 'menu-on-top';
1167
+ this.box_style = `top: -${(this.box_height)}px; height: ${this.box_height}px;`;
1168
+ }
1169
+ });
1170
+ }
1171
+ }
1172
+ toClose() {
1173
+ this.menu_show = false;
1174
+ }
1175
+ toResize() {
1176
+ window.addEventListener('resize', () => {
1177
+ this.viewport_width = window.innerWidth;
1178
+ this.viewport_height = window.innerHeight;
1179
+ this.resolve_position_dropdown(this.menu_show);
1180
+ });
1181
+ }
1182
+ toClick() {
1183
+ const box = `area-${this.id}`;
1184
+ window.addEventListener('click', (e) => {
1185
+ var _a;
1186
+ if (this.menu_show) {
1187
+ if (!((_a = document.getElementById(box)) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
1188
+ this.menu_show = false;
1189
+ }
1190
+ }
1191
+ });
1192
+ }
1193
+ //get accessor
1194
+ get value() {
1195
+ return this.selected_item;
1196
+ }
1197
+ ;
1198
+ //set accessor including call the onchange callback
1199
+ set value(v) {
1200
+ if (v !== this.selected_item) {
1201
+ this.selected_item = v;
1202
+ this.onChangeCallback(v);
1203
+ }
1204
+ }
1205
+ //Set touched on blur
1206
+ onBlur() {
1207
+ this.onTouchedCallback();
1208
+ }
1209
+ //From ControlValueAccessor interface
1210
+ writeValue(value) {
1211
+ if (value !== this.selected_item) {
1212
+ this.selected_item = value;
1213
+ }
1214
+ }
1215
+ //From ControlValueAccessor interface
1216
+ registerOnChange(fn) {
1217
+ this.onChangeCallback = fn;
1218
+ }
1219
+ //From ControlValueAccessor interface
1220
+ registerOnTouched(fn) {
1221
+ this.onTouchedCallback = fn;
1222
+ }
1223
+ }
1224
+ TCloudUiDataListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListComponent, deps: [{ token: DataListService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
1225
+ TCloudUiDataListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiDataListComponent, selector: "tcloud-ui-data-list", inputs: { placeholder: "placeholder", disabled: "disabled", loading: "loading", search: "search", ngModel: "ngModel" }, outputs: { onInputChange: "onInputChange", onChange: "onChange" }, providers: [
1226
+ DataListService,
1227
+ CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR
1228
+ ], ngImport: i0, template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div>", styles: [".dropdown-toggle:after{display:none!important}.tc-dropdown{position:relative}.tc-dropdown .button-select{width:100%;background-color:#fff;border:1px solid #ccc;height:35px;text-align:left;padding-left:15px;font-size:14px;color:#666}.tc-dropdown .button-select span{position:absolute;right:6px;top:7px}.tc-dropdown .tc-dropdown-menu{width:100%;border:1px solid #ccc;background-color:#fff}.tc-dropdown .area-options{max-height:200px;overflow-y:scroll;overflow-x:hidden}.tc-dropdown .menu-on-top{position:absolute}.line-search{padding:3px}.line-search .box-search{width:100%;border-collapse:collapse}.line-search .box-search td.area-icon{padding:4px 0 2px 8px;width:35px}.line-search .box-search td.area-icon .icon-search{color:#666}.line-search .box-search td.area-icon button{border:none;background-color:transparent;color:#999;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.line-search .box-search td.area-input{border:none}.line-search .box-search td.area-input input{width:100%}.line-search .box-search input{width:100%;font-size:13px;height:33px;border:1px solid #ccc;padding:10px}.loading-area{line-height:0;position:relative;height:0;bottom:-10px;left:10px}button:disabled{background-color:#eee!important;border:1px solid #ececec!important;cursor:not-allowed}.loading-box{cursor:progress!important}.disabled i{color:#999!important}.to-hide{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
1229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListComponent, decorators: [{
1230
+ type: Component,
1231
+ args: [{ selector: 'tcloud-ui-data-list', providers: [
1232
+ DataListService,
1233
+ CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR
1234
+ ], template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div>", styles: [".dropdown-toggle:after{display:none!important}.tc-dropdown{position:relative}.tc-dropdown .button-select{width:100%;background-color:#fff;border:1px solid #ccc;height:35px;text-align:left;padding-left:15px;font-size:14px;color:#666}.tc-dropdown .button-select span{position:absolute;right:6px;top:7px}.tc-dropdown .tc-dropdown-menu{width:100%;border:1px solid #ccc;background-color:#fff}.tc-dropdown .area-options{max-height:200px;overflow-y:scroll;overflow-x:hidden}.tc-dropdown .menu-on-top{position:absolute}.line-search{padding:3px}.line-search .box-search{width:100%;border-collapse:collapse}.line-search .box-search td.area-icon{padding:4px 0 2px 8px;width:35px}.line-search .box-search td.area-icon .icon-search{color:#666}.line-search .box-search td.area-icon button{border:none;background-color:transparent;color:#999;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.line-search .box-search td.area-input{border:none}.line-search .box-search td.area-input input{width:100%}.line-search .box-search input{width:100%;font-size:13px;height:33px;border:1px solid #ccc;padding:10px}.loading-area{line-height:0;position:relative;height:0;bottom:-10px;left:10px}button:disabled{background-color:#eee!important;border:1px solid #ececec!important;cursor:not-allowed}.loading-box{cursor:progress!important}.disabled i{color:#999!important}.to-hide{display:none}\n"] }]
1235
+ }], ctorParameters: function () { return [{ type: DataListService }, { type: i2.FormBuilder }]; }, propDecorators: { placeholder: [{
1236
+ type: Input
1237
+ }], disabled: [{
1238
+ type: Input
1239
+ }], loading: [{
1240
+ type: Input
1241
+ }], search: [{
1242
+ type: Input
1243
+ }], onInputChange: [{
1244
+ type: Output
1245
+ }], onChange: [{
1246
+ type: Output
1247
+ }], ngModel: [{
1248
+ type: Input
1249
+ }] } });
1250
+
1251
+ class ISelectOptions {
1252
+ }
1253
+
1254
+ class TCloudUiDataListOptionComponent {
1255
+ constructor(dataListService) {
1256
+ this.dataListService = dataListService;
1257
+ this.id = '';
1258
+ this.select_options = new ISelectOptions();
1259
+ this.selected = new EventEmitter();
1260
+ this.subscription_active = dataListService.stateValue$.subscribe(v => { this.actived_value = v; });
1261
+ }
1262
+ ngOnInit() {
1263
+ this.id = this.generateID();
1264
+ this.setSelectOptions();
1265
+ }
1266
+ generateID() {
1267
+ return `data-list-option-${Math.floor(Math.random() * Math.floor(Math.random() * Date.now()))}`;
1268
+ }
1269
+ setSelectedItem(value) {
1270
+ var _a;
1271
+ if (value === '') {
1272
+ this.value = '';
1273
+ }
1274
+ this.dataListService.setItemValue(this.value);
1275
+ const description = ((_a = document.getElementById(this.id)) === null || _a === void 0 ? void 0 : _a.innerText) || '';
1276
+ this.dataListService.setItemDescription(description);
1277
+ this.setSelectOptions();
1278
+ }
1279
+ setSelectOptions() {
1280
+ setTimeout(() => {
1281
+ var _a;
1282
+ try {
1283
+ const description = (_a = document.getElementById(this.id)) === null || _a === void 0 ? void 0 : _a.innerText;
1284
+ this.select_options.value = this.value;
1285
+ this.select_options.description = description;
1286
+ this.dataListService.registerSelectionOptionsDescription(this.select_options);
1287
+ }
1288
+ catch (error) { }
1289
+ });
1290
+ }
1291
+ ngOnDestroy() {
1292
+ if (this.subscription_active) {
1293
+ this.subscription_active.unsubscribe();
1294
+ }
1295
+ }
1296
+ }
1297
+ TCloudUiDataListOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListOptionComponent, deps: [{ token: DataListService }], target: i0.ɵɵFactoryTarget.Component });
1298
+ TCloudUiDataListOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiDataListOptionComponent, selector: "tcloud-ui-data-list-option", inputs: { value: "value" }, outputs: { selected: "selected" }, ngImport: i0, template: "<button \r\n [title]=\"select_options.description\"\r\n id=\"{{id}}\"\r\n [attr.data-description]=\"select_options.description\"\r\n class=\"dropdown-item\" \r\n [class.null-value]=\"value === undefined || value === null || value === ''\"\r\n [class.active]=\"value === actived_value\" \r\n type=\"button\" \r\n [value]=\"value\"\r\n (click)=\"setSelectedItem(value)\" >\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["button{color:#666;width:100%;padding:10px;font-size:14px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}button:hover{background-color:#e5f5f9;color:#333}button.active{background-color:#ceedf5;color:#333}.null-value{height:35px}\n"] });
1299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListOptionComponent, decorators: [{
1300
+ type: Component,
1301
+ args: [{ selector: 'tcloud-ui-data-list-option', template: "<button \r\n [title]=\"select_options.description\"\r\n id=\"{{id}}\"\r\n [attr.data-description]=\"select_options.description\"\r\n class=\"dropdown-item\" \r\n [class.null-value]=\"value === undefined || value === null || value === ''\"\r\n [class.active]=\"value === actived_value\" \r\n type=\"button\" \r\n [value]=\"value\"\r\n (click)=\"setSelectedItem(value)\" >\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["button{color:#666;width:100%;padding:10px;font-size:14px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}button:hover{background-color:#e5f5f9;color:#333}button.active{background-color:#ceedf5;color:#333}.null-value{height:35px}\n"] }]
1302
+ }], ctorParameters: function () { return [{ type: DataListService }]; }, propDecorators: { value: [{
1303
+ type: Input
1304
+ }], selected: [{
1305
+ type: Output
1306
+ }] } });
1307
+
1308
+ class TCloudUiDataListModule {
1309
+ }
1310
+ TCloudUiDataListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1311
+ TCloudUiDataListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListModule, declarations: [TCloudUiDataListComponent,
1312
+ TCloudUiDataListOptionComponent], imports: [CommonModule,
1313
+ FormsModule,
1314
+ ReactiveFormsModule], exports: [TCloudUiDataListComponent,
1315
+ TCloudUiDataListOptionComponent] });
1316
+ TCloudUiDataListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListModule, imports: [CommonModule,
1317
+ FormsModule,
1318
+ ReactiveFormsModule] });
1319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListModule, decorators: [{
1320
+ type: NgModule,
1321
+ args: [{
1322
+ declarations: [
1323
+ TCloudUiDataListComponent,
1324
+ TCloudUiDataListOptionComponent,
1325
+ ],
1326
+ exports: [
1327
+ TCloudUiDataListComponent,
1328
+ TCloudUiDataListOptionComponent
1329
+ ],
1330
+ imports: [
1331
+ CommonModule,
1332
+ FormsModule,
1333
+ ReactiveFormsModule
1334
+ ]
1335
+ }]
1336
+ }] });
1337
+
1338
+ class TCloudUiTooltipDirective {
1339
+ constructor(el, renderer) {
1340
+ this.el = el;
1341
+ this.renderer = renderer;
1342
+ this._direction = 'top';
1343
+ // main
1344
+ this.el_height = 0;
1345
+ this.el_width = 0;
1346
+ this.el_center = 0;
1347
+ this.el_position = 0;
1348
+ // tooltip
1349
+ this.target_height = 0;
1350
+ this.target_width = 0;
1351
+ this.target_center = 0;
1352
+ this.ID = '';
1353
+ this.info_text = '';
1354
+ }
1355
+ onMouseOver() {
1356
+ if (this.getElement()) {
1357
+ this.renderer.addClass(this.el.nativeElement, 'main-tooltip');
1358
+ const el = this.getElement();
1359
+ el.style.display = 'inline';
1360
+ setTimeout(() => {
1361
+ var _a;
1362
+ this.el_height = this.el.nativeElement.offsetHeight;
1363
+ this.el_width = this.el.nativeElement.offsetWidth;
1364
+ this.el_center = this.el_width / 2;
1365
+ const rect = (_a = this.el.nativeElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1366
+ this.el_position = (rect === null || rect === void 0 ? void 0 : rect.left) || 0;
1367
+ // console.log('this.el_width', this.el_width);
1368
+ // console.log('this.el_center', this.el_center);
1369
+ // console.log('this.el_position', this.el_position);
1370
+ this.target_height = el.offsetHeight;
1371
+ this.target_width = el.offsetWidth;
1372
+ this.target_center = this.target_width / 2;
1373
+ // console.log('target_heigth', this.target_height);
1374
+ // console.log('target_width', this.target_width);
1375
+ // console.log('target_center', this.target_center);
1376
+ // this.renderer.setStyle(el, 'bottom', `${this.el_position}px`);
1377
+ switch (this._direction) {
1378
+ case 'top':
1379
+ this.to_top(el);
1380
+ break;
1381
+ case 'bottom':
1382
+ this.to_bottom(el);
1383
+ break;
1384
+ case 'left':
1385
+ this.to_left(el);
1386
+ break;
1387
+ case 'right':
1388
+ this.to_right(el);
1389
+ break;
1390
+ }
1391
+ });
1392
+ }
1393
+ }
1394
+ onMouseOut() {
1395
+ if (this.getElement()) {
1396
+ const el = this.getElement();
1397
+ el.style.display = 'none';
1398
+ this.renderer.removeClass(this.el.nativeElement, 'main-tooltip');
1399
+ }
1400
+ }
1401
+ set tooltip(tooltip) {
1402
+ if (tooltip) {
1403
+ this.check(tooltip);
1404
+ }
1405
+ }
1406
+ ;
1407
+ set direction(direction) {
1408
+ if (direction) {
1409
+ this._direction = direction;
1410
+ }
1411
+ }
1412
+ ;
1413
+ ngOnInit() {
1414
+ }
1415
+ generateID() {
1416
+ return `tc-tooltip-${Math.floor(Math.random() * Math.floor(Math.random() * Date.now()))}`;
1417
+ }
1418
+ getElement() {
1419
+ return document.getElementById(this.ID) || undefined;
1420
+ }
1421
+ check(tooltip) {
1422
+ this.ID = this.generateID();
1423
+ this.info_text = tooltip;
1424
+ let el = this.el.nativeElement;
1425
+ this.main_el = el;
1426
+ if (el) {
1427
+ this.create_tooltip(tooltip, el);
1428
+ }
1429
+ else {
1430
+ console.log("TCL: tooltip -> el", this.el.nativeElement);
1431
+ }
1432
+ }
1433
+ setStyle(el) {
1434
+ // this.renderer.setStyle(el, 'position', 'relative');
1435
+ // this.renderer.setStyle(el, 'display', 'inline');
1436
+ }
1437
+ create_tooltip(tip, el) {
1438
+ this.setStyle(el);
1439
+ const tooltip = document.createElement("div");
1440
+ tooltip.setAttribute('id', this.ID);
1441
+ tooltip.setAttribute('style', `
1442
+ position: absolute;
1443
+ display: none;
1444
+ padding: 10px;
1445
+ border-radius: 10px;
1446
+ text-align: center;
1447
+ width: max-content;
1448
+ max-width: 250px;
1449
+ background-color: transparent;
1450
+ color: transparent;
1451
+ z-index: 1090;
1452
+ bottom: ${this.el_position}px;
1453
+ left: ${this.target_center}px;
1454
+ `);
1455
+ tooltip.innerHTML = tip;
1456
+ el.insertBefore(tooltip, null);
1457
+ }
1458
+ to_top(el) {
1459
+ const pos = this.el_center - (this.target_center);
1460
+ this.renderer.setStyle(el, 'left', `${(pos)}px`);
1461
+ this.renderer.setStyle(el, 'bottom', `${(this.el_height + 7)}px`);
1462
+ el.setAttribute('class', 'tc-directive-tooltip tc-directive-tooltip-top');
1463
+ }
1464
+ to_bottom(el) {
1465
+ const pos = this.el_center - (this.target_center);
1466
+ this.renderer.setStyle(el, 'left', `${(pos)}px`);
1467
+ this.renderer.setStyle(el, 'bottom', `-${(this.target_height + 7)}px`);
1468
+ el.setAttribute('class', 'tc-directive-tooltip tc-directive-tooltip-bottom');
1469
+ }
1470
+ to_right(el) {
1471
+ const pos = this.el_width;
1472
+ this.renderer.setStyle(el, 'left', `${(pos + 11)}px`);
1473
+ this.renderer.setStyle(el, 'bottom', `-${(((this.target_height) / 2) - (this.el_height / 2))}px`);
1474
+ el.setAttribute('class', 'tc-directive-tooltip tc-directive-tooltip-right');
1475
+ }
1476
+ to_left(el) {
1477
+ const pos = -((this.target_width));
1478
+ this.renderer.setStyle(el, 'left', `${(pos - 11)}px`);
1479
+ this.renderer.setStyle(el, 'bottom', `-${(((this.target_height) / 2) - (this.el_height / 2))}px`);
1480
+ el.setAttribute('class', 'tc-directive-tooltip tc-directive-tooltip-left');
1481
+ }
1482
+ }
1483
+ TCloudUiTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
1484
+ TCloudUiTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiTooltipDirective, selector: "[tooltip]", inputs: { tooltip: "tooltip", direction: "direction" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseout": "onMouseOut()" } }, ngImport: i0 });
1485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiTooltipDirective, decorators: [{
1486
+ type: Directive,
1487
+ args: [{
1488
+ selector: '[tooltip]'
1489
+ }]
1490
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onMouseOver: [{
1491
+ type: HostListener,
1492
+ args: ['mouseover']
1493
+ }], onMouseOut: [{
1494
+ type: HostListener,
1495
+ args: ['mouseout']
1496
+ }], tooltip: [{
1497
+ type: Input
1498
+ }], direction: [{
1499
+ type: Input
1500
+ }] } });
1501
+
1502
+ class TCloudUiDirectiveModule {
1503
+ }
1504
+ TCloudUiDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1505
+ TCloudUiDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, declarations: [TCloudUiTooltipDirective], exports: [TCloudUiTooltipDirective] });
1506
+ TCloudUiDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule });
1507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, decorators: [{
1508
+ type: NgModule,
1509
+ args: [{
1510
+ declarations: [TCloudUiTooltipDirective],
1511
+ exports: [TCloudUiTooltipDirective],
1512
+ }]
1513
+ }] });
1514
+
1515
+ class MonthNamePipe {
1516
+ constructor() {
1517
+ this.meses = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezenbro'];
1518
+ }
1519
+ transform(yyyy_mm) {
1520
+ if (yyyy_mm !== '') {
1521
+ let part = (yyyy_mm).split('-');
1522
+ if ((part).length === 2) {
1523
+ let yyyy = +part[0];
1524
+ let mm = +part[1];
1525
+ return this.meses[(mm - 1)];
1526
+ }
1527
+ }
1528
+ return '';
1529
+ }
1530
+ }
1531
+ MonthNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MonthNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1532
+ MonthNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: MonthNamePipe, name: "monthname" });
1533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MonthNamePipe, decorators: [{
1534
+ type: Pipe,
1535
+ args: [{ name: 'monthname' }]
1536
+ }] });
1537
+
1538
+ class StatusInfoPipe {
1539
+ constructor() {
1540
+ this.status_default = [
1541
+ { key: 'SUCCEEDED', value: 'Finalizado' },
1542
+ { key: 'PENDING', value: 'Pendente' },
1543
+ { key: 'FAILED', value: 'Erro' },
1544
+ { key: 'RUNNING', value: 'Em andamento' },
1545
+ { key: 'REGISTRATION', value: 'Cadastro Pendente' },
1546
+ { key: 'SUCCEED', value: 'Finalizado' },
1547
+ { key: 'WAITING', value: 'Aguardando' },
1548
+ { key: 'REJECTED', value: 'Rejeitado' },
1549
+ ];
1550
+ this.status_proposal = [
1551
+ { key: 'SUCCEEDED', value: 'Finalizado' },
1552
+ { key: 'PENDING', value: 'Aguardando Aprovação' },
1553
+ { key: 'FAILED', value: 'Erro' },
1554
+ { key: 'RUNNING', value: 'Provisionando Ambientes' },
1555
+ { key: 'REGISTRATION', value: 'Cadastro Pendente' },
1556
+ { key: 'SUCCEED', value: 'Finalizado' },
1557
+ { key: 'WAITING', value: 'Provisionando Ambientes' },
1558
+ { key: 'REJECTED', value: 'Rejeitada' },
1559
+ ];
1560
+ }
1561
+ transform(status_name, tema) {
1562
+ let map_tema = this.status_default;
1563
+ if (tema && tema !== undefined) {
1564
+ switch (tema) {
1565
+ case 'proposal':
1566
+ map_tema = this.status_proposal;
1567
+ break;
1568
+ }
1569
+ }
1570
+ let status_name_in_search = '';
1571
+ if (tema && tema === 'ALL') {
1572
+ map_tema = this.status_default;
1573
+ if (status_name !== undefined && status_name !== null && `${status_name}` !== '') {
1574
+ for (let i = 0; i < (map_tema).length; i++) {
1575
+ if ((`${status_name}`).toLowerCase() === (`${map_tema[i].key}`).toLowerCase()) {
1576
+ status_name_in_search += ' ' + map_tema[i].value;
1577
+ break;
1578
+ }
1579
+ }
1580
+ }
1581
+ map_tema = this.status_proposal;
1582
+ if (status_name !== undefined && status_name !== null && `${status_name}` !== '') {
1583
+ for (let i = 0; i < (map_tema).length; i++) {
1584
+ if ((`${status_name}`).toLowerCase() === (`${map_tema[i].key}`).toLowerCase()) {
1585
+ status_name_in_search += ' ' + map_tema[i].value;
1586
+ break;
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+ else {
1592
+ if (status_name !== undefined && status_name !== null && `${status_name}` !== '') {
1593
+ for (let i = 0; i < (map_tema).length; i++) {
1594
+ if ((`${status_name}`).toLowerCase() === (`${map_tema[i].key}`).toLowerCase()) {
1595
+ status_name_in_search += ' ' + map_tema[i].value;
1596
+ break;
1597
+ }
1598
+ }
1599
+ }
1600
+ }
1601
+ if (status_name_in_search !== '') {
1602
+ return status_name_in_search;
1603
+ }
1604
+ return status_name;
1605
+ }
1606
+ }
1607
+ StatusInfoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: StatusInfoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1608
+ StatusInfoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: StatusInfoPipe, name: "statusinfo" });
1609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: StatusInfoPipe, decorators: [{
1610
+ type: Pipe,
1611
+ args: [{ name: 'statusinfo' }]
1612
+ }] });
1613
+
1614
+ class RespectivePipe {
1615
+ constructor() {
1616
+ this.map = [
1617
+ // Tipos de Ambientes
1618
+ { key: 'production', value: 'Produção' },
1619
+ { key: 'development', value: 'Desenvolvimento' },
1620
+ { key: 'qa', value: 'Qualidade' },
1621
+ // Implantação / Migração
1622
+ { key: 'golive', value: 'Pré GoLive' },
1623
+ { key: 'kickoff', value: 'Kickoff' },
1624
+ // Tipos de Clientes
1625
+ { key: 'prime', value: 'Prime' },
1626
+ { key: 'p', value: 'Pequeno' },
1627
+ { key: 'm', value: 'Médio' },
1628
+ { key: 'g', value: 'Grande' },
1629
+ // Produtos
1630
+ { key: '2c', value: 'Carol' },
1631
+ { key: 'carol', value: 'carol' },
1632
+ { key: 'consinco', value: 'Consinco' },
1633
+ { key: 'datasul', value: 'Datasul' },
1634
+ { key: 'fluig', value: 'Fluig' },
1635
+ { key: 'license-server', value: 'License Server' },
1636
+ { key: 'pep', value: 'PEP' },
1637
+ { key: 'protheus', value: 'Protheus' },
1638
+ { key: 'pvi', value: 'PVI' },
1639
+ { key: 'rm', value: 'RM' },
1640
+ { key: 'sfa', value: 'SFA' },
1641
+ { key: 'smartrm', value: 'Smart RM' },
1642
+ { key: 'smartrmcluster', value: 'Smart RM Cluster' },
1643
+ { key: 'smartrmcontrol', value: 'Smart RM Control' },
1644
+ { key: 'taf', value: 'TAF' },
1645
+ { key: 'treports', value: 'Treports' },
1646
+ { key: 'tss', value: 'TSS' },
1647
+ { key: 'winthor', value: 'Winthor' },
1648
+ // Tipos de SO
1649
+ { key: 'windows', value: 'Windows' },
1650
+ { key: 'linux', value: 'Linux' },
1651
+ // Tipos responsaveis
1652
+ { key: 'prime_customer_success', value: 'Customer Success' },
1653
+ { key: 'project_manager', value: 'Gerente de Projetos' },
1654
+ { key: 'prime_engineer', value: 'Engenheiro Prime' }
1655
+ ];
1656
+ }
1657
+ transform(v) {
1658
+ if (v !== '') {
1659
+ for (let i = 0; i < (this.map).length; i++) {
1660
+ let custom_v = v;
1661
+ custom_v = (custom_v).toLowerCase();
1662
+ custom_v = (custom_v).trim();
1663
+ custom_v = (custom_v).replace(/\_/g, "-");
1664
+ const current_key = (this.map[i].key).replace(/\_/g, "-");
1665
+ if ((custom_v).toLowerCase() === current_key) {
1666
+ return this.map[i].value;
1667
+ }
1668
+ }
1669
+ }
1670
+ return v;
1671
+ }
1672
+ }
1673
+ RespectivePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: RespectivePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1674
+ RespectivePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: RespectivePipe, name: "respective" });
1675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: RespectivePipe, decorators: [{
1676
+ type: Pipe,
1677
+ args: [{ name: 'respective' }]
1678
+ }] });
1679
+
1680
+ class CNPJPipe {
1681
+ constructor() {
1682
+ this.mascara = "##.###.###/####-##";
1683
+ }
1684
+ createMask(v) {
1685
+ const mask = this.mascara;
1686
+ let str = v.replace(/\s/g, '');
1687
+ let strMask = '';
1688
+ if (str.length == 14) {
1689
+ let j = 0;
1690
+ for (let i = 0; i < mask.length; i++) {
1691
+ if (mask[i] == '#') {
1692
+ strMask += str[j++];
1693
+ }
1694
+ else {
1695
+ strMask += mask[i];
1696
+ }
1697
+ }
1698
+ }
1699
+ else {
1700
+ return v;
1701
+ }
1702
+ return strMask;
1703
+ }
1704
+ transform(cnpj) {
1705
+ return this.createMask(cnpj);
1706
+ }
1707
+ }
1708
+ CNPJPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CNPJPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1709
+ CNPJPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: CNPJPipe, name: "cnpj" });
1710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CNPJPipe, decorators: [{
1711
+ type: Pipe,
1712
+ args: [{ name: 'cnpj' }]
1713
+ }] });
1714
+
1715
+ class CPFPipe {
1716
+ constructor() {
1717
+ this.mascara = "###.###.###-##";
1718
+ }
1719
+ createMask(v) {
1720
+ const mask = this.mascara;
1721
+ let str = v.replace(/\s/g, '');
1722
+ let strMask = '';
1723
+ if (str.length == 14) {
1724
+ let j = 0;
1725
+ for (let i = 0; i < mask.length; i++) {
1726
+ if (mask[i] == '#') {
1727
+ strMask += str[j++];
1728
+ }
1729
+ else {
1730
+ strMask += mask[i];
1731
+ }
1732
+ }
1733
+ }
1734
+ else {
1735
+ return v;
1736
+ }
1737
+ return strMask;
1738
+ }
1739
+ transform(cpf) {
1740
+ return this.createMask(cpf);
1741
+ }
1742
+ }
1743
+ CPFPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CPFPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1744
+ CPFPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: CPFPipe, name: "cpf" });
1745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CPFPipe, decorators: [{
1746
+ type: Pipe,
1747
+ args: [{ name: 'cpf' }]
1748
+ }] });
1749
+
1750
+ class TCloudUiPipesModule {
1751
+ }
1752
+ TCloudUiPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1753
+ TCloudUiPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiPipesModule, declarations: [MonthNamePipe,
1754
+ StatusInfoPipe,
1755
+ RespectivePipe,
1756
+ CNPJPipe], imports: [CommonModule], exports: [MonthNamePipe,
1757
+ StatusInfoPipe,
1758
+ RespectivePipe,
1759
+ CNPJPipe] });
1760
+ TCloudUiPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiPipesModule, providers: [
1761
+ MonthNamePipe,
1762
+ StatusInfoPipe,
1763
+ RespectivePipe,
1764
+ CNPJPipe
1765
+ ], imports: [CommonModule] });
1766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiPipesModule, decorators: [{
1767
+ type: NgModule,
1768
+ args: [{
1769
+ imports: [
1770
+ CommonModule,
1771
+ ],
1772
+ declarations: [
1773
+ MonthNamePipe,
1774
+ StatusInfoPipe,
1775
+ RespectivePipe,
1776
+ CNPJPipe
1777
+ ],
1778
+ exports: [
1779
+ MonthNamePipe,
1780
+ StatusInfoPipe,
1781
+ RespectivePipe,
1782
+ CNPJPipe
1783
+ ],
1784
+ providers: [
1785
+ MonthNamePipe,
1786
+ StatusInfoPipe,
1787
+ RespectivePipe,
1788
+ CNPJPipe
1789
+ ]
1790
+ }]
1791
+ }] });
1792
+
1793
+ class TCloudUiMultiInputComponent {
1794
+ constructor() {
1795
+ this.placeholder = '';
1796
+ this.disabled = false;
1797
+ this.loading = false;
1798
+ this.count_actives = 0;
1799
+ this.tcChange = new EventEmitter();
1800
+ }
1801
+ ngOnInit() {
1802
+ setTimeout(() => {
1803
+ this.toChange();
1804
+ });
1805
+ }
1806
+ addItem(item) {
1807
+ if (this.disabled) {
1808
+ return;
1809
+ }
1810
+ if (!this.tcList) {
1811
+ this.tcList = [];
1812
+ }
1813
+ (this.tcList).push({ value: item });
1814
+ this.toChange();
1815
+ this.input_value = '';
1816
+ }
1817
+ removeItem(item, index) {
1818
+ if (this.disabled) {
1819
+ return;
1820
+ }
1821
+ if (this.tcList) {
1822
+ for (let i = 0; i < (this.tcList).length; i++) {
1823
+ const row = this.tcList[i];
1824
+ if (item === row.value && i === index) {
1825
+ (this.tcList).splice(index, 1);
1826
+ break;
1827
+ }
1828
+ }
1829
+ this.toChange();
1830
+ }
1831
+ }
1832
+ toChange() {
1833
+ let count_actives = 0;
1834
+ let itens = [];
1835
+ if (this.tcList) {
1836
+ for (let i = 0; i < (this.tcList).length; i++) {
1837
+ const row = this.tcList[i];
1838
+ (itens).push(row);
1839
+ }
1840
+ }
1841
+ this.count_actives = count_actives;
1842
+ this.tcChange.emit(itens);
1843
+ }
1844
+ }
1845
+ TCloudUiMultiInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1846
+ TCloudUiMultiInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiMultiInputComponent, selector: "tcloud-ui-multi-input", inputs: { tcList: "tcList", placeholder: "placeholder", disabled: "disabled", loading: "loading" }, outputs: { tcChange: "tcChange" }, ngImport: i0, template: "<div>\n <form #_formulario=\"ngForm\">\n <table>\n <tr *ngIf=\"tcList\">\n <td>\n <input type=\"text\" [(ngModel)]=\"input_value\" [disabled]=\"disabled || loading\" name=\"input_value\" required>\n </td>\n <td>\n <button\n [disabled]=\"disabled || loading || !_formulario.valid\"\n title=\"Adicionar\"\n class=\"btn-plus-select\"\n (click)=\"addItem(input_value)\"\n type=\"button\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </td>\n </tr>\n </table>\n \n <div class=\"box-itens-selected\">\n <ng-container *ngFor=\"let item of tcList; let i = index\">\n \n <div class=\"box-label\">\n <div class=\"box-value\" [title]=\"item.value\">\n {{ item.value }} \n </div>\n <div class=\"box-action\">\n <button\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\n title=\"Remover\"\n type=\"button\"\n (click)=\"removeItem(item.value, i)\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n\n </ng-container>\n </div>\n </form>\n</div>\n ", styles: ["table{width:100%;border-collapse:collapse;border:none}table td:first-child{width:100%}input{font-size:.8rem;height:40px;border:1px solid #999;border-radius:4px 0 0 4px;padding:6px 10px;white-space:nowrap;text-overflow:ellipsis;width:100%;background-color:#fff;color:#888}.btn-plus-select{width:30px;height:40px;border:none;color:#fff;background-color:var(--verde);border-radius:0 4px 4px 0}.box-itens-selected{display:flex;padding:9px;background-color:#ededed;border-radius:4px}select:disabled{opacity:.8!important;cursor:not-allowed!important;background-color:#ededed}button:disabled{opacity:.5!important;cursor:not-allowed!important}.box-label{display:flex;max-width:220px;height:35px;min-width:100px;background-color:var(--verde);color:#fff;padding:8px 15px 10px;border:none;border-radius:5px;margin:2px}.box-label .box-value{width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.box-label .box-action{width:8px}.box-label .box-action button{color:#d72020;background-color:var(--verde);border:none;font-weight:700;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputComponent, decorators: [{
1848
+ type: Component,
1849
+ args: [{ selector: 'tcloud-ui-multi-input', template: "<div>\n <form #_formulario=\"ngForm\">\n <table>\n <tr *ngIf=\"tcList\">\n <td>\n <input type=\"text\" [(ngModel)]=\"input_value\" [disabled]=\"disabled || loading\" name=\"input_value\" required>\n </td>\n <td>\n <button\n [disabled]=\"disabled || loading || !_formulario.valid\"\n title=\"Adicionar\"\n class=\"btn-plus-select\"\n (click)=\"addItem(input_value)\"\n type=\"button\">\n <i class=\"fas fa-plus\"></i>\n </button>\n </td>\n </tr>\n </table>\n \n <div class=\"box-itens-selected\">\n <ng-container *ngFor=\"let item of tcList; let i = index\">\n \n <div class=\"box-label\">\n <div class=\"box-value\" [title]=\"item.value\">\n {{ item.value }} \n </div>\n <div class=\"box-action\">\n <button\n [disabled]=\"tcList === undefined || (tcList && tcList.length === 0) || disabled || loading\"\n title=\"Remover\"\n type=\"button\"\n (click)=\"removeItem(item.value, i)\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n\n </ng-container>\n </div>\n </form>\n</div>\n ", styles: ["table{width:100%;border-collapse:collapse;border:none}table td:first-child{width:100%}input{font-size:.8rem;height:40px;border:1px solid #999;border-radius:4px 0 0 4px;padding:6px 10px;white-space:nowrap;text-overflow:ellipsis;width:100%;background-color:#fff;color:#888}.btn-plus-select{width:30px;height:40px;border:none;color:#fff;background-color:var(--verde);border-radius:0 4px 4px 0}.box-itens-selected{display:flex;padding:9px;background-color:#ededed;border-radius:4px}select:disabled{opacity:.8!important;cursor:not-allowed!important;background-color:#ededed}button:disabled{opacity:.5!important;cursor:not-allowed!important}.box-label{display:flex;max-width:220px;height:35px;min-width:100px;background-color:var(--verde);color:#fff;padding:8px 15px 10px;border:none;border-radius:5px;margin:2px}.box-label .box-value{width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.box-label .box-action{width:8px}.box-label .box-action button{color:#d72020;background-color:var(--verde);border:none;font-weight:700;cursor:pointer}\n"] }]
1850
+ }], ctorParameters: function () { return []; }, propDecorators: { tcList: [{
1851
+ type: Input
1852
+ }], placeholder: [{
1853
+ type: Input
1854
+ }], disabled: [{
1855
+ type: Input
1856
+ }], loading: [{
1857
+ type: Input
1858
+ }], tcChange: [{
1859
+ type: Output
1860
+ }] } });
1861
+
1862
+ class TCloudUiMultiInputModule {
1863
+ }
1864
+ TCloudUiMultiInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1865
+ TCloudUiMultiInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputModule, declarations: [TCloudUiMultiInputComponent], imports: [FormsModule,
1866
+ ReactiveFormsModule,
1867
+ CommonModule], exports: [TCloudUiMultiInputComponent] });
1868
+ TCloudUiMultiInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputModule, imports: [FormsModule,
1869
+ ReactiveFormsModule,
1870
+ CommonModule] });
1871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiMultiInputModule, decorators: [{
1872
+ type: NgModule,
1873
+ args: [{
1874
+ declarations: [TCloudUiMultiInputComponent],
1875
+ exports: [TCloudUiMultiInputComponent],
1876
+ imports: [
1877
+ FormsModule,
1878
+ ReactiveFormsModule,
1879
+ CommonModule
1880
+ ]
1881
+ }]
1882
+ }] });
1883
+
876
1884
  class TCloudUiModule {
877
1885
  }
878
1886
  TCloudUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
879
1887
  TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, imports: [TCloudUiModalModule,
880
1888
  TCloudUiTabMenuModule,
881
1889
  TCloudUiLinhaLogoModule,
882
- TCloudUiLineStepCircleModule], exports: [TCloudUiModalModule,
1890
+ TCloudUiLineStepCircleModule,
1891
+ TCloudUiMultiSelectModule,
1892
+ TCloudUiDataListModule,
1893
+ TCloudUiMultiInputModule,
1894
+ // Directives
1895
+ TCloudUiDirectiveModule,
1896
+ // Pipes
1897
+ TCloudUiPipesModule], exports: [TCloudUiModalModule,
883
1898
  TCloudUiTabMenuModule,
884
1899
  TCloudUiLinhaLogoModule,
885
- TCloudUiLineStepCircleModule] });
1900
+ TCloudUiLineStepCircleModule,
1901
+ TCloudUiMultiSelectModule,
1902
+ TCloudUiDataListModule,
1903
+ TCloudUiMultiInputModule,
1904
+ // Directives
1905
+ TCloudUiDirectiveModule,
1906
+ // Pipes
1907
+ TCloudUiPipesModule] });
886
1908
  TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, imports: [TCloudUiModalModule,
887
1909
  TCloudUiTabMenuModule,
888
1910
  TCloudUiLinhaLogoModule,
889
- TCloudUiLineStepCircleModule, TCloudUiModalModule,
1911
+ TCloudUiLineStepCircleModule,
1912
+ TCloudUiMultiSelectModule,
1913
+ TCloudUiDataListModule,
1914
+ TCloudUiMultiInputModule,
1915
+ // Directives
1916
+ TCloudUiDirectiveModule,
1917
+ // Pipes
1918
+ TCloudUiPipesModule, TCloudUiModalModule,
890
1919
  TCloudUiTabMenuModule,
891
1920
  TCloudUiLinhaLogoModule,
892
- TCloudUiLineStepCircleModule] });
1921
+ TCloudUiLineStepCircleModule,
1922
+ TCloudUiMultiSelectModule,
1923
+ TCloudUiDataListModule,
1924
+ TCloudUiMultiInputModule,
1925
+ // Directives
1926
+ TCloudUiDirectiveModule,
1927
+ // Pipes
1928
+ TCloudUiPipesModule] });
893
1929
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, decorators: [{
894
1930
  type: NgModule,
895
1931
  args: [{
@@ -897,13 +1933,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
897
1933
  TCloudUiModalModule,
898
1934
  TCloudUiTabMenuModule,
899
1935
  TCloudUiLinhaLogoModule,
900
- TCloudUiLineStepCircleModule
1936
+ TCloudUiLineStepCircleModule,
1937
+ TCloudUiMultiSelectModule,
1938
+ TCloudUiDataListModule,
1939
+ TCloudUiMultiInputModule,
1940
+ // Directives
1941
+ TCloudUiDirectiveModule,
1942
+ // Pipes
1943
+ TCloudUiPipesModule
901
1944
  ],
902
1945
  exports: [
903
1946
  TCloudUiModalModule,
904
1947
  TCloudUiTabMenuModule,
905
1948
  TCloudUiLinhaLogoModule,
906
- TCloudUiLineStepCircleModule
1949
+ TCloudUiLineStepCircleModule,
1950
+ TCloudUiMultiSelectModule,
1951
+ TCloudUiDataListModule,
1952
+ TCloudUiMultiInputModule,
1953
+ // Directives
1954
+ TCloudUiDirectiveModule,
1955
+ // Pipes
1956
+ TCloudUiPipesModule
907
1957
  ]
908
1958
  }]
909
1959
  }] });
@@ -916,5 +1966,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
916
1966
  * Generated bundle index. Do not edit.
917
1967
  */
918
1968
 
919
- export { TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent };
1969
+ export { CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCloudUiDataListComponent, TCloudUiDataListModule, TCloudUiDataListOptionComponent, TCloudUiDirectiveModule, TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiInputModule, TCloudUiMultiSelectComponent, TCloudUiMultiSelectModule, TCloudUiPipesModule, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTooltipDirective };
920
1970
  //# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map