iptdevs-design-system 3.1.581 → 3.1.583

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.
@@ -7144,12 +7144,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
7144
7144
  }] } });
7145
7145
 
7146
7146
  class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7147
- constructor(fb, messageService, commercialService, baseService, calculateQuotesService) {
7147
+ constructor(fb, messageService, commercialService, baseService, codFormControls, calculateQuotesService) {
7148
7148
  super();
7149
7149
  this.fb = fb;
7150
7150
  this.messageService = messageService;
7151
7151
  this.commercialService = commercialService;
7152
7152
  this.baseService = baseService;
7153
+ this.codFormControls = codFormControls;
7153
7154
  this.calculateQuotesService = calculateQuotesService;
7154
7155
  this.completed = new EventEmitter();
7155
7156
  this.financingData = new EventEmitter();
@@ -7168,10 +7169,10 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7168
7169
  this.initForm();
7169
7170
  }
7170
7171
  initForm() {
7171
- const currentDate = new Date().toISOString().split('T')[0];
7172
+ // const currentDate = new Date().toISOString().split('T')[0];
7172
7173
  this.codSelfFormStepThree = this.fb.group({
7173
7174
  program_price: [{ value: '', disabled: true }, [Validators.required]],
7174
- payment_date: [currentDate, [Validators.required]],
7175
+ payment_date: [new Date(), [Validators.required]],
7175
7176
  payment_method: ['', [Validators.required]],
7176
7177
  quota_times: [{ value: '', disabled: true }, [Validators.required]],
7177
7178
  total_price: [{ value: '', disabled: true }, [Validators.required]],
@@ -7179,6 +7180,7 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7179
7180
  quota_price: ['', [Validators.required]],
7180
7181
  fee_number: ['', [Validators.required]],
7181
7182
  });
7183
+ this.listenPaymentMethodField();
7182
7184
  }
7183
7185
  ngOnInit() {
7184
7186
  this.startLocalStorageWork();
@@ -7186,9 +7188,49 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7186
7188
  }
7187
7189
  startLocalStorageWork() {
7188
7190
  this.controls.forEach(control => {
7189
- let localStorageValue = this.readAndWriteLS(2, control.name);
7191
+ let localStorageValue = this.readAndWriteLS(3, control.name);
7190
7192
  this.codSelfFormStepThree.controls[control.name].setValue(localStorageValue.value);
7191
- this.listenFormChanges(2, control.name, this.codSelfFormStepThree.controls[control.name].valueChanges);
7193
+ this.listenFormChanges(3, control.name, this.codSelfFormStepThree.controls[control.name].valueChanges);
7194
+ });
7195
+ }
7196
+ listenPaymentMethodField() {
7197
+ const control = this.codSelfFormStepThree.get('payment_method');
7198
+ control?.valueChanges.subscribe((change) => {
7199
+ // Financiado
7200
+ if (change === '1') {
7201
+ // Poner validaciones
7202
+ this.codSelfFormStepThree.controls['program_price'].setValidators([Validators.required]);
7203
+ this.codSelfFormStepThree.controls['payment_date'].setValidators([Validators.required]);
7204
+ this.codSelfFormStepThree.controls['quota_times'].setValidators([Validators.required]);
7205
+ this.codSelfFormStepThree.controls['total_price'].setValidators([Validators.required]);
7206
+ // Actualizar para que se tomen los cambios
7207
+ this.updateValueAndValidity();
7208
+ // Actualizar los controls globales
7209
+ this.updateGlobalControls(change);
7210
+ }
7211
+ // de contado
7212
+ if (change === '2') {
7213
+ // Quitar las validaciones
7214
+ this.codSelfFormStepThree.controls['program_price'].setValidators([Validators.required]);
7215
+ this.codSelfFormStepThree.controls['payment_date'].setValidators([Validators.required]);
7216
+ this.codSelfFormStepThree.controls['quota_times'].clearValidators();
7217
+ this.codSelfFormStepThree.controls['total_price'].setValidators([Validators.required]);
7218
+ // Actualizar para que se tomen los cambios
7219
+ this.updateValueAndValidity();
7220
+ // Actualizar los controls globales
7221
+ this.updateGlobalControls(change);
7222
+ }
7223
+ });
7224
+ }
7225
+ updateGlobalControls(change) {
7226
+ let controls = this.controls.filter(control => control.name !== 'payment_method');
7227
+ controls.forEach(control => {
7228
+ if (change === '1')
7229
+ this.codFormControls.changeValue(3, control.name, true);
7230
+ if (change === '2') {
7231
+ if (control.name === 'quota_times')
7232
+ this.codFormControls.changeValue(4, control.name, false);
7233
+ }
7192
7234
  });
7193
7235
  }
7194
7236
  onReject() {
@@ -7310,12 +7352,12 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7310
7352
  this.codSelfFormStepThree.controls['total_price'].updateValueAndValidity();
7311
7353
  }
7312
7354
  }
