@seniorsistemas/angular-components 17.3.4 → 17.3.6
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 +26 -4
- 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/dynamic-form/components/fields/slider/slider-field.component.d.ts +4 -0
- package/esm2015/components/dynamic-form/components/fields/slider/slider-field.component.js +26 -3
- package/esm2015/components/tiered-menu/tiered-menu.module.js +1 -3
- package/esm5/components/dynamic-form/components/fields/slider/slider-field.component.js +27 -4
- package/esm5/components/tiered-menu/tiered-menu.module.js +1 -3
- package/fesm2015/seniorsistemas-angular-components.js +26 -4
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +27 -5
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -48,7 +48,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
|
|
|
48
48
|
import { SliderModule } from 'primeng/slider';
|
|
49
49
|
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
50
50
|
import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
|
|
51
|
-
import { DomSanitizer
|
|
51
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
52
52
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
53
53
|
import Cropper from 'cropperjs';
|
|
54
54
|
import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
|
|
@@ -8906,8 +8906,15 @@ var SliderFieldComponent = /** @class */ (function (_super) {
|
|
|
8906
8906
|
return _this;
|
|
8907
8907
|
}
|
|
8908
8908
|
SliderFieldComponent.prototype.ngOnInit = function () {
|
|
8909
|
-
var _this = this;
|
|
8910
8909
|
var _a, _b;
|
|
8910
|
+
var defaultValue = ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) ? [this.field.min, this.field.max] : this.field.min;
|
|
8911
|
+
if (!this.isValid(this.formControl.value)) {
|
|
8912
|
+
this.formControl.setValue((_b = this.field.defaultValue) !== null && _b !== void 0 ? _b : defaultValue);
|
|
8913
|
+
}
|
|
8914
|
+
this.subscribeToFormControlEvents();
|
|
8915
|
+
};
|
|
8916
|
+
SliderFieldComponent.prototype.subscribeToFormControlEvents = function () {
|
|
8917
|
+
var _this = this;
|
|
8911
8918
|
this.onChange.pipe(takeUntil(this.ngUnsubscribe))
|
|
8912
8919
|
.subscribe(function (event) {
|
|
8913
8920
|
if (_this.field.onChange) {
|
|
@@ -8920,8 +8927,24 @@ var SliderFieldComponent = /** @class */ (function (_super) {
|
|
|
8920
8927
|
_this.field.onSlideEnd(event);
|
|
8921
8928
|
}
|
|
8922
8929
|
});
|
|
8923
|
-
|
|
8924
|
-
|
|
8930
|
+
};
|
|
8931
|
+
SliderFieldComponent.prototype.isValid = function (value) {
|
|
8932
|
+
var _a;
|
|
8933
|
+
if ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) {
|
|
8934
|
+
return Array.isArray(value) && this.isValidRange(value);
|
|
8935
|
+
}
|
|
8936
|
+
else {
|
|
8937
|
+
return Number.isInteger(value) && this.isValidNoRange(value);
|
|
8938
|
+
}
|
|
8939
|
+
};
|
|
8940
|
+
SliderFieldComponent.prototype.isValidRange = function (value) {
|
|
8941
|
+
var _a, _b, _c, _d;
|
|
8942
|
+
var _e = __read(value, 2), startValue = _e[0], endValue = _e[1];
|
|
8943
|
+
return startValue >= ((_a = this.field) === null || _a === void 0 ? void 0 : _a.min) && startValue <= ((_b = this.field) === null || _b === void 0 ? void 0 : _b.max) &&
|
|
8944
|
+
endValue >= ((_c = this.field) === null || _c === void 0 ? void 0 : _c.min) && endValue <= ((_d = this.field) === null || _d === void 0 ? void 0 : _d.max);
|
|
8945
|
+
};
|
|
8946
|
+
SliderFieldComponent.prototype.isValidNoRange = function (value) {
|
|
8947
|
+
return value >= this.field.min && value <= this.field.max;
|
|
8925
8948
|
};
|
|
8926
8949
|
SliderFieldComponent.prototype.ngOnDestroy = function () {
|
|
8927
8950
|
this.ngUnsubscribe.next();
|
|
@@ -15690,7 +15713,6 @@ var TieredMenuModule = /** @class */ (function () {
|
|
|
15690
15713
|
NgModule({
|
|
15691
15714
|
imports: [
|
|
15692
15715
|
CommonModule,
|
|
15693
|
-
BrowserModule,
|
|
15694
15716
|
],
|
|
15695
15717
|
declarations: [
|
|
15696
15718
|
TieredMenuDirective,
|