intelicoreact 1.2.27 → 1.2.29
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.
|
@@ -87,6 +87,7 @@ var Modal = function Modal(_ref2) {
|
|
|
87
87
|
_ref2$closeOnEsc = _ref2.closeOnEsc,
|
|
88
88
|
closeOnEsc = _ref2$closeOnEsc === void 0 ? false : _ref2$closeOnEsc,
|
|
89
89
|
leftContentOfFooter = _ref2.leftContentOfFooter,
|
|
90
|
+
customFooter = _ref2.customFooter,
|
|
90
91
|
testId = _ref2.testId,
|
|
91
92
|
noHeaderCloseBtn = _ref2.noHeaderCloseBtn,
|
|
92
93
|
_ref2$noMobileModalLo = _ref2.noMobileModalLogic,
|
|
@@ -169,14 +170,14 @@ var Modal = function Modal(_ref2) {
|
|
|
169
170
|
className: (0, _classnames.default)('modal__body', {
|
|
170
171
|
'modal__body--no-footer': noFooter
|
|
171
172
|
})
|
|
172
|
-
}), children), !noFooter && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
173
|
+
}), children), (!noFooter || customFooter) && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
173
174
|
wrapperRef: modalMobileFooterRef,
|
|
174
175
|
className: (0, _classnames.default)({
|
|
175
176
|
'modal__footer--hidden': MODALS_LOGIC.IS_FOOTER_HIDDEN,
|
|
176
177
|
'modal__footer--sticky': !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY,
|
|
177
178
|
'modal__footer_with-left-content': leftContentOfFooter
|
|
178
179
|
})
|
|
179
|
-
}, leftContentOfFooter, /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
}, customFooter || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, leftContentOfFooter, !noCloseBtn && !noConfirmBtn && /*#__PURE__*/_react.default.createElement("div", {
|
|
180
181
|
className: "modal__buttons-block"
|
|
181
182
|
}, !noCloseBtn && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
182
183
|
testId: "modal",
|
|
@@ -201,7 +202,7 @@ var Modal = function Modal(_ref2) {
|
|
|
201
202
|
disabled: confirmBtnDisable,
|
|
202
203
|
icon: confirmBtnIcon,
|
|
203
204
|
isIconRight: isConfirmBtnIconPositionRight
|
|
204
|
-
}))))));
|
|
205
|
+
})))))));
|
|
205
206
|
};
|
|
206
207
|
|
|
207
208
|
if (!isOpen) return null;
|
|
@@ -275,40 +275,42 @@ function formatToReplaceAllWhiteSpace(str) {
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
var filterFloat = function filterFloat(inputValue) {
|
|
278
|
+
var _output, _output2, _output3, _output4;
|
|
279
|
+
|
|
278
280
|
var decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
279
281
|
var value = getSafelyValue(inputValue);
|
|
280
282
|
|
|
281
283
|
var replacer = function replacer(input) {
|
|
282
|
-
|
|
284
|
+
var _ref3;
|
|
285
|
+
|
|
286
|
+
return (_ref3 = '' + input) === null || _ref3 === void 0 ? void 0 : _ref3.replace(/[^\.\d,]/g, '');
|
|
283
287
|
};
|
|
284
288
|
|
|
285
289
|
if (value.length === 1 && (value[0] === '.' || value[0] === ',')) return '0.';
|
|
286
290
|
var output = value;
|
|
287
|
-
var previousValue = '' + output.slice(0, -1);
|
|
288
|
-
var lastSym = '' + output.slice(-1);
|
|
291
|
+
var previousValue = '' + ((_output = output) === null || _output === void 0 ? void 0 : _output.slice(0, -1));
|
|
292
|
+
var lastSym = '' + ((_output2 = output) === null || _output2 === void 0 ? void 0 : _output2.slice(-1));
|
|
289
293
|
|
|
290
|
-
if (decimalPlaces && typeof decimalPlaces === 'number' && previousValue.includes('.') && previousValue.indexOf('.') + 1 + decimalPlaces === previousValue.length) {
|
|
294
|
+
if (decimalPlaces && typeof decimalPlaces === 'number' && previousValue !== null && previousValue !== void 0 && previousValue.includes('.') && (previousValue === null || previousValue === void 0 ? void 0 : previousValue.indexOf('.')) + 1 + decimalPlaces === (previousValue === null || previousValue === void 0 ? void 0 : previousValue.length)) {
|
|
291
295
|
return replacer(previousValue);
|
|
292
296
|
}
|
|
293
297
|
|
|
294
|
-
if (output.includes('.') && output[output.indexOf('.') + 3] !== undefined && Number(output)) {
|
|
295
|
-
|
|
298
|
+
if ((_output3 = output) !== null && _output3 !== void 0 && _output3.includes('.') && output[((_output4 = output) === null || _output4 === void 0 ? void 0 : _output4.indexOf('.')) + 3] !== undefined && Number(output)) {
|
|
299
|
+
var _Number;
|
|
300
|
+
|
|
301
|
+
output = (_Number = Number(output)) === null || _Number === void 0 ? void 0 : _Number.toFixed(decimalPlaces);
|
|
296
302
|
}
|
|
297
303
|
|
|
298
|
-
return replacer(lastSym === '.' && previousValue.includes('.') ? previousValue : output);
|
|
304
|
+
return replacer(lastSym === '.' && previousValue !== null && previousValue !== void 0 && previousValue.includes('.') ? previousValue : output);
|
|
299
305
|
};
|
|
300
306
|
|
|
301
307
|
exports.filterFloat = filterFloat;
|
|
302
308
|
|
|
303
309
|
var filterNumeric = function filterNumeric(value, settings) {
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
var _ref3 = settings || {},
|
|
309
|
-
_ref3$type = _ref3.type,
|
|
310
|
-
type = _ref3$type === void 0 ? 'float' : _ref3$type,
|
|
311
|
-
decimalPlaces = _ref3.decimalPlaces;
|
|
310
|
+
var _ref4 = settings || {},
|
|
311
|
+
_ref4$type = _ref4.type,
|
|
312
|
+
type = _ref4$type === void 0 ? 'float' : _ref4$type,
|
|
313
|
+
decimalPlaces = _ref4.decimalPlaces;
|
|
312
314
|
|
|
313
315
|
var executor = type === 'float' ? filterFloat : formatOnlyNumbers;
|
|
314
316
|
return executor(getSafelyValue(value), decimalPlaces);
|
|
@@ -317,13 +319,13 @@ var filterNumeric = function filterNumeric(value, settings) {
|
|
|
317
319
|
exports.filterNumeric = filterNumeric;
|
|
318
320
|
|
|
319
321
|
var formatToHideValuePartially = function formatToHideValuePartially(value, settings) {
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
showSymbolsCount =
|
|
323
|
-
|
|
324
|
-
isVisibleFromFront =
|
|
325
|
-
|
|
326
|
-
isCutOutWhiteSpaces =
|
|
322
|
+
var _ref5 = settings || {},
|
|
323
|
+
_ref5$showSymbolsCoun = _ref5.showSymbolsCount,
|
|
324
|
+
showSymbolsCount = _ref5$showSymbolsCoun === void 0 ? 4 : _ref5$showSymbolsCoun,
|
|
325
|
+
_ref5$isVisibleFromFr = _ref5.isVisibleFromFront,
|
|
326
|
+
isVisibleFromFront = _ref5$isVisibleFromFr === void 0 ? false : _ref5$isVisibleFromFr,
|
|
327
|
+
_ref5$isCutOutWhiteSp = _ref5.isCutOutWhiteSpaces,
|
|
328
|
+
isCutOutWhiteSpaces = _ref5$isCutOutWhiteSp === void 0 ? true : _ref5$isCutOutWhiteSp;
|
|
327
329
|
|
|
328
330
|
var safelyValue = getSafelyValue(value);
|
|
329
331
|
var newValue = isCutOutWhiteSpaces ? safelyValue.replace(/\s/g, '') : safelyValue;
|