7313
- CodSelfFormStepThreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepThreeComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2$1.MessageService }, { token: CommercialService }, { token: BaseService }, { token: CalculateQuotesService }], target: i0.ɵɵFactoryTarget.Component });
7355
+ CodSelfFormStepThreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepThreeComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2$1.MessageService }, { token: CommercialService }, { token: BaseService }, { token: CodSelfManagedControls }, { token: CalculateQuotesService }], target: i0.ɵɵFactoryTarget.Component });
7314
7356
  CodSelfFormStepThreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodSelfFormStepThreeComponent, selector: "app-cod-self-form-step-three", outputs: { completed: "completed", financingData: "financingData" }, usesInheritance: true, ngImport: i0, template: "<div class=\"container-main\">\n <div class=\"container-form\">\n <h2>Pagos</h2>\n <p-toast position=\"top-center\" key=\"confirm\" (onClose)=\"onReject()\" [baseZIndex]=\"10\">\n <ng-template let-message pTemplate=\"message\">\n <div class=\"flex flex-column align-items-start\" style=\"flex: 1\">\n <div class=\"flex align-items-center gap-2\">\n <img src=\"https://qa.iptdev.com.co/assets/logos/reading.png\" style=\"width: 65px;\" shape=\"circle\" />\n <span class=\"font-bold text-900\">Jacob</span>\n </div>\n <div class=\"font-medium text-lg my-3 text-900\">{{ messageInfo }}</div>\n </div>\n </ng-template>\n </p-toast>\n <i class=\"pi pi-exclamation-circle cursor-pointer w-auto mb-4\" (click)=\"showConfirm()\" pTooltip=\"Mas info.\" tooltipPosition=\"bottom\"></i>\n\n <form autocomplete=\"off\" [formGroup]=\"codSelfFormStepThree\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codSelfFormStepThree.controls['payment_method'].value\"\n [control]=\"codSelfFormStepThree.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data.paid_level }} Nivel(es)</td>\n <td>{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codSelfFormStepThree.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codSelfFormStepThree.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <!-- <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codSelfFormStepThree.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div> -->\n\n <!-- Tabla de financiaci\u00F3n -->\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th>#</th>\n <th>Valor</th>\n <th>Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data[0] }}</td>\n <td>{{ data[1] }}</td>\n <td>{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n <!-- ---------------------- -->\n\n </form>\n </div>\n\n\n<div class=\"flex justify-content-between mt-3 align-items-center gap-3\">\n <!-- <span *ngIf=\"codSelfFormStepOne.invalid && codSelfFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span> -->\n <button\n pButton\n icon=\"pi pi-arrow-left\"\n type=\"submit\"\n (click)=\"back()\"\n ></button>\n\n <button\n pButton\n icon=\"pi pi-arrow-right\"\n (click)=\"sendForm()\"\n ></button>\n</div>\n</div>\n\n<div>\n <pre>{{ codSelfFormStepThree.value | json }}</pre>\n <div>\n <pre>{{ codSelfFormStepThree.valid | json }}</pre>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal", "disabledSel"], outputs: ["dateSelected"] }, { kind: "component", type: LoaderComponent, selector: "ipt-loader", inputs: ["message", "isDialog"] }, { kind: "component", type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "control"], outputs: ["eventSelect"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i7$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i7$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i13.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "pipe", type: i1.JsonPipe, name: "json" }] });
7315
7357
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepThreeComponent, decorators: [{
7316
7358
  type: Component,
7317
7359
  args: [{ selector: 'app-cod-self-form-step-three', template: "<div class=\"container-main\">\n <div class=\"container-form\">\n <h2>Pagos</h2>\n <p-toast position=\"top-center\" key=\"confirm\" (onClose)=\"onReject()\" [baseZIndex]=\"10\">\n <ng-template let-message pTemplate=\"message\">\n <div class=\"flex flex-column align-items-start\" style=\"flex: 1\">\n <div class=\"flex align-items-center gap-2\">\n <img src=\"https://qa.iptdev.com.co/assets/logos/reading.png\" style=\"width: 65px;\" shape=\"circle\" />\n <span class=\"font-bold text-900\">Jacob</span>\n </div>\n <div class=\"font-medium text-lg my-3 text-900\">{{ messageInfo }}</div>\n </div>\n </ng-template>\n </p-toast>\n <i class=\"pi pi-exclamation-circle cursor-pointer w-auto mb-4\" (click)=\"showConfirm()\" pTooltip=\"Mas info.\" tooltipPosition=\"bottom\"></i>\n\n <form autocomplete=\"off\" [formGroup]=\"codSelfFormStepThree\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codSelfFormStepThree.controls['payment_method'].value\"\n [control]=\"codSelfFormStepThree.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data.paid_level }} Nivel(es)</td>\n <td>{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codSelfFormStepThree.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codSelfFormStepThree.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <!-- <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codSelfFormStepThree.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div> -->\n\n <!-- Tabla de financiaci\u00F3n -->\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th>#</th>\n <th>Valor</th>\n <th>Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data[0] }}</td>\n <td>{{ data[1] }}</td>\n <td>{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n <!-- ---------------------- -->\n\n </form>\n </div>\n\n\n<div class=\"flex justify-content-between mt-3 align-items-center gap-3\">\n <!-- <span *ngIf=\"codSelfFormStepOne.invalid && codSelfFormStepOne.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span> -->\n <button\n pButton\n icon=\"pi pi-arrow-left\"\n type=\"submit\"\n (click)=\"back()\"\n ></button>\n\n <button\n pButton\n icon=\"pi pi-arrow-right\"\n (click)=\"sendForm()\"\n ></button>\n</div>\n</div>\n\n<div>\n <pre>{{ codSelfFormStepThree.value | json }}</pre>\n <div>\n <pre>{{ codSelfFormStepThree.valid | json }}</pre>\n </div>\n</div>\n" }]
7318
- }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i2$1.MessageService }, { type: CommercialService }, { type: BaseService }, { type: CalculateQuotesService }]; }, propDecorators: { completed: [{
7360
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i2$1.MessageService }, { type: CommercialService }, { type: BaseService }, { type: CodSelfManagedControls }, { type: CalculateQuotesService }]; }, propDecorators: { completed: [{
7319
7361
  type: Output
7320
7362
  }], financingData: [{
7321
7363
  type: Output