@sprucelabs/spruce-calendar-components 26.0.2 → 26.0.3
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/esm/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -0
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.js +8 -3
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -0
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.js +6 -3
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
|
|
|
25
25
|
addTool(options: AddToolOptions): Promise<CalendarTool>;
|
|
26
26
|
protected buildVcConstructorOptions(id: string): CalendarToolOptions;
|
|
27
27
|
private addVc;
|
|
28
|
+
private loadVc;
|
|
28
29
|
loadTools(): Promise<void>;
|
|
29
30
|
protected getPersonFromEvent(): ReturnType<GetPersonFromEventHandler>;
|
|
30
31
|
protected handleUpdateContextFromTool(updates: Partial<CalendarToolBeltContext>, fromToolId: string, options?: UpdateCalendarContextOptions): Promise<boolean>;
|
|
@@ -117,7 +117,6 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
addVc(toolId, lineIcon, vc) {
|
|
120
|
-
var _a;
|
|
121
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
121
|
this.vcs.push({ vc, toolId });
|
|
123
122
|
if (typeof vc.handleUpdateContext !== 'function') {
|
|
@@ -129,13 +128,19 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
129
128
|
card: vc.render(),
|
|
130
129
|
});
|
|
131
130
|
if (this.shouldLoadToolsRightAway) {
|
|
132
|
-
yield
|
|
131
|
+
yield this.loadVc(vc);
|
|
133
132
|
}
|
|
134
133
|
});
|
|
135
134
|
}
|
|
135
|
+
loadVc(vc) {
|
|
136
|
+
var _a;
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
yield ((_a = vc.load) === null || _a === void 0 ? void 0 : _a.call(vc));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
136
141
|
loadTools() {
|
|
137
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
yield Promise.all(this.vcs.map(({ vc }) =>
|
|
143
|
+
yield Promise.all(this.vcs.map(({ vc }) => this.loadVc(vc)));
|
|
139
144
|
});
|
|
140
145
|
}
|
|
141
146
|
getPersonFromEvent() {
|
|
@@ -25,6 +25,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
|
|
|
25
25
|
addTool(options: AddToolOptions): Promise<CalendarTool>;
|
|
26
26
|
protected buildVcConstructorOptions(id: string): CalendarToolOptions;
|
|
27
27
|
private addVc;
|
|
28
|
+
private loadVc;
|
|
28
29
|
loadTools(): Promise<void>;
|
|
29
30
|
protected getPersonFromEvent(): ReturnType<GetPersonFromEventHandler>;
|
|
30
31
|
protected handleUpdateContextFromTool(updates: Partial<CalendarToolBeltContext>, fromToolId: string, options?: UpdateCalendarContextOptions): Promise<boolean>;
|
|
@@ -97,7 +97,6 @@ class AbstractCalendarEventToolBeltState {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
async addVc(toolId, lineIcon, vc) {
|
|
100
|
-
var _a;
|
|
101
100
|
this.vcs.push({ vc, toolId });
|
|
102
101
|
if (typeof vc.handleUpdateContext !== 'function') {
|
|
103
102
|
throw new Error('Your tool must conform to the CalendarTool interface!');
|
|
@@ -108,11 +107,15 @@ class AbstractCalendarEventToolBeltState {
|
|
|
108
107
|
card: vc.render(),
|
|
109
108
|
});
|
|
110
109
|
if (this.shouldLoadToolsRightAway) {
|
|
111
|
-
await
|
|
110
|
+
await this.loadVc(vc);
|
|
112
111
|
}
|
|
113
112
|
}
|
|
113
|
+
async loadVc(vc) {
|
|
114
|
+
var _a;
|
|
115
|
+
await ((_a = vc.load) === null || _a === void 0 ? void 0 : _a.call(vc));
|
|
116
|
+
}
|
|
114
117
|
async loadTools() {
|
|
115
|
-
await Promise.all(this.vcs.map(({ vc }) =>
|
|
118
|
+
await Promise.all(this.vcs.map(({ vc }) => this.loadVc(vc)));
|
|
116
119
|
}
|
|
117
120
|
async getPersonFromEvent() {
|
|
118
121
|
var _a;
|