Changed folder structure; all Calendar logic now in src/Calendar
This commit is contained in:
parent
f65a4f119f
commit
904a9c0691
@ -1,5 +1,5 @@
|
|||||||
import EventGrouping from "./EventGrouping";
|
import EventGrouping from "./EventGrouping";
|
||||||
import { Event, Groups } from "../types";
|
import { Event, Groups } from "../../types";
|
||||||
import {
|
import {
|
||||||
add,
|
add,
|
||||||
differenceInCalendarDays,
|
differenceInCalendarDays,
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Event, Groups } from "../types";
|
import { Event, Groups } from "../../types";
|
||||||
|
|
||||||
export default abstract class EventGrouping {
|
export default abstract class EventGrouping {
|
||||||
protected readonly sortedEvents: Event[];
|
protected readonly sortedEvents: Event[];
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import EventGrouping from "./EventGrouping";
|
import EventGrouping from "./EventGrouping";
|
||||||
import { Event, Groups } from "../types";
|
import { Event, Groups } from "../../types";
|
||||||
import {
|
import {
|
||||||
add,
|
add,
|
||||||
differenceInCalendarMonths,
|
differenceInCalendarMonths,
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import EventGrouping from "./EventGrouping";
|
import EventGrouping from "./EventGrouping";
|
||||||
import { Event, Groups } from "../types";
|
import { Event, Groups } from "../../types";
|
||||||
import {
|
import {
|
||||||
add,
|
add,
|
||||||
differenceInCalendarWeeks,
|
differenceInCalendarWeeks,
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import EventGrouping from "./EventGrouping";
|
import EventGrouping from "./EventGrouping";
|
||||||
import { Event, Groups } from "../types";
|
import { Event, Groups } from "../../types";
|
||||||
import {
|
import {
|
||||||
add,
|
add,
|
||||||
differenceInCalendarYears,
|
differenceInCalendarYears,
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Event as EventType } from "../types";
|
import { Event as EventType } from "../../types";
|
||||||
|
|
||||||
export default class Event implements EventType {
|
export default class Event implements EventType {
|
||||||
date: Date;
|
date: Date;
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { generateRandomColor } from "../../utilities";
|
import { generateRandomColor } from "../../../utilities";
|
||||||
|
|
||||||
export default abstract class GroupRenderer {
|
export default abstract class GroupRenderer {
|
||||||
protected container: HTMLDivElement;
|
protected container: HTMLDivElement;
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import EventGrouping from "../../EventGrouping/EventGrouping";
|
import EventGrouping from "../../EventGrouping/EventGrouping";
|
||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
|
|
||||||
export default abstract class Renderer {
|
export default abstract class Renderer {
|
||||||
protected abstract renderGroups(
|
protected abstract renderGroups(
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { DayGrouping } from "../../EventGrouping";
|
import DayGrouping from "../../EventGrouping/DayGrouping";
|
||||||
|
|
||||||
import GroupRenderer from "../Abstract/GroupRenderer";
|
import GroupRenderer from "../Abstract/GroupRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { DayGrouping } from "../../EventGrouping";
|
import DayGrouping from "../../EventGrouping/DayGrouping";
|
||||||
import Renderer from "../Abstract/Renderer";
|
import Renderer from "../Abstract/Renderer";
|
||||||
import GroupDayRenderer from "./GroupDayRenderer";
|
import GroupDayRenderer from "./GroupDayRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { MonthGrouping } from "../../EventGrouping";
|
import MonthGrouping from "../../EventGrouping/MonthGrouping";
|
||||||
|
|
||||||
import GroupRenderer from "../Abstract/GroupRenderer";
|
import GroupRenderer from "../Abstract/GroupRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { MonthGrouping } from "../../EventGrouping";
|
import MonthGrouping from "../../EventGrouping/MonthGrouping";
|
||||||
import Renderer from "../Abstract/Renderer";
|
import Renderer from "../Abstract/Renderer";
|
||||||
import GroupMonthRenderer from "./GroupMonthRenderer";
|
import GroupMonthRenderer from "./GroupMonthRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { WeekGrouping } from "../../EventGrouping";
|
import WeekGrouping from "../../EventGrouping/WeekGrouping";
|
||||||
|
|
||||||
import GroupRenderer from "../Abstract/GroupRenderer";
|
import GroupRenderer from "../Abstract/GroupRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { WeekGrouping } from "../../EventGrouping";
|
import WeekGrouping from "../../EventGrouping/WeekGrouping";
|
||||||
import Renderer from "../Abstract/Renderer";
|
import Renderer from "../Abstract/Renderer";
|
||||||
import GroupWeekRenderer from "./GroupWeekRenderer";
|
import GroupWeekRenderer from "./GroupWeekRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { YearGrouping } from "../../EventGrouping";
|
import YearGrouping from "../../EventGrouping/YearGrouping";
|
||||||
|
|
||||||
import GroupRenderer from "../Abstract/GroupRenderer";
|
import GroupRenderer from "../Abstract/GroupRenderer";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Event } from "../../types";
|
import { Event } from "../../../types";
|
||||||
import { YearGrouping } from "../../EventGrouping";
|
import YearGrouping from "../../EventGrouping/YearGrouping";
|
||||||
import Renderer from "../Abstract/Renderer";
|
import Renderer from "../Abstract/Renderer";
|
||||||
import GroupYearRenderer from "./GroupYearRenderer";
|
import GroupYearRenderer from "./GroupYearRenderer";
|
||||||
|
|
||||||
@ -1,17 +1,13 @@
|
|||||||
import { GroupTypes } from "../types";
|
import { GroupTypes } from "../types";
|
||||||
import Events from "../Events/";
|
import Events from "./Events/";
|
||||||
import {
|
import DayGrouping from "./EventGrouping/DayGrouping";
|
||||||
DayGrouping,
|
import MonthGrouping from "./EventGrouping/MonthGrouping";
|
||||||
MonthGrouping,
|
import WeekGrouping from "./EventGrouping/MonthGrouping";
|
||||||
WeekGrouping,
|
import YearGrouping from "./EventGrouping/YearGrouping";
|
||||||
YearGrouping,
|
import DayRenderer from "./HtmlRenderer/Day";
|
||||||
} from "../EventGrouping";
|
import MonthRenderer from "./HtmlRenderer/Month";
|
||||||
import {
|
import WeekRenderer from "./HtmlRenderer/Week";
|
||||||
DayRenderer,
|
import YearRenderer from "./HtmlRenderer/Year";
|
||||||
MonthRenderer,
|
|
||||||
WeekRenderer,
|
|
||||||
YearRenderer,
|
|
||||||
} from "../HtmlRenderer";
|
|
||||||
|
|
||||||
export default class Calendar {
|
export default class Calendar {
|
||||||
public readonly jsonContent: object;
|
public readonly jsonContent: object;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
const { GroupTypes } = require("../../types");
|
const { GroupTypes } = require("../../../types");
|
||||||
const DayGrouping = require("../DayGrouping").default;
|
const DayGrouping = require("../../EventGrouping/DayGrouping").default;
|
||||||
const mockSortedEvents = require("./mockSortedEvents").default;
|
const mockSortedEvents = require("./mockSortedEvents").default;
|
||||||
|
|
||||||
describe("groupEventsByDay should", () => {
|
describe("groupEventsByDay should", () => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
const { GroupTypes } = require("../../types");
|
const { GroupTypes } = require("../../../types");
|
||||||
const MonthGrouping = require("../MonthGrouping").default;
|
const MonthGrouping = require("../../EventGrouping/MonthGrouping").default;
|
||||||
const mockSortedEvents = require("./mockSortedEvents").default;
|
const mockSortedEvents = require("./mockSortedEvents").default;
|
||||||
|
|
||||||
describe("groupEventsByMonth should", () => {
|
describe("groupEventsByMonth should", () => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
const { GroupTypes } = require("../../types");
|
const { GroupTypes } = require("../../../types");
|
||||||
const WeekGrouping = require("../WeekGrouping").default;
|
const WeekGrouping = require("../../EventGrouping/WeekGrouping").default;
|
||||||
const mockSortedEvents = require("./mockSortedEvents").default;
|
const mockSortedEvents = require("./mockSortedEvents").default;
|
||||||
|
|
||||||
describe("groupEventsByWeek should", () => {
|
describe("groupEventsByWeek should", () => {
|
||||||
@ -1,4 +1,4 @@
|
|||||||
const Events = require("./index").default;
|
const Events = require("../../Events").default;
|
||||||
|
|
||||||
const mockEventsAllValid = [
|
const mockEventsAllValid = [
|
||||||
{
|
{
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import DayGrouping from "./DayGrouping";
|
|
||||||
import WeekGrouping from "./WeekGrouping";
|
|
||||||
import MonthGrouping from "./MonthGrouping";
|
|
||||||
import YearGrouping from "./YearGrouping";
|
|
||||||
|
|
||||||
export { DayGrouping, WeekGrouping, MonthGrouping, YearGrouping };
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import DayRenderer from "./Day";
|
|
||||||
import WeekRenderer from "./Week";
|
|
||||||
import MonthRenderer from "./Month";
|
|
||||||
import YearRenderer from "./Year";
|
|
||||||
|
|
||||||
export { DayRenderer, WeekRenderer, MonthRenderer, YearRenderer };
|
|
||||||
Loading…
x
Reference in New Issue
Block a user