@datawheel/data-explorer 1.1.6 → 1.1.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/dist/main.mjs +18 -1
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -3685,11 +3685,28 @@ function NumberInputComponent({ text, filter }) {
|
|
|
3685
3685
|
}
|
|
3686
3686
|
var MinMax = ({ filter, hideControls, ...rest }) => {
|
|
3687
3687
|
const actions2 = useActions();
|
|
3688
|
+
const updateUrl = useUpdateUrl();
|
|
3689
|
+
const queryItem = useSelector$1(selectCurrentQueryItem);
|
|
3690
|
+
const debouncedUpdateUrl = useMemo(
|
|
3691
|
+
() => debounce((query) => {
|
|
3692
|
+
updateUrl(query);
|
|
3693
|
+
}, 1e3),
|
|
3694
|
+
[]
|
|
3695
|
+
);
|
|
3696
|
+
useEffect(() => {
|
|
3697
|
+
return () => {
|
|
3698
|
+
debouncedUpdateUrl.cancel();
|
|
3699
|
+
};
|
|
3700
|
+
}, [debouncedUpdateUrl]);
|
|
3688
3701
|
function onInputChangeMinMax(props) {
|
|
3689
3702
|
const { filter: filter2, min: min2, max: max2 } = props;
|
|
3690
3703
|
const conditions = getFiltersConditions(getFilterFn(filter2) || "greaterThan", [Number(min2), Number(max2)]) || {};
|
|
3691
3704
|
const active = Boolean(min2) && Boolean(max2);
|
|
3692
|
-
|
|
3705
|
+
const newFilter = buildFilter({ ...filter2, active, ...conditions });
|
|
3706
|
+
actions2.updateFilter(newFilter);
|
|
3707
|
+
const newQuery = buildQuery(cloneDeep(queryItem));
|
|
3708
|
+
newQuery.params.filters[filter2.key] = newFilter;
|
|
3709
|
+
debouncedUpdateUrl(newQuery);
|
|
3693
3710
|
}
|
|
3694
3711
|
function getFilterValue(condition) {
|
|
3695
3712
|
if (condition) {
|