evmux-app-framework 0.0.42 → 0.0.43
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/package.json
CHANGED
|
@@ -27,7 +27,8 @@ export const availableRequests = {
|
|
|
27
27
|
listScenes: "listScenes",
|
|
28
28
|
switchScene: "switchScene",
|
|
29
29
|
removeSizeCatcher: "removeSizeCatcher",
|
|
30
|
-
openSideBarSettings: "openSideBarSettings"
|
|
30
|
+
openSideBarSettings: "openSideBarSettings",
|
|
31
|
+
displayDateTimePicker: "displayDateTimePicker"
|
|
31
32
|
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -6,6 +6,7 @@ import EvmuxAppsApiApps from './EvmuxAppsApiApps.js'
|
|
|
6
6
|
|
|
7
7
|
import { availableRequests } from '../AppsObserver/AppsObserver.js'
|
|
8
8
|
import EvmuxAppsApiSocial from "./EvmuxAppsApiSocial";
|
|
9
|
+
import EvmuxAppsApiModules from "./EvmuxAppsApiModules";
|
|
9
10
|
|
|
10
11
|
export const availableEvents = {
|
|
11
12
|
settingsUpdated: "settingsUpdated",
|
|
@@ -55,6 +56,7 @@ export default class EvmuxAppsApi {
|
|
|
55
56
|
this.social = new EvmuxAppsApiSocial(this, this.comments)
|
|
56
57
|
this.scene = new EvmuxAppsApiScene(this);
|
|
57
58
|
this.apps = new EvmuxAppsApiApps(this);
|
|
59
|
+
this.modules = new EvmuxAppsApiModules(this);
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
async registerEvent(eventName, callback)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {availableRequests} from "../AppsObserver/AppsObserver";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default class EvmuxAppsApiModules {
|
|
5
|
+
|
|
6
|
+
constructor(evmuxAppsApi) {
|
|
7
|
+
this.evmuxAppsApi = evmuxAppsApi;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async displayDateTimePicker(
|
|
11
|
+
type = 'datetime', // 'date', 'time'
|
|
12
|
+
currentValue = new Date().getTime(),
|
|
13
|
+
timezone = Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
14
|
+
minDate = new Date().getTime(),
|
|
15
|
+
maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 1)).getTime(),
|
|
16
|
+
dateTimeKey = 'result'
|
|
17
|
+
) {
|
|
18
|
+
|
|
19
|
+
let reqObj = {
|
|
20
|
+
request: availableRequests.displayDateTimePicker,
|
|
21
|
+
userAppInstanceId: this.evmuxAppsApi._userAppInstanceId,
|
|
22
|
+
componentId: this.evmuxAppsApi._componentId,
|
|
23
|
+
data: {
|
|
24
|
+
type,
|
|
25
|
+
currentValue,
|
|
26
|
+
timezone,
|
|
27
|
+
minDate,
|
|
28
|
+
maxDate,
|
|
29
|
+
dateTimeKey
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return this.evmuxAppsApi._postMessageManager.sendRequestAsync(reqObj);
|
|
33
|
+
}
|
|
34
|
+
}
|