funda-ui 4.4.15 → 4.4.35
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/EventCalendar/index.css +114 -114
- package/EventCalendar/index.d.ts +1 -0
- package/EventCalendar/index.js +116 -84
- package/EventCalendarTimeline/index.css +274 -270
- package/EventCalendarTimeline/index.d.ts +3 -0
- package/EventCalendarTimeline/index.js +641 -224
- package/MultipleCheckboxes/index.js +11 -11
- package/MultipleSelect/index.js +11 -11
- package/NativeSelect/index.js +11 -11
- package/Radio/index.js +11 -11
- package/Select/index.js +11 -11
- package/Table/index.css +1 -0
- package/Table/index.js +36 -7
- package/TagInput/index.d.ts +1 -0
- package/TagInput/index.js +20 -2
- package/Tree/index.js +11 -11
- package/Utils/object.js +11 -11
- package/Utils/os.d.ts +2 -0
- package/Utils/os.js +104 -0
- package/lib/cjs/EventCalendar/index.d.ts +1 -0
- package/lib/cjs/EventCalendar/index.js +116 -84
- package/lib/cjs/EventCalendarTimeline/index.d.ts +3 -0
- package/lib/cjs/EventCalendarTimeline/index.js +641 -224
- package/lib/cjs/MultipleCheckboxes/index.js +11 -11
- package/lib/cjs/MultipleSelect/index.js +11 -11
- package/lib/cjs/NativeSelect/index.js +11 -11
- package/lib/cjs/Radio/index.js +11 -11
- package/lib/cjs/Select/index.js +11 -11
- package/lib/cjs/Table/index.js +36 -7
- package/lib/cjs/TagInput/index.d.ts +1 -0
- package/lib/cjs/TagInput/index.js +20 -2
- package/lib/cjs/Tree/index.js +11 -11
- package/lib/cjs/Utils/object.js +11 -11
- package/lib/cjs/Utils/os.d.ts +2 -0
- package/lib/cjs/Utils/os.js +104 -0
- package/lib/css/EventCalendar/index.css +114 -114
- package/lib/css/EventCalendarTimeline/index.css +274 -270
- package/lib/css/Table/index.css +1 -0
- package/lib/esm/EventCalendar/index.scss +81 -81
- package/lib/esm/EventCalendar/index.tsx +136 -98
- package/lib/esm/EventCalendarTimeline/index.scss +226 -221
- package/lib/esm/EventCalendarTimeline/index.tsx +445 -207
- package/lib/esm/ModalDialog/index.tsx +0 -1
- package/lib/esm/Table/Table.tsx +0 -1
- package/lib/esm/Table/index.scss +2 -0
- package/lib/esm/Table/utils/hooks/useTableDraggable.tsx +47 -6
- package/lib/esm/TagInput/index.tsx +23 -1
- package/lib/esm/Utils/libs/object.ts +67 -67
- package/lib/esm/Utils/libs/os.ts +63 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
|
5
5
|
import ModalDialog from 'funda-modaldialog';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
export interface EventsValueConfig {
|
|
9
10
|
id: string | number;
|
|
10
11
|
date: string,
|
|
@@ -64,6 +65,7 @@ export type EventCalendarProps = {
|
|
|
64
65
|
onCellMouseEnter?: (el: any) => void;
|
|
65
66
|
onCellMouseLeave?: (el: any) => void;
|
|
66
67
|
onCellClick?: (el: any) => void;
|
|
68
|
+
onCellDoubleClick?: (el: any) => void;
|
|
67
69
|
onCellMouseUp?: (el: any) => void;
|
|
68
70
|
onKeyPressed?: (el: any) => void;
|
|
69
71
|
|
|
@@ -119,6 +121,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
119
121
|
onCellMouseEnter,
|
|
120
122
|
onCellMouseLeave,
|
|
121
123
|
onCellClick,
|
|
124
|
+
onCellDoubleClick,
|
|
122
125
|
onCellMouseUp,
|
|
123
126
|
onKeyPressed
|
|
124
127
|
} = props;
|
|
@@ -129,8 +132,10 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
129
132
|
const WEEK_FULL = langWeekFull || ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY'];
|
|
130
133
|
const MONTHS = langMonths || ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
|
|
131
134
|
const MONTHS_FULL = langMonthsFull || ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
const START_WEEK_ON = 1; // represents "Monday/1" in JavaScript
|
|
136
|
+
|
|
137
|
+
// orginal data
|
|
138
|
+
const [orginalData, setOrginalData] = useState<TimelineCellListConfig[]>([]);
|
|
134
139
|
|
|
135
140
|
const now = useMemo(() => new Date(), []);
|
|
136
141
|
const [date, setDate] = useState<Date>(now);
|
|
@@ -159,6 +164,23 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
159
164
|
// Open temporary storage for pop-ups
|
|
160
165
|
const [tableCellId, setTableCellId] = useState<number>(-1);
|
|
161
166
|
|
|
167
|
+
|
|
168
|
+
const findMondayAndTruncate = (dates: string[]) => {
|
|
169
|
+
const _res = dates.map((s: string) => new Date(s));
|
|
170
|
+
// Find the first Monday in the sequence
|
|
171
|
+
for (let i = 0; i < _res.length; i++) {
|
|
172
|
+
const date = _res[i];
|
|
173
|
+
if (date.getDay() === START_WEEK_ON) {
|
|
174
|
+
// Return dates starting from Monday onwards
|
|
175
|
+
return dates.slice(i);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return []; // Return empty array if no Monday found
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
162
184
|
// exposes the following methods
|
|
163
185
|
useImperativeHandle(
|
|
164
186
|
contentRef,
|
|
@@ -188,7 +210,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
188
210
|
|
|
189
211
|
|
|
190
212
|
const queryItemObj = () => {
|
|
191
|
-
const _perData =
|
|
213
|
+
const _perData = orginalData.filter((item: any) => getCalendarDate(item.date as string) === getCalendarDate(`${year}-${month + 1}-${day}`));
|
|
192
214
|
|
|
193
215
|
let _currentData: any = undefined;
|
|
194
216
|
if (_perData[0]) {
|
|
@@ -273,76 +295,88 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
273
295
|
return first7Days.map((v: Date) => getCalendarDate(v));
|
|
274
296
|
};
|
|
275
297
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
// back fill
|
|
298
|
-
const __backFillDate: string[] = _getBackFill(year, month + 1);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const _getDateShow = (_dayIndex: number, _m: number, _startDay: number, _month: number) => {
|
|
302
|
-
const currentDay = typeof _dayIndex === 'number' ? _dayIndex - (_startDay - 2) : 0; // ..., -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, ...
|
|
303
|
-
|
|
304
|
-
// date
|
|
305
|
-
let _dateShow: any = currentDay > 0 ? `${year}-${_month + 1}-${currentDay}` : '';
|
|
306
|
-
|
|
307
|
-
// forward & back
|
|
308
|
-
if (isFirstGroup && _dateShow === '') {
|
|
309
|
-
_dateShow = __forwardFillDate.at(currentDay - 1);
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
// The remaining date of the previous month
|
|
301
|
+
// If the number is 7, the calendar does not include the date of the previous month
|
|
302
|
+
const remainPrevDate = findMondayAndTruncate(_getForwardFill(year, month+1));
|
|
303
|
+
const remainPrevDateTotal = remainPrevDate.length === 7 ? 0 : remainPrevDate.length;
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
return {
|
|
307
|
+
rowsTotal: orginalData.length,
|
|
308
|
+
colsTotal: allDays.length,
|
|
309
|
+
forwardFillTotal: remainPrevDateTotal,
|
|
310
|
+
list: _tempCells.map((_: any, j: number) => {
|
|
311
|
+
const _col = allDays.slice(j * 7, (j + 1) * 7);
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
// back fill
|
|
315
|
+
const backFillArr: null[] = [];
|
|
316
|
+
for (let k = 0; k < 7 - _col.length; k++) {
|
|
317
|
+
backFillArr.push(null);
|
|
310
318
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
319
|
+
_col.splice(_col.length, 0, ...backFillArr as any);
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
//
|
|
323
|
+
const isFirstGroup = j === 0;
|
|
324
|
+
const isLastGroup = j === _tempCells.length - 1;
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
// forward fill
|
|
328
|
+
const __forwardFillDate: string[] = _getForwardFill(year, month + 1);
|
|
329
|
+
|
|
330
|
+
// back fill
|
|
331
|
+
const __backFillDate: string[] = _getBackFill(year, month + 1);
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
const _getDateShow = (_dayIndex: number, _m: number, _startDay: number, _month: number) => {
|
|
335
|
+
const currentDay = typeof _dayIndex === 'number' ? _dayIndex - (_startDay - 2) : 0; // ..., -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, ...
|
|
336
|
+
|
|
337
|
+
// date
|
|
338
|
+
let _dateShow: any = currentDay > 0 ? `${year}-${_month + 1}-${currentDay}` : '';
|
|
339
|
+
|
|
340
|
+
// forward & back
|
|
341
|
+
if (isFirstGroup && _dateShow === '') {
|
|
342
|
+
_dateShow = __forwardFillDate.at(currentDay - 1);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (isLastGroup && _dateShow === '') {
|
|
346
|
+
_dateShow = __backFillDate.at(_m);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
return {
|
|
351
|
+
date: getCalendarDate(_dateShow),
|
|
352
|
+
firstGroup: isFirstGroup,
|
|
353
|
+
lastGroup: isLastGroup,
|
|
354
|
+
validDisplayDate: currentDay > 0 && currentDay <= days[month]
|
|
355
|
+
};
|
|
356
|
+
|
|
314
357
|
}
|
|
315
|
-
|
|
316
|
-
|
|
358
|
+
|
|
359
|
+
//
|
|
317
360
|
return {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return WEEK[m]
|
|
338
|
-
}),
|
|
339
|
-
week: _col.map((k: number, m: number) => {
|
|
340
|
-
return m
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
|
|
361
|
+
month: currentMonth,
|
|
362
|
+
startDay: currentStartDay,
|
|
363
|
+
row: j,
|
|
364
|
+
col: _col,
|
|
365
|
+
dateInfo: _col.map((k: number, m: number) => {
|
|
366
|
+
const _lastWeekDays: number = _col.filter(Boolean).length;
|
|
367
|
+
return _getDateShow(k, m - _lastWeekDays, currentStartDay, currentMonth);
|
|
368
|
+
}),
|
|
369
|
+
weekDisplay: _col.map((k: number, m: number) => {
|
|
370
|
+
return WEEK[m]
|
|
371
|
+
}),
|
|
372
|
+
week: _col.map((k: number, m: number) => {
|
|
373
|
+
return m
|
|
374
|
+
}),
|
|
375
|
+
|
|
376
|
+
}
|
|
377
|
+
})
|
|
378
|
+
}
|
|
379
|
+
|
|
346
380
|
};
|
|
347
381
|
|
|
348
382
|
|
|
@@ -502,7 +536,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
502
536
|
useEffect(() => {
|
|
503
537
|
|
|
504
538
|
// update events value
|
|
505
|
-
if (Array.isArray(eventsValue))
|
|
539
|
+
if (Array.isArray(eventsValue)) setOrginalData(eventsValue);
|
|
506
540
|
|
|
507
541
|
// update current today
|
|
508
542
|
if (typeof customTodayDate === 'string' && customTodayDate !== '' && isValidDate(customTodayDate)) {
|
|
@@ -521,7 +555,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
521
555
|
|
|
522
556
|
<div
|
|
523
557
|
className={combinedCls(
|
|
524
|
-
"
|
|
558
|
+
"custom-event-cal__wrapper",
|
|
525
559
|
calendarWrapperClassName
|
|
526
560
|
)}
|
|
527
561
|
onKeyDown={(e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
@@ -532,36 +566,36 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
532
566
|
|
|
533
567
|
|
|
534
568
|
{/*++++++++++++++++ MAIN ++++++++++++++++*/}
|
|
535
|
-
<div className="
|
|
536
|
-
<button tabIndex={-1} type="button" className="
|
|
569
|
+
<div className="custom-event-cal__header bg-body-tertiary">
|
|
570
|
+
<button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--prev" onClick={handlePrevChange}>
|
|
537
571
|
<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
|
|
538
572
|
<path d="M14.2893 5.70708C13.8988 5.31655 13.2657 5.31655 12.8751 5.70708L7.98768 10.5993C7.20729 11.3805 7.2076 12.6463 7.98837 13.427L12.8787 18.3174C13.2693 18.7079 13.9024 18.7079 14.293 18.3174C14.6835 17.9269 14.6835 17.2937 14.293 16.9032L10.1073 12.7175C9.71678 12.327 9.71678 11.6939 10.1073 11.3033L14.2893 7.12129C14.6799 6.73077 14.6799 6.0976 14.2893 5.70708Z" fill="#000" />
|
|
539
573
|
</svg>
|
|
540
574
|
</button>
|
|
541
|
-
<div className="
|
|
542
|
-
<button tabIndex={-1} type="button" className={`
|
|
575
|
+
<div className="custom-event-cal__header__btns">
|
|
576
|
+
<button tabIndex={-1} type="button" className={`custom-event-cal__btn ${winMonth ? 'active' : ''}`} onClick={handleShowWinMonth}>
|
|
543
577
|
{MONTHS[month]}
|
|
544
578
|
<svg width="12px" height="12px" viewBox="0 0 24 24"><path d="M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z" fill="#000000" /></svg>
|
|
545
579
|
</button>
|
|
546
|
-
<button tabIndex={-1} type="button" className={`
|
|
580
|
+
<button tabIndex={-1} type="button" className={`custom-event-cal__btn ${winYear ? 'active' : ''}`} onClick={handleShowWinYear}>
|
|
547
581
|
{year}
|
|
548
582
|
<svg width="12px" height="12px" viewBox="0 0 24 24"><path d="M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z" fill="#000000" /></svg>
|
|
549
583
|
</button>
|
|
550
584
|
</div>
|
|
551
|
-
<button tabIndex={-1} type="button" className="
|
|
585
|
+
<button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--next" onClick={handleNextChange}>
|
|
552
586
|
<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
|
|
553
587
|
<path d="M9.71069 18.2929C10.1012 18.6834 10.7344 18.6834 11.1249 18.2929L16.0123 13.4006C16.7927 12.6195 16.7924 11.3537 16.0117 10.5729L11.1213 5.68254C10.7308 5.29202 10.0976 5.29202 9.70708 5.68254C9.31655 6.07307 9.31655 6.70623 9.70708 7.09676L13.8927 11.2824C14.2833 11.6729 14.2833 12.3061 13.8927 12.6966L9.71069 16.8787C9.32016 17.2692 9.32016 17.9023 9.71069 18.2929Z" fill="#000" />
|
|
554
588
|
</svg>
|
|
555
589
|
</button>
|
|
556
590
|
</div>
|
|
557
|
-
<div className="
|
|
591
|
+
<div className="custom-event-cal__body">
|
|
558
592
|
|
|
559
593
|
{/* week */}
|
|
560
|
-
<div className="
|
|
594
|
+
<div className="custom-event-cal__row">
|
|
561
595
|
{WEEK.map((s: string, i: number) => (
|
|
562
596
|
<div
|
|
563
597
|
className={combinedCls(
|
|
564
|
-
'
|
|
598
|
+
'custom-event-cal__cell custom-event-cal__day custom-event-cal__day--week custom-event-cal__day--disabled bg-secondary-subtle empty',
|
|
565
599
|
{
|
|
566
600
|
'last-cell': i === WEEK.length - 1
|
|
567
601
|
}
|
|
@@ -577,11 +611,11 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
577
611
|
{/* /week */}
|
|
578
612
|
|
|
579
613
|
{/* day */}
|
|
580
|
-
{getCells().map((item: any, j: number) => {
|
|
614
|
+
{getCells().list.map((item: any, j: number) => {
|
|
581
615
|
|
|
582
|
-
const isLastRow = j === getCells().length - 1;
|
|
616
|
+
const isLastRow = j === getCells().list.length - 1;
|
|
583
617
|
|
|
584
|
-
return <div key={'row' + item.row} className="
|
|
618
|
+
return <div key={'row' + item.row} className="custom-event-cal__row">
|
|
585
619
|
{item.col.map((dayIndex: number | null, i: number) => {
|
|
586
620
|
|
|
587
621
|
const isLastCell = i === item.col.length - 1;
|
|
@@ -595,7 +629,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
595
629
|
|
|
596
630
|
// helper
|
|
597
631
|
const d = parseFloat(_dateDayShow);
|
|
598
|
-
const _currentData =
|
|
632
|
+
const _currentData = orginalData.filter((item: any) => getCalendarDate(item.date as string) === _dateShow);
|
|
599
633
|
const isInteractive = item.dateInfo[i].validDisplayDate; // The date on which the user interaction can occur, e.g. click, modify
|
|
600
634
|
const isForward = item.dateInfo[i].firstGroup && !isInteractive;
|
|
601
635
|
const isBack = item.dateInfo[i].lastGroup && !isInteractive;
|
|
@@ -618,7 +652,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
618
652
|
|
|
619
653
|
return <div
|
|
620
654
|
className={combinedCls(
|
|
621
|
-
`
|
|
655
|
+
`custom-event-cal__cell-item custom-event-cal__cell-item-${cellItemIndex}`,
|
|
622
656
|
{
|
|
623
657
|
'first': cellItemIndex === 0,
|
|
624
658
|
'last': cellItemIndex === _items.length - 1
|
|
@@ -652,7 +686,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
652
686
|
|
|
653
687
|
{/* ITEM */}
|
|
654
688
|
<div
|
|
655
|
-
className="
|
|
689
|
+
className="custom-event-cal__day__event"
|
|
656
690
|
style={typeof cellItem !== 'undefined' && (cellItem as any).eventStyles !== 'undefined' ? cellItem.eventStyles : {}}
|
|
657
691
|
dangerouslySetInnerHTML={typeof cellItem.data === 'string' ? {
|
|
658
692
|
__html: cellItem.data
|
|
@@ -664,7 +698,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
664
698
|
|
|
665
699
|
{/* DELETE BUTTON */}
|
|
666
700
|
<div
|
|
667
|
-
className={`
|
|
701
|
+
className={`custom-event-cal__day__eventdel ${cellCloseBtnClassName || ''}`}
|
|
668
702
|
>
|
|
669
703
|
<a
|
|
670
704
|
href="#"
|
|
@@ -712,7 +746,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
712
746
|
return (
|
|
713
747
|
<div
|
|
714
748
|
className={combinedCls(
|
|
715
|
-
'
|
|
749
|
+
'custom-event-cal__cell custom-event-cal__day',
|
|
716
750
|
{
|
|
717
751
|
'empty': !isInteractive,
|
|
718
752
|
'today': d === now.getDate(),
|
|
@@ -737,6 +771,10 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
737
771
|
onChangeDate?.(e, null);
|
|
738
772
|
}
|
|
739
773
|
}}
|
|
774
|
+
onDoubleClick={(e: React.MouseEvent) => {
|
|
775
|
+
//
|
|
776
|
+
onCellDoubleClick?.(e);
|
|
777
|
+
}}
|
|
740
778
|
onMouseLeave={(e: React.MouseEvent) => {
|
|
741
779
|
onCellMouseLeave?.(e);
|
|
742
780
|
}}
|
|
@@ -764,7 +802,7 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
764
802
|
{/* ADD BUTTON */}
|
|
765
803
|
{isForward || isBack ? null : <>
|
|
766
804
|
<div
|
|
767
|
-
className={`
|
|
805
|
+
className={`custom-event-cal__day__eventadd ${cellAddBtnClassName || ''}`}
|
|
768
806
|
>
|
|
769
807
|
<a
|
|
770
808
|
href="#"
|
|
@@ -819,12 +857,12 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
819
857
|
|
|
820
858
|
|
|
821
859
|
{/*++++++++++++++++ MONTH SELECTION TAB ++++++++++++++++*/}
|
|
822
|
-
<div className={`
|
|
823
|
-
<div className="
|
|
860
|
+
<div className={`custom-event-cal__month-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ${winMonth ? 'active' : ''}`}>
|
|
861
|
+
<div className="custom-event-cal__month-container">
|
|
824
862
|
{MONTHS_FULL.map((month, index) => {
|
|
825
863
|
return <div
|
|
826
864
|
data-month={padZero(index + 1)}
|
|
827
|
-
className={`
|
|
865
|
+
className={`custom-event-cal__month ${selectedMonth === index ? ' selected' : ''}`}
|
|
828
866
|
key={month + index}
|
|
829
867
|
onClick={() => { handleMonthChange(index) }}
|
|
830
868
|
>{month}</div>
|
|
@@ -834,12 +872,12 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
834
872
|
{/*++++++++++++++++ /MONTH SELECTION TAB ++++++++++++++++*/}
|
|
835
873
|
|
|
836
874
|
{/*++++++++++++++++ YEAR SELECTION TAB ++++++++++++++++*/}
|
|
837
|
-
<div className={`
|
|
838
|
-
<div className="
|
|
875
|
+
<div className={`custom-event-cal__year-wrapper shadow p-3 mb-5 bg-body-tertiary rounded ${winYear ? 'active' : ''}`}>
|
|
876
|
+
<div className="custom-event-cal__year-container bg-body-tertiary">
|
|
839
877
|
{yearsArray.map((year, index) => {
|
|
840
878
|
return <div
|
|
841
879
|
data-year={year}
|
|
842
|
-
className={`
|
|
880
|
+
className={`custom-event-cal__year ${selectedYear === year ? ' selected' : ''}`}
|
|
843
881
|
key={year + index}
|
|
844
882
|
onClick={() => { handleYearChange(year) }}
|
|
845
883
|
>{year}</div>
|
|
@@ -852,8 +890,8 @@ const EventCalendar = (props: EventCalendarProps) => {
|
|
|
852
890
|
|
|
853
891
|
|
|
854
892
|
{/*++++++++++++++++ TODAY SELECTION TAB ++++++++++++++++*/}
|
|
855
|
-
<div className="
|
|
856
|
-
<button tabIndex={-1} type="button" className="
|
|
893
|
+
<div className="custom-event-cal__today-wrapper p-2 bg-body-tertiary">
|
|
894
|
+
<button tabIndex={-1} type="button" className="custom-event-cal__btn custom-event-cal__btn--today" onClick={handleTodayChange}>
|
|
857
895
|
{langToday || 'Today'}
|
|
858
896
|
</button>
|
|
859
897
|
</div>
|