@idea-ionic/agenda 7.2.3 → 7.2.4
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/package.json +1 -1
- package/src/agenda.component.d.ts +237 -0
- package/src/agenda.module.d.ts +15 -0
- package/src/calendar.component.d.ts +68 -0
- package/src/calendarCreation.component.d.ts +70 -0
- package/src/calendarItem.component.d.ts +46 -0
- package/src/calendars.service.d.ts +79 -0
- package/src/dateFormatter.provider.d.ts +13 -0
package/package.json
CHANGED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { IonContent, Platform } from '@ionic/angular';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { CalendarEvent, CalendarEventTimesChangedEvent, CalendarMonthViewBeforeRenderEvent, CalendarView, CalendarWeekViewBeforeRenderEvent } from 'angular-calendar';
|
|
5
|
+
import { IDEATranslationsService } from '@idea-ionic/common';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class IDEAAgendaComponent implements OnInit {
|
|
8
|
+
private cdr;
|
|
9
|
+
private platform;
|
|
10
|
+
t: IDEATranslationsService;
|
|
11
|
+
/**
|
|
12
|
+
* The events to display in the calendar.
|
|
13
|
+
*/
|
|
14
|
+
events: AgendaEvent[];
|
|
15
|
+
/**
|
|
16
|
+
* An array of day indexes (0 = sunday, 1 = monday, etc.) that will be hidden on the view.
|
|
17
|
+
*/
|
|
18
|
+
excludeDays: number[];
|
|
19
|
+
/**
|
|
20
|
+
* The day start hours in 24 hour time. Must be 0-23
|
|
21
|
+
*/
|
|
22
|
+
dayStartHour: number;
|
|
23
|
+
/**
|
|
24
|
+
* The day start hours in 24 hour time. Must be 0-23
|
|
25
|
+
*/
|
|
26
|
+
dayEndHour: number;
|
|
27
|
+
/**
|
|
28
|
+
* The number of segments in an hour. Must divide equally into 60.
|
|
29
|
+
*/
|
|
30
|
+
hourSegments: number;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to open the current day's details right away in month view.
|
|
33
|
+
*/
|
|
34
|
+
activeDayIsOpen: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The view mode for the agenda.
|
|
37
|
+
*/
|
|
38
|
+
view: CalendarView;
|
|
39
|
+
/**
|
|
40
|
+
* The allowed view mode for the agenda.
|
|
41
|
+
*/
|
|
42
|
+
allowedViews: CalendarView[];
|
|
43
|
+
/**
|
|
44
|
+
* Whether to block any day/slot in the past.
|
|
45
|
+
*/
|
|
46
|
+
onlyFuture: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Some notes to show underneath the calendar's header.
|
|
49
|
+
*/
|
|
50
|
+
titleNotes: string;
|
|
51
|
+
/**
|
|
52
|
+
* The template for new events created by drag&drop.
|
|
53
|
+
*/
|
|
54
|
+
newEventTemplate: AgendaEvent;
|
|
55
|
+
/**
|
|
56
|
+
* Whether (and how) to allow the creation of events by drag&drop.
|
|
57
|
+
* If enabled, on mobile it requires the `parentContent` to be set for a correct execution.
|
|
58
|
+
*/
|
|
59
|
+
allowDragToCreate: DragToCreateOptions;
|
|
60
|
+
/**
|
|
61
|
+
* The parent ion-content, in case we want to control its scrollability for drag&drop features.
|
|
62
|
+
*/
|
|
63
|
+
parentContent: IonContent;
|
|
64
|
+
/**
|
|
65
|
+
* Trigger when an event is selected.
|
|
66
|
+
*/
|
|
67
|
+
selectEvent: EventEmitter<AgendaEvent>;
|
|
68
|
+
/**
|
|
69
|
+
* Trigger when a day is selected.
|
|
70
|
+
*/
|
|
71
|
+
selectDay: EventEmitter<Date>;
|
|
72
|
+
/**
|
|
73
|
+
* Trigger when a time slot is selected.
|
|
74
|
+
*/
|
|
75
|
+
selectSlot: EventEmitter<Date>;
|
|
76
|
+
/**
|
|
77
|
+
* Trigger when a new event is added by drag and drop.
|
|
78
|
+
*/
|
|
79
|
+
newEventByDrag: EventEmitter<AgendaEvent>;
|
|
80
|
+
/**
|
|
81
|
+
* Trigger when an event changed date (drag&drop or resize).
|
|
82
|
+
*/
|
|
83
|
+
changeEvent: EventEmitter<AgendaEvent>;
|
|
84
|
+
/**
|
|
85
|
+
* Trigger when the view date of reference changed (because we moved inside the calendar).
|
|
86
|
+
*/
|
|
87
|
+
changeDate: EventEmitter<Date>;
|
|
88
|
+
/**
|
|
89
|
+
* Trigger before the rendering of the week or day view.
|
|
90
|
+
*/
|
|
91
|
+
beforeWeekOrDayViewRenderEmitter: EventEmitter<CalendarWeekViewBeforeRenderEvent>;
|
|
92
|
+
/**
|
|
93
|
+
* Trigger before the rendering of the month view.
|
|
94
|
+
*/
|
|
95
|
+
beforeMonthViewRenderEmitter: EventEmitter<CalendarMonthViewBeforeRenderEvent>;
|
|
96
|
+
/**
|
|
97
|
+
* Helper to use the enum in the UX.
|
|
98
|
+
*/
|
|
99
|
+
CalendarView: typeof CalendarView;
|
|
100
|
+
/**
|
|
101
|
+
* The currently selected date.
|
|
102
|
+
*/
|
|
103
|
+
viewDate: Date;
|
|
104
|
+
/**
|
|
105
|
+
* A controller to refresh the current view.
|
|
106
|
+
*/
|
|
107
|
+
refresh: Subject<void>;
|
|
108
|
+
/**
|
|
109
|
+
* The locale used to format dates.
|
|
110
|
+
* @hide
|
|
111
|
+
*/
|
|
112
|
+
locale: string;
|
|
113
|
+
/**
|
|
114
|
+
* The starting day for the week, according to the locale (0 = sunday).
|
|
115
|
+
* @hide
|
|
116
|
+
*/
|
|
117
|
+
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
118
|
+
Attendance: typeof EventAttendance;
|
|
119
|
+
darkMode: boolean;
|
|
120
|
+
constructor(cdr: ChangeDetectorRef, platform: Platform, t: IDEATranslationsService);
|
|
121
|
+
ngOnInit(): void;
|
|
122
|
+
isMobile(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Run some checks before the month view is rendered (e.g. disable invalid days).
|
|
125
|
+
*/
|
|
126
|
+
beforeMonthViewRender(event: CalendarMonthViewBeforeRenderEvent): void;
|
|
127
|
+
/**
|
|
128
|
+
* Run some checks before the week/day view is rendered (e.g. disable invalid days).
|
|
129
|
+
*/
|
|
130
|
+
beforeWeekOrDayViewRender(event: CalendarWeekViewBeforeRenderEvent): void;
|
|
131
|
+
/**
|
|
132
|
+
* Check whether a date is valid based on the configured parameters.
|
|
133
|
+
*/
|
|
134
|
+
dateIsValid(date: any, sameDayIsValid?: boolean): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Change the current view for the agenda.
|
|
137
|
+
*/
|
|
138
|
+
setView(view: CalendarView): void;
|
|
139
|
+
/**
|
|
140
|
+
* Emit the change of the view date and close the detail component of the month view, if needed.
|
|
141
|
+
*/
|
|
142
|
+
viewDateChanged(newDate: Date): void;
|
|
143
|
+
/**
|
|
144
|
+
* A day was selected: manage the detailed view.
|
|
145
|
+
*/
|
|
146
|
+
changeDay({ date, events }: {
|
|
147
|
+
date: Date;
|
|
148
|
+
events: AgendaEvent[];
|
|
149
|
+
}): void;
|
|
150
|
+
/**
|
|
151
|
+
* The time of an event was changed.
|
|
152
|
+
*/
|
|
153
|
+
eventTimesChanged({ event, newStart, newEnd }: CalendarEventTimesChangedEvent): void;
|
|
154
|
+
/**
|
|
155
|
+
* Given a color, it returns an opaque version of it.
|
|
156
|
+
*/
|
|
157
|
+
getAlternateColor(color: string, amount: number, opacity?: number): string | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Get the content of the tooltip based on the event.
|
|
160
|
+
*/
|
|
161
|
+
getTooltipContent(event: AgendaEvent): string;
|
|
162
|
+
/**
|
|
163
|
+
* Get a shortened version of the description as preview.
|
|
164
|
+
*/
|
|
165
|
+
getPreviewDescription(description: string): string;
|
|
166
|
+
/**
|
|
167
|
+
* Handle the drag&drop to create a new event.
|
|
168
|
+
*/
|
|
169
|
+
startDragToCreate(event: Event, segmentDate: Date, segmentElement: HTMLElement): void;
|
|
170
|
+
private getFixedEndDateWithMinimumSegmentDuration;
|
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEAAgendaComponent, never>;
|
|
172
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IDEAAgendaComponent, "idea-agenda", never, { "events": { "alias": "events"; "required": false; }; "excludeDays": { "alias": "excludeDays"; "required": false; }; "dayStartHour": { "alias": "dayStartHour"; "required": false; }; "dayEndHour": { "alias": "dayEndHour"; "required": false; }; "hourSegments": { "alias": "hourSegments"; "required": false; }; "activeDayIsOpen": { "alias": "activeDayIsOpen"; "required": false; }; "view": { "alias": "view"; "required": false; }; "allowedViews": { "alias": "allowedViews"; "required": false; }; "onlyFuture": { "alias": "onlyFuture"; "required": false; }; "titleNotes": { "alias": "titleNotes"; "required": false; }; "newEventTemplate": { "alias": "newEventTemplate"; "required": false; }; "allowDragToCreate": { "alias": "allowDragToCreate"; "required": false; }; "parentContent": { "alias": "parentContent"; "required": false; }; }, { "selectEvent": "selectEvent"; "selectDay": "selectDay"; "selectSlot": "selectSlot"; "newEventByDrag": "newEventByDrag"; "changeEvent": "changeEvent"; "changeDate": "changeDate"; "beforeWeekOrDayViewRenderEmitter": "beforeWeekOrDayViewRenderEmitter"; "beforeMonthViewRenderEmitter": "beforeMonthViewRenderEmitter"; }, never, never, false, never>;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A richer version of the classic CalendarEvent.
|
|
176
|
+
*/
|
|
177
|
+
export interface AgendaEvent extends CalendarEvent {
|
|
178
|
+
/**
|
|
179
|
+
* A brief description for the event (e.g. customer, address, etc.).
|
|
180
|
+
*/
|
|
181
|
+
description?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The location of the event.
|
|
184
|
+
*/
|
|
185
|
+
location?: string;
|
|
186
|
+
/**
|
|
187
|
+
* A list of URLs of images to show as small avatars.
|
|
188
|
+
*/
|
|
189
|
+
avatars?: {
|
|
190
|
+
id: string;
|
|
191
|
+
url: string;
|
|
192
|
+
title: string;
|
|
193
|
+
}[];
|
|
194
|
+
/**
|
|
195
|
+
* A list of ion-icons to show.
|
|
196
|
+
*/
|
|
197
|
+
icons?: {
|
|
198
|
+
name: string;
|
|
199
|
+
title: string;
|
|
200
|
+
}[];
|
|
201
|
+
/**
|
|
202
|
+
* The colors of the event displayed.
|
|
203
|
+
*/
|
|
204
|
+
color?: {
|
|
205
|
+
primary: string;
|
|
206
|
+
secondary?: string;
|
|
207
|
+
} | any;
|
|
208
|
+
/**
|
|
209
|
+
* Whether the event is external; external events are less important UI-wise.
|
|
210
|
+
*/
|
|
211
|
+
external?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* The attendance status to this event, if any.
|
|
214
|
+
*/
|
|
215
|
+
attendance?: EventAttendance;
|
|
216
|
+
/**
|
|
217
|
+
* A standard and unique id for the event, valid across multiple sources.
|
|
218
|
+
*/
|
|
219
|
+
iCalUID?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Possible attendance statuses for the event.
|
|
223
|
+
*/
|
|
224
|
+
export declare enum EventAttendance {
|
|
225
|
+
DECLINED = -1,
|
|
226
|
+
NEEDS_ACTION = 0,
|
|
227
|
+
TENTATIVE = 1,
|
|
228
|
+
ACCEPTED = 2
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The options to allow (or not) drag&drop to create a new event.
|
|
232
|
+
*/
|
|
233
|
+
export declare enum DragToCreateOptions {
|
|
234
|
+
DISABLED = 0,
|
|
235
|
+
ONLY_SAME_DAY = 1,
|
|
236
|
+
FREE = 2
|
|
237
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./agenda.component";
|
|
3
|
+
import * as i2 from "./calendar.component";
|
|
4
|
+
import * as i3 from "./calendarItem.component";
|
|
5
|
+
import * as i4 from "./calendarCreation.component";
|
|
6
|
+
import * as i5 from "@angular/common";
|
|
7
|
+
import * as i6 from "@angular/forms";
|
|
8
|
+
import * as i7 from "@ionic/angular";
|
|
9
|
+
import * as i8 from "@idea-ionic/common";
|
|
10
|
+
import * as i9 from "angular-calendar";
|
|
11
|
+
export declare class IDEAAgendaModule {
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEAAgendaModule, never>;
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<IDEAAgendaModule, [typeof i1.IDEAAgendaComponent, typeof i2.IDEACalendarComponent, typeof i3.IDEACalendarItemComponent, typeof i4.IDEACalendarCreationComponent], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.IonicModule, typeof i8.IDEATranslationsModule, typeof i8.IDEAColorPickerModule, typeof i8.IDEACheckerModule, typeof i8.IDEAUserAvatarModule, typeof i9.CalendarModule], [typeof i1.IDEAAgendaComponent, typeof i2.IDEACalendarComponent, typeof i3.IDEACalendarItemComponent, typeof i4.IDEACalendarCreationComponent]>;
|
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<IDEAAgendaModule>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ModalController, AlertController } from '@ionic/angular';
|
|
3
|
+
import { Calendar, Check, Membership } from 'idea-toolbox';
|
|
4
|
+
import { IDEALoadingService, IDEAAWSAPIService, IDEATinCanService, IDEAMessageService, IDEATranslationsService } from '@idea-ionic/common';
|
|
5
|
+
import { IDEACalendarsService } from './calendars.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class IDEACalendarComponent implements OnInit {
|
|
8
|
+
calendars: IDEACalendarsService;
|
|
9
|
+
modalCtrl: ModalController;
|
|
10
|
+
alertCtrl: AlertController;
|
|
11
|
+
tc: IDEATinCanService;
|
|
12
|
+
loading: IDEALoadingService;
|
|
13
|
+
message: IDEAMessageService;
|
|
14
|
+
API: IDEAAWSAPIService;
|
|
15
|
+
t: IDEATranslationsService;
|
|
16
|
+
/**
|
|
17
|
+
* The calendar to manage.
|
|
18
|
+
*/
|
|
19
|
+
calendar: Calendar;
|
|
20
|
+
/**
|
|
21
|
+
* Whether we want to enable advanced permissions (based on the memberships) on the calendar.
|
|
22
|
+
*/
|
|
23
|
+
advancedPermissions: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the calendar color is an important detail or it shouldn't be shown.
|
|
26
|
+
*/
|
|
27
|
+
hideColor: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Working copy of the calendar, to update only when confirmed.
|
|
30
|
+
*/
|
|
31
|
+
_calendar: Calendar;
|
|
32
|
+
/**
|
|
33
|
+
* Helper to allow selecting memberships.
|
|
34
|
+
*/
|
|
35
|
+
membershipsChecks: Check[];
|
|
36
|
+
/**
|
|
37
|
+
* The current membership.
|
|
38
|
+
*/
|
|
39
|
+
membership: Membership;
|
|
40
|
+
/**
|
|
41
|
+
* Errors while validating the entity.
|
|
42
|
+
*/
|
|
43
|
+
errors: Set<string>;
|
|
44
|
+
/**
|
|
45
|
+
* The default color for a calendar.
|
|
46
|
+
*/
|
|
47
|
+
DEFAULT_COLOR: string;
|
|
48
|
+
constructor(calendars: IDEACalendarsService, modalCtrl: ModalController, alertCtrl: AlertController, tc: IDEATinCanService, loading: IDEALoadingService, message: IDEAMessageService, API: IDEAAWSAPIService, t: IDEATranslationsService);
|
|
49
|
+
ngOnInit(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Set the support array to display errors in the UI.
|
|
52
|
+
*/
|
|
53
|
+
hasFieldAnError(field: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Save a calendar with the new info.
|
|
56
|
+
*/
|
|
57
|
+
save(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete the calendar.
|
|
60
|
+
*/
|
|
61
|
+
delete(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Close the component.
|
|
64
|
+
*/
|
|
65
|
+
close(): void;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEACalendarComponent, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IDEACalendarComponent, "idea-calendar", never, { "calendar": { "alias": "calendar"; "required": false; }; "advancedPermissions": { "alias": "advancedPermissions"; "required": false; }; "hideColor": { "alias": "hideColor"; "required": false; }; }, {}, never, never, false, never>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ModalController } from '@ionic/angular';
|
|
3
|
+
import { Calendar, ExternalCalendarSources, Membership } from 'idea-toolbox';
|
|
4
|
+
import { IDEALoadingService, IDEAAWSAPIService, IDEATinCanService, IDEAMessageService, IDEATranslationsService } from '@idea-ionic/common';
|
|
5
|
+
import { IDEACalendarsService } from './calendars.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class IDEACalendarCreationComponent implements OnInit {
|
|
8
|
+
calendars: IDEACalendarsService;
|
|
9
|
+
modalCtrl: ModalController;
|
|
10
|
+
tc: IDEATinCanService;
|
|
11
|
+
loading: IDEALoadingService;
|
|
12
|
+
message: IDEAMessageService;
|
|
13
|
+
API: IDEAAWSAPIService;
|
|
14
|
+
t: IDEATranslationsService;
|
|
15
|
+
/**
|
|
16
|
+
* Whether we want to allow the creation of only a particular type of calendar, based on the scope.
|
|
17
|
+
*/
|
|
18
|
+
fixScope: CalendarScopes;
|
|
19
|
+
/**
|
|
20
|
+
* Whether we want to allow the creation of local calendars.
|
|
21
|
+
*/
|
|
22
|
+
onlyExternalCalendars: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The current membership (generic).
|
|
25
|
+
*/
|
|
26
|
+
membership: Membership;
|
|
27
|
+
/**
|
|
28
|
+
* The calendar to create.
|
|
29
|
+
*/
|
|
30
|
+
calendar: Calendar;
|
|
31
|
+
/**
|
|
32
|
+
* The default color for a new calendar.
|
|
33
|
+
*/
|
|
34
|
+
DEFAULT_COLOR: string;
|
|
35
|
+
/**
|
|
36
|
+
* The possible external services for the new calendar.
|
|
37
|
+
*/
|
|
38
|
+
SOURCES: string[];
|
|
39
|
+
constructor(calendars: IDEACalendarsService, modalCtrl: ModalController, tc: IDEATinCanService, loading: IDEALoadingService, message: IDEAMessageService, API: IDEAAWSAPIService, t: IDEATranslationsService);
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
/**
|
|
42
|
+
* If allowed by the component configuration, reset the scope of the calendar (private/shared).
|
|
43
|
+
*/
|
|
44
|
+
resetScope(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Whether we can change the scope of the calendar (private/shared).
|
|
47
|
+
*/
|
|
48
|
+
canChangeScope(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the scope has been set already.
|
|
51
|
+
*/
|
|
52
|
+
scopeIsSet(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Add a new calendar based on the configuration set.
|
|
55
|
+
*/
|
|
56
|
+
saveNewCalendar(service?: ExternalCalendarSources): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Close the component.
|
|
59
|
+
*/
|
|
60
|
+
close(): void;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEACalendarCreationComponent, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IDEACalendarCreationComponent, "idea-calendar-creation", never, { "fixScope": { "alias": "fixScope"; "required": false; }; "onlyExternalCalendars": { "alias": "onlyExternalCalendars"; "required": false; }; }, {}, never, never, false, never>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The possible scopes of the calendar.
|
|
66
|
+
*/
|
|
67
|
+
export declare enum CalendarScopes {
|
|
68
|
+
SHARED = "shared",// teamId
|
|
69
|
+
PRIVATE = "private"
|
|
70
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { AlertController, ModalController } from '@ionic/angular';
|
|
3
|
+
import { Calendar } from 'idea-toolbox';
|
|
4
|
+
import { IDEALoadingService, IDEAMessageService, IDEATranslationsService } from '@idea-ionic/common';
|
|
5
|
+
import { IDEACalendarsService } from './calendars.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class IDEACalendarItemComponent {
|
|
8
|
+
calendars: IDEACalendarsService;
|
|
9
|
+
alertCtrl: AlertController;
|
|
10
|
+
modalCtrl: ModalController;
|
|
11
|
+
message: IDEAMessageService;
|
|
12
|
+
loading: IDEALoadingService;
|
|
13
|
+
t: IDEATranslationsService;
|
|
14
|
+
/**
|
|
15
|
+
* The calendar to show.
|
|
16
|
+
*/
|
|
17
|
+
calendar: Calendar;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the component is disabled.
|
|
20
|
+
*/
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether we want to enable advanced permissions (based on the memberships) on the calendar.
|
|
24
|
+
*/
|
|
25
|
+
advancedPermissions: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the calendar color is an important detail or it shouldn't be shown.
|
|
28
|
+
*/
|
|
29
|
+
hideColor: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Report to parent components a change.
|
|
32
|
+
*/
|
|
33
|
+
somethingChanged: EventEmitter<Calendar>;
|
|
34
|
+
constructor(calendars: IDEACalendarsService, alertCtrl: AlertController, modalCtrl: ModalController, message: IDEAMessageService, loading: IDEALoadingService, t: IDEATranslationsService);
|
|
35
|
+
/**
|
|
36
|
+
* Open the modal to manage the calendar.
|
|
37
|
+
*/
|
|
38
|
+
manageCalendar(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Continue the auth flow to link an external service and set an external calendar;
|
|
41
|
+
* otherwise, the calendar can be deleted.
|
|
42
|
+
*/
|
|
43
|
+
linkExtCalendarOrDelete(): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEACalendarItemComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IDEACalendarItemComponent, "idea-calendar-item", never, { "calendar": { "alias": "calendar"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "advancedPermissions": { "alias": "advancedPermissions"; "required": false; }; "hideColor": { "alias": "hideColor"; "required": false; }; }, { "somethingChanged": "somethingChanged"; }, never, never, false, never>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AlertController, ModalController } from '@ionic/angular';
|
|
2
|
+
import { Calendar, ExternalCalendarSources } from 'idea-toolbox';
|
|
3
|
+
import { IDEALoadingService, IDEAAWSAPIService, IDEAMessageService, IDEATranslationsService } from '@idea-ionic/common';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Note: to test locally, you need to temporarily change the redirect URI:
|
|
7
|
+
* - in the lambda `idea_calendars`, e.g. `SCARLETT_URL`;
|
|
8
|
+
* - in the client config file: `APP_URL`.
|
|
9
|
+
* In both cases, the value should be set to `http://localhost:8100` (or according to the local URL).
|
|
10
|
+
*/
|
|
11
|
+
export declare class IDEACalendarsService {
|
|
12
|
+
modalCtrl: ModalController;
|
|
13
|
+
alertCtrl: AlertController;
|
|
14
|
+
message: IDEAMessageService;
|
|
15
|
+
loading: IDEALoadingService;
|
|
16
|
+
API: IDEAAWSAPIService;
|
|
17
|
+
t: IDEATranslationsService;
|
|
18
|
+
constructor(modalCtrl: ModalController, alertCtrl: AlertController, message: IDEAMessageService, loading: IDEALoadingService, API: IDEAAWSAPIService, t: IDEATranslationsService);
|
|
19
|
+
/**
|
|
20
|
+
* Get the ion-icon of an external service from its name.
|
|
21
|
+
*/
|
|
22
|
+
getServiceIcon(service: ExternalCalendarSources): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get the base URL for API request (shared/private calendar).
|
|
25
|
+
*/
|
|
26
|
+
getRequestURL(calendar: Calendar): string;
|
|
27
|
+
/**
|
|
28
|
+
* Create a new calendar.
|
|
29
|
+
*/
|
|
30
|
+
postCalendar(cal: Calendar): Promise<Calendar>;
|
|
31
|
+
/**
|
|
32
|
+
* Update an existing calendar.
|
|
33
|
+
*/
|
|
34
|
+
putCalendar(cal: Calendar): Promise<Calendar>;
|
|
35
|
+
/**
|
|
36
|
+
* Delete a calendar.
|
|
37
|
+
*/
|
|
38
|
+
deleteCalendar(cal: Calendar): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Associate an external calendar with the given calendar.
|
|
41
|
+
*/
|
|
42
|
+
setExternalCalendar(cal: Calendar, externalId: string): Promise<Calendar>;
|
|
43
|
+
/**
|
|
44
|
+
* Link the calendar with the chosen external service (auth flow).
|
|
45
|
+
*/
|
|
46
|
+
linkExtService(cal: Calendar): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Get the external calendars list of the external service.
|
|
49
|
+
*/
|
|
50
|
+
getExternalCalendars(cal: Calendar): Promise<ExtCalendar[]>;
|
|
51
|
+
/**
|
|
52
|
+
* If the external service is linked, choose an external calendar and set it for the chosen calendar.
|
|
53
|
+
* @return the updated calendar.
|
|
54
|
+
*/
|
|
55
|
+
chooseAndSetExternalCalendar(cal: Calendar): Promise<Calendar>;
|
|
56
|
+
/**
|
|
57
|
+
* Open the modal to pick a calendar from the external service.
|
|
58
|
+
* @return the id of the external calendar.
|
|
59
|
+
*/
|
|
60
|
+
private openModalAndPickExternalCalendar;
|
|
61
|
+
/**
|
|
62
|
+
* First sync of the extenal calendar.
|
|
63
|
+
*/
|
|
64
|
+
syncCalendar(cal: Calendar): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Helper to recursively sync an the extenal calendar.
|
|
67
|
+
*/
|
|
68
|
+
private syncCalendarHelper;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IDEACalendarsService, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IDEACalendarsService>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Helper structure to define external services' calendars (basic info).
|
|
74
|
+
*/
|
|
75
|
+
interface ExtCalendar {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CustomDateFormatter extends CalendarDateFormatter {
|
|
4
|
+
monthViewColumnHeader: ({ date, locale }: DateFormatterParams) => string;
|
|
5
|
+
monthViewTitle: ({ date, locale }: DateFormatterParams) => string;
|
|
6
|
+
weekViewHour: ({ date, locale }: DateFormatterParams) => string;
|
|
7
|
+
weekViewColumnHeader: ({ date, locale }: DateFormatterParams) => string;
|
|
8
|
+
weekViewTitle: ({ date, locale }: DateFormatterParams) => string;
|
|
9
|
+
dayViewHour: ({ date, locale }: DateFormatterParams) => string;
|
|
10
|
+
dayViewTitle: ({ date, locale }: DateFormatterParams) => string;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomDateFormatter, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CustomDateFormatter>;
|
|
13
|
+
}
|