@sprucelabs/spruce-calendar-components 28.0.9 → 28.1.0
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 +207 -207
- package/build/esm/.spruce/schemas/schemas.types.d.ts +207 -207
- package/build/esm/skillViewControllers/Root.svc.d.ts +2 -1
- package/build/esm/skillViewControllers/Root.svc.js +17 -2
- package/build/skillViewControllers/Root.svc.d.ts +2 -1
- package/build/skillViewControllers/Root.svc.js +17 -2
- package/package.json +1 -1
|
@@ -198,14 +198,29 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
198
198
|
onRemoveDraftEvent: this.handleDraftEventRemoved.bind(this),
|
|
199
199
|
onEventSwapped: this.handleEventSwapped.bind(this),
|
|
200
200
|
onDropEvent: this.handleDropEvent.bind(this),
|
|
201
|
-
onChangeStartDate: this.
|
|
201
|
+
onChangeStartDate: this.handleChangeStartDate.bind(this),
|
|
202
202
|
onDeselectEvent: this.handleDeselectEvent.bind(this),
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
handleChangeStartDate() {
|
|
206
206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
const startDate = this.calendarVc.getStartDate();
|
|
208
|
+
const isForceRefresh = this.lastStartDate && this.lastStartDate === startDate;
|
|
209
|
+
if (isForceRefresh) {
|
|
210
|
+
yield this.alert({
|
|
211
|
+
message: `Forcing refresh now!`,
|
|
212
|
+
style: 'success',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
this.lastStartDate = startDate;
|
|
207
216
|
this.makeDateSelectMatchSelectedDateFromCalendar();
|
|
208
217
|
yield this.loadEvents();
|
|
218
|
+
if (isForceRefresh) {
|
|
219
|
+
yield this.alert({
|
|
220
|
+
message: `Refreshed!`,
|
|
221
|
+
style: 'success',
|
|
222
|
+
});
|
|
223
|
+
}
|
|
209
224
|
});
|
|
210
225
|
}
|
|
211
226
|
makeDateSelectMatchSelectedDateFromCalendar() {
|
|
@@ -30,6 +30,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
|
|
|
30
30
|
protected draftEvent?: CalendarEvent;
|
|
31
31
|
private loadEventInterval?;
|
|
32
32
|
private shouldIgnoreNextDeselectEvent;
|
|
33
|
+
private lastStartDate?;
|
|
33
34
|
constructor(options: ViewControllerOptions);
|
|
34
35
|
getScope: () => ScopeFlag[];
|
|
35
36
|
private createToolBeltStates;
|
|
@@ -46,7 +47,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
|
|
|
46
47
|
getToolBeltStateMachine(): CalendarToolBeltStateMachine<import("../types/calendar.types").CalendarToolBeltContext>;
|
|
47
48
|
getToolBeltStateId(): string | undefined;
|
|
48
49
|
private CalendarVc;
|
|
49
|
-
private
|
|
50
|
+
private handleChangeStartDate;
|
|
50
51
|
private makeDateSelectMatchSelectedDateFromCalendar;
|
|
51
52
|
private setSelectedDateInDateSelectVc;
|
|
52
53
|
private getStartDate;
|
|
@@ -176,13 +176,28 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
|
|
|
176
176
|
onRemoveDraftEvent: this.handleDraftEventRemoved.bind(this),
|
|
177
177
|
onEventSwapped: this.handleEventSwapped.bind(this),
|
|
178
178
|
onDropEvent: this.handleDropEvent.bind(this),
|
|
179
|
-
onChangeStartDate: this.
|
|
179
|
+
onChangeStartDate: this.handleChangeStartDate.bind(this),
|
|
180
180
|
onDeselectEvent: this.handleDeselectEvent.bind(this),
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
async
|
|
183
|
+
async handleChangeStartDate() {
|
|
184
|
+
const startDate = this.calendarVc.getStartDate();
|
|
185
|
+
const isForceRefresh = this.lastStartDate && this.lastStartDate === startDate;
|
|
186
|
+
if (isForceRefresh) {
|
|
187
|
+
await this.alert({
|
|
188
|
+
message: `Forcing refresh now!`,
|
|
189
|
+
style: 'success',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
this.lastStartDate = startDate;
|
|
184
193
|
this.makeDateSelectMatchSelectedDateFromCalendar();
|
|
185
194
|
await this.loadEvents();
|
|
195
|
+
if (isForceRefresh) {
|
|
196
|
+
await this.alert({
|
|
197
|
+
message: `Refreshed!`,
|
|
198
|
+
style: 'success',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
186
201
|
}
|
|
187
202
|
makeDateSelectMatchSelectedDateFromCalendar() {
|
|
188
203
|
const date = this.getStartDate();
|