sf-crud 12.0.2 → 12.0.4

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.
@@ -851,7 +851,7 @@
851
851
  };
852
852
  ControlComponent.prototype.setDate = function () {
853
853
  var format = this.control.formatMoment;
854
- if (format && this.value) {
854
+ if (format && this.value && !(this.value instanceof Date)) {
855
855
  this.value = moment__namespace(this.value, format).toDate();
856
856
  this.sendValue();
857
857
  }
@@ -859,7 +859,7 @@
859
859
  return ControlComponent;
860
860
  }());
861
861
  ControlComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, deps: [{ token: GeneralService }], target: i0__namespace.ɵɵFactoryTarget.Component });
862
- ControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ControlComponent, selector: "sf-control", inputs: { control: "control", label: "label", value: "value", appendTo: "appendTo" }, outputs: { setValue: "setValue", sendNotification: "sendNotification", sendObject: "sendObject" }, ngImport: i0__namespace, template: "<ng-container [ngSwitch]=\"control.type\" #cc>\r\n <label [for]=\"label\" style=\"width: -webkit-fill-available;\">{{label}}</label>\r\n <ng-container *ngSwitchCase=\"'string'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'input'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\"\r\n [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'textarea'\">\r\n <textarea [rows]=\"control?.rows ? control.rows : 4\" \r\n [(ngModel)]=\"value\" (focusout)=\"sendValue()\" pInputTextarea \r\n [disabled]=\"control?.disabled || false\" [autoResize]=\"control?.autoresize || false\"></textarea>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\"\r\n [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'email'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" placeholder=\"email@example.com\"\r\n (focusout)=\"validateValue('email')\" [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <p-inputMask mask=\"(999) 999-9999\" [(ngModel)]=\"value\" placeholder=\"(999) 999-9999\"\r\n (focusout)=\"sendValue()\" [disabled]=\"control?.disabled || false\" [unmask]=\"control.unmask || false\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" appendTo=\"body\"\r\n placeholder=\"Seleccione una opci\u00F3n\" [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n [optionLabel]=\"control.config.optionLabel\"\r\n [optionValue]=\"control?.field || control.config.optionValue\" (onClick)=\"refresData()\"\r\n appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown:replace'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\"\r\n (onChange)=\"sendValueFromObject($event.value)\" [optionLabel]=\"control.config.optionLabel\"\r\n (onClick)=\"refresData()\" appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [showEmptyMessage]=\"true\" [suggestions]=\"dataFromService\" appendTo=\"body\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event.value)\" [(ngModel)]=\"tempValue\"\r\n [disabled]=\"control?.disabled || false\"></p-autoComplete>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'input:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"text\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'calendar'\">\r\n <p-calendar [(ngModel)]=\"value\" (onSelect)=\"sendValue()\" (onBlur)=\"sendValue()\" [monthNavigator]=\"true\"\r\n [yearNavigator]=\"true\" yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\"\r\n appendTo=\"body\" [disabled]=\"control?.disabled || false\" [showOnFocus]=\"!control?.hide\"\r\n [placeholder]=\"control?.placeholder || 'aaaa-mm-dd'\" [touchUI]=\"control?.touchUI || false\"\r\n [showIcon]=\"control?.showIcon || false\"></p-calendar>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'numeric'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"currency\" [minFractionDigits]=\"control?.minFractionDigits || 0\"\r\n [min]=\"control?.min || null\" [max]=\"control?.max || null\" (focusout)=\"sendValue()\" [locale]=\"control?.locale || undefined\"\r\n [currency]=\"control?.currency || 'USD'\" [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"decimal\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 0\" [locale]=\"control?.locale || undefined\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'percentage'\">\r\n <p-inputNumber [(ngModel)]=\"value\" suffix=\" %\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 2\" [locale]=\"control?.locale || undefined\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"number\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'file'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'filetmp'\">\r\n <p-fileUpload [accept]=\"control.config.accept\" [customUpload]=\"true\" (uploadHandler)=\"onUpload($event)\"\r\n [maxFileSize]=\"control.config?.maxFileSize || null\" fileLimit=\"1\">\r\n <ng-template pTemplate=\"content\">\r\n <ul *ngIf=\"uploadedFiles.length\">\r\n <li *ngFor=\"let file of uploadedFiles\">{{file.name}} - {{file.size}} bytes</li>\r\n </ul>\r\n </ng-template>\r\n </p-fileUpload>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'switch'\">\r\n <p-inputSwitch [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [id]=\"label\"></p-inputSwitch>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>", components: [{ type: i2__namespace$2.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }, { type: i3__namespace$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide"] }, { type: i4__namespace$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }, { type: i5__namespace$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "numberOfMonths", "view", "touchUI", "timeSeparator", "focusTrap", "firstDayOfWeek", "showTransitionOptions", "hideTransitionOptions", "tabindex", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6__namespace$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "step", "inputStyle", "inputStyleClass", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i7__namespace$1.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler"] }, { type: i8__namespace.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "ariaLabelledBy"], outputs: ["onChange"] }], directives: [{ type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i10__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.InputText, selector: "[pInputText]" }, { type: i10__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i12__namespace.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
862
+ ControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ControlComponent, selector: "sf-control", inputs: { control: "control", label: "label", value: "value", appendTo: "appendTo" }, outputs: { setValue: "setValue", sendNotification: "sendNotification", sendObject: "sendObject" }, ngImport: i0__namespace, template: "<ng-container [ngSwitch]=\"control.type\" #cc>\r\n <label [for]=\"label\" style=\"width: -webkit-fill-available;\">{{label}}</label>\r\n <ng-container *ngSwitchCase=\"'string'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'input'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\"\r\n [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'textarea'\">\r\n <textarea [rows]=\"control?.rows ? control.rows : 4\" \r\n [(ngModel)]=\"value\" (focusout)=\"sendValue()\" pInputTextarea \r\n [disabled]=\"control?.disabled || false\" [autoResize]=\"control?.autoresize || false\"></textarea>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\"\r\n [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'email'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" placeholder=\"email@example.com\"\r\n (focusout)=\"validateValue('email')\" [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <p-inputMask mask=\"(999) 999-9999\" [(ngModel)]=\"value\" placeholder=\"(999) 999-9999\"\r\n (focusout)=\"sendValue()\" [disabled]=\"control?.disabled || false\" [unmask]=\"control.unmask || false\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" appendTo=\"body\"\r\n placeholder=\"Seleccione una opci\u00F3n\" [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n [optionLabel]=\"control.config.optionLabel\"\r\n [optionValue]=\"control?.field || control.config.optionValue\" (onClick)=\"refresData()\"\r\n appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown:replace'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\"\r\n (onChange)=\"sendValueFromObject($event)\" [optionLabel]=\"control.config.optionLabel\"\r\n (onClick)=\"refresData()\" appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [showEmptyMessage]=\"true\" [suggestions]=\"dataFromService\" appendTo=\"body\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event)\" [(ngModel)]=\"tempValue\"\r\n [disabled]=\"control?.disabled || false\"></p-autoComplete>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'input:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"text\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'calendar'\">\r\n <p-calendar [(ngModel)]=\"value\" (onSelect)=\"sendValue()\" (onBlur)=\"sendValue()\" [monthNavigator]=\"true\"\r\n [yearNavigator]=\"true\" yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\"\r\n appendTo=\"body\" [disabled]=\"control?.disabled || false\" [showOnFocus]=\"!control?.hide\"\r\n [placeholder]=\"control?.placeholder || 'aaaa-mm-dd'\" [touchUI]=\"control?.touchUI || false\"\r\n [showIcon]=\"control?.showIcon || false\"></p-calendar>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'numeric'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"currency\" [minFractionDigits]=\"control?.minFractionDigits || 0\"\r\n [min]=\"control?.min || null\" [max]=\"control?.max || null\" (focusout)=\"sendValue()\" [locale]=\"control?.locale || undefined\"\r\n [currency]=\"control?.currency || 'USD'\" [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"decimal\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 0\" [locale]=\"control?.locale || undefined\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'percentage'\">\r\n <p-inputNumber [(ngModel)]=\"value\" suffix=\" %\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 2\" [locale]=\"control?.locale || undefined\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"number\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'file'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'filetmp'\">\r\n <p-fileUpload [accept]=\"control.config.accept\" [customUpload]=\"true\" (uploadHandler)=\"onUpload($event)\"\r\n [maxFileSize]=\"control.config?.maxFileSize || null\" fileLimit=\"1\">\r\n <ng-template pTemplate=\"content\">\r\n <ul *ngIf=\"uploadedFiles.length\">\r\n <li *ngFor=\"let file of uploadedFiles\">{{file.name}} - {{file.size}} bytes</li>\r\n </ul>\r\n </ng-template>\r\n </p-fileUpload>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'switch'\">\r\n <p-inputSwitch [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [id]=\"label\"></p-inputSwitch>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>", components: [{ type: i2__namespace$2.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }, { type: i3__namespace$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide"] }, { type: i4__namespace$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }, { type: i5__namespace$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "numberOfMonths", "view", "touchUI", "timeSeparator", "focusTrap", "firstDayOfWeek", "showTransitionOptions", "hideTransitionOptions", "tabindex", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6__namespace$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "step", "inputStyle", "inputStyleClass", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i7__namespace$1.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler"] }, { type: i8__namespace.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "ariaLabelledBy"], outputs: ["onChange"] }], directives: [{ type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i10__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11__namespace.InputText, selector: "[pInputText]" }, { type: i10__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i12__namespace.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
863
863
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
864
864
  type: i0.Component,
865
865
  args: [{
@@ -1137,10 +1137,11 @@
1137
1137
  var _a;
1138
1138
  _this.controls.push([]);
1139
1139
  _this.values.push([]);
1140
- (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
1140
+ (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, j) {
1141
1141
  if (!element.scope)
1142
1142
  console.log("CONFIGURAR BIEN " + element);
1143
1143
  _this.controls[i].push(_this.getControl(element.scope));
1144
+ _this.controls[i][j].scope = element.scope;
1144
1145
  _this.values[i].push(_this.getValue(element.scope));
1145
1146
  });
1146
1147
  });
@@ -1157,9 +1158,14 @@
1157
1158
  switch (typeof (value)) {
1158
1159
  case 'object':
1159
1160
  if (Array.isArray(value))
1160
- value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
1161
- else
1161
+ value.forEach(function (val) {
1162
+ _this.setValueByScope(val.scope, val.value);
1163
+ jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value);
1164
+ });
1165
+ else {
1166
+ this.values[i][j] = value;
1162
1167
  jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
1168
+ }
1163
1169
  break;
1164
1170
  default:
1165
1171
  this.values[i][j] = value;
@@ -1391,12 +1397,30 @@
1391
1397
  });
1392
1398
  this.applyValuesOnEvent('onChange', this.esquema, element.scope.replace('$..properties.', ''));
1393
1399
  };
1394
- RegistroChildComponent.prototype.applyValuesFromObject = function (event) {
1400
+ RegistroChildComponent.prototype.setValueByScope = function (scope, newVal) {
1395
1401
  var _this = this;
1396
- if (event.data)
1397
- event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), _this.aplyFormatValue(value.scope, event.data[value.key])); });
1398
- else
1399
- event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), null); });
1402
+ var _loop_1 = function (i) {
1403
+ var row = this_1.controls[i];
1404
+ row.forEach(function (el, j) {
1405
+ if (el.scope && el.scope.replace('.properties', '') == scope.replace('.properties', '')) {
1406
+ _this.values[i][j] = newVal;
1407
+ }
1408
+ });
1409
+ };
1410
+ var this_1 = this;
1411
+ for (var i = 0; i < this.controls.length; i++) {
1412
+ _loop_1(i);
1413
+ }
1414
+ };
1415
+ RegistroChildComponent.prototype.applyValuesFromObject = function (event) {
1416
+ if (event.optionValue) {
1417
+ for (var i = 0; i < event.optionValue.length; i++) {
1418
+ var optionVal = event.optionValue[i];
1419
+ var newVal = event.data ? this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]) : null;
1420
+ jsonpath__namespace.value(this.data, optionVal.scope.replace('.properties', ''), this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]));
1421
+ this.setValueByScope(optionVal.scope, newVal);
1422
+ }
1423
+ }
1400
1424
  };
1401
1425
  RegistroChildComponent.prototype.aplyFormatValue = function (scope, value) {
1402
1426
  var control = jsonpath__namespace.query(this.esquema, scope)[0];
@@ -1509,10 +1533,9 @@
1509
1533
  var _a;
1510
1534
  _this.controls.push([]);
1511
1535
  _this.values.push([]);
1512
- (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
1513
- if (!element.scope)
1514
- console.log("CONFIGURAR BIEN " + element);
1536
+ (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, j) {
1515
1537
  _this.controls[i].push(_this.getControl(element.scope));
1538
+ _this.controls[i][j].scope = element.scope;
1516
1539
  _this.values[i].push(_this.getValue(element.scope));
1517
1540
  });
1518
1541
  });
@@ -1573,9 +1596,14 @@
1573
1596
  switch (typeof (value)) {
1574
1597
  case 'object':
1575
1598
  if (Array.isArray(value))
1576
- value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
1577
- else
1599
+ value.forEach(function (val) {
1600
+ _this.setValueByScope(val.scope, val.value);
1601
+ jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value);
1602
+ });
1603
+ else {
1604
+ this.values[i][j] = value;
1578
1605
  jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
1606
+ }
1579
1607
  break;
1580
1608
  default:
1581
1609
  this.values[i][j] = value;
