@seniorsistemas/angular-components 17.16.6 → 17.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 +41 -39
- 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/slider/slider.component.d.ts +1 -0
- package/esm2015/components/slider/slider.component.js +41 -40
- package/esm5/components/slider/slider.component.js +42 -40
- package/fesm2015/seniorsistemas-angular-components.js +40 -39
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +41 -39
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -18582,12 +18582,15 @@ var SliderComponent = /** @class */ (function () {
|
|
|
18582
18582
|
this.setUserRangeMapValues();
|
|
18583
18583
|
};
|
|
18584
18584
|
SliderComponent.prototype.ngOnChanges = function (changes) {
|
|
18585
|
+
var _this = this;
|
|
18585
18586
|
var hasChangesOnMin = changes.min && !changes.min.firstChange;
|
|
18586
18587
|
var hasChangesOnMax = changes.max && !changes.max.firstChange;
|
|
18587
18588
|
var hasChanges = hasChangesOnMin || hasChangesOnMax;
|
|
18588
18589
|
if (hasChanges) {
|
|
18589
18590
|
this.setUserRangeMapValues();
|
|
18590
|
-
|
|
18591
|
+
setTimeout(function () {
|
|
18592
|
+
_this.setRangeValues();
|
|
18593
|
+
});
|
|
18591
18594
|
}
|
|
18592
18595
|
};
|
|
18593
18596
|
SliderComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -18626,6 +18629,7 @@ var SliderComponent = /** @class */ (function () {
|
|
|
18626
18629
|
});
|
|
18627
18630
|
SliderComponent.prototype.writeValue = function (obj) {
|
|
18628
18631
|
this.value = obj;
|
|
18632
|
+
this.setRangeValues();
|
|
18629
18633
|
};
|
|
18630
18634
|
SliderComponent.prototype.registerOnChange = function (fn) {
|
|
18631
18635
|
this.onChange = fn;
|
|
@@ -18743,6 +18747,9 @@ var SliderComponent = /** @class */ (function () {
|
|
|
18743
18747
|
_this.startValue = _this.getClosestValueFromMapSlider(startValue);
|
|
18744
18748
|
_this.endValue = _this.getClosestValueFromMapSlider(endValue);
|
|
18745
18749
|
};
|
|
18750
|
+
if (this.value === null || this.value === undefined) {
|
|
18751
|
+
return;
|
|
18752
|
+
}
|
|
18746
18753
|
if (Array.isArray(this.value) && !this.multiple) {
|
|
18747
18754
|
throw new Error('You must use "multiple" with value as array');
|
|
18748
18755
|
}
|
|
@@ -18750,48 +18757,43 @@ var SliderComponent = /** @class */ (function () {
|
|
|
18750
18757
|
this.startValue = this.value[0];
|
|
18751
18758
|
this.endValue = this.value[1];
|
|
18752
18759
|
}
|
|
18753
|
-
else if (this.multiple && !Array.isArray(this.value)) {
|
|
18754
|
-
this.value = [this.startValue, this.endValue];
|
|
18755
|
-
}
|
|
18756
18760
|
else if (!this.multiple) {
|
|
18757
18761
|
this.startValue = this.value;
|
|
18758
18762
|
this.endValue = this.value;
|
|
18759
18763
|
}
|
|
18760
|
-
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
_startValue = _endValue - difference;
|
|
18771
|
-
}
|
|
18772
|
-
else if (startValueIsLessThanMin) {
|
|
18773
|
-
_startValue = this.min;
|
|
18774
|
-
_endValue = _startValue + difference;
|
|
18775
|
-
}
|
|
18776
|
-
if (needUpdateValues) {
|
|
18777
|
-
_setStartAndEndValue(_startValue, _endValue);
|
|
18778
|
-
this.setValue([this.startValue, this.endValue]);
|
|
18779
|
-
}
|
|
18764
|
+
_setStartAndEndValue(this.startValue, this.endValue);
|
|
18765
|
+
if (this.multiple) {
|
|
18766
|
+
var _a = __read(this.value, 2), _startValue = _a[0], _endValue = _a[1];
|
|
18767
|
+
var difference = getDifference(_endValue, _startValue);
|
|
18768
|
+
var endValueIsGreatherThanMax = _endValue > this.max;
|
|
18769
|
+
var startValueIsLessThanMin = _startValue < this.min;
|
|
18770
|
+
var needUpdateValues = endValueIsGreatherThanMax || startValueIsLessThanMin;
|
|
18771
|
+
if (endValueIsGreatherThanMax) {
|
|
18772
|
+
_endValue = this.max;
|
|
18773
|
+
_startValue = _endValue - difference;
|
|
18780
18774
|
}
|
|
18781
|
-
else {
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18775
|
+
else if (startValueIsLessThanMin) {
|
|
18776
|
+
_startValue = this.min;
|
|
18777
|
+
_endValue = _startValue + difference;
|
|
18778
|
+
}
|
|
18779
|
+
if (needUpdateValues) {
|
|
18780
|
+
_setStartAndEndValue(_startValue, _endValue);
|
|
18781
|
+
this.setValue([this.startValue, this.endValue]);
|
|
18782
|
+
}
|
|
18783
|
+
}
|
|
18784
|
+
else {
|
|
18785
|
+
var _value = this.value;
|
|
18786
|
+
var valueGreatherThanMax = _value > this.max;
|
|
18787
|
+
var valueLessThanMin = _value < this.min;
|
|
18788
|
+
var needUpdateValue = valueGreatherThanMax || valueLessThanMin;
|
|
18789
|
+
if (valueGreatherThanMax) {
|
|
18790
|
+
_value = this.max;
|
|
18791
|
+
}
|
|
18792
|
+
else if (valueLessThanMin) {
|
|
18793
|
+
_value = this.min;
|
|
18794
|
+
}
|
|
18795
|
+
if (needUpdateValue) {
|
|
18796
|
+
this.setValue(_value, false);
|
|
18795
18797
|
}
|
|
18796
18798
|
}
|
|
18797
18799
|
this.setProgress();
|
|
@@ -19041,7 +19043,7 @@ var SliderComponent = /** @class */ (function () {
|
|
|
19041
19043
|
SliderComponent = SliderComponent_1 = __decorate([
|
|
19042
19044
|
Component({
|
|
19043
19045
|
selector: "s-slider",
|
|
19044
|
-
template: "<div\n class=\"slider-container\"\n [ngClass]=\"{ 'slider-container--disabled': disabled }\"\n [tabindex]=\"tabindex\"\n (click)=\"onTrackClick($event)\"\n (focus)=\"onFocusIn()\"\n (blur)=\"onBlur()\">\n <div\n #track\n class=\"slider-track\"\n [ngClass]=\"{\n 'slider-track--hidden-thumb': hiddenThumb,\n 'slider-track--moving-multiple-thumbs': movingProgressBar\n }\">\n <div\n class=\"slider-progress\"\n (mousedown)=\"onProgressMouseDown($event)\"\n [style.left.%]=\"progressLeft\"\n [style.width]=\"progressWidth\"\n ></div>\n <div\n *ngIf=\"multiple\"\n class=\"slider-thumb\"\n [sTooltip]=\"tooltipStartText\"\n (mousedown)=\"onMouseDown($event, 'start')\"\n [style.left.%]=\"startValue\"\n ></div>\n <div\n [sTooltip]=\"tooltipEndText\"\n class=\"slider-thumb\"\n (mousedown)=\"onMouseDown($event, 'end')\"\n [style.left.%]=\"endValue\"></div>\n </div>\n <div class=\"footer\">\n <span>{{ minValueLabel || min }}</span>\n <span>{{ maxValueLabel || max }}</span>\n </div>\n</div>\n",
|
|
19046
|
+
template: "<div\n class=\"slider-container\"\n [ngClass]=\"{ 'slider-container--disabled': disabled }\"\n [tabindex]=\"tabindex\"\n (click)=\"onTrackClick($event)\"\n (focus)=\"onFocusIn()\"\n (blur)=\"onBlur()\">\n <div\n #track\n class=\"slider-track\"\n [ngClass]=\"{\n 'slider-track--hidden-thumb': hiddenThumb,\n 'slider-track--moving-multiple-thumbs': movingProgressBar\n }\">\n <div\n class=\"slider-progress\"\n (mousedown)=\"onProgressMouseDown($event)\"\n [style.left.%]=\"progressLeft\"\n [style.width]=\"progressWidth\"\n ></div>\n <div\n *ngIf=\"multiple\"\n class=\"slider-thumb\"\n [sTooltip]=\"tooltipStartText\"\n [showDelay]=\"0\"\n (mousedown)=\"onMouseDown($event, 'start')\"\n [style.left.%]=\"startValue\"\n ></div>\n <div\n [sTooltip]=\"tooltipEndText\"\n class=\"slider-thumb\"\n [showDelay]=\"0\"\n (mousedown)=\"onMouseDown($event, 'end')\"\n [style.left.%]=\"endValue\"></div>\n </div>\n <div class=\"footer\">\n <span>{{ minValueLabel || min }}</span>\n <span>{{ maxValueLabel || max }}</span>\n </div>\n</div>\n",
|
|
19045
19047
|
providers: [
|
|
19046
19048
|
{
|
|
19047
19049
|
provide: NG_VALUE_ACCESSOR,
|