@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.
@@ -1,5 +1,5 @@
1
1
  import { __spread, __assign, __decorate, __extends, __values, __param, __read, __awaiter, __generator } 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, ElementRef, ContentChildren } from '@angular/core';
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';
@@ -3685,6 +3685,191 @@ var RowTogllerDirective = /** @class */ (function (_super) {
3685
3685
  return RowTogllerDirective;
3686
3686
  }(RowToggler));
3687
3687
 
3688
+ var TableFrozenPositionDirective = /** @class */ (function () {
3689
+ function TableFrozenPositionDirective(el, host) {
3690
+ var _this = this;
3691
+ this.el = el;
3692
+ this.host = host;
3693
+ this.sTableFrozenPosition = "left";
3694
+ this.host.onColResize.subscribe(function () {
3695
+ _this.handleColResize();
3696
+ });
3697
+ window.addEventListener("resize", this.handleWindowResize.bind(this));
3698
+ var componentId = new Date().getTime();
3699
+ this.resetRowHeightClassName = "resetTableRowsHeight_" + componentId;
3700
+ var styleReset = document.createElement("style");
3701
+ styleReset.innerHTML = "." + this.resetRowHeightClassName + " tbody > tr, ." + this.resetRowHeightClassName + " thead > tr { height: auto; }";
3702
+ document.getElementsByTagName("head")[0].appendChild(styleReset);
3703
+ this.fixBodyRowClassName = "fixTableBodyRowsHeight_" + componentId;
3704
+ this.styleFixBodyRowHeight = document.createElement("style");
3705
+ this.styleFixBodyRowHeight.innerHTML = "." + this.fixBodyRowClassName + " tbody > tr { height: auto; }";
3706
+ document.getElementsByTagName("head")[0].appendChild(this.styleFixBodyRowHeight);
3707
+ this.fixHeadRowClassName = "fixTableHeadRowsHeight_" + componentId;
3708
+ this.styleFixHeadRowHeight = document.createElement("style");
3709
+ this.styleFixHeadRowHeight.innerHTML = "." + this.fixHeadRowClassName + " thead > tr { height: auto; }";
3710
+ document.getElementsByTagName("head")[0].appendChild(this.styleFixHeadRowHeight);
3711
+ }
3712
+ Object.defineProperty(TableFrozenPositionDirective.prototype, "sTableFrozenValue", {
3713
+ set: function (_) {
3714
+ var _this = this;
3715
+ setTimeout(function () {
3716
+ _this.synchronizeRowHeight();
3717
+ });
3718
+ },
3719
+ enumerable: true,
3720
+ configurable: true
3721
+ });
3722
+ TableFrozenPositionDirective.prototype.ngAfterViewInit = function () {
3723
+ if (this.sTableFrozenPosition === "left")
3724
+ return;
3725
+ this.applyStylesForTable();
3726
+ };
3727
+ TableFrozenPositionDirective.prototype.ngOnDestroy = function () {
3728
+ window.removeEventListener("resize", this.handleWindowResize.bind(this));
3729
+ };
3730
+ TableFrozenPositionDirective.prototype.applyStylesForTable = function () {
3731
+ var scrollWrapper = this.el.nativeElement.querySelector(".ui-table-scrollable-wrapper");
3732
+ if (!scrollWrapper) {
3733
+ console.warn("Unable to find scroll-wrapper element from table. Is the table configured with frozen template?");
3734
+ return;
3735
+ }
3736
+ scrollWrapper.style.display = "flex";
3737
+ scrollWrapper.style.flexDirection = "row";
3738
+ var frozenTable = this.el.nativeElement.querySelector(".ui-table-frozen-view");
3739
+ if (!frozenTable) {
3740
+ console.warn("Unable to find frozen element from table. Is the table configured with frozen template?");
3741
+ return;
3742
+ }
3743
+ frozenTable.style.order = "1";
3744
+ frozenTable.style.borderRight = "none";
3745
+ frozenTable.style.borderLeft = "1px solid #dddddd";
3746
+ frozenTable.style.boxShadow = "-5px 0 5px -5px #cccccc";
3747
+ var unfrozenTable = this.el.nativeElement.querySelector(".ui-table-unfrozen-view");
3748
+ if (!unfrozenTable) {
3749
+ console.warn("Unable to find unfrozen element from table. Is the table configured with frozen template?");
3750
+ return;
3751
+ }
3752
+ unfrozenTable.style.position = "unset";
3753
+ };
3754
+ TableFrozenPositionDirective.prototype.handleWindowResize = function () {
3755
+ this.synchronizeRowHeight();
3756
+ };
3757
+ TableFrozenPositionDirective.prototype.handleColResize = function () {
3758
+ this.synchronizeRowHeight();
3759
+ };
3760
+ TableFrozenPositionDirective.prototype.synchronizeRowHeight = function () {
3761
+ var tableBodyWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-body");
3762
+ var tableBodies = __spread(tableBodyWrappers).map(function (divWrapper) { return __spread(divWrapper.childNodes).find(function (p) { return p.tagName === "TABLE"; }); });
3763
+ this.recalculateDefaultRowHeight(tableBodies);
3764
+ this.applyMaxRowHeight(tableBodies);
3765
+ var tableHeadWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-header-box");
3766
+ var tableHeads = __spread(tableHeadWrappers).map(function (divWrapper) { return __spread(divWrapper.childNodes).find(function (p) { return p.tagName === "TABLE"; }); });
3767
+ this.recalculateDefaultRowHeight(tableHeads);
3768
+ this.applyMaxRowHeight(tableHeads, true);
3769
+ };
3770
+ TableFrozenPositionDirective.prototype.recalculateDefaultRowHeight = function (tables) {
3771
+ var e_1, _a;
3772
+ try {
3773
+ for (var tables_1 = __values(tables), tables_1_1 = tables_1.next(); !tables_1_1.done; tables_1_1 = tables_1.next()) {
3774
+ var table = tables_1_1.value;
3775
+ table.classList.remove(this.fixBodyRowClassName);
3776
+ table.classList.remove(this.fixHeadRowClassName);
3777
+ table.classList.add(this.resetRowHeightClassName);
3778
+ }
3779
+ }
3780
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3781
+ finally {
3782
+ try {
3783
+ if (tables_1_1 && !tables_1_1.done && (_a = tables_1.return)) _a.call(tables_1);
3784
+ }
3785
+ finally { if (e_1) throw e_1.error; }
3786
+ }
3787
+ };
3788
+ TableFrozenPositionDirective.prototype.applyMaxRowHeight = function (tables, isHead) {
3789
+ var e_2, _a, e_3, _b, e_4, _c, e_5, _d;
3790
+ if (isHead === void 0) { isHead = false; }
3791
+ var rowSizes = [];
3792
+ try {
3793
+ for (var tables_2 = __values(tables), tables_2_1 = tables_2.next(); !tables_2_1.done; tables_2_1 = tables_2.next()) {
3794
+ var table = tables_2_1.value;
3795
+ try {
3796
+ for (var _e = (e_3 = void 0, __values(table.rows)), _f = _e.next(); !_f.done; _f = _e.next()) {
3797
+ var tr = _f.value;
3798
+ rowSizes.push(tr.getBoundingClientRect().height);
3799
+ }
3800
+ }
3801
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
3802
+ finally {
3803
+ try {
3804
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
3805
+ }
3806
+ finally { if (e_3) throw e_3.error; }
3807
+ }
3808
+ }
3809
+ }
3810
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3811
+ finally {
3812
+ try {
3813
+ if (tables_2_1 && !tables_2_1.done && (_a = tables_2.return)) _a.call(tables_2);
3814
+ }
3815
+ finally { if (e_2) throw e_2.error; }
3816
+ }
3817
+ if (!rowSizes.length)
3818
+ return;
3819
+ var maxHeight = Math.max.apply(Math, __spread(rowSizes));
3820
+ if (isHead) {
3821
+ this.styleFixHeadRowHeight.innerHTML = "." + this.fixHeadRowClassName + " thead > tr { height: " + maxHeight + "px; }";
3822
+ try {
3823
+ for (var tables_3 = __values(tables), tables_3_1 = tables_3.next(); !tables_3_1.done; tables_3_1 = tables_3.next()) {
3824
+ var table = tables_3_1.value;
3825
+ table.classList.remove(this.resetRowHeightClassName);
3826
+ table.classList.add(this.fixHeadRowClassName);
3827
+ }
3828
+ }
3829
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
3830
+ finally {
3831
+ try {
3832
+ if (tables_3_1 && !tables_3_1.done && (_c = tables_3.return)) _c.call(tables_3);
3833
+ }
3834
+ finally { if (e_4) throw e_4.error; }
3835
+ }
3836
+ }
3837
+ else {
3838
+ this.styleFixBodyRowHeight.innerHTML = "." + this.fixBodyRowClassName + " tbody > tr { height: " + maxHeight + "px; }";
3839
+ try {
3840
+ for (var tables_4 = __values(tables), tables_4_1 = tables_4.next(); !tables_4_1.done; tables_4_1 = tables_4.next()) {
3841
+ var table = tables_4_1.value;
3842
+ table.classList.remove(this.resetRowHeightClassName);
3843
+ table.classList.add(this.fixBodyRowClassName);
3844
+ }
3845
+ }
3846
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
3847
+ finally {
3848
+ try {
3849
+ if (tables_4_1 && !tables_4_1.done && (_d = tables_4.return)) _d.call(tables_4);
3850
+ }
3851
+ finally { if (e_5) throw e_5.error; }
3852
+ }
3853
+ }
3854
+ };
3855
+ TableFrozenPositionDirective.ctorParameters = function () { return [
3856
+ { type: ElementRef },
3857
+ { type: Table }
3858
+ ]; };
3859
+ __decorate([
3860
+ Input()
3861
+ ], TableFrozenPositionDirective.prototype, "sTableFrozenPosition", void 0);
3862
+ __decorate([
3863
+ Input()
3864
+ ], TableFrozenPositionDirective.prototype, "sTableFrozenValue", null);
3865
+ TableFrozenPositionDirective = __decorate([
3866
+ Directive({
3867
+ selector: "[sTableFrozenPosition]"
3868
+ })
3869
+ ], TableFrozenPositionDirective);
3870
+ return TableFrozenPositionDirective;
3871
+ }());
3872
+
3688
3873
  var EnumColumnFieldType;
3689
3874
  (function (EnumColumnFieldType) {
3690
3875
  EnumColumnFieldType["STRING"] = "STRING";
@@ -4011,12 +4196,14 @@ var TableModule = /** @class */ (function () {
4011
4196
  exports: [
4012
4197
  RowTogllerDirective,
4013
4198
  NavigationDirective,
4014
- TableColumnsComponent
4199
+ TableColumnsComponent,
4200
+ TableFrozenPositionDirective
4015
4201
  ],
4016
4202
  declarations: [
4017
4203
  RowTogllerDirective,
4018
4204
  NavigationDirective,
4019
- TableColumnsComponent
4205
+ TableColumnsComponent,
4206
+ TableFrozenPositionDirective
4020
4207
  ],
4021
4208
  })
4022
4209
  ], TableModule);
@@ -8613,5 +8800,5 @@ var CodeEditorModule = /** @class */ (function () {
8613
8800
  * Generated bundle index. Do not edit.
8614
8801
  */
8615
8802
 
8616
- 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 };
8803
+ 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 };
8617
8804
  //# sourceMappingURL=seniorsistemas-angular-components.js.map