@sprucelabs/spruce-calendar-components 39.0.1 → 39.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.
@@ -4,7 +4,7 @@ export default class VenueListViewController extends AbstractViewController<List
4
4
  static id: string;
5
5
  protected listVc: ListViewController;
6
6
  private venues;
7
- protected onSelectHandler?: (venue: Venue) => void;
7
+ protected onSelectHandler?: SelectVenueHandler;
8
8
  private router?;
9
9
  private isLoaded;
10
10
  private selectedVenue?;
@@ -26,9 +26,10 @@ export default class VenueListViewController extends AbstractViewController<List
26
26
  export interface VenueListLoadOptions {
27
27
  organizationId: string;
28
28
  }
29
+ export type SelectVenueHandler = (venue: Venue) => Promise<void>;
29
30
  export interface VenueListConstructorOptions {
30
31
  router?: Router;
31
- onSelect?: (venue: Venue) => void;
32
+ onSelect?: SelectVenueHandler;
32
33
  }
33
34
  export interface VenueList {
34
35
  load(options: VenueListLoadOptions): Promise<void>;
@@ -116,11 +116,11 @@ class VenueListViewController extends AbstractViewController {
116
116
  checkboxInput: {
117
117
  name: 'isSelected',
118
118
  value: this.isSelected(venue),
119
- onChange: (value) => {
119
+ onChange: (value) => __awaiter(this, void 0, void 0, function* () {
120
120
  if (value) {
121
- this.handleClickedCheckbox(venue);
121
+ yield this.handleClickedCheckbox(venue);
122
122
  }
123
- },
123
+ }),
124
124
  },
125
125
  };
126
126
  }
@@ -131,14 +131,16 @@ class VenueListViewController extends AbstractViewController {
131
131
  });
132
132
  }
133
133
  handleClickedCheckbox(venue) {
134
- var _a;
135
- this.venues.forEach((v) => __awaiter(this, void 0, void 0, function* () {
136
- if (v.provider === venue.provider) {
137
- return;
138
- }
139
- yield this.listVc.setValue(v.provider, 'isSelected', false);
140
- }));
141
- (_a = this.onSelectHandler) === null || _a === void 0 ? void 0 : _a.call(this, venue);
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ var _a;
136
+ this.venues.forEach((v) => __awaiter(this, void 0, void 0, function* () {
137
+ if (v.provider === venue.provider) {
138
+ return;
139
+ }
140
+ yield this.listVc.setValue(v.provider, 'isSelected', false);
141
+ }));
142
+ yield ((_a = this.onSelectHandler) === null || _a === void 0 ? void 0 : _a.call(this, venue));
143
+ });
142
144
  }
143
145
  render() {
144
146
  return (this.venues.length === 0 && this.isLoaded
@@ -4,7 +4,7 @@ export default class VenueListViewController extends AbstractViewController<List
4
4
  static id: string;
5
5
  protected listVc: ListViewController;
6
6
  private venues;
7
- protected onSelectHandler?: (venue: Venue) => void;
7
+ protected onSelectHandler?: SelectVenueHandler;
8
8
  private router?;
9
9
  private isLoaded;
10
10
  private selectedVenue?;
@@ -26,9 +26,10 @@ export default class VenueListViewController extends AbstractViewController<List
26
26
  export interface VenueListLoadOptions {
27
27
  organizationId: string;
28
28
  }
29
+ export type SelectVenueHandler = (venue: Venue) => Promise<void>;
29
30
  export interface VenueListConstructorOptions {
30
31
  router?: Router;
31
- onSelect?: (venue: Venue) => void;
32
+ onSelect?: SelectVenueHandler;
32
33
  }
33
34
  export interface VenueList {
34
35
  load(options: VenueListLoadOptions): Promise<void>;
@@ -101,9 +101,9 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
101
101
  checkboxInput: {
102
102
  name: 'isSelected',
103
103
  value: this.isSelected(venue),
104
- onChange: (value) => {
104
+ onChange: async (value) => {
105
105
  if (value) {
106
- this.handleClickedCheckbox(venue);
106
+ await this.handleClickedCheckbox(venue);
107
107
  }
108
108
  },
109
109
  },
@@ -112,14 +112,14 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
112
112
  async handleOnClickJoinUrl(joinUrl) {
113
113
  await this.router?.redirect(joinUrl);
114
114
  }
115
- handleClickedCheckbox(venue) {
115
+ async handleClickedCheckbox(venue) {
116
116
  this.venues.forEach(async (v) => {
117
117
  if (v.provider === venue.provider) {
118
118
  return;
119
119
  }
120
120
  await this.listVc.setValue(v.provider, 'isSelected', false);
121
121
  });
122
- this.onSelectHandler?.(venue);
122
+ await this.onSelectHandler?.(venue);
123
123
  }
124
124
  render() {
125
125
  return (this.venues.length === 0 && this.isLoaded
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": "39.0.1",
4
+ "version": "39.0.2",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },