intelicoreact 1.3.68 → 1.3.70
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.
|
@@ -108,13 +108,22 @@ const InputCurrency = _ref => {
|
|
|
108
108
|
value: inputValue,
|
|
109
109
|
onChange: formatCurrencyInput,
|
|
110
110
|
onClick: onInputClick,
|
|
111
|
-
onKeyDown: onKeyDown
|
|
112
|
-
|
|
111
|
+
onKeyDown: onKeyDown
|
|
112
|
+
}, attributesOfNativeInput, {
|
|
113
|
+
onFocus: e => {
|
|
114
|
+
var _attributesOfNativeIn;
|
|
115
|
+
|
|
116
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn = attributesOfNativeInput.onFocus) === null || _attributesOfNativeIn === void 0 ? void 0 : _attributesOfNativeIn.call(attributesOfNativeInput, e);
|
|
117
|
+
setIsFocused(true);
|
|
118
|
+
},
|
|
113
119
|
onBlur: (e, value) => {
|
|
120
|
+
var _attributesOfNativeIn2;
|
|
121
|
+
|
|
122
|
+
attributesOfNativeInput === null || attributesOfNativeInput === void 0 ? void 0 : (_attributesOfNativeIn2 = attributesOfNativeInput.onBlur) === null || _attributesOfNativeIn2 === void 0 ? void 0 : _attributesOfNativeIn2.call(attributesOfNativeInput, e);
|
|
114
123
|
if (!isNoCheckMinMax) checkMinMax(e, value);
|
|
115
124
|
setIsFocused(false);
|
|
116
125
|
}
|
|
117
|
-
}
|
|
126
|
+
})));
|
|
118
127
|
};
|
|
119
128
|
|
|
120
129
|
var _default = InputCurrency;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
|
|
12
|
+
function useMediaQuery(query) {
|
|
13
|
+
const getMatches = (0, _react.useMemo)(() => {
|
|
14
|
+
return inputQuery => {
|
|
15
|
+
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
16
|
+
return window.matchMedia(inputQuery).matches;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
const [matches, setMatches] = (0, _react.useState)(getMatches(query));
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
25
|
+
const matchMedia = window.matchMedia(query);
|
|
26
|
+
const debouncedChangeHandler = (0, _utils.debounce)(() => setMatches(getMatches(query)), 300);
|
|
27
|
+
matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia.addEventListener("change", debouncedChangeHandler);
|
|
28
|
+
return () => {
|
|
29
|
+
matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia.removeEventListener("change", debouncedChangeHandler);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}, [query, getMatches]);
|
|
33
|
+
return matches;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var _default = useMediaQuery;
|
|
37
|
+
exports.default = _default;
|