@seniorsistemas/angular-components 14.11.0 → 14.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-angular-components.umd.js +190 -2
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/table/frozen-position/frozen-position.directive.d.ts +22 -0
- package/components/table/index.d.ts +1 -0
- package/esm2015/components/table/frozen-position/frozen-position.directive.js +129 -0
- package/esm2015/components/table/index.js +2 -1
- package/esm2015/components/table/table.module.js +6 -3
- package/esm5/components/table/frozen-position/frozen-position.directive.js +189 -0
- package/esm5/components/table/index.js +2 -1
- package/esm5/components/table/table.module.js +6 -3
- package/fesm2015/seniorsistemas-angular-components.js +131 -4
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +191 -4
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param, __awaiter } from 'tslib';
|
|
2
|
-
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, InjectionToken, Inject, ContentChild, ApplicationRef, Injector,
|
|
2
|
+
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, ElementRef, InjectionToken, Inject, ContentChild, ApplicationRef, Injector, ContentChildren } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
@@ -3427,6 +3427,131 @@ RowTogllerDirective = __decorate([
|
|
|
3427
3427
|
Directive({ selector: "[sRowToggler]" })
|
|
3428
3428
|
], RowTogllerDirective);
|
|
3429
3429
|
|
|
3430
|
+
let TableFrozenPositionDirective = class TableFrozenPositionDirective {
|
|
3431
|
+
constructor(el, host) {
|
|
3432
|
+
this.el = el;
|
|
3433
|
+
this.host = host;
|
|
3434
|
+
this.sTableFrozenPosition = "left";
|
|
3435
|
+
this.host.onColResize.subscribe(() => {
|
|
3436
|
+
this.handleColResize();
|
|
3437
|
+
});
|
|
3438
|
+
window.addEventListener("resize", this.handleWindowResize.bind(this));
|
|
3439
|
+
const componentId = new Date().getTime();
|
|
3440
|
+
this.resetRowHeightClassName = `resetTableRowsHeight_${componentId}`;
|
|
3441
|
+
const styleReset = document.createElement("style");
|
|
3442
|
+
styleReset.innerHTML = `.${this.resetRowHeightClassName} tbody > tr, .${this.resetRowHeightClassName} thead > tr { height: auto; }`;
|
|
3443
|
+
document.getElementsByTagName("head")[0].appendChild(styleReset);
|
|
3444
|
+
this.fixBodyRowClassName = `fixTableBodyRowsHeight_${componentId}`;
|
|
3445
|
+
this.styleFixBodyRowHeight = document.createElement("style");
|
|
3446
|
+
this.styleFixBodyRowHeight.innerHTML = `.${this.fixBodyRowClassName} tbody > tr { height: auto; }`;
|
|
3447
|
+
document.getElementsByTagName("head")[0].appendChild(this.styleFixBodyRowHeight);
|
|
3448
|
+
this.fixHeadRowClassName = `fixTableHeadRowsHeight_${componentId}`;
|
|
3449
|
+
this.styleFixHeadRowHeight = document.createElement("style");
|
|
3450
|
+
this.styleFixHeadRowHeight.innerHTML = `.${this.fixHeadRowClassName} thead > tr { height: auto; }`;
|
|
3451
|
+
document.getElementsByTagName("head")[0].appendChild(this.styleFixHeadRowHeight);
|
|
3452
|
+
}
|
|
3453
|
+
set sTableFrozenValue(_) {
|
|
3454
|
+
setTimeout(() => {
|
|
3455
|
+
this.synchronizeRowHeight();
|
|
3456
|
+
});
|
|
3457
|
+
}
|
|
3458
|
+
ngAfterViewInit() {
|
|
3459
|
+
if (this.sTableFrozenPosition === "left")
|
|
3460
|
+
return;
|
|
3461
|
+
this.applyStylesForTable();
|
|
3462
|
+
}
|
|
3463
|
+
ngOnDestroy() {
|
|
3464
|
+
window.removeEventListener("resize", this.handleWindowResize.bind(this));
|
|
3465
|
+
}
|
|
3466
|
+
applyStylesForTable() {
|
|
3467
|
+
const scrollWrapper = this.el.nativeElement.querySelector(".ui-table-scrollable-wrapper");
|
|
3468
|
+
if (!scrollWrapper) {
|
|
3469
|
+
console.warn("Unable to find scroll-wrapper element from table. Is the table configured with frozen template?");
|
|
3470
|
+
return;
|
|
3471
|
+
}
|
|
3472
|
+
scrollWrapper.style.display = "flex";
|
|
3473
|
+
scrollWrapper.style.flexDirection = "row";
|
|
3474
|
+
const frozenTable = this.el.nativeElement.querySelector(".ui-table-frozen-view");
|
|
3475
|
+
if (!frozenTable) {
|
|
3476
|
+
console.warn("Unable to find frozen element from table. Is the table configured with frozen template?");
|
|
3477
|
+
return;
|
|
3478
|
+
}
|
|
3479
|
+
frozenTable.style.order = "1";
|
|
3480
|
+
frozenTable.style.borderRight = "none";
|
|
3481
|
+
frozenTable.style.borderLeft = "1px solid #dddddd";
|
|
3482
|
+
frozenTable.style.boxShadow = "-5px 0 5px -5px #cccccc";
|
|
3483
|
+
const unfrozenTable = this.el.nativeElement.querySelector(".ui-table-unfrozen-view");
|
|
3484
|
+
if (!unfrozenTable) {
|
|
3485
|
+
console.warn("Unable to find unfrozen element from table. Is the table configured with frozen template?");
|
|
3486
|
+
return;
|
|
3487
|
+
}
|
|
3488
|
+
unfrozenTable.style.position = "unset";
|
|
3489
|
+
}
|
|
3490
|
+
handleWindowResize() {
|
|
3491
|
+
this.synchronizeRowHeight();
|
|
3492
|
+
}
|
|
3493
|
+
handleColResize() {
|
|
3494
|
+
this.synchronizeRowHeight();
|
|
3495
|
+
}
|
|
3496
|
+
synchronizeRowHeight() {
|
|
3497
|
+
const tableBodyWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-body");
|
|
3498
|
+
const tableBodies = [...tableBodyWrappers].map(divWrapper => [...divWrapper.childNodes].find(p => p.tagName === "TABLE"));
|
|
3499
|
+
this.recalculateDefaultRowHeight(tableBodies);
|
|
3500
|
+
this.applyMaxRowHeight(tableBodies);
|
|
3501
|
+
const tableHeadWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-header-box");
|
|
3502
|
+
const tableHeads = [...tableHeadWrappers].map(divWrapper => [...divWrapper.childNodes].find(p => p.tagName === "TABLE"));
|
|
3503
|
+
this.recalculateDefaultRowHeight(tableHeads);
|
|
3504
|
+
this.applyMaxRowHeight(tableHeads, true);
|
|
3505
|
+
}
|
|
3506
|
+
recalculateDefaultRowHeight(tables) {
|
|
3507
|
+
for (const table of tables) {
|
|
3508
|
+
table.classList.remove(this.fixBodyRowClassName);
|
|
3509
|
+
table.classList.remove(this.fixHeadRowClassName);
|
|
3510
|
+
table.classList.add(this.resetRowHeightClassName);
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
applyMaxRowHeight(tables, isHead = false) {
|
|
3514
|
+
const rowSizes = [];
|
|
3515
|
+
for (const table of tables) {
|
|
3516
|
+
for (const tr of table.rows) {
|
|
3517
|
+
rowSizes.push(tr.getBoundingClientRect().height);
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
if (!rowSizes.length)
|
|
3521
|
+
return;
|
|
3522
|
+
const maxHeight = Math.max(...rowSizes);
|
|
3523
|
+
if (isHead) {
|
|
3524
|
+
this.styleFixHeadRowHeight.innerHTML = `.${this.fixHeadRowClassName} thead > tr { height: ${maxHeight}px; }`;
|
|
3525
|
+
for (const table of tables) {
|
|
3526
|
+
table.classList.remove(this.resetRowHeightClassName);
|
|
3527
|
+
table.classList.add(this.fixHeadRowClassName);
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
else {
|
|
3531
|
+
this.styleFixBodyRowHeight.innerHTML = `.${this.fixBodyRowClassName} tbody > tr { height: ${maxHeight}px; }`;
|
|
3532
|
+
for (const table of tables) {
|
|
3533
|
+
table.classList.remove(this.resetRowHeightClassName);
|
|
3534
|
+
table.classList.add(this.fixBodyRowClassName);
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
};
|
|
3539
|
+
TableFrozenPositionDirective.ctorParameters = () => [
|
|
3540
|
+
{ type: ElementRef },
|
|
3541
|
+
{ type: Table }
|
|
3542
|
+
];
|
|
3543
|
+
__decorate([
|
|
3544
|
+
Input()
|
|
3545
|
+
], TableFrozenPositionDirective.prototype, "sTableFrozenPosition", void 0);
|
|
3546
|
+
__decorate([
|
|
3547
|
+
Input()
|
|
3548
|
+
], TableFrozenPositionDirective.prototype, "sTableFrozenValue", null);
|
|
3549
|
+
TableFrozenPositionDirective = __decorate([
|
|
3550
|
+
Directive({
|
|
3551
|
+
selector: "[sTableFrozenPosition]"
|
|
3552
|
+
})
|
|
3553
|
+
], TableFrozenPositionDirective);
|
|
3554
|
+
|
|
3430
3555
|
var EnumColumnFieldType;
|
|
3431
3556
|
(function (EnumColumnFieldType) {
|
|
3432
3557
|
EnumColumnFieldType["STRING"] = "STRING";
|
|
@@ -3740,12 +3865,14 @@ TableModule = __decorate([
|
|
|
3740
3865
|
exports: [
|
|
3741
3866
|
RowTogllerDirective,
|
|
3742
3867
|
NavigationDirective,
|
|
3743
|
-
TableColumnsComponent
|
|
3868
|
+
TableColumnsComponent,
|
|
3869
|
+
TableFrozenPositionDirective
|
|
3744
3870
|
],
|
|
3745
3871
|
declarations: [
|
|
3746
3872
|
RowTogllerDirective,
|
|
3747
3873
|
NavigationDirective,
|
|
3748
|
-
TableColumnsComponent
|
|
3874
|
+
TableColumnsComponent,
|
|
3875
|
+
TableFrozenPositionDirective
|
|
3749
3876
|
],
|
|
3750
3877
|
})
|
|
3751
3878
|
], TableModule);
|
|
@@ -8050,5 +8177,5 @@ CodeEditorModule = __decorate([
|
|
|
8050
8177
|
* Generated bundle index. Do not edit.
|
|
8051
8178
|
*/
|
|
8052
8179
|
|
|
8053
|
-
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, DecimalField as ɵbb, StructureModule as ɵbc, HeaderComponent as ɵbd, FooterComponent as ɵbe, InfoSignComponent as ɵbf, NumberLocaleOptions as ɵbg, ThumbnailService as ɵbh, InfiniteScrollModule as ɵbi, InfiniteScrollDirective as ɵbj, CustomTranslationsModule as ɵbk, CodeEditorComponent as ɵbl, CoreFacade as ɵbm, CodeMirror6Core as ɵbn, LocalizedBignumberImpurePipe as ɵc, TokenListModule as ɵd, TableColumnsComponent as ɵe, InfoSignModule as ɵf, MouseEventsModule as ɵg, AutocompleteFieldComponent as ɵh, BooleanFieldComponent as ɵi, CalendarFieldComponent as ɵj, ChipsFieldComponent as ɵk, CurrencyFieldComponent as ɵl, BaseFieldComponent as ɵm, DynamicFieldComponent as ɵn, DynamicFormDirective as ɵo, FieldsetComponent as ɵp, FileUploadComponent$1 as ɵq, LookupFieldComponent as ɵr, NumberFieldComponent as ɵs, BignumberFieldComponent as ɵt, RadioButtonComponent as ɵu, RowComponent as ɵv, SectionComponent as ɵw, SelectFieldComponent as ɵx, TextAreaFieldComponent as ɵy, TextFieldComponent as ɵz };
|
|
8180
|
+
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, DecimalField as ɵbb, StructureModule as ɵbc, HeaderComponent as ɵbd, FooterComponent as ɵbe, InfoSignComponent as ɵbf, NumberLocaleOptions as ɵbg, ThumbnailService as ɵbh, InfiniteScrollModule as ɵbi, InfiniteScrollDirective as ɵbj, CustomTranslationsModule as ɵbk, CodeEditorComponent as ɵbl, CoreFacade as ɵbm, CodeMirror6Core as ɵbn, LocalizedBignumberImpurePipe as ɵc, TokenListModule as ɵd, TableColumnsComponent as ɵe, InfoSignModule as ɵf, MouseEventsModule as ɵg, AutocompleteFieldComponent as ɵh, BooleanFieldComponent as ɵi, CalendarFieldComponent as ɵj, ChipsFieldComponent as ɵk, CurrencyFieldComponent as ɵl, BaseFieldComponent as ɵm, DynamicFieldComponent as ɵn, DynamicFormDirective as ɵo, FieldsetComponent as ɵp, FileUploadComponent$1 as ɵq, LookupFieldComponent as ɵr, NumberFieldComponent as ɵs, BignumberFieldComponent as ɵt, RadioButtonComponent as ɵu, RowComponent as ɵv, SectionComponent as ɵw, SelectFieldComponent as ɵx, TextAreaFieldComponent as ɵy, TextFieldComponent as ɵz };
|
|
8054
8181
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|