intelicoreact 1.0.82 → 1.0.84

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.
@@ -144,7 +144,6 @@
144
144
 
145
145
  &__arrow {
146
146
  box-sizing: border-box;
147
- width: auto;
148
147
  height: 100%;
149
148
 
150
149
  cursor: pointer;
@@ -2,12 +2,16 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
8
10
  exports.default = void 0;
9
11
 
10
- var _react = _interopRequireDefault(require("react"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _react = _interopRequireWildcard(require("react"));
11
15
 
12
16
  var _classnames = _interopRequireDefault(require("classnames"));
13
17
 
@@ -15,6 +19,10 @@ var _moment = _interopRequireDefault(require("moment"));
15
19
 
16
20
  require("./DoubleString.scss");
17
21
 
22
+ 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); }
23
+
24
+ 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; }
25
+
18
26
  var RC = 'double-string';
19
27
 
20
28
  var DoubleString = function DoubleString(_ref) {
@@ -31,14 +39,39 @@ var DoubleString = function DoubleString(_ref) {
31
39
  _ref$dateFormatSettin3 = _ref$dateFormatSettin.displayFormat,
32
40
  displayFormat = _ref$dateFormatSettin3 === void 0 ? 'MM.DD.YYYY' : _ref$dateFormatSettin3;
33
41
  var computedValue = isFormatValueToDate ? (0, _moment.default)(value, parseFormat).format(displayFormat) : value;
42
+ var valueRef = (0, _react.useRef)(null);
43
+ var descriptionRef = (0, _react.useRef)(null);
44
+
45
+ var _useState = (0, _react.useState)({
46
+ valueWidth: 0,
47
+ descriptionWidth: 0
48
+ }),
49
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
+ elemsWidth = _useState2[0],
51
+ setElemsWidth = _useState2[1];
52
+
53
+ (0, _react.useEffect)(function () {
54
+ var _valueRef$current, _descriptionRef$curre;
55
+
56
+ var valueWidth = valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.clientWidth;
57
+ var descriptionWidth = descriptionRef === null || descriptionRef === void 0 ? void 0 : (_descriptionRef$curre = descriptionRef.current) === null || _descriptionRef$curre === void 0 ? void 0 : _descriptionRef$curre.clientWidth;
58
+ setElemsWidth({
59
+ valueWidth: valueWidth,
60
+ descriptionWidth: descriptionWidth
61
+ });
62
+ }, [descriptionRef, valueRef]);
34
63
  return /*#__PURE__*/_react.default.createElement("div", {
35
64
  className: (0, _classnames.default)(RC, className)
36
- }, /*#__PURE__*/_react.default.createElement("span", {
65
+ }, /*#__PURE__*/_react.default.createElement("p", {
66
+ ref: valueRef,
37
67
  "data-testid": "doubleString--".concat(testId, "--value"),
38
- className: (0, _classnames.default)("".concat(RC, "__value"))
39
- }, computedValue), /*#__PURE__*/_react.default.createElement("span", {
68
+ className: (0, _classnames.default)("".concat(RC, "__value")),
69
+ title: elemsWidth.valueWidth > 99 ? computedValue : ''
70
+ }, computedValue), /*#__PURE__*/_react.default.createElement("p", {
71
+ ref: descriptionRef,
40
72
  "data-testid": "doubleString--".concat(description, "--value"),
41
- className: (0, _classnames.default)("".concat(RC, "__description"))
73
+ className: (0, _classnames.default)("".concat(RC, "__description")),
74
+ title: elemsWidth.descriptionWidth > 99 ? computedValue : ''
42
75
  }, description));
43
76
  };
44
77
 
@@ -7,7 +7,6 @@
7
7
  &__value,
8
8
  &__description {
9
9
  color: inherit;
10
-
11
10
  font-family: inherit;
12
11
  font-size: inherit;
13
12
  font-weight: inherit;
@@ -16,14 +15,14 @@
16
15
 
17
16
  &__value {
18
17
  overflow: hidden;
19
-
20
- margin-bottom: 4px;
21
-
18
+ margin: 0 0 4px;
22
19
  white-space: nowrap;
23
20
  text-overflow: ellipsis;
21
+ max-width: 100px;
24
22
  }
25
23
 
26
24
  &__description {
27
25
  color: #9AA0B9;
26
+ margin: 0;
28
27
  }
29
28
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.formatToReplaceAllWhiteSpace = formatToReplaceAllWhiteSpace;
7
- exports.filterNumeric = exports.filterFloat = exports.formatToHex = exports.formatToLimitLength = exports.formatNumberValueToMask = exports.formatToCutOffDotAtTheEnd = exports.formatToOnlyASCIICodeText = exports.formatToLetters = exports.formatToPriceWithUSD = exports.formatToTwoDigitAfterDot = exports.formatToDollarSign = exports.formatToAddBitDepthPoints = exports.formatToRemoveComa = exports.formatOnlyNumbers = exports.intlNumbersFormatter = exports.getSafelyValue = void 0;
7
+ exports.formatToHideValuePartially = exports.filterNumeric = exports.filterFloat = exports.formatToHex = exports.formatToLimitLength = exports.formatNumberValueToMask = exports.formatToCutOffDotAtTheEnd = exports.formatToOnlyASCIICodeText = exports.formatToLetters = exports.formatToPriceWithUSD = exports.formatToTwoDigitAfterDot = exports.formatToDollarSign = exports.formatToAddBitDepthPoints = exports.formatToRemoveComa = exports.formatOnlyNumbers = exports.intlNumbersFormatter = exports.getSafelyValue = void 0;
8
8
 
9
9
  // The first word "format" in the function name means a
10
10
  //logic in which the function transforms the incoming value in any case.
@@ -285,4 +285,30 @@ var filterNumeric = function filterNumeric(value, settings) {
285
285
  return executor(getSafelyValue(value), decimalPlaces);
286
286
  };
287
287
 
288
- exports.filterNumeric = filterNumeric;
288
+ exports.filterNumeric = filterNumeric;
289
+
290
+ var formatToHideValuePartially = function formatToHideValuePartially(value, settings) {
291
+ var _ref5 = settings || {},
292
+ _ref5$showSymbolsCoun = _ref5.showSymbolsCount,
293
+ showSymbolsCount = _ref5$showSymbolsCoun === void 0 ? 4 : _ref5$showSymbolsCoun,
294
+ _ref5$isVisibleFromFr = _ref5.isVisibleFromFront,
295
+ isVisibleFromFront = _ref5$isVisibleFromFr === void 0 ? false : _ref5$isVisibleFromFr,
296
+ _ref5$isCutOutWhiteSp = _ref5.isCutOutWhiteSpaces,
297
+ isCutOutWhiteSpaces = _ref5$isCutOutWhiteSp === void 0 ? true : _ref5$isCutOutWhiteSp;
298
+
299
+ var safelyValue = getSafelyValue(value);
300
+ var newValue = isCutOutWhiteSpaces ? safelyValue.replace(/\s/g, '') : safelyValue;
301
+ if (newValue.length <= showSymbolsCount) return newValue;
302
+
303
+ var hide = function hide(val) {
304
+ return val.split('').map(function () {
305
+ return '*';
306
+ }).join('');
307
+ };
308
+
309
+ var visiblePart = isVisibleFromFront ? newValue.slice(0, showSymbolsCount) : newValue.slice(-1 * showSymbolsCount);
310
+ var hiddenPart = isVisibleFromFront ? newValue.slice(showSymbolsCount) : newValue.slice(0, -1 * showSymbolsCount);
311
+ return isVisibleFromFront ? "".concat(visiblePart).concat(hide(hiddenPart)) : "".concat(hide(hiddenPart)).concat(visiblePart);
312
+ };
313
+
314
+ exports.formatToHideValuePartially = formatToHideValuePartially;
@@ -112,7 +112,10 @@ var addRangeDefault = function addRangeDefault(from, to, currentValues, decimalP
112
112
  acc.from = null;
113
113
  processTo();
114
114
  } else {
115
- acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), (0, _toConsumableArray2.default)(!isRangeMustBeIncludet ? [range] : []));
115
+ acc.result = [].concat((0, _toConsumableArray2.default)(acc.result), (0, _toConsumableArray2.default)(!isRangeMustBeIncludet ? [range] : []), [{
116
+ from: Math.round10(acc.from, -1 * decimalPlaces),
117
+ to: Math.round10(acc.to, -1 * decimalPlaces)
118
+ }]);
116
119
  }
117
120
  }
