@sprucelabs/spruce-calendar-components 22.10.38 → 22.10.40
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.
|
@@ -14,12 +14,13 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
14
14
|
private activelyPersisting;
|
|
15
15
|
private persistPromise?;
|
|
16
16
|
constructor(options: ViewControllerOptions & CalendarViewControllerOptions);
|
|
17
|
+
private handleTapView;
|
|
17
18
|
protected handleLongPressViewDrop(options: ClickCalendarViewOptions): Promise<void>;
|
|
18
19
|
private handleDropEvent;
|
|
19
20
|
getCalendarVc(): this;
|
|
20
21
|
setRemoteStore(remoteEventStore: RemoteEventStore): void;
|
|
21
22
|
getRemoteStore(): RemoteEventStore | undefined;
|
|
22
|
-
private
|
|
23
|
+
private handleClickView;
|
|
23
24
|
private isDraftEvent;
|
|
24
25
|
protected getDraftEvent(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent | undefined;
|
|
25
26
|
private removeDraftEvent;
|
|
@@ -29,6 +29,8 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
29
29
|
return this.handleDropEvent(options);
|
|
30
30
|
}, onLongPressViewDrop: (options) => {
|
|
31
31
|
return this.handleLongPressViewDrop(options);
|
|
32
|
+
}, onTapView: () => {
|
|
33
|
+
return this.handleTapView();
|
|
32
34
|
} }));
|
|
33
35
|
this.activelyPersisting = {};
|
|
34
36
|
this.isSwapping = false;
|
|
@@ -40,9 +42,20 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
40
42
|
this.eventSwappedHandler = onEventSwapped;
|
|
41
43
|
this.dropEventHandler = onDropEvent;
|
|
42
44
|
this.remoteEventStore = remoteEventStore;
|
|
43
|
-
this.model.onClickView = this.
|
|
45
|
+
this.model.onClickView = this.handleClickView.bind(this);
|
|
44
46
|
this.setDefaultControllerForEvents('calendar.universal-calendar-event');
|
|
45
47
|
}
|
|
48
|
+
handleTapView() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
yield this.renderOnce(() => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
yield this.deselectEvent();
|
|
52
|
+
const draft = this.getDraftEvent();
|
|
53
|
+
if (draft) {
|
|
54
|
+
yield this.removeDraftEvent(draft.id);
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
46
59
|
handleLongPressViewDrop(options) {
|
|
47
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
61
|
const draft = this.getDraftEvent();
|
|
@@ -83,7 +96,7 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
83
96
|
getRemoteStore() {
|
|
84
97
|
return this.remoteEventStore;
|
|
85
98
|
}
|
|
86
|
-
|
|
99
|
+
handleClickView(options) {
|
|
87
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
101
|
assertOptions({ remoteEventStore: this.remoteEventStore }, [
|
|
89
102
|
'remoteEventStore',
|
|
@@ -14,12 +14,13 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
14
14
|
private activelyPersisting;
|
|
15
15
|
private persistPromise?;
|
|
16
16
|
constructor(options: ViewControllerOptions & CalendarViewControllerOptions);
|
|
17
|
+
private handleTapView;
|
|
17
18
|
protected handleLongPressViewDrop(options: ClickCalendarViewOptions): Promise<void>;
|
|
18
19
|
private handleDropEvent;
|
|
19
20
|
getCalendarVc(): this;
|
|
20
21
|
setRemoteStore(remoteEventStore: RemoteEventStore): void;
|
|
21
22
|
getRemoteStore(): RemoteEventStore | undefined;
|
|
22
|
-
private
|
|
23
|
+
private handleClickView;
|
|
23
24
|
private isDraftEvent;
|
|
24
25
|
protected getDraftEvent(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent | undefined;
|
|
25
26
|
private removeDraftEvent;
|
|
@@ -25,6 +25,8 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
25
25
|
return this.handleDropEvent(options);
|
|
26
26
|
}, onLongPressViewDrop: (options) => {
|
|
27
27
|
return this.handleLongPressViewDrop(options);
|
|
28
|
+
}, onTapView: () => {
|
|
29
|
+
return this.handleTapView();
|
|
28
30
|
} }));
|
|
29
31
|
this.activelyPersisting = {};
|
|
30
32
|
this.isSwapping = false;
|
|
@@ -36,9 +38,18 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
36
38
|
this.eventSwappedHandler = onEventSwapped;
|
|
37
39
|
this.dropEventHandler = onDropEvent;
|
|
38
40
|
this.remoteEventStore = remoteEventStore;
|
|
39
|
-
this.model.onClickView = this.
|
|
41
|
+
this.model.onClickView = this.handleClickView.bind(this);
|
|
40
42
|
this.setDefaultControllerForEvents('calendar.universal-calendar-event');
|
|
41
43
|
}
|
|
44
|
+
async handleTapView() {
|
|
45
|
+
await this.renderOnce(async () => {
|
|
46
|
+
await this.deselectEvent();
|
|
47
|
+
const draft = this.getDraftEvent();
|
|
48
|
+
if (draft) {
|
|
49
|
+
await this.removeDraftEvent(draft.id);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
42
53
|
async handleLongPressViewDrop(options) {
|
|
43
54
|
const draft = this.getDraftEvent();
|
|
44
55
|
if (draft) {
|
|
@@ -75,7 +86,7 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
75
86
|
getRemoteStore() {
|
|
76
87
|
return this.remoteEventStore;
|
|
77
88
|
}
|
|
78
|
-
async
|
|
89
|
+
async handleClickView(options) {
|
|
79
90
|
(0, schema_1.assertOptions)({ remoteEventStore: this.remoteEventStore }, [
|
|
80
91
|
'remoteEventStore',
|
|
81
92
|
]);
|