intelicoreact 0.2.87 → 0.2.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.
@@ -49,7 +49,7 @@ var CheckboxInput = function CheckboxInput(_ref) {
49
49
  ref: function ref(elem) {
50
50
  if (elem) elem.indeterminate = isStark;
51
51
  },
52
- "data-testid": "checkbox--input--".concat(testId || id || key || (label === null || label === void 0 ? void 0 : label.replace(/\s/g, '-')))
52
+ "data-testid": "checkbox--input--".concat(testId || id || key)
53
53
  })), /*#__PURE__*/_react.default.createElement("span", {
54
54
  className: "checkbox-input__mark"
55
55
  })), label && /*#__PURE__*/_react.default.createElement("div", {
@@ -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--".concat(optTestId || index, "--key-").concat((item === null || item === void 0 ? void 0 : item.key) || 'item', "--option"),
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-testId": testId,
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 correctFrom = +(from === null || from === void 0 ? void 0 : from.replace(/[^\d]/g, ''));
73
- var correntTo = +(to === null || to === void 0 ? void 0 : to.replace(/[^\d]/g, ''));
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) {
@@ -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-testId": "accordionHeader--key-".concat(testId, "--clickable"),
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", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.2.87",
3
+ "version": "0.2.90",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [