@sprucelabs/spruce-calendar-components 22.0.0 → 22.1.2
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.
|
@@ -59,6 +59,7 @@ export declare class CalendarEventManager {
|
|
|
59
59
|
private handleDidUpdateContext;
|
|
60
60
|
private saveEvent;
|
|
61
61
|
getIsLoaded(): boolean;
|
|
62
|
+
hasEvent(id: string): boolean;
|
|
62
63
|
optionallyAskForUpdateRepeatingStrategy(event: UpdateEvent): Promise<boolean>;
|
|
63
64
|
}
|
|
64
65
|
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent'>;
|
|
@@ -197,10 +197,11 @@ export class CalendarEventManager {
|
|
|
197
197
|
}
|
|
198
198
|
setupVcForEventType(vcId, typeSlug) {
|
|
199
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
|
|
200
|
+
const key = vcId + typeSlug;
|
|
201
|
+
if (this.hasVcForEventTypeBeenLoaded[key]) {
|
|
201
202
|
return;
|
|
202
203
|
}
|
|
203
|
-
this.hasVcForEventTypeBeenLoaded[
|
|
204
|
+
this.hasVcForEventTypeBeenLoaded[key] = true;
|
|
204
205
|
yield this.remoteVc.fetchRemoteController(vcId);
|
|
205
206
|
this.calendarVc.setControllerForEventType(typeSlug, vcId);
|
|
206
207
|
});
|
|
@@ -308,6 +309,9 @@ export class CalendarEventManager {
|
|
|
308
309
|
getIsLoaded() {
|
|
309
310
|
return this.isLoaded;
|
|
310
311
|
}
|
|
312
|
+
hasEvent(id) {
|
|
313
|
+
return !!this.allEvents.find((e) => e.id === id);
|
|
314
|
+
}
|
|
311
315
|
optionallyAskForUpdateRepeatingStrategy(event) {
|
|
312
316
|
var _a;
|
|
313
317
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -59,6 +59,7 @@ export declare class CalendarEventManager {
|
|
|
59
59
|
private handleDidUpdateContext;
|
|
60
60
|
private saveEvent;
|
|
61
61
|
getIsLoaded(): boolean;
|
|
62
|
+
hasEvent(id: string): boolean;
|
|
62
63
|
optionallyAskForUpdateRepeatingStrategy(event: UpdateEvent): Promise<boolean>;
|
|
63
64
|
}
|
|
64
65
|
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent'>;
|
|
@@ -173,10 +173,11 @@ class CalendarEventManager {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
async setupVcForEventType(vcId, typeSlug) {
|
|
176
|
-
|
|
176
|
+
const key = vcId + typeSlug;
|
|
177
|
+
if (this.hasVcForEventTypeBeenLoaded[key]) {
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
179
|
-
this.hasVcForEventTypeBeenLoaded[
|
|
180
|
+
this.hasVcForEventTypeBeenLoaded[key] = true;
|
|
180
181
|
await this.remoteVc.fetchRemoteController(vcId);
|
|
181
182
|
this.calendarVc.setControllerForEventType(typeSlug, vcId);
|
|
182
183
|
}
|
|
@@ -267,6 +268,9 @@ class CalendarEventManager {
|
|
|
267
268
|
getIsLoaded() {
|
|
268
269
|
return this.isLoaded;
|
|
269
270
|
}
|
|
271
|
+
hasEvent(id) {
|
|
272
|
+
return !!this.allEvents.find((e) => e.id === id);
|
|
273
|
+
}
|
|
270
274
|
async optionallyAskForUpdateRepeatingStrategy(event) {
|
|
271
275
|
var _a;
|
|
272
276
|
const cleaned = (0, schema_1.normalizeSchemaValues)(heartwood_view_controllers_1.calendarEventSchema, event, {});
|