intelicoreact 1.1.68 → 1.1.70

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,
@@ -135,18 +135,19 @@ var OpenedPart = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
135
135
  // { 'form-select-options--hoverable': isHoverable },
136
136
  )
137
137
  }, items.map(function (item, index) {
138
- var _intervals$item, _intervals$item2, _intervals$item2$star, _intervals$item2$star2, _intervals$item2$star3;
138
+ var _intervals$item, _intervals$item2, _intervals$item3, _intervals$item3$star, _intervals$item3$star2, _intervals$item3$star3;
139
139
 
140
+ if ((_intervals$item = _dependencies.INTERVALS[item]) !== null && _intervals$item !== void 0 && _intervals$item.isHidden) return null;
140
141
  return /*#__PURE__*/_react.default.createElement(_SelectItem.default, {
141
142
  testId: testId,
142
143
  key: index,
143
144
  item: item,
144
- label: (txt === null || txt === void 0 ? void 0 : txt.labels) && (txt === null || txt === void 0 ? void 0 : txt.labels[item]) || ((_intervals$item = _dependencies.INTERVALS[item]) === null || _intervals$item === void 0 ? void 0 : _intervals$item.label) || (item === _dependencies.CUSTOM_INTERVAL_KEY ? _dependencies.CUSTOM_INTERVAL_KEY_TEXT : item),
145
+ label: (txt === null || txt === void 0 ? void 0 : txt.labels) && (txt === null || txt === void 0 ? void 0 : txt.labels[item]) || ((_intervals$item2 = _dependencies.INTERVALS[item]) === null || _intervals$item2 === void 0 ? void 0 : _intervals$item2.label) || (item === _dependencies.CUSTOM_INTERVAL_KEY ? _dependencies.CUSTOM_INTERVAL_KEY_TEXT : item),
145
146
  isActive: activeInterval === item,
146
147
  onItemClick: function onItemClick() {
147
148
  return handleItemClick(item.value || item);
148
149
  },
149
- disabled: item === _dependencies.CUSTOM_INTERVAL_KEY || minDate && ((_intervals$item2 = _dependencies.INTERVALS[item]) === null || _intervals$item2 === void 0 ? void 0 : (_intervals$item2$star = _intervals$item2.start) === null || _intervals$item2$star === void 0 ? void 0 : (_intervals$item2$star2 = _intervals$item2$star.call(_intervals$item2)) === null || _intervals$item2$star2 === void 0 ? void 0 : (_intervals$item2$star3 = _intervals$item2$star2.isBefore) === null || _intervals$item2$star3 === void 0 ? void 0 : _intervals$item2$star3.call(_intervals$item2$star2, momentMinDate))
150
+ disabled: item === _dependencies.CUSTOM_INTERVAL_KEY || minDate && ((_intervals$item3 = _dependencies.INTERVALS[item]) === null || _intervals$item3 === void 0 ? void 0 : (_intervals$item3$star = _intervals$item3.start) === null || _intervals$item3$star === void 0 ? void 0 : (_intervals$item3$star2 = _intervals$item3$star.call(_intervals$item3)) === null || _intervals$item3$star2 === void 0 ? void 0 : (_intervals$item3$star3 = _intervals$item3$star2.isBefore) === null || _intervals$item3$star3 === void 0 ? void 0 : _intervals$item3$star3.call(_intervals$item3$star2, momentMinDate))
150
151
  });
151
152
  })), !isCompact && /*#__PURE__*/_react.default.createElement(_Datepicker.default, {
152
153
  testId: testId,
@@ -174,7 +174,7 @@ var INTERVALS = {
174
174
  }
175
175
  },
176
176
  last6Months: {
177
- label: '6 Months',
177
+ label: 'Last 6 Months',
178
178
  start: function start() {
179
179
  return (0, _momentTimezone.default)().subtract(6, 'month').startOf('month');
180
180
  },
@@ -182,6 +182,16 @@ var INTERVALS = {
182
182
  return (0, _momentTimezone.default)().startOf('month');
183
183
  }
184
184
  },
185
+ sixMonths: {
186
+ label: '6 Months',
187
+ isHidden: true,
188
+ start: function start() {
189
+ return (0, _momentTimezone.default)().subtract(6, 'month');
190
+ },
191
+ end: function end() {
192
+ return (0, _momentTimezone.default)().add(1, 'day').startOf('day');
193
+ }
194
+ },
185
195
  thisYear: {
186
196
  label: 'This Year',
187
197
  start: function start() {
@@ -191,6 +201,16 @@ var INTERVALS = {
191
201
  return (0, _momentTimezone.default)().add(1, 'day').startOf('day');
192
202
  }
193
203
  },
204
+ year: {
205
+ label: 'Year',
206
+ isHidden: true,
207
+ start: function start() {
208
+ return (0, _momentTimezone.default)().subtract(1, 'year');
209
+ },
210
+ end: function end() {
211
+ return (0, _momentTimezone.default)().add(1, 'day').startOf('day');
212
+ }
213
+ },
194
214
  lastYear: {
195
215
  label: 'Last Year',
196
216
  start: function start() {
@@ -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)('black'),
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
- }, type !== 'right' ? /*#__PURE__*/_react.default.createElement("svg", {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.1.68",
3
+ "version": "1.1.70",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [