mvvm-mobx 1.1.0 → 1.1.1
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.
|
@@ -3,22 +3,22 @@ import { InteractionResponse } from "./InteractionResponse";
|
|
|
3
3
|
export declare class CommonInteractionResponses {
|
|
4
4
|
static readonly ok: {
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
6
|
+
response: InteractionResponse;
|
|
7
7
|
};
|
|
8
8
|
static readonly cancel: {
|
|
9
9
|
id: string;
|
|
10
|
-
|
|
10
|
+
response: InteractionResponse;
|
|
11
11
|
};
|
|
12
12
|
static readonly close: {
|
|
13
13
|
id: string;
|
|
14
|
-
|
|
14
|
+
response: InteractionResponse;
|
|
15
15
|
};
|
|
16
16
|
static readonly yes: {
|
|
17
17
|
id: string;
|
|
18
|
-
|
|
18
|
+
response: InteractionResponse;
|
|
19
19
|
};
|
|
20
20
|
static readonly no: {
|
|
21
21
|
id: string;
|
|
22
|
-
|
|
22
|
+
response: InteractionResponse;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -6,8 +6,8 @@ const InteractionResponse_1 = require("./InteractionResponse");
|
|
|
6
6
|
class CommonInteractionResponses {
|
|
7
7
|
}
|
|
8
8
|
exports.CommonInteractionResponses = CommonInteractionResponses;
|
|
9
|
-
CommonInteractionResponses.ok = { id: 'ok',
|
|
10
|
-
CommonInteractionResponses.cancel = { id: 'cancel',
|
|
11
|
-
CommonInteractionResponses.close = { id: 'close',
|
|
12
|
-
CommonInteractionResponses.yes = { id: 'yes',
|
|
13
|
-
CommonInteractionResponses.no = { id: 'no',
|
|
9
|
+
CommonInteractionResponses.ok = { id: 'ok', response: new InteractionResponse_1.InteractionResponse('ok', 'OK') };
|
|
10
|
+
CommonInteractionResponses.cancel = { id: 'cancel', response: new InteractionResponse_1.InteractionResponse('cancel', 'Cancel') };
|
|
11
|
+
CommonInteractionResponses.close = { id: 'close', response: new InteractionResponse_1.InteractionResponse('close', 'Close') };
|
|
12
|
+
CommonInteractionResponses.yes = { id: 'yes', response: new InteractionResponse_1.InteractionResponse('yes', 'Yes') };
|
|
13
|
+
CommonInteractionResponses.no = { id: 'no', response: new InteractionResponse_1.InteractionResponse('no', 'No') };
|
|
@@ -14,7 +14,7 @@ class Interact {
|
|
|
14
14
|
* @returns true if @constant CommonInteractionResponses.Ok.id was selected, or false if @constant CommonInteractionResponses.Cancel.id was selected.
|
|
15
15
|
*/
|
|
16
16
|
static async withOkCancel(interactionManager, title, content) {
|
|
17
|
-
return await this.withCustomAndCancel(interactionManager, title, content, CommonInteractionResponses_1.CommonInteractionResponses.ok.
|
|
17
|
+
return await this.withCustomAndCancel(interactionManager, title, content, CommonInteractionResponses_1.CommonInteractionResponses.ok.response);
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Interact with the user with a default OK action.
|
|
@@ -27,7 +27,7 @@ class Interact {
|
|
|
27
27
|
return (await interactionManager.requestInteraction({
|
|
28
28
|
title,
|
|
29
29
|
content,
|
|
30
|
-
responses: [CommonInteractionResponses_1.CommonInteractionResponses.ok.
|
|
30
|
+
responses: [CommonInteractionResponses_1.CommonInteractionResponses.ok.response],
|
|
31
31
|
defaultActionId: CommonInteractionResponses_1.CommonInteractionResponses.ok.id,
|
|
32
32
|
})) === CommonInteractionResponses_1.CommonInteractionResponses.ok.id;
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@ class Interact {
|
|
|
40
40
|
* @returns true if @constant CommonInteractionResponses.Ok.id was selected, or false if @constant CommonInteractionResponses.Cancel.id was selected.
|
|
41
41
|
*/
|
|
42
42
|
static async withOkCommand(interactionManager, title, content, okCommand) {
|
|
43
|
-
return await this.withCustomAndCancel(interactionManager, title, content, new InteractionResponse_1.InteractionResponse(CommonInteractionResponses_1.CommonInteractionResponses.ok.id, CommonInteractionResponses_1.CommonInteractionResponses.ok.
|
|
43
|
+
return await this.withCustomAndCancel(interactionManager, title, content, new InteractionResponse_1.InteractionResponse(CommonInteractionResponses_1.CommonInteractionResponses.ok.id, CommonInteractionResponses_1.CommonInteractionResponses.ok.response.title, okCommand));
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Interact with the user with default Yes and No responses.
|
|
@@ -53,7 +53,7 @@ class Interact {
|
|
|
53
53
|
return (await interactionManager.requestInteraction({
|
|
54
54
|
title,
|
|
55
55
|
content,
|
|
56
|
-
responses: [CommonInteractionResponses_1.CommonInteractionResponses.yes.
|
|
56
|
+
responses: [CommonInteractionResponses_1.CommonInteractionResponses.yes.response, CommonInteractionResponses_1.CommonInteractionResponses.no.response],
|
|
57
57
|
defaultActionId: CommonInteractionResponses_1.CommonInteractionResponses.yes.id,
|
|
58
58
|
cancelActionId: CommonInteractionResponses_1.CommonInteractionResponses.no.id,
|
|
59
59
|
})) === CommonInteractionResponses_1.CommonInteractionResponses.yes.id;
|
|
@@ -75,7 +75,7 @@ class Interact {
|
|
|
75
75
|
content,
|
|
76
76
|
responses: [
|
|
77
77
|
action,
|
|
78
|
-
new InteractionResponse_1.InteractionResponse(CommonInteractionResponses_1.CommonInteractionResponses.cancel.id, CommonInteractionResponses_1.CommonInteractionResponses.cancel.
|
|
78
|
+
new InteractionResponse_1.InteractionResponse(CommonInteractionResponses_1.CommonInteractionResponses.cancel.id, CommonInteractionResponses_1.CommonInteractionResponses.cancel.response.title,
|
|
79
79
|
// A Cancel action that becomes disabled when the OK command (if exists) is active:
|
|
80
80
|
new RelayCommand_1.RelayCommand(() => content?.onOperationFinished?.call(CommonInteractionResponses_1.CommonInteractionResponses.cancel.id), () => action.command?.workingFlag?.isActive !== true)),
|
|
81
81
|
],
|