@sprucelabs/spruce-calendar-components 39.0.6 → 39.0.8

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.
@@ -18,9 +18,10 @@ export default class VenueListViewController extends AbstractViewController<List
18
18
  selectVenue(venue: Venue): Promise<void>;
19
19
  private optionallyRenderJoinUrlCell;
20
20
  private isSelected;
21
+ hasVenues(): boolean;
21
22
  private renderCheckboxCell;
22
23
  private handleOnClickJoinUrl;
23
- private handleClickedCheckbox;
24
+ private handleClickVenue;
24
25
  render(): List;
25
26
  }
26
27
  export interface VenueListLoadOptions {
@@ -34,4 +35,5 @@ export interface VenueListConstructorOptions {
34
35
  export interface VenueList extends ViewController<List> {
35
36
  load(options: VenueListLoadOptions): Promise<void>;
36
37
  selectVenue(venue: Venue): Promise<void>;
38
+ hasVenues(): boolean;
37
39
  }
@@ -84,7 +84,7 @@ class VenueListViewController extends AbstractViewController {
84
84
  this.optionallyRenderJoinUrlCell(venue),
85
85
  ].filter(Boolean),
86
86
  onClick: () => __awaiter(this, void 0, void 0, function* () {
87
- yield this.selectVenue(venue);
87
+ yield this.handleClickVenue(venue);
88
88
  }),
89
89
  };
90
90
  }
@@ -114,6 +114,9 @@ class VenueListViewController extends AbstractViewController {
114
114
  var _a;
115
115
  return ((_a = this.selectedVenue) === null || _a === void 0 ? void 0 : _a.provider) === venue.provider;
116
116
  }
117
+ hasVenues() {
118
+ return this.venues.length > 0;
119
+ }
117
120
  renderCheckboxCell(venue) {
118
121
  return {
119
122
  checkboxInput: {
@@ -121,7 +124,7 @@ class VenueListViewController extends AbstractViewController {
121
124
  value: this.isSelected(venue),
122
125
  onChange: (value) => __awaiter(this, void 0, void 0, function* () {
123
126
  if (value) {
124
- yield this.handleClickedCheckbox(venue);
127
+ yield this.handleClickVenue(venue);
125
128
  }
126
129
  }),
127
130
  },
@@ -133,15 +136,10 @@ class VenueListViewController extends AbstractViewController {
133
136
  yield ((_a = this.router) === null || _a === void 0 ? void 0 : _a.redirect(joinUrl));
134
137
  });
135
138
  }
136
- handleClickedCheckbox(venue) {
139
+ handleClickVenue(venue) {
137
140
  return __awaiter(this, void 0, void 0, function* () {
138
141
  var _a;
139
- this.venues.forEach((v) => __awaiter(this, void 0, void 0, function* () {
140
- if (v.provider === venue.provider) {
141
- return;
142
- }
143
- yield this.venueListVc.setValue(v.provider, 'isSelected', false);
144
- }));
142
+ yield this.selectVenue(venue);
145
143
  yield ((_a = this.onSelectHandler) === null || _a === void 0 ? void 0 : _a.call(this, venue));
146
144
  });
147
145
  }
@@ -18,9 +18,10 @@ export default class VenueListViewController extends AbstractViewController<List
18
18
  selectVenue(venue: Venue): Promise<void>;
19
19
  private optionallyRenderJoinUrlCell;
20
20
  private isSelected;
21
+ hasVenues(): boolean;
21
22
  private renderCheckboxCell;
22
23
  private handleOnClickJoinUrl;
23
- private handleClickedCheckbox;
24
+ private handleClickVenue;
24
25
  render(): List;
25
26
  }
26
27
  export interface VenueListLoadOptions {
@@ -34,4 +35,5 @@ export interface VenueListConstructorOptions {
34
35
  export interface VenueList extends ViewController<List> {
35
36
  load(options: VenueListLoadOptions): Promise<void>;
36
37
  selectVenue(venue: Venue): Promise<void>;
38
+ hasVenues(): boolean;
37
39
  }
@@ -73,7 +73,7 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
73
73
  this.optionallyRenderJoinUrlCell(venue),
74
74
  ].filter(Boolean),
75
75
  onClick: async () => {
76
- await this.selectVenue(venue);
76
+ await this.handleClickVenue(venue);
77
77
  },
78
78
  };
79
79
  }
@@ -99,6 +99,9 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
99
99
  isSelected(venue) {
100
100
  return this.selectedVenue?.provider === venue.provider;
101
101
  }
102
+ hasVenues() {
103
+ return this.venues.length > 0;
104
+ }
102
105
  renderCheckboxCell(venue) {
103
106
  return {
104
107
  checkboxInput: {
@@ -106,7 +109,7 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
106
109
  value: this.isSelected(venue),
107
110
  onChange: async (value) => {
108
111
  if (value) {
109
- await this.handleClickedCheckbox(venue);
112
+ await this.handleClickVenue(venue);
110
113
  }
111
114
  },
112
115
  },
@@ -115,13 +118,8 @@ class VenueListViewController extends heartwood_view_controllers_1.AbstractViewC
115
118
  async handleOnClickJoinUrl(joinUrl) {
116
119
  await this.router?.redirect(joinUrl);
117
120
  }
118
- async handleClickedCheckbox(venue) {
119
- this.venues.forEach(async (v) => {
120
- if (v.provider === venue.provider) {
121
- return;
122
- }
123
- await this.venueListVc.setValue(v.provider, 'isSelected', false);
124
- });
121
+ async handleClickVenue(venue) {
122
+ await this.selectVenue(venue);
125
123
  await this.onSelectHandler?.(venue);
126
124
  }
127
125
  render() {
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.6",
4
+ "version": "39.0.8",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },