Skip to content

Commit 1ad7a81

Browse files
committed
chore(html): add multiview calendar with captions
1 parent e1dbf1a commit 1ad7a81

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed

packages/html/src/multiviewcalendar/templates/multiviewcalendar-century.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MultiViewCalendar } from "..";
22
import { CalendarTable, CalendarTableRow, CalendarCell } from "../../calendar";
33

4-
export const MultiViewCalendarCentury = ({ showOtherCentury, ...props }: any) => (
4+
export const MultiViewCalendarCentury = ({ showCaptions ,showOtherCentury, ...props }: any) => (
55
<MultiViewCalendar calendarView="century" calendarTitleText="1900 - 2099"
66
children={
77
<>
8-
<CalendarTable>
8+
<CalendarTable calendarCaption={showCaptions && "1900 - 1999"}>
99
<CalendarTableRow>
1010
<CalendarCell text="1890 - 1899" empty={!showOtherCentury}/>
1111
<CalendarCell text="1900 - 1909" />
@@ -25,7 +25,7 @@ export const MultiViewCalendarCentury = ({ showOtherCentury, ...props }: any) =>
2525
<CalendarCell text="2000 - 2009" empty={!showOtherCentury} />
2626
</CalendarTableRow>
2727
</CalendarTable>
28-
<CalendarTable>
28+
<CalendarTable calendarCaption={showCaptions && "2000 - 2099"}>
2929
<CalendarTableRow>
3030
<CalendarCell text="1990 - 1999" empty={!showOtherCentury}/>
3131
<CalendarCell text="2000 - 2009" />

packages/html/src/multiviewcalendar/templates/multiviewcalendar-decade.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MultiViewCalendar } from "..";
22
import { CalendarTable, CalendarTableRow, CalendarCell } from "../../calendar";
33

4-
export const MultiViewCalendarDecade = ({ showOtherDecade, ...props }: any) => (
4+
export const MultiViewCalendarDecade = ({ showCaptions, showOtherDecade, ...props }: any) => (
55
<MultiViewCalendar calendarView="decade" calendarTitleText="2020 - 2039"
66
children={
77
<>
8-
<CalendarTable>
8+
<CalendarTable calendarCaption={showCaptions && "2020 - 2029"}>
99
<CalendarTableRow>
1010
<CalendarCell text="2019" empty={!showOtherDecade} />
1111
<CalendarCell text="2020" />
@@ -25,7 +25,7 @@ export const MultiViewCalendarDecade = ({ showOtherDecade, ...props }: any) => (
2525
<CalendarCell text="2030" empty={!showOtherDecade} />
2626
</CalendarTableRow>
2727
</CalendarTable>
28-
<CalendarTable>
28+
<CalendarTable calendarCaption={showCaptions && "2030 - 2039"}>
2929
<CalendarTableRow>
3030
<CalendarCell text="2029" empty={!showOtherDecade} />
3131
<CalendarCell text="2030" />

packages/html/src/multiviewcalendar/templates/multiviewcalendar-with-weeks.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MultiViewCalendar } from "..";
22
import { CalendarTable, CalendarTableRow, CalendarCell } from "../../calendar";
33

4-
export const MultiViewCalendarWithWeeks = ({ showOtherMonth, ...other }: any) => (
4+
export const MultiViewCalendarWithWeeks = ({ showCaptions, showOtherMonth, ...other }: any) => (
55
<MultiViewCalendar calendarView="month" showWeek
66
children={
77
<>
8-
<CalendarTable showTableHead showWeek>
8+
<CalendarTable calendarCaption={showCaptions && "October 2021"} showTableHead showWeek>
99
<CalendarTableRow>
1010
<CalendarCell text="39" weekCell />
1111
<CalendarCell text="26" showOtherMonth={showOtherMonth} empty={!showOtherMonth} weekend={showOtherMonth} />
@@ -67,7 +67,7 @@ export const MultiViewCalendarWithWeeks = ({ showOtherMonth, ...other }: any) =>
6767
<CalendarCell text="6" showOtherMonth={showOtherMonth} empty={!showOtherMonth} weekend={showOtherMonth} />
6868
</CalendarTableRow>
6969
</CalendarTable>
70-
<CalendarTable showTableHead showWeek>
70+
<CalendarTable calendarCaption={showCaptions && "November 2021"} showTableHead showWeek>
7171
<CalendarTableRow>
7272
<CalendarCell text="45" weekCell />
7373
<CalendarCell text="31" showOtherMonth={showOtherMonth} empty={!showOtherMonth} weekend={showOtherMonth} />

packages/html/src/multiviewcalendar/templates/multiviewcalendar-year.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { MultiViewCalendar } from "..";
22
import { CalendarTable, CalendarTableRow, CalendarCell } from "../../calendar";
33

4-
export const MultiViewCalendarYear = (props: any) => (
4+
export const MultiViewCalendarYear = ({ showCaptions, ...props }: any) => (
55
<MultiViewCalendar calendarView="year" calendarTitleText="2021"
66
children={
77
<>
8-
<CalendarTable>
8+
<CalendarTable calendarCaption={showCaptions && "2021"}>
99
<CalendarTableRow>
1010
<CalendarCell text="Jan" />
1111
<CalendarCell text="Feb" />
@@ -25,7 +25,7 @@ export const MultiViewCalendarYear = (props: any) => (
2525
<CalendarCell text="Dec" />
2626
</CalendarTableRow>
2727
</CalendarTable>
28-
<CalendarTable>
28+
<CalendarTable calendarCaption={showCaptions && "2022"}>
2929
<CalendarTableRow>
3030
<CalendarCell text="Jan" />
3131
<CalendarCell text="Feb" />
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { MultiViewCalendarNormal, MultiViewCalendarYear, MultiViewCalendarDecade, MultiViewCalendarCentury, MultiViewCalendarWithWeeks } from '../../multiviewcalendar';
2+
3+
const styles = `
4+
#test-area {
5+
max-width: 1240px;
6+
}
7+
`;
8+
9+
export default () => (
10+
<>
11+
<style>{styles}</style>
12+
<div id="test-area" className="k-d-grid k-grid-cols-2 k-gap-4">
13+
14+
<section>
15+
<div>Month View</div>
16+
<MultiViewCalendarNormal showCaptions />
17+
</section>
18+
19+
<section>
20+
<div>Month View with Week Numbers</div>
21+
<MultiViewCalendarWithWeeks showCaptions calendarTitleText="October 2021 - November 2021"/>
22+
</section>
23+
24+
<section>
25+
<div>Year View</div>
26+
<MultiViewCalendarYear showCaptions />
27+
</section>
28+
29+
<section>
30+
<div>Decade View</div>
31+
<MultiViewCalendarDecade showCaptions />
32+
</section>
33+
34+
<section>
35+
<div>Century View</div>
36+
<MultiViewCalendarCentury showCaptions />
37+
</section>
38+
39+
<section>
40+
<div>With Footer</div>
41+
<MultiViewCalendarNormal showCalendarFooter showCaptions />
42+
</section>
43+
44+
</div>
45+
</>
46+
);

0 commit comments

Comments
 (0)