@sprucelabs/spruce-calendar-components 17.2.8 → 18.0.2

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.
@@ -164,6 +164,7 @@ export default class RemoteEventStore {
164
164
  'error',
165
165
  'source',
166
166
  'target',
167
+ 'nthInRepeating',
167
168
  ];
168
169
  for (const key of toDelete) {
169
170
  //@ts-ignore
@@ -3,6 +3,7 @@ import { CalendarTool, CalendarToolBeltContext, CalendarToolOptions } from '../t
3
3
  declare type Card = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
4
4
  export default class EventDateTimeToolViewController extends AbstractViewController<Card> implements CalendarTool {
5
5
  static id: string;
6
+ shouldPersistContextChangesImmediately: boolean;
6
7
  private cardVc;
7
8
  private formVc;
8
9
  private updateContext;
@@ -21,6 +21,7 @@ const schema = buildSchema({
21
21
  export default class EventDateTimeToolViewController extends AbstractViewController {
22
22
  constructor(options) {
23
23
  super(options);
24
+ this.shouldPersistContextChangesImmediately = true;
24
25
  this.updateContext = options.updateContext;
25
26
  this.getContext = options.getContext;
26
27
  this.formVc = this.FormVc();
@@ -39,9 +39,16 @@ export default class EventRepeatingToolViewController extends AbstractViewContro
39
39
  private FormVc;
40
40
  getControlsListVc(): RepeatingControlsListViewController;
41
41
  getFormVc(): FormVc;
42
- getValues(): Partial<Pick<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent, "interval" | "startDateTimeMs" | "repeats" | "daysOfWeek" | "daysOfMonth" | "repeatsUntil" | "occurrences"> & {
42
+ getValues(): {
43
+ repeatsUntil: number | undefined;
44
+ interval?: number | null | undefined;
45
+ startDateTimeMs?: number | undefined;
46
+ repeats?: "weekly" | "monthly" | "daily" | null | undefined;
47
+ daysOfWeek?: ("sun" | "mon" | "tue" | "wed" | "thur" | "fri" | "sat")[] | null | undefined;
48
+ daysOfMonth?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31")[] | null | undefined;
49
+ occurrences?: number | null | undefined;
43
50
  repeatAmount?: "after" | "until" | "forever" | undefined;
44
- }>;
51
+ };
45
52
  setValues(repeating: RepeatingOptions): void;
46
53
  getCalendarVc(): import("@sprucelabs/heartwood-view-controllers").CalendarViewController | undefined;
47
54
  render(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
@@ -31,9 +31,16 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
31
31
  CalendarVc(): CalendarViewController;
32
32
  getCalendarVc(): CalendarViewController | undefined;
33
33
  getListVc(): ListViewController;
34
- getRepeating(): Partial<Pick<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent, "interval" | "startDateTimeMs" | "repeats" | "daysOfWeek" | "daysOfMonth" | "repeatsUntil" | "occurrences"> & {
34
+ getRepeating(): {
35
+ repeatsUntil: number | undefined;
36
+ interval?: number | null | undefined;
37
+ startDateTimeMs?: number | undefined;
38
+ repeats?: "weekly" | "monthly" | "daily" | null | undefined;
39
+ daysOfWeek?: ("sun" | "mon" | "tue" | "wed" | "thur" | "fri" | "sat")[] | null | undefined;
40
+ daysOfMonth?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31")[] | null | undefined;
41
+ occurrences?: number | null | undefined;
35
42
  repeatAmount?: "after" | "until" | "forever" | undefined;
36
- }>;
43
+ };
37
44
  updateRepeating(repeating: RepeatingOptions): void;
38
45
  private setCalendarSelectedDatesFromDate;
39
46
  private getSelectedDatesFromDate;
@@ -98,7 +98,7 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
98
98
  name: 'interval',
99
99
  value: ((_a = this.repeating) === null || _a === void 0 ? void 0 : _a.interval)
100
100
  ? `${(_b = this.repeating) === null || _b === void 0 ? void 0 : _b.interval}`
101
- : undefined,
101
+ : '1',
102
102
  onChange: (value) => __awaiter(this, void 0, void 0, function* () {
103
103
  var _c;
104
104
  this.repeating.interval = value;
@@ -178,7 +178,7 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
178
178
  };
179
179
  }
180
180
  renderRepeatAmountRow() {
181
- var _a, _b, _c, _d, _e, _f, _g;
181
+ var _a, _b, _c, _d, _e, _f, _g, _h;
182
182
  const cells = [
183
183
  {
184
184
  selectInput: {
@@ -188,7 +188,7 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
188
188
  { label: 'After', value: 'after' },
189
189
  ],
190
190
  name: 'repeatAmount',
191
- value: (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount,
191
+ value: (_b = (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount) !== null && _b !== void 0 ? _b : 'forever',
192
192
  onChange: (value) => {
193
193
  var _a;
194
194
  this.handleRepeatAmountChange(value);
@@ -197,13 +197,13 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
197
197
  },
198
198
  },
199
199
  ];
200
- if (((_b = this.repeating) === null || _b === void 0 ? void 0 : _b.repeatAmount) === 'until') {
200
+ if (((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatAmount) === 'until') {
201
201
  cells.push({
202
- textInput: {
202
+ dateInput: {
203
203
  name: 'repeatsUntil',
204
204
  label: ``,
205
- value: ((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatsUntil)
206
- ? `${(_d = this.repeating) === null || _d === void 0 ? void 0 : _d.repeatsUntil}`
205
+ value: ((_d = this.repeating) === null || _d === void 0 ? void 0 : _d.repeatsUntil)
206
+ ? `${(_e = this.repeating) === null || _e === void 0 ? void 0 : _e.repeatsUntil}`
207
207
  : undefined,
208
208
  onChange: (value) => {
209
209
  var _a;
@@ -213,13 +213,13 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
213
213
  },
214
214
  });
215
215
  }
216
- else if (((_e = this.repeating) === null || _e === void 0 ? void 0 : _e.repeatAmount) === 'after') {
216
+ else if (((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.repeatAmount) === 'after') {
217
217
  cells.push({
218
218
  textInput: {
219
219
  name: 'occurrences',
220
220
  label: ``,
221
- value: ((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.occurrences)
222
- ? `${(_g = this.repeating) === null || _g === void 0 ? void 0 : _g.occurrences}`
221
+ value: ((_g = this.repeating) === null || _g === void 0 ? void 0 : _g.occurrences)
222
+ ? `${(_h = this.repeating) === null || _h === void 0 ? void 0 : _h.occurrences}`
223
223
  : undefined,
224
224
  onChange: (value) => {
225
225
  var _a;
@@ -352,7 +352,9 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
352
352
  return this.listVc;
353
353
  }
354
354
  getRepeating() {
355
- return this.repeating;
355
+ return Object.assign(Object.assign({}, this.repeating), { repeatsUntil: this.repeating.repeatsUntil
356
+ ? dateUtil.getEndOfDay(this.repeating.repeatsUntil)
357
+ : undefined });
356
358
  }
357
359
  updateRepeating(repeating) {
358
360
  this.repeating = Object.assign(Object.assign({}, this.repeating), repeating);
@@ -150,6 +150,7 @@ class RemoteEventStore {
150
150
  'error',
151
151
  'source',
152
152
  'target',
153
+ 'nthInRepeating',
153
154
  ];
154
155
  for (const key of toDelete) {
155
156
  //@ts-ignore
@@ -3,6 +3,7 @@ import { CalendarTool, CalendarToolBeltContext, CalendarToolOptions } from '../t
3
3
  declare type Card = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
4
4
  export default class EventDateTimeToolViewController extends AbstractViewController<Card> implements CalendarTool {
5
5
  static id: string;
6
+ shouldPersistContextChangesImmediately: boolean;
6
7
  private cardVc;
7
8
  private formVc;
8
9
  private updateContext;
@@ -14,6 +14,7 @@ const schema = (0, schema_1.buildSchema)({
14
14
  class EventDateTimeToolViewController extends heartwood_view_controllers_1.AbstractViewController {
15
15
  constructor(options) {
16
16
  super(options);
17
+ this.shouldPersistContextChangesImmediately = true;
17
18
  this.updateContext = options.updateContext;
18
19
  this.getContext = options.getContext;
19
20
  this.formVc = this.FormVc();
@@ -39,9 +39,16 @@ export default class EventRepeatingToolViewController extends AbstractViewContro
39
39
  private FormVc;
40
40
  getControlsListVc(): RepeatingControlsListViewController;
41
41
  getFormVc(): FormVc;
42
- getValues(): Partial<Pick<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent, "interval" | "startDateTimeMs" | "repeats" | "daysOfWeek" | "daysOfMonth" | "repeatsUntil" | "occurrences"> & {
42
+ getValues(): {
43
+ repeatsUntil: number | undefined;
44
+ interval?: number | null | undefined;
45
+ startDateTimeMs?: number | undefined;
46
+ repeats?: "weekly" | "monthly" | "daily" | null | undefined;
47
+ daysOfWeek?: ("sun" | "mon" | "tue" | "wed" | "thur" | "fri" | "sat")[] | null | undefined;
48
+ daysOfMonth?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31")[] | null | undefined;
49
+ occurrences?: number | null | undefined;
43
50
  repeatAmount?: "after" | "until" | "forever" | undefined;
44
- }>;
51
+ };
45
52
  setValues(repeating: RepeatingOptions): void;
46
53
  getCalendarVc(): import("@sprucelabs/heartwood-view-controllers").CalendarViewController | undefined;
47
54
  render(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
@@ -31,9 +31,16 @@ export default class RepeatingControlsListViewController extends AbstractViewCon
31
31
  CalendarVc(): CalendarViewController;
32
32
  getCalendarVc(): CalendarViewController | undefined;
33
33
  getListVc(): ListViewController;
34
- getRepeating(): Partial<Pick<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent, "interval" | "startDateTimeMs" | "repeats" | "daysOfWeek" | "daysOfMonth" | "repeatsUntil" | "occurrences"> & {
34
+ getRepeating(): {
35
+ repeatsUntil: number | undefined;
36
+ interval?: number | null | undefined;
37
+ startDateTimeMs?: number | undefined;
38
+ repeats?: "weekly" | "monthly" | "daily" | null | undefined;
39
+ daysOfWeek?: ("sun" | "mon" | "tue" | "wed" | "thur" | "fri" | "sat")[] | null | undefined;
40
+ daysOfMonth?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31")[] | null | undefined;
41
+ occurrences?: number | null | undefined;
35
42
  repeatAmount?: "after" | "until" | "forever" | undefined;
36
- }>;
43
+ };
37
44
  updateRepeating(repeating: RepeatingOptions): void;
38
45
  private setCalendarSelectedDatesFromDate;
39
46
  private getSelectedDatesFromDate;
@@ -91,7 +91,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
91
91
  name: 'interval',
92
92
  value: ((_a = this.repeating) === null || _a === void 0 ? void 0 : _a.interval)
93
93
  ? `${(_b = this.repeating) === null || _b === void 0 ? void 0 : _b.interval}`
94
- : undefined,
94
+ : '1',
95
95
  onChange: async (value) => {
96
96
  var _a;
97
97
  this.repeating.interval = value;
@@ -171,7 +171,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
171
171
  };
172
172
  }
173
173
  renderRepeatAmountRow() {
174
- var _a, _b, _c, _d, _e, _f, _g;
174
+ var _a, _b, _c, _d, _e, _f, _g, _h;
175
175
  const cells = [
176
176
  {
177
177
  selectInput: {
@@ -181,7 +181,7 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
181
181
  { label: 'After', value: 'after' },
182
182
  ],
183
183
  name: 'repeatAmount',
184
- value: (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount,
184
+ value: (_b = (_a = this.repeating) === null || _a === void 0 ? void 0 : _a.repeatAmount) !== null && _b !== void 0 ? _b : 'forever',
185
185
  onChange: (value) => {
186
186
  var _a;
187
187
  this.handleRepeatAmountChange(value);
@@ -190,13 +190,13 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
190
190
  },
191
191
  },
192
192
  ];
193
- if (((_b = this.repeating) === null || _b === void 0 ? void 0 : _b.repeatAmount) === 'until') {
193
+ if (((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatAmount) === 'until') {
194
194
  cells.push({
195
- textInput: {
195
+ dateInput: {
196
196
  name: 'repeatsUntil',
197
197
  label: ``,
198
- value: ((_c = this.repeating) === null || _c === void 0 ? void 0 : _c.repeatsUntil)
199
- ? `${(_d = this.repeating) === null || _d === void 0 ? void 0 : _d.repeatsUntil}`
198
+ value: ((_d = this.repeating) === null || _d === void 0 ? void 0 : _d.repeatsUntil)
199
+ ? `${(_e = this.repeating) === null || _e === void 0 ? void 0 : _e.repeatsUntil}`
200
200
  : undefined,
201
201
  onChange: (value) => {
202
202
  var _a;
@@ -206,13 +206,13 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
206
206
  },
207
207
  });
208
208
  }
209
- else if (((_e = this.repeating) === null || _e === void 0 ? void 0 : _e.repeatAmount) === 'after') {
209
+ else if (((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.repeatAmount) === 'after') {
210
210
  cells.push({
211
211
  textInput: {
212
212
  name: 'occurrences',
213
213
  label: ``,
214
- value: ((_f = this.repeating) === null || _f === void 0 ? void 0 : _f.occurrences)
215
- ? `${(_g = this.repeating) === null || _g === void 0 ? void 0 : _g.occurrences}`
214
+ value: ((_g = this.repeating) === null || _g === void 0 ? void 0 : _g.occurrences)
215
+ ? `${(_h = this.repeating) === null || _h === void 0 ? void 0 : _h.occurrences}`
216
216
  : undefined,
217
217
  onChange: (value) => {
218
218
  var _a;
@@ -345,7 +345,9 @@ class RepeatingControlsListViewController extends heartwood_view_controllers_1.A
345
345
  return this.listVc;
346
346
  }
347
347
  getRepeating() {
348
- return this.repeating;
348
+ return Object.assign(Object.assign({}, this.repeating), { repeatsUntil: this.repeating.repeatsUntil
349
+ ? calendar_utils_1.dateUtil.getEndOfDay(this.repeating.repeatsUntil)
350
+ : undefined });
349
351
  }
350
352
  updateRepeating(repeating) {
351
353
  this.repeating = Object.assign(Object.assign({}, this.repeating), repeating);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-calendar-components",
3
3
  "description": "Calendar components for working with calendars and Sprucebot.",
4
- "version": "17.2.8",
4
+ "version": "18.0.2",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },