intelicoreact 1.1.69 → 1.1.71
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.
|
@@ -64,7 +64,8 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
64
64
|
_props$format = props.format,
|
|
65
65
|
format = _props$format === void 0 ? 'MM/DD/YYYY' : _props$format,
|
|
66
66
|
isDontLimitFuture = props.isDontLimitFuture,
|
|
67
|
-
isListTop = props.isListTop
|
|
67
|
+
isListTop = props.isListTop,
|
|
68
|
+
isAltArrows = props.isAltArrows;
|
|
68
69
|
var formatedMinDate = (0, _momentTimezone.default)(minDate).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(minDate).format(format) : null;
|
|
69
70
|
var formatedMaxDate = (0, _momentTimezone.default)(maxDate).format(format) !== 'Invalid date' ? (0, _momentTimezone.default)(maxDate).format(format) : null;
|
|
70
71
|
var momentMinDate = (0, _momentTimezone.default)(formatedMinDate, format).startOf('day');
|
|
@@ -223,7 +224,8 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
223
224
|
onClick: function onClick() {
|
|
224
225
|
return handleArrowClick('left');
|
|
225
226
|
},
|
|
226
|
-
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY || formatedMinDate && (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start).subtract((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isBefore(momentMinDate)
|
|
227
|
+
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY || formatedMinDate && (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start).subtract((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isBefore(momentMinDate),
|
|
228
|
+
isAlt: isAltArrows
|
|
227
229
|
}), /*#__PURE__*/_react.default.createElement(_Arrow.default, {
|
|
228
230
|
testId: testId,
|
|
229
231
|
type: "right",
|
|
@@ -231,7 +233,8 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
231
233
|
onClick: function onClick() {
|
|
232
234
|
return handleArrowClick('right');
|
|
233
235
|
},
|
|
234
|
-
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY || !isDontLimitFuture && (formatedMaxDate ? (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).endOf('day').subtract((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isAfter(momentMaxDate.startOf('day')) : (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).add((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isAfter((0, _momentTimezone.default)().add(1, 'day').startOf('day')))
|
|
236
|
+
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY || !isDontLimitFuture && (formatedMaxDate ? (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).endOf('day').subtract((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isAfter(momentMaxDate.startOf('day')) : (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).add((0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).diff(actualValues === null || actualValues === void 0 ? void 0 : actualValues.start, 'hours'), 'hours').isAfter((0, _momentTimezone.default)().add(1, 'day').startOf('day'))),
|
|
237
|
+
isAlt: isAltArrows
|
|
235
238
|
}))), isToggled && !isUseAbs && /*#__PURE__*/_react.default.createElement(_OpenedPart.default, (0, _extends2.default)({}, props, {
|
|
236
239
|
testId: testId,
|
|
237
240
|
ref: internalContainerRef,
|
|
@@ -31,22 +31,16 @@ var useClickOutside = function useClickOutside(hideComponent, additionalComponen
|
|
|
31
31
|
var ref = (0, _react.useRef)(null);
|
|
32
32
|
|
|
33
33
|
var checkCondition = function checkCondition(target) {
|
|
34
|
-
if (additionalComponent) {
|
|
35
|
-
|
|
36
|
-
var _ref$current, _Array$from;
|
|
34
|
+
if (additionalComponent && additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.length) {
|
|
35
|
+
var _ref$current, _Array$from;
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} else {
|
|
42
|
-
var _ref$current2;
|
|
43
|
-
|
|
44
|
-
return !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target)) && !(additionalComponent !== null && additionalComponent !== void 0 && additionalComponent.contains(target));
|
|
45
|
-
}
|
|
37
|
+
return !((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(target)) && !((_Array$from = Array.from(additionalComponent)) !== null && _Array$from !== void 0 && _Array$from.some(function (item) {
|
|
38
|
+
return item === null || item === void 0 ? void 0 : item.contains(target);
|
|
39
|
+
}));
|
|
46
40
|
} else {
|
|
47
|
-
var _ref$
|
|
41
|
+
var _ref$current2;
|
|
48
42
|
|
|
49
|
-
return !((_ref$
|
|
43
|
+
return !((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.contains(target));
|
|
50
44
|
}
|
|
51
45
|
};
|
|
52
46
|
|
|
@@ -28,11 +28,12 @@ var Arrow = function Arrow(_ref) {
|
|
|
28
28
|
className = _ref.className,
|
|
29
29
|
onClick = _ref.onClick,
|
|
30
30
|
disabled = _ref.disabled,
|
|
31
|
-
testId = _ref.testId
|
|
31
|
+
testId = _ref.testId,
|
|
32
|
+
isAlt = _ref.isAlt;
|
|
32
33
|
if (!type || type !== 'left' && type !== 'right') return null;
|
|
33
34
|
var ref = (0, _react.useRef)();
|
|
34
35
|
|
|
35
|
-
var _useState = (0, _react.useState)('
|
|
36
|
+
var _useState = (0, _react.useState)('currentColor'),
|
|
36
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
38
|
color = _useState2[0],
|
|
38
39
|
setColor = _useState2[1];
|
|
@@ -42,6 +43,84 @@ var Arrow = function Arrow(_ref) {
|
|
|
42
43
|
setColor((0, _utils.getStyles)(ref.current, 'color'));
|
|
43
44
|
}
|
|
44
45
|
}, [ref.current]);
|
|
46
|
+
|
|
47
|
+
function renderSVG() {
|
|
48
|
+
if (type === 'left') {
|
|
49
|
+
if (isAlt) return /*#__PURE__*/_react.default.createElement("svg", {
|
|
50
|
+
version: "1.1",
|
|
51
|
+
id: "Layer_1",
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
width: "16",
|
|
54
|
+
height: "16",
|
|
55
|
+
viewBox: "0 0 16 16"
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
57
|
+
d: "M12.7,8H3.3",
|
|
58
|
+
stroke: color,
|
|
59
|
+
fill: "none",
|
|
60
|
+
strokeWidth: 1.3333,
|
|
61
|
+
strokeLinecap: "round",
|
|
62
|
+
strokeLinejoin: "round"
|
|
63
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
64
|
+
d: "M8,3.3L3.3,8L8,12.7",
|
|
65
|
+
stroke: color,
|
|
66
|
+
fill: "none",
|
|
67
|
+
strokeWidth: 1.3333,
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
}));
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
72
|
+
"data-testid": "arrow-left",
|
|
73
|
+
width: "24",
|
|
74
|
+
height: "24",
|
|
75
|
+
viewBox: "0 0 24 24",
|
|
76
|
+
fill: "none",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
79
|
+
d: "M15 18L9 12L15 6",
|
|
80
|
+
stroke: color,
|
|
81
|
+
strokeWidth: "2",
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeLinejoin: "round"
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (isAlt) return /*#__PURE__*/_react.default.createElement("svg", {
|
|
88
|
+
id: "Layer_1",
|
|
89
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
90
|
+
width: "16",
|
|
91
|
+
height: "16",
|
|
92
|
+
viewBox: "0 0 16 16"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
94
|
+
d: "M3.3,8h9.3",
|
|
95
|
+
stroke: color,
|
|
96
|
+
fill: "none",
|
|
97
|
+
strokeWidth: 1.3333,
|
|
98
|
+
strokeLinecap: "round",
|
|
99
|
+
strokeLinejoin: "round"
|
|
100
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
101
|
+
d: "M8,3.3L12.7,8L8,12.7",
|
|
102
|
+
stroke: color,
|
|
103
|
+
fill: "none",
|
|
104
|
+
strokeWidth: 1.3333,
|
|
105
|
+
strokeLinecap: "round",
|
|
106
|
+
strokeLinejoin: "round"
|
|
107
|
+
}));
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
109
|
+
"data-testid": "arrow-right",
|
|
110
|
+
width: "24",
|
|
111
|
+
height: "24",
|
|
112
|
+
viewBox: "0 0 24 24",
|
|
113
|
+
fill: "none",
|
|
114
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
116
|
+
d: "M9 18L15 12L9 6",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
strokeWidth: "2",
|
|
119
|
+
strokeLinecap: "round",
|
|
120
|
+
strokeLinejoin: "round"
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
|
|
45
124
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
125
|
"data-testid": "arrow--key-".concat(testId, "--type-").concat(type),
|
|
47
126
|
ref: ref,
|
|
@@ -49,33 +128,7 @@ var Arrow = function Arrow(_ref) {
|
|
|
49
128
|
arrow_disabled: disabled
|
|
50
129
|
}),
|
|
51
130
|
onClick: onClick
|
|
52
|
-
},
|
|
53
|
-
"data-testid": "arrow-left",
|
|
54
|
-
width: "24",
|
|
55
|
-
height: "24",
|
|
56
|
-
viewBox: "0 0 24 24",
|
|
57
|
-
fill: "none",
|
|
58
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
60
|
-
d: "M15 18L9 12L15 6",
|
|
61
|
-
stroke: color,
|
|
62
|
-
strokeWidth: "2",
|
|
63
|
-
strokeLinecap: "round",
|
|
64
|
-
strokeLinejoin: "round"
|
|
65
|
-
})) : /*#__PURE__*/_react.default.createElement("svg", {
|
|
66
|
-
"data-testid": "arrow-right",
|
|
67
|
-
width: "24",
|
|
68
|
-
height: "24",
|
|
69
|
-
viewBox: "0 0 24 24",
|
|
70
|
-
fill: "none",
|
|
71
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
73
|
-
d: "M9 18L15 12L9 6",
|
|
74
|
-
stroke: color,
|
|
75
|
-
strokeWidth: "2",
|
|
76
|
-
strokeLinecap: "round",
|
|
77
|
-
strokeLinejoin: "round"
|
|
78
|
-
})));
|
|
131
|
+
}, renderSVG());
|
|
79
132
|
};
|
|
80
133
|
|
|
81
134
|
var _default = Arrow;
|