Skip to content

Commit cef12dc

Browse files
author
Dohyung Ahn
committed
refactor: rename CalendarControl to CalendarCore
1 parent db0d458 commit cef12dc

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

apps/calendar/src/factory/calendar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { h } from 'preact';
22

33
import { Main } from '@src/components/view/main';
44
import { VIEW_TYPE } from '@src/constants/view';
5-
import CalendarControl from '@src/factory/calendarControl';
5+
import CalendarCore from '@src/factory/calendarCore';
66
import { InvalidViewTypeError } from '@src/utils/error';
77

88
import type { Options, ViewType } from '@t/options';
@@ -12,7 +12,7 @@ function isValidViewType(viewType: string): viewType is ViewType {
1212
return !!Object.values(VIEW_TYPE).find((type) => type === viewType);
1313
}
1414

15-
export default class Calendar extends CalendarControl {
15+
export default class Calendar extends CalendarCore {
1616
constructor(container: Element | string, options: Options = {}) {
1717
super(container, options);
1818

apps/calendar/src/factory/calendarControl.spec.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Layout } from '@src/components/layout';
99
import { GA_TRACKING_ID } from '@src/constants/statistics';
1010
import { useDispatch, useStore } from '@src/contexts/calendarStore';
1111
import { useAllTheme, useTheme } from '@src/contexts/themeStore';
12-
import CalendarControl from '@src/factory/calendarControl';
12+
import CalendarCore from '@src/factory/calendarCore';
1313
import Month from '@src/factory/month';
1414
import { isVisibleEvent } from '@src/helpers/events';
1515
import { createDateMatrixOfMonth, getWeekDates } from '@src/helpers/grid';
@@ -41,7 +41,7 @@ function MockComponent() {
4141
);
4242
}
4343

44-
class MockCalendar extends CalendarControl {
44+
class MockCalendar extends CalendarCore {
4545
protected getComponent() {
4646
return <MockComponent />;
4747
}
@@ -205,7 +205,7 @@ describe('destroy', () => {
205205
});
206206

207207
describe('openFormPopup', () => {
208-
class MockPopupCalendar extends CalendarControl {
208+
class MockPopupCalendar extends CalendarCore {
209209
protected getComponent() {
210210
return <Layout>mock</Layout>; // popup component is rendered in Layout component
211211
}
@@ -336,7 +336,7 @@ describe('prev/next/today', () => {
336336

337337
return <div>month: {month}</div>;
338338
}
339-
class MockCalendarMonth extends CalendarControl {
339+
class MockCalendarMonth extends CalendarCore {
340340
protected getComponent() {
341341
return <MockMonthView />;
342342
}
@@ -431,7 +431,7 @@ describe('prev/next/today', () => {
431431
</div>
432432
);
433433
}
434-
class MockCalendarWeek extends CalendarControl {
434+
class MockCalendarWeek extends CalendarCore {
435435
protected getComponent() {
436436
return <MockWeekView />;
437437
}
@@ -550,7 +550,7 @@ describe('prev/next/today', () => {
550550
</div>
551551
);
552552
}
553-
class MockCalendarDay extends CalendarControl {
553+
class MockCalendarDay extends CalendarCore {
554554
protected getComponent() {
555555
return <MockDayView />;
556556
}
@@ -651,7 +651,7 @@ describe('setTheme', () => {
651651
</div>
652652
);
653653
}
654-
class MockCalendarTheme extends CalendarControl {
654+
class MockCalendarTheme extends CalendarCore {
655655
protected getComponent() {
656656
return <MockThemeView />;
657657
}
@@ -725,7 +725,7 @@ describe('getOptions/setOptions', () => {
725725
</div>
726726
);
727727
}
728-
class MockCalendarOptions extends CalendarControl {
728+
class MockCalendarOptions extends CalendarCore {
729729
protected getComponent() {
730730
return <MockOptionsView />;
731731
}
@@ -803,7 +803,7 @@ describe('setCalendars', () => {
803803
</div>
804804
);
805805
}
806-
class MockCalendarCalendars extends CalendarControl {
806+
class MockCalendarCalendars extends CalendarCore {
807807
protected getComponent() {
808808
return <MockCalendarsView />;
809809
}
@@ -867,7 +867,7 @@ describe('setCalendarColor', () => {
867867
</div>
868868
);
869869
}
870-
class MockCalendarColor extends CalendarControl {
870+
class MockCalendarColor extends CalendarCore {
871871
protected getComponent() {
872872
return <MockCalendarColorView />;
873873
}
@@ -1018,7 +1018,7 @@ describe('hideMoreView', () => {
10181018
describe('getElement', () => {
10191019
const eventModel = new EventModel({ calendarId: 'mockCalendarId', id: 'mockEventId' });
10201020
const mockEventUIModel = new EventUIModel(eventModel);
1021-
class MockCalenderEvent extends CalendarControl {
1021+
class MockCalenderEvent extends CalendarCore {
10221022
protected getComponent() {
10231023
return (
10241024
<div>
@@ -1091,7 +1091,7 @@ describe('setCalendarVisibility', () => {
10911091
</div>
10921092
);
10931093
}
1094-
class MockCalenderEvent extends CalendarControl {
1094+
class MockCalenderEvent extends CalendarCore {
10951095
protected getComponent() {
10961096
return <MockHorizontalEvents />;
10971097
}

apps/calendar/src/factory/calendarControl.tsx apps/calendar/src/factory/calendarCore.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import type {
3333
} from '@t/store';
3434
import type { ThemeState, ThemeStore } from '@t/theme';
3535

36-
export default abstract class CalendarControl implements EventBus<ExternalEventTypes> {
36+
export default abstract class CalendarCore implements EventBus<ExternalEventTypes> {
3737
protected container: Element | null;
3838

3939
/**

apps/calendar/src/factory/day.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { h } from 'preact';
22

33
import { Day as DayComponent } from '@src/components/view/day';
4-
import CalendarControl from '@src/factory/calendarControl';
4+
import CalendarCore from '@src/factory/calendarCore';
55

66
import type { Options } from '@t/options';
77

8-
export default class Day extends CalendarControl {
8+
export default class Day extends CalendarCore {
99
constructor(container: Element, options: Options = {}) {
1010
super(container, options);
1111

apps/calendar/src/factory/month.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { h } from 'preact';
22

33
import { Month as MonthComponent } from '@src/components/view/month';
4-
import CalendarControl from '@src/factory/calendarControl';
4+
import CalendarCore from '@src/factory/calendarCore';
55

66
import type { Options } from '@t/options';
77

8-
export default class Month extends CalendarControl {
8+
export default class Month extends CalendarCore {
99
constructor(container: Element, options: Options = {}) {
1010
super(container, options);
1111

apps/calendar/src/factory/week.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { h } from 'preact';
22

33
import { Week as WeekComponent } from '@src/components/view/week';
4-
import CalendarControl from '@src/factory/calendarControl';
4+
import CalendarCore from '@src/factory/calendarCore';
55

66
import type { Options } from '@t/options';
77

8-
export default class Week extends CalendarControl {
8+
export default class Week extends CalendarCore {
99
constructor(container: Element, options: Options = {}) {
1010
super(container, options);
1111

0 commit comments

Comments
 (0)