intelicoreact 1.1.0 → 1.1.2
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/ActionAlert/ActionAlert.js +7 -4
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +9 -2
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +8 -2
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +5 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +7 -0
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +7 -1
- package/dist/Functions/utils.js +13 -2
- package/package.json +1 -1
|
@@ -11,13 +11,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _utils = require("../../../Functions/utils");
|
|
15
|
-
|
|
16
14
|
var _Button = _interopRequireDefault(require("../../UI/Button/Button"));
|
|
17
15
|
|
|
18
16
|
require("./ActionAlert.scss");
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
var _utils = require("../../../Functions/utils");
|
|
19
|
+
|
|
21
20
|
var ActionAlert = function ActionAlert(_ref) {
|
|
22
21
|
var onClick = _ref.onClick,
|
|
23
22
|
message = _ref.message,
|
|
@@ -28,9 +27,13 @@ var ActionAlert = function ActionAlert(_ref) {
|
|
|
28
27
|
noButton = _ref.noButton,
|
|
29
28
|
children = _ref.children,
|
|
30
29
|
_ref$variant = _ref.variant,
|
|
31
|
-
variant = _ref$variant === void 0 ? 'default' : _ref$variant
|
|
30
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
31
|
+
testId = _ref.testId;
|
|
32
32
|
// const transformedTime = moment(date).format('MM.DD.YYYY HH:mm');
|
|
33
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
"data-testid": "actionAlert".concat((0, _utils.getCorrectTestId)({
|
|
35
|
+
testId: testId
|
|
36
|
+
})),
|
|
34
37
|
className: (0, _classnames.default)("action-alert action-alert--".concat(variant), className)
|
|
35
38
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
39
|
className: "action-alert__message-box"
|
|
@@ -17,6 +17,8 @@ var _Status = _interopRequireDefault(require("../../UI/Status/Status"));
|
|
|
17
17
|
|
|
18
18
|
require("./AdvancedStatus.scss");
|
|
19
19
|
|
|
20
|
+
var _utils = require("../../../Functions/utils");
|
|
21
|
+
|
|
20
22
|
var AdvancedStatus = function AdvancedStatus(_ref) {
|
|
21
23
|
var onChange = _ref.onChange,
|
|
22
24
|
inactiveText = _ref.inactiveText,
|
|
@@ -24,13 +26,18 @@ var AdvancedStatus = function AdvancedStatus(_ref) {
|
|
|
24
26
|
value = _ref.value,
|
|
25
27
|
disabled = _ref.disabled,
|
|
26
28
|
isPrimary = _ref.isPrimary,
|
|
27
|
-
primaryStatusText = _ref.primaryStatusText
|
|
29
|
+
primaryStatusText = _ref.primaryStatusText,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
testId = _ref.testId;
|
|
28
32
|
var isUndefined = value === undefined || value === null;
|
|
29
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
"data-testid": "advanced-status".concat((0, _utils.getCorrectTestId)({
|
|
35
|
+
testId: testId
|
|
36
|
+
})),
|
|
30
37
|
className: (0, _classnames.default)('advanced-status', {
|
|
31
38
|
'advanced-status_undefined': isUndefined,
|
|
32
39
|
'advanced-status_disabled': disabled
|
|
33
|
-
})
|
|
40
|
+
}, className)
|
|
34
41
|
}, /*#__PURE__*/_react.default.createElement(_TextSwitcher.default, {
|
|
35
42
|
onChange: onChange,
|
|
36
43
|
isActive: value,
|
|
@@ -17,6 +17,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
17
17
|
|
|
18
18
|
require("./CheckboxInput.scss");
|
|
19
19
|
|
|
20
|
+
var _utils = require("../../../Functions/utils");
|
|
21
|
+
|
|
20
22
|
var CheckboxInput = function CheckboxInput(_ref) {
|
|
21
23
|
var _cn2;
|
|
22
24
|
|
|
@@ -31,7 +33,9 @@ var CheckboxInput = function CheckboxInput(_ref) {
|
|
|
31
33
|
_ref$testId = _ref.testId,
|
|
32
34
|
testId = _ref$testId === void 0 ? '' : _ref$testId;
|
|
33
35
|
return /*#__PURE__*/_react.default.createElement("label", {
|
|
34
|
-
"data-testid": "checkbox--label
|
|
36
|
+
"data-testid": "checkbox--label-".concat((0, _utils.getCorrectTestId)({
|
|
37
|
+
testId: testId || id || fieldKey
|
|
38
|
+
})),
|
|
35
39
|
className: (0, _classnames.default)('checkbox-input', className, (0, _defineProperty2.default)({}, "checkbox-input_disabled", disabled)),
|
|
36
40
|
htmlFor: id
|
|
37
41
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -49,7 +53,9 @@ var CheckboxInput = function CheckboxInput(_ref) {
|
|
|
49
53
|
ref: function ref(elem) {
|
|
50
54
|
if (elem) elem.indeterminate = isStark;
|
|
51
55
|
},
|
|
52
|
-
"data-testid": "checkbox--input--".concat(
|
|
56
|
+
"data-testid": "checkbox--input--".concat((0, _utils.getCorrectTestId)({
|
|
57
|
+
testId: testId || id || fieldKey
|
|
58
|
+
}))
|
|
53
59
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
60
|
className: "checkbox-input__mark"
|
|
55
61
|
})), label && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -31,6 +31,8 @@ var _Spinner = _interopRequireDefault(require("../../Layout/Spinner/Spinner"));
|
|
|
31
31
|
|
|
32
32
|
require("./NumericInput.scss");
|
|
33
33
|
|
|
34
|
+
var _utils = require("../../../Functions/utils");
|
|
35
|
+
|
|
34
36
|
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); }
|
|
35
37
|
|
|
36
38
|
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; }
|
|
@@ -312,7 +314,9 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
312
314
|
} : {});
|
|
313
315
|
|
|
314
316
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, uniProps, {
|
|
315
|
-
"data-testid": "input
|
|
317
|
+
"data-testid": "input-".concat((0, _utils.getCorrectTestId)({
|
|
318
|
+
testId: testId || name || fieldKey || id
|
|
319
|
+
})),
|
|
316
320
|
value: (value === null || value === void 0 ? void 0 : value.length) > 0 ? (0, _fieldValueFormatters.formatToAddBitDepthPoints)((0, _fieldValueFormatters.formatToRemoveComa)(value)) : value,
|
|
317
321
|
ref: inputRef,
|
|
318
322
|
type: "text",
|
|
@@ -49,6 +49,8 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
49
49
|
} : _ref$value,
|
|
50
50
|
_ref$onChange = _ref.onChange,
|
|
51
51
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
52
|
+
_ref$validateErrors = _ref.validateErrors,
|
|
53
|
+
validateErrors = _ref$validateErrors === void 0 ? function () {} : _ref$validateErrors,
|
|
52
54
|
_ref$type = _ref.type,
|
|
53
55
|
type = _ref$type === void 0 ? 'int' : _ref$type,
|
|
54
56
|
setInnerError = _ref.setError,
|
|
@@ -101,6 +103,8 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
101
103
|
};
|
|
102
104
|
|
|
103
105
|
var rangeValidation = function rangeValidation(e, key) {
|
|
106
|
+
var _validateErrors;
|
|
107
|
+
|
|
104
108
|
var oppositeKey = key === 'from' ? 'to' : 'from';
|
|
105
109
|
|
|
106
110
|
if (!withZero && !(valueObj !== null && valueObj !== void 0 && valueObj.from) && !(valueObj !== null && valueObj !== void 0 && valueObj.to)) {
|
|
@@ -120,6 +124,9 @@ var RangeInputs = function RangeInputs(_ref) {
|
|
|
120
124
|
to: 'Invalid range'
|
|
121
125
|
}));
|
|
122
126
|
setInnerError === null || setInnerError === void 0 ? void 0 : setInnerError('Invalid range');
|
|
127
|
+
} else if ((_validateErrors = validateErrors === null || validateErrors === void 0 ? void 0 : validateErrors(valueObj === null || valueObj === void 0 ? void 0 : valueObj.from, valueObj === null || valueObj === void 0 ? void 0 : valueObj.to)) !== null && _validateErrors !== void 0 ? _validateErrors : false) {
|
|
128
|
+
//проп validateErrors вернет пустую строку, в случае если ошибок нет
|
|
129
|
+
setInnerError === null || setInnerError === void 0 ? void 0 : setInnerError(validateErrors(+state.from, +state.to));
|
|
123
130
|
} else {
|
|
124
131
|
setError({
|
|
125
132
|
from: '',
|
|
@@ -36,6 +36,9 @@ var SwitcherRange = function SwitcherRange(_ref) {
|
|
|
36
36
|
value = _ref.value,
|
|
37
37
|
onChange = _ref.onChange,
|
|
38
38
|
isInputsColumn = _ref.isInputsColumn,
|
|
39
|
+
validateErrors = _ref.validateErrors,
|
|
40
|
+
withZero = _ref.withZero,
|
|
41
|
+
isPrice = _ref.isPrice,
|
|
39
42
|
inputsType = _ref.inputsType;
|
|
40
43
|
|
|
41
44
|
var _useState = (0, _react.useState)(''),
|
|
@@ -64,7 +67,10 @@ var SwitcherRange = function SwitcherRange(_ref) {
|
|
|
64
67
|
onChange: onChange,
|
|
65
68
|
value: value,
|
|
66
69
|
setError: function setError() {},
|
|
67
|
-
isColumnPosition: isInputsColumn
|
|
70
|
+
isColumnPosition: isInputsColumn,
|
|
71
|
+
validateErrors: validateErrors,
|
|
72
|
+
withZero: withZero,
|
|
73
|
+
isPrice: isPrice
|
|
68
74
|
}));
|
|
69
75
|
};
|
|
70
76
|
|
package/dist/Functions/utils.js
CHANGED
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
exports.transformUTCTimeToLocal = transformUTCTimeToLocal;
|
|
11
11
|
exports.transformUTCHoursToLocal = transformUTCHoursToLocal;
|
|
12
12
|
exports.downloadEmulation = downloadEmulation;
|
|
13
|
-
exports.disableDefaultBehavior = exports.getOS = exports.renderFileSize = exports.getBase64 = exports.compareAlphabetical = exports.setCarretToEnd = exports.compare = exports.downloadFile = exports.checkedRef = exports.capitalized = exports.firstLetterCapital = exports.changeMeta = exports.addBitDepthPoints = exports.throttle = exports.debounce = exports.getColorById = exports.getStyles = exports.logout = exports.omitKeys = exports.clone = exports.useOutsideToggle = exports.handleObjectChange = void 0;
|
|
13
|
+
exports.getCorrectTestId = exports.disableDefaultBehavior = exports.getOS = exports.renderFileSize = exports.getBase64 = exports.compareAlphabetical = exports.setCarretToEnd = exports.compare = exports.downloadFile = exports.checkedRef = exports.capitalized = exports.firstLetterCapital = exports.changeMeta = exports.addBitDepthPoints = exports.throttle = exports.debounce = exports.getColorById = exports.getStyles = exports.logout = exports.omitKeys = exports.clone = exports.useOutsideToggle = exports.handleObjectChange = void 0;
|
|
14
14
|
|
|
15
15
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
16
16
|
|
|
@@ -516,4 +516,15 @@ String.prototype.lastIndexEqualsTo = function (index) {
|
|
|
516
516
|
// return compareItem(item);
|
|
517
517
|
// }, true);
|
|
518
518
|
// return isDependenciesSatisfied ? dependendFunction : () => {};
|
|
519
|
-
// };
|
|
519
|
+
// };
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
var getCorrectTestId = function getCorrectTestId(_ref4) {
|
|
523
|
+
var _ref4$testId = _ref4.testId,
|
|
524
|
+
testId = _ref4$testId === void 0 ? '' : _ref4$testId,
|
|
525
|
+
_ref4$withTier = _ref4.withTier,
|
|
526
|
+
withTier = _ref4$withTier === void 0 ? true : _ref4$withTier;
|
|
527
|
+
return testId && testId !== undefined ? "".concat(withTier ? '-' : '').concat(testId) : '';
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
exports.getCorrectTestId = getCorrectTestId;
|