@@ -1733,7 +1761,7 @@
1733
1761
  header: element.label ? element.label : 'Detalle',
1734
1762
  width: '70%',
1735
1763
  modal: true,
1736
- closable: false,
1764
+ closable: true,
1737
1765
  data: {
1738
1766
  uiEsquema: Object.assign({}, element.elements),
1739
1767
  esquema: this.getControl(element.scope),
@@ -1752,7 +1780,7 @@
1752
1780
  header: element.label ? element.label : 'Detalle',
1753
1781
  width: '70%',
1754
1782
  modal: true,
1755
- closable: false,
1783
+ closable: true,
1756
1784
  data: {
1757
1785
  uiEsquema: Object.assign({}, element.elements),
1758
1786
  esquema: this.getControl(element.scope),
@@ -1842,11 +1870,29 @@
1842
1870
  });
1843
1871
  };
1844
1872
  RegistroComponent.prototype.applyValuesFromObject = function (event) {
1873
+ if (event.optionValue) {
1874
+ for (var i = 0; i < event.optionValue.length; i++) {
1875
+ var optionVal = event.optionValue[i];
1876
+ var newVal = event.data ? this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]) : null;
1877
+ jsonpath__namespace.value(this.data, optionVal.scope.replace('.properties', ''), this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]));
1878
+ this.setValueByScope(optionVal.scope, newVal);
1879
+ }
1880
+ }
1881
+ };
1882
+ RegistroComponent.prototype.setValueByScope = function (scope, newVal) {
1845
1883
  var _this = this;
1846
- if (event.data)
1847
- event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), _this.aplyFormatValue(value.scope, event.data[value.key])); });
1848
- else
1849
- event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), null); });
1884
+ var _loop_1 = function (i) {
1885
+ var row = this_1.controls[i];
1886
+ row.forEach(function (el, j) {
1887
+ if (el.scope && el.scope.replace('.properties', '') == scope.replace('.properties', '')) {
1888
+ _this.values[i][j] = newVal;
1889
+ }
1890
+ });
1891
+ };
1892
+ var this_1 = this;
1893
+ for (var i = 0; i < this.controls.length; i++) {
1894
+ _loop_1(i);
1895
+ }
1850
1896
  };
1851
1897
  RegistroComponent.prototype.aplyFormatValue = function (scope, value) {
1852
1898
  var control = jsonpath__namespace.query(this.crudConfig.esquema, scope)[0];