intelicoreact 1.0.83 → 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.
|
@@ -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
|
|
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("
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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;
|
package/dist/Functions/utils.js
CHANGED
|
@@ -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
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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;
|