intelicoreact 1.0.36 → 1.0.37
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.
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
|
|
16
|
+
var _reactFeather = require("react-feather");
|
|
17
|
+
|
|
18
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
+
|
|
20
|
+
var _Input = _interopRequireDefault(require("../../Atomic/FormElements/Input/Input"));
|
|
21
|
+
|
|
22
|
+
require("./InputPassword.scss");
|
|
23
|
+
|
|
24
|
+
var InputPassword = function InputPassword(_ref) {
|
|
25
|
+
var _ref$field = _ref.field,
|
|
26
|
+
field = _ref$field === void 0 ? {} : _ref$field,
|
|
27
|
+
_ref$onChange = _ref.onChange,
|
|
28
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
29
|
+
_ref$testId = _ref.testId,
|
|
30
|
+
testId = _ref$testId === void 0 ? '' : _ref$testId;
|
|
31
|
+
|
|
32
|
+
var _useState = (0, _react.useState)(false),
|
|
33
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
34
|
+
showPassword = _useState2[0],
|
|
35
|
+
setSP = _useState2[1];
|
|
36
|
+
|
|
37
|
+
var inputWrapper = (0, _react.useRef)(null);
|
|
38
|
+
|
|
39
|
+
var setCarretToEnd = function setCarretToEnd(input) {
|
|
40
|
+
//Set Carret To The End
|
|
41
|
+
setTimeout(function () {
|
|
42
|
+
var tmp = input.value;
|
|
43
|
+
input.value = '';
|
|
44
|
+
input.value = tmp;
|
|
45
|
+
}, 10);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var handle = {
|
|
49
|
+
changeView: function changeView() {
|
|
50
|
+
var _inputWrapper$current;
|
|
51
|
+
|
|
52
|
+
var input = inputWrapper === null || inputWrapper === void 0 ? void 0 : (_inputWrapper$current = inputWrapper.current) === null || _inputWrapper$current === void 0 ? void 0 : _inputWrapper$current.querySelector('input');
|
|
53
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
54
|
+
setCarretToEnd(input);
|
|
55
|
+
setSP(!showPassword);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "password",
|
|
60
|
+
ref: inputWrapper
|
|
61
|
+
}, /*#__PURE__*/React.createElement(_Input.default, (0, _extends2.default)({}, field, {
|
|
62
|
+
testId: "inputPassword--input--key-".concat(testId || field.key),
|
|
63
|
+
className: (0, _classnames.default)('input-fin', field === null || field === void 0 ? void 0 : field.key),
|
|
64
|
+
onChange: onChange,
|
|
65
|
+
type: !showPassword ? 'password' : 'text'
|
|
66
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: "password-eye-holder",
|
|
68
|
+
onClick: handle.changeView,
|
|
69
|
+
"data-testid": "inputPassword--eye--key-".concat(testId || field.key, "--container")
|
|
70
|
+
}, ' ', showPassword ? /*#__PURE__*/React.createElement(_reactFeather.EyeOff, {
|
|
71
|
+
strokeWidth: 1,
|
|
72
|
+
className: "password-icon"
|
|
73
|
+
}) : /*#__PURE__*/React.createElement(_reactFeather.Eye, {
|
|
74
|
+
strokeWidth: 1,
|
|
75
|
+
className: "password-icon"
|
|
76
|
+
})));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var _default = InputPassword;
|
|
80
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.password {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.input-classic__wrap input,
|
|
5
|
+
.input__wrap input {
|
|
6
|
+
padding: 0 38px 0 10px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&-eye-holder {
|
|
10
|
+
position: absolute;
|
|
11
|
+
|
|
12
|
+
top: 25%;
|
|
13
|
+
right: 10px;
|
|
14
|
+
|
|
15
|
+
height: 100%;
|
|
16
|
+
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transform: translateY(-25%);
|
|
19
|
+
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-icon {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
color: #A6AAB4;
|
|
29
|
+
}
|
|
30
|
+
}
|