@seniorsistemas/angular-components 14.16.4 → 14.16.7
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 +37 -7
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/custom-fields/custom-fields.component.d.ts +6 -3
- package/components/dynamic-form/configurations/fields/select-field.d.ts +2 -0
- package/components/table/frozen-position/frozen-position.directive.d.ts +5 -2
- package/esm2015/components/custom-fields/custom-fields.component.js +22 -12
- package/esm2015/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
- package/esm2015/components/dynamic-form/configurations/fields/select-field.js +2 -1
- package/esm2015/components/table/frozen-position/frozen-position.directive.js +13 -2
- package/esm5/components/custom-fields/custom-fields.component.js +30 -12
- package/esm5/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
- package/esm5/components/dynamic-form/configurations/fields/select-field.js +2 -1
- package/esm5/components/table/frozen-position/frozen-position.directive.js +13 -2
- package/fesm2015/seniorsistemas-angular-components.js +31 -9
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +39 -9
- 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 { __spread, __assign, __decorate, __extends, __rest, __values, __param, __awaiter, __generator, __read } from 'tslib';
|
|
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';
|
|
2
|
+
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, ElementRef, InjectionToken, Inject, Optional, 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';
|
|
@@ -10,7 +10,7 @@ import { TooltipModule } from 'primeng/tooltip';
|
|
|
10
10
|
import { DomHandler } from 'primeng/dom';
|
|
11
11
|
import { Calendar, CalendarModule } from 'primeng/calendar';
|
|
12
12
|
import { trigger, state, style as style$7, transition, animate, group, query, animateChild } from '@angular/animations';
|
|
13
|
-
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray } from '@angular/forms';
|
|
13
|
+
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray, ControlContainer } from '@angular/forms';
|
|
14
14
|
import { HttpClient, HttpEventType, HttpClientModule } from '@angular/common/http';
|
|
15
15
|
import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
|
|
16
16
|
import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
|
|
@@ -1868,6 +1868,7 @@ var SelectField = /** @class */ (function (_super) {
|
|
|
1868
1868
|
_this.multipleSelectedLabel = config.multipleSelectedLabel || "{0} registros selecionados";
|
|
1869
1869
|
_this.onClick = config.onClick;
|
|
1870
1870
|
_this.onChange = config.onChange;
|
|
1871
|
+
_this.emptyMessage = config.emptyMessage;
|
|
1871
1872
|
return _this;
|
|
1872
1873
|
}
|
|
1873
1874
|
return SelectField;
|
|
@@ -3804,7 +3805,9 @@ var TableFrozenPositionDirective = /** @class */ (function () {
|
|
|
3804
3805
|
this.el = el;
|
|
3805
3806
|
this.host = host;
|
|
3806
3807
|
this.sTableFrozenPosition = "left";
|
|
3808
|
+
this.isTableVisible = false;
|
|
3807
3809
|
this.onColumnsChanged = new EventEmitter();
|
|
3810
|
+
this.table = host;
|
|
3808
3811
|
this.host.onColResize.subscribe(function () {
|
|
3809
3812
|
_this.handleColResize();
|
|
3810
3813
|
});
|
|
@@ -3840,6 +3843,15 @@ var TableFrozenPositionDirective = /** @class */ (function () {
|
|
|
3840
3843
|
this.applyStylesForTable();
|
|
3841
3844
|
this.setUpColumnMonitoring();
|
|
3842
3845
|
};
|
|
3846
|
+
TableFrozenPositionDirective.prototype.ngAfterContentChecked = function () {
|
|
3847
|
+
if (!this.isTableVisible && !!this.table.el.nativeElement.offsetParent) {
|
|
3848
|
+
this.isTableVisible = true;
|
|
3849
|
+
this.synchronizeRowHeight();
|
|
3850
|
+
}
|
|
3851
|
+
else if (this.isTableVisible && !this.table.el.nativeElement.offsetParent) {
|
|
3852
|
+
this.isTableVisible = false;
|
|
3853
|
+
}
|
|
3854
|
+
};
|
|
3843
3855
|
TableFrozenPositionDirective.prototype.ngOnDestroy = function () {
|
|
3844
3856
|
window.removeEventListener("resize", this.handleWindowResize.bind(this));
|
|
3845
3857
|
if (this.tableHeadObservable) {
|
|
@@ -4757,7 +4769,7 @@ var SelectFieldComponent = /** @class */ (function (_super) {
|
|
|
4757
4769
|
], SelectFieldComponent.prototype, "formControl", void 0);
|
|
4758
4770
|
SelectFieldComponent = __decorate([
|
|
4759
4771
|
Component({
|
|
4760
|
-
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo
|
|
4772
|
+
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-multiSelect>\n\n"
|
|
4761
4773
|
})
|
|
4762
4774
|
], SelectFieldComponent);
|
|
4763
4775
|
return SelectFieldComponent;
|
|
@@ -5511,11 +5523,12 @@ var CustomFieldType;
|
|
|
5511
5523
|
})(CustomFieldType || (CustomFieldType = {}));
|
|
5512
5524
|
var moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
5513
5525
|
var CustomFieldsComponent = /** @class */ (function () {
|
|
5514
|
-
function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService) {
|
|
5526
|
+
function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService, controlContainer) {
|
|
5515
5527
|
this.customFieldsService = customFieldsService;
|
|
5516
5528
|
this.localeService = localeService;
|
|
5517
5529
|
this.sanitizer = sanitizer;
|
|
5518
5530
|
this.translateService = translateService;
|
|
5531
|
+
this.controlContainer = controlContainer;
|
|
5519
5532
|
this.customFieldsEndpoint = "platform/field_customization/queries/getEntity";
|
|
5520
5533
|
this.fileLocationEndpoint = "platform/field_customization/actions/requestUpload";
|
|
5521
5534
|
this.requestAccessEndpoint = "platform/field_customization/actions/requestAccess";
|
|
@@ -5524,6 +5537,20 @@ var CustomFieldsComponent = /** @class */ (function () {
|
|
|
5524
5537
|
this.ngUsubscribe = new Subject();
|
|
5525
5538
|
}
|
|
5526
5539
|
CustomFieldsComponent_1 = CustomFieldsComponent;
|
|
5540
|
+
Object.defineProperty(CustomFieldsComponent.prototype, "parentForm", {
|
|
5541
|
+
get: function () {
|
|
5542
|
+
return this.controlContainer.control;
|
|
5543
|
+
},
|
|
5544
|
+
enumerable: true,
|
|
5545
|
+
configurable: true
|
|
5546
|
+
});
|
|
5547
|
+
Object.defineProperty(CustomFieldsComponent.prototype, "parentControl", {
|
|
5548
|
+
get: function () {
|
|
5549
|
+
return this.parentForm.get("custom");
|
|
5550
|
+
},
|
|
5551
|
+
enumerable: true,
|
|
5552
|
+
configurable: true
|
|
5553
|
+
});
|
|
5527
5554
|
CustomFieldsComponent.prototype.registerOnChange = function (fn) {
|
|
5528
5555
|
var _this = this;
|
|
5529
5556
|
this.onChange = fn;
|
|
@@ -5567,7 +5594,10 @@ var CustomFieldsComponent = /** @class */ (function () {
|
|
|
5567
5594
|
this.formGroup = new FormGroup({});
|
|
5568
5595
|
var observables = [this.getCustomFields(), this.localeService.get()];
|
|
5569
5596
|
forkJoin(observables)
|
|
5570
|
-
.pipe(takeUntil(this.ngUsubscribe))
|
|
5597
|
+
.pipe(takeUntil(this.ngUsubscribe), finalize(function () {
|
|
5598
|
+
_this.formGroup.markAsPristine();
|
|
5599
|
+
_this.parentControl.markAsPristine();
|
|
5600
|
+
}))
|
|
5571
5601
|
.subscribe(function (response) {
|
|
5572
5602
|
var _a = __read(response, 2), customFieldsResponse = _a[0], localeOptions = _a[1];
|
|
5573
5603
|
var defaults = {};
|
|
@@ -5614,13 +5644,11 @@ var CustomFieldsComponent = /** @class */ (function () {
|
|
|
5614
5644
|
validators.push(Validators.required);
|
|
5615
5645
|
}
|
|
5616
5646
|
var control = new FormControl({ value: defaults[fieldType].defaultValue, disabled: _this.formGroup.disabled }, validators);
|
|
5617
|
-
control.markAsDirty({ onlySelf: true });
|
|
5618
5647
|
_this.formGroup.addControl(formField.name, control);
|
|
5619
5648
|
_this.fields.push(formField);
|
|
5620
5649
|
});
|
|
5621
5650
|
_this.createFieldCustomization(fields);
|
|
5622
5651
|
_this.formGroup.patchValue(_this.parseValuesForFields(_this.value));
|
|
5623
|
-
_this.formGroup.markAsDirty({ onlySelf: true });
|
|
5624
5652
|
_this.ready = true;
|
|
5625
5653
|
});
|
|
5626
5654
|
};
|
|
@@ -5985,7 +6013,8 @@ var CustomFieldsComponent = /** @class */ (function () {
|
|
|
5985
6013
|
{ type: CustomFieldsService },
|
|
5986
6014
|
{ type: LocaleService },
|
|
5987
6015
|
{ type: DomSanitizer },
|
|
5988
|
-
{ type: TranslateService }
|
|
6016
|
+
{ type: TranslateService },
|
|
6017
|
+
{ type: ControlContainer, decorators: [{ type: Optional }] }
|
|
5989
6018
|
]; };
|
|
5990
6019
|
__decorate([
|
|
5991
6020
|
Input()
|
|
@@ -6030,7 +6059,8 @@ var CustomFieldsComponent = /** @class */ (function () {
|
|
|
6030
6059
|
multi: true,
|
|
6031
6060
|
},
|
|
6032
6061
|
]
|
|
6033
|
-
})
|
|
6062
|
+
}),
|
|
6063
|
+
__param(4, Optional())
|
|
6034
6064
|
], CustomFieldsComponent);
|
|
6035
6065
|
return CustomFieldsComponent;
|
|
6036
6066
|
}());
|