intelica-library-ui 0.1.140 → 0.1.142
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/intelica-library-ui.mjs +55 -4
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/components/multi-select/multi-select.component.d.ts +5 -4
- package/lib/dto/ElementResponse.d.ts +5 -0
- package/lib/services/element.service.d.ts +15 -0
- package/lib/services/pageElement.service.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject } from '@angular/core';
|
|
3
3
|
import { getCookie, Cookies, setCookie } from 'typescript-cookie';
|
|
4
4
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
|
-
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, tap, map } from 'rxjs';
|
|
6
6
|
import Swal from 'sweetalert2';
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
@@ -2829,6 +2829,12 @@ class MultiSelectComponent {
|
|
|
2829
2829
|
selectedOptions = [];
|
|
2830
2830
|
onChangeFn = () => { };
|
|
2831
2831
|
onTouchedFn = () => { };
|
|
2832
|
+
ngAfterViewInit() {
|
|
2833
|
+
if (this.options.some(option => typeof option !== "object")) {
|
|
2834
|
+
this.optionValue = undefined;
|
|
2835
|
+
this.optionLabel = undefined;
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2832
2838
|
writeValue(value) {
|
|
2833
2839
|
this.selectedOptions = value || [];
|
|
2834
2840
|
this.checked = this.selectedOptions.length === this.options.length;
|
|
@@ -2843,13 +2849,20 @@ class MultiSelectComponent {
|
|
|
2843
2849
|
/* opcional: implementar si necesitas deshabilitar el componente desde ngModel */
|
|
2844
2850
|
}
|
|
2845
2851
|
toggleAllSelection(event) {
|
|
2846
|
-
|
|
2852
|
+
if (!event.checked) {
|
|
2853
|
+
this.selectedOptions = [];
|
|
2854
|
+
}
|
|
2855
|
+
else {
|
|
2856
|
+
this.options.map(option => option[this.optionValue]);
|
|
2857
|
+
if (this.options.some(option => typeof option !== "object")) {
|
|
2858
|
+
this.selectedOptions = this.options;
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2847
2861
|
this.emitChangeEvent();
|
|
2848
2862
|
this.onChangeFn(this.selectedOptions);
|
|
2849
2863
|
this.onTouchedFn();
|
|
2850
2864
|
}
|
|
2851
2865
|
onChangeSelect(event) {
|
|
2852
|
-
console.log("onChange -> ", event);
|
|
2853
2866
|
this.checked = this.selectedOptions.length === this.options.length;
|
|
2854
2867
|
this.emitChangeEvent();
|
|
2855
2868
|
this.onChangeFn(this.selectedOptions);
|
|
@@ -5476,6 +5489,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
5476
5489
|
args: [{ providedIn: "root" }]
|
|
5477
5490
|
}] });
|
|
5478
5491
|
|
|
5492
|
+
class PageElementService {
|
|
5493
|
+
_http = inject(HttpClient);
|
|
5494
|
+
_configService = inject(ConfigService);
|
|
5495
|
+
GetElements(pageRoot) {
|
|
5496
|
+
return this._http.get(`${this._configService.environment?.securityPath}/Page/GetAvailableElementsByPageRoot/${pageRoot}`);
|
|
5497
|
+
}
|
|
5498
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: PageElementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5499
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: PageElementService, providedIn: "root" });
|
|
5500
|
+
}
|
|
5501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: PageElementService, decorators: [{
|
|
5502
|
+
type: Injectable,
|
|
5503
|
+
args: [{ providedIn: "root" }]
|
|
5504
|
+
}] });
|
|
5505
|
+
|
|
5506
|
+
class ElementService {
|
|
5507
|
+
Elements = [];
|
|
5508
|
+
PageRoot = "";
|
|
5509
|
+
pageElementService = inject(PageElementService);
|
|
5510
|
+
Initialize$(pageRootValue) {
|
|
5511
|
+
if (!pageRootValue)
|
|
5512
|
+
return of();
|
|
5513
|
+
this.PageRoot = pageRootValue;
|
|
5514
|
+
return this.pageElementService.GetElements(this.PageRoot).pipe(tap(elements => (this.Elements = elements)), map(() => void 0));
|
|
5515
|
+
}
|
|
5516
|
+
/**
|
|
5517
|
+
* Verify if page has available element by description
|
|
5518
|
+
*/
|
|
5519
|
+
HasElement(description) {
|
|
5520
|
+
return this.Elements.some(x => x.elementDescription === description);
|
|
5521
|
+
}
|
|
5522
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ElementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5523
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ElementService, providedIn: "root" });
|
|
5524
|
+
}
|
|
5525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ElementService, decorators: [{
|
|
5526
|
+
type: Injectable,
|
|
5527
|
+
args: [{ providedIn: "root" }]
|
|
5528
|
+
}] });
|
|
5529
|
+
|
|
5479
5530
|
/**
|
|
5480
5531
|
* Función de comparación genérica para ordenar objetos por un campo específico.
|
|
5481
5532
|
*
|
|
@@ -7861,5 +7912,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
7861
7912
|
* Generated bundle index. Do not edit.
|
|
7862
7913
|
*/
|
|
7863
7914
|
|
|
7864
|
-
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DateFilterDirective, DateModeOptions, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
7915
|
+
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DateFilterDirective, DateModeOptions, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
7865
7916
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|