intelicoreact 0.0.61 → 0.0.65
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.
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +53 -43
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.scss +7 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +161 -4
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +6 -3
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +5 -3
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +14 -6
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +8 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +7 -2
- package/package.json +1 -1
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.js +220 -213
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.scss +7 -6
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +102 -11
- package/src/Atomic/FormElements/InputDateRange/components/Datepicker.js +4 -1
- package/src/Atomic/FormElements/InputDateRange/components/OpenedPart.js +4 -2
- package/src/Atomic/FormElements/InputDateRange/components/SelectItem.js +5 -3
- package/src/Atomic/FormElements/InputDateRange/dependencies.js +8 -0
- package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.js +5 -2
|
@@ -62,6 +62,7 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
62
62
|
hideArrows = _props$hideArrows === void 0 ? false : _props$hideArrows,
|
|
63
63
|
isOptionsRight = props.isOptionsRight,
|
|
64
64
|
limitRange = props.limitRange,
|
|
65
|
+
isShortWeekNames = props.isShortWeekNames,
|
|
65
66
|
isUseAbs = props.isUseAbs,
|
|
66
67
|
absTooltip = props.absTooltip;
|
|
67
68
|
var actualValues = (0, _dependencies.getActualDateRange)(value);
|
|
@@ -86,6 +87,25 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
86
87
|
var internalContainerRef = (0, _react.useRef)(null);
|
|
87
88
|
var isEndDateNearFuture = (0, _momentTimezone.default)(actualValues === null || actualValues === void 0 ? void 0 : actualValues.end).isSameOrAfter((0, _momentTimezone.default)());
|
|
88
89
|
|
|
90
|
+
var handleChange = function handleChange(input) {
|
|
91
|
+
var newValue = (0, _dependencies.getActualDateRange)(input);
|
|
92
|
+
|
|
93
|
+
var formatedValue = _objectSpread(_objectSpread(_objectSpread({
|
|
94
|
+
intervalKey: newValue.intervalKey,
|
|
95
|
+
start: newValue.start ? (0, _momentTimezone.default)(newValue.start).format('YYYY-MM-DDTHH:mm') : newValue.start,
|
|
96
|
+
end: newValue.end ? (0, _momentTimezone.default)(newValue.end).format('YYYY-MM-DDTHH:mm') : newValue.end
|
|
97
|
+
}, newValue.compare ? {
|
|
98
|
+
compare: newValue.compare
|
|
99
|
+
} : {}), newValue.startPrevDate ? {
|
|
100
|
+
startPrevDate: (0, _momentTimezone.default)(newValue.startPrevDate).format('YYYY-MM-DDTHH:mm')
|
|
101
|
+
} : {}), newValue.endPrevDate ? {
|
|
102
|
+
endPrevDate: (0, _momentTimezone.default)(newValue.endPrevDate).format('YYYY-MM-DDTHH:mm')
|
|
103
|
+
} : {});
|
|
104
|
+
|
|
105
|
+
onChange(formatedValue);
|
|
106
|
+
return formatedValue;
|
|
107
|
+
};
|
|
108
|
+
|
|
89
109
|
var Range = function Range() {
|
|
90
110
|
var SYMBOLS_QUANTITY_IF_TIME_ADDED = 13;
|
|
91
111
|
var start = actualValues.start,
|
|
@@ -116,8 +136,7 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
116
136
|
var start = actualValues.start,
|
|
117
137
|
end = actualValues.end;
|
|
118
138
|
var intervalHoursCount = (0, _momentTimezone.default)(end).diff(start, 'hours');
|
|
119
|
-
var newEnd;
|
|
120
|
-
var newStart;
|
|
139
|
+
var newEnd, newStart;
|
|
121
140
|
var endHours = (0, _momentTimezone.default)(end).hours();
|
|
122
141
|
var startHours = (0, _momentTimezone.default)(start).hours();
|
|
123
142
|
|
|
@@ -131,7 +150,7 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
131
150
|
|
|
132
151
|
var startPrevDate = (0, _momentTimezone.default)(newStart).subtract(intervalHoursCount, 'hours').subtract(1, 'seconds');
|
|
133
152
|
var endPrevDate = (0, _momentTimezone.default)(newEnd).subtract(1, 'seconds');
|
|
134
|
-
|
|
153
|
+
handleChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
135
154
|
intervalKey: (_getActualDateRange = (0, _dependencies.getActualDateRange)({
|
|
136
155
|
start: newStart,
|
|
137
156
|
end: newEnd
|
|
@@ -146,36 +165,34 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
146
165
|
var handleArrowClick = function handleArrowClick(type) {
|
|
147
166
|
slideInterval(type === 'right' ? 'forward' : 'back');
|
|
148
167
|
toggleOff();
|
|
149
|
-
};
|
|
168
|
+
}; // const absData = useMemo(
|
|
169
|
+
// () => ({
|
|
170
|
+
// body: OpenedPart,
|
|
171
|
+
// props: {
|
|
172
|
+
// ...props,
|
|
173
|
+
// key: `${actualValues.start}-${actualValues.end}-${actualValues.intervalKey}-${current}-${isCompare}`,
|
|
174
|
+
// actualValues,
|
|
175
|
+
// current,
|
|
176
|
+
// setCurrent,
|
|
177
|
+
// isCompare,
|
|
178
|
+
// setIsCompare,
|
|
179
|
+
// toggleOff,
|
|
180
|
+
// onChange,
|
|
181
|
+
// },
|
|
182
|
+
// clickOutsideCallback: () => toggleOff(),
|
|
183
|
+
// top: internalContainerRef.current?.getBoundingClientRect()?.bottom || 0,
|
|
184
|
+
// left: internalContainerRef.current?.getBoundingClientRect()?.left || 0,
|
|
185
|
+
// }),
|
|
186
|
+
// [isToggled, value, actualValues, current, isCompare],
|
|
187
|
+
// );
|
|
188
|
+
// useEffect(() => {
|
|
189
|
+
// if (current && isUseAbs && absTooltip) onChange(current, 'absTooltip/props/current');
|
|
190
|
+
// }, [current]);
|
|
191
|
+
// useEffect(() => {
|
|
192
|
+
// if (isUseAbs) onChange(isToggled ? absData : null, 'absTooltip');
|
|
193
|
+
// }, [isToggled]);
|
|
194
|
+
|
|
150
195
|
|
|
151
|
-
var absData = (0, _react.useMemo)(function () {
|
|
152
|
-
var _internalContainerRef, _internalContainerRef2, _internalContainerRef3, _internalContainerRef4;
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
body: _OpenedPart.default,
|
|
156
|
-
props: _objectSpread(_objectSpread({}, props), {}, {
|
|
157
|
-
key: "".concat(actualValues.start, "-").concat(actualValues.end, "-").concat(actualValues.intervalKey, "-").concat(current, "-").concat(isCompare),
|
|
158
|
-
actualValues: actualValues,
|
|
159
|
-
current: current,
|
|
160
|
-
setCurrent: setCurrent,
|
|
161
|
-
isCompare: isCompare,
|
|
162
|
-
setIsCompare: setIsCompare,
|
|
163
|
-
toggleOff: toggleOff,
|
|
164
|
-
onChange: onChange
|
|
165
|
-
}),
|
|
166
|
-
clickOutsideCallback: function clickOutsideCallback() {
|
|
167
|
-
return toggleOff();
|
|
168
|
-
},
|
|
169
|
-
top: ((_internalContainerRef = internalContainerRef.current) === null || _internalContainerRef === void 0 ? void 0 : (_internalContainerRef2 = _internalContainerRef.getBoundingClientRect()) === null || _internalContainerRef2 === void 0 ? void 0 : _internalContainerRef2.bottom) || 0,
|
|
170
|
-
left: ((_internalContainerRef3 = internalContainerRef.current) === null || _internalContainerRef3 === void 0 ? void 0 : (_internalContainerRef4 = _internalContainerRef3.getBoundingClientRect()) === null || _internalContainerRef4 === void 0 ? void 0 : _internalContainerRef4.left) || 0
|
|
171
|
-
};
|
|
172
|
-
}, [isToggled, value, actualValues, current, isCompare]);
|
|
173
|
-
(0, _react.useEffect)(function () {
|
|
174
|
-
if (current && isUseAbs && absTooltip) onChange(current, 'absTooltip/props/current');
|
|
175
|
-
}, [current]);
|
|
176
|
-
(0, _react.useEffect)(function () {
|
|
177
|
-
if (isUseAbs) onChange(isToggled ? absData : null, 'absTooltip');
|
|
178
|
-
}, [isToggled]);
|
|
179
196
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
180
197
|
ref: internalContainerRef,
|
|
181
198
|
className: (0, _classnames.default)('date-range-input', className, {
|
|
@@ -200,14 +217,7 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
200
217
|
className: (0, _classnames.default)('date-range-input__static-part')
|
|
201
218
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
202
219
|
id: id,
|
|
203
|
-
className: (0, _classnames.default)('date-range-input__toggle-button')
|
|
204
|
-
// 'date-range-input__toggle-button',
|
|
205
|
-
// { 'form-select__input--disabled': disabled },
|
|
206
|
-
// { 'form-select__input--opened': isToggled },
|
|
207
|
-
// { 'form-select__input--focused': isToggled },
|
|
208
|
-
// className,
|
|
209
|
-
// )}
|
|
210
|
-
,
|
|
220
|
+
className: (0, _classnames.default)('date-range-input__toggle-button'),
|
|
211
221
|
disabled: disabled,
|
|
212
222
|
onClick: !disabled && !isHoverable ? toggle : undefined
|
|
213
223
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -220,14 +230,14 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
220
230
|
type: "left",
|
|
221
231
|
className: "date-range-input__arrow",
|
|
222
232
|
onClick: function onClick() {
|
|
223
|
-
return handleArrowClick(
|
|
233
|
+
return handleArrowClick("left");
|
|
224
234
|
},
|
|
225
235
|
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY
|
|
226
236
|
}), /*#__PURE__*/_react.default.createElement(_Arrow.default, {
|
|
227
237
|
type: "right",
|
|
228
238
|
className: "date-range-input__arrow",
|
|
229
239
|
onClick: function onClick() {
|
|
230
|
-
return handleArrowClick(
|
|
240
|
+
return handleArrowClick("right");
|
|
231
241
|
},
|
|
232
242
|
disabled: disabled || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === _dependencies.ALL_TIME_KEY || (actualValues === null || actualValues === void 0 ? void 0 : actualValues.intervalKey) === 'today' || (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'))
|
|
233
243
|
}))), isToggled && !isUseAbs && /*#__PURE__*/_react.default.createElement(_OpenedPart.default, (0, _extends2.default)({}, props, {
|
|
@@ -238,7 +248,7 @@ var InputDateRange = function InputDateRange(props) {
|
|
|
238
248
|
isCompare: isCompare,
|
|
239
249
|
setIsCompare: setIsCompare,
|
|
240
250
|
toggleOff: toggleOff,
|
|
241
|
-
onChange:
|
|
251
|
+
onChange: handleChange
|
|
242
252
|
})))), error && /*#__PURE__*/_react.default.createElement("span", {
|
|
243
253
|
className: "date-range-input__error-block"
|
|
244
254
|
}, error));
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
--calendar-range-point-color: #6b81dd;
|
|
7
7
|
--font-size: 12px;
|
|
8
8
|
--line-height: 20px;
|
|
9
|
+
--border-radius: 4px;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.date-range-input {
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
box-sizing: border-box;
|
|
64
65
|
width: 100%;
|
|
65
66
|
height: var(--input-height);
|
|
66
|
-
border-radius:
|
|
67
|
+
border-radius: var(--border-radius);
|
|
67
68
|
|
|
68
69
|
display: flex;
|
|
69
70
|
flex-flow: row nowrap;
|
|
@@ -200,7 +201,7 @@
|
|
|
200
201
|
justify-content: flex-start;
|
|
201
202
|
align-items: stretch;
|
|
202
203
|
border: 1px solid var(--border-color);
|
|
203
|
-
border-radius:
|
|
204
|
+
border-radius: var(--border-radius);
|
|
204
205
|
background: #FFFFFF;
|
|
205
206
|
|
|
206
207
|
&_right-position-once-element {
|
|
@@ -297,7 +298,7 @@
|
|
|
297
298
|
&.input__wrap {
|
|
298
299
|
box-sizing: border-box;
|
|
299
300
|
box-shadow: none;
|
|
300
|
-
border-radius:
|
|
301
|
+
border-radius: var(--border-radius);
|
|
301
302
|
|
|
302
303
|
&_focus {
|
|
303
304
|
border: 1px solid blue;
|
|
@@ -329,7 +330,7 @@
|
|
|
329
330
|
&__hour-select-input {
|
|
330
331
|
width: 70px;
|
|
331
332
|
height: fit-content;
|
|
332
|
-
border-radius:
|
|
333
|
+
border-radius: var(--border-radius);
|
|
333
334
|
|
|
334
335
|
&>.dropdown__trigger {
|
|
335
336
|
width: 100%;
|
|
@@ -507,7 +508,7 @@
|
|
|
507
508
|
|
|
508
509
|
&--prev-range-end {
|
|
509
510
|
background: #E2E5EC;
|
|
510
|
-
border-radius:
|
|
511
|
+
border-radius: var(--border-radius);
|
|
511
512
|
}
|
|
512
513
|
|
|
513
514
|
&--prev-range-inside {
|
|
@@ -530,7 +531,7 @@
|
|
|
530
531
|
box-sizing: border-box;
|
|
531
532
|
width: 100%;
|
|
532
533
|
padding: 8px 16px;
|
|
533
|
-
border-radius: 0 0
|
|
534
|
+
border-radius: 0 0 var(--border-radius) 0;
|
|
534
535
|
border: none;
|
|
535
536
|
|
|
536
537
|
display: flex;
|
|
@@ -11,6 +11,8 @@ exports.InputDateRangeTemplate = exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
14
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
17
|
|
|
16
18
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -19,12 +21,18 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
21
|
|
|
20
22
|
var _InputDateRange = _interopRequireDefault(require("./InputDateRange"));
|
|
21
23
|
|
|
24
|
+
var _Table = _interopRequireDefault(require("../Table/Table"));
|
|
25
|
+
|
|
22
26
|
var _excluded = ["dateRange"];
|
|
23
27
|
|
|
24
28
|
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); }
|
|
25
29
|
|
|
26
30
|
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; }
|
|
27
31
|
|
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
+
|
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
35
|
+
|
|
28
36
|
global.lng = 'en';
|
|
29
37
|
var _default = {
|
|
30
38
|
title: 'Form Elements/InputDateRange',
|
|
@@ -38,23 +46,171 @@ var _default = {
|
|
|
38
46
|
}
|
|
39
47
|
};
|
|
40
48
|
exports.default = _default;
|
|
49
|
+
var tableData = {
|
|
50
|
+
header: [{
|
|
51
|
+
id: 1,
|
|
52
|
+
label: 'state'
|
|
53
|
+
}, {
|
|
54
|
+
id: 2,
|
|
55
|
+
label: 'Tags'
|
|
56
|
+
}, {
|
|
57
|
+
id: 3,
|
|
58
|
+
label: 'status'
|
|
59
|
+
}, {
|
|
60
|
+
id: 4,
|
|
61
|
+
label: 'loanAmountApproved'
|
|
62
|
+
}, {
|
|
63
|
+
id: 5,
|
|
64
|
+
label: 'loanAmountRejected'
|
|
65
|
+
}, {
|
|
66
|
+
id: 6,
|
|
67
|
+
label: 'approveRate'
|
|
68
|
+
}, {
|
|
69
|
+
id: 7,
|
|
70
|
+
label: 'actions',
|
|
71
|
+
type: 'actions'
|
|
72
|
+
}],
|
|
73
|
+
rows: [{
|
|
74
|
+
id: 1,
|
|
75
|
+
link: {
|
|
76
|
+
label: 'CA',
|
|
77
|
+
link: '#s'
|
|
78
|
+
},
|
|
79
|
+
tags: [{
|
|
80
|
+
label: 'Label 1'
|
|
81
|
+
}],
|
|
82
|
+
status: {
|
|
83
|
+
value: '90',
|
|
84
|
+
status: 'active'
|
|
85
|
+
},
|
|
86
|
+
loanAmountApproved: {
|
|
87
|
+
value: '$70,000'
|
|
88
|
+
},
|
|
89
|
+
loanAmountRejected: {
|
|
90
|
+
value: '$30,000'
|
|
91
|
+
},
|
|
92
|
+
approveRate: {
|
|
93
|
+
value: '70%'
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
id: 2,
|
|
97
|
+
link: {
|
|
98
|
+
label: 'NY',
|
|
99
|
+
link: '#s'
|
|
100
|
+
},
|
|
101
|
+
advancedTags: [{
|
|
102
|
+
labelLeft: 'home',
|
|
103
|
+
labelRight: 'hoods',
|
|
104
|
+
active: 3,
|
|
105
|
+
pause: 1,
|
|
106
|
+
merchants: 5
|
|
107
|
+
}, {
|
|
108
|
+
labelRight: 'jewelry',
|
|
109
|
+
active: 3,
|
|
110
|
+
pause: 1,
|
|
111
|
+
merchants: 5
|
|
112
|
+
}, {
|
|
113
|
+
labelLeft: 'home',
|
|
114
|
+
labelRight: 'improvement',
|
|
115
|
+
active: 0,
|
|
116
|
+
pause: 0,
|
|
117
|
+
warnLeft: true,
|
|
118
|
+
warnLeftMsg: 'landerNotIncluded',
|
|
119
|
+
warnRightMsg: 'noMerchants'
|
|
120
|
+
}, {
|
|
121
|
+
labelLeft: 'home',
|
|
122
|
+
labelRight: 'hoods',
|
|
123
|
+
active: 3,
|
|
124
|
+
pause: 1,
|
|
125
|
+
merchants: 5
|
|
126
|
+
}, {
|
|
127
|
+
labelRight: 'jewelry',
|
|
128
|
+
active: 3,
|
|
129
|
+
pause: 1,
|
|
130
|
+
merchants: 5
|
|
131
|
+
}],
|
|
132
|
+
status: {
|
|
133
|
+
label: 'Active',
|
|
134
|
+
className: 'color--green-haze'
|
|
135
|
+
},
|
|
136
|
+
loanAmountApproved: {
|
|
137
|
+
value: '$3,000'
|
|
138
|
+
},
|
|
139
|
+
loanAmountRejected: {
|
|
140
|
+
value: '$7,000'
|
|
141
|
+
},
|
|
142
|
+
approveRate: {
|
|
143
|
+
value: '30%'
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
id: 3,
|
|
147
|
+
link: {
|
|
148
|
+
label: 'NH',
|
|
149
|
+
link: '#s'
|
|
150
|
+
},
|
|
151
|
+
tags: [{
|
|
152
|
+
label: 'Label 1'
|
|
153
|
+
}, {
|
|
154
|
+
label: 'Label 2'
|
|
155
|
+
}, {
|
|
156
|
+
label: 'Label 3'
|
|
157
|
+
}],
|
|
158
|
+
status: {
|
|
159
|
+
status: 'error'
|
|
160
|
+
},
|
|
161
|
+
loanAmountApproved: {
|
|
162
|
+
value: '$70,000'
|
|
163
|
+
},
|
|
164
|
+
loanAmountRejected: {
|
|
165
|
+
value: '$30,000'
|
|
166
|
+
},
|
|
167
|
+
approveRate: {
|
|
168
|
+
value: '70%'
|
|
169
|
+
}
|
|
170
|
+
}]
|
|
171
|
+
};
|
|
41
172
|
|
|
42
173
|
var Template = function Template(args) {
|
|
174
|
+
var _state$rows;
|
|
175
|
+
|
|
43
176
|
var dateRange = args.dateRange,
|
|
44
177
|
restOfProps = (0, _objectWithoutProperties2.default)(args, _excluded);
|
|
45
178
|
|
|
46
179
|
var _useState = (0, _react.useState)(dateRange),
|
|
47
180
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
48
181
|
value = _useState2[0],
|
|
49
|
-
setValue = _useState2[1];
|
|
50
|
-
|
|
182
|
+
setValue = _useState2[1];
|
|
183
|
+
|
|
184
|
+
var _useState3 = (0, _react.useState)(tableData),
|
|
185
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
186
|
+
state = _useState4[0],
|
|
187
|
+
setState = _useState4[1];
|
|
188
|
+
|
|
189
|
+
var rowsWithActions = state === null || state === void 0 ? void 0 : (_state$rows = state.rows) === null || _state$rows === void 0 ? void 0 : _state$rows.map(function (row) {
|
|
190
|
+
return _objectSpread(_objectSpread({}, row), {}, {
|
|
191
|
+
actions: row.isDeleted ? [{
|
|
192
|
+
type: 'undo'
|
|
193
|
+
}] : [{
|
|
194
|
+
type: 'download'
|
|
195
|
+
}, {
|
|
196
|
+
type: 'edit'
|
|
197
|
+
}, {
|
|
198
|
+
type: 'delete'
|
|
199
|
+
}]
|
|
200
|
+
});
|
|
201
|
+
}); // useEffect(() => console.log(value), [value]);
|
|
202
|
+
// return <InputDateRange {...restOfProps} value={value} onChange={setValue} />;
|
|
51
203
|
|
|
52
204
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
53
205
|
className: "mb20"
|
|
54
206
|
}, /*#__PURE__*/_react.default.createElement(_InputDateRange.default, (0, _extends2.default)({}, restOfProps, {
|
|
55
207
|
value: value,
|
|
56
208
|
onChange: setValue
|
|
57
|
-
})))
|
|
209
|
+
}))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Table.default, {
|
|
210
|
+
header: state.header,
|
|
211
|
+
rows: rowsWithActions,
|
|
212
|
+
onChange: setState
|
|
213
|
+
})));
|
|
58
214
|
};
|
|
59
215
|
|
|
60
216
|
var InputDateRangeTemplate = Template.bind({});
|
|
@@ -80,7 +236,8 @@ InputDateRangeTemplate.args = {
|
|
|
80
236
|
isIntervalsHidden: false,
|
|
81
237
|
isCompareHidden: true,
|
|
82
238
|
hideArrows: false,
|
|
83
|
-
isOptionsRight: false
|
|
239
|
+
isOptionsRight: false,
|
|
240
|
+
isShortWeekNames: false // limitRange,
|
|
84
241
|
// isUseAbs,
|
|
85
242
|
// absTooltip
|
|
86
243
|
|
|
@@ -66,7 +66,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
66
66
|
isCompareHidden = props.isCompareHidden,
|
|
67
67
|
limitRange = props.limitRange,
|
|
68
68
|
handleItemClick = props.handleItemClick,
|
|
69
|
-
setActiveInterval = props.setActiveInterval
|
|
69
|
+
setActiveInterval = props.setActiveInterval,
|
|
70
|
+
isShortWeekNames = props.isShortWeekNames;
|
|
70
71
|
var _values$start = values.start,
|
|
71
72
|
start = _values$start === void 0 ? null : _values$start,
|
|
72
73
|
_values$end = values.end,
|
|
@@ -461,7 +462,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
461
462
|
endPrevDate: endPrevDate,
|
|
462
463
|
onClick: handleClick,
|
|
463
464
|
onHover: handleHover,
|
|
464
|
-
limitRange: limitRange
|
|
465
|
+
limitRange: limitRange,
|
|
466
|
+
isShortWeekNames: isShortWeekNames
|
|
465
467
|
}), /*#__PURE__*/_react.default.createElement(_RangeCalendar.default, {
|
|
466
468
|
className: "date-picker__calendar",
|
|
467
469
|
date: date2,
|
|
@@ -472,7 +474,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
472
474
|
startPrevDate: startPrevDate,
|
|
473
475
|
endPrevDate: endPrevDate,
|
|
474
476
|
onClick: handleClick,
|
|
475
|
-
onHover: handleHover
|
|
477
|
+
onHover: handleHover,
|
|
478
|
+
isShortWeekNames: isShortWeekNames
|
|
476
479
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
477
480
|
className: (0, _classnames.default)('date-picker__footer', {
|
|
478
481
|
'date-picker__footer_once-element': isCompareHidden
|
|
@@ -55,7 +55,8 @@ var OpenedPart = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
55
55
|
setCurrent = props.setCurrent,
|
|
56
56
|
isCompare = props.isCompare,
|
|
57
57
|
setIsCompare = props.setIsCompare,
|
|
58
|
-
toggleOff = props.toggleOff
|
|
58
|
+
toggleOff = props.toggleOff,
|
|
59
|
+
isShortWeekNames = props.isShortWeekNames;
|
|
59
60
|
|
|
60
61
|
var items = isCompact ? (0, _toConsumableArray2.default)(Object.keys(_dependencies.INTERVALS)) : [].concat((0, _toConsumableArray2.default)(Object.keys(_dependencies.INTERVALS)), [_dependencies.CUSTOM_INTERVAL_KEY]);
|
|
61
62
|
|
|
@@ -118,7 +119,7 @@ var OpenedPart = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
118
119
|
return /*#__PURE__*/_react.default.createElement(_SelectItem.default, {
|
|
119
120
|
key: index,
|
|
120
121
|
item: item,
|
|
121
|
-
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,
|
|
122
|
+
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),
|
|
122
123
|
isActive: activeInterval === item,
|
|
123
124
|
onItemClick: function onItemClick() {
|
|
124
125
|
return handleItemClick(item.value || item);
|
|
@@ -146,7 +147,8 @@ var OpenedPart = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
146
147
|
onCancel: toggleOff,
|
|
147
148
|
isCompareHidden: isCompareHidden,
|
|
148
149
|
limitRange: limitRange,
|
|
149
|
-
setActiveInterval: setActiveInterval
|
|
150
|
+
setActiveInterval: setActiveInterval,
|
|
151
|
+
isShortWeekNames: isShortWeekNames
|
|
150
152
|
})));
|
|
151
153
|
});
|
|
152
154
|
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _check = _interopRequireDefault(require("../../../../../../assets/icons/check.svg"));
|
|
15
|
-
|
|
16
14
|
var SelectItem = function SelectItem(_ref) {
|
|
17
15
|
var item = _ref.item,
|
|
18
16
|
label = _ref.label,
|
|
@@ -28,10 +26,20 @@ var SelectItem = function SelectItem(_ref) {
|
|
|
28
26
|
onClick: onItemClick,
|
|
29
27
|
onMouseEnter: onMouseEnter,
|
|
30
28
|
"data-item": item
|
|
31
|
-
}, isActive && /*#__PURE__*/_react.default.createElement("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
}, isActive && /*#__PURE__*/_react.default.createElement("svg", {
|
|
30
|
+
className: (0, _classnames.default)('opened-part__intervals-item-icon-active'),
|
|
31
|
+
width: "16",
|
|
32
|
+
height: "16",
|
|
33
|
+
viewBox: "0 0 16 16",
|
|
34
|
+
fill: "none",
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
37
|
+
d: "M13.3333 4L5.99999 11.3333L2.66666 8",
|
|
38
|
+
stroke: "black",
|
|
39
|
+
"stroke-width": "1.33333",
|
|
40
|
+
"stroke-linecap": "round",
|
|
41
|
+
"stroke-linejoin": "round"
|
|
42
|
+
})), label);
|
|
35
43
|
};
|
|
36
44
|
|
|
37
45
|
var _default = SelectItem;
|
|
@@ -221,6 +221,14 @@ var getActualDateRange = function getActualDateRange(inputDateRange) {
|
|
|
221
221
|
return null;
|
|
222
222
|
}();
|
|
223
223
|
|
|
224
|
+
if (actualIntervalKey === ALL_TIME_KEY) return {
|
|
225
|
+
intervalKey: ALL_TIME_KEY,
|
|
226
|
+
start: null,
|
|
227
|
+
end: null,
|
|
228
|
+
compare: inputDateRange.compare,
|
|
229
|
+
startPrevDate: null,
|
|
230
|
+
endPrevDate: null
|
|
231
|
+
};
|
|
224
232
|
var actualValues = {
|
|
225
233
|
// intervalKey: inputDateRange.intervalKey || customIntervalKey,
|
|
226
234
|
intervalKey: actualIntervalKey || CUSTOM_INTERVAL_KEY,
|
|
@@ -43,7 +43,8 @@ var RangeCalendar = function RangeCalendar(props) {
|
|
|
43
43
|
onHover = _props$onHover === void 0 ? function () {} : _props$onHover,
|
|
44
44
|
startPrevDate = props.startPrevDate,
|
|
45
45
|
endPrevDate = props.endPrevDate,
|
|
46
|
-
limitRange = props.limitRange
|
|
46
|
+
limitRange = props.limitRange,
|
|
47
|
+
isShortWeekNames = props.isShortWeekNames;
|
|
47
48
|
|
|
48
49
|
var _useState = (0, _react.useState)({}),
|
|
49
50
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -125,6 +126,10 @@ var RangeCalendar = function RangeCalendar(props) {
|
|
|
125
126
|
setDate((0, _momentTimezone.default)(date).add(1, 'month').toDate());
|
|
126
127
|
};
|
|
127
128
|
|
|
129
|
+
var getFormatedWeekName = function getFormatedWeekName(input) {
|
|
130
|
+
return isShortWeekNames ? input.charAt(0) : input;
|
|
131
|
+
};
|
|
132
|
+
|
|
128
133
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
129
134
|
className: (0, _classnames.default)('range-calendar', className)
|
|
130
135
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -147,7 +152,7 @@ var RangeCalendar = function RangeCalendar(props) {
|
|
|
147
152
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
148
153
|
key: "day-of-week_".concat(dayOfWeek),
|
|
149
154
|
className: "range-calendar__day range-calendar__day--title"
|
|
150
|
-
}, (0, _momentTimezone.default)().weekday(dayOfWeek).format('dd')
|
|
155
|
+
}, getFormatedWeekName((0, _momentTimezone.default)().weekday(dayOfWeek).format('dd')));
|
|
151
156
|
})), Object.keys(days).map(function (week, index) {
|
|
152
157
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
153
158
|
key: "week_".concat(index),
|