@sprucelabs/spruce-calendar-components 28.3.48 → 28.3.49
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/build/.spruce/schemas/schemas.types.d.ts +770 -770
- package/build/esm/.spruce/schemas/schemas.types.d.ts +770 -770
- package/build/esm/__tests__/support/SpyRemoteEventStore.js +1 -1
- package/build/esm/__tests__/support/utilities/calendarSkillAssert.js +1 -1
- package/build/esm/calendar/Calendar.vc.js +4 -4
- package/build/esm/calendar/CalendarEventManager.js +12 -12
- package/build/esm/calendar/CalendarPeopleManager.js +1 -1
- package/build/esm/calendar/CalendarPersister.js +2 -2
- package/build/esm/root/Root.svc.js +17 -17
- package/build/esm/stores/RemoteEventStore.js +1 -1
- package/build/esm/toolBelt/CalendarToolRegistrar.js +2 -2
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.js +10 -10
- package/build/esm/toolBelt/states/PrerequisitesToolBeltState.js +4 -4
- package/build/esm/toolBelt/states/RootToolBeltState.js +1 -1
- package/build/esm/tools/EventDateTimeTool.vc.js +6 -6
- package/package.json +1 -1
|
@@ -28,8 +28,8 @@ export default class SpyRemoteEventStore extends RemoteEventStoreImpl {
|
|
|
28
28
|
const _super = Object.create(null, {
|
|
29
29
|
getCalendars: { get: () => super.getCalendars }
|
|
30
30
|
});
|
|
31
|
-
var _a;
|
|
32
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var _a;
|
|
33
33
|
return (_a = this.calendars) !== null && _a !== void 0 ? _a : _super.getCalendars.call(this);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -53,8 +53,8 @@ const calendarSkillAssert = {
|
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
55
|
createsCalendarOnInstall(calendarSlug, client, typeSlugs) {
|
|
56
|
-
var _a, _b, _c, _d;
|
|
57
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
58
|
assertRanBeforeEach(this);
|
|
59
59
|
assertOptions({
|
|
60
60
|
calendarSlug,
|
|
@@ -72,8 +72,8 @@ class CalendarViewController extends CoreCalendarViewController {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
handleDropEvent(options) {
|
|
75
|
-
var _a;
|
|
76
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a;
|
|
77
77
|
const { event, blockUpdates, newPersonId, newStartDateTimeMs } = options;
|
|
78
78
|
const updates = {};
|
|
79
79
|
if (newStartDateTimeMs) {
|
|
@@ -135,8 +135,8 @@ class CalendarViewController extends CoreCalendarViewController {
|
|
|
135
135
|
return draft;
|
|
136
136
|
}
|
|
137
137
|
removeDraftEvent(id) {
|
|
138
|
-
var _a, _b, _c;
|
|
139
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
var _a, _b, _c;
|
|
140
140
|
yield this.removeEvent(id);
|
|
141
141
|
yield ((_a = this.draftRemovedHandler) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
142
142
|
try {
|
|
@@ -223,14 +223,14 @@ class CalendarViewController extends CoreCalendarViewController {
|
|
|
223
223
|
return Object.assign({}, updates);
|
|
224
224
|
}
|
|
225
225
|
persist(event) {
|
|
226
|
-
var _a;
|
|
227
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
+
var _a;
|
|
228
228
|
return (_a = this.persister) === null || _a === void 0 ? void 0 : _a.persist(event);
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
waitForPendingSaves() {
|
|
232
|
-
var _a;
|
|
233
232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
var _a;
|
|
234
234
|
yield ((_a = this.persister) === null || _a === void 0 ? void 0 : _a.waitForPendingSaves());
|
|
235
235
|
});
|
|
236
236
|
}
|
|
@@ -66,8 +66,8 @@ class CalendarEventManager {
|
|
|
66
66
|
return (_a = this.prefs.getVisibleCalendarIds()) !== null && _a !== void 0 ? _a : this.calendars.map((c) => c.id);
|
|
67
67
|
}
|
|
68
68
|
handleStreamEvents(options) {
|
|
69
|
-
var _a;
|
|
70
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
var _a;
|
|
71
71
|
const { events, chunkingId } = options;
|
|
72
72
|
const { id, startDate, endDate } = (_a = this.activeChunk) !== null && _a !== void 0 ? _a : {};
|
|
73
73
|
if (id !== chunkingId || !startDate || !endDate) {
|
|
@@ -129,8 +129,8 @@ class CalendarEventManager {
|
|
|
129
129
|
getCalendars() {
|
|
130
130
|
return this.calendars;
|
|
131
131
|
}
|
|
132
|
-
addDraftEvent(
|
|
133
|
-
return __awaiter(this,
|
|
132
|
+
addDraftEvent(event_1) {
|
|
133
|
+
return __awaiter(this, arguments, void 0, function* (event, shouldSelectEvent = true) {
|
|
134
134
|
this.allEvents.push(event);
|
|
135
135
|
if (!this.calendarVc.hasEvent(event.id)) {
|
|
136
136
|
this.calendarVc.addEvent(event);
|
|
@@ -151,8 +151,8 @@ class CalendarEventManager {
|
|
|
151
151
|
this.calendarVc.mixinEvents(events);
|
|
152
152
|
}
|
|
153
153
|
silentlySwapEvent(oldId, event) {
|
|
154
|
-
var _a;
|
|
155
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
var _a;
|
|
156
156
|
const events = this.getEvents().filter((e) => e.id !== oldId);
|
|
157
157
|
this.allEvents = [...events, event];
|
|
158
158
|
if (((_a = this.sm.getContext().event) === null || _a === void 0 ? void 0 : _a.id) === oldId) {
|
|
@@ -180,8 +180,8 @@ class CalendarEventManager {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
reset() {
|
|
183
|
-
var _a;
|
|
184
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
var _a;
|
|
185
185
|
yield this.setEventInContext(undefined);
|
|
186
186
|
(_a = this.events) === null || _a === void 0 ? void 0 : _a.clearCalendarId();
|
|
187
187
|
});
|
|
@@ -200,8 +200,8 @@ class CalendarEventManager {
|
|
|
200
200
|
return this.visibleCalendarIds;
|
|
201
201
|
}
|
|
202
202
|
cancelEvent(id, options) {
|
|
203
|
-
var _a;
|
|
204
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
var _a;
|
|
205
205
|
const { shouldPersist = true } = options !== null && options !== void 0 ? options : {};
|
|
206
206
|
const event = this.calendarVc.getEvent(id);
|
|
207
207
|
if (shouldPersist) {
|
|
@@ -264,8 +264,8 @@ class CalendarEventManager {
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
runUpdateQueue() {
|
|
267
|
-
var _a;
|
|
268
267
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
var _a;
|
|
269
269
|
this.isRunningUpdateQueue = true;
|
|
270
270
|
let next;
|
|
271
271
|
const savedEvents = [];
|
|
@@ -283,8 +283,8 @@ class CalendarEventManager {
|
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
_updateEvent(id, updates) {
|
|
286
|
-
var _a;
|
|
287
286
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
var _a;
|
|
288
288
|
let { shouldPersist = true, dateToUpdate, shouldUpdateAllEventsGoingForward } = updates, rest = __rest(updates, ["shouldPersist", "dateToUpdate", "shouldUpdateAllEventsGoingForward"]);
|
|
289
289
|
const { isTheSame, isTheSameWithoutBusy, match: originalEvent, } = this.calculateDifferences(id, updates);
|
|
290
290
|
if (isTheSame) {
|
|
@@ -423,8 +423,8 @@ class CalendarEventManager {
|
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
setEventInContext(newEvent, options) {
|
|
426
|
-
var _a;
|
|
427
426
|
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
+
var _a;
|
|
428
428
|
this.shouldIgnoreNextContextUpdate =
|
|
429
429
|
(options === null || options === void 0 ? void 0 : options.shouldHandleDidUpdateContext) !== false;
|
|
430
430
|
const didTrigger = yield ((_a = this.updateContext) !== null && _a !== void 0 ? _a : this.sm.updateContext.bind(this.sm))({
|
|
@@ -553,9 +553,9 @@ class CalendarEventManager {
|
|
|
553
553
|
var _a;
|
|
554
554
|
return (_a = this.activeChunk) === null || _a === void 0 ? void 0 : _a.id;
|
|
555
555
|
}
|
|
556
|
-
optionallyAskForUpdateRepeatingStrategy(
|
|
557
|
-
|
|
558
|
-
|
|
556
|
+
optionallyAskForUpdateRepeatingStrategy(event_1) {
|
|
557
|
+
return __awaiter(this, arguments, void 0, function* (event, action = 'update') {
|
|
558
|
+
var _a;
|
|
559
559
|
if (!event.id) {
|
|
560
560
|
return { pass: true };
|
|
561
561
|
}
|
|
@@ -140,8 +140,8 @@ export default class CalendarPeopleManager extends AbstractEventEmitter {
|
|
|
140
140
|
.filter((p) => !!p);
|
|
141
141
|
}
|
|
142
142
|
setVisiblePeopleIds(visible, options) {
|
|
143
|
-
var _a;
|
|
144
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
var _a;
|
|
145
145
|
const { shouldForceEmitDidChange } = options !== null && options !== void 0 ? options : {};
|
|
146
146
|
const newVisibile = visible.filter((id, idx) => visible.indexOf(id) === idx);
|
|
147
147
|
const oldVisible = (_a = this.getSavedVisiblePeopleIds()) !== null && _a !== void 0 ? _a : [];
|
|
@@ -37,8 +37,8 @@ export default class CalendarPersister {
|
|
|
37
37
|
return this.events;
|
|
38
38
|
}
|
|
39
39
|
_persist(event) {
|
|
40
|
-
var _a, _b;
|
|
41
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b;
|
|
42
42
|
let updated = event;
|
|
43
43
|
const id = updated.id;
|
|
44
44
|
try {
|
|
@@ -91,8 +91,8 @@ export default class CalendarPersister {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
cancelEvent(id, options) {
|
|
94
|
-
var _a;
|
|
95
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
var _a;
|
|
96
96
|
yield ((_a = this.events) === null || _a === void 0 ? void 0 : _a.cancelEvent(id, options));
|
|
97
97
|
});
|
|
98
98
|
}
|
|
@@ -82,8 +82,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
82
82
|
return sm;
|
|
83
83
|
}
|
|
84
84
|
handleCancelEvent(eventId) {
|
|
85
|
-
var _a;
|
|
86
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a;
|
|
87
87
|
const event = this.events.getEvent(eventId);
|
|
88
88
|
const confirm = ((_a = event.totalInRepeating) !== null && _a !== void 0 ? _a : 0) > 0 ||
|
|
89
89
|
(yield this.confirm({
|
|
@@ -96,8 +96,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
askForUpdateStrategy(
|
|
100
|
-
return __awaiter(this,
|
|
99
|
+
askForUpdateStrategy(cleaned_1) {
|
|
100
|
+
return __awaiter(this, arguments, void 0, function* (cleaned, action = 'update') {
|
|
101
101
|
let strategy;
|
|
102
102
|
const dlg = this.renderInDialog(Object.assign({ shouldShowCloseButton: false }, this.Controller('calendar.select-update-repeating-strategy-card', {
|
|
103
103
|
event: cleaned,
|
|
@@ -112,8 +112,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
handleSelectEventType(type) {
|
|
115
|
-
var _a, _b;
|
|
116
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
var _a, _b;
|
|
117
117
|
this.selectingTypePromise = new Promise((resolve) => {
|
|
118
118
|
this.selectingTypeResolve = resolve;
|
|
119
119
|
});
|
|
@@ -150,8 +150,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
transitionToolBeltForEvent(eventId) {
|
|
153
|
-
var _a;
|
|
154
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
var _a;
|
|
155
155
|
const vc = this.calendarVc.getEventVc(eventId);
|
|
156
156
|
const state = (_a = vc.getToolBeltState) === null || _a === void 0 ? void 0 : _a.call(vc);
|
|
157
157
|
if (state) {
|
|
@@ -165,8 +165,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
waitUntilDoneSaving() {
|
|
168
|
-
var _a;
|
|
169
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
var _a;
|
|
170
170
|
yield Promise.all([
|
|
171
171
|
(_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.waitForPendingSaves(),
|
|
172
172
|
this.selectingTypePromise,
|
|
@@ -179,8 +179,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
handleSelectCalendar(calendar) {
|
|
182
|
-
var _a;
|
|
183
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
var _a;
|
|
184
184
|
(_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.setCalendarId(calendar.id);
|
|
185
185
|
yield this.events.makeCalendarVisible(calendar.id);
|
|
186
186
|
});
|
|
@@ -270,8 +270,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
270
270
|
shouldRenderAllToolsAtOnce: true,
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
handleCloseToolBelt(
|
|
274
|
-
return __awaiter(this,
|
|
273
|
+
handleCloseToolBelt(_a) {
|
|
274
|
+
return __awaiter(this, arguments, void 0, function* ({ isDrawer }) {
|
|
275
275
|
if (!isDrawer) {
|
|
276
276
|
yield this.resetToRootState();
|
|
277
277
|
if (this.draftEvent) {
|
|
@@ -283,8 +283,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
handleClickEvent(options) {
|
|
286
|
-
var _a, _b;
|
|
287
286
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
var _a, _b;
|
|
288
288
|
const { event } = options;
|
|
289
289
|
const selected = this.events.getSelectedEvent();
|
|
290
290
|
if (selected) {
|
|
@@ -369,8 +369,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
369
369
|
return this.calendarVc;
|
|
370
370
|
}
|
|
371
371
|
load(options) {
|
|
372
|
-
var _a;
|
|
373
372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
|
+
var _a;
|
|
374
374
|
yield this.sm.updateContext(Object.assign(Object.assign({}, options), { people: this.people, events: this.events }));
|
|
375
375
|
this.client = yield this.connectToApi();
|
|
376
376
|
const { scope, locale, args, router } = options;
|
|
@@ -431,8 +431,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
destroy() {
|
|
434
|
-
var _a, _b, _c, _d;
|
|
435
434
|
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
+
var _a, _b, _c, _d;
|
|
436
436
|
clearInterval(this.loadEventInterval);
|
|
437
437
|
yield ((_a = this.client) === null || _a === void 0 ? void 0 : _a.off('connection-status-change', this.handleStateChange));
|
|
438
438
|
yield ((_b = this.client) === null || _b === void 0 ? void 0 : _b.off('calendar.did-create-calendar-event::v2021_05_19', this.handleDidCreateOrUpdateRemoteEvent));
|
|
@@ -449,16 +449,16 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
449
449
|
]);
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
-
handleDidCancelEvent(
|
|
453
|
-
return __awaiter(this,
|
|
452
|
+
handleDidCancelEvent(_a) {
|
|
453
|
+
return __awaiter(this, arguments, void 0, function* ({ target }) {
|
|
454
454
|
const { calendarEventId } = target;
|
|
455
455
|
if (this.events.hasEvent(calendarEventId)) {
|
|
456
456
|
yield this.events.cancelEvent(calendarEventId, { shouldPersist: false });
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
|
-
handleDidCreateOrUpdateRemoteEvent(
|
|
461
|
-
return __awaiter(this,
|
|
460
|
+
handleDidCreateOrUpdateRemoteEvent(_a) {
|
|
461
|
+
return __awaiter(this, arguments, void 0, function* ({ payload, target, }) {
|
|
462
462
|
const { calendarEvent } = payload;
|
|
463
463
|
const { locationId } = target;
|
|
464
464
|
if (calendarEvent.style !== 'draft' && locationId === this.locationId) {
|
|
@@ -517,8 +517,8 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
519
|
_loadEvents(options) {
|
|
520
|
-
var _a;
|
|
521
520
|
return __awaiter(this, void 0, void 0, function* () {
|
|
521
|
+
var _a;
|
|
522
522
|
try {
|
|
523
523
|
if (this.events.getCalendars().length > 0) {
|
|
524
524
|
const date = this.getStartDate();
|
|
@@ -17,8 +17,8 @@ class CalendarToolRegistrar {
|
|
|
17
17
|
CalendarToolRegistrar.fetchedRecord = {};
|
|
18
18
|
}
|
|
19
19
|
fetchAndAddCards(getControllerOptions) {
|
|
20
|
-
var _a;
|
|
21
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
22
22
|
const { event } = this.sm.getContext();
|
|
23
23
|
let cards = [];
|
|
24
24
|
const cacheKey = (_a = event.eventTypeSlug) !== null && _a !== void 0 ? _a : 'none';
|
|
@@ -75,8 +75,8 @@ class CalendarToolRegistrar {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
addTool(card) {
|
|
78
|
-
var _a;
|
|
79
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a;
|
|
80
80
|
const toolBeltVc = this.sm.getToolBeltVc();
|
|
81
81
|
if (this.addToolHandler) {
|
|
82
82
|
yield this.addToolHandler(card);
|
|
@@ -21,8 +21,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
21
21
|
this._handleWillUpdateContext = this._handleWillUpdateContext.bind(this);
|
|
22
22
|
}
|
|
23
23
|
load(sm) {
|
|
24
|
-
var _a;
|
|
25
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
26
|
this.sm = sm;
|
|
27
27
|
this.toolBeltVc = sm.getToolBeltVc();
|
|
28
28
|
this.isLoaded = true;
|
|
@@ -80,8 +80,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
80
80
|
yield this.context.events.deselectEvent();
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
_handleWillUpdateContext(
|
|
84
|
-
return __awaiter(this,
|
|
83
|
+
_handleWillUpdateContext(_a) {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* ({ updates, }) {
|
|
85
85
|
const { event } = updates;
|
|
86
86
|
if (event && this.lastEventId !== event.id) {
|
|
87
87
|
this.pendingContextUpdates = {};
|
|
@@ -95,7 +95,7 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
95
95
|
if (!context.event) {
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
yield Promise.all(this.vcs.map((
|
|
98
|
+
yield Promise.all(this.vcs.map((_a) => __awaiter(this, [_a], void 0, function* ({ vc, toolId }) {
|
|
99
99
|
if (toolId !== skipToolWithId) {
|
|
100
100
|
yield vc.handleUpdateContext(context);
|
|
101
101
|
}
|
|
@@ -107,8 +107,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
107
107
|
getContextWithPendingChanges() {
|
|
108
108
|
return Object.assign({}, this.sm.getContext(this.pendingContextUpdates));
|
|
109
109
|
}
|
|
110
|
-
clearPendingContextChanges(
|
|
111
|
-
return __awaiter(this,
|
|
110
|
+
clearPendingContextChanges() {
|
|
111
|
+
return __awaiter(this, arguments, void 0, function* (shouldEmitDidUpdate = true) {
|
|
112
112
|
this.pendingContextUpdates = {};
|
|
113
113
|
if (shouldEmitDidUpdate) {
|
|
114
114
|
yield this._handleDidUpdateContext();
|
|
@@ -116,8 +116,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
addTool(options) {
|
|
119
|
-
var _a;
|
|
120
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
var _a;
|
|
121
121
|
assertOptions(options, ['id', 'lineIcon', 'cardVcId']);
|
|
122
122
|
if (!this.sm) {
|
|
123
123
|
throw new Error("You can't add a tool until after load. Make sure you're calling 'await super.load()' inside your 'load()'.");
|
|
@@ -165,8 +165,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
loadVc(vc) {
|
|
168
|
-
var _a, _b;
|
|
169
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
var _a, _b;
|
|
170
170
|
try {
|
|
171
171
|
yield ((_a = vc.load) === null || _a === void 0 ? void 0 : _a.call(vc));
|
|
172
172
|
}
|
|
@@ -181,8 +181,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
getPersonFromEvent() {
|
|
184
|
-
var _a;
|
|
185
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
var _a;
|
|
186
186
|
if (this.getPersonPromise) {
|
|
187
187
|
return this.getPersonPromise;
|
|
188
188
|
}
|
|
@@ -191,8 +191,8 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
_getPersonFromEvent() {
|
|
194
|
-
var _a;
|
|
195
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
var _a;
|
|
196
196
|
try {
|
|
197
197
|
const id = this.event.target.personId;
|
|
198
198
|
const client = yield this.sm.connectToApi();
|
|
@@ -63,8 +63,8 @@ export class PrerequisitesToolBeltState {
|
|
|
63
63
|
this.calendarSelectCardVc.setIsBusy(false);
|
|
64
64
|
}
|
|
65
65
|
handleSelectCalendar(calendar) {
|
|
66
|
-
var _a, _b, _c, _d;
|
|
67
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
68
|
(_a = this.calendarSelectCardVc) === null || _a === void 0 ? void 0 : _a.setIsBusy(true);
|
|
69
69
|
this.calendar = calendar;
|
|
70
70
|
yield ((_b = this.selectCalendarHandler) === null || _b === void 0 ? void 0 : _b.call(this, calendar));
|
|
@@ -85,8 +85,8 @@ export class PrerequisitesToolBeltState {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
setupTypeSelectCard(types) {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f;
|
|
89
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a, _b, _c, _d, _e, _f;
|
|
90
90
|
if (!this.toolBeltVc.getTool('types')) {
|
|
91
91
|
this.typeSelectCardVc = this.TypeSelectCardVc();
|
|
92
92
|
this.toolBeltVc.addTool({
|
|
@@ -120,8 +120,8 @@ export class PrerequisitesToolBeltState {
|
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
handleSelectType(type) {
|
|
123
|
-
var _a, _b, _c;
|
|
124
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
var _a, _b, _c;
|
|
125
125
|
(_a = this.typeSelectCardVc) === null || _a === void 0 ? void 0 : _a.setIsBusy(true);
|
|
126
126
|
const { event } = this.sm.getContext();
|
|
127
127
|
const updated = makeEventTyped(event, type);
|
|
@@ -134,8 +134,8 @@ export class PrerequisitesToolBeltState {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
updateEvent(updates) {
|
|
137
|
-
var _a;
|
|
138
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
var _a;
|
|
139
139
|
const { event, events } = this.sm.getContext();
|
|
140
140
|
if (event) {
|
|
141
141
|
events.updateEvent(event.id, Object.assign({ calendarId: (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id }, updates));
|
|
@@ -88,8 +88,8 @@ export class RootToolBeltState {
|
|
|
88
88
|
return (_c = this.calendarSelectCardVc) === null || _c === void 0 ? void 0 : _c.load(stateMachine.getContext());
|
|
89
89
|
}
|
|
90
90
|
optionallyAddPeopleCard(scope) {
|
|
91
|
-
var _a, _b;
|
|
92
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
var _a, _b;
|
|
93
93
|
const location = yield scope.getCurrentLocation();
|
|
94
94
|
if (location && !((_a = this.toolBeltVc) === null || _a === void 0 ? void 0 : _a.getTool('people'))) {
|
|
95
95
|
this.personSelectVc = this.PersonSelectVc();
|
|
@@ -23,8 +23,8 @@ class EventDateTimeToolViewController extends AbstractViewController {
|
|
|
23
23
|
this.formVc = this.FormVc();
|
|
24
24
|
this.cardVc = this.CardVc();
|
|
25
25
|
}
|
|
26
|
-
handleSelectDateFromCalendar(
|
|
27
|
-
return __awaiter(this,
|
|
26
|
+
handleSelectDateFromCalendar(_a) {
|
|
27
|
+
return __awaiter(this, arguments, void 0, function* ({ dateTimeMs, }) {
|
|
28
28
|
const { hour, minute, day, month } = this.dates.splitDate(this.event.startDateTimeMs);
|
|
29
29
|
const { day: newDay, month: newMonth } = this.dates.splitDate(dateTimeMs);
|
|
30
30
|
if (day === newDay && month === newMonth) {
|
|
@@ -135,11 +135,11 @@ class EventDateTimeToolViewController extends AbstractViewController {
|
|
|
135
135
|
this.calendarVc.setSelectedDates([this.getSelectedDate()]);
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
handleChangeForm(
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
handleChangeForm(_a) {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* ({ values }) {
|
|
140
|
+
var _b;
|
|
141
141
|
if (values.startDateTime) {
|
|
142
|
-
yield ((
|
|
142
|
+
yield ((_b = this.updateContext) === null || _b === void 0 ? void 0 : _b.call(this, {
|
|
143
143
|
//@ts-ignore
|
|
144
144
|
'event.startDateTimeMs': values.startDateTime,
|
|
145
145
|
}));
|