intelicoreact 1.1.30 → 1.1.32
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/Atomic/FormElements/Dropdown/Dropdown.js +7 -2
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +4 -2
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +24 -7
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.scss +56 -6
- package/dist/Atomic/FormElements/Label/Label.js +3 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +0 -1
- package/dist/Atomic/UI/Hint/Hint.js +5 -4
- package/dist/Molecular/FormElement/FormElement.js +4 -2
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
44
44
|
var RC = 'dropdown';
|
|
45
45
|
|
|
46
46
|
var Dropdown = function Dropdown(_ref) {
|
|
47
|
-
var _options$find, _filteredOptions$find;
|
|
47
|
+
var _options$find, _window, _filteredOptions$find;
|
|
48
48
|
|
|
49
49
|
var _ref$options = _ref.options,
|
|
50
50
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
@@ -184,7 +184,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
184
184
|
var handleClickOutside = function handleClickOutside(event) {
|
|
185
185
|
var _getListContainer;
|
|
186
186
|
|
|
187
|
-
if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event.target))) {
|
|
187
|
+
if (!((_getListContainer = getListContainer()) !== null && _getListContainer !== void 0 && _getListContainer.contains(event === null || event === void 0 ? void 0 : event.target))) {
|
|
188
188
|
setIsOpen(false);
|
|
189
189
|
}
|
|
190
190
|
};
|
|
@@ -403,10 +403,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
403
403
|
(0, _react.useLayoutEffect)(function () {
|
|
404
404
|
window.addEventListener('resize', setListContainerStyles);
|
|
405
405
|
window.addEventListener('mousewheel', closeList);
|
|
406
|
+
window.addEventListener('scroll', closeList);
|
|
406
407
|
window.addEventListener('touchmove', closeList);
|
|
407
408
|
return function () {
|
|
408
409
|
window.removeEventListener('resize', setListContainerStyles);
|
|
409
410
|
window.removeEventListener('mousewheel', closeList);
|
|
411
|
+
window.removeEventListener('scroll', closeList);
|
|
410
412
|
window.removeEventListener('touchmove', closeList);
|
|
411
413
|
};
|
|
412
414
|
}, [getListContainer]);
|
|
@@ -433,6 +435,9 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
433
435
|
if (scrollReactionObj && (0, _typeof2.default)(scrollReactionObj) === 'object') removeEventListener('scroll', doScrollCallback);
|
|
434
436
|
};
|
|
435
437
|
}, [isOpen, dropdownListRef]);
|
|
438
|
+
(0, _react.useEffect)(function () {
|
|
439
|
+
closeList();
|
|
440
|
+
}, [(_window = window) === null || _window === void 0 ? void 0 : _window.scrollY]);
|
|
436
441
|
|
|
437
442
|
var onKeyDown = function onKeyDown(e) {
|
|
438
443
|
if (![9, 13].includes(e.keyCode)) return false;
|
|
@@ -25,7 +25,7 @@ var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
|
25
25
|
|
|
26
26
|
require("./FormattedRawSSN.scss");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["value", "onChange", "maskChar", "testId"];
|
|
28
|
+
var _excluded = ["value", "onChange", "maskChar", "testId", "isHiddenDefault"];
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -39,6 +39,8 @@ var FormattedRawSSN = function FormattedRawSSN(_ref) {
|
|
|
39
39
|
_ref$maskChar = _ref.maskChar,
|
|
40
40
|
maskChar = _ref$maskChar === void 0 ? '*' : _ref$maskChar,
|
|
41
41
|
testId = _ref.testId,
|
|
42
|
+
_ref$isHiddenDefault = _ref.isHiddenDefault,
|
|
43
|
+
isHiddenDefault = _ref$isHiddenDefault === void 0 ? true : _ref$isHiddenDefault,
|
|
42
44
|
args = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
45
|
|
|
44
46
|
var _useState = (0, _react.useState)(value !== null && value !== void 0 ? value : ''),
|
|
@@ -46,7 +48,7 @@ var FormattedRawSSN = function FormattedRawSSN(_ref) {
|
|
|
46
48
|
SSN = _useState2[0],
|
|
47
49
|
setSSN = _useState2[1];
|
|
48
50
|
|
|
49
|
-
var _useState3 = (0, _react.useState)(
|
|
51
|
+
var _useState3 = (0, _react.useState)(isHiddenDefault),
|
|
50
52
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
51
53
|
isHidden = _useState4[0],
|
|
52
54
|
setIsHidden = _useState4[1];
|
|
@@ -33,7 +33,7 @@ var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
|
33
33
|
|
|
34
34
|
require("./InputWithAction.scss");
|
|
35
35
|
|
|
36
|
-
var _excluded = ["className", "inputClassName", "isHideAction", "actionLabel", "doAction", "actionContent", "actionProps", "isNoChangeAfterAction", "isWithCopy", "copyLabel", "copy", "disabled", "isInputZoneDisabled", "isInputDisabled", "isLodaing", "onChange", "value"];
|
|
36
|
+
var _excluded = ["className", "inputClassName", "isHideAction", "actionLabel", "doAction", "actionContent", "actionProps", "isNoChangeAfterAction", "isWithCopy", "copyLabel", "copy", "copyIcon", "isNoCopyIcon", "isCopyIconRight", "copyButtonVariant", "disabled", "isInputZoneDisabled", "isInputDisabled", "isLodaing", "onChange", "value", "testId"];
|
|
37
37
|
|
|
38
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
39
|
|
|
@@ -42,6 +42,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
42
42
|
var RC = 'input-with-action';
|
|
43
43
|
|
|
44
44
|
var InputWithAction = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
45
|
+
var _cn2;
|
|
46
|
+
|
|
45
47
|
var className = props.className,
|
|
46
48
|
inputClassName = props.inputClassName,
|
|
47
49
|
_props$isHideAction = props.isHideAction,
|
|
@@ -58,12 +60,18 @@ var InputWithAction = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
58
60
|
_props$copyLabel = props.copyLabel,
|
|
59
61
|
copyLabel = _props$copyLabel === void 0 ? 'Copy' : _props$copyLabel,
|
|
60
62
|
_copy = props.copy,
|
|
63
|
+
copyIcon = props.copyIcon,
|
|
64
|
+
isNoCopyIcon = props.isNoCopyIcon,
|
|
65
|
+
isCopyIconRight = props.isCopyIconRight,
|
|
66
|
+
_props$copyButtonVari = props.copyButtonVariant,
|
|
67
|
+
copyButtonVariant = _props$copyButtonVari === void 0 ? 'dark-outline' : _props$copyButtonVari,
|
|
61
68
|
disabled = props.disabled,
|
|
62
69
|
isInputZoneDisabled = props.isInputZoneDisabled,
|
|
63
70
|
isInputDisabled = props.isInputDisabled,
|
|
64
71
|
isLodaing = props.isLodaing,
|
|
65
72
|
onChange = props.onChange,
|
|
66
73
|
value = props.value,
|
|
74
|
+
testId = props.testId,
|
|
67
75
|
inputProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
68
76
|
|
|
69
77
|
var _useState = (0, _react.useState)(false),
|
|
@@ -113,25 +121,34 @@ var InputWithAction = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
113
121
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
114
122
|
className: (0, _classnames.default)(RC, className, (0, _defineProperty2.default)({}, "".concat(RC, "_disabled"), disabled))
|
|
115
123
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
-
className: (0, _classnames.default)("".concat(RC, "__input-zone"), (0, _defineProperty2.default)(
|
|
124
|
+
className: (0, _classnames.default)("".concat(RC, "__input-zone"), (_cn2 = {}, (0, _defineProperty2.default)(_cn2, "".concat(RC, "__input-zone_disabled"), isInputZoneDisabled), (0, _defineProperty2.default)(_cn2, "".concat(RC, "__input-zone_input-disabled"), isInputDisabled), _cn2))
|
|
117
125
|
}, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({}, inputProps, {
|
|
126
|
+
testId: "".concat(testId, "-input"),
|
|
118
127
|
ref: ref,
|
|
119
128
|
value: value,
|
|
120
129
|
disabled: isInputDisabled,
|
|
121
130
|
onChange: onChange,
|
|
122
131
|
className: (0, _classnames.default)("".concat(RC, "__input"), inputClassName)
|
|
123
|
-
})), !isHideAction && actionContent, !isHideAction && !actionContent && /*#__PURE__*/_react.default.createElement("
|
|
124
|
-
className: (0, _classnames.default)("".concat(RC, "__action-container"))
|
|
132
|
+
})), !isHideAction && actionContent, !isHideAction && !actionContent && /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
className: (0, _classnames.default)("".concat(RC, "__action-container"))
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
135
|
+
className: (0, _classnames.default)("".concat(RC, "__action-label")),
|
|
125
136
|
onClick: function onClick() {
|
|
126
137
|
return handle.doAction();
|
|
127
|
-
}
|
|
128
|
-
|
|
138
|
+
},
|
|
139
|
+
testId: "".concat(testId, "-action-label")
|
|
140
|
+
}, actionLabel)), isLocalLoading && /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
129
141
|
size: "small"
|
|
130
142
|
})), isWithCopy && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
143
|
+
testId: "".concat(testId, "-copy-button"),
|
|
131
144
|
className: "".concat(RC, "__coppy-button"),
|
|
132
145
|
onClick: function onClick() {
|
|
133
146
|
return handle.copy();
|
|
134
|
-
}
|
|
147
|
+
},
|
|
148
|
+
icon: copyIcon,
|
|
149
|
+
noIcon: isNoCopyIcon,
|
|
150
|
+
isIconRight: isCopyIconRight,
|
|
151
|
+
variant: copyButtonVariant
|
|
135
152
|
}, copyLabel));
|
|
136
153
|
});
|
|
137
154
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-flow: row nowrap;
|
|
7
7
|
justify-content: flex-start;
|
|
8
|
-
align-items:
|
|
8
|
+
align-items: stretch;
|
|
9
9
|
|
|
10
10
|
&__input-zone {
|
|
11
11
|
flex-grow: 1;
|
|
@@ -22,20 +22,70 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&__action-container {
|
|
25
|
+
height: 100%;
|
|
25
26
|
margin-left: 8px;
|
|
27
|
+
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-flow: row nowrap;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__action-label {
|
|
39
|
+
background-color: transparent;
|
|
26
40
|
cursor: pointer;
|
|
27
|
-
user-select: none
|
|
41
|
+
user-select: none;
|
|
42
|
+
|
|
43
|
+
font-family: 'Roboto';
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
line-height: 20px;
|
|
48
|
+
color: #6B81DD;
|
|
28
49
|
}
|
|
29
50
|
|
|
30
51
|
&__coppy-button {
|
|
31
|
-
|
|
52
|
+
width: 63px;
|
|
53
|
+
margin-left: 4px;
|
|
32
54
|
user-select: none
|
|
33
55
|
}
|
|
34
56
|
|
|
35
|
-
&_disabled
|
|
57
|
+
&_disabled {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
|
|
61
|
+
.input-with-action__input-zone {
|
|
62
|
+
background-color: #F7F8FA;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.input__wrap {
|
|
66
|
+
background-color: #F7F8FA;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
36
70
|
&__input-zone_disabled {
|
|
37
71
|
opacity: 0.5;
|
|
38
72
|
pointer-events: none;
|
|
73
|
+
background-color: #F7F8FA;
|
|
74
|
+
|
|
75
|
+
.input__wrap {
|
|
76
|
+
background-color: #F7F8FA;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__input-zone_input-disabled {
|
|
81
|
+
background-color: #F7F8FA;
|
|
82
|
+
|
|
83
|
+
.input-with-action__action-container {
|
|
84
|
+
background-color: rgba(#F7F8FA, 0.5);
|
|
85
|
+
}
|
|
86
|
+
.input__wrap {
|
|
87
|
+
background-color: #F7F8FA;
|
|
88
|
+
}
|
|
39
89
|
}
|
|
40
90
|
|
|
41
91
|
.input__wrap {
|
|
@@ -52,8 +102,8 @@
|
|
|
52
102
|
}
|
|
53
103
|
|
|
54
104
|
.lds-ring_small {
|
|
55
|
-
width: 20px
|
|
56
|
-
height: 20px
|
|
105
|
+
width: 20px !important;;
|
|
106
|
+
height: 20px !important;;
|
|
57
107
|
|
|
58
108
|
& div {
|
|
59
109
|
border-width: 3px !important;
|
|
@@ -22,6 +22,7 @@ var Label = function Label(_ref) {
|
|
|
22
22
|
hint = _ref.hint,
|
|
23
23
|
isRequired = _ref.isRequired,
|
|
24
24
|
isLabelBolt = _ref.isLabelBolt,
|
|
25
|
+
onClickHintCallback = _ref.onClickHintCallback,
|
|
25
26
|
_ref$error = _ref.error,
|
|
26
27
|
error = _ref$error === void 0 ? null : _ref$error;
|
|
27
28
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -34,7 +35,8 @@ var Label = function Label(_ref) {
|
|
|
34
35
|
}, "*"), hint && /*#__PURE__*/_react.default.createElement(_Hint.default, {
|
|
35
36
|
hint: hint.text,
|
|
36
37
|
side: hint.hintSide,
|
|
37
|
-
className: "label-hint"
|
|
38
|
+
className: "label-hint",
|
|
39
|
+
onClickCallback: onClickHintCallback
|
|
38
40
|
}));
|
|
39
41
|
};
|
|
40
42
|
|
|
@@ -40,7 +40,6 @@ var SwitcherRange = function SwitcherRange(_ref) {
|
|
|
40
40
|
withZero = _ref.withZero,
|
|
41
41
|
isPrice = _ref.isPrice,
|
|
42
42
|
inputsType = _ref.inputsType;
|
|
43
|
-
console.log(validateErrors, 'switcher range validate error');
|
|
44
43
|
|
|
45
44
|
var _useState = (0, _react.useState)(''),
|
|
46
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -13,14 +13,14 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _reactDom = require("react-dom");
|
|
17
|
+
|
|
16
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
19
|
|
|
18
20
|
var _reactFeather = require("react-feather");
|
|
19
21
|
|
|
20
22
|
require("./Hint.scss");
|
|
21
23
|
|
|
22
|
-
var _reactDom = require("react-dom");
|
|
23
|
-
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -40,6 +40,7 @@ var Hint = function Hint(_ref) {
|
|
|
40
40
|
variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
|
|
41
41
|
_ref$handleOpenType = _ref.handleOpenType,
|
|
42
42
|
handleOpenType = _ref$handleOpenType === void 0 ? 'click' : _ref$handleOpenType,
|
|
43
|
+
onClickCallback = _ref.onClickCallback,
|
|
43
44
|
key = _ref.key,
|
|
44
45
|
id = _ref.id;
|
|
45
46
|
var hintId = (_ref2 = key !== null && key !== void 0 ? key : id) !== null && _ref2 !== void 0 ? _ref2 : time;
|
|
@@ -50,7 +51,7 @@ var Hint = function Hint(_ref) {
|
|
|
50
51
|
setIsOpen = _useState2[1];
|
|
51
52
|
|
|
52
53
|
var hintRef = (0, _react.useRef)(null);
|
|
53
|
-
var
|
|
54
|
+
var isCallbackExist = typeof onClickCallback === 'function';
|
|
54
55
|
|
|
55
56
|
var handleClickOutside = function handleClickOutside(event) {
|
|
56
57
|
if (!getHintContainer().contains(event === null || event === void 0 ? void 0 : event.target)) {
|
|
@@ -127,7 +128,7 @@ var Hint = function Hint(_ref) {
|
|
|
127
128
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
128
129
|
"data-testid": 'test-hint',
|
|
129
130
|
onClick: function onClick() {
|
|
130
|
-
return handleOpenType === 'click' && setIsOpen(!isOpen);
|
|
131
|
+
return handleOpenType === 'click' && (isCallbackExist ? onClickCallback() : setIsOpen(!isOpen));
|
|
131
132
|
},
|
|
132
133
|
onMouseEnter: function onMouseEnter() {
|
|
133
134
|
return handleOpenType === 'hover' && setIsOpen(!isOpen);
|
|
@@ -32,7 +32,8 @@ var FormElement = function FormElement(_ref) {
|
|
|
32
32
|
hint = _ref.hint,
|
|
33
33
|
isLabelBolt = _ref.isLabelBolt,
|
|
34
34
|
isNoLabel = _ref.isNoLabel,
|
|
35
|
-
alert = _ref.alert
|
|
35
|
+
alert = _ref.alert,
|
|
36
|
+
onClickHintCallback = _ref.onClickHintCallback;
|
|
36
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
38
|
className: (0, _classnames.default)(className, RC)
|
|
38
39
|
}, label && !isNoLabel && /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
@@ -40,7 +41,8 @@ var FormElement = function FormElement(_ref) {
|
|
|
40
41
|
label: label,
|
|
41
42
|
hint: hint,
|
|
42
43
|
isRequired: required,
|
|
43
|
-
isLabelBolt: isLabelBolt
|
|
44
|
+
isLabelBolt: isLabelBolt,
|
|
45
|
+
onClickHintCallback: onClickHintCallback
|
|
44
46
|
}), children, error && /*#__PURE__*/_react.default.createElement("span", {
|
|
45
47
|
className: (0, _classnames.default)("".concat(RC, "__error"), (0, _defineProperty2.default)({}, "".concat(RC, "__error--with-alert"), alert))
|
|
46
48
|
}, error), alert && /*#__PURE__*/_react.default.createElement(_Alert.default, (0, _extends2.default)({
|