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/fesm2015/sf-crud.js
CHANGED
|
@@ -360,7 +360,7 @@ class ControlComponent {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
ControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ControlComponent, deps: [{ token: GeneralService }], target: i0.ɵɵFactoryTarget.Component });
|
|
363
|
-
ControlComponent.ɵcmp = i0.ɵɵ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, 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$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$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$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$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$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.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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9$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.InputText, selector: "[pInputText]" }, { type: i9$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
363
|
+
ControlComponent.ɵcmp = i0.ɵɵ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, 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$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$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$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$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$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.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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9$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.InputText, selector: "[pInputText]" }, { type: i9$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
364
364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ControlComponent, decorators: [{
|
|
365
365
|
type: Component,
|
|
366
366
|
args: [{
|
|
@@ -395,7 +395,7 @@ class RegistroChildComponent {
|
|
|
395
395
|
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
396
396
|
if (!this.data) {
|
|
397
397
|
this.data = this.createObject(this.esquema);
|
|
398
|
-
|
|
398
|
+
jsonpath.value(this.data, '$..id', this.config.data.id);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
getControl(scope) {
|
|
@@ -413,6 +413,7 @@ class RegistroChildComponent {
|
|
|
413
413
|
jsonpath.value(this.data, scope.replace('.properties', ''), value);
|
|
414
414
|
break;
|
|
415
415
|
}
|
|
416
|
+
this.applyValuesOnEvent('onChange', this.esquema);
|
|
416
417
|
}
|
|
417
418
|
createObject(esquema) {
|
|
418
419
|
let object = {};
|
|
@@ -472,6 +473,7 @@ class RegistroChildComponent {
|
|
|
472
473
|
return data;
|
|
473
474
|
}
|
|
474
475
|
submit() {
|
|
476
|
+
this.applyValuesOnEvent('onSubmit', this.esquema);
|
|
475
477
|
if (!this.validateData())
|
|
476
478
|
return;
|
|
477
479
|
this.ref.close(this.data);
|
|
@@ -494,6 +496,35 @@ class RegistroChildComponent {
|
|
|
494
496
|
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
495
497
|
return err.length == 0;
|
|
496
498
|
}
|
|
499
|
+
applyValuesOnEvent(event, esquema) {
|
|
500
|
+
for (const key in esquema.properties) {
|
|
501
|
+
if (esquema.properties[key][event]) {
|
|
502
|
+
esquema.properties[key][event].forEach((value) => {
|
|
503
|
+
jsonpath.value(this.data, `$..${key}`, this.getValueEvent(this.data, value));
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
getValueEvent(data, params) {
|
|
509
|
+
let value;
|
|
510
|
+
switch (params.op) {
|
|
511
|
+
case 'sum':
|
|
512
|
+
value = jsonpath.query(data, (params === null || params === void 0 ? void 0 : params.scope) || '').reduce((acc, cur) => acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur, 0);
|
|
513
|
+
break;
|
|
514
|
+
case 'concat':
|
|
515
|
+
let array = [];
|
|
516
|
+
params.key.reduce((acc, cur) => {
|
|
517
|
+
console.log(jsonpath.query(this.data, cur)[0]);
|
|
518
|
+
array.push(jsonpath.query(this.data, cur)[0]);
|
|
519
|
+
}, []);
|
|
520
|
+
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
521
|
+
value = array.join((params === null || params === void 0 ? void 0 : params.separator) || ' ');
|
|
522
|
+
break;
|
|
523
|
+
default:
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
return value;
|
|
527
|
+
}
|
|
497
528
|
}
|
|
498
529
|
RegistroChildComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RegistroChildComponent, deps: [{ token: i1$1.DynamicDialogRef }, { token: i1$1.DynamicDialogConfig }, { token: i3$1.MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
499
530
|
RegistroChildComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroChildComponent, selector: "lib-registro-child", providers: [MessageService], ngImport: i0, template: "<p-toast></p-toast>\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\">\n <ng-container [ngSwitch]=\"element.type\">\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\n {{element?.label}}\n </div>\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\" #a>\n <ng-container [ngSwitch]=\"el.type\">\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\" \n (sendNotification)=\"sendNotification($event)\"></sf-control>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\n <ng-container [ngSwitch]=\"el.type\" #b>\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\" [appendTo]=\"b\"\n (sendNotification)=\"sendNotification($event)\"></sf-control>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Control'\" #c>\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\" [appendTo]=\"c\"></sf-control>\n </ng-container>\n </ng-container>\n</div>\n<div class=\"card-footer mt-2\">\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\n</div>", components: [{ type: i3$3.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }] });
|
|
@@ -588,6 +619,7 @@ class RegistroComponent {
|
|
|
588
619
|
jsonpath.value(this.data, scope.replace('.properties', ''), value);
|
|
589
620
|
break;
|
|
590
621
|
}
|
|
622
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
591
623
|
}
|
|
592
624
|
createObject(esquema) {
|
|
593
625
|
let object = {};
|
|
@@ -617,6 +649,7 @@ class RegistroComponent {
|
|
|
617
649
|
console.log(this.data);
|
|
618
650
|
if (!this.validateData())
|
|
619
651
|
return;
|
|
652
|
+
this.applyValuesOnEvent('onSubmit', this.crudConfig.esquema);
|
|
620
653
|
this.enProceso = true;
|
|
621
654
|
let endpoint = this.configOperation.endpoint;
|
|
622
655
|
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
@@ -647,7 +680,18 @@ class RegistroComponent {
|
|
|
647
680
|
if (!jsonpath.query(this.data, x.field)[0])
|
|
648
681
|
err.push(x.message);
|
|
649
682
|
});
|
|
650
|
-
(_b = this.configOperation.validations) === null || _b === void 0 ? void 0 : _b.operations.forEach()
|
|
683
|
+
(_b = this.configOperation.validations) === null || _b === void 0 ? void 0 : _b.operations.forEach((op) => {
|
|
684
|
+
switch (op.action) {
|
|
685
|
+
case 'sumArray':
|
|
686
|
+
let var1 = jsonpath.query(this.data, op.scope[0]).reduce((acc, cur) => acc += cur[op.key], 0);
|
|
687
|
+
let var2 = jsonpath.query(this.data, op.scope[1]).reduce((acc, cur) => acc += cur[op.key], 0);
|
|
688
|
+
if (var1 != var2)
|
|
689
|
+
err.push(op.message);
|
|
690
|
+
break;
|
|
691
|
+
default:
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
});
|
|
651
695
|
if (err.length != 0)
|
|
652
696
|
this.messageSerice.add({ severity: 'warn', detail: err.join('. ') });
|
|
653
697
|
return err.length == 0;
|
|
@@ -704,6 +748,7 @@ class RegistroComponent {
|
|
|
704
748
|
this.dialogRef.onClose.subscribe((data) => {
|
|
705
749
|
if (data)
|
|
706
750
|
this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
751
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
707
752
|
});
|
|
708
753
|
}
|
|
709
754
|
editRow(element, data) {
|
|
@@ -721,6 +766,7 @@ class RegistroComponent {
|
|
|
721
766
|
this.dialogRef.onClose.subscribe((data) => {
|
|
722
767
|
if (data)
|
|
723
768
|
this.data[element.scope.replace('$..properties.', '')][data.id - 1] = data;
|
|
769
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
724
770
|
});
|
|
725
771
|
}
|
|
726
772
|
deleteRow(element, index) {
|
|
@@ -730,6 +776,27 @@ class RegistroComponent {
|
|
|
730
776
|
el.id = index;
|
|
731
777
|
index++;
|
|
732
778
|
});
|
|
779
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
780
|
+
}
|
|
781
|
+
applyValuesOnEvent(event, esquema) {
|
|
782
|
+
for (const key in esquema.properties) {
|
|
783
|
+
if (esquema.properties[key][event]) {
|
|
784
|
+
esquema.properties[key][event].forEach((value) => {
|
|
785
|
+
jsonpath.value(this.data, `$..${key}`, this.getValueEvent(this.data, value));
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
getValueEvent(data, params) {
|
|
791
|
+
let value;
|
|
792
|
+
switch (params.op) {
|
|
793
|
+
case 'sum':
|
|
794
|
+
value = jsonpath.query(data, params.scope).reduce((acc, cur) => acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur, 0);
|
|
795
|
+
break;
|
|
796
|
+
default:
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
return value;
|
|
733
800
|
}
|
|
734
801
|
}
|
|
735
802
|
RegistroComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RegistroComponent, deps: [{ token: GeneralService }, { token: i2.Router }, { token: i3$1.MessageService }, { token: i1$1.DialogService }], target: i0.ɵɵFactoryTarget.Component });
|