@idea-ionic/agenda 6.8.1 → 6.9.1

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.
@@ -1,12 +1,12 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { Platform } from '@ionic/angular';
1
+ import { EventEmitter, OnInit, ChangeDetectorRef } from '@angular/core';
2
+ import { IonContent, Platform } from '@ionic/angular';
3
3
  import { Subject } from 'rxjs';
4
- import { CalendarEvent, CalendarEventTimesChangedEvent, CalendarMonthViewDay, CalendarView } from 'angular-calendar';
5
- import { IDEATinCanService, IDEATranslationsService } from '@idea-ionic/common';
4
+ import { CalendarEvent, CalendarEventTimesChangedEvent, CalendarMonthViewBeforeRenderEvent, CalendarView, CalendarWeekViewBeforeRenderEvent } from 'angular-calendar';
5
+ import { IDEATranslationsService } from '@idea-ionic/common';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class IDEAAgendaComponent implements OnInit {
8
- platform: Platform;
9
- tc: IDEATinCanService;
8
+ private cdr;
9
+ private platform;
10
10
  t: IDEATranslationsService;
11
11
  /**
12
12
  * The events to display in the calendar.
@@ -36,10 +36,31 @@ export declare class IDEAAgendaComponent implements OnInit {
36
36
  * The view mode for the agenda.
37
37
  */
38
38
  view: CalendarView;
39
+ /**
40
+ * The allowed view mode for the agenda.
41
+ */
42
+ allowedViews: CalendarView[];
39
43
  /**
40
44
  * Whether to block any day/slot in the past.
41
45
  */
42
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;
43
64
  /**
44
65
  * Trigger when an event is selected.
45
66
  */
@@ -52,6 +73,10 @@ export declare class IDEAAgendaComponent implements OnInit {
52
73
  * Trigger when a time slot is selected.
53
74
  */
54
75
  selectSlot: EventEmitter<Date>;
76
+ /**
77
+ * Trigger when a new event is added by drag and drop.
78
+ */
79
+ newEventByDrag: EventEmitter<AgendaEvent>;
55
80
  /**
56
81
  * Trigger when an event changed date (drag&drop or resize).
57
82
  */
@@ -60,6 +85,14 @@ export declare class IDEAAgendaComponent implements OnInit {
60
85
  * Trigger when the view date of reference changed (because we moved inside the calendar).
61
86
  */
62
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>;
63
96
  /**
64
97
  * Helper to use the enum in the UX.
65
98
  */
@@ -71,7 +104,7 @@ export declare class IDEAAgendaComponent implements OnInit {
71
104
  /**
72
105
  * A controller to refresh the current view.
73
106
  */
74
- refresh: Subject<any>;
107
+ refresh: Subject<void>;
75
108
  /**
76
109
  * The locale used to format dates.
77
110
  * @hide
@@ -81,30 +114,24 @@ export declare class IDEAAgendaComponent implements OnInit {
81
114
  * The starting day for the week, according to the locale (0 = sunday).
82
115
  * @hide
83
116
  */
84
- weekStartsOn: number;
85
- /**
86
- * Helper to use the enum in the UI.
87
- */
117
+ weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
88
118
  Attendance: typeof EventAttendance;
89
119
  darkMode: boolean;
90
- constructor(platform: Platform, tc: IDEATinCanService, t: IDEATranslationsService);
120
+ constructor(cdr: ChangeDetectorRef, platform: Platform, t: IDEATranslationsService);
91
121
  ngOnInit(): void;
122
+ isMobile(): boolean;
92
123
  /**
93
124
  * Run some checks before the month view is rendered (e.g. disable invalid days).
94
125
  */
95
- beforeMonthViewRender({ body }: {
96
- body: CalendarMonthViewDay[];
97
- }): void;
126
+ beforeMonthViewRender(event: CalendarMonthViewBeforeRenderEvent): void;
98
127
  /**
99
128
  * Run some checks before the week/day view is rendered (e.g. disable invalid days).
100
129
  */
101
- beforeWeekOrDayViewRender({ header }: {
102
- header: any;
103
- }): void;
130
+ beforeWeekOrDayViewRender(event: CalendarWeekViewBeforeRenderEvent): void;
104
131
  /**
105
132
  * Check whether a date is valid based on the configured parameters.
106
133
  */
107
- dateIsValid(date: Date, sameDayIsValid?: boolean): boolean;
134
+ dateIsValid(date: any, sameDayIsValid?: boolean): boolean;
108
135
  /**
109
136
  * Change the current view for the agenda.
110
137
  */
@@ -127,7 +154,7 @@ export declare class IDEAAgendaComponent implements OnInit {
127
154
  /**
128
155
  * Given a color, it returns an opaque version of it.
129
156
  */
130
- getAlternateColor(color: string, amount: number, opacity?: number): string;
157
+ getAlternateColor(color: string, amount: number, opacity?: number): string | undefined;
131
158
  /**
132
159
  * Get the content of the tooltip based on the event.
133
160
  */
@@ -136,8 +163,13 @@ export declare class IDEAAgendaComponent implements OnInit {
136
163
  * Get a shortened version of the description as preview.
137
164
  */
138
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;
139
171
  static ɵfac: i0.ɵɵFactoryDeclaration<IDEAAgendaComponent, never>;
140
- static ɵcmp: i0.ɵɵComponentDeclaration<IDEAAgendaComponent, "idea-agenda", never, { "events": "events"; "excludeDays": "excludeDays"; "dayStartHour": "dayStartHour"; "dayEndHour": "dayEndHour"; "hourSegments": "hourSegments"; "activeDayIsOpen": "activeDayIsOpen"; "view": "view"; "onlyFuture": "onlyFuture"; }, { "selectEvent": "selectEvent"; "selectDay": "selectDay"; "selectSlot": "selectSlot"; "changeEvent": "changeEvent"; "changeDate": "changeDate"; }, never, never, false, never>;
172
+ static ɵcmp: i0.ɵɵComponentDeclaration<IDEAAgendaComponent, "idea-agenda", never, { "events": "events"; "excludeDays": "excludeDays"; "dayStartHour": "dayStartHour"; "dayEndHour": "dayEndHour"; "hourSegments": "hourSegments"; "activeDayIsOpen": "activeDayIsOpen"; "view": "view"; "allowedViews": "allowedViews"; "onlyFuture": "onlyFuture"; "titleNotes": "titleNotes"; "newEventTemplate": "newEventTemplate"; "allowDragToCreate": "allowDragToCreate"; "parentContent": "parentContent"; }, { "selectEvent": "selectEvent"; "selectDay": "selectDay"; "selectSlot": "selectSlot"; "newEventByDrag": "newEventByDrag"; "changeEvent": "changeEvent"; "changeDate": "changeDate"; "beforeWeekOrDayViewRenderEmitter": "beforeWeekOrDayViewRenderEmitter"; "beforeMonthViewRenderEmitter": "beforeMonthViewRenderEmitter"; }, never, never, false, never>;
141
173
  }
142
174
  /**
143
175
  * A richer version of the classic CalendarEvent.
@@ -166,6 +198,13 @@ export interface AgendaEvent extends CalendarEvent {
166
198
  name: string;
167
199
  title: string;
168
200
  }[];
201
+ /**
202
+ * The colors of the event displayed.
203
+ */
204
+ color?: {
205
+ primary: string;
206
+ secondary?: string;
207
+ } | any;
169
208
  /**
170
209
  * Whether the event is external; external events are less important UI-wise.
171
210
  */
@@ -188,3 +227,11 @@ export declare enum EventAttendance {
188
227
  TENTATIVE = 1,
189
228
  ACCEPTED = 2
190
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
+ }
@@ -1,13 +1,13 @@
1
1
  import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
2
2
  import * as i0 from "@angular/core";
3
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;
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
11
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomDateFormatter, never>;
12
12
  static ɵprov: i0.ɵɵInjectableDeclaration<CustomDateFormatter>;
13
13
  }