intelicoreact 0.0.74 → 0.0.75

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.
@@ -96,20 +96,14 @@ var InputDateRange = function InputDateRange(props) {
96
96
  return formatedValue;
97
97
  };
98
98
 
99
- var _useState5 = (0, _react.useState)(false),
100
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
101
- mountDate = _useState6[0],
102
- setMD = _useState6[1];
103
-
104
- (0, _react.useEffect)(function () {
105
- if (value && value.start && !mountDate) {
106
- setMD(true);
107
- handleChange(_objectSpread({}, value));
108
- }
109
- }, [value]);
110
-
111
99
  var Range = function Range() {
112
100
  var SYMBOLS_QUANTITY_IF_TIME_ADDED = 13;
101
+
102
+ if (!actualValues.start && value.start) {
103
+ actualValues.start = value.start;
104
+ actualValues.end = value.end || '';
105
+ }
106
+
113
107
  var start = actualValues.start,
114
108
  end = actualValues.end;
115
109
  if (!start || !end) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.0.74",
3
+ "version": "0.0.75",
4
4
  "description": "Date range fixes and dropdown refactor",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -49,17 +49,12 @@ const InputDateRange = props => {
49
49
  return formatedValue;
50
50
  };
51
51
 
52
- const [mountDate, setMD] = useState(false);
53
-
54
- useEffect(() => {
55
- if (value && value.start && !mountDate) {
56
- setMD(true);
57
- handleChange({ ...value });
58
- }
59
- }, [value]);
60
-
61
52
  const Range = () => {
62
53
  const SYMBOLS_QUANTITY_IF_TIME_ADDED = 13;
54
+ if (!actualValues.start && value.start) {
55
+ actualValues.start = value.start;
56
+ actualValues.end = value.end || '';
57
+ }
63
58
  const { start, end } = actualValues;
64
59
  if (!start || !end) return null;
65
60
 
@@ -162,7 +157,7 @@ const InputDateRange = props => {
162
157
  <div className="date-range-input__interval-key">
163
158
  <span>
164
159
  {(txt?.labels && txt.labels[actualValues?.intervalKey]) ??
165
- (INTERVALS[actualValues?.intervalKey]?.label || CUSTOM_INTERVAL_KEY_TEXT)}
160
+ (INTERVALS[actualValues?.intervalKey]?.label || CUSTOM_INTERVAL_KEY_TEXT)}
166
161
  </span>
167
162
  {current !== ALL_TIME_KEY && <span>:</span>}
168
163
  </div>