118
121
  return acc;
@@ -392,18 +392,20 @@ var compareAlphabetical = function compareAlphabetical(a, b) {
392
392
  exports.compareAlphabetical = compareAlphabetical;
393
393
 
394
394
  var getBase64 = function getBase64(file) {
395
- return new Promise(function (resolve, reject) {
396
- var reader = new FileReader();
397
- reader.readAsDataURL(file);
398
-
399
- reader.onload = function () {
400
- return resolve(reader.result);
401
- };
402
-
403
- reader.onerror = function (error) {
404
- return reject('Error: ', error);
405
- };
406
- });
395
+ if (file) {
396
+ return new Promise(function (resolve, reject) {
397
+ var reader = new FileReader();
398
+ reader.readAsDataURL(file);
399
+
400
+ reader.onload = function () {
401
+ return resolve(reader.result);
402
+ };
403
+
404
+ reader.onerror = function (error) {
405
+ return reject('Error: ', error);
406
+ };
407
+ });
408
+ }
407
409
  };
408
410
 
409
411
  exports.getBase64 = getBase64;
@@ -1,6 +1,6 @@
1
1
  @import "./fonts";
2
2
  @import "~anme/scss/anme-vars";
3
- @import "anme/scss/styles.scss";
3
+ @import "~anme/scss/styles.scss";
4
4
 
5
5
  body {
6
6
  margin: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [