@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
|
@@ -18727,12 +18727,15 @@
|
|
|
18727
18727
|
this.setUserRangeMapValues();
|
|
18728
18728
|
};
|
|
18729
18729
|
SliderComponent.prototype.ngOnChanges = function (changes) {
|
|
18730
|
+
var _this = this;
|
|
18730
18731
|
var hasChangesOnMin = changes.min && !changes.min.firstChange;
|
|
18731
18732
|
var hasChangesOnMax = changes.max && !changes.max.firstChange;
|
|
18732
18733
|
var hasChanges = hasChangesOnMin || hasChangesOnMax;
|
|
18733
18734
|
if (hasChanges) {
|
|
18734
18735
|
this.setUserRangeMapValues();
|
|
18735
|
-
|
|
18736
|
+
setTimeout(function () {
|
|
18737
|
+
_this.setRangeValues();
|
|
18738
|
+
});
|
|
18736
18739
|
}
|
|
18737
18740
|
};
|
|
18738
18741
|
SliderComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -18771,6 +18774,7 @@
|
|
|
18771
18774
|
});
|
|
18772
18775
|
SliderComponent.prototype.writeValue = function (obj) {
|
|
18773
18776
|
this.value = obj;
|
|
18777
|
+
this.setRangeValues();
|
|
18774
18778
|
};
|
|
18775
18779
|
SliderComponent.prototype.registerOnChange = function (fn) {
|
|
18776
18780
|
this.onChange = fn;
|
|
@@ -18888,6 +18892,9 @@
|
|
|
18888
18892
|
_this.startValue = _this.getClosestValueFromMapSlider(startValue);
|
|
18889
18893
|
_this.endValue = _this.getClosestValueFromMapSlider(endValue);
|
|
18890
18894
|
};
|
|
18895
|
+
if (this.value === null || this.value === undefined) {
|
|
18896
|
+
return;
|
|
18897
|
+
}
|
|
18891
18898
|
if (Array.isArray(this.value) && !this.multiple) {
|
|
18892
18899
|
throw new Error('You must use "multiple" with value as array');
|
|
18893
18900
|
}
|
|
@@ -18895,48 +18902,43 @@
|
|
|
18895
18902
|
this.startValue = this.value[0];
|
|
18896
18903
|
this.endValue = this.value[1];
|
|
18897
18904
|
}
|
|
18898
|
-
else if (this.multiple && !Array.isArray(this.value)) {
|
|
18899
|
-
this.value = [this.startValue, this.endValue];
|
|
18900
|
-
}
|
|
18901
18905
|
else if (!this.multiple) {
|
|
18902
18906
|
this.startValue = this.value;
|
|
18903
18907
|
this.endValue = this.value;
|
|
18904
18908
|
}
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
|
|
18909
|
-
|
|
18910
|
-
|
|
18911
|
-
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
|
|
18915
|
-
_startValue = _endValue - difference;
|
|
18916
|
-
}
|
|
18917
|
-
else if (startValueIsLessThanMin) {
|
|
18918
|
-
_startValue = this.min;
|
|
18919
|
-
_endValue = _startValue + difference;
|
|
18920
|
-
}
|
|
18921
|
-
if (needUpdateValues) {
|
|
18922
|
-
_setStartAndEndValue(_startValue, _endValue);
|
|
18923
|
-
this.setValue([this.startValue, this.endValue]);
|
|
18924
|
-
}
|
|
18909
|
+
_setStartAndEndValue(this.startValue, this.endValue);
|
|
18910
|
+
if (this.multiple) {
|
|
18911
|
+
var _a = __read(this.value, 2), _startValue = _a[0], _endValue = _a[1];
|
|
18912
|
+
var difference = getDifference(_endValue, _startValue);
|
|
18913
|
+
var endValueIsGreatherThanMax = _endValue > this.max;
|
|
18914
|
+
var startValueIsLessThanMin = _startValue < this.min;
|
|
18915
|
+
var needUpdateValues = endValueIsGreatherThanMax || startValueIsLessThanMin;
|
|
18916
|
+
if (endValueIsGreatherThanMax) {
|
|
18917
|
+
_endValue = this.max;
|
|
18918
|
+
_startValue = _endValue - difference;
|
|
18925
18919
|
}
|
|
18926
|
-
else {
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18937
|
-
|
|
18938
|
-
|
|
18939
|
-
|
|
18920
|
+
else if (startValueIsLessThanMin) {
|
|
18921
|
+
_startValue = this.min;
|
|
18922
|
+
_endValue = _startValue + difference;
|
|
18923
|
+
}
|
|
18924
|
+
if (needUpdateValues) {
|
|
18925
|
+
_setStartAndEndValue(_startValue, _endValue);
|
|
18926
|
+
this.setValue([this.startValue, this.endValue]);
|
|
18927
|
+
}
|
|
18928
|
+
}
|
|
18929
|
+
else {
|
|
18930
|
+
var _value = this.value;
|
|
18931
|
+
var valueGreatherThanMax = _value > this.max;
|
|
18932
|
+
var valueLessThanMin = _value < this.min;
|
|
18933
|
+
var needUpdateValue = valueGreatherThanMax || valueLessThanMin;
|
|
18934
|
+
if (valueGreatherThanMax) {
|
|
18935
|
+
_value = this.max;
|
|
18936
|
+
}
|
|
18937
|
+
else if (valueLessThanMin) {
|
|
18938
|
+
_value = this.min;
|
|
18939
|
+
}
|
|
18940
|
+
if (needUpdateValue) {
|
|
18941
|
+
this.setValue(_value, false);
|
|
18940
18942
|
}
|
|
18941
18943
|
}
|
|
18942
18944
|
this.setProgress();
|
|
@@ -19186,7 +19188,7 @@
|
|
|
19186
19188
|
SliderComponent = SliderComponent_1 = __decorate([
|
|
19187
19189
|
core.Component({
|
|
19188
19190
|
selector: "s-slider",
|
|
19189
|
-
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",
|
|
19191
|
+
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",
|
|
19190
19192
|
providers: [
|
|
19191
19193
|
{
|
|
19192
19194
|
provide: forms.NG_VALUE_ACCESSOR,
|