ecomlab-components-next 0.1.89 → 0.1.90
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.
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _imask = _interopRequireDefault(require("imask"));
|
|
11
11
|
var _libphonenumberJs = require("libphonenumber-js");
|
|
12
12
|
require("./InputDinamycPlaceholder.scss");
|
|
13
|
-
var _excluded = ["tooltip", "tooltipStatic", "rows", "changeValue", "setChangeValue", "classname", "placeholder", "type", "onChange", "passwordTooltip", "err", "textErr", "infoHeader", "info", "autoComplete", "disabled", "showClearIndicator", "multiline", "maxLength", "autoFocus", "variant", "size", "maxlength", "required", "onBlur", "mask", "readOnly", "countrySelect"];
|
|
13
|
+
var _excluded = ["tooltip", "tooltipStatic", "rows", "changeValue", "setChangeValue", "classname", "placeholder", "type", "onChange", "passwordTooltip", "err", "textErr", "infoHeader", "info", "autoComplete", "disabled", "showClearIndicator", "multiline", "maxLength", "autoFocus", "variant", "size", "maxlength", "required", "onBlur", "mask", "readOnly", "countrySelect", "countryDefault"];
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -66,6 +66,8 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
66
66
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
67
67
|
_ref$countrySelect = _ref.countrySelect,
|
|
68
68
|
countrySelect = _ref$countrySelect === void 0 ? false : _ref$countrySelect,
|
|
69
|
+
_ref$countryDefault = _ref.countryDefault,
|
|
70
|
+
countryDefault = _ref$countryDefault === void 0 ? 'RU' : _ref$countryDefault,
|
|
69
71
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
70
72
|
var _useState = (0, _react.useState)(false),
|
|
71
73
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -83,12 +85,13 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
83
85
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
86
|
isFocus = _useState8[0],
|
|
85
87
|
setIsFocus = _useState8[1];
|
|
86
|
-
var _useState9 = (0, _react.useState)(
|
|
88
|
+
var _useState9 = (0, _react.useState)(countryDefault),
|
|
87
89
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
88
90
|
country = _useState10[0],
|
|
89
91
|
setCountry = _useState10[1]; // По умолчанию Россия
|
|
90
92
|
var inputRef = (0, _react.useRef)(null);
|
|
91
93
|
var maskRef = (0, _react.useRef)(null);
|
|
94
|
+
console.log(valueInside);
|
|
92
95
|
|
|
93
96
|
// Список всех стран
|
|
94
97
|
var countries = (0, _libphonenumberJs.getCountries)();
|
|
@@ -109,9 +112,7 @@ var InputDinamycPlaceholder = function InputDinamycPlaceholder(_ref) {
|
|
|
109
112
|
maskRef.current.destroy();
|
|
110
113
|
}
|
|
111
114
|
maskRef.current = (0, _imask["default"])(inputRef.current, newMask);
|
|
112
|
-
|
|
113
|
-
setValueInside(maskRef.current.value);
|
|
114
|
-
});
|
|
115
|
+
setValueInside('');
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
|