sf-crud 12.0.1-beta21 → 12.0.1-beta22
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.
- package/bundles/sf-crud.umd.js +79 -3
- package/bundles/sf-crud.umd.js.map +1 -1
- package/esm2015/lib/components/control/control.component.js +2 -2
- package/esm2015/lib/components/registro/registro.component.js +38 -2
- package/esm2015/lib/components/registro-child/registro-child.component.js +33 -2
- package/fesm2015/sf-crud.js +70 -3
- package/fesm2015/sf-crud.js.map +1 -1
- package/lib/components/registro/registro.component.d.ts +6 -0
- package/lib/components/registro-child/registro-child.component.d.ts +7 -0
- package/package.json +1 -1
package/bundles/sf-crud.umd.js
CHANGED
|
@@ -711,7 +711,7 @@
|
|
|
711
711
|
return ControlComponent;
|
|
712
712
|
}());
|
|
713
713
|
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 });
|
|
714
|
-
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" }, ngImport: i0__namespace, template: "<!-- <p-blockUI [blocked]=\"isLoading\" [target]=\"cc\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI> -->\r\n\r\n<ng-container [ngSwitch]=\"control.type\">\r\n <label>{{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 </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\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')\">\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()\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [appendTo]=\"appendTo\"\r\n placeholder=\"Seleccione una opci\u00F3n\"></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\" [optionValue]=\"control.config.optionValue\"\r\n [appendTo]=\"appendTo\" placeholder=\"Seleccione una opci\u00F3n\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [showEmptyMessage]=\"true\" [suggestions]=\"dataFromService\" [appendTo]=\"appendTo\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event)\"></p-autoComplete>\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()\" [monthNavigator]=\"true\" [yearNavigator]=\"true\"\r\n yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\" [appendTo]=\"appendTo\"></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()\"\r\n [currency]=\"control?.currency || 'USD'\"></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\"></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\"></p-inputNumber>\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>", components: [{ type: i2__namespace$1.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$2.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.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"] }], directives: [{ type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__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: i10__namespace.InputText, selector: "[pInputText]" }, { type: i9__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
714
|
+
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" }, ngImport: i0__namespace, template: "<!-- <p-blockUI [blocked]=\"isLoading\" [target]=\"cc\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI> -->\r\n\r\n<ng-container [ngSwitch]=\"control.type\">\r\n <label>{{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=\"'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\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [appendTo]=\"appendTo\"\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\" [optionValue]=\"control.config.optionValue\"\r\n [appendTo]=\"appendTo\" 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]=\"appendTo\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event)\"\r\n [disabled]=\"control?.disabled || false\"></p-autoComplete>\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()\" [monthNavigator]=\"true\" [yearNavigator]=\"true\"\r\n yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\" [appendTo]=\"appendTo\"\r\n [disabled]=\"control?.disabled || 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()\"\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\"\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\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\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>", components: [{ type: i2__namespace$1.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$2.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.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"] }], directives: [{ type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__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: i10__namespace.InputText, selector: "[pInputText]" }, { type: i9__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
715
715
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
|
|
716
716
|
type: i0.Component,
|
|
717
717
|
args: [{
|
|
@@ -746,7 +746,7 @@
|
|
|
746
746
|
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
747
747
|
if (!this.data) {
|
|
748
748
|
this.data = this.createObject(this.esquema);
|
|
749
|
-
|
|
749
|
+
jsonpath__namespace.value(this.data, '$..id', this.config.data.id);
|
|
750
750
|
}
|
|
751
751
|
};
|
|
752
752
|
RegistroChildComponent.prototype.getControl = function (scope) {
|
|
@@ -765,6 +765,7 @@
|
|
|
765
765
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
766
766
|
break;
|
|
767
767
|
}
|
|
768
|
+
this.applyValuesOnEvent('onChange', this.esquema);
|
|
768
769
|
};
|
|
769
770
|
RegistroChildComponent.prototype.createObject = function (esquema) {
|
|
770
771
|
var object = {};
|
|
@@ -824,6 +825,7 @@
|
|
|
824
825
|
return data;
|
|
825
826
|
};
|
|
826
827
|
RegistroChildComponent.prototype.submit = function () {
|
|
828
|
+
this.applyValuesOnEvent('onSubmit', this.esquema);
|
|
827
829
|
if (!this.validateData())
|
|
828
830
|
return;
|
|
829
831
|
this.ref.close(this.data);
|
|
@@ -847,6 +849,40 @@
|
|
|
847
849
|
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
848
850
|
return err.length == 0;
|
|
849
851
|
};
|
|
852
|
+
RegistroChildComponent.prototype.applyValuesOnEvent = function (event, esquema) {
|
|
853
|
+
var _this = this;
|
|
854
|
+
var _loop_1 = function (key) {
|
|
855
|
+
if (esquema.properties[key][event]) {
|
|
856
|
+
esquema.properties[key][event].forEach(function (value) {
|
|
857
|
+
jsonpath__namespace.value(_this.data, "$.." + key, _this.getValueEvent(_this.data, value));
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
for (var key in esquema.properties) {
|
|
862
|
+
_loop_1(key);
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
RegistroChildComponent.prototype.getValueEvent = function (data, params) {
|
|
866
|
+
var _this = this;
|
|
867
|
+
var value;
|
|
868
|
+
switch (params.op) {
|
|
869
|
+
case 'sum':
|
|
870
|
+
value = jsonpath__namespace.query(data, (params === null || params === void 0 ? void 0 : params.scope) || '').reduce(function (acc, cur) { return acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur; }, 0);
|
|
871
|
+
break;
|
|
872
|
+
case 'concat':
|
|
873
|
+
var array_1 = [];
|
|
874
|
+
params.key.reduce(function (acc, cur) {
|
|
875
|
+
console.log(jsonpath__namespace.query(_this.data, cur)[0]);
|
|
876
|
+
array_1.push(jsonpath__namespace.query(_this.data, cur)[0]);
|
|
877
|
+
}, []);
|
|
878
|
+
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
879
|
+
value = array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' ');
|
|
880
|
+
break;
|
|
881
|
+
default:
|
|
882
|
+
break;
|
|
883
|
+
}
|
|
884
|
+
return value;
|
|
885
|
+
};
|
|
850
886
|
return RegistroChildComponent;
|
|
851
887
|
}());
|
|
852
888
|
RegistroChildComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, deps: [{ token: i1__namespace$1.DynamicDialogRef }, { token: i1__namespace$1.DynamicDialogConfig }, { token: i3__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
@@ -945,6 +981,7 @@
|
|
|
945
981
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
946
982
|
break;
|
|
947
983
|
}
|
|
984
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
948
985
|
};
|
|
949
986
|
RegistroComponent.prototype.createObject = function (esquema) {
|
|
950
987
|
var object = {};
|
|
@@ -975,6 +1012,7 @@
|
|
|
975
1012
|
console.log(this.data);
|
|
976
1013
|
if (!this.validateData())
|
|
977
1014
|
return;
|
|
1015
|
+
this.applyValuesOnEvent('onSubmit', this.crudConfig.esquema);
|
|
978
1016
|
this.enProceso = true;
|
|
979
1017
|
var endpoint = this.configOperation.endpoint;
|
|
980
1018
|
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
@@ -1006,7 +1044,18 @@
|
|
|
1006
1044
|
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
1007
1045
|
err.push(x.message);
|
|
1008
1046
|
});
|
|
1009
|
-
(_b = this.configOperation.validations) === null || _b === void 0 ? void 0 : _b.operations.forEach()
|
|
1047
|
+
(_b = this.configOperation.validations) === null || _b === void 0 ? void 0 : _b.operations.forEach(function (op) {
|
|
1048
|
+
switch (op.action) {
|
|
1049
|
+
case 'sumArray':
|
|
1050
|
+
var var1 = jsonpath__namespace.query(_this.data, op.scope[0]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1051
|
+
var var2 = jsonpath__namespace.query(_this.data, op.scope[1]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1052
|
+
if (var1 != var2)
|
|
1053
|
+
err.push(op.message);
|
|
1054
|
+
break;
|
|
1055
|
+
default:
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1010
1059
|
if (err.length != 0)
|
|
1011
1060
|
this.messageSerice.add({ severity: 'warn', detail: err.join('. ') });
|
|
1012
1061
|
return err.length == 0;
|
|
@@ -1064,6 +1113,7 @@
|
|
|
1064
1113
|
this.dialogRef.onClose.subscribe(function (data) {
|
|
1065
1114
|
if (data)
|
|
1066
1115
|
_this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
1116
|
+
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema);
|
|
1067
1117
|
});
|
|
1068
1118
|
};
|
|
1069
1119
|
RegistroComponent.prototype.editRow = function (element, data) {
|
|
@@ -1082,6 +1132,7 @@
|
|
|
1082
1132
|
this.dialogRef.onClose.subscribe(function (data) {
|
|
1083
1133
|
if (data)
|
|
1084
1134
|
_this.data[element.scope.replace('$..properties.', '')][data.id - 1] = data;
|
|
1135
|
+
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema);
|
|
1085
1136
|
});
|
|
1086
1137
|
};
|
|
1087
1138
|
RegistroComponent.prototype.deleteRow = function (element, index) {
|
|
@@ -1091,6 +1142,31 @@
|
|
|
1091
1142
|
el.id = index;
|
|
1092
1143
|
index++;
|
|
1093
1144
|
});
|
|
1145
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
1146
|
+
};
|
|
1147
|
+
RegistroComponent.prototype.applyValuesOnEvent = function (event, esquema) {
|
|
1148
|
+
var _this = this;
|
|
1149
|
+
var _loop_1 = function (key) {
|
|
1150
|
+
if (esquema.properties[key][event]) {
|
|
1151
|
+
esquema.properties[key][event].forEach(function (value) {
|
|
1152
|
+
jsonpath__namespace.value(_this.data, "$.." + key, _this.getValueEvent(_this.data, value));
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
for (var key in esquema.properties) {
|
|
1157
|
+
_loop_1(key);
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
RegistroComponent.prototype.getValueEvent = function (data, params) {
|
|
1161
|
+
var value;
|
|
1162
|
+
switch (params.op) {
|
|
1163
|
+
case 'sum':
|
|
1164
|
+
value = jsonpath__namespace.query(data, params.scope).reduce(function (acc, cur) { return acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur; }, 0);
|
|
1165
|
+
break;
|
|
1166
|
+
default:
|
|
1167
|
+
break;
|
|
1168
|
+
}
|
|
1169
|
+
return value;
|
|
1094
1170
|
};
|
|
1095
1171
|
return RegistroComponent;
|
|
1096
1172
|
}());
|