intelicoreact 1.4.5 → 1.4.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.
|
@@ -143,6 +143,7 @@ function RangeSlider(_ref) {
|
|
|
143
143
|
|
|
144
144
|
const onRangeChange = function (type, value) {
|
|
145
145
|
let validate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
146
|
+
let callOnChange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
146
147
|
if (validate) value = prepareValue(value);
|
|
147
148
|
if (isNaN(value)) value = 0;
|
|
148
149
|
|
|
@@ -160,7 +161,7 @@ function RangeSlider(_ref) {
|
|
|
160
161
|
|
|
161
162
|
validate ? setFrom(value) : setFromValue(value);
|
|
162
163
|
|
|
163
|
-
if (!isTriggerMoved) {
|
|
164
|
+
if (!isTriggerMoved && callOnChange) {
|
|
164
165
|
debounce(() => {
|
|
165
166
|
const values = {
|
|
166
167
|
from: prepareValue(value),
|
|
@@ -186,7 +187,7 @@ function RangeSlider(_ref) {
|
|
|
186
187
|
|
|
187
188
|
validate ? setTo(value) : setToValue(value);
|
|
188
189
|
|
|
189
|
-
if (!isTriggerMoved) {
|
|
190
|
+
if (!isTriggerMoved && callOnChange) {
|
|
190
191
|
debounce(() => {
|
|
191
192
|
const values = {
|
|
192
193
|
from,
|
|
@@ -248,8 +249,8 @@ function RangeSlider(_ref) {
|
|
|
248
249
|
(0, _react.useEffect)(() => {
|
|
249
250
|
var _value$from2, _value$to2;
|
|
250
251
|
|
|
251
|
-
onRangeChange("from", (_value$from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value$from2 !== void 0 ? _value$from2 : max);
|
|
252
|
-
onRangeChange("to", (_value$to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value$to2 !== void 0 ? _value$to2 : min);
|
|
252
|
+
onRangeChange("from", (_value$from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value$from2 !== void 0 ? _value$from2 : max, true, false);
|
|
253
|
+
onRangeChange("to", (_value$to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value$to2 !== void 0 ? _value$to2 : min, true, false);
|
|
253
254
|
}, []); /// MouseUp Event Controller
|
|
254
255
|
|
|
255
256
|
(0, _react.useEffect)(() => {
|
|
@@ -283,7 +284,7 @@ function RangeSlider(_ref) {
|
|
|
283
284
|
setFrezeedValues(null);
|
|
284
285
|
}, [isTriggerMoved]);
|
|
285
286
|
(0, _react.useEffect)(() => {
|
|
286
|
-
if (Object.values(isInputsFocused).every(v => !v) && !isTriggerMoved) {
|
|
287
|
+
if (Object.values(isInputsFocused).every(v => !v) && !isTriggerMoved && (value.from !== from || value.to !== to)) {
|
|
287
288
|
onChange({
|
|
288
289
|
from,
|
|
289
290
|
to
|