@dataclouder/ngx-core 0.1.32 → 0.1.34
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/fesm2022/dataclouder-ngx-core.mjs +892 -702
- package/fesm2022/dataclouder-ngx-core.mjs.map +1 -1
- package/index.d.ts +71 -5
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, Input, Component, inject, output, ChangeDetectionStrategy, HostListener, ChangeDetectorRef, Injectable, Pipe, signal, effect, ViewChild, Directive, InjectionToken, Optional, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import { FormBuilder, FormsModule, ReactiveFormsModule, FormGroup, FormArray } from '@angular/forms';
|
|
5
|
-
import * as
|
|
4
|
+
import { FormBuilder, FormsModule, ReactiveFormsModule, FormControl, ControlContainer, FormGroup, FormArray } from '@angular/forms';
|
|
5
|
+
import * as i2 from 'primeng/button';
|
|
6
6
|
import { ButtonModule } from 'primeng/button';
|
|
7
7
|
import * as i4 from 'primeng/dialog';
|
|
8
8
|
import { DialogModule } from 'primeng/dialog';
|
|
@@ -15,11 +15,11 @@ import { DatePickerModule } from 'primeng/datepicker';
|
|
|
15
15
|
import * as i3 from 'primeng/api';
|
|
16
16
|
import { MessageService, FilterMatchMode } from 'primeng/api';
|
|
17
17
|
import { DynamicDialogConfig, DynamicDialogRef, DialogService } from 'primeng/dynamicdialog';
|
|
18
|
-
import * as i2 from 'primeng/message';
|
|
18
|
+
import * as i2$1 from 'primeng/message';
|
|
19
19
|
import { MessageModule } from 'primeng/message';
|
|
20
20
|
import * as i3$1 from 'primeng/progressbar';
|
|
21
21
|
import { ProgressBarModule, ProgressBar } from 'primeng/progressbar';
|
|
22
|
-
import * as i2$
|
|
22
|
+
import * as i2$2 from 'primeng/toast';
|
|
23
23
|
import { ToastModule, Toast } from 'primeng/toast';
|
|
24
24
|
import { CardModule } from 'primeng/card';
|
|
25
25
|
import * as i4$1 from 'primeng/inputtext';
|
|
@@ -32,17 +32,23 @@ import { TableModule } from 'primeng/table';
|
|
|
32
32
|
import { get } from 'lodash';
|
|
33
33
|
import * as i5$1 from 'primeng/tag';
|
|
34
34
|
import { TagModule } from 'primeng/tag';
|
|
35
|
-
import * as i1$
|
|
35
|
+
import * as i1$2 from '@angular/common';
|
|
36
36
|
import { CommonModule } from '@angular/common';
|
|
37
|
-
import * as i1$
|
|
37
|
+
import * as i1$1 from 'primeng/fieldset';
|
|
38
38
|
import { FieldsetModule } from 'primeng/fieldset';
|
|
39
39
|
import * as i3$3 from 'primeng/chip';
|
|
40
40
|
import { ChipModule } from 'primeng/chip';
|
|
41
41
|
import { AvatarModule } from 'primeng/avatar';
|
|
42
|
+
import * as i2$3 from 'primeng/checkbox';
|
|
43
|
+
import { CheckboxModule } from 'primeng/checkbox';
|
|
44
|
+
import * as i4$2 from 'primeng/tooltip';
|
|
45
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
46
|
+
import * as i2$4 from 'primeng/inputnumber';
|
|
47
|
+
import { InputNumberModule } from 'primeng/inputnumber';
|
|
42
48
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
43
49
|
import { map } from 'rxjs/operators';
|
|
44
50
|
import { firstValueFrom, tap, catchError, lastValueFrom, throwError, map as map$1 } from 'rxjs';
|
|
45
|
-
import * as i4$
|
|
51
|
+
import * as i4$3 from 'primeng/textarea';
|
|
46
52
|
import { TextareaModule } from 'primeng/textarea';
|
|
47
53
|
import { HttpClient, HttpEventType } from '@angular/common/http';
|
|
48
54
|
|
|
@@ -169,7 +175,7 @@ class DCFilterBarComponent {
|
|
|
169
175
|
this.onFilterAction.emit(filterEvent);
|
|
170
176
|
}
|
|
171
177
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCFilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DCFilterBarComponent, isStandalone: true, selector: "dc-filter-bar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, customFilters: { classPropertyName: "customFilters", publicName: "customFilters", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onFilterAction: "onFilterAction", onChangeSort: "onChangeSort", onNew: "onNew" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"background-bar\">\n <div class=\"button-flex\">\n <p-button icon=\"pi pi-search\" label=\"buscar\" severity=\"secondary\" (click)=\"isSearchVisible = true\" />\n\n @if (options()?.showCreateButton) {\n <span class=\"admin\">\n <i style=\"position: absolute; right: -5px; top: -5px; z-index: 2; color: grey\" class=\"pi pi-key\"></i>\n <p-button icon=\"pi pi-plus\" label=\"Crear Nueva\" severity=\"secondary\" (click)=\"createNew()\" />\n </span>\n }\n </div>\n\n @if(options()?.showViewButton){\n <p-button icon=\"pi pi-objects-column\" variant=\"text\" (click)=\"doItemAction({ action: 'changeView', item: null })\" severity=\"secondary\"></p-button>\n } @if(options()?.showActions){ @for(item of items(); track $index) {\n <p-button [icon]=\"item.icon\" variant=\"text\" (click)=\"doItemAction({ action: item.title, item: item })\" severity=\"secondary\"></p-button>\n }\n\n <div class=\"button-flex\">\n <p-button icon=\"pi pi-filter\" label=\"Filtrar\" severity=\"secondary\" (click)=\"isFilterVisible = true\" />\n </div>\n }\n</div>\n\n@if (placeholder) {\n<span class=\"search-flex\" (click)=\"search(null)\"> <i class=\"pi pi-times\"></i>{{ placeholder }} </span>\n}\n\n<p-dialog [(visible)]=\"isSearchVisible\" [dismissableMask]=\"true\" [modal]=\"true\" [showHeader]=\"false\" (onHide)=\"isSearchVisible = false\">\n <p>Haz una b\u00FAsqueda (Enter)</p>\n <div>\n <span>\n <input (keydown.enter)=\"search(placeholder)\" type=\"text\" pInputText [(ngModel)]=\"placeholder\" />\n </span>\n </div>\n</p-dialog>\n\n<p-dialog [(visible)]=\"isFilterVisible\" [modal]=\"true\" [style]=\"{ width: '70vw', height: '70vh' }\" [header]=\"'Filtros'\">\n <div class=\"flex flex-column gap-4\">\n <!-- Sort Options -->\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">Ordenar por</label>\n <p-select [options]=\"sortOptions\" [(ngModel)]=\"selectedSort\" optionLabel=\"label\" [style]=\"{ width: '100%' }\" placeholder=\"Seleccionar orden\"> </p-select>\n </div>\n\n <p-multiselect\n [options]=\"availibleFilters\"\n [(ngModel)]=\"selectedFilters\"\n optionLabel=\"name\"\n placeholder=\"Filtros R\u00E1pidos\"\n [maxSelectedLabels]=\"3\"\n styleClass=\"w-full md:w-80\" />\n\n <!-- Date Filter -->\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">Rango de fechas</label>\n <p-datepicker\n [(ngModel)]=\"dateRange\"\n selectionMode=\"range\"\n [showButtonBar]=\"true\"\n [style]=\"{ width: '100%' }\"\n placeholder=\"Seleccionar fechas\"\n dateFormat=\"dd/mm/yy\">\n </p-datepicker>\n </div>\n\n @if (customFilters?.length > 0) {\n <form [formGroup]=\"customFiltersForm\">\n <h4>Filtros Personalizados</h4>\n @for (customFilter of customFilters; track customFilter.field) {\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">{{ customFilter.name }}</label>\n @switch (customFilter.type) { @case ('select') {\n <p-select\n [options]=\"customFilter.options\"\n [formControlName]=\"customFilter.field\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [style]=\"{ width: '100%' }\"\n placeholder=\"Seleccionar {{ customFilter.name }}\" />\n } @case ('string') {\n <input type=\"text\" pInputText [formControlName]=\"customFilter.field\" class=\"w-full\" />\n } @case ('date') {\n <p-datepicker [formControlName]=\"customFilter.field\" [style]=\"{ width: '100%' }\" dateFormat=\"dd/mm/yy\"></p-datepicker>\n } }\n </div>\n }\n </form>\n }\n\n <!-- Recent/All Toggle -->\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"flex justify-content-end gap-2\">\n <p-button label=\"Limpiar\" icon=\"pi pi-trash\" (click)=\"clearFilters()\" styleClass=\"p-button-text\"> </p-button>\n <p-button label=\"Aplicar\" icon=\"pi pi-check\" (click)=\"applyFilters()\" severity=\"primary\"> </p-button>\n </div>\n </ng-template>\n</p-dialog>\n", styles: [":host{display:block}.admin{margin-left:10px;position:relative}.background-bar{background-color:var(--p-primary-color);display:flex;border-radius:10px;justify-content:space-between;padding:10px}.button-flex{display:flex;margin-right:10px}.white{color:#fff}.search-flex{margin-left:10px}.search-dialog{width:750px;-webkit-backdrop-filter:blur(70px);backdrop-filter:blur(70px)}.border-none{border:none}.bg-black-alpha-50{background-color:var(--p-primary-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i5.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i6.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i7.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
178
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DCFilterBarComponent, isStandalone: true, selector: "dc-filter-bar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, customFilters: { classPropertyName: "customFilters", publicName: "customFilters", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onFilterAction: "onFilterAction", onChangeSort: "onChangeSort", onNew: "onNew" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"background-bar\">\n <div class=\"button-flex\">\n <p-button icon=\"pi pi-search\" label=\"buscar\" severity=\"secondary\" (click)=\"isSearchVisible = true\" />\n\n @if (options()?.showCreateButton) {\n <span class=\"admin\">\n <i style=\"position: absolute; right: -5px; top: -5px; z-index: 2; color: grey\" class=\"pi pi-key\"></i>\n <p-button icon=\"pi pi-plus\" label=\"Crear Nueva\" severity=\"secondary\" (click)=\"createNew()\" />\n </span>\n }\n </div>\n\n @if(options()?.showViewButton){\n <p-button icon=\"pi pi-objects-column\" variant=\"text\" (click)=\"doItemAction({ action: 'changeView', item: null })\" severity=\"secondary\"></p-button>\n } @if(options()?.showActions){ @for(item of items(); track $index) {\n <p-button [icon]=\"item.icon\" variant=\"text\" (click)=\"doItemAction({ action: item.title, item: item })\" severity=\"secondary\"></p-button>\n }\n\n <div class=\"button-flex\">\n <p-button icon=\"pi pi-filter\" label=\"Filtrar\" severity=\"secondary\" (click)=\"isFilterVisible = true\" />\n </div>\n }\n</div>\n\n@if (placeholder) {\n<span class=\"search-flex\" (click)=\"search(null)\"> <i class=\"pi pi-times\"></i>{{ placeholder }} </span>\n}\n\n<p-dialog [(visible)]=\"isSearchVisible\" [dismissableMask]=\"true\" [modal]=\"true\" [showHeader]=\"false\" (onHide)=\"isSearchVisible = false\">\n <p>Haz una b\u00FAsqueda (Enter)</p>\n <div>\n <span>\n <input (keydown.enter)=\"search(placeholder)\" type=\"text\" pInputText [(ngModel)]=\"placeholder\" />\n </span>\n </div>\n</p-dialog>\n\n<p-dialog [(visible)]=\"isFilterVisible\" [modal]=\"true\" [style]=\"{ width: '70vw', height: '70vh' }\" [header]=\"'Filtros'\">\n <div class=\"flex flex-column gap-4\">\n <!-- Sort Options -->\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">Ordenar por</label>\n <p-select [options]=\"sortOptions\" [(ngModel)]=\"selectedSort\" optionLabel=\"label\" [style]=\"{ width: '100%' }\" placeholder=\"Seleccionar orden\"> </p-select>\n </div>\n\n <p-multiselect\n [options]=\"availibleFilters\"\n [(ngModel)]=\"selectedFilters\"\n optionLabel=\"name\"\n placeholder=\"Filtros R\u00E1pidos\"\n [maxSelectedLabels]=\"3\"\n styleClass=\"w-full md:w-80\" />\n\n <!-- Date Filter -->\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">Rango de fechas</label>\n <p-datepicker\n [(ngModel)]=\"dateRange\"\n selectionMode=\"range\"\n [showButtonBar]=\"true\"\n [style]=\"{ width: '100%' }\"\n placeholder=\"Seleccionar fechas\"\n dateFormat=\"dd/mm/yy\">\n </p-datepicker>\n </div>\n\n @if (customFilters?.length > 0) {\n <form [formGroup]=\"customFiltersForm\">\n <h4>Filtros Personalizados</h4>\n @for (customFilter of customFilters; track customFilter.field) {\n <div class=\"field\">\n <label class=\"font-semibold block mb-2\">{{ customFilter.name }}</label>\n @switch (customFilter.type) { @case ('select') {\n <p-select\n [options]=\"customFilter.options\"\n [formControlName]=\"customFilter.field\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [style]=\"{ width: '100%' }\"\n placeholder=\"Seleccionar {{ customFilter.name }}\" />\n } @case ('string') {\n <input type=\"text\" pInputText [formControlName]=\"customFilter.field\" class=\"w-full\" />\n } @case ('date') {\n <p-datepicker [formControlName]=\"customFilter.field\" [style]=\"{ width: '100%' }\" dateFormat=\"dd/mm/yy\"></p-datepicker>\n } }\n </div>\n }\n </form>\n }\n\n <!-- Recent/All Toggle -->\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"flex justify-content-end gap-2\">\n <p-button label=\"Limpiar\" icon=\"pi pi-trash\" (click)=\"clearFilters()\" styleClass=\"p-button-text\"> </p-button>\n <p-button label=\"Aplicar\" icon=\"pi pi-check\" (click)=\"applyFilters()\" severity=\"primary\"> </p-button>\n </div>\n </ng-template>\n</p-dialog>\n", styles: [":host{display:block}.admin{margin-left:10px;position:relative}.background-bar{background-color:var(--p-primary-color);display:flex;border-radius:10px;justify-content:space-between;padding:10px}.button-flex{display:flex;margin-right:10px}.white{color:#fff}.search-flex{margin-left:10px}.search-dialog{width:750px;-webkit-backdrop-filter:blur(70px);backdrop-filter:blur(70px)}.border-none{border:none}.bg-black-alpha-50{background-color:var(--p-primary-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i5.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i6.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i7.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
173
179
|
}
|
|
174
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCFilterBarComponent, decorators: [{
|
|
175
181
|
type: Component,
|
|
@@ -207,7 +213,7 @@ class ConfirmComponent {
|
|
|
207
213
|
this.ref.close(true);
|
|
208
214
|
}
|
|
209
215
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
210
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ConfirmComponent, isStandalone: true, selector: "app-confirm", inputs: { title: "title", message: "message", warning: "warning", oneBotton: "oneBotton", acceptText: "acceptText", cancelText: "cancelText", piIcon: "piIcon" }, host: { listeners: { "window:keyup.enter": "onEnter($event)", "window:keyup.escape": "onEscapte($event)" } }, ngImport: i0, template: "<div class=\"form-input-card\">\n <p-message severity=\"secondary\"> {{ title }}</p-message>\n\n <div style=\"text-align: center; padding: 1rem\">\n <i style=\"font-size: 4rem; color: #ff0040\" class=\"pi {{ piIcon }}\"></i>\n </div>\n\n <div>{{ message }} </div>\n\n @if (warning) {\n <p-message severity=\"warn\">\n <i class=\"pi pi-exclamation-triangle\"></i>\n {{ warning }}</p-message\n >\n }\n\n <br /><br />\n\n <div>\n <div style=\"float: right\">\n @if (oneBotton) {\n <p-button label=\"Ok\" (click)=\"confirm()\"></p-button>\n }\n </div>\n\n @if (!oneBotton) {\n <div class=\"options\">\n <p-button [label]=\"cancelText\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText\" (click)=\"confirm()\" severity=\"danger\"></p-button>\n </div>\n }\n </div>\n </div>\n", styles: [".options{display:flex;justify-content:space-between}.subtext{color:#353535;font-size:small}nb-card{min-width:50vw;max-width:88vw;max-height:90vh}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type:
|
|
216
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ConfirmComponent, isStandalone: true, selector: "app-confirm", inputs: { title: "title", message: "message", warning: "warning", oneBotton: "oneBotton", acceptText: "acceptText", cancelText: "cancelText", piIcon: "piIcon" }, host: { listeners: { "window:keyup.enter": "onEnter($event)", "window:keyup.escape": "onEscapte($event)" } }, ngImport: i0, template: "<div class=\"form-input-card\">\n <p-message severity=\"secondary\"> {{ title }}</p-message>\n\n <div style=\"text-align: center; padding: 1rem\">\n <i style=\"font-size: 4rem; color: #ff0040\" class=\"pi {{ piIcon }}\"></i>\n </div>\n\n <div>{{ message }} </div>\n\n @if (warning) {\n <p-message severity=\"warn\">\n <i class=\"pi pi-exclamation-triangle\"></i>\n {{ warning }}</p-message\n >\n }\n\n <br /><br />\n\n <div>\n <div style=\"float: right\">\n @if (oneBotton) {\n <p-button label=\"Ok\" (click)=\"confirm()\"></p-button>\n }\n </div>\n\n @if (!oneBotton) {\n <div class=\"options\">\n <p-button [label]=\"cancelText\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText\" (click)=\"confirm()\" severity=\"danger\"></p-button>\n </div>\n }\n </div>\n </div>\n", styles: [".options{display:flex;justify-content:space-between}.subtext{color:#353535;font-size:small}nb-card{min-width:50vw;max-width:88vw;max-height:90vh}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }] }); }
|
|
211
217
|
}
|
|
212
218
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmComponent, decorators: [{
|
|
213
219
|
type: Component,
|
|
@@ -289,7 +295,7 @@ class DCProgressToastComponent {
|
|
|
289
295
|
this.processClosed.emit();
|
|
290
296
|
}
|
|
291
297
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCProgressToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
292
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DCProgressToastComponent, isStandalone: true, selector: "dc-progress-toast", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: false, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { processCompleted: "processCompleted", processClosed: "processClosed" }, providers: [MessageService], usesOnChanges: true, ngImport: i0, template: "<div class=\"card flex justify-center\">\n <p-toast position=\"top-center\" key=\"confirm\" (onClose)=\"onClose()\" [baseZIndex]=\"9000\">\n <ng-template let-message #headless let-closeFn=\"closeFn\">\n <section style=\"padding: 15px\">\n <div>\n <i class=\"pi pi-cloud-upload\"></i>\n <span>{{ message.summary }}</span>\n </div>\n <div>\n <p-progressbar [value]=\"progress()\" [showValue]=\"false\" [style]=\"{ height: '6px' }\" />\n\n <label style=\"color: beige\">{{ progress() }}% uploaded</label>\n </div>\n <div>\n <p-button label=\"Another Upload?\" (click)=\"closeFn($event)\" size=\"small\" />\n <p-button label=\"Cancel\" (click)=\"closeFn($event)\" size=\"small\" />\n </div>\n </section>\n </ng-template>\n </p-toast>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type:
|
|
298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DCProgressToastComponent, isStandalone: true, selector: "dc-progress-toast", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: false, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { processCompleted: "processCompleted", processClosed: "processClosed" }, providers: [MessageService], usesOnChanges: true, ngImport: i0, template: "<div class=\"card flex justify-center\">\n <p-toast position=\"top-center\" key=\"confirm\" (onClose)=\"onClose()\" [baseZIndex]=\"9000\">\n <ng-template let-message #headless let-closeFn=\"closeFn\">\n <section style=\"padding: 15px\">\n <div>\n <i class=\"pi pi-cloud-upload\"></i>\n <span>{{ message.summary }}</span>\n </div>\n <div>\n <p-progressbar [value]=\"progress()\" [showValue]=\"false\" [style]=\"{ height: '6px' }\" />\n\n <label style=\"color: beige\">{{ progress() }}% uploaded</label>\n </div>\n <div>\n <p-button label=\"Another Upload?\" (click)=\"closeFn($event)\" size=\"small\" />\n <p-button label=\"Cancel\" (click)=\"closeFn($event)\" size=\"small\" />\n </div>\n </section>\n </ng-template>\n </p-toast>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ToastModule }, { kind: "component", type: i2$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i3$1.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }] }); }
|
|
293
299
|
}
|
|
294
300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCProgressToastComponent, decorators: [{
|
|
295
301
|
type: Component,
|
|
@@ -618,7 +624,7 @@ class QuickTableComponent {
|
|
|
618
624
|
}
|
|
619
625
|
}
|
|
620
626
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: QuickTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
621
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: QuickTableComponent, isStandalone: true, selector: "app-quick-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["tableRef"], descendants: true }], ngImport: i0, template: "<p-table\n [tableStyle]=\"{ 'min-width': '20rem' }\"\n #tableRef\n [value]=\"_tableData()\"\n [columns]=\"_columns()\"\n [globalFilterFields]=\"globalFilterFields()\"\n [filters]=\"filters()\"\n (onFilter)=\"onFilterLocal($event)\">\n <ng-template pTemplate=\"caption\">\n <div class=\"flex justify-content-between align-items-center\">\n <h5 class=\"m-0\">Table Data</h5>\n <span class=\"p-input-icon-left\">\n <i class=\"pi pi-search\"></i>\n <input pInputText type=\"text\" (input)=\"onGlobalFilter($event)\" placeholder=\"Search keyword\" />\n </span>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n @for (column of columns; track column) {\n <th [pSortableColumn]=\"column.field\">{{ column.header }} <p-sortIcon [field]=\"column.field\"></p-sortIcon></th>\n }\n </tr>\n <tr>\n @for (column of columns; track column) { @if(column.type === 'tags') {\n <th>\n <p-multiselect\n [options]=\"filters()?.[column.field]?.['options']\"\n placeholder=\"Selecciona\"\n (onChange)=\"filterOutsideTable('tags', column.field, $event.value)\"\n [style]=\"{ minWidth: '14rem' }\"\n [panelStyle]=\"{ minWidth: '16rem' }\">\n <ng-template let-option #item>\n <div class=\"flex items-center gap-2\">\n <span>{{ option }}</span>\n </div>\n </ng-template>\n </p-multiselect>\n </th>\n\n } @else {\n <th>\n <p-columnFilter [type]=\"getFilterType(column)\" [field]=\"column.field\" placeholder=\"Search\" [showMenu]=\"false\"></p-columnFilter>\n </th>\n } }\n </tr>\n </ng-template>\n <!-- @if(tableData()){ -->\n <ng-template pTemplate=\"body\" let-item let-columns=\"columns\">\n <tr>\n @for (column of columns; track column) {\n <td>\n @if(column.type === 'image'){\n <div class=\"image-container\">\n <img [src]=\"item | getPath: column\" alt=\"Image\" class=\"image\" />\n </div>\n } @else if(column.type === 'tags') {\n <div class=\"tags-container\">\n @for (tag of item[column.field]; track tag) {\n <p-tag [rounded]=\"true\" [value]=\"tag\"></p-tag>\n }\n </div>\n } @else if(column.type === 'actions') {\n <div style=\"display: flex; gap: 2px\">\n @for (actionBtn of _actions(); track actionBtn) {\n <p-button (click)=\"selectItem(item, actionBtn)\" [icon]=\"actionBtn.icon\" [severity]=\"actionBtn['severity']\" />\n }\n </div>\n } @else {\n <span>{{ item | getPath: column}} </span>\n }\n </td>\n }\n </tr>\n </ng-template>\n <!-- } -->\n</p-table>\n", styles: [":host{display:block;height:100%;overflow:auto}.generic-list-container{display:flex;flex-direction:column;height:100%}.generic-list-content{margin-top:10px;flex:1;overflow-y:auto;padding-bottom:10px}.card-source{margin-bottom:10px;position:relative}.paginator-container{margin-top:auto;padding-top:10px}.image-container{width:50px;height:50px;border-radius:50%;overflow:hidden;display:flex;justify-content:center;align-items:center}.image-container img{width:100%;height:100%;object-fit:cover}\n"], dependencies: [{ kind: "ngmodule", type: CardModule }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type:
|
|
627
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: QuickTableComponent, isStandalone: true, selector: "app-quick-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["tableRef"], descendants: true }], ngImport: i0, template: "<p-table\n [tableStyle]=\"{ 'min-width': '20rem' }\"\n #tableRef\n [value]=\"_tableData()\"\n [columns]=\"_columns()\"\n [globalFilterFields]=\"globalFilterFields()\"\n [filters]=\"filters()\"\n (onFilter)=\"onFilterLocal($event)\">\n <ng-template pTemplate=\"caption\">\n <div class=\"flex justify-content-between align-items-center\">\n <h5 class=\"m-0\">Table Data</h5>\n <span class=\"p-input-icon-left\">\n <i class=\"pi pi-search\"></i>\n <input pInputText type=\"text\" (input)=\"onGlobalFilter($event)\" placeholder=\"Search keyword\" />\n </span>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n @for (column of columns; track column) {\n <th [pSortableColumn]=\"column.field\">{{ column.header }} <p-sortIcon [field]=\"column.field\"></p-sortIcon></th>\n }\n </tr>\n <tr>\n @for (column of columns; track column) { @if(column.type === 'tags') {\n <th>\n <p-multiselect\n [options]=\"filters()?.[column.field]?.['options']\"\n placeholder=\"Selecciona\"\n (onChange)=\"filterOutsideTable('tags', column.field, $event.value)\"\n [style]=\"{ minWidth: '14rem' }\"\n [panelStyle]=\"{ minWidth: '16rem' }\">\n <ng-template let-option #item>\n <div class=\"flex items-center gap-2\">\n <span>{{ option }}</span>\n </div>\n </ng-template>\n </p-multiselect>\n </th>\n\n } @else {\n <th>\n <p-columnFilter [type]=\"getFilterType(column)\" [field]=\"column.field\" placeholder=\"Search\" [showMenu]=\"false\"></p-columnFilter>\n </th>\n } }\n </tr>\n </ng-template>\n <!-- @if(tableData()){ -->\n <ng-template pTemplate=\"body\" let-item let-columns=\"columns\">\n <tr>\n @for (column of columns; track column) {\n <td>\n @if(column.type === 'image'){\n <div class=\"image-container\">\n <img [src]=\"item | getPath: column\" alt=\"Image\" class=\"image\" />\n </div>\n } @else if(column.type === 'tags') {\n <div class=\"tags-container\">\n @for (tag of item[column.field]; track tag) {\n <p-tag [rounded]=\"true\" [value]=\"tag\"></p-tag>\n }\n </div>\n } @else if(column.type === 'actions') {\n <div style=\"display: flex; gap: 2px\">\n @for (actionBtn of _actions(); track actionBtn) {\n <p-button (click)=\"selectItem(item, actionBtn)\" [icon]=\"actionBtn.icon\" [severity]=\"actionBtn['severity']\" />\n }\n </div>\n } @else {\n <span>{{ item | getPath: column}} </span>\n }\n </td>\n }\n </tr>\n </ng-template>\n <!-- } -->\n</p-table>\n", styles: [":host{display:block;height:100%;overflow:auto}.generic-list-container{display:flex;flex-direction:column;height:100%}.generic-list-content{margin-top:10px;flex:1;overflow-y:auto;padding-bottom:10px}.card-source{margin-bottom:10px;position:relative}.paginator-container{margin-top:auto;padding-top:10px}.image-container{width:50px;height:50px;border-radius:50%;overflow:hidden;display:flex;justify-content:center;align-items:center}.image-container img{width:100%;height:100%;object-fit:cover}\n"], dependencies: [{ kind: "ngmodule", type: CardModule }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SpeedDialModule }, { kind: "ngmodule", type: PaginatorModule }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i3$2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i3$2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i3$2.ColumnFilter, selector: "p-columnFilter, p-column-filter, p-columnfilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "filterOn", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i4$1.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i5$1.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i6.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "pipe", type: GetPathPipe, name: "getPath" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
622
628
|
}
|
|
623
629
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: QuickTableComponent, decorators: [{
|
|
624
630
|
type: Component,
|
|
@@ -691,7 +697,7 @@ class DcAuditableViewerComponent {
|
|
|
691
697
|
</div>
|
|
692
698
|
</p-fieldset>
|
|
693
699
|
}
|
|
694
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FieldsetModule }, { kind: "component", type: i1$
|
|
700
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FieldsetModule }, { kind: "component", type: i1$1.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i5$1.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: i3$3.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }] }); }
|
|
695
701
|
}
|
|
696
702
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAuditableViewerComponent, decorators: [{
|
|
697
703
|
type: Component,
|
|
@@ -754,7 +760,7 @@ class DcExtensionsViewerComponent {
|
|
|
754
760
|
this.data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
755
761
|
}
|
|
756
762
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcExtensionsViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
757
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcExtensionsViewerComponent, isStandalone: true, selector: "dc-extensions-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$
|
|
763
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcExtensionsViewerComponent, isStandalone: true, selector: "dc-extensions-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }] }); }
|
|
758
764
|
}
|
|
759
765
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcExtensionsViewerComponent, decorators: [{
|
|
760
766
|
type: Component,
|
|
@@ -771,7 +777,7 @@ class DcLearnableViewerComponent {
|
|
|
771
777
|
this.data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
772
778
|
}
|
|
773
779
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcLearnableViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
774
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcLearnableViewerComponent, isStandalone: true, selector: "dc-learnable-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$
|
|
780
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcLearnableViewerComponent, isStandalone: true, selector: "dc-learnable-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }] }); }
|
|
775
781
|
}
|
|
776
782
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcLearnableViewerComponent, decorators: [{
|
|
777
783
|
type: Component,
|
|
@@ -788,7 +794,7 @@ class DcManageableViewerComponent {
|
|
|
788
794
|
this.data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
789
795
|
}
|
|
790
796
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcManageableViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
791
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcManageableViewerComponent, isStandalone: true, selector: "dc-manageable-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$
|
|
797
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcManageableViewerComponent, isStandalone: true, selector: "dc-manageable-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }] }); }
|
|
792
798
|
}
|
|
793
799
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcManageableViewerComponent, decorators: [{
|
|
794
800
|
type: Component,
|
|
@@ -805,7 +811,7 @@ class DcReactionsViewerComponent {
|
|
|
805
811
|
this.data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
806
812
|
}
|
|
807
813
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcReactionsViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
808
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcReactionsViewerComponent, isStandalone: true, selector: "dc-reactions-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$
|
|
814
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcReactionsViewerComponent, isStandalone: true, selector: "dc-reactions-viewer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<pre>{{ data() | json }}</pre>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }] }); }
|
|
809
815
|
}
|
|
810
816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcReactionsViewerComponent, decorators: [{
|
|
811
817
|
type: Component,
|
|
@@ -817,6 +823,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
817
823
|
}]
|
|
818
824
|
}] });
|
|
819
825
|
|
|
826
|
+
class DcManageableFormComponent {
|
|
827
|
+
constructor() {
|
|
828
|
+
this.form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
829
|
+
this.statusOptions = [
|
|
830
|
+
{ label: '✍️ Borrador', value: 'draft' },
|
|
831
|
+
{ label: '📝 En Revisión', value: 'review' },
|
|
832
|
+
{ label: '👍 Publicado', value: 'published' },
|
|
833
|
+
{ label: '🗑️ Archivado', value: 'archived' },
|
|
834
|
+
];
|
|
835
|
+
}
|
|
836
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcManageableFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
837
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcManageableFormComponent, isStandalone: true, selector: "dc-manageable-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [formGroup]=\"form()\">\n <div style=\"display: flex; justify-content: space-between\">\n <div class=\"form-field checkbox\">\n <label>\n <p-checkbox [binary]=\"true\" formControlName=\"isPublic\" />\n Public <span pTooltip=\"Is this content visible to all users?\">\u2139\uFE0F</span>\n </label>\n </div>\n\n <div class=\"form-field\">\n <label for=\"status\">Status <span pTooltip=\"Status of the content\">\u2139\uFE0F</span></label>\n <p-select\n id=\"status\"\n [options]=\"statusOptions\"\n formControlName=\"status\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"'Select Status'\"></p-select>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i2$3.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i5.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo"] }] }); }
|
|
838
|
+
}
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcManageableFormComponent, decorators: [{
|
|
840
|
+
type: Component,
|
|
841
|
+
args: [{ selector: 'dc-manageable-form', standalone: true, imports: [ReactiveFormsModule, CardModule, CheckboxModule, SelectModule, TooltipModule], template: "<div [formGroup]=\"form()\">\n <div style=\"display: flex; justify-content: space-between\">\n <div class=\"form-field checkbox\">\n <label>\n <p-checkbox [binary]=\"true\" formControlName=\"isPublic\" />\n Public <span pTooltip=\"Is this content visible to all users?\">\u2139\uFE0F</span>\n </label>\n </div>\n\n <div class=\"form-field\">\n <label for=\"status\">Status <span pTooltip=\"Status of the content\">\u2139\uFE0F</span></label>\n <p-select\n id=\"status\"\n [options]=\"statusOptions\"\n formControlName=\"status\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"'Select Status'\"></p-select>\n </div>\n </div>\n</div>\n" }]
|
|
842
|
+
}] });
|
|
843
|
+
|
|
844
|
+
class DcTagsFormComponent {
|
|
845
|
+
constructor(parentContainer) {
|
|
846
|
+
this.parentContainer = parentContainer;
|
|
847
|
+
this.newTagControl = new FormControl('');
|
|
848
|
+
}
|
|
849
|
+
ngOnInit() {
|
|
850
|
+
this.form = this.parentContainer.control;
|
|
851
|
+
}
|
|
852
|
+
get arrayForm() {
|
|
853
|
+
return this.form.get('tags');
|
|
854
|
+
}
|
|
855
|
+
addTag() {
|
|
856
|
+
const newTag = this.newTagControl.value?.trim();
|
|
857
|
+
if (newTag) {
|
|
858
|
+
this.arrayForm.push(new FormControl(newTag));
|
|
859
|
+
this.newTagControl.reset();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
removeTag(index) {
|
|
863
|
+
this.arrayForm.removeAt(index);
|
|
864
|
+
}
|
|
865
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcTagsFormComponent, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
866
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DcTagsFormComponent, isStandalone: true, selector: "dc-tags-form", ngImport: i0, template: "<div [formGroup]=\"form\">\n <div formArrayName=\"tags\">\n <div class=\"flex flex-wrap gap-2\">\n @for (tagControl of arrayForm.controls; track tagControl; let i = $index) {\n <p-chip [label]=\"tagControl.value\" [removable]=\"true\" (onRemove)=\"removeTag(i)\"></p-chip>\n }\n </div>\n </div>\n</div>\n\n<div class=\"flex mt-2\">\n <input pInputText type=\"text\" [formControl]=\"newTagControl\" placeholder=\"New tag\" (keydown.enter)=\"addTag(); $event.preventDefault()\" />\n <p-button label=\"Add Tag\" icon=\"pi pi-plus\" (click)=\"addTag()\" [disabled]=\"!newTagControl.value\"></p-button>\n</div>\n", styles: [".tag-field{display:flex;align-items:center;margin-bottom:.5rem}.tag-field input{margin-right:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i4$1.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: i3$3.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }], viewProviders: [
|
|
867
|
+
{
|
|
868
|
+
provide: ControlContainer,
|
|
869
|
+
useFactory: () => inject(ControlContainer, { skipSelf: true }),
|
|
870
|
+
},
|
|
871
|
+
] }); }
|
|
872
|
+
}
|
|
873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcTagsFormComponent, decorators: [{
|
|
874
|
+
type: Component,
|
|
875
|
+
args: [{ selector: 'dc-tags-form', standalone: true, imports: [CommonModule, ReactiveFormsModule, ButtonModule, InputTextModule, ChipModule], viewProviders: [
|
|
876
|
+
{
|
|
877
|
+
provide: ControlContainer,
|
|
878
|
+
useFactory: () => inject(ControlContainer, { skipSelf: true }),
|
|
879
|
+
},
|
|
880
|
+
], template: "<div [formGroup]=\"form\">\n <div formArrayName=\"tags\">\n <div class=\"flex flex-wrap gap-2\">\n @for (tagControl of arrayForm.controls; track tagControl; let i = $index) {\n <p-chip [label]=\"tagControl.value\" [removable]=\"true\" (onRemove)=\"removeTag(i)\"></p-chip>\n }\n </div>\n </div>\n</div>\n\n<div class=\"flex mt-2\">\n <input pInputText type=\"text\" [formControl]=\"newTagControl\" placeholder=\"New tag\" (keydown.enter)=\"addTag(); $event.preventDefault()\" />\n <p-button label=\"Add Tag\" icon=\"pi pi-plus\" (click)=\"addTag()\" [disabled]=\"!newTagControl.value\"></p-button>\n</div>\n", styles: [".tag-field{display:flex;align-items:center;margin-bottom:.5rem}.tag-field input{margin-right:.5rem}\n"] }]
|
|
881
|
+
}], ctorParameters: () => [{ type: i1.ControlContainer }] });
|
|
882
|
+
|
|
883
|
+
class DcLearnableFormComponent {
|
|
884
|
+
constructor() {
|
|
885
|
+
this.form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
886
|
+
}
|
|
887
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcLearnableFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
888
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DcLearnableFormComponent, isStandalone: true, selector: "dc-learnable-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [formGroup]=\"form()\">\n <div class=\"form-grid\">\n <div class=\"row\">\n <div class=\"form-field\">\n <label for=\"level\">Level <span pTooltip=\"Difficulty level\">\u2139\uFE0F</span></label>\n <p-inputNumber id=\"level\" formControlName=\"level\" [min]=\"0\" [max]=\"10\"></p-inputNumber>\n </div>\n <div class=\"form-field\">\n <label for=\"takenCount\">Taken Count <span pTooltip=\"How many times this has been taken\">\u2139\uFE0F</span></label>\n <p-inputNumber id=\"takenCount\" formControlName=\"takenCount\" [min]=\"0\"></p-inputNumber>\n </div>\n </div>\n <div class=\"form-field\">\n <label for=\"tags\">Tags <span pTooltip=\"Relevant tags for this content\">\u2139\uFE0F</span></label>\n <dc-tags-form />\n </div>\n </div>\n</div>\n", styles: [".form-grid{display:grid;gap:1rem}.row{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.form-field{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i2$4.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo"] }, { kind: "component", type: DcTagsFormComponent, selector: "dc-tags-form" }] }); }
|
|
889
|
+
}
|
|
890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcLearnableFormComponent, decorators: [{
|
|
891
|
+
type: Component,
|
|
892
|
+
args: [{ selector: 'dc-learnable-form', standalone: true, imports: [ReactiveFormsModule, CardModule, InputNumberModule, TooltipModule, DcTagsFormComponent], template: "<div [formGroup]=\"form()\">\n <div class=\"form-grid\">\n <div class=\"row\">\n <div class=\"form-field\">\n <label for=\"level\">Level <span pTooltip=\"Difficulty level\">\u2139\uFE0F</span></label>\n <p-inputNumber id=\"level\" formControlName=\"level\" [min]=\"0\" [max]=\"10\"></p-inputNumber>\n </div>\n <div class=\"form-field\">\n <label for=\"takenCount\">Taken Count <span pTooltip=\"How many times this has been taken\">\u2139\uFE0F</span></label>\n <p-inputNumber id=\"takenCount\" formControlName=\"takenCount\" [min]=\"0\"></p-inputNumber>\n </div>\n </div>\n <div class=\"form-field\">\n <label for=\"tags\">Tags <span pTooltip=\"Relevant tags for this content\">\u2139\uFE0F</span></label>\n <dc-tags-form />\n </div>\n </div>\n</div>\n", styles: [".form-grid{display:grid;gap:1rem}.row{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.form-field{display:flex;flex-direction:column}\n"] }]
|
|
893
|
+
}] });
|
|
894
|
+
|
|
820
895
|
/**
|
|
821
896
|
* Abstract base class for implementing pagination functionality.
|
|
822
897
|
* Provides common pagination logic, state management, and navigation handling.
|
|
@@ -1035,6 +1110,10 @@ class IAIModel {
|
|
|
1035
1110
|
class ChatUserSettings {
|
|
1036
1111
|
}
|
|
1037
1112
|
|
|
1113
|
+
// Como funciona esta clase y beneficos de extender
|
|
1114
|
+
// el objeto principal ahora se llama entity
|
|
1115
|
+
// sabe buscar el objeto directamente desde el id en un efecto en esta clase.
|
|
1116
|
+
// Es tu deber implementar el patch, como se crear el form cuando se tiene el objeto.
|
|
1038
1117
|
class EntityBaseFormComponent {
|
|
1039
1118
|
constructor() {
|
|
1040
1119
|
this.route = inject(ActivatedRoute);
|
|
@@ -1210,668 +1289,6 @@ function formatCamelCaseString(input) {
|
|
|
1210
1289
|
// * Extensionable: Ability to add extra features to the entity
|
|
1211
1290
|
// * ❗️ PENDING IMediable: this add media songs and videos and more only thinking for lessons or content interactions.
|
|
1212
1291
|
|
|
1213
|
-
class ConfirmService {
|
|
1214
|
-
constructor() {
|
|
1215
|
-
this.pdialogService = inject(DialogService);
|
|
1216
|
-
}
|
|
1217
|
-
openConfirm(title = '', message = '', acceptText = 'Aceptar') {
|
|
1218
|
-
const dialogRef = this.pdialogService.open(ConfirmComponent, {
|
|
1219
|
-
data: {
|
|
1220
|
-
message: message,
|
|
1221
|
-
title: title,
|
|
1222
|
-
acceptText,
|
|
1223
|
-
},
|
|
1224
|
-
closable: true,
|
|
1225
|
-
modal: true,
|
|
1226
|
-
});
|
|
1227
|
-
return dialogRef.onClose;
|
|
1228
|
-
}
|
|
1229
|
-
confirm(options) {
|
|
1230
|
-
const dialogRef = this.pdialogService.open(ConfirmComponent, {
|
|
1231
|
-
data: {
|
|
1232
|
-
message: options.message || '',
|
|
1233
|
-
title: options.title || 'Confirmación',
|
|
1234
|
-
acceptText: options.acceptText || 'Aceptar',
|
|
1235
|
-
cancelText: options.cancelText || 'Cancelar',
|
|
1236
|
-
warning: options.warning || null,
|
|
1237
|
-
oneBotton: options.oneBotton || false,
|
|
1238
|
-
piIcon: options.piIcon || null,
|
|
1239
|
-
},
|
|
1240
|
-
closable: true,
|
|
1241
|
-
modal: true,
|
|
1242
|
-
});
|
|
1243
|
-
return firstValueFrom(dialogRef.onClose);
|
|
1244
|
-
}
|
|
1245
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1246
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, providedIn: 'root' }); }
|
|
1247
|
-
}
|
|
1248
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, decorators: [{
|
|
1249
|
-
type: Injectable,
|
|
1250
|
-
args: [{
|
|
1251
|
-
providedIn: 'root',
|
|
1252
|
-
}]
|
|
1253
|
-
}], ctorParameters: () => [] });
|
|
1254
|
-
|
|
1255
|
-
class PromptComponent {
|
|
1256
|
-
constructor() {
|
|
1257
|
-
this.ref = inject(DynamicDialogRef);
|
|
1258
|
-
this.config = inject(DynamicDialogConfig);
|
|
1259
|
-
this.title = signal('Prompt', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1260
|
-
this.message = signal('', ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
1261
|
-
this.acceptText = signal('Accept', ...(ngDevMode ? [{ debugName: "acceptText" }] : []));
|
|
1262
|
-
this.cancelText = signal('Cancel', ...(ngDevMode ? [{ debugName: "cancelText" }] : []));
|
|
1263
|
-
this.inputValue = signal('', ...(ngDevMode ? [{ debugName: "inputValue" }] : []));
|
|
1264
|
-
}
|
|
1265
|
-
ngOnInit() {
|
|
1266
|
-
this.title.set(this.config.data?.title || 'Prompt');
|
|
1267
|
-
this.message.set(this.config.data?.message || '');
|
|
1268
|
-
this.acceptText.set(this.config.data?.acceptText || 'Accept');
|
|
1269
|
-
this.cancelText.set(this.config.data?.cancelText || 'Cancel');
|
|
1270
|
-
// Set initial value if provided
|
|
1271
|
-
this.inputValue.set(this.config.data?.initialValue || '');
|
|
1272
|
-
}
|
|
1273
|
-
accept() {
|
|
1274
|
-
this.ref.close(this.inputValue());
|
|
1275
|
-
}
|
|
1276
|
-
cancel() {
|
|
1277
|
-
this.ref.close(null);
|
|
1278
|
-
}
|
|
1279
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1280
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: PromptComponent, isStandalone: true, selector: "dc-prompt", ngImport: i0, template: "<div class=\"form-input-card p-4\">\n <p-message severity=\"secondary\"> {{ title() }}</p-message>\n\n <div class=\"my-4\">{{ message() }}</div>\n\n <div class=\"p-field mb-4\">\n <textarea rows=\"5\" cols=\"30\" pTextarea [(ngModel)]=\"inputValue\" class=\"w-full\"></textarea>\n </div>\n\n <div class=\"flex justify-content-end gap-2\">\n <p-button [label]=\"cancelText()\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText()\" (click)=\"accept()\"></p-button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i4$2.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }] }); }
|
|
1281
|
-
}
|
|
1282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptComponent, decorators: [{
|
|
1283
|
-
type: Component,
|
|
1284
|
-
args: [{ selector: 'dc-prompt', standalone: true, imports: [CommonModule, ButtonModule, InputTextModule, FormsModule, MessageModule, TextareaModule], template: "<div class=\"form-input-card p-4\">\n <p-message severity=\"secondary\"> {{ title() }}</p-message>\n\n <div class=\"my-4\">{{ message() }}</div>\n\n <div class=\"p-field mb-4\">\n <textarea rows=\"5\" cols=\"30\" pTextarea [(ngModel)]=\"inputValue\" class=\"w-full\"></textarea>\n </div>\n\n <div class=\"flex justify-content-end gap-2\">\n <p-button [label]=\"cancelText()\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText()\" (click)=\"accept()\"></p-button>\n </div>\n</div>\n" }]
|
|
1285
|
-
}] });
|
|
1286
|
-
|
|
1287
|
-
class PromptService {
|
|
1288
|
-
constructor() {
|
|
1289
|
-
this.dialogService = inject(DialogService);
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Opens a prompt dialog.
|
|
1293
|
-
* @param options Configuration options for the prompt dialog.
|
|
1294
|
-
* @returns A promise that resolves with the input value if accepted, or null if canceled.
|
|
1295
|
-
*/
|
|
1296
|
-
openPrompt(options) {
|
|
1297
|
-
const dialogRef = this.dialogService.open(PromptComponent, {
|
|
1298
|
-
data: {
|
|
1299
|
-
title: options.title || 'Prompt',
|
|
1300
|
-
message: options.message || '',
|
|
1301
|
-
acceptText: options.acceptText || 'Accept',
|
|
1302
|
-
cancelText: options.cancelText || 'Cancel',
|
|
1303
|
-
initialValue: options.initialValue || '', // Pass initialValue to component data
|
|
1304
|
-
},
|
|
1305
|
-
header: options.title || 'Prompt', // Set header for accessibility and title bar
|
|
1306
|
-
closable: true,
|
|
1307
|
-
modal: true,
|
|
1308
|
-
width: '700px', // Optional: Adjust width as needed
|
|
1309
|
-
});
|
|
1310
|
-
// Return the result when the dialog closes
|
|
1311
|
-
return firstValueFrom(dialogRef.onClose);
|
|
1312
|
-
}
|
|
1313
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1314
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, providedIn: 'root' }); }
|
|
1315
|
-
}
|
|
1316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, decorators: [{
|
|
1317
|
-
type: Injectable,
|
|
1318
|
-
args: [{
|
|
1319
|
-
providedIn: 'root',
|
|
1320
|
-
}]
|
|
1321
|
-
}] });
|
|
1322
|
-
|
|
1323
|
-
/**
|
|
1324
|
-
* Injection token for HttpCoreService configuration
|
|
1325
|
-
*/
|
|
1326
|
-
const HTTP_CORE_CONFIG = new InjectionToken('HTTP_CORE_CONFIG');
|
|
1327
|
-
/**
|
|
1328
|
-
* Modern HTTP service for Angular applications
|
|
1329
|
-
* Provides methods for making HTTP requests with proper error handling and response transformation
|
|
1330
|
-
*/
|
|
1331
|
-
class HttpCoreService {
|
|
1332
|
-
constructor(config) {
|
|
1333
|
-
this.httpClient = inject(HttpClient);
|
|
1334
|
-
// Use signals for reactive state
|
|
1335
|
-
this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
1336
|
-
this.lastError = signal(null, ...(ngDevMode ? [{ debugName: "lastError" }] : []));
|
|
1337
|
-
if (config && config.primaryUrl) {
|
|
1338
|
-
this.config = {
|
|
1339
|
-
defaultHost: 'primary',
|
|
1340
|
-
...config,
|
|
1341
|
-
};
|
|
1342
|
-
}
|
|
1343
|
-
else {
|
|
1344
|
-
// Initialize with a placeholder - this will be set properly with setConfig
|
|
1345
|
-
this.config = {
|
|
1346
|
-
primaryUrl: '',
|
|
1347
|
-
defaultHost: 'primary',
|
|
1348
|
-
};
|
|
1349
|
-
if (!config) {
|
|
1350
|
-
console.warn('HttpCoreService: No configuration provided. Use setConfig to configure the service.');
|
|
1351
|
-
}
|
|
1352
|
-
else if (!config.primaryUrl) {
|
|
1353
|
-
console.warn('HttpCoreService: primaryUrl is required in configuration. Use setConfig to set it.');
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
/**
|
|
1358
|
-
* Set the configuration for the service
|
|
1359
|
-
* This allows for manual configuration when not using dependency injection
|
|
1360
|
-
*/
|
|
1361
|
-
setConfig(config) {
|
|
1362
|
-
this.config = {
|
|
1363
|
-
...this.config,
|
|
1364
|
-
...config,
|
|
1365
|
-
};
|
|
1366
|
-
}
|
|
1367
|
-
/**
|
|
1368
|
-
* Get the loading state as a signal
|
|
1369
|
-
*/
|
|
1370
|
-
loading() {
|
|
1371
|
-
return this.isLoading;
|
|
1372
|
-
}
|
|
1373
|
-
/**
|
|
1374
|
-
* Get the last error as a signal
|
|
1375
|
-
*/
|
|
1376
|
-
error() {
|
|
1377
|
-
return this.lastError;
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Make a POST request to the specified service
|
|
1381
|
-
* @param service The service endpoint
|
|
1382
|
-
* @param data The data to send
|
|
1383
|
-
* @param host The host to use (primary or secondary)
|
|
1384
|
-
* @returns A promise with the response
|
|
1385
|
-
*/
|
|
1386
|
-
async post(service, data, host = this.config.defaultHost) {
|
|
1387
|
-
this.isLoading.set(true);
|
|
1388
|
-
try {
|
|
1389
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1390
|
-
const dataPlain = this.toPlainObject(data);
|
|
1391
|
-
const response$ = this.httpClient.post(url, dataPlain).pipe(tap(this.checkResponseStatus.bind(this)), catchError(this.handleRequestError.bind(this)));
|
|
1392
|
-
const result = await lastValueFrom(response$);
|
|
1393
|
-
this.isLoading.set(false);
|
|
1394
|
-
return result;
|
|
1395
|
-
}
|
|
1396
|
-
catch (error) {
|
|
1397
|
-
this.isLoading.set(false);
|
|
1398
|
-
throw error;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* Make a POST request to a specific URL
|
|
1403
|
-
* @param baseUrl The base URL
|
|
1404
|
-
* @param service The service endpoint
|
|
1405
|
-
* @param data The data to send
|
|
1406
|
-
* @returns A promise with the response
|
|
1407
|
-
*/
|
|
1408
|
-
async postToUrl(baseUrl, service, data) {
|
|
1409
|
-
this.isLoading.set(true);
|
|
1410
|
-
try {
|
|
1411
|
-
const url = `${baseUrl}/${service}`;
|
|
1412
|
-
const dataPlain = this.toPlainObject(data);
|
|
1413
|
-
const response$ = this.httpClient.post(url, dataPlain).pipe(tap(this.checkResponseStatus.bind(this)), catchError(this.handleRequestError.bind(this)));
|
|
1414
|
-
const result = await lastValueFrom(response$);
|
|
1415
|
-
this.isLoading.set(false);
|
|
1416
|
-
return result;
|
|
1417
|
-
}
|
|
1418
|
-
catch (error) {
|
|
1419
|
-
this.isLoading.set(false);
|
|
1420
|
-
throw error;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
/**
|
|
1424
|
-
* Make a PUT request to the specified service
|
|
1425
|
-
* @param service The service endpoint
|
|
1426
|
-
* @param data The data to send
|
|
1427
|
-
* @param host The host to use (primary or secondary)
|
|
1428
|
-
* @returns A promise with the response
|
|
1429
|
-
*/
|
|
1430
|
-
async put(service, data, host = this.config.defaultHost) {
|
|
1431
|
-
this.isLoading.set(true);
|
|
1432
|
-
try {
|
|
1433
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1434
|
-
const dataPlain = this.toPlainObject(data);
|
|
1435
|
-
const response$ = this.httpClient.put(url, dataPlain).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1436
|
-
const result = await lastValueFrom(response$);
|
|
1437
|
-
this.isLoading.set(false);
|
|
1438
|
-
return result;
|
|
1439
|
-
}
|
|
1440
|
-
catch (error) {
|
|
1441
|
-
this.isLoading.set(false);
|
|
1442
|
-
throw error;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
/**
|
|
1446
|
-
* Make a PUT request to a specific URL
|
|
1447
|
-
* @param baseUrl The base URL
|
|
1448
|
-
* @param service The service endpoint
|
|
1449
|
-
* @param data The data to send
|
|
1450
|
-
* @returns A promise with the response
|
|
1451
|
-
*/
|
|
1452
|
-
async putToUrl(baseUrl, service, data) {
|
|
1453
|
-
this.isLoading.set(true);
|
|
1454
|
-
try {
|
|
1455
|
-
const url = `${baseUrl}/${service}`;
|
|
1456
|
-
const dataPlain = this.toPlainObject(data);
|
|
1457
|
-
const response$ = this.httpClient.put(url, dataPlain).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1458
|
-
const result = await lastValueFrom(response$);
|
|
1459
|
-
this.isLoading.set(false);
|
|
1460
|
-
return result;
|
|
1461
|
-
}
|
|
1462
|
-
catch (error) {
|
|
1463
|
-
this.isLoading.set(false);
|
|
1464
|
-
throw error;
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
/**
|
|
1468
|
-
* Make a GET request to the specified service
|
|
1469
|
-
* @param service The service endpoint
|
|
1470
|
-
* @param host The host to use (primary or secondary)
|
|
1471
|
-
* @param skipErrorHandling Whether to skip error handling
|
|
1472
|
-
* @returns A promise with the response
|
|
1473
|
-
*/
|
|
1474
|
-
async get(service, host = this.config.defaultHost, skipErrorHandling = false) {
|
|
1475
|
-
this.isLoading.set(true);
|
|
1476
|
-
try {
|
|
1477
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1478
|
-
const response$ = this.httpClient.get(url).pipe(catchError((err) => {
|
|
1479
|
-
if (!skipErrorHandling) {
|
|
1480
|
-
return this.handleRequestError(err);
|
|
1481
|
-
}
|
|
1482
|
-
return throwError(() => err);
|
|
1483
|
-
}));
|
|
1484
|
-
const result = await lastValueFrom(response$);
|
|
1485
|
-
this.isLoading.set(false);
|
|
1486
|
-
return result;
|
|
1487
|
-
}
|
|
1488
|
-
catch (error) {
|
|
1489
|
-
this.isLoading.set(false);
|
|
1490
|
-
throw error;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
/**
|
|
1494
|
-
* Make a GET request to a specific URL
|
|
1495
|
-
* @param baseUrl The base URL
|
|
1496
|
-
* @param service The service endpoint
|
|
1497
|
-
* @param skipErrorHandling Whether to skip error handling
|
|
1498
|
-
* @returns A promise with the response
|
|
1499
|
-
*/
|
|
1500
|
-
async getFromUrl(baseUrl, service, skipErrorHandling = false) {
|
|
1501
|
-
this.isLoading.set(true);
|
|
1502
|
-
try {
|
|
1503
|
-
const url = `${baseUrl}/${service}`;
|
|
1504
|
-
const response$ = this.httpClient.get(url).pipe(catchError((err) => {
|
|
1505
|
-
if (!skipErrorHandling) {
|
|
1506
|
-
return this.handleRequestError(err);
|
|
1507
|
-
}
|
|
1508
|
-
return throwError(() => err);
|
|
1509
|
-
}));
|
|
1510
|
-
const result = await lastValueFrom(response$);
|
|
1511
|
-
this.isLoading.set(false);
|
|
1512
|
-
return result;
|
|
1513
|
-
}
|
|
1514
|
-
catch (error) {
|
|
1515
|
-
this.isLoading.set(false);
|
|
1516
|
-
throw error;
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
/**
|
|
1520
|
-
* Make a DELETE request to the specified service
|
|
1521
|
-
* @param service The service endpoint
|
|
1522
|
-
* @param host The host to use (primary or secondary)
|
|
1523
|
-
* @returns A promise with the response
|
|
1524
|
-
*/
|
|
1525
|
-
async delete(service, host = this.config.defaultHost) {
|
|
1526
|
-
this.isLoading.set(true);
|
|
1527
|
-
try {
|
|
1528
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1529
|
-
const response$ = this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1530
|
-
const result = await lastValueFrom(response$);
|
|
1531
|
-
this.isLoading.set(false);
|
|
1532
|
-
return result;
|
|
1533
|
-
}
|
|
1534
|
-
catch (error) {
|
|
1535
|
-
this.isLoading.set(false);
|
|
1536
|
-
throw error;
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
/**
|
|
1540
|
-
* Make a DELETE request to a specific URL
|
|
1541
|
-
* @param baseUrl The base URL
|
|
1542
|
-
* @param service The service endpoint
|
|
1543
|
-
* @returns A promise with the response
|
|
1544
|
-
*/
|
|
1545
|
-
async deleteFromUrl(baseUrl, service) {
|
|
1546
|
-
this.isLoading.set(true);
|
|
1547
|
-
try {
|
|
1548
|
-
const url = `${baseUrl}/${service}`;
|
|
1549
|
-
const response$ = this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1550
|
-
const result = await lastValueFrom(response$);
|
|
1551
|
-
this.isLoading.set(false);
|
|
1552
|
-
return result;
|
|
1553
|
-
}
|
|
1554
|
-
catch (error) {
|
|
1555
|
-
this.isLoading.set(false);
|
|
1556
|
-
throw error;
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
/**
|
|
1560
|
-
* Get an observable for a GET request
|
|
1561
|
-
* @param service The service endpoint
|
|
1562
|
-
* @param host The host to use (primary or secondary)
|
|
1563
|
-
* @returns An observable with the response
|
|
1564
|
-
*/
|
|
1565
|
-
getObservable(service, host = this.config.defaultHost) {
|
|
1566
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1567
|
-
return this.httpClient.get(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* Get an observable for a POST request
|
|
1571
|
-
* @param service The service endpoint
|
|
1572
|
-
* @param data The data to send
|
|
1573
|
-
* @param skipErrorHandling Whether to skip error handling
|
|
1574
|
-
* @param host The host to use (primary or secondary)
|
|
1575
|
-
* @returns An observable with the response
|
|
1576
|
-
*/
|
|
1577
|
-
postObservable(service, data, skipErrorHandling = false, host = this.config.defaultHost) {
|
|
1578
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1579
|
-
const dataPlain = this.toPlainObject(data);
|
|
1580
|
-
return this.httpClient.post(url, dataPlain).pipe(catchError((err) => {
|
|
1581
|
-
if (!skipErrorHandling) {
|
|
1582
|
-
return this.handleRequestError(err);
|
|
1583
|
-
}
|
|
1584
|
-
return throwError(() => err);
|
|
1585
|
-
}));
|
|
1586
|
-
}
|
|
1587
|
-
/**
|
|
1588
|
-
* Get an observable for a DELETE request
|
|
1589
|
-
* @param service The service endpoint
|
|
1590
|
-
* @param host The host to use (primary or secondary)
|
|
1591
|
-
* @returns An observable with the response
|
|
1592
|
-
*/
|
|
1593
|
-
deleteObservable(service, host = this.config.defaultHost) {
|
|
1594
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1595
|
-
return this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
1596
|
-
}
|
|
1597
|
-
/**
|
|
1598
|
-
* Upload a file to the specified service
|
|
1599
|
-
* @param service The service endpoint
|
|
1600
|
-
* @param file The file to upload
|
|
1601
|
-
* @param metadata Optional metadata to send with the file
|
|
1602
|
-
* @param host The host to use (primary or secondary)
|
|
1603
|
-
* @returns A promise with the response
|
|
1604
|
-
*/
|
|
1605
|
-
async uploadFile(service, file, metadata = null, host = this.config.defaultHost) {
|
|
1606
|
-
this.isLoading.set(true);
|
|
1607
|
-
try {
|
|
1608
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1609
|
-
const formData = new FormData();
|
|
1610
|
-
formData.append('file', file);
|
|
1611
|
-
let headers = {};
|
|
1612
|
-
if (metadata) {
|
|
1613
|
-
headers = { metadata: JSON.stringify(metadata) };
|
|
1614
|
-
}
|
|
1615
|
-
const response$ = this.httpClient.post(url, formData, { headers });
|
|
1616
|
-
const result = await lastValueFrom(response$);
|
|
1617
|
-
this.isLoading.set(false);
|
|
1618
|
-
return result;
|
|
1619
|
-
}
|
|
1620
|
-
catch (error) {
|
|
1621
|
-
this.isLoading.set(false);
|
|
1622
|
-
throw error;
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
/**
|
|
1626
|
-
* Download a file from the specified service
|
|
1627
|
-
* @param service The service endpoint
|
|
1628
|
-
* @param host The host to use (primary or secondary)
|
|
1629
|
-
* @returns A promise with the response
|
|
1630
|
-
*/
|
|
1631
|
-
async downloadFile(service, host = this.config.defaultHost) {
|
|
1632
|
-
this.isLoading.set(true);
|
|
1633
|
-
try {
|
|
1634
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1635
|
-
const response$ = this.httpClient
|
|
1636
|
-
.get(url, {
|
|
1637
|
-
responseType: 'blob',
|
|
1638
|
-
observe: 'response',
|
|
1639
|
-
})
|
|
1640
|
-
.pipe(catchError(this.handleBlobError.bind(this)));
|
|
1641
|
-
const result = await lastValueFrom(response$);
|
|
1642
|
-
this.isLoading.set(false);
|
|
1643
|
-
return result;
|
|
1644
|
-
}
|
|
1645
|
-
catch (error) {
|
|
1646
|
-
this.isLoading.set(false);
|
|
1647
|
-
throw error;
|
|
1648
|
-
}
|
|
1649
|
-
}
|
|
1650
|
-
/**
|
|
1651
|
-
* Upload a file to the specified service and get the response as a blob
|
|
1652
|
-
* @param service The service endpoint
|
|
1653
|
-
* @param data The data to send
|
|
1654
|
-
* @param host The host to use (primary or secondary)
|
|
1655
|
-
* @returns A promise with the response
|
|
1656
|
-
*/
|
|
1657
|
-
async postFileAndGetBlob(service, data, host = this.config.defaultHost) {
|
|
1658
|
-
this.isLoading.set(true);
|
|
1659
|
-
try {
|
|
1660
|
-
let url = this.getHostUrl(host);
|
|
1661
|
-
if (service) {
|
|
1662
|
-
url += '/' + service;
|
|
1663
|
-
}
|
|
1664
|
-
const response$ = this.httpClient
|
|
1665
|
-
.post(url, data, {
|
|
1666
|
-
observe: 'response',
|
|
1667
|
-
responseType: 'blob',
|
|
1668
|
-
})
|
|
1669
|
-
.pipe(catchError(this.handleBlobError.bind(this)));
|
|
1670
|
-
const result = await lastValueFrom(response$);
|
|
1671
|
-
this.isLoading.set(false);
|
|
1672
|
-
return result;
|
|
1673
|
-
}
|
|
1674
|
-
catch (error) {
|
|
1675
|
-
this.isLoading.set(false);
|
|
1676
|
-
throw error;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
/**
|
|
1680
|
-
* Get a file from the specified service as an observable
|
|
1681
|
-
* @param service The service endpoint
|
|
1682
|
-
* @param host The host to use (primary or secondary)
|
|
1683
|
-
* @returns An observable with the response
|
|
1684
|
-
*/
|
|
1685
|
-
getFileObservable(service, host = this.config.defaultHost) {
|
|
1686
|
-
const url = this.getHostUrl(host) + '/' + service;
|
|
1687
|
-
return this.httpClient.get(url, { responseType: 'blob' });
|
|
1688
|
-
}
|
|
1689
|
-
/**
|
|
1690
|
-
* Get the URL for the specified host
|
|
1691
|
-
* @param host The host to use (primary or secondary)
|
|
1692
|
-
* @returns The URL for the specified host
|
|
1693
|
-
*/
|
|
1694
|
-
getHostUrl(host = this.config.defaultHost) {
|
|
1695
|
-
return host === 'secondary' && this.config.secondaryUrl ? this.config.secondaryUrl : this.config.primaryUrl;
|
|
1696
|
-
}
|
|
1697
|
-
/**
|
|
1698
|
-
* Handle an error from a request
|
|
1699
|
-
* @param error The error to handle
|
|
1700
|
-
* @returns An observable that throws the error
|
|
1701
|
-
*/
|
|
1702
|
-
handleRequestError(error) {
|
|
1703
|
-
this.isLoading.set(false);
|
|
1704
|
-
// Set the last error
|
|
1705
|
-
if (error.error && typeof error.error === 'object') {
|
|
1706
|
-
this.lastError.set({
|
|
1707
|
-
error_message: error.error.error_message || 'An error occurred',
|
|
1708
|
-
explanation: error.error.explanation || 'Please try again later',
|
|
1709
|
-
status: error.status,
|
|
1710
|
-
code: error.error.code,
|
|
1711
|
-
});
|
|
1712
|
-
}
|
|
1713
|
-
else {
|
|
1714
|
-
this.lastError.set({
|
|
1715
|
-
error_message: error.message || 'An error occurred',
|
|
1716
|
-
explanation: 'Please try again later',
|
|
1717
|
-
status: error.status,
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
// Call the custom error handler if provided
|
|
1721
|
-
if (this.config.errorHandler) {
|
|
1722
|
-
this.config.errorHandler(error);
|
|
1723
|
-
}
|
|
1724
|
-
return throwError(() => error);
|
|
1725
|
-
}
|
|
1726
|
-
/**
|
|
1727
|
-
* Handle an error from a blob request
|
|
1728
|
-
* @param error The error to handle
|
|
1729
|
-
* @returns An observable that throws the error
|
|
1730
|
-
*/
|
|
1731
|
-
async handleBlobError(error) {
|
|
1732
|
-
// Convert blob error response to JSON if possible
|
|
1733
|
-
if (error.error instanceof Blob) {
|
|
1734
|
-
try {
|
|
1735
|
-
const errorText = await error.error.text();
|
|
1736
|
-
error.error = JSON.parse(errorText);
|
|
1737
|
-
}
|
|
1738
|
-
catch (e) {
|
|
1739
|
-
// If parsing fails, create a generic error
|
|
1740
|
-
error.error = {
|
|
1741
|
-
error_message: 'Error processing file',
|
|
1742
|
-
explanation: 'Unable to process server response',
|
|
1743
|
-
};
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
return this.handleRequestError(error);
|
|
1747
|
-
}
|
|
1748
|
-
/**
|
|
1749
|
-
* Check the status of a response
|
|
1750
|
-
* @param response The response to check
|
|
1751
|
-
*/
|
|
1752
|
-
checkResponseStatus(response) {
|
|
1753
|
-
// Implement any response status checking logic here
|
|
1754
|
-
// For example, check for specific status codes or error messages
|
|
1755
|
-
}
|
|
1756
|
-
/**
|
|
1757
|
-
* Convert an object to a plain object
|
|
1758
|
-
* @param obj The object to convert
|
|
1759
|
-
* @returns A plain object
|
|
1760
|
-
*/
|
|
1761
|
-
toPlainObject(obj) {
|
|
1762
|
-
if (!obj)
|
|
1763
|
-
return obj;
|
|
1764
|
-
// Handle simple types
|
|
1765
|
-
if (typeof obj !== 'object' || obj instanceof Blob || obj instanceof File) {
|
|
1766
|
-
return obj;
|
|
1767
|
-
}
|
|
1768
|
-
// Handle arrays
|
|
1769
|
-
if (Array.isArray(obj)) {
|
|
1770
|
-
return obj.map((item) => this.toPlainObject(item));
|
|
1771
|
-
}
|
|
1772
|
-
// Handle objects
|
|
1773
|
-
const result = {};
|
|
1774
|
-
for (const key in obj) {
|
|
1775
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1776
|
-
const value = obj[key];
|
|
1777
|
-
// Skip functions and undefined values
|
|
1778
|
-
if (typeof value === 'function' || value === undefined) {
|
|
1779
|
-
continue;
|
|
1780
|
-
}
|
|
1781
|
-
result[key] = this.toPlainObject(value);
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
return result;
|
|
1785
|
-
}
|
|
1786
|
-
postObservableWithProgress(service, data, host = 'primary') {
|
|
1787
|
-
const hostUrl = this.getHostUrl(host);
|
|
1788
|
-
const url = `${hostUrl}/${service}`;
|
|
1789
|
-
return this.httpClient
|
|
1790
|
-
.post(url, data, {
|
|
1791
|
-
reportProgress: true,
|
|
1792
|
-
observe: 'events',
|
|
1793
|
-
responseType: 'blob',
|
|
1794
|
-
})
|
|
1795
|
-
.pipe(map$1((event) => {
|
|
1796
|
-
let progress;
|
|
1797
|
-
let blob;
|
|
1798
|
-
switch (event.type) {
|
|
1799
|
-
case HttpEventType.DownloadProgress:
|
|
1800
|
-
if (event.total) {
|
|
1801
|
-
progress = Math.round((100 * event.loaded) / event.total);
|
|
1802
|
-
}
|
|
1803
|
-
break;
|
|
1804
|
-
case HttpEventType.Response:
|
|
1805
|
-
blob = event.body;
|
|
1806
|
-
break;
|
|
1807
|
-
}
|
|
1808
|
-
return { progress, blob };
|
|
1809
|
-
}), catchError((err) => {
|
|
1810
|
-
this.handleRequestError(err);
|
|
1811
|
-
return throwError(() => err);
|
|
1812
|
-
}));
|
|
1813
|
-
}
|
|
1814
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, deps: [{ token: HTTP_CORE_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1815
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, providedIn: 'root' }); }
|
|
1816
|
-
}
|
|
1817
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, decorators: [{
|
|
1818
|
-
type: Injectable,
|
|
1819
|
-
args: [{
|
|
1820
|
-
providedIn: 'root',
|
|
1821
|
-
}]
|
|
1822
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1823
|
-
type: Optional
|
|
1824
|
-
}, {
|
|
1825
|
-
type: Inject,
|
|
1826
|
-
args: [HTTP_CORE_CONFIG]
|
|
1827
|
-
}] }] });
|
|
1828
|
-
|
|
1829
|
-
class EntityCommunicationService {
|
|
1830
|
-
constructor(serviceName) {
|
|
1831
|
-
this.serviceName = serviceName;
|
|
1832
|
-
this.httpService = inject(HttpCoreService);
|
|
1833
|
-
}
|
|
1834
|
-
findAll() {
|
|
1835
|
-
return this.httpService.get(`api/${this.serviceName}`);
|
|
1836
|
-
}
|
|
1837
|
-
findOne(id) {
|
|
1838
|
-
return this.httpService.get(`api/${this.serviceName}/${id}`);
|
|
1839
|
-
}
|
|
1840
|
-
createOrUpdate(entity) {
|
|
1841
|
-
// if Id is present then in object, then Update all props in the object
|
|
1842
|
-
return this.httpService.post(`api/${this.serviceName}`, entity);
|
|
1843
|
-
}
|
|
1844
|
-
query(filterConfig) {
|
|
1845
|
-
return this.httpService.post(`api/${this.serviceName}/query`, filterConfig);
|
|
1846
|
-
}
|
|
1847
|
-
partialUpdate(id, partialUpdates) {
|
|
1848
|
-
// In backend object is flattened, so Convert nested objects to dot notation eg. { "video.captions.remotion": captions.captions }
|
|
1849
|
-
return this.httpService.put(`api/${this.serviceName}/${id}`, partialUpdates);
|
|
1850
|
-
}
|
|
1851
|
-
async remove(id) {
|
|
1852
|
-
await this.httpService.delete(`api/${this.serviceName}/${id}`);
|
|
1853
|
-
}
|
|
1854
|
-
clone(id, overrides = {}) {
|
|
1855
|
-
return this.httpService.post(`api/${this.serviceName}/${id}/clone`, overrides);
|
|
1856
|
-
}
|
|
1857
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1858
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService }); }
|
|
1859
|
-
}
|
|
1860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService, decorators: [{
|
|
1861
|
-
type: Injectable
|
|
1862
|
-
}], ctorParameters: () => [{ type: undefined }] });
|
|
1863
|
-
|
|
1864
|
-
class UiStateService {
|
|
1865
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1866
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, providedIn: 'root' }); }
|
|
1867
|
-
}
|
|
1868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, decorators: [{
|
|
1869
|
-
type: Injectable,
|
|
1870
|
-
args: [{
|
|
1871
|
-
providedIn: 'root',
|
|
1872
|
-
}]
|
|
1873
|
-
}] });
|
|
1874
|
-
|
|
1875
1292
|
const SUPPORTED_LANGUAGES = [
|
|
1876
1293
|
'en',
|
|
1877
1294
|
'es',
|
|
@@ -1953,7 +1370,7 @@ const LANGUAGES = {
|
|
|
1953
1370
|
en: 'Spanish',
|
|
1954
1371
|
es: 'Español',
|
|
1955
1372
|
},
|
|
1956
|
-
status: '
|
|
1373
|
+
status: 'ready',
|
|
1957
1374
|
speakers: 592000000,
|
|
1958
1375
|
},
|
|
1959
1376
|
de: {
|
|
@@ -1986,21 +1403,6 @@ const LANGUAGES = {
|
|
|
1986
1403
|
status: 'almostready',
|
|
1987
1404
|
speakers: 300000000,
|
|
1988
1405
|
},
|
|
1989
|
-
zh: {
|
|
1990
|
-
nativeName: '中文 (Zhōngwén)',
|
|
1991
|
-
flag: '🇨🇳',
|
|
1992
|
-
flagImg: 'assets/flags/cn.svg',
|
|
1993
|
-
code: 'zh',
|
|
1994
|
-
i: 5,
|
|
1995
|
-
llmKnowledge: 94,
|
|
1996
|
-
countries: ['China', 'Singapore', 'Taiwan.'],
|
|
1997
|
-
translations: {
|
|
1998
|
-
en: 'Chinese (Mandarin)',
|
|
1999
|
-
es: 'Chino (Mandarín)',
|
|
2000
|
-
},
|
|
2001
|
-
status: 'almostready',
|
|
2002
|
-
speakers: 1120000000,
|
|
2003
|
-
},
|
|
2004
1406
|
it: {
|
|
2005
1407
|
nativeName: 'Italiano',
|
|
2006
1408
|
flag: '🇮🇹',
|
|
@@ -2013,7 +1415,7 @@ const LANGUAGES = {
|
|
|
2013
1415
|
en: 'Italian',
|
|
2014
1416
|
es: 'Italiano',
|
|
2015
1417
|
},
|
|
2016
|
-
status: '
|
|
1418
|
+
status: 'ready',
|
|
2017
1419
|
speakers: 67000000,
|
|
2018
1420
|
},
|
|
2019
1421
|
pt: {
|
|
@@ -2060,6 +1462,23 @@ const LANGUAGES = {
|
|
|
2060
1462
|
},
|
|
2061
1463
|
status: 'commingsoon',
|
|
2062
1464
|
speakers: 25000000,
|
|
1465
|
+
releaseDate: '2025-09-08',
|
|
1466
|
+
},
|
|
1467
|
+
zh: {
|
|
1468
|
+
nativeName: '中文 (Zhōngwén)',
|
|
1469
|
+
flag: '🇨🇳',
|
|
1470
|
+
flagImg: 'assets/flags/cn.svg',
|
|
1471
|
+
code: 'zh',
|
|
1472
|
+
i: 5,
|
|
1473
|
+
llmKnowledge: 94,
|
|
1474
|
+
countries: ['China', 'Singapore', 'Taiwan.'],
|
|
1475
|
+
translations: {
|
|
1476
|
+
en: 'Chinese (Mandarin)',
|
|
1477
|
+
es: 'Chino (Mandarín)',
|
|
1478
|
+
},
|
|
1479
|
+
status: 'commingsoon',
|
|
1480
|
+
speakers: 1120000000,
|
|
1481
|
+
releaseDate: '2025-09-15',
|
|
2063
1482
|
},
|
|
2064
1483
|
ru: {
|
|
2065
1484
|
nativeName: 'Русский (Russkiy)',
|
|
@@ -2075,6 +1494,7 @@ const LANGUAGES = {
|
|
|
2075
1494
|
},
|
|
2076
1495
|
status: 'commingsoon',
|
|
2077
1496
|
speakers: 258000000,
|
|
1497
|
+
releaseDate: '2025-09-22',
|
|
2078
1498
|
},
|
|
2079
1499
|
ko: {
|
|
2080
1500
|
nativeName: '한국어 (Hangugeo)',
|
|
@@ -2088,8 +1508,9 @@ const LANGUAGES = {
|
|
|
2088
1508
|
en: 'Korean',
|
|
2089
1509
|
es: 'Coreano',
|
|
2090
1510
|
},
|
|
2091
|
-
status: '
|
|
1511
|
+
status: 'commingsoon',
|
|
2092
1512
|
speakers: 82000000,
|
|
1513
|
+
releaseDate: '2025-09-22',
|
|
2093
1514
|
},
|
|
2094
1515
|
pl: {
|
|
2095
1516
|
nativeName: 'Polski',
|
|
@@ -2105,6 +1526,7 @@ const LANGUAGES = {
|
|
|
2105
1526
|
},
|
|
2106
1527
|
status: 'commingsoon',
|
|
2107
1528
|
speakers: 40000000,
|
|
1529
|
+
releaseDate: '2025-09-29',
|
|
2108
1530
|
},
|
|
2109
1531
|
sv: {
|
|
2110
1532
|
nativeName: 'Svenska',
|
|
@@ -2120,6 +1542,7 @@ const LANGUAGES = {
|
|
|
2120
1542
|
},
|
|
2121
1543
|
status: 'commingsoon',
|
|
2122
1544
|
speakers: 10000000,
|
|
1545
|
+
releaseDate: '2025-10-06',
|
|
2123
1546
|
},
|
|
2124
1547
|
tr: {
|
|
2125
1548
|
nativeName: 'Türkçe',
|
|
@@ -2135,6 +1558,7 @@ const LANGUAGES = {
|
|
|
2135
1558
|
},
|
|
2136
1559
|
status: 'commingsoon',
|
|
2137
1560
|
speakers: 88000000,
|
|
1561
|
+
releaseDate: '2025-10-06',
|
|
2138
1562
|
},
|
|
2139
1563
|
ar: {
|
|
2140
1564
|
nativeName: 'العربية (Al-Arabiyyah)',
|
|
@@ -2176,6 +1600,7 @@ const LANGUAGES = {
|
|
|
2176
1600
|
},
|
|
2177
1601
|
status: 'commingsoon',
|
|
2178
1602
|
speakers: 422000000,
|
|
1603
|
+
releaseDate: '2025-10-13',
|
|
2179
1604
|
},
|
|
2180
1605
|
vi: {
|
|
2181
1606
|
nativeName: 'Tiếng Việt',
|
|
@@ -2191,6 +1616,7 @@ const LANGUAGES = {
|
|
|
2191
1616
|
},
|
|
2192
1617
|
status: 'commingsoon',
|
|
2193
1618
|
speakers: 90000000,
|
|
1619
|
+
releaseDate: '2025-10-20',
|
|
2194
1620
|
},
|
|
2195
1621
|
id: {
|
|
2196
1622
|
nativeName: 'Bahasa Indonesia',
|
|
@@ -2206,6 +1632,7 @@ const LANGUAGES = {
|
|
|
2206
1632
|
},
|
|
2207
1633
|
status: 'commingsoon',
|
|
2208
1634
|
speakers: 199000000,
|
|
1635
|
+
releaseDate: '2025-10-20',
|
|
2209
1636
|
},
|
|
2210
1637
|
da: {
|
|
2211
1638
|
nativeName: 'Dansk',
|
|
@@ -2221,6 +1648,7 @@ const LANGUAGES = {
|
|
|
2221
1648
|
},
|
|
2222
1649
|
status: 'commingsoon',
|
|
2223
1650
|
speakers: 6000000,
|
|
1651
|
+
releaseDate: '2025-10-27',
|
|
2224
1652
|
},
|
|
2225
1653
|
no: {
|
|
2226
1654
|
nativeName: 'Norsk',
|
|
@@ -2236,6 +1664,7 @@ const LANGUAGES = {
|
|
|
2236
1664
|
},
|
|
2237
1665
|
status: 'commingsoon',
|
|
2238
1666
|
speakers: 5300000,
|
|
1667
|
+
releaseDate: '2025-10-27',
|
|
2239
1668
|
},
|
|
2240
1669
|
fi: {
|
|
2241
1670
|
nativeName: 'Suomi',
|
|
@@ -2251,6 +1680,7 @@ const LANGUAGES = {
|
|
|
2251
1680
|
},
|
|
2252
1681
|
status: 'commingsoon',
|
|
2253
1682
|
speakers: 5400000,
|
|
1683
|
+
releaseDate: '2025-11-03',
|
|
2254
1684
|
},
|
|
2255
1685
|
cs: {
|
|
2256
1686
|
nativeName: 'Čeština',
|
|
@@ -2266,6 +1696,7 @@ const LANGUAGES = {
|
|
|
2266
1696
|
},
|
|
2267
1697
|
status: 'commingsoon',
|
|
2268
1698
|
speakers: 10700000,
|
|
1699
|
+
releaseDate: '2025-11-03',
|
|
2269
1700
|
},
|
|
2270
1701
|
el: {
|
|
2271
1702
|
nativeName: 'Ελληνικά (Elliniká)',
|
|
@@ -2281,6 +1712,7 @@ const LANGUAGES = {
|
|
|
2281
1712
|
},
|
|
2282
1713
|
status: 'commingsoon',
|
|
2283
1714
|
speakers: 13500000,
|
|
1715
|
+
releaseDate: '2025-11-17',
|
|
2284
1716
|
},
|
|
2285
1717
|
hu: {
|
|
2286
1718
|
nativeName: 'Magyar',
|
|
@@ -2296,6 +1728,7 @@ const LANGUAGES = {
|
|
|
2296
1728
|
},
|
|
2297
1729
|
status: 'commingsoon',
|
|
2298
1730
|
speakers: 13000000,
|
|
1731
|
+
releaseDate: '2025-11-25',
|
|
2299
1732
|
},
|
|
2300
1733
|
ro: {
|
|
2301
1734
|
nativeName: 'Română',
|
|
@@ -2311,6 +1744,7 @@ const LANGUAGES = {
|
|
|
2311
1744
|
},
|
|
2312
1745
|
status: 'commingsoon',
|
|
2313
1746
|
speakers: 24000000,
|
|
1747
|
+
releaseDate: '2025-12-01',
|
|
2314
1748
|
},
|
|
2315
1749
|
uk: {
|
|
2316
1750
|
nativeName: 'Українська (Ukrainska)',
|
|
@@ -2326,6 +1760,7 @@ const LANGUAGES = {
|
|
|
2326
1760
|
},
|
|
2327
1761
|
status: 'commingsoon',
|
|
2328
1762
|
speakers: 33000000,
|
|
1763
|
+
releaseDate: '2025-12-08',
|
|
2329
1764
|
},
|
|
2330
1765
|
he: {
|
|
2331
1766
|
nativeName: 'עברית (Ivrit)',
|
|
@@ -2341,6 +1776,7 @@ const LANGUAGES = {
|
|
|
2341
1776
|
},
|
|
2342
1777
|
status: 'commingsoon',
|
|
2343
1778
|
speakers: 9000000,
|
|
1779
|
+
releaseDate: '2025-12-15',
|
|
2344
1780
|
},
|
|
2345
1781
|
th: {
|
|
2346
1782
|
nativeName: 'ภาษาไทย (Phasa Thai)',
|
|
@@ -2356,6 +1792,7 @@ const LANGUAGES = {
|
|
|
2356
1792
|
},
|
|
2357
1793
|
status: 'commingsoon',
|
|
2358
1794
|
speakers: 69000000,
|
|
1795
|
+
releaseDate: '2025-12-15',
|
|
2359
1796
|
},
|
|
2360
1797
|
hi: {
|
|
2361
1798
|
nativeName: 'हिन्दी (Hindī)',
|
|
@@ -2371,6 +1808,7 @@ const LANGUAGES = {
|
|
|
2371
1808
|
},
|
|
2372
1809
|
status: 'commingsoon',
|
|
2373
1810
|
speakers: 602000000,
|
|
1811
|
+
releaseDate: '2025-12-22',
|
|
2374
1812
|
},
|
|
2375
1813
|
ca: {
|
|
2376
1814
|
nativeName: 'Català',
|
|
@@ -2386,6 +1824,7 @@ const LANGUAGES = {
|
|
|
2386
1824
|
},
|
|
2387
1825
|
status: 'commingsoon',
|
|
2388
1826
|
speakers: 10000000,
|
|
1827
|
+
releaseDate: '2025-12-22',
|
|
2389
1828
|
},
|
|
2390
1829
|
bg: {
|
|
2391
1830
|
nativeName: 'Български (Balgarski)',
|
|
@@ -2401,6 +1840,7 @@ const LANGUAGES = {
|
|
|
2401
1840
|
},
|
|
2402
1841
|
status: 'commingsoon',
|
|
2403
1842
|
speakers: 9000000,
|
|
1843
|
+
releaseDate: '2025-12-22',
|
|
2404
1844
|
},
|
|
2405
1845
|
eo: {
|
|
2406
1846
|
nativeName: 'Esperanto',
|
|
@@ -2416,6 +1856,7 @@ const LANGUAGES = {
|
|
|
2416
1856
|
},
|
|
2417
1857
|
status: 'commingsoon',
|
|
2418
1858
|
speakers: 2000000,
|
|
1859
|
+
releaseDate: '2025-12-29',
|
|
2419
1860
|
},
|
|
2420
1861
|
ia: {
|
|
2421
1862
|
nativeName: 'Interlingua',
|
|
@@ -2431,6 +1872,7 @@ const LANGUAGES = {
|
|
|
2431
1872
|
},
|
|
2432
1873
|
status: 'commingsoon',
|
|
2433
1874
|
speakers: 1500,
|
|
1875
|
+
releaseDate: '2025-12-29',
|
|
2434
1876
|
},
|
|
2435
1877
|
hr: {
|
|
2436
1878
|
nativeName: 'Hrvatski',
|
|
@@ -2446,6 +1888,7 @@ const LANGUAGES = {
|
|
|
2446
1888
|
},
|
|
2447
1889
|
status: 'commingsoon',
|
|
2448
1890
|
speakers: 5700000,
|
|
1891
|
+
releaseDate: '2025-12-29',
|
|
2449
1892
|
},
|
|
2450
1893
|
sk: {
|
|
2451
1894
|
nativeName: 'Slovenčina',
|
|
@@ -2461,6 +1904,7 @@ const LANGUAGES = {
|
|
|
2461
1904
|
},
|
|
2462
1905
|
status: 'commingsoon',
|
|
2463
1906
|
speakers: 5400000,
|
|
1907
|
+
releaseDate: '2025-12-29',
|
|
2464
1908
|
},
|
|
2465
1909
|
fil: {
|
|
2466
1910
|
nativeName: 'Filipino',
|
|
@@ -2476,6 +1920,7 @@ const LANGUAGES = {
|
|
|
2476
1920
|
},
|
|
2477
1921
|
status: 'commingsoon',
|
|
2478
1922
|
speakers: 109000000,
|
|
1923
|
+
releaseDate: '2025-12-29',
|
|
2479
1924
|
},
|
|
2480
1925
|
tl: {
|
|
2481
1926
|
// Tagalog often used as base for Filipino, but distinct ISO code
|
|
@@ -2492,6 +1937,7 @@ const LANGUAGES = {
|
|
|
2492
1937
|
},
|
|
2493
1938
|
status: 'commingsoon',
|
|
2494
1939
|
speakers: 109000000,
|
|
1940
|
+
releaseDate: '2025-12-29',
|
|
2495
1941
|
},
|
|
2496
1942
|
lt: {
|
|
2497
1943
|
nativeName: 'Lietuvių',
|
|
@@ -2507,6 +1953,7 @@ const LANGUAGES = {
|
|
|
2507
1953
|
},
|
|
2508
1954
|
status: 'commingsoon',
|
|
2509
1955
|
speakers: 2800000,
|
|
1956
|
+
releaseDate: '2025-12-29',
|
|
2510
1957
|
},
|
|
2511
1958
|
lv: {
|
|
2512
1959
|
nativeName: 'Latviešu',
|
|
@@ -2522,6 +1969,7 @@ const LANGUAGES = {
|
|
|
2522
1969
|
},
|
|
2523
1970
|
status: 'commingsoon',
|
|
2524
1971
|
speakers: 1900000,
|
|
1972
|
+
releaseDate: '2025-12-29',
|
|
2525
1973
|
},
|
|
2526
1974
|
sl: {
|
|
2527
1975
|
nativeName: 'Slovenščina',
|
|
@@ -2537,6 +1985,7 @@ const LANGUAGES = {
|
|
|
2537
1985
|
},
|
|
2538
1986
|
status: 'commingsoon',
|
|
2539
1987
|
speakers: 2500000,
|
|
1988
|
+
releaseDate: '2025-12-29',
|
|
2540
1989
|
},
|
|
2541
1990
|
et: {
|
|
2542
1991
|
nativeName: 'Eesti',
|
|
@@ -2552,6 +2001,7 @@ const LANGUAGES = {
|
|
|
2552
2001
|
},
|
|
2553
2002
|
status: 'commingsoon',
|
|
2554
2003
|
speakers: 1100000,
|
|
2004
|
+
releaseDate: '2025-12-29',
|
|
2555
2005
|
},
|
|
2556
2006
|
ms: {
|
|
2557
2007
|
nativeName: 'Bahasa Melayu',
|
|
@@ -2567,6 +2017,7 @@ const LANGUAGES = {
|
|
|
2567
2017
|
},
|
|
2568
2018
|
status: 'commingsoon',
|
|
2569
2019
|
speakers: 290000000,
|
|
2020
|
+
releaseDate: '2025-12-29',
|
|
2570
2021
|
},
|
|
2571
2022
|
sw: {
|
|
2572
2023
|
nativeName: 'Kiswahili',
|
|
@@ -2582,6 +2033,7 @@ const LANGUAGES = {
|
|
|
2582
2033
|
},
|
|
2583
2034
|
status: 'commingsoon',
|
|
2584
2035
|
speakers: 200000000,
|
|
2036
|
+
releaseDate: '2025-12-29',
|
|
2585
2037
|
},
|
|
2586
2038
|
fa: {
|
|
2587
2039
|
nativeName: 'فارسی (Fārsī)',
|
|
@@ -2597,6 +2049,7 @@ const LANGUAGES = {
|
|
|
2597
2049
|
},
|
|
2598
2050
|
status: 'commingsoon',
|
|
2599
2051
|
speakers: 110000000,
|
|
2052
|
+
releaseDate: '2025-12-29',
|
|
2600
2053
|
},
|
|
2601
2054
|
bn: {
|
|
2602
2055
|
nativeName: 'বাংলা (Bangla)',
|
|
@@ -2857,12 +2310,749 @@ const LANGUAGES = {
|
|
|
2857
2310
|
function getLangDesc(langCode, lang) {
|
|
2858
2311
|
return LANGUAGES[langCode]?.translations[lang] || langCode;
|
|
2859
2312
|
}
|
|
2860
|
-
function getSupportedLanguageOptions(lang = 'es') {
|
|
2861
|
-
return SUPPORTED_LANGUAGES.map((langCode) => ({
|
|
2862
|
-
value: langCode,
|
|
2863
|
-
label: getLangDesc(langCode, lang),
|
|
2864
|
-
}));
|
|
2313
|
+
function getSupportedLanguageOptions(lang = 'es') {
|
|
2314
|
+
return SUPPORTED_LANGUAGES.map((langCode) => ({
|
|
2315
|
+
value: langCode,
|
|
2316
|
+
label: getLangDesc(langCode, lang),
|
|
2317
|
+
}));
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
class LangDescTranslation {
|
|
2321
|
+
transform(value, lang) {
|
|
2322
|
+
return getLangDesc(value, lang);
|
|
2323
|
+
}
|
|
2324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: LangDescTranslation, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2325
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: LangDescTranslation, isStandalone: true, name: "langDesc" }); }
|
|
2326
|
+
}
|
|
2327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: LangDescTranslation, decorators: [{
|
|
2328
|
+
type: Pipe,
|
|
2329
|
+
args: [{
|
|
2330
|
+
name: 'langDesc',
|
|
2331
|
+
standalone: true,
|
|
2332
|
+
}]
|
|
2333
|
+
}] });
|
|
2334
|
+
|
|
2335
|
+
class ConfirmService {
|
|
2336
|
+
constructor() {
|
|
2337
|
+
this.pdialogService = inject(DialogService);
|
|
2338
|
+
}
|
|
2339
|
+
openConfirm(title = '', message = '', acceptText = 'Aceptar') {
|
|
2340
|
+
const dialogRef = this.pdialogService.open(ConfirmComponent, {
|
|
2341
|
+
data: {
|
|
2342
|
+
message: message,
|
|
2343
|
+
title: title,
|
|
2344
|
+
acceptText,
|
|
2345
|
+
},
|
|
2346
|
+
closable: true,
|
|
2347
|
+
modal: true,
|
|
2348
|
+
});
|
|
2349
|
+
return dialogRef.onClose;
|
|
2350
|
+
}
|
|
2351
|
+
confirm(options) {
|
|
2352
|
+
const dialogRef = this.pdialogService.open(ConfirmComponent, {
|
|
2353
|
+
data: {
|
|
2354
|
+
message: options.message || '',
|
|
2355
|
+
title: options.title || 'Confirmación',
|
|
2356
|
+
acceptText: options.acceptText || 'Aceptar',
|
|
2357
|
+
cancelText: options.cancelText || 'Cancelar',
|
|
2358
|
+
warning: options.warning || null,
|
|
2359
|
+
oneBotton: options.oneBotton || false,
|
|
2360
|
+
piIcon: options.piIcon || null,
|
|
2361
|
+
},
|
|
2362
|
+
closable: true,
|
|
2363
|
+
modal: true,
|
|
2364
|
+
});
|
|
2365
|
+
return firstValueFrom(dialogRef.onClose);
|
|
2366
|
+
}
|
|
2367
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2368
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, providedIn: 'root' }); }
|
|
2369
|
+
}
|
|
2370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConfirmService, decorators: [{
|
|
2371
|
+
type: Injectable,
|
|
2372
|
+
args: [{
|
|
2373
|
+
providedIn: 'root',
|
|
2374
|
+
}]
|
|
2375
|
+
}], ctorParameters: () => [] });
|
|
2376
|
+
|
|
2377
|
+
class PromptComponent {
|
|
2378
|
+
constructor() {
|
|
2379
|
+
this.ref = inject(DynamicDialogRef);
|
|
2380
|
+
this.config = inject(DynamicDialogConfig);
|
|
2381
|
+
this.title = signal('Prompt', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2382
|
+
this.message = signal('', ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
2383
|
+
this.acceptText = signal('Accept', ...(ngDevMode ? [{ debugName: "acceptText" }] : []));
|
|
2384
|
+
this.cancelText = signal('Cancel', ...(ngDevMode ? [{ debugName: "cancelText" }] : []));
|
|
2385
|
+
this.inputValue = signal('', ...(ngDevMode ? [{ debugName: "inputValue" }] : []));
|
|
2386
|
+
}
|
|
2387
|
+
ngOnInit() {
|
|
2388
|
+
this.title.set(this.config.data?.title || 'Prompt');
|
|
2389
|
+
this.message.set(this.config.data?.message || '');
|
|
2390
|
+
this.acceptText.set(this.config.data?.acceptText || 'Accept');
|
|
2391
|
+
this.cancelText.set(this.config.data?.cancelText || 'Cancel');
|
|
2392
|
+
// Set initial value if provided
|
|
2393
|
+
this.inputValue.set(this.config.data?.initialValue || '');
|
|
2394
|
+
}
|
|
2395
|
+
accept() {
|
|
2396
|
+
this.ref.close(this.inputValue());
|
|
2397
|
+
}
|
|
2398
|
+
cancel() {
|
|
2399
|
+
this.ref.close(null);
|
|
2400
|
+
}
|
|
2401
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2402
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: PromptComponent, isStandalone: true, selector: "dc-prompt", ngImport: i0, template: "<div class=\"form-input-card p-4\">\n <p-message severity=\"secondary\"> {{ title() }}</p-message>\n\n <div class=\"my-4\">{{ message() }}</div>\n\n <div class=\"p-field mb-4\">\n <textarea rows=\"5\" cols=\"30\" pTextarea [(ngModel)]=\"inputValue\" class=\"w-full\"></textarea>\n </div>\n\n <div class=\"flex justify-content-end gap-2\">\n <p-button [label]=\"cancelText()\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText()\" (click)=\"accept()\"></p-button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i4$3.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }] }); }
|
|
2403
|
+
}
|
|
2404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptComponent, decorators: [{
|
|
2405
|
+
type: Component,
|
|
2406
|
+
args: [{ selector: 'dc-prompt', standalone: true, imports: [CommonModule, ButtonModule, InputTextModule, FormsModule, MessageModule, TextareaModule], template: "<div class=\"form-input-card p-4\">\n <p-message severity=\"secondary\"> {{ title() }}</p-message>\n\n <div class=\"my-4\">{{ message() }}</div>\n\n <div class=\"p-field mb-4\">\n <textarea rows=\"5\" cols=\"30\" pTextarea [(ngModel)]=\"inputValue\" class=\"w-full\"></textarea>\n </div>\n\n <div class=\"flex justify-content-end gap-2\">\n <p-button [label]=\"cancelText()\" (click)=\"cancel()\" severity=\"secondary\"></p-button>\n <p-button [label]=\"acceptText()\" (click)=\"accept()\"></p-button>\n </div>\n</div>\n" }]
|
|
2407
|
+
}] });
|
|
2408
|
+
|
|
2409
|
+
class PromptService {
|
|
2410
|
+
constructor() {
|
|
2411
|
+
this.dialogService = inject(DialogService);
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* Opens a prompt dialog.
|
|
2415
|
+
* @param options Configuration options for the prompt dialog.
|
|
2416
|
+
* @returns A promise that resolves with the input value if accepted, or null if canceled.
|
|
2417
|
+
*/
|
|
2418
|
+
openPrompt(options) {
|
|
2419
|
+
const dialogRef = this.dialogService.open(PromptComponent, {
|
|
2420
|
+
data: {
|
|
2421
|
+
title: options.title || 'Prompt',
|
|
2422
|
+
message: options.message || '',
|
|
2423
|
+
acceptText: options.acceptText || 'Accept',
|
|
2424
|
+
cancelText: options.cancelText || 'Cancel',
|
|
2425
|
+
initialValue: options.initialValue || '', // Pass initialValue to component data
|
|
2426
|
+
},
|
|
2427
|
+
header: options.title || 'Prompt', // Set header for accessibility and title bar
|
|
2428
|
+
closable: true,
|
|
2429
|
+
modal: true,
|
|
2430
|
+
width: '700px', // Optional: Adjust width as needed
|
|
2431
|
+
});
|
|
2432
|
+
// Return the result when the dialog closes
|
|
2433
|
+
return firstValueFrom(dialogRef.onClose);
|
|
2434
|
+
}
|
|
2435
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2436
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, providedIn: 'root' }); }
|
|
2437
|
+
}
|
|
2438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: PromptService, decorators: [{
|
|
2439
|
+
type: Injectable,
|
|
2440
|
+
args: [{
|
|
2441
|
+
providedIn: 'root',
|
|
2442
|
+
}]
|
|
2443
|
+
}] });
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Injection token for HttpCoreService configuration
|
|
2447
|
+
*/
|
|
2448
|
+
const HTTP_CORE_CONFIG = new InjectionToken('HTTP_CORE_CONFIG');
|
|
2449
|
+
/**
|
|
2450
|
+
* Modern HTTP service for Angular applications
|
|
2451
|
+
* Provides methods for making HTTP requests with proper error handling and response transformation
|
|
2452
|
+
*/
|
|
2453
|
+
class HttpCoreService {
|
|
2454
|
+
constructor(config) {
|
|
2455
|
+
this.httpClient = inject(HttpClient);
|
|
2456
|
+
// Use signals for reactive state
|
|
2457
|
+
this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
2458
|
+
this.lastError = signal(null, ...(ngDevMode ? [{ debugName: "lastError" }] : []));
|
|
2459
|
+
if (config && config.primaryUrl) {
|
|
2460
|
+
this.config = {
|
|
2461
|
+
defaultHost: 'primary',
|
|
2462
|
+
...config,
|
|
2463
|
+
};
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
// Initialize with a placeholder - this will be set properly with setConfig
|
|
2467
|
+
this.config = {
|
|
2468
|
+
primaryUrl: '',
|
|
2469
|
+
defaultHost: 'primary',
|
|
2470
|
+
};
|
|
2471
|
+
if (!config) {
|
|
2472
|
+
console.warn('HttpCoreService: No configuration provided. Use setConfig to configure the service.');
|
|
2473
|
+
}
|
|
2474
|
+
else if (!config.primaryUrl) {
|
|
2475
|
+
console.warn('HttpCoreService: primaryUrl is required in configuration. Use setConfig to set it.');
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
|
+
* Set the configuration for the service
|
|
2481
|
+
* This allows for manual configuration when not using dependency injection
|
|
2482
|
+
*/
|
|
2483
|
+
setConfig(config) {
|
|
2484
|
+
this.config = {
|
|
2485
|
+
...this.config,
|
|
2486
|
+
...config,
|
|
2487
|
+
};
|
|
2488
|
+
}
|
|
2489
|
+
/**
|
|
2490
|
+
* Get the loading state as a signal
|
|
2491
|
+
*/
|
|
2492
|
+
loading() {
|
|
2493
|
+
return this.isLoading;
|
|
2494
|
+
}
|
|
2495
|
+
/**
|
|
2496
|
+
* Get the last error as a signal
|
|
2497
|
+
*/
|
|
2498
|
+
error() {
|
|
2499
|
+
return this.lastError;
|
|
2500
|
+
}
|
|
2501
|
+
async postHttp({ service, data, host }) {
|
|
2502
|
+
this.isLoading.set(true);
|
|
2503
|
+
try {
|
|
2504
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2505
|
+
const dataPlain = this.toPlainObject(data);
|
|
2506
|
+
const response$ = this.httpClient.post(url, dataPlain).pipe(tap(this.checkResponseStatus.bind(this)), catchError(this.handleRequestError.bind(this)));
|
|
2507
|
+
const result = await lastValueFrom(response$);
|
|
2508
|
+
this.isLoading.set(false);
|
|
2509
|
+
return result;
|
|
2510
|
+
}
|
|
2511
|
+
catch (error) {
|
|
2512
|
+
this.isLoading.set(false);
|
|
2513
|
+
throw error;
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
async putHttp({ service, data, host }) {
|
|
2517
|
+
this.isLoading.set(true);
|
|
2518
|
+
try {
|
|
2519
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2520
|
+
const dataPlain = this.toPlainObject(data);
|
|
2521
|
+
const response$ = this.httpClient.put(url, dataPlain).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2522
|
+
const result = await lastValueFrom(response$);
|
|
2523
|
+
this.isLoading.set(false);
|
|
2524
|
+
return result;
|
|
2525
|
+
}
|
|
2526
|
+
catch (error) {
|
|
2527
|
+
this.isLoading.set(false);
|
|
2528
|
+
throw error;
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
async getHttp({ service, host, skipErrorHandling = false }) {
|
|
2532
|
+
this.isLoading.set(true);
|
|
2533
|
+
try {
|
|
2534
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2535
|
+
const response$ = this.httpClient.get(url).pipe(catchError((err) => {
|
|
2536
|
+
if (!skipErrorHandling) {
|
|
2537
|
+
return this.handleRequestError(err);
|
|
2538
|
+
}
|
|
2539
|
+
return throwError(() => err);
|
|
2540
|
+
}));
|
|
2541
|
+
const result = await lastValueFrom(response$);
|
|
2542
|
+
this.isLoading.set(false);
|
|
2543
|
+
return result;
|
|
2544
|
+
}
|
|
2545
|
+
catch (error) {
|
|
2546
|
+
this.isLoading.set(false);
|
|
2547
|
+
throw error;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
async deleteHttp({ service, host }) {
|
|
2551
|
+
this.isLoading.set(true);
|
|
2552
|
+
try {
|
|
2553
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2554
|
+
const response$ = this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2555
|
+
const result = await lastValueFrom(response$);
|
|
2556
|
+
this.isLoading.set(false);
|
|
2557
|
+
return result;
|
|
2558
|
+
}
|
|
2559
|
+
catch (error) {
|
|
2560
|
+
this.isLoading.set(false);
|
|
2561
|
+
throw error;
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
/**
|
|
2565
|
+
* Make a POST request to the specified service
|
|
2566
|
+
* @param service The service endpoint
|
|
2567
|
+
* @param data The data to send
|
|
2568
|
+
* @param host The host to use (primary or secondary)
|
|
2569
|
+
* @returns A promise with the response
|
|
2570
|
+
* @deprecated Use postHttp instead
|
|
2571
|
+
*/
|
|
2572
|
+
async post(service, data, host = this.config.defaultHost) {
|
|
2573
|
+
return this.postHttp({ service, data, host });
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Make a POST request to a specific URL
|
|
2577
|
+
* @param baseUrl The base URL
|
|
2578
|
+
* @param service The service endpoint
|
|
2579
|
+
* @param data The data to send
|
|
2580
|
+
* @returns A promise with the response
|
|
2581
|
+
*/
|
|
2582
|
+
async postToUrl(baseUrl, service, data) {
|
|
2583
|
+
this.isLoading.set(true);
|
|
2584
|
+
try {
|
|
2585
|
+
const url = `${baseUrl}/${service}`;
|
|
2586
|
+
const dataPlain = this.toPlainObject(data);
|
|
2587
|
+
const response$ = this.httpClient.post(url, dataPlain).pipe(tap(this.checkResponseStatus.bind(this)), catchError(this.handleRequestError.bind(this)));
|
|
2588
|
+
const result = await lastValueFrom(response$);
|
|
2589
|
+
this.isLoading.set(false);
|
|
2590
|
+
return result;
|
|
2591
|
+
}
|
|
2592
|
+
catch (error) {
|
|
2593
|
+
this.isLoading.set(false);
|
|
2594
|
+
throw error;
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
/**
|
|
2598
|
+
* Make a PUT request to the specified service
|
|
2599
|
+
* @param service The service endpoint
|
|
2600
|
+
* @param data The data to send
|
|
2601
|
+
* @param host The host to use (primary or secondary)
|
|
2602
|
+
* @returns A promise with the response
|
|
2603
|
+
* @deprecated Use putHttp instead
|
|
2604
|
+
*/
|
|
2605
|
+
async put(service, data, host = this.config.defaultHost) {
|
|
2606
|
+
return this.putHttp({ service, data, host });
|
|
2607
|
+
}
|
|
2608
|
+
/**
|
|
2609
|
+
* Make a PUT request to a specific URL
|
|
2610
|
+
* @param baseUrl The base URL
|
|
2611
|
+
* @param service The service endpoint
|
|
2612
|
+
* @param data The data to send
|
|
2613
|
+
* @returns A promise with the response
|
|
2614
|
+
*/
|
|
2615
|
+
async putToUrl(baseUrl, service, data) {
|
|
2616
|
+
this.isLoading.set(true);
|
|
2617
|
+
try {
|
|
2618
|
+
const url = `${baseUrl}/${service}`;
|
|
2619
|
+
const dataPlain = this.toPlainObject(data);
|
|
2620
|
+
const response$ = this.httpClient.put(url, dataPlain).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2621
|
+
const result = await lastValueFrom(response$);
|
|
2622
|
+
this.isLoading.set(false);
|
|
2623
|
+
return result;
|
|
2624
|
+
}
|
|
2625
|
+
catch (error) {
|
|
2626
|
+
this.isLoading.set(false);
|
|
2627
|
+
throw error;
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* Make a GET request to the specified service
|
|
2632
|
+
* @param service The service endpoint
|
|
2633
|
+
* @param host The host to use (primary or secondary)
|
|
2634
|
+
* @param skipErrorHandling Whether to skip error handling
|
|
2635
|
+
* @returns A promise with the response
|
|
2636
|
+
* @deprecated Use getHttp instead
|
|
2637
|
+
*/
|
|
2638
|
+
async get(service, host = this.config.defaultHost, skipErrorHandling = false) {
|
|
2639
|
+
return this.getHttp({ service, host, skipErrorHandling });
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* Make a GET request to a specific URL
|
|
2643
|
+
* @param baseUrl The base URL
|
|
2644
|
+
* @param service The service endpoint
|
|
2645
|
+
* @param skipErrorHandling Whether to skip error handling
|
|
2646
|
+
* @returns A promise with the response
|
|
2647
|
+
*/
|
|
2648
|
+
async getFromUrl(baseUrl, service, skipErrorHandling = false) {
|
|
2649
|
+
this.isLoading.set(true);
|
|
2650
|
+
try {
|
|
2651
|
+
const url = `${baseUrl}/${service}`;
|
|
2652
|
+
const response$ = this.httpClient.get(url).pipe(catchError((err) => {
|
|
2653
|
+
if (!skipErrorHandling) {
|
|
2654
|
+
return this.handleRequestError(err);
|
|
2655
|
+
}
|
|
2656
|
+
return throwError(() => err);
|
|
2657
|
+
}));
|
|
2658
|
+
const result = await lastValueFrom(response$);
|
|
2659
|
+
this.isLoading.set(false);
|
|
2660
|
+
return result;
|
|
2661
|
+
}
|
|
2662
|
+
catch (error) {
|
|
2663
|
+
this.isLoading.set(false);
|
|
2664
|
+
throw error;
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
/**
|
|
2668
|
+
* Make a DELETE request to the specified service
|
|
2669
|
+
* @param service The service endpoint
|
|
2670
|
+
* @param host The host to use (primary or secondary)
|
|
2671
|
+
* @returns A promise with the response
|
|
2672
|
+
* @deprecated Use deleteHttp instead
|
|
2673
|
+
*/
|
|
2674
|
+
async delete(service, host = this.config.defaultHost) {
|
|
2675
|
+
return this.deleteHttp({ service, host });
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* Make a DELETE request to a specific URL
|
|
2679
|
+
* @param baseUrl The base URL
|
|
2680
|
+
* @param service The service endpoint
|
|
2681
|
+
* @returns A promise with the response
|
|
2682
|
+
*/
|
|
2683
|
+
async deleteFromUrl(baseUrl, service) {
|
|
2684
|
+
this.isLoading.set(true);
|
|
2685
|
+
try {
|
|
2686
|
+
const url = `${baseUrl}/${service}`;
|
|
2687
|
+
const response$ = this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2688
|
+
const result = await lastValueFrom(response$);
|
|
2689
|
+
this.isLoading.set(false);
|
|
2690
|
+
return result;
|
|
2691
|
+
}
|
|
2692
|
+
catch (error) {
|
|
2693
|
+
this.isLoading.set(false);
|
|
2694
|
+
throw error;
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Get an observable for a GET request
|
|
2699
|
+
* @param service The service endpoint
|
|
2700
|
+
* @param host The host to use (primary or secondary)
|
|
2701
|
+
* @returns An observable with the response
|
|
2702
|
+
*/
|
|
2703
|
+
getObservable(service, host = this.config.defaultHost) {
|
|
2704
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2705
|
+
return this.httpClient.get(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2708
|
+
* Get an observable for a POST request
|
|
2709
|
+
* @param service The service endpoint
|
|
2710
|
+
* @param data The data to send
|
|
2711
|
+
* @param skipErrorHandling Whether to skip error handling
|
|
2712
|
+
* @param host The host to use (primary or secondary)
|
|
2713
|
+
* @returns An observable with the response
|
|
2714
|
+
*/
|
|
2715
|
+
postObservable(service, data, skipErrorHandling = false, host = this.config.defaultHost) {
|
|
2716
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2717
|
+
const dataPlain = this.toPlainObject(data);
|
|
2718
|
+
return this.httpClient.post(url, dataPlain).pipe(catchError((err) => {
|
|
2719
|
+
if (!skipErrorHandling) {
|
|
2720
|
+
return this.handleRequestError(err);
|
|
2721
|
+
}
|
|
2722
|
+
return throwError(() => err);
|
|
2723
|
+
}));
|
|
2724
|
+
}
|
|
2725
|
+
/**
|
|
2726
|
+
* Get an observable for a DELETE request
|
|
2727
|
+
* @param service The service endpoint
|
|
2728
|
+
* @param host The host to use (primary or secondary)
|
|
2729
|
+
* @returns An observable with the response
|
|
2730
|
+
*/
|
|
2731
|
+
deleteObservable(service, host = this.config.defaultHost) {
|
|
2732
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2733
|
+
return this.httpClient.delete(url).pipe(catchError(this.handleRequestError.bind(this)));
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Upload a file to the specified service
|
|
2737
|
+
* @param service The service endpoint
|
|
2738
|
+
* @param file The file to upload
|
|
2739
|
+
* @param metadata Optional metadata to send with the file
|
|
2740
|
+
* @param host The host to use (primary or secondary)
|
|
2741
|
+
* @returns A promise with the response
|
|
2742
|
+
*/
|
|
2743
|
+
async uploadFile(service, file, metadata = null, host = this.config.defaultHost) {
|
|
2744
|
+
this.isLoading.set(true);
|
|
2745
|
+
try {
|
|
2746
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2747
|
+
const formData = new FormData();
|
|
2748
|
+
formData.append('file', file);
|
|
2749
|
+
let headers = {};
|
|
2750
|
+
if (metadata) {
|
|
2751
|
+
headers = { metadata: JSON.stringify(metadata) };
|
|
2752
|
+
}
|
|
2753
|
+
const response$ = this.httpClient.post(url, formData, { headers });
|
|
2754
|
+
const result = await lastValueFrom(response$);
|
|
2755
|
+
this.isLoading.set(false);
|
|
2756
|
+
return result;
|
|
2757
|
+
}
|
|
2758
|
+
catch (error) {
|
|
2759
|
+
this.isLoading.set(false);
|
|
2760
|
+
throw error;
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Download a file from the specified service
|
|
2765
|
+
* @param service The service endpoint
|
|
2766
|
+
* @param host The host to use (primary or secondary)
|
|
2767
|
+
* @returns A promise with the response
|
|
2768
|
+
*/
|
|
2769
|
+
async downloadFile(service, host = this.config.defaultHost) {
|
|
2770
|
+
this.isLoading.set(true);
|
|
2771
|
+
try {
|
|
2772
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2773
|
+
const response$ = this.httpClient
|
|
2774
|
+
.get(url, {
|
|
2775
|
+
responseType: 'blob',
|
|
2776
|
+
observe: 'response',
|
|
2777
|
+
})
|
|
2778
|
+
.pipe(catchError(this.handleBlobError.bind(this)));
|
|
2779
|
+
const result = await lastValueFrom(response$);
|
|
2780
|
+
this.isLoading.set(false);
|
|
2781
|
+
return result;
|
|
2782
|
+
}
|
|
2783
|
+
catch (error) {
|
|
2784
|
+
this.isLoading.set(false);
|
|
2785
|
+
throw error;
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
/**
|
|
2789
|
+
* Upload a file to the specified service and get the response as a blob
|
|
2790
|
+
* @param service The service endpoint
|
|
2791
|
+
* @param data The data to send
|
|
2792
|
+
* @param host The host to use (primary or secondary)
|
|
2793
|
+
* @returns A promise with the response
|
|
2794
|
+
*/
|
|
2795
|
+
async postFileAndGetBlob(service, data, host = this.config.defaultHost) {
|
|
2796
|
+
this.isLoading.set(true);
|
|
2797
|
+
try {
|
|
2798
|
+
let url = this.getHostUrl(host);
|
|
2799
|
+
if (service) {
|
|
2800
|
+
url += '/' + service;
|
|
2801
|
+
}
|
|
2802
|
+
const response$ = this.httpClient
|
|
2803
|
+
.post(url, data, {
|
|
2804
|
+
observe: 'response',
|
|
2805
|
+
responseType: 'blob',
|
|
2806
|
+
})
|
|
2807
|
+
.pipe(catchError(this.handleBlobError.bind(this)));
|
|
2808
|
+
const result = await lastValueFrom(response$);
|
|
2809
|
+
this.isLoading.set(false);
|
|
2810
|
+
return result;
|
|
2811
|
+
}
|
|
2812
|
+
catch (error) {
|
|
2813
|
+
this.isLoading.set(false);
|
|
2814
|
+
throw error;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
/**
|
|
2818
|
+
* Get a file from the specified service as an observable
|
|
2819
|
+
* @param service The service endpoint
|
|
2820
|
+
* @param host The host to use (primary or secondary)
|
|
2821
|
+
* @returns An observable with the response
|
|
2822
|
+
*/
|
|
2823
|
+
getFileObservable(service, host = this.config.defaultHost) {
|
|
2824
|
+
const url = this.getHostUrl(host) + '/' + service;
|
|
2825
|
+
return this.httpClient.get(url, { responseType: 'blob' });
|
|
2826
|
+
}
|
|
2827
|
+
/**
|
|
2828
|
+
* Get the URL for the specified host
|
|
2829
|
+
* @param host The host to use (primary or secondary)
|
|
2830
|
+
* @returns The URL for the specified host
|
|
2831
|
+
*/
|
|
2832
|
+
getHostUrl(host = this.config.defaultHost) {
|
|
2833
|
+
if (host === 'primary') {
|
|
2834
|
+
return this.config.primaryUrl;
|
|
2835
|
+
}
|
|
2836
|
+
if (host === 'secondary' && this.config.secondaryUrl) {
|
|
2837
|
+
return this.config.secondaryUrl;
|
|
2838
|
+
}
|
|
2839
|
+
else {
|
|
2840
|
+
return host;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* Handle an error from a request
|
|
2845
|
+
* @param error The error to handle
|
|
2846
|
+
* @returns An observable that throws the error
|
|
2847
|
+
*/
|
|
2848
|
+
handleRequestError(error) {
|
|
2849
|
+
this.isLoading.set(false);
|
|
2850
|
+
// Set the last error
|
|
2851
|
+
if (error.error && typeof error.error === 'object') {
|
|
2852
|
+
this.lastError.set({
|
|
2853
|
+
error_message: error.error.error_message || 'An error occurred',
|
|
2854
|
+
explanation: error.error.explanation || 'Please try again later',
|
|
2855
|
+
status: error.status,
|
|
2856
|
+
code: error.error.code,
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
else {
|
|
2860
|
+
this.lastError.set({
|
|
2861
|
+
error_message: error.message || 'An error occurred',
|
|
2862
|
+
explanation: 'Please try again later',
|
|
2863
|
+
status: error.status,
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
// Call the custom error handler if provided
|
|
2867
|
+
if (this.config.errorHandler) {
|
|
2868
|
+
this.config.errorHandler(error);
|
|
2869
|
+
}
|
|
2870
|
+
return throwError(() => error);
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* Handle an error from a blob request
|
|
2874
|
+
* @param error The error to handle
|
|
2875
|
+
* @returns An observable that throws the error
|
|
2876
|
+
*/
|
|
2877
|
+
async handleBlobError(error) {
|
|
2878
|
+
// Convert blob error response to JSON if possible
|
|
2879
|
+
if (error.error instanceof Blob) {
|
|
2880
|
+
try {
|
|
2881
|
+
const errorText = await error.error.text();
|
|
2882
|
+
error.error = JSON.parse(errorText);
|
|
2883
|
+
}
|
|
2884
|
+
catch (e) {
|
|
2885
|
+
// If parsing fails, create a generic error
|
|
2886
|
+
error.error = {
|
|
2887
|
+
error_message: 'Error processing file',
|
|
2888
|
+
explanation: 'Unable to process server response',
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
return this.handleRequestError(error);
|
|
2893
|
+
}
|
|
2894
|
+
/**
|
|
2895
|
+
* Check the status of a response
|
|
2896
|
+
* @param response The response to check
|
|
2897
|
+
*/
|
|
2898
|
+
checkResponseStatus(response) {
|
|
2899
|
+
// Implement any response status checking logic here
|
|
2900
|
+
// For example, check for specific status codes or error messages
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* Convert an object to a plain object
|
|
2904
|
+
* @param obj The object to convert
|
|
2905
|
+
* @returns A plain object
|
|
2906
|
+
*/
|
|
2907
|
+
toPlainObject(obj) {
|
|
2908
|
+
if (!obj)
|
|
2909
|
+
return obj;
|
|
2910
|
+
// Handle simple types
|
|
2911
|
+
if (typeof obj !== 'object' || obj instanceof Blob || obj instanceof File) {
|
|
2912
|
+
return obj;
|
|
2913
|
+
}
|
|
2914
|
+
// Handle arrays
|
|
2915
|
+
if (Array.isArray(obj)) {
|
|
2916
|
+
return obj.map((item) => this.toPlainObject(item));
|
|
2917
|
+
}
|
|
2918
|
+
// Handle objects
|
|
2919
|
+
const result = {};
|
|
2920
|
+
for (const key in obj) {
|
|
2921
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2922
|
+
const value = obj[key];
|
|
2923
|
+
// Skip functions and undefined values
|
|
2924
|
+
if (typeof value === 'function' || value === undefined) {
|
|
2925
|
+
continue;
|
|
2926
|
+
}
|
|
2927
|
+
result[key] = this.toPlainObject(value);
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
return result;
|
|
2931
|
+
}
|
|
2932
|
+
postObservableWithProgress(service, data, host = 'primary') {
|
|
2933
|
+
const hostUrl = this.getHostUrl(host);
|
|
2934
|
+
const url = `${hostUrl}/${service}`;
|
|
2935
|
+
return this.httpClient
|
|
2936
|
+
.post(url, data, {
|
|
2937
|
+
reportProgress: true,
|
|
2938
|
+
observe: 'events',
|
|
2939
|
+
responseType: 'blob',
|
|
2940
|
+
})
|
|
2941
|
+
.pipe(map$1((event) => {
|
|
2942
|
+
let progress;
|
|
2943
|
+
let blob;
|
|
2944
|
+
switch (event.type) {
|
|
2945
|
+
case HttpEventType.DownloadProgress:
|
|
2946
|
+
if (event.total) {
|
|
2947
|
+
progress = Math.round((100 * event.loaded) / event.total);
|
|
2948
|
+
}
|
|
2949
|
+
break;
|
|
2950
|
+
case HttpEventType.Response:
|
|
2951
|
+
blob = event.body;
|
|
2952
|
+
break;
|
|
2953
|
+
}
|
|
2954
|
+
return { progress, blob };
|
|
2955
|
+
}), catchError((err) => {
|
|
2956
|
+
this.handleRequestError(err);
|
|
2957
|
+
return throwError(() => err);
|
|
2958
|
+
}));
|
|
2959
|
+
}
|
|
2960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, deps: [{ token: HTTP_CORE_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2961
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, providedIn: 'root' }); }
|
|
2962
|
+
}
|
|
2963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HttpCoreService, decorators: [{
|
|
2964
|
+
type: Injectable,
|
|
2965
|
+
args: [{
|
|
2966
|
+
providedIn: 'root',
|
|
2967
|
+
}]
|
|
2968
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2969
|
+
type: Optional
|
|
2970
|
+
}, {
|
|
2971
|
+
type: Inject,
|
|
2972
|
+
args: [HTTP_CORE_CONFIG]
|
|
2973
|
+
}] }] });
|
|
2974
|
+
|
|
2975
|
+
class EntityCommunicationService {
|
|
2976
|
+
constructor(serviceName, customHost) {
|
|
2977
|
+
this.serviceName = serviceName;
|
|
2978
|
+
this.customHost = customHost;
|
|
2979
|
+
this.httpService = inject(HttpCoreService);
|
|
2980
|
+
}
|
|
2981
|
+
findAll() {
|
|
2982
|
+
return this.httpService.getHttp({ service: `api/${this.serviceName}`, host: this.customHost });
|
|
2983
|
+
}
|
|
2984
|
+
findOne(id) {
|
|
2985
|
+
return this.httpService.getHttp({ service: `api/${this.serviceName}/${id}`, host: this.customHost });
|
|
2986
|
+
}
|
|
2987
|
+
createOrUpdate(entity) {
|
|
2988
|
+
// if Id is present then in object, then Update all props in the object
|
|
2989
|
+
return this.httpService.postHttp({ service: `api/${this.serviceName}`, data: entity, host: this.customHost });
|
|
2990
|
+
}
|
|
2991
|
+
query(filterConfig) {
|
|
2992
|
+
return this.httpService.postHttp({ service: `api/${this.serviceName}/query`, data: filterConfig, host: this.customHost });
|
|
2993
|
+
}
|
|
2994
|
+
partialUpdate(id, partialUpdates) {
|
|
2995
|
+
// In backend object is flattened, so Convert nested objects to dot notation eg. { "video.captions.remotion": captions.captions }
|
|
2996
|
+
return this.httpService.putHttp({ service: `api/${this.serviceName}/${id}`, data: partialUpdates, host: this.customHost });
|
|
2997
|
+
}
|
|
2998
|
+
async remove(id) {
|
|
2999
|
+
await this.httpService.deleteHttp({ service: `api/${this.serviceName}/${id}`, host: this.customHost });
|
|
3000
|
+
}
|
|
3001
|
+
clone(id, overrides = {}) {
|
|
3002
|
+
return this.httpService.postHttp({ service: `api/${this.serviceName}/${id}/clone`, data: overrides });
|
|
3003
|
+
}
|
|
3004
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3005
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService }); }
|
|
3006
|
+
}
|
|
3007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EntityCommunicationService, decorators: [{
|
|
3008
|
+
type: Injectable
|
|
3009
|
+
}], ctorParameters: () => [{ type: undefined }, { type: undefined }] });
|
|
3010
|
+
|
|
3011
|
+
class UiStateService {
|
|
3012
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3013
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, providedIn: 'root' }); }
|
|
3014
|
+
}
|
|
3015
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: UiStateService, decorators: [{
|
|
3016
|
+
type: Injectable,
|
|
3017
|
+
args: [{
|
|
3018
|
+
providedIn: 'root',
|
|
3019
|
+
}]
|
|
3020
|
+
}] });
|
|
3021
|
+
|
|
3022
|
+
class FormUtilsService {
|
|
3023
|
+
constructor() {
|
|
3024
|
+
this.fb = inject(FormBuilder);
|
|
3025
|
+
}
|
|
3026
|
+
createMetaFormGroup() {
|
|
3027
|
+
return this.fb.group({
|
|
3028
|
+
authorId: [''],
|
|
3029
|
+
authorEmail: [''],
|
|
3030
|
+
takenCount: [0],
|
|
3031
|
+
level: [0],
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3034
|
+
createManageableFormGroup() {
|
|
3035
|
+
return this.fb.group({
|
|
3036
|
+
isPublic: [false],
|
|
3037
|
+
status: ['draft'],
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
3040
|
+
createLearnableFormGroup() {
|
|
3041
|
+
return this.fb.group({
|
|
3042
|
+
level: new FormControl(0),
|
|
3043
|
+
takenCount: new FormControl(0),
|
|
3044
|
+
tags: this.fb.array([]),
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormUtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3048
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormUtilsService, providedIn: 'root' }); }
|
|
2865
3049
|
}
|
|
3050
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormUtilsService, decorators: [{
|
|
3051
|
+
type: Injectable,
|
|
3052
|
+
args: [{
|
|
3053
|
+
providedIn: 'root',
|
|
3054
|
+
}]
|
|
3055
|
+
}] });
|
|
2866
3056
|
|
|
2867
3057
|
const MoodStateOptions = [
|
|
2868
3058
|
// Emociones básicas y fundamentales
|
|
@@ -2913,5 +3103,5 @@ const MoodStateOptions = [
|
|
|
2913
3103
|
* Generated bundle index. Do not edit.
|
|
2914
3104
|
*/
|
|
2915
3105
|
|
|
2916
|
-
export { AudioSpeed, AudioSpeedReverse, ChatUserSettings, ConfirmComponent, ConfirmService, DCFilterBarComponent, DCProgressToastComponent, DcAuditableViewerComponent, DcExtensionsViewerComponent, DcLearnableViewerComponent, DcManageableViewerComponent, DcReactionsViewerComponent, EModelQuality, EmptyStateComponent, EntityBaseFormComponent, EntityBaseListComponent, EntityCommunicationService, GetPathPipe, HTTP_CORE_CONFIG, HttpCoreService, IAIModel, LANGUAGES, LoadingBarComponent, LoadingBarService, ModelQualityOptions, MoodStateOptions, OptionValue, PaginationBase, PromptService, QuickTableComponent, SUPPORTED_LANGUAGES, TOAST_ALERTS_TOKEN, ToastAlertsAbstractService, UiStateService, availibleFilters, extractJsonFromString, formatCamelCaseString, getLangDesc, getSupportedLanguageOptions, provideToastAlert, sortOptions, sortTypes };
|
|
3106
|
+
export { AudioSpeed, AudioSpeedReverse, ChatUserSettings, ConfirmComponent, ConfirmService, DCFilterBarComponent, DCProgressToastComponent, DcAuditableViewerComponent, DcExtensionsViewerComponent, DcLearnableFormComponent, DcLearnableViewerComponent, DcManageableFormComponent, DcManageableViewerComponent, DcReactionsViewerComponent, EModelQuality, EmptyStateComponent, EntityBaseFormComponent, EntityBaseListComponent, EntityCommunicationService, FormUtilsService, GetPathPipe, HTTP_CORE_CONFIG, HttpCoreService, IAIModel, LANGUAGES, LangDescTranslation, LoadingBarComponent, LoadingBarService, ModelQualityOptions, MoodStateOptions, OptionValue, PaginationBase, PromptService, QuickTableComponent, SUPPORTED_LANGUAGES, TOAST_ALERTS_TOKEN, ToastAlertsAbstractService, UiStateService, availibleFilters, extractJsonFromString, formatCamelCaseString, getLangDesc, getSupportedLanguageOptions, provideToastAlert, sortOptions, sortTypes };
|
|
2917
3107
|
//# sourceMappingURL=dataclouder-ngx-core.mjs.map
|