Adds I-prefix to all interfaces
This commit is contained in:
parent
80aaab46f2
commit
8ec5f52872
44 changed files with 1731 additions and 1949 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { CalendarEvent } from '../types/CalendarTypes';
|
||||
import { CalendarConfig } from '../core/CalendarConfig';
|
||||
import { ICalendarEvent } from '../types/CalendarTypes';
|
||||
import { Configuration } from '../configuration/CalendarConfig';
|
||||
import { TimeFormatter } from '../utils/TimeFormatter';
|
||||
import { PositionUtils } from '../utils/PositionUtils';
|
||||
import { DateService } from '../utils/DateService';
|
||||
|
|
@ -9,12 +9,12 @@ import { DateService } from '../utils/DateService';
|
|||
*/
|
||||
export abstract class BaseSwpEventElement extends HTMLElement {
|
||||
protected dateService: DateService;
|
||||
protected config: CalendarConfig;
|
||||
protected config: Configuration;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
// TODO: Find better solution for web component DI
|
||||
this.config = new CalendarConfig();
|
||||
// Get singleton instance for web components (can't use DI)
|
||||
this.config = Configuration.getInstance();
|
||||
this.dateService = new DateService(this.config);
|
||||
}
|
||||
|
||||
|
|
@ -256,11 +256,11 @@ export class SwpEventElement extends BaseSwpEventElement {
|
|||
// ============================================
|
||||
|
||||
/**
|
||||
* Create SwpEventElement from CalendarEvent
|
||||
* Create SwpEventElement from ICalendarEvent
|
||||
*/
|
||||
public static fromCalendarEvent(event: CalendarEvent): SwpEventElement {
|
||||
public static fromCalendarEvent(event: ICalendarEvent): SwpEventElement {
|
||||
const element = document.createElement('swp-event') as SwpEventElement;
|
||||
const config = new CalendarConfig();
|
||||
const config = Configuration.getInstance();
|
||||
const dateService = new DateService(config);
|
||||
|
||||
element.dataset.eventId = event.id;
|
||||
|
|
@ -274,9 +274,9 @@ export class SwpEventElement extends BaseSwpEventElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Extract CalendarEvent from DOM element
|
||||
* Extract ICalendarEvent from DOM element
|
||||
*/
|
||||
public static extractCalendarEventFromElement(element: HTMLElement): CalendarEvent {
|
||||
public static extractCalendarEventFromElement(element: HTMLElement): ICalendarEvent {
|
||||
return {
|
||||
id: element.dataset.eventId || '',
|
||||
title: element.dataset.title || '',
|
||||
|
|
@ -331,11 +331,11 @@ export class SwpAllDayEventElement extends BaseSwpEventElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create from CalendarEvent
|
||||
* Create from ICalendarEvent
|
||||
*/
|
||||
public static fromCalendarEvent(event: CalendarEvent): SwpAllDayEventElement {
|
||||
public static fromCalendarEvent(event: ICalendarEvent): SwpAllDayEventElement {
|
||||
const element = document.createElement('swp-allday-event') as SwpAllDayEventElement;
|
||||
const config = new CalendarConfig();
|
||||
const config = Configuration.getInstance();
|
||||
const dateService = new DateService(config);
|
||||
|
||||
element.dataset.eventId = event.id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue