intelicoreact 1.4.6 → 1.4.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.
|
@@ -149,7 +149,7 @@ function RangeSlider(_ref) {
|
|
|
149
149
|
|
|
150
150
|
switch (type) {
|
|
151
151
|
case "from":
|
|
152
|
-
|
|
152
|
+
const getValidatedFromValue = value => {
|
|
153
153
|
if (value < min) {
|
|
154
154
|
value = min;
|
|
155
155
|
}
|
|
@@ -157,6 +157,12 @@ function RangeSlider(_ref) {
|
|
|
157
157
|
if (value > to - minRange) {
|
|
158
158
|
value = to - minRange;
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
return value;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
if (validate) {
|
|
165
|
+
value = getValidatedFromValue(value);
|
|
160
166
|
}
|
|
161
167
|
|
|
162
168
|
validate ? setFrom(value) : setFromValue(value);
|
|
@@ -164,7 +170,7 @@ function RangeSlider(_ref) {
|
|
|
164
170
|
if (!isTriggerMoved && callOnChange) {
|
|
165
171
|
debounce(() => {
|
|
166
172
|
const values = {
|
|
167
|
-
from: prepareValue(value),
|
|
173
|
+
from: prepareValue(getValidatedFromValue(value)),
|
|
168
174
|
to
|
|
169
175
|
};
|
|
170
176
|
onChange(values);
|
|
@@ -175,7 +181,7 @@ function RangeSlider(_ref) {
|
|
|
175
181
|
break;
|
|
176
182
|
|
|
177
183
|
case "to":
|
|
178
|
-
|
|
184
|
+
const getValidatedToValue = value => {
|
|
179
185
|
if (value > max) {
|
|
180
186
|
value = max;
|
|
181
187
|
}
|
|
@@ -183,6 +189,12 @@ function RangeSlider(_ref) {
|
|
|
183
189
|
if (value < from + minRange) {
|
|
184
190
|
value = from + minRange;
|
|
185
191
|
}
|
|
192
|
+
|
|
193
|
+
return value;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
if (validate) {
|
|
197
|
+
value = getValidatedToValue(value);
|
|
186
198
|
}
|
|
187
199
|
|
|
188
200
|
validate ? setTo(value) : setToValue(value);
|
|
@@ -191,7 +203,7 @@ function RangeSlider(_ref) {
|
|
|
191
203
|
debounce(() => {
|
|
192
204
|
const values = {
|
|
193
205
|
from,
|
|
194
|
-
to: prepareValue(value)
|
|
206
|
+
to: prepareValue(getValidatedToValue(value))
|
|
195
207
|
};
|
|
196
208
|
onChange(values);
|
|
197
209
|
setFrezeedValues(values);
|