@sprucelabs/spruce-calendar-components 39.0.0 → 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.
- package/build/esm/index-components.d.ts +1 -0
- package/build/esm/index-components.js +1 -0
- package/build/esm/viewControllers/VenueList.vc.d.ts +9 -4
- package/build/esm/viewControllers/VenueList.vc.js +13 -11
- package/build/index-components.d.ts +1 -0
- package/build/index-components.js +1 -0
- package/build/viewControllers/VenueList.vc.d.ts +9 -4
- package/build/viewControllers/VenueList.vc.js +4 -4
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ export { default as EventDateTimeToolViewController } from './tools/EventDateTim
|
|
|
25
25
|
export * from './tools/EventDateTimeTool.vc';
|
|
26
26
|
export { default as VenueSelectionToolViewController } from './tools/VenueSelectionTool.vc';
|
|
27
27
|
export * from './tools/VenueSelectionTool.vc';
|
|
28
|
+
export * from './viewControllers/VenueList.vc';
|
|
28
29
|
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc';
|
|
29
30
|
export * from './tools/EventRepeatingTool.vc';
|
|
30
31
|
export { default as EventDurationToolViewController } from './tools/EventDurationTool.vc';
|
|
@@ -17,6 +17,7 @@ export { default as EventDateTimeToolViewController } from './tools/EventDateTim
|
|
|
17
17
|
export * from './tools/EventDateTimeTool.vc.js';
|
|
18
18
|
export { default as VenueSelectionToolViewController } from './tools/VenueSelectionTool.vc.js';
|
|
19
19
|
export * from './tools/VenueSelectionTool.vc.js';
|
|
20
|
+
export * from './viewControllers/VenueList.vc.js';
|
|
20
21
|
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc.js';
|
|
21
22
|
export * from './tools/EventRepeatingTool.vc.js';
|
|
22
23
|
export { default as EventDurationToolViewController } from './tools/EventDurationTool.vc.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AbstractViewController, ViewControllerOptions, List, ListViewController, Router } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Venue } from '../types/calendar.types';
|
|
3
|
-
export default class VenueListViewController extends AbstractViewController<List> {
|
|
3
|
+
export default class VenueListViewController extends AbstractViewController<List> implements VenueList {
|
|
4
4
|
static id: string;
|
|
5
5
|
protected listVc: ListViewController;
|
|
6
6
|
private venues;
|
|
7
|
-
protected onSelectHandler?:
|
|
7
|
+
protected onSelectHandler?: SelectVenueHandler;
|
|
8
8
|
private router?;
|
|
9
9
|
private isLoaded;
|
|
10
10
|
private selectedVenue?;
|
|
@@ -26,7 +26,12 @@ 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
|
-
router
|
|
31
|
-
onSelect?:
|
|
31
|
+
router?: Router;
|
|
32
|
+
onSelect?: SelectVenueHandler;
|
|
33
|
+
}
|
|
34
|
+
export interface VenueList {
|
|
35
|
+
load(options: VenueListLoadOptions): Promise<void>;
|
|
36
|
+
selectVenue(venue: Venue): Promise<void>;
|
|
32
37
|
}
|
|
@@ -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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
|
@@ -25,6 +25,7 @@ export { default as EventDateTimeToolViewController } from './tools/EventDateTim
|
|
|
25
25
|
export * from './tools/EventDateTimeTool.vc';
|
|
26
26
|
export { default as VenueSelectionToolViewController } from './tools/VenueSelectionTool.vc';
|
|
27
27
|
export * from './tools/VenueSelectionTool.vc';
|
|
28
|
+
export * from './viewControllers/VenueList.vc';
|
|
28
29
|
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc';
|
|
29
30
|
export * from './tools/EventRepeatingTool.vc';
|
|
30
31
|
export { default as EventDurationToolViewController } from './tools/EventDurationTool.vc';
|
|
@@ -49,6 +49,7 @@ __exportStar(require("./tools/EventDateTimeTool.vc"), exports);
|
|
|
49
49
|
var VenueSelectionTool_vc_1 = require("./tools/VenueSelectionTool.vc");
|
|
50
50
|
Object.defineProperty(exports, "VenueSelectionToolViewController", { enumerable: true, get: function () { return __importDefault(VenueSelectionTool_vc_1).default; } });
|
|
51
51
|
__exportStar(require("./tools/VenueSelectionTool.vc"), exports);
|
|
52
|
+
__exportStar(require("./viewControllers/VenueList.vc"), exports);
|
|
52
53
|
var EventRepeatingTool_vc_2 = require("./tools/EventRepeatingTool.vc");
|
|
53
54
|
Object.defineProperty(exports, "EventRepeatingToolViewController", { enumerable: true, get: function () { return __importDefault(EventRepeatingTool_vc_2).default; } });
|
|
54
55
|
__exportStar(require("./tools/EventRepeatingTool.vc"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AbstractViewController, ViewControllerOptions, List, ListViewController, Router } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Venue } from '../types/calendar.types';
|
|
3
|
-
export default class VenueListViewController extends AbstractViewController<List> {
|
|
3
|
+
export default class VenueListViewController extends AbstractViewController<List> implements VenueList {
|
|
4
4
|
static id: string;
|
|
5
5
|
protected listVc: ListViewController;
|
|
6
6
|
private venues;
|
|
7
|
-
protected onSelectHandler?:
|
|
7
|
+
protected onSelectHandler?: SelectVenueHandler;
|
|
8
8
|
private router?;
|
|
9
9
|
private isLoaded;
|
|
10
10
|
private selectedVenue?;
|
|
@@ -26,7 +26,12 @@ 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
|
-
router
|
|
31
|
-
onSelect?:
|
|
31
|
+
router?: Router;
|
|
32
|
+
onSelect?: SelectVenueHandler;
|
|
33
|
+
}
|
|
34
|
+
export interface VenueList {
|
|
35
|
+
load(options: VenueListLoadOptions): Promise<void>;
|
|
36
|
+
selectVenue(venue: Venue): Promise<void>;
|
|
32
37
|
}
|
|
@@ -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
|