intelicoreact 0.2.88 → 0.2.91
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 +1 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +9 -4
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +37 -11
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -1
- package/package.json +1 -1
|
@@ -183,7 +183,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
183
183
|
var _item$label2, _item$label2$toLowerC, _item$label2$toLowerC2, _item$label2$toLowerC3, _searchValue$toLowerC;
|
|
184
184
|
|
|
185
185
|
return item !== null && item !== void 0 && (_item$label2 = item.label) !== null && _item$label2 !== void 0 && (_item$label2$toLowerC = _item$label2.toLowerCase) !== null && _item$label2$toLowerC !== void 0 && (_item$label2$toLowerC2 = _item$label2$toLowerC.call(_item$label2)) !== null && _item$label2$toLowerC2 !== void 0 && (_item$label2$toLowerC3 = _item$label2$toLowerC2.includes) !== null && _item$label2$toLowerC3 !== void 0 && _item$label2$toLowerC3.call(_item$label2$toLowerC2, (searchValue === null || searchValue === void 0 ? void 0 : (_searchValue$toLowerC = searchValue.toLowerCase) === null || _searchValue$toLowerC === void 0 ? void 0 : _searchValue$toLowerC.call(searchValue)) || '') ? /*#__PURE__*/_react.default.createElement("button", {
|
|
186
|
-
"data-testid": "dropdown--button--key-".concat(optTestId || (item === null || item === void 0 ? void 0 : item.value
|
|
186
|
+
"data-testid": "dropdown--button--key-".concat(optTestId || (item === null || item === void 0 ? void 0 : item.value) || (item === null || item === void 0 ? void 0 : item.key) || 'item', "--option"),
|
|
187
187
|
key: item.value,
|
|
188
188
|
onClick: function onClick() {
|
|
189
189
|
return depend.onChange(item);
|
|
@@ -1434,7 +1434,7 @@ function InputMask() {
|
|
|
1434
1434
|
onBlur: onBlur
|
|
1435
1435
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1436
1436
|
className: "\n input-mask\n ".concat(isError ? 'input-mask_error' : '', "\n ").concat(isFocused ? 'input-mask_focus' : '', "\n ").concat(blinkError ? 'input-mask_blink-error' : '', "\n "),
|
|
1437
|
-
"data-
|
|
1437
|
+
"data-testid": testId,
|
|
1438
1438
|
onMouseDown: function onMouseDown(e) {
|
|
1439
1439
|
return cancelDefaultAction(e, function () {
|
|
1440
1440
|
return setIsMouseDown(true);
|
|
@@ -55,7 +55,8 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
55
55
|
_ref$label = _ref.label,
|
|
56
56
|
label = _ref$label === void 0 ? '' : _ref$label,
|
|
57
57
|
_ref$isPrice = _ref.isPrice,
|
|
58
|
-
isPrice = _ref$isPrice === void 0 ? false : _ref$isPrice
|
|
58
|
+
isPrice = _ref$isPrice === void 0 ? false : _ref$isPrice,
|
|
59
|
+
testId = _ref.testId;
|
|
59
60
|
|
|
60
61
|
var _useState = (0, _react.useState)({
|
|
61
62
|
from: '',
|
|
@@ -69,13 +70,15 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
69
70
|
var inputToRef = (0, _react.useRef)(null);
|
|
70
71
|
|
|
71
72
|
var isValidRange = function isValidRange(from, to) {
|
|
72
|
-
var
|
|
73
|
-
|
|
73
|
+
var replaceNotDigitFrom = from === null || from === void 0 ? void 0 : from.toString().replace(/[^\d]/g, ''),
|
|
74
|
+
replaceNotDigitFromTo = to === null || to === void 0 ? void 0 : to.toString().replace(/[^\d]/g, '');
|
|
75
|
+
var correctFrom = parseInt(replaceNotDigitFrom);
|
|
76
|
+
var correntTo = parseInt(replaceNotDigitFromTo);
|
|
74
77
|
return !!(correctFrom && correntTo && correctFrom <= correntTo);
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
var valueFormatter = function valueFormatter(value) {
|
|
78
|
-
if (type === 'float') return (0, _fieldValueFormatters.filterFloat)(value);else if (isPrice) return (0, _utils.addBitDepthPoints)(value.replace(/[^\d]/g, ''));else return (0, _fieldValueFormatters.formatOnlyNumbers)(value);
|
|
81
|
+
if (type === 'float') return (0, _fieldValueFormatters.filterFloat)(value);else if (isPrice) return (0, _utils.addBitDepthPoints)(value === null || value === void 0 ? void 0 : value.replace(/[^\d]/g, ''));else return (0, _fieldValueFormatters.formatOnlyNumbers)(value);
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
var handleChange = function handleChange(prop, val) {
|
|
@@ -123,6 +126,7 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
123
126
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
124
127
|
className: "".concat(RC, "__input-label")
|
|
125
128
|
}, "From"), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
129
|
+
testId: "".concat(testId, "--from"),
|
|
126
130
|
ref: inputFromRef,
|
|
127
131
|
value: (_valueObj$from = valueObj === null || valueObj === void 0 ? void 0 : valueObj.from) !== null && _valueObj$from !== void 0 ? _valueObj$from : '',
|
|
128
132
|
onChange: function onChange(val) {
|
|
@@ -145,6 +149,7 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
145
149
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
146
150
|
className: "".concat(RC, "__input-label")
|
|
147
151
|
}, "to"), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
152
|
+
testId: "".concat(testId, "--to"),
|
|
148
153
|
ref: inputToRef,
|
|
149
154
|
value: (_valueObj$to = valueObj === null || valueObj === void 0 ? void 0 : valueObj.to) !== null && _valueObj$to !== void 0 ? _valueObj$to : '',
|
|
150
155
|
onChange: function onChange(val) {
|
|
@@ -31,7 +31,9 @@ var TieredCheckboxes = function TieredCheckboxes(_ref) {
|
|
|
31
31
|
onChange = _ref.onChange,
|
|
32
32
|
isUseParentsClassesAsDataset = _ref.isUseParentsClassesAsDataset,
|
|
33
33
|
isUseAccordionForGroup = _ref.isUseAccordionForGroup,
|
|
34
|
-
accordionIcons = _ref.accordionIcons
|
|
34
|
+
accordionIcons = _ref.accordionIcons,
|
|
35
|
+
_ref$isOnlyOne = _ref.isOnlyOne,
|
|
36
|
+
isOnlyOne = _ref$isOnlyOne === void 0 ? false : _ref$isOnlyOne;
|
|
35
37
|
var handle = {
|
|
36
38
|
changeParent: function changeParent(value, key, prop) {
|
|
37
39
|
var parent = items.find(function (item) {
|
|
@@ -56,15 +58,39 @@ var TieredCheckboxes = function TieredCheckboxes(_ref) {
|
|
|
56
58
|
onChange((0, _toConsumableArray2.default)(items));
|
|
57
59
|
},
|
|
58
60
|
changeChild: function changeChild(value, key, parentKey) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
if (isOnlyOne) {
|
|
62
|
+
var parent = items.find(function (item) {
|
|
63
|
+
return item.key === parentKey;
|
|
64
|
+
});
|
|
65
|
+
parent.children.find(function (item) {
|
|
66
|
+
return item.key === key;
|
|
67
|
+
}).value = value;
|
|
68
|
+
parent.children.map(function (item) {
|
|
69
|
+
if (item.key !== key && value === true) {
|
|
70
|
+
item.disabled = true;
|
|
71
|
+
parent.disabled = true;
|
|
72
|
+
} else if (item.key !== key && value === false) {
|
|
73
|
+
item.disabled = false;
|
|
74
|
+
parent.disabled = false;
|
|
75
|
+
} else item.disabled = false;
|
|
76
|
+
|
|
77
|
+
return item;
|
|
78
|
+
});
|
|
79
|
+
parent.disabled = true;
|
|
80
|
+
console.log(parent);
|
|
81
|
+
} else {
|
|
82
|
+
var _parent = items.find(function (item) {
|
|
83
|
+
return item.key === parentKey;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
_parent.children.find(function (item) {
|
|
87
|
+
return item.key === key;
|
|
88
|
+
}).value = value;
|
|
89
|
+
if (_parent.children.every(function (item) {
|
|
90
|
+
return item.value;
|
|
91
|
+
})) _parent.value = true;else _parent.value = false;
|
|
92
|
+
}
|
|
93
|
+
|
|
68
94
|
onChange((0, _toConsumableArray2.default)(items));
|
|
69
95
|
},
|
|
70
96
|
isAllChecked: function isAllChecked(item) {
|
|
@@ -131,7 +157,7 @@ var TieredCheckboxes = function TieredCheckboxes(_ref) {
|
|
|
131
157
|
disabled: parent.children.every(function (_ref4) {
|
|
132
158
|
var disabled = _ref4.disabled;
|
|
133
159
|
return disabled === true;
|
|
134
|
-
})
|
|
160
|
+
}) || parent.disabled
|
|
135
161
|
}), renderInner(parent));
|
|
136
162
|
}));
|
|
137
163
|
};
|
|
@@ -53,7 +53,7 @@ var AccordionWithCheckbox = function AccordionWithCheckbox(_ref) {
|
|
|
53
53
|
disabled: parent.children.every(function (_ref2) {
|
|
54
54
|
var disabled = _ref2.disabled;
|
|
55
55
|
return disabled === true;
|
|
56
|
-
})
|
|
56
|
+
}) || parent.disabled
|
|
57
57
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
58
58
|
className: "".concat(RC, "__description-checked")
|
|
59
59
|
}, parent !== null && parent !== void 0 && (_parent$children3 = parent.children) !== null && _parent$children3 !== void 0 && _parent$children3.length ? "Selected ".concat(parent.children.filter(function (child) {
|
|
@@ -76,7 +76,7 @@ var MonoAccordion = function MonoAccordion(_ref) {
|
|
|
76
76
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, datasetProp, {
|
|
77
77
|
className: (0, _classnames.default)(RC, className, (_cn = {}, (0, _defineProperty2.default)(_cn, "".concat(RC, "_is-open"), isOpen), (0, _defineProperty2.default)(_cn, "".concat(RC, "_disabled"), disabled), _cn))
|
|
78
78
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
-
"data-
|
|
79
|
+
"data-testid": "accordionHeader--key-".concat(testId, "--clickable"),
|
|
80
80
|
className: "".concat(RC, "__head"),
|
|
81
81
|
onClick: handleClick
|
|
82
82
|
}, /*#__PURE__*/_react.default.createElement("div", {
|