@sprucelabs/spruce-calendar-components 24.3.9 → 25.0.0
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/skillViewControllers/Root.svc.js +1 -1
- package/build/esm/viewControllers/EventControlsCard.vc.d.ts +0 -4
- package/build/esm/viewControllers/EventControlsCard.vc.js +3 -28
- package/build/skillViewControllers/Root.svc.js +1 -1
- package/build/viewControllers/EventControlsCard.vc.d.ts +0 -4
- package/build/viewControllers/EventControlsCard.vc.js +3 -26
- package/package.json +1 -1
|
@@ -482,7 +482,7 @@ class RootSkillViewController extends AbstractSkillViewController {
|
|
|
482
482
|
catch (err) {
|
|
483
483
|
if ((options === null || options === void 0 ? void 0 : options.shouldRenderAlertOnFail) === false) {
|
|
484
484
|
this.toast({
|
|
485
|
-
message: 'Updating your calendar failed! Trying
|
|
485
|
+
message: 'Updating your calendar failed! Trying to connect...',
|
|
486
486
|
});
|
|
487
487
|
return;
|
|
488
488
|
}
|
|
@@ -4,20 +4,16 @@ export default class EventControlsCardViewController extends AbstractViewControl
|
|
|
4
4
|
static id: string;
|
|
5
5
|
private cardVc;
|
|
6
6
|
private saveHandler;
|
|
7
|
-
private cancelHandler;
|
|
8
|
-
private getHasPendingContextChanges;
|
|
9
7
|
private getContext;
|
|
10
8
|
private cancelEventHandler;
|
|
11
9
|
private isEnableLocked;
|
|
12
10
|
constructor(options: ViewControllerOptions & EventControlsCardOptions);
|
|
13
11
|
private CardVc;
|
|
14
|
-
private handleClickCancel;
|
|
15
12
|
private handleClickSave;
|
|
16
13
|
lockEnabled(): void;
|
|
17
14
|
unlockEnabled(): void;
|
|
18
15
|
getIsEnableLocked(): boolean;
|
|
19
16
|
handleUpdateContext(): void;
|
|
20
|
-
private shouldFooterBeEnabled;
|
|
21
17
|
private optionallyDropInCancelButton;
|
|
22
18
|
render(): import("@sprucelabs/heartwood-view-controllers").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
|
23
19
|
}
|
|
@@ -14,17 +14,13 @@ class EventControlsCardViewController extends AbstractViewController {
|
|
|
14
14
|
constructor(options) {
|
|
15
15
|
super(options);
|
|
16
16
|
this.isEnableLocked = false;
|
|
17
|
-
const { onSave,
|
|
18
|
-
'onCancel',
|
|
17
|
+
const { onSave, getContext, onCancelEvent } = assertOptions(options, [
|
|
19
18
|
'onSave',
|
|
20
19
|
'onCancelEvent',
|
|
21
|
-
'getHasPendingContextChanges',
|
|
22
20
|
'getContext',
|
|
23
21
|
]);
|
|
24
22
|
this.saveHandler = onSave;
|
|
25
|
-
this.cancelHandler = onCancel;
|
|
26
23
|
this.cancelEventHandler = onCancelEvent;
|
|
27
|
-
this.getHasPendingContextChanges = getHasPendingContextChanges;
|
|
28
24
|
this.getContext = getContext;
|
|
29
25
|
this.cardVc = this.CardVc();
|
|
30
26
|
this.optionallyDropInCancelButton();
|
|
@@ -32,17 +28,12 @@ class EventControlsCardViewController extends AbstractViewController {
|
|
|
32
28
|
CardVc() {
|
|
33
29
|
return this.Controller('card', {
|
|
34
30
|
footer: {
|
|
35
|
-
isEnabled:
|
|
31
|
+
isEnabled: true,
|
|
36
32
|
isBusy: false,
|
|
37
33
|
buttons: [
|
|
38
|
-
{
|
|
39
|
-
id: 'cancel',
|
|
40
|
-
label: 'Undo Last Changes',
|
|
41
|
-
onClick: this.handleClickCancel.bind(this),
|
|
42
|
-
},
|
|
43
34
|
{
|
|
44
35
|
id: 'save',
|
|
45
|
-
label: '
|
|
36
|
+
label: 'Done',
|
|
46
37
|
type: 'primary',
|
|
47
38
|
onClick: this.handleClickSave.bind(this),
|
|
48
39
|
},
|
|
@@ -50,18 +41,11 @@ class EventControlsCardViewController extends AbstractViewController {
|
|
|
50
41
|
},
|
|
51
42
|
});
|
|
52
43
|
}
|
|
53
|
-
handleClickCancel() {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
yield this.cancelHandler();
|
|
56
|
-
this.cardVc.disableFooter();
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
44
|
handleClickSave() {
|
|
60
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
46
|
this.cardVc.setFooterIsBusy(true);
|
|
62
47
|
yield this.saveHandler();
|
|
63
48
|
this.cardVc.setFooterIsBusy(false);
|
|
64
|
-
this.cardVc.disableFooter();
|
|
65
49
|
});
|
|
66
50
|
}
|
|
67
51
|
lockEnabled() {
|
|
@@ -76,17 +60,8 @@ class EventControlsCardViewController extends AbstractViewController {
|
|
|
76
60
|
return this.isEnableLocked;
|
|
77
61
|
}
|
|
78
62
|
handleUpdateContext() {
|
|
79
|
-
if (this.shouldFooterBeEnabled()) {
|
|
80
|
-
this.cardVc.enableFooter();
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.cardVc.disableFooter();
|
|
84
|
-
}
|
|
85
63
|
this.optionallyDropInCancelButton();
|
|
86
64
|
}
|
|
87
|
-
shouldFooterBeEnabled() {
|
|
88
|
-
return this.getHasPendingContextChanges() || this.isEnableLocked;
|
|
89
|
-
}
|
|
90
65
|
optionallyDropInCancelButton() {
|
|
91
66
|
var _a;
|
|
92
67
|
const { event } = this.getContext();
|
|
@@ -421,7 +421,7 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
|
|
|
421
421
|
catch (err) {
|
|
422
422
|
if ((options === null || options === void 0 ? void 0 : options.shouldRenderAlertOnFail) === false) {
|
|
423
423
|
this.toast({
|
|
424
|
-
message: 'Updating your calendar failed! Trying
|
|
424
|
+
message: 'Updating your calendar failed! Trying to connect...',
|
|
425
425
|
});
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
@@ -4,20 +4,16 @@ export default class EventControlsCardViewController extends AbstractViewControl
|
|
|
4
4
|
static id: string;
|
|
5
5
|
private cardVc;
|
|
6
6
|
private saveHandler;
|
|
7
|
-
private cancelHandler;
|
|
8
|
-
private getHasPendingContextChanges;
|
|
9
7
|
private getContext;
|
|
10
8
|
private cancelEventHandler;
|
|
11
9
|
private isEnableLocked;
|
|
12
10
|
constructor(options: ViewControllerOptions & EventControlsCardOptions);
|
|
13
11
|
private CardVc;
|
|
14
|
-
private handleClickCancel;
|
|
15
12
|
private handleClickSave;
|
|
16
13
|
lockEnabled(): void;
|
|
17
14
|
unlockEnabled(): void;
|
|
18
15
|
getIsEnableLocked(): boolean;
|
|
19
16
|
handleUpdateContext(): void;
|
|
20
|
-
private shouldFooterBeEnabled;
|
|
21
17
|
private optionallyDropInCancelButton;
|
|
22
18
|
render(): import("@sprucelabs/heartwood-view-controllers").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
|
23
19
|
}
|
|
@@ -10,17 +10,13 @@ class EventControlsCardViewController extends heartwood_view_controllers_1.Abstr
|
|
|
10
10
|
constructor(options) {
|
|
11
11
|
super(options);
|
|
12
12
|
this.isEnableLocked = false;
|
|
13
|
-
const { onSave,
|
|
14
|
-
'onCancel',
|
|
13
|
+
const { onSave, getContext, onCancelEvent } = (0, schema_1.assertOptions)(options, [
|
|
15
14
|
'onSave',
|
|
16
15
|
'onCancelEvent',
|
|
17
|
-
'getHasPendingContextChanges',
|
|
18
16
|
'getContext',
|
|
19
17
|
]);
|
|
20
18
|
this.saveHandler = onSave;
|
|
21
|
-
this.cancelHandler = onCancel;
|
|
22
19
|
this.cancelEventHandler = onCancelEvent;
|
|
23
|
-
this.getHasPendingContextChanges = getHasPendingContextChanges;
|
|
24
20
|
this.getContext = getContext;
|
|
25
21
|
this.cardVc = this.CardVc();
|
|
26
22
|
this.optionallyDropInCancelButton();
|
|
@@ -28,17 +24,12 @@ class EventControlsCardViewController extends heartwood_view_controllers_1.Abstr
|
|
|
28
24
|
CardVc() {
|
|
29
25
|
return this.Controller('card', {
|
|
30
26
|
footer: {
|
|
31
|
-
isEnabled:
|
|
27
|
+
isEnabled: true,
|
|
32
28
|
isBusy: false,
|
|
33
29
|
buttons: [
|
|
34
|
-
{
|
|
35
|
-
id: 'cancel',
|
|
36
|
-
label: 'Undo Last Changes',
|
|
37
|
-
onClick: this.handleClickCancel.bind(this),
|
|
38
|
-
},
|
|
39
30
|
{
|
|
40
31
|
id: 'save',
|
|
41
|
-
label: '
|
|
32
|
+
label: 'Done',
|
|
42
33
|
type: 'primary',
|
|
43
34
|
onClick: this.handleClickSave.bind(this),
|
|
44
35
|
},
|
|
@@ -46,15 +37,10 @@ class EventControlsCardViewController extends heartwood_view_controllers_1.Abstr
|
|
|
46
37
|
},
|
|
47
38
|
});
|
|
48
39
|
}
|
|
49
|
-
async handleClickCancel() {
|
|
50
|
-
await this.cancelHandler();
|
|
51
|
-
this.cardVc.disableFooter();
|
|
52
|
-
}
|
|
53
40
|
async handleClickSave() {
|
|
54
41
|
this.cardVc.setFooterIsBusy(true);
|
|
55
42
|
await this.saveHandler();
|
|
56
43
|
this.cardVc.setFooterIsBusy(false);
|
|
57
|
-
this.cardVc.disableFooter();
|
|
58
44
|
}
|
|
59
45
|
lockEnabled() {
|
|
60
46
|
this.isEnableLocked = true;
|
|
@@ -68,17 +54,8 @@ class EventControlsCardViewController extends heartwood_view_controllers_1.Abstr
|
|
|
68
54
|
return this.isEnableLocked;
|
|
69
55
|
}
|
|
70
56
|
handleUpdateContext() {
|
|
71
|
-
if (this.shouldFooterBeEnabled()) {
|
|
72
|
-
this.cardVc.enableFooter();
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.cardVc.disableFooter();
|
|
76
|
-
}
|
|
77
57
|
this.optionallyDropInCancelButton();
|
|
78
58
|
}
|
|
79
|
-
shouldFooterBeEnabled() {
|
|
80
|
-
return this.getHasPendingContextChanges() || this.isEnableLocked;
|
|
81
|
-
}
|
|
82
59
|
optionallyDropInCancelButton() {
|
|
83
60
|
var _a;
|
|
84
61
|
const { event } = this.getContext();
|