@sprucelabs/spruce-calendar-components 25.2.5 → 25.2.7
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/calendar/CalendarEventManager.js +0 -4
- package/build/esm/calendar/CalendarEventManager.js +0 -4
- package/build/esm/skillViewControllers/Root.svc.js +0 -2
- package/build/esm/viewControllers/RepeatingControlsList.vc.js +16 -8
- package/build/skillViewControllers/Root.svc.js +0 -2
- package/build/viewControllers/RepeatingControlsList.vc.js +16 -8
- package/package.json +1 -1
|
@@ -194,7 +194,6 @@ class CalendarEventManager {
|
|
|
194
194
|
peopleIds,
|
|
195
195
|
});
|
|
196
196
|
await this.calendarVc.renderOnce(async () => {
|
|
197
|
-
console.log('CalendarEventManager.loadEvents triggerRender start');
|
|
198
197
|
this.replaceEventsInRange(events, startDate, endDate);
|
|
199
198
|
if (!this.eventTypes) {
|
|
200
199
|
this.eventTypes = await this.events.getEventTypes();
|
|
@@ -206,7 +205,6 @@ class CalendarEventManager {
|
|
|
206
205
|
await this.setupVcForEventType(type.viewControllerId, type.slug);
|
|
207
206
|
}
|
|
208
207
|
}));
|
|
209
|
-
console.log('CalendarEventManager.loadEvents triggerRender end');
|
|
210
208
|
});
|
|
211
209
|
}
|
|
212
210
|
async setCalendarVisibility(calendarId, shouldBeVisible) {
|
|
@@ -224,7 +222,6 @@ class CalendarEventManager {
|
|
|
224
222
|
}
|
|
225
223
|
this.hasVcForEventTypeBeenLoaded[key] = true;
|
|
226
224
|
await this.remoteVc.fetchRemoteController(vcId);
|
|
227
|
-
console.log('set controller for type');
|
|
228
225
|
this.calendarVc.setControllerForEventType(typeSlug, vcId);
|
|
229
226
|
}
|
|
230
227
|
assertValidCalendarId(calendarId) {
|
|
@@ -305,7 +302,6 @@ class CalendarEventManager {
|
|
|
305
302
|
await this.calendarVc.deselectEvent();
|
|
306
303
|
}
|
|
307
304
|
async setCurrentDate(dateMs) {
|
|
308
|
-
console.log('CalendarEventManager.setStartDate');
|
|
309
305
|
await this.calendarVc.setStartDate(dateMs);
|
|
310
306
|
}
|
|
311
307
|
async handleDidUpdateContext() {
|
|
@@ -215,7 +215,6 @@ export default class CalendarEventManager {
|
|
|
215
215
|
peopleIds,
|
|
216
216
|
});
|
|
217
217
|
yield this.calendarVc.renderOnce(() => __awaiter(this, void 0, void 0, function* () {
|
|
218
|
-
console.log('CalendarEventManager.loadEvents triggerRender start');
|
|
219
218
|
this.replaceEventsInRange(events, startDate, endDate);
|
|
220
219
|
if (!this.eventTypes) {
|
|
221
220
|
this.eventTypes = yield this.events.getEventTypes();
|
|
@@ -227,7 +226,6 @@ export default class CalendarEventManager {
|
|
|
227
226
|
yield this.setupVcForEventType(type.viewControllerId, type.slug);
|
|
228
227
|
}
|
|
229
228
|
})));
|
|
230
|
-
console.log('CalendarEventManager.loadEvents triggerRender end');
|
|
231
229
|
}));
|
|
232
230
|
});
|
|
233
231
|
}
|
|
@@ -249,7 +247,6 @@ export default class CalendarEventManager {
|
|
|
249
247
|
}
|
|
250
248
|
this.hasVcForEventTypeBeenLoaded[key] = true;
|
|
251
249
|
yield this.remoteVc.fetchRemoteController(vcId);
|
|
252
|
-
console.log('set controller for type');
|
|
253
250
|
this.calendarVc.setControllerForEventType(typeSlug, vcId);
|
|
254
251
|
});
|
|
255
252
|
}
|
|
@@ -346,7 +343,6 @@ export default class CalendarEventManager {
|
|
|
346
343
|
}
|
|
347
344
|
setCurrentDate(dateMs) {
|
|
348
345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
-
console.log('CalendarEventManager.setStartDate');
|
|
350
346
|
yield this.calendarVc.setStartDate(dateMs);
|
|
351
347
|
});
|
|
352
348
|
}
|
|
@@ -356,7 +356,6 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
358
|
const { startDate = this.dates.getStartOfDay(), visiblePeopleIds } = args;
|
|
359
|
-
console.log('render once');
|
|
360
359
|
yield this.calendarVc.renderOnce(() => __awaiter(this, void 0, void 0, function* () {
|
|
361
360
|
this.syncOffsetWithLocale(locale);
|
|
362
361
|
yield this.events.setCurrentDate(startDate);
|
|
@@ -464,7 +463,6 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
464
463
|
}
|
|
465
464
|
loadEvents(options) {
|
|
466
465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
-
console.log('load events');
|
|
468
466
|
this.loadEventsPromise = this._loadEvents(options);
|
|
469
467
|
yield this.loadEventsPromise;
|
|
470
468
|
});
|
|
@@ -10,11 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { AbstractViewController, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
11
|
class RepeatingControlsListViewController extends AbstractViewController {
|
|
12
12
|
constructor(options) {
|
|
13
|
-
var _a;
|
|
14
13
|
super(options);
|
|
15
14
|
this.repeating = {};
|
|
16
|
-
|
|
17
|
-
this.
|
|
15
|
+
const { repeating, didChangeRepeating } = options;
|
|
16
|
+
this.repeating = repeating !== null && repeating !== void 0 ? repeating : {};
|
|
17
|
+
if (repeating === null || repeating === void 0 ? void 0 : repeating.repeatsUntil) {
|
|
18
|
+
this.repeating.repeatAmount = 'until';
|
|
19
|
+
}
|
|
20
|
+
else if (repeating === null || repeating === void 0 ? void 0 : repeating.occurrences) {
|
|
21
|
+
this.repeating.repeatAmount = 'after';
|
|
22
|
+
}
|
|
23
|
+
this.didChangeRepeating = didChangeRepeating;
|
|
18
24
|
this.calendarVc = this.CalendarVc();
|
|
19
25
|
this.listVc = this.ListVc();
|
|
20
26
|
}
|
|
@@ -184,7 +190,7 @@ class RepeatingControlsListViewController extends AbstractViewController {
|
|
|
184
190
|
choices: [
|
|
185
191
|
{ label: 'Forever', value: 'forever' },
|
|
186
192
|
{ label: 'Until', value: 'until' },
|
|
187
|
-
{ label: '
|
|
193
|
+
{ label: 'For', value: 'after' },
|
|
188
194
|
],
|
|
189
195
|
name: 'repeatAmount',
|
|
190
196
|
value: (_b = (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount) !== null && _b !== void 0 ? _b : 'forever',
|
|
@@ -198,6 +204,7 @@ class RepeatingControlsListViewController extends AbstractViewController {
|
|
|
198
204
|
];
|
|
199
205
|
if (((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatAmount) === 'until') {
|
|
200
206
|
cells.push({
|
|
207
|
+
id: 'repeatsUntil',
|
|
201
208
|
dateInput: {
|
|
202
209
|
name: 'repeatsUntil',
|
|
203
210
|
label: ``,
|
|
@@ -206,7 +213,7 @@ class RepeatingControlsListViewController extends AbstractViewController {
|
|
|
206
213
|
: undefined,
|
|
207
214
|
onChange: (value) => {
|
|
208
215
|
var _a;
|
|
209
|
-
this.repeating.repeatsUntil = value;
|
|
216
|
+
this.repeating.repeatsUntil = this.dates.getEndOfDay(value);
|
|
210
217
|
(_a = this.didChangeRepeating) === null || _a === void 0 ? void 0 : _a.call(this, this.repeating);
|
|
211
218
|
},
|
|
212
219
|
},
|
|
@@ -214,6 +221,7 @@ class RepeatingControlsListViewController extends AbstractViewController {
|
|
|
214
221
|
}
|
|
215
222
|
else if (((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.repeatAmount) === 'after') {
|
|
216
223
|
cells.push({
|
|
224
|
+
id: 'occurrences',
|
|
217
225
|
textInput: {
|
|
218
226
|
name: 'occurrences',
|
|
219
227
|
label: ``,
|
|
@@ -316,12 +324,12 @@ class RepeatingControlsListViewController extends AbstractViewController {
|
|
|
316
324
|
mapFieldRepeatAfterSuffix() {
|
|
317
325
|
var _a;
|
|
318
326
|
if (!this.repeating || !this.repeating.occurrences) {
|
|
319
|
-
return '
|
|
327
|
+
return 'time(s)';
|
|
320
328
|
}
|
|
321
329
|
else if (((_a = this.repeating) === null || _a === void 0 ? void 0 : _a.occurrences) > 1) {
|
|
322
|
-
return '
|
|
330
|
+
return 'times';
|
|
323
331
|
}
|
|
324
|
-
return '
|
|
332
|
+
return 'time';
|
|
325
333
|
}
|
|
326
334
|
CalendarVc() {
|
|
327
335
|
var _a;
|
|
@@ -315,7 +315,6 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
|
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
317
|
const { startDate = this.dates.getStartOfDay(), visiblePeopleIds } = args;
|
|
318
|
-
console.log('render once');
|
|
319
318
|
await this.calendarVc.renderOnce(async () => {
|
|
320
319
|
this.syncOffsetWithLocale(locale);
|
|
321
320
|
await this.events.setCurrentDate(startDate);
|
|
@@ -405,7 +404,6 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
|
|
|
405
404
|
this.calendarVc.setTimezoneOffsetMs(offset * 60 * 1000);
|
|
406
405
|
}
|
|
407
406
|
async loadEvents(options) {
|
|
408
|
-
console.log('load events');
|
|
409
407
|
this.loadEventsPromise = this._loadEvents(options);
|
|
410
408
|
await this.loadEventsPromise;
|
|
411
409
|
}
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
4
4
|
class RepeatingControlsListViewController extends heartwood_view_controllers_1.AbstractViewController {
|
|
5
5
|
constructor(options) {
|
|
6
|
-
var _a;
|
|
7
6
|
super(options);
|
|
8
7
|
this.repeating = {};
|
|
9
|
-
|
|
10
|
-
this.
|
|
8
|
+
const { repeating, didChangeRepeating } = options;
|
|
9
|
+
this.repeating = repeating !== null && repeating !== void 0 ? repeating : {};
|
|
10
|
+
if (repeating === null || repeating === void 0 ? void 0 : repeating.repeatsUntil) {
|
|
11
|
+
this.repeating.repeatAmount = 'until';
|
|
12
|
+
}
|
|
13
|
+
else if (repeating === null || repeating === void 0 ? void 0 : repeating.occurrences) {
|
|
14
|
+
this.repeating.repeatAmount = 'after';
|
|
15
|
+
}
|
|
16
|
+
this.didChangeRepeating = didChangeRepeating;
|
|
11
17
|
this.calendarVc = this.CalendarVc();
|
|
12
18
|
this.listVc = this.ListVc();
|
|
13
19
|
}
|
|
@@ -177,7 +183,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
|
|
|
177
183
|
choices: [
|
|
178
184
|
{ label: 'Forever', value: 'forever' },
|
|
179
185
|
{ label: 'Until', value: 'until' },
|
|
180
|
-
{ label: '
|
|
186
|
+
{ label: 'For', value: 'after' },
|
|
181
187
|
],
|
|
182
188
|
name: 'repeatAmount',
|
|
183
189
|
value: (_b = (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount) !== null && _b !== void 0 ? _b : 'forever',
|
|
@@ -191,6 +197,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
|
|
|
191
197
|
];
|
|
192
198
|
if (((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatAmount) === 'until') {
|
|
193
199
|
cells.push({
|
|
200
|
+
id: 'repeatsUntil',
|
|
194
201
|
dateInput: {
|
|
195
202
|
name: 'repeatsUntil',
|
|
196
203
|
label: ``,
|
|
@@ -199,7 +206,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
|
|
|
199
206
|
: undefined,
|
|
200
207
|
onChange: (value) => {
|
|
201
208
|
var _a;
|
|
202
|
-
this.repeating.repeatsUntil = value;
|
|
209
|
+
this.repeating.repeatsUntil = this.dates.getEndOfDay(value);
|
|
203
210
|
(_a = this.didChangeRepeating) === null || _a === void 0 ? void 0 : _a.call(this, this.repeating);
|
|
204
211
|
},
|
|
205
212
|
},
|
|
@@ -207,6 +214,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
|
|
|
207
214
|
}
|
|
208
215
|
else if (((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.repeatAmount) === 'after') {
|
|
209
216
|
cells.push({
|
|
217
|
+
id: 'occurrences',
|
|
210
218
|
textInput: {
|
|
211
219
|
name: 'occurrences',
|
|
212
220
|
label: ``,
|
|
@@ -309,12 +317,12 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
|
|
|
309
317
|
mapFieldRepeatAfterSuffix() {
|
|
310
318
|
var _a;
|
|
311
319
|
if (!this.repeating || !this.repeating.occurrences) {
|
|
312
|
-
return '
|
|
320
|
+
return 'time(s)';
|
|
313
321
|
}
|
|
314
322
|
else if (((_a = this.repeating) === null || _a === void 0 ? void 0 : _a.occurrences) > 1) {
|
|
315
|
-
return '
|
|
323
|
+
return 'times';
|
|
316
324
|
}
|
|
317
|
-
return '
|
|
325
|
+
return 'time';
|
|
318
326
|
}
|
|
319
327
|
CalendarVc() {
|
|
320
328
|
var _a;
|