intelicoreact 0.0.6 → 0.0.7
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/CheckboxInput/CheckboxInput.js +6 -2
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +91 -60
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +2 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +40 -9
- package/dist/Atomic/FormElements/Dropdown/Dropdown.scss +21 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +22 -6
- package/dist/Atomic/FormElements/Input/Input.js +15 -4
- package/dist/Atomic/FormElements/Input/Input.stories.js +7 -1
- package/dist/Atomic/FormElements/InputDateRange/{components/InputDateRange.js → InputDateRange.js} +61 -50
- package/dist/Atomic/FormElements/InputDateRange/{components/InputDateRange.scss → InputDateRange.scss} +218 -222
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +11 -5
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +27 -6
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +20 -11
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +14 -6
- package/dist/Atomic/FormElements/InputDateRange/{index.js → dependencies.js} +18 -17
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +7 -2
- package/dist/Atomic/FormElements/Table/Table.scss +1 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.scss +1 -1
- package/dist/Atomic/MainMenu/MainMenu.scss +2 -2
- package/dist/Atomic/UI/Accordion/Accordion.scss +2 -2
- package/dist/Atomic/UI/Arrow/Arrow.scss +0 -3
- package/dist/Atomic/UI/Calendar/Calendar.js +3 -2
- package/dist/Atomic/UI/Calendar/Calendar.stories.js +3 -2
- package/dist/Atomic/UI/Status/Status.scss +1 -1
- package/dist/Molecular/Datepicker/Datepicker.js +451 -0
- package/dist/Molecular/Datepicker/Datepicker.scss +8 -0
- package/dist/Molecular/Datepicker/Datepicker.stories.js +44 -0
- package/dist/{Atomic/FormElements/Calendar → Molecular/Datepicker/components}/Calendar.js +50 -39
- package/dist/scss/_vars.scss +3 -1
- package/dist/scss/main.scss +1 -1
- package/package.json +3 -2
- package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.js +12 -2
- package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +91 -60
- package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +4 -3
- package/src/Atomic/FormElements/Dropdown/Dropdown.js +64 -27
- package/src/Atomic/FormElements/Dropdown/Dropdown.scss +21 -3
- package/src/Atomic/FormElements/Dropdown/Dropdown.stories.js +28 -15
- package/src/Atomic/FormElements/Input/Input.js +4 -0
- package/src/Atomic/FormElements/Input/Input.stories.js +7 -1
- package/src/Atomic/FormElements/InputDateRange/{components/InputDateRange.js → InputDateRange.js} +65 -54
- package/src/Atomic/FormElements/InputDateRange/{components/InputDateRange.scss → InputDateRange.scss} +218 -222
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +9 -2
- package/src/Atomic/FormElements/InputDateRange/components/Datepicker.js +42 -27
- package/src/Atomic/FormElements/InputDateRange/components/OpenedPart.js +11 -6
- package/src/Atomic/FormElements/InputDateRange/components/SelectItem.js +5 -3
- package/src/Atomic/FormElements/InputDateRange/{index.js → dependencies.js} +15 -11
- package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.js +5 -2
- package/src/Atomic/FormElements/Table/Table.scss +1 -1
- package/src/Atomic/FormElements/Textarea/Textarea.scss +1 -1
- package/src/Atomic/MainMenu/MainMenu.scss +2 -2
- package/src/Atomic/UI/Accordion/Accordion.scss +2 -2
- package/src/Atomic/UI/Arrow/Arrow.scss +0 -3
- package/src/Atomic/UI/Calendar/Calendar.js +2 -2
- package/src/Atomic/UI/Calendar/Calendar.stories.js +2 -1
- package/src/Atomic/UI/Status/Status.scss +1 -1
- package/src/Molecular/Datepicker/Datepicker.js +346 -0
- package/src/Molecular/Datepicker/Datepicker.scss +8 -0
- package/src/Molecular/Datepicker/Datepicker.stories.js +27 -0
- package/src/Molecular/Datepicker/components/Calendar.js +118 -0
- package/src/scss/_vars.scss +3 -1
- package/src/scss/main.scss +1 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.scss +0 -543
- package/dist/Atomic/FormElements/Calendar/Calendar.stories.js +0 -33
- package/dist/scss/anme/_anme-bootstrap-grid.scss +0 -748
- package/dist/scss/anme/_anme-elements.scss +0 -269
- package/dist/scss/anme/_anme-grid.scss +0 -111
- package/dist/scss/anme/_anme-justify.scss +0 -111
- package/dist/scss/anme/_anme-mixins-media.scss +0 -116
- package/dist/scss/anme/_anme-mixins.scss +0 -166
- package/dist/scss/anme/_anme-normalize.scss +0 -8
- package/dist/scss/anme/_anme-overall.scss +0 -34
- package/dist/scss/anme/_anme-padding-margins.scss +0 -419
- package/dist/scss/anme/_anme-table.scss +0 -81
- package/dist/scss/anme/_anme-theme.scss +0 -275
- package/dist/scss/anme/_anme-vars.scss +0 -91
- package/dist/scss/anme/_code-styling.scss +0 -23
- package/dist/scss/anme/styles.scss +0 -12
- package/src/scss/anme/_anme-bootstrap-grid.scss +0 -748
- package/src/scss/anme/_anme-elements.scss +0 -269
- package/src/scss/anme/_anme-grid.scss +0 -111
- package/src/scss/anme/_anme-justify.scss +0 -111
- package/src/scss/anme/_anme-mixins-media.scss +0 -116
- package/src/scss/anme/_anme-mixins.scss +0 -166
- package/src/scss/anme/_anme-normalize.scss +0 -8
- package/src/scss/anme/_anme-overall.scss +0 -34
- package/src/scss/anme/_anme-padding-margins.scss +0 -419
- package/src/scss/anme/_anme-table.scss +0 -81
- package/src/scss/anme/_anme-theme.scss +0 -275
- package/src/scss/anme/_anme-vars.scss +0 -91
- package/src/scss/anme/_code-styling.scss +0 -23
- package/src/scss/anme/styles.scss +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import InputDateRange from '
|
|
1
|
+
import React, { /*useEffect,*/ useState } from 'react';
|
|
2
|
+
import InputDateRange from './InputDateRange';
|
|
3
3
|
import Table from '../Table/Table';
|
|
4
4
|
|
|
5
5
|
global.lng = 'en';
|
|
@@ -105,6 +105,8 @@ const Template = args => {
|
|
|
105
105
|
actions: row.isDeleted ? [{ type: 'undo' }] : [{ type: 'download' }, { type: 'edit' }, { type: 'delete' }]
|
|
106
106
|
}));
|
|
107
107
|
|
|
108
|
+
// useEffect(() => console.log(value), [value]);
|
|
109
|
+
|
|
108
110
|
// return <InputDateRange {...restOfProps} value={value} onChange={setValue} />;
|
|
109
111
|
return (
|
|
110
112
|
<div>
|
|
@@ -122,6 +124,10 @@ export const InputDateRangeTemplate = Template.bind({});
|
|
|
122
124
|
|
|
123
125
|
InputDateRangeTemplate.args = {
|
|
124
126
|
txt: {},
|
|
127
|
+
buttonsTypes: {
|
|
128
|
+
// apply: 'ellipse-apply',
|
|
129
|
+
cancel: 'bark-outline'
|
|
130
|
+
},
|
|
125
131
|
label: 'Date Range',
|
|
126
132
|
dateRange: { intervalKey: 'today'},
|
|
127
133
|
id: 'anyToggleButtonId',
|
|
@@ -136,6 +142,7 @@ InputDateRangeTemplate.args = {
|
|
|
136
142
|
isCompareHidden: true,
|
|
137
143
|
hideArrows: false,
|
|
138
144
|
isOptionsRight: false,
|
|
145
|
+
isShortWeekNames: false
|
|
139
146
|
// limitRange,
|
|
140
147
|
// isUseAbs,
|
|
141
148
|
// absTooltip
|
|
@@ -3,6 +3,8 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
3
3
|
import moment from 'moment-timezone';
|
|
4
4
|
import cn from 'classnames';
|
|
5
5
|
|
|
6
|
+
import { getActualDateRange } from '../dependencies';
|
|
7
|
+
|
|
6
8
|
import SelectInput from '../../Dropdown/Dropdown';
|
|
7
9
|
import TextInput from '../../Input/Input';
|
|
8
10
|
import Btn from '../../../UI/Button/Button';
|
|
@@ -28,6 +30,7 @@ const Datepicker = props => {
|
|
|
28
30
|
const {
|
|
29
31
|
txt,
|
|
30
32
|
className,
|
|
33
|
+
buttonsTypes = {},
|
|
31
34
|
values = {},
|
|
32
35
|
onChange,
|
|
33
36
|
onChangeCompare,
|
|
@@ -36,6 +39,9 @@ const Datepicker = props => {
|
|
|
36
39
|
onChangeInterval,
|
|
37
40
|
isCompareHidden,
|
|
38
41
|
limitRange,
|
|
42
|
+
handleItemClick,
|
|
43
|
+
setActiveInterval,
|
|
44
|
+
isShortWeekNames
|
|
39
45
|
} = props;
|
|
40
46
|
const { start = null, end = null, compare = false } = values;
|
|
41
47
|
const startDateInputRef = useRef(null);
|
|
@@ -64,6 +70,10 @@ const Datepicker = props => {
|
|
|
64
70
|
[startDate, endDate, isCompare],
|
|
65
71
|
);
|
|
66
72
|
|
|
73
|
+
const setInterval = () => {
|
|
74
|
+
setActiveInterval(getActualDateRange({ start: startDate, end: endDate }).intervalKey)
|
|
75
|
+
};
|
|
76
|
+
|
|
67
77
|
const prevEndHour = useRef(endHour);
|
|
68
78
|
|
|
69
79
|
const getStartHourItems = () =>
|
|
@@ -127,6 +137,7 @@ const Datepicker = props => {
|
|
|
127
137
|
setDate1(moment(startDate));
|
|
128
138
|
setDate2(moment(endDate));
|
|
129
139
|
}
|
|
140
|
+
setInterval();
|
|
130
141
|
}, [startDate, endDate]);
|
|
131
142
|
|
|
132
143
|
useEffect(() => {
|
|
@@ -203,12 +214,12 @@ const Datepicker = props => {
|
|
|
203
214
|
|
|
204
215
|
const renderButtons = () => (
|
|
205
216
|
<>
|
|
206
|
-
<Btn className="date-picker__button" onClick={() => onCancel()} variant=
|
|
217
|
+
<Btn className="date-picker__button" onClick={() => onCancel()} variant={buttonsTypes?.cancel}>
|
|
207
218
|
{txt?.buttons?.cancel || 'cancel'}
|
|
208
219
|
</Btn>
|
|
209
220
|
<Btn
|
|
210
221
|
className="date-picker__button"
|
|
211
|
-
variant=
|
|
222
|
+
variant={buttonsTypes?.apply}
|
|
212
223
|
disabled={!startDate || !endDate}
|
|
213
224
|
onClick={() =>
|
|
214
225
|
onChange({
|
|
@@ -339,31 +350,35 @@ const Datepicker = props => {
|
|
|
339
350
|
|
|
340
351
|
|
|
341
352
|
<div className="date-picker__calendars">
|
|
342
|
-
<
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
353
|
+
<div className="date-picker__calendars-wrapper">
|
|
354
|
+
<Calendar
|
|
355
|
+
className="date-picker__calendar"
|
|
356
|
+
date={date1}
|
|
357
|
+
setDate={setDate1}
|
|
358
|
+
allowNext={!isNearby}
|
|
359
|
+
startDate={startDate}
|
|
360
|
+
endDate={endDate}
|
|
361
|
+
startPrevDate={startPrevDate}
|
|
362
|
+
endPrevDate={endPrevDate}
|
|
363
|
+
onClick={handleClick}
|
|
364
|
+
onHover={handleHover}
|
|
365
|
+
limitRange={limitRange}
|
|
366
|
+
isShortWeekNames={isShortWeekNames}
|
|
367
|
+
/>
|
|
368
|
+
<Calendar
|
|
369
|
+
className="date-picker__calendar"
|
|
370
|
+
date={date2}
|
|
371
|
+
setDate={setDate2}
|
|
372
|
+
allowPrev={!isNearby}
|
|
373
|
+
startDate={startDate}
|
|
374
|
+
endDate={endDate}
|
|
375
|
+
startPrevDate={startPrevDate}
|
|
376
|
+
endPrevDate={endPrevDate}
|
|
377
|
+
onClick={handleClick}
|
|
378
|
+
onHover={handleHover}
|
|
379
|
+
isShortWeekNames={isShortWeekNames}
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
367
382
|
</div>
|
|
368
383
|
<div className={cn('date-picker__footer', {
|
|
369
384
|
'date-picker__footer_once-element': isCompareHidden
|
|
@@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
|
|
|
2
2
|
import moment from 'moment-timezone';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
|
|
5
|
-
import {INTERVALS as intervals, CUSTOM_INTERVAL_KEY as customKey } from '
|
|
5
|
+
import {INTERVALS as intervals, CUSTOM_INTERVAL_KEY as customKey, CUSTOM_INTERVAL_KEY_TEXT } from '../dependencies';
|
|
6
6
|
|
|
7
7
|
import SelectItem from './SelectItem';
|
|
8
8
|
import Datepicker from './Datepicker';
|
|
@@ -10,6 +10,7 @@ import Datepicker from './Datepicker';
|
|
|
10
10
|
const OpenedPart = React.forwardRef((props, ref) => {
|
|
11
11
|
const {
|
|
12
12
|
txt,
|
|
13
|
+
buttonsTypes,
|
|
13
14
|
actualValues,
|
|
14
15
|
onChange = () => {},
|
|
15
16
|
isHoverable,
|
|
@@ -24,11 +25,12 @@ const OpenedPart = React.forwardRef((props, ref) => {
|
|
|
24
25
|
isCompare,
|
|
25
26
|
setIsCompare,
|
|
26
27
|
toggleOff,
|
|
28
|
+
isShortWeekNames
|
|
27
29
|
} = props;
|
|
28
|
-
|
|
29
|
-
// const [styles, setStyles] = useState({});
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
const items = isCompact ? [...Object.keys(intervals)] : [...Object.keys(intervals), customKey];
|
|
32
|
+
|
|
33
|
+
const [activeInterval, setActiveInterval] = useState(actualValues.intervalKey);
|
|
32
34
|
|
|
33
35
|
const handleItemClick = item => {
|
|
34
36
|
if (item !== customKey) {
|
|
@@ -75,8 +77,8 @@ const OpenedPart = React.forwardRef((props, ref) => {
|
|
|
75
77
|
<SelectItem
|
|
76
78
|
key={index}
|
|
77
79
|
item={item}
|
|
78
|
-
label={(txt?.labels && txt?.labels[item]) || intervals[item]?.label || item}
|
|
79
|
-
isActive={
|
|
80
|
+
label={(txt?.labels && txt?.labels[item]) || intervals[item]?.label || (item === customKey ? CUSTOM_INTERVAL_KEY_TEXT : item )}
|
|
81
|
+
isActive={activeInterval === item}
|
|
80
82
|
onItemClick={() => handleItemClick(item.value || item)}
|
|
81
83
|
disabled={item === customKey}
|
|
82
84
|
/>
|
|
@@ -86,6 +88,7 @@ const OpenedPart = React.forwardRef((props, ref) => {
|
|
|
86
88
|
{!isCompact && (
|
|
87
89
|
<Datepicker
|
|
88
90
|
className={cn('opened-part__date-picker')}
|
|
91
|
+
buttonsTypes={buttonsTypes}
|
|
89
92
|
values={actualValues}
|
|
90
93
|
onChange={data => {
|
|
91
94
|
onChange({
|
|
@@ -100,6 +103,8 @@ const OpenedPart = React.forwardRef((props, ref) => {
|
|
|
100
103
|
onCancel={toggleOff}
|
|
101
104
|
isCompareHidden={isCompareHidden}
|
|
102
105
|
limitRange={limitRange}
|
|
106
|
+
setActiveInterval={setActiveInterval}
|
|
107
|
+
isShortWeekNames={isShortWeekNames}
|
|
103
108
|
/>
|
|
104
109
|
)}
|
|
105
110
|
</div>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
import icon from '../../../../../../assets/icons/check.svg'
|
|
5
|
-
|
|
6
4
|
const SelectItem = ({ item, label, isActive, onItemClick, onMouseEnter, disabled }) => (
|
|
7
5
|
<div
|
|
8
6
|
className={cn(
|
|
@@ -15,7 +13,11 @@ const SelectItem = ({ item, label, isActive, onItemClick, onMouseEnter, disabled
|
|
|
15
13
|
onMouseEnter={onMouseEnter}
|
|
16
14
|
data-item={item}
|
|
17
15
|
>
|
|
18
|
-
{isActive &&
|
|
16
|
+
{isActive && (
|
|
17
|
+
<svg className={cn('opened-part__intervals-item-icon-active')} width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
+
<path d="M13.3333 4L5.99999 11.3333L2.66666 8" stroke="black" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
19
|
+
</svg>
|
|
20
|
+
)}
|
|
19
21
|
{label}
|
|
20
22
|
</div>
|
|
21
23
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
2
|
import moment from 'moment-timezone';
|
|
3
3
|
|
|
4
|
-
import InputDateRange from './
|
|
4
|
+
import InputDateRange from './InputDateRange';
|
|
5
5
|
|
|
6
6
|
export const useClickOutside = (hideComponent, additionalComponent) => {
|
|
7
7
|
const ref = useRef(null);
|
|
@@ -115,10 +115,9 @@ export const CUSTOM_INTERVAL_KEY_TEXT = 'Custom Date';
|
|
|
115
115
|
|
|
116
116
|
export const getActualDateRange = inputDateRange => {
|
|
117
117
|
const actualIntervalKey = (() => {
|
|
118
|
-
if (inputDateRange.intervalKey && inputDateRange.intervalKey
|
|
118
|
+
if (inputDateRange.intervalKey && Object.keys(INTERVALS).includes(inputDateRange.intervalKey)) {
|
|
119
119
|
return inputDateRange.intervalKey;
|
|
120
|
-
}
|
|
121
|
-
if (inputDateRange.start && inputDateRange.end) {
|
|
120
|
+
} else if (inputDateRange.start && inputDateRange.end) {
|
|
122
121
|
for (const [key, interval] of Object.entries(INTERVALS)) {
|
|
123
122
|
if (
|
|
124
123
|
moment(inputDateRange.start).isSame(interval.start()) &&
|
|
@@ -127,20 +126,29 @@ export const getActualDateRange = inputDateRange => {
|
|
|
127
126
|
return key;
|
|
128
127
|
}
|
|
129
128
|
}
|
|
129
|
+
return CUSTOM_INTERVAL_KEY;
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return ALL_TIME_KEY;
|
|
132
132
|
})();
|
|
133
|
+
if (actualIntervalKey === ALL_TIME_KEY) return {
|
|
134
|
+
intervalKey: ALL_TIME_KEY,
|
|
135
|
+
start: null,
|
|
136
|
+
end: null,
|
|
137
|
+
compare: inputDateRange.compare,
|
|
138
|
+
startPrevDate: null,
|
|
139
|
+
endPrevDate:null
|
|
140
|
+
};
|
|
133
141
|
const actualValues = {
|
|
134
142
|
// intervalKey: inputDateRange.intervalKey || customIntervalKey,
|
|
135
143
|
intervalKey: actualIntervalKey || CUSTOM_INTERVAL_KEY,
|
|
136
144
|
start:
|
|
137
145
|
inputDateRange.intervalKey === CUSTOM_INTERVAL_KEY
|
|
138
146
|
? inputDateRange?.start
|
|
139
|
-
: INTERVALS[inputDateRange.intervalKey]?.start()?.
|
|
147
|
+
: INTERVALS[inputDateRange.intervalKey]?.start()?.format('YYYY-MM-DDTHH:mm'),
|
|
140
148
|
end:
|
|
141
149
|
inputDateRange.intervalKey === CUSTOM_INTERVAL_KEY
|
|
142
150
|
? inputDateRange?.end
|
|
143
|
-
: INTERVALS[inputDateRange.intervalKey]?.end()?.
|
|
151
|
+
: INTERVALS[inputDateRange.intervalKey]?.end()?.format('YYYY-MM-DDTHH:mm'),
|
|
144
152
|
compare: inputDateRange.compare,
|
|
145
153
|
};
|
|
146
154
|
|
|
@@ -151,7 +159,3 @@ export const getActualDateRange = inputDateRange => {
|
|
|
151
159
|
}
|
|
152
160
|
return actualValues;
|
|
153
161
|
};
|
|
154
|
-
|
|
155
|
-
const component = props => <InputDateRange {...props} />;
|
|
156
|
-
export default component;
|
|
157
|
-
|
|
@@ -19,7 +19,8 @@ const RangeCalendar = props => {
|
|
|
19
19
|
onHover = () => {},
|
|
20
20
|
startPrevDate,
|
|
21
21
|
endPrevDate,
|
|
22
|
-
limitRange
|
|
22
|
+
limitRange,
|
|
23
|
+
isShortWeekNames
|
|
23
24
|
} = props;
|
|
24
25
|
|
|
25
26
|
const [days, setDays] = useState({});
|
|
@@ -100,6 +101,8 @@ const RangeCalendar = props => {
|
|
|
100
101
|
setDate(moment(date).add(1, 'month').toDate());
|
|
101
102
|
};
|
|
102
103
|
|
|
104
|
+
const getFormatedWeekName = input => isShortWeekNames ? input.charAt(0) : input;
|
|
105
|
+
|
|
103
106
|
return (
|
|
104
107
|
<div className={cn('range-calendar', className)}>
|
|
105
108
|
<div className="range-calendar-header">
|
|
@@ -126,7 +129,7 @@ const RangeCalendar = props => {
|
|
|
126
129
|
{[...Array(7).keys()].map(dayOfWeek => {
|
|
127
130
|
return (
|
|
128
131
|
<div key={`day-of-week_${dayOfWeek}`} className="range-calendar__day range-calendar__day--title">
|
|
129
|
-
{moment().weekday(dayOfWeek).format('dd')
|
|
132
|
+
{getFormatedWeekName(moment().weekday(dayOfWeek).format('dd'))}
|
|
130
133
|
</div>
|
|
131
134
|
);
|
|
132
135
|
})}
|
|
@@ -5,7 +5,7 @@ import { ChevronLeft, ChevronRight } from 'react-feather';
|
|
|
5
5
|
import './Calendar.scss';
|
|
6
6
|
|
|
7
7
|
export default function (props) {
|
|
8
|
-
const { date, setDate, allowPrev = true, allowNext = true, params } = props;
|
|
8
|
+
const { date, setDate, allowPrev = true, allowNext = true, params, className } = props;
|
|
9
9
|
const { minDate, maxDate } = params;
|
|
10
10
|
const [days, setDays] = useState({});
|
|
11
11
|
const [showDate, setShowDate] = useState(date);
|
|
@@ -70,7 +70,7 @@ export default function (props) {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
|
-
<div className=
|
|
73
|
+
<div className={`calendar ${className}`}>
|
|
74
74
|
<div className="calendar-header">
|
|
75
75
|
<div className="calendar-header__prev">
|
|
76
76
|
{allowPrev && (
|
|
@@ -4,7 +4,7 @@ import Calendar from './Calendar';
|
|
|
4
4
|
global.lng = 'en';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Calendar',
|
|
8
8
|
component: Calendar,
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -20,4 +20,5 @@ CalendarTemplate.args = {
|
|
|
20
20
|
date: '12/03/2021',
|
|
21
21
|
params: {},
|
|
22
22
|
setDate: () => null,
|
|
23
|
+
className: ''
|
|
23
24
|
};
|