chayns-api 1.0.58 → 1.1.0-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.
- package/.babelrc +30 -30
- package/.eslintrc +17 -17
- package/.github/workflows/deploy_docs.yml +28 -28
- package/.github/workflows/publish.yml +21 -21
- package/LICENSE +21 -21
- package/README.md +54 -54
- package/dist/cjs/calls/dialogs/date.js +34 -34
- package/dist/cjs/calls/index.js +106 -106
- package/dist/cjs/calls/sendMessage.js +8 -8
- package/dist/cjs/calls/visibilityChangeListener.js +4 -4
- package/dist/cjs/components/withHydrationBoundary.js +57 -0
- package/dist/cjs/constants/hydrationContext.js +16 -0
- package/dist/cjs/constants/index.js +16 -0
- package/dist/cjs/hooks/geoLocationListener.js +4 -4
- package/dist/cjs/hooks/scrollListener.js +8 -8
- package/dist/cjs/hooks/useAccessToken.js +3 -3
- package/dist/cjs/hooks/useCurrentPage.js +2 -2
- package/dist/cjs/hooks/useCustomData.js +2 -2
- package/dist/cjs/hooks/useDevice.js +2 -2
- package/dist/cjs/hooks/useDialogState.js +4 -4
- package/dist/cjs/hooks/useEnvironment.js +2 -2
- package/dist/cjs/hooks/useFunctions.js +2 -2
- package/dist/cjs/hooks/useIsAdminMode.js +2 -2
- package/dist/cjs/hooks/useLanguage.js +2 -2
- package/dist/cjs/hooks/usePages.js +4 -4
- package/dist/cjs/hooks/useParameters.js +2 -2
- package/dist/cjs/hooks/useSite.js +2 -2
- package/dist/cjs/hooks/useUser.js +2 -2
- package/dist/cjs/hooks/useValues.js +2 -2
- package/dist/cjs/hooks/windowMetricsListener.js +4 -4
- package/dist/cjs/host/module/ModuleHost.js +3 -19
- package/dist/cjs/host/module/utils/loadComponent.js +46 -53
- package/dist/cjs/host/module/utils/useDynamicScript.js +6 -4
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/types/IChaynsReact.js +4 -4
- package/dist/esm/calls/dialogs/date.js +34 -34
- package/dist/esm/calls/index.js +106 -106
- package/dist/esm/calls/sendMessage.js +8 -8
- package/dist/esm/calls/visibilityChangeListener.js +4 -4
- package/dist/esm/components/withHydrationBoundary.js +50 -0
- package/dist/esm/constants/hydrationContext.js +10 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/hooks/geoLocationListener.js +4 -4
- package/dist/esm/hooks/scrollListener.js +8 -8
- package/dist/esm/hooks/useAccessToken.js +3 -3
- package/dist/esm/hooks/useCurrentPage.js +2 -2
- package/dist/esm/hooks/useCustomData.js +2 -2
- package/dist/esm/hooks/useDevice.js +2 -2
- package/dist/esm/hooks/useDialogState.js +4 -4
- package/dist/esm/hooks/useEnvironment.js +2 -2
- package/dist/esm/hooks/useFunctions.js +2 -2
- package/dist/esm/hooks/useIsAdminMode.js +2 -2
- package/dist/esm/hooks/useLanguage.js +2 -2
- package/dist/esm/hooks/usePages.js +4 -4
- package/dist/esm/hooks/useParameters.js +2 -2
- package/dist/esm/hooks/useSite.js +2 -2
- package/dist/esm/hooks/useUser.js +2 -2
- package/dist/esm/hooks/useValues.js +2 -2
- package/dist/esm/hooks/windowMetricsListener.js +4 -4
- package/dist/esm/host/module/ModuleHost.js +3 -19
- package/dist/esm/host/module/utils/loadComponent.js +46 -53
- package/dist/esm/index.js +2 -0
- package/dist/esm/types/IChaynsReact.js +4 -4
- package/dist/types/calls/dialogs/alert.d.ts +1 -1
- package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
- package/dist/types/calls/dialogs/close.d.ts +1 -1
- package/dist/types/calls/dialogs/communication.d.ts +3 -3
- package/dist/types/calls/dialogs/confirm.d.ts +13 -13
- package/dist/types/calls/dialogs/date.d.ts +96 -96
- package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
- package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
- package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
- package/dist/types/calls/dialogs/index.d.ts +14 -14
- package/dist/types/calls/dialogs/input.d.ts +15 -15
- package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
- package/dist/types/calls/dialogs/open.d.ts +1 -1
- package/dist/types/calls/dialogs/select.d.ts +6 -6
- package/dist/types/calls/dialogs/signature.d.ts +7 -7
- package/dist/types/calls/dialogs/toast.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
- package/dist/types/calls/getUserInfo.d.ts +9 -9
- package/dist/types/calls/index.d.ts +251 -255
- package/dist/types/calls/sendMessage.d.ts +13 -13
- package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
- package/dist/types/components/AppDialogWrapper.d.ts +5 -5
- package/dist/types/components/ChaynsContext.d.ts +3 -3
- package/dist/types/components/ChaynsProvider.d.ts +11 -11
- package/dist/types/components/ErrorBoundary.d.ts +13 -13
- package/dist/types/components/WaitUntil.d.ts +7 -7
- package/dist/types/components/moduleWrapper.d.ts +4 -4
- package/dist/types/components/withCompatMode.d.ts +13 -13
- package/dist/types/components/withHydrationBoundary.d.ts +16 -0
- package/dist/types/constants/hydrationContext.d.ts +8 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/handler/DialogHandler.d.ts +18 -18
- package/dist/types/helper/apiListenerHelper.d.ts +6 -6
- package/dist/types/hooks/geoLocationListener.d.ts +18 -18
- package/dist/types/hooks/index.d.ts +17 -17
- package/dist/types/hooks/scrollListener.d.ts +28 -28
- package/dist/types/hooks/useAccessToken.d.ts +6 -6
- package/dist/types/hooks/useCurrentPage.d.ts +4 -4
- package/dist/types/hooks/useCustomData.d.ts +4 -4
- package/dist/types/hooks/useDevice.d.ts +5 -5
- package/dist/types/hooks/useDialogState.d.ts +9 -9
- package/dist/types/hooks/useEnvironment.d.ts +5 -5
- package/dist/types/hooks/useFunctions.d.ts +5 -5
- package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
- package/dist/types/hooks/useLanguage.d.ts +5 -5
- package/dist/types/hooks/usePages.d.ts +18 -18
- package/dist/types/hooks/useParameters.d.ts +5 -5
- package/dist/types/hooks/useSite.d.ts +5 -5
- package/dist/types/hooks/useUser.d.ts +5 -5
- package/dist/types/hooks/useValues.d.ts +5 -5
- package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
- package/dist/types/host/ChaynsHost.d.ts +30 -30
- package/dist/types/host/iframe/HostIframe.d.ts +26 -26
- package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
- package/dist/types/host/module/ModuleHost.d.ts +27 -27
- package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
- package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -9
- package/dist/types/index.d.ts +21 -19
- package/dist/types/types/IChaynsReact.d.ts +816 -816
- package/dist/types/types/dialog.d.ts +41 -41
- package/dist/types/util/appCall.d.ts +2 -2
- package/dist/types/util/deviceHelper.d.ts +7 -7
- package/dist/types/util/heightHelper.d.ts +1 -1
- package/dist/types/util/postIframeForm.d.ts +1 -1
- package/dist/types/util/transferNestedFunctions.d.ts +1 -1
- package/dist/types/util/url.d.ts +1 -1
- package/dist/types/wrapper/AppWrapper.d.ts +22 -22
- package/dist/types/wrapper/FrameWrapper.d.ts +15 -15
- package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -10
- package/dist/types/wrapper/SsrWrapper.d.ts +11 -11
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -9
- package/package.json +79 -78
- package/toolkit.config.js +20 -20
- package/tsconfig.json +56 -56
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from "use-context-selector";
|
|
2
2
|
import { ChaynsFunctionsContext } from "../components/ChaynsContext";
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useFunctions = () => {
|
|
7
7
|
const t = useContextSelector(ChaynsFunctionsContext, f => f || {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useLanguage = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.language);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
3
|
import { moduleWrapper } from '../components/moduleWrapper';
|
|
4
|
-
/**
|
|
5
|
-
* @category Hooks
|
|
4
|
+
/**
|
|
5
|
+
* @category Hooks
|
|
6
6
|
*/
|
|
7
7
|
export const usePages = function () {
|
|
8
8
|
let {
|
|
@@ -16,8 +16,8 @@ export const usePages = function () {
|
|
|
16
16
|
}
|
|
17
17
|
return pages;
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
* @category Hooks
|
|
19
|
+
/**
|
|
20
|
+
* @category Hooks
|
|
21
21
|
*/
|
|
22
22
|
export const usePage = _ref => {
|
|
23
23
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useParameters = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.parameters) || []);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useSite = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.site);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useUser = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useValues = () => {
|
|
7
7
|
const t = useContextSelector(ChaynsContext, v => v || {});
|
|
@@ -2,8 +2,8 @@ import { useContextSelector } from 'use-context-selector';
|
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChaynsFunctionsContext } from '../components/ChaynsContext';
|
|
4
4
|
import { ScreenSize } from '../types/IChaynsReact';
|
|
5
|
-
/**
|
|
6
|
-
* @category Hooks
|
|
5
|
+
/**
|
|
6
|
+
* @category Hooks
|
|
7
7
|
*/
|
|
8
8
|
export const useWindowMetricsListener = () => {
|
|
9
9
|
const addListener = useContextSelector(ChaynsFunctionsContext, v => v.addWindowMetricsListener);
|
|
@@ -18,8 +18,8 @@ export const useWindowMetricsListener = () => {
|
|
|
18
18
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
19
|
}, []);
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
* @category Hooks
|
|
21
|
+
/**
|
|
22
|
+
* @category Hooks
|
|
23
23
|
*/
|
|
24
24
|
export const useWindowMetrics = function () {
|
|
25
25
|
let {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import useDynamicScript from './utils/useDynamicScript';
|
|
3
2
|
import loadComponent from './utils/loadComponent';
|
|
4
3
|
import { replaceStagingUrl } from "../../util/url";
|
|
5
4
|
const System = _ref => {
|
|
@@ -8,25 +7,10 @@ const System = _ref => {
|
|
|
8
7
|
fallback,
|
|
9
8
|
...props
|
|
10
9
|
} = _ref;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
failed
|
|
14
|
-
} = useDynamicScript({
|
|
15
|
-
url: system === null || system === void 0 ? void 0 : system.url,
|
|
16
|
-
scope: system === null || system === void 0 ? void 0 : system.scope
|
|
17
|
-
});
|
|
18
|
-
const Component = useMemo(() => {
|
|
19
|
-
// maybe return waitcursor instead
|
|
20
|
-
if (!system || !ready || failed) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return /*#__PURE__*/React.lazy(loadComponent(system.scope, system.module, system.url, undefined, system.preventSingleton));
|
|
24
|
-
|
|
25
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
26
|
-
}, [system === null || system === void 0 ? void 0 : system.scope, ready, system === null || system === void 0 ? void 0 : system.url]);
|
|
27
|
-
return Component ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
10
|
+
const Component = useMemo(() => loadComponent(system.scope, system.module, system.url, undefined, system.preventSingleton), [system.scope, system.module, system.url, system.preventSingleton]);
|
|
11
|
+
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
28
12
|
fallback: fallback || ''
|
|
29
|
-
}, /*#__PURE__*/React.createElement(Component, props))
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Component, props));
|
|
30
14
|
};
|
|
31
15
|
const ModuleHost = _ref2 => {
|
|
32
16
|
let {
|
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
1
|
import semver from 'semver';
|
|
5
2
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { loadRemote, registerRemotes } from '@module-federation/runtime';
|
|
4
|
+
const registeredScopes = {};
|
|
5
|
+
const dynamicMap = {};
|
|
8
6
|
export default function loadComponent(scope, module, url) {
|
|
9
7
|
let skipCompatMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
10
8
|
let preventSingleton = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let ModuleMap = instances[`${scope}__${module}`];
|
|
22
|
-
let Module;
|
|
23
|
-
if (!ModuleMap) {
|
|
24
|
-
ModuleMap = {};
|
|
25
|
-
instances[`${scope}__${module}`] = ModuleMap;
|
|
26
|
-
}
|
|
27
|
-
if (Object.keys(ModuleMap).length > 0) {
|
|
28
|
-
const newModule = factory();
|
|
29
|
-
Module = ModuleMap[`${newModule.default.buildEnv}__${newModule.default.appVersion}`];
|
|
30
|
-
if (!Module) {
|
|
31
|
-
Module = newModule;
|
|
32
|
-
ModuleMap[`${newModule.default.buildEnv}__${newModule.default.appVersion}`] = newModule;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
Module = factory();
|
|
36
|
-
ModuleMap[`${Module.default.buildEnv}__${Module.default.appVersion}`] = Module;
|
|
37
|
-
}
|
|
38
|
-
if (preventSingleton) {
|
|
39
|
-
// Intercom :)
|
|
40
|
-
window[scope + "_list"] = null;
|
|
41
|
-
}
|
|
42
|
-
if (skipCompatMode) return Module;
|
|
43
|
-
const hostVersion = semver.minVersion(React.version);
|
|
44
|
-
const {
|
|
45
|
-
requiredVersion,
|
|
46
|
-
environment
|
|
47
|
-
} = Module.default;
|
|
48
|
-
const matchReactVersion = requiredVersion && semver.satisfies(hostVersion, requiredVersion) && !Object.keys(__webpack_share_scopes__.default.react).some(version => {
|
|
49
|
-
return semver.gt(version, hostVersion) && semver.satisfies(version, requiredVersion) || scope === __webpack_share_scopes__.default.react[version].from.split('-').join('_');
|
|
9
|
+
if (skipCompatMode) {
|
|
10
|
+
console.warn('[chayns-api] skipCompatMode-option is deprecated and is set automatically now');
|
|
11
|
+
}
|
|
12
|
+
if (registeredScopes[scope] !== url || preventSingleton) {
|
|
13
|
+
registerRemotes([{
|
|
14
|
+
name: scope,
|
|
15
|
+
entry: url,
|
|
16
|
+
alias: scope
|
|
17
|
+
}], {
|
|
18
|
+
force: scope in registeredScopes
|
|
50
19
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
registeredScopes[scope] = url;
|
|
21
|
+
dynamicMap[scope] = {};
|
|
22
|
+
}
|
|
23
|
+
if (!(module in dynamicMap[scope])) {
|
|
24
|
+
const path = `${scope}/${module.replace(/^\.\//, '')}`;
|
|
25
|
+
dynamicMap[scope][module] = /*#__PURE__*/React.lazy(() => {
|
|
26
|
+
return loadRemote(path).then(Module => {
|
|
27
|
+
// semantically equals skipCompatMode
|
|
28
|
+
if (typeof Module.default === 'function') {
|
|
29
|
+
return Module;
|
|
30
|
+
}
|
|
31
|
+
const hostVersion = semver.minVersion(React.version);
|
|
32
|
+
const {
|
|
33
|
+
requiredVersion,
|
|
34
|
+
environment
|
|
35
|
+
} = Module.default;
|
|
36
|
+
// @ts-expect-error
|
|
37
|
+
const webpackShareScopes = __webpack_share_scopes__.default;
|
|
38
|
+
const matchReactVersion = requiredVersion && semver.satisfies(hostVersion, requiredVersion) && !Object.keys(webpackShareScopes.react).some(version => {
|
|
39
|
+
return semver.gt(version, hostVersion) && semver.satisfies(version, requiredVersion) || scope === webpackShareScopes.react[version].from.split('-').join('_');
|
|
40
|
+
});
|
|
41
|
+
if (!matchReactVersion || environment !== 'production' || process.env.NODE_ENV === 'development') {
|
|
42
|
+
return {
|
|
43
|
+
default: Module.default.CompatComponent
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
default: Module.default.Component
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return dynamicMap[scope][module];
|
|
60
53
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export * from './hooks';
|
|
|
8
8
|
export * from './components/WaitUntil';
|
|
9
9
|
export * from './types/IChaynsReact';
|
|
10
10
|
export * from './components/withCompatMode';
|
|
11
|
+
export * from './constants';
|
|
12
|
+
export { default as withHydrationBoundary } from './components/withHydrationBoundary';
|
|
11
13
|
export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
|
|
12
14
|
export { default as DialogHandler } from './handler/DialogHandler';
|
|
13
15
|
import * as _dialog from './calls/dialogs/index';
|
|
@@ -40,12 +40,12 @@ export let ScreenSize = /*#__PURE__*/function (ScreenSize) {
|
|
|
40
40
|
return ScreenSize;
|
|
41
41
|
}({});
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* @ignore
|
|
43
|
+
/**
|
|
44
|
+
* @ignore
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* @ignore
|
|
47
|
+
/**
|
|
48
|
+
* @ignore
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
51
|
export let AccessMode = /*#__PURE__*/function (AccessMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function alert(title?: string, message?: string): Promise<any> | "unsupported";
|
|
1
|
+
export declare function alert(title?: string, message?: string): Promise<any> | "unsupported";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export declare const buttonText: {
|
|
2
|
-
YES: string;
|
|
3
|
-
NO: string;
|
|
4
|
-
OK: string;
|
|
5
|
-
CANCEL: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const buttonType: {
|
|
8
|
-
CANCEL: number;
|
|
9
|
-
NEGATIVE: number;
|
|
10
|
-
POSITIVE: number;
|
|
11
|
-
};
|
|
12
|
-
export declare const dialogAction: {
|
|
13
|
-
ALERT_CONFIRM: number;
|
|
14
|
-
INPUT: number;
|
|
15
|
-
SELECT: number;
|
|
16
|
-
DATE: number;
|
|
17
|
-
ADVANCED_DATE: number;
|
|
18
|
-
DROP_UP_ALERT: number;
|
|
19
|
-
MEDIA_SELECT: number;
|
|
20
|
-
FILE_SELECT: number;
|
|
21
|
-
SIGNATURE: number;
|
|
22
|
-
IFRAME: number;
|
|
23
|
-
};
|
|
24
|
-
export declare function chaynsDialog(config: any): Promise<any> | "unsupported";
|
|
1
|
+
export declare const buttonText: {
|
|
2
|
+
YES: string;
|
|
3
|
+
NO: string;
|
|
4
|
+
OK: string;
|
|
5
|
+
CANCEL: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const buttonType: {
|
|
8
|
+
CANCEL: number;
|
|
9
|
+
NEGATIVE: number;
|
|
10
|
+
POSITIVE: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const dialogAction: {
|
|
13
|
+
ALERT_CONFIRM: number;
|
|
14
|
+
INPUT: number;
|
|
15
|
+
SELECT: number;
|
|
16
|
+
DATE: number;
|
|
17
|
+
ADVANCED_DATE: number;
|
|
18
|
+
DROP_UP_ALERT: number;
|
|
19
|
+
MEDIA_SELECT: number;
|
|
20
|
+
FILE_SELECT: number;
|
|
21
|
+
SIGNATURE: number;
|
|
22
|
+
IFRAME: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function chaynsDialog(config: any): Promise<any> | "unsupported";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function close(): Promise<any>;
|
|
1
|
+
export declare function close(): Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function sendData(data: any, isApiEvent: any): Promise<any>;
|
|
2
|
-
export declare function addDialogDataListener(callback: any, getApiEvents?: boolean): boolean;
|
|
3
|
-
export declare function removeDialogDataListener(callback: any, getApiEvents?: boolean): boolean;
|
|
1
|
+
export declare function sendData(data: any, isApiEvent: any): Promise<any>;
|
|
2
|
+
export declare function addDialogDataListener(callback: any, getApiEvents?: boolean): boolean;
|
|
3
|
+
export declare function removeDialogDataListener(callback: any, getApiEvents?: boolean): boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
-
type Confirm = {
|
|
3
|
-
headline?: string;
|
|
4
|
-
text?: string;
|
|
5
|
-
buttons?: DialogButtonOld[] | {
|
|
6
|
-
buttons?: DialogButtonOld[];
|
|
7
|
-
links?: DialogButtonOld[];
|
|
8
|
-
};
|
|
9
|
-
links?: unknown;
|
|
10
|
-
select?: unknown;
|
|
11
|
-
};
|
|
12
|
-
export declare function confirm(title?: string, message?: string, config?: Confirm): Promise<any> | "unsupported";
|
|
13
|
-
export {};
|
|
1
|
+
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
+
type Confirm = {
|
|
3
|
+
headline?: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
buttons?: DialogButtonOld[] | {
|
|
6
|
+
buttons?: DialogButtonOld[];
|
|
7
|
+
links?: DialogButtonOld[];
|
|
8
|
+
};
|
|
9
|
+
links?: unknown;
|
|
10
|
+
select?: unknown;
|
|
11
|
+
};
|
|
12
|
+
export declare function confirm(title?: string, message?: string, config?: Confirm): Promise<any> | "unsupported";
|
|
13
|
+
export {};
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { DialogButtonOld, DialogTextBlock, IntervalItem, WeekDayIntervalObject } from "../../types/dialog";
|
|
2
|
-
/**
|
|
3
|
-
* The config object for date dialog
|
|
4
|
-
* @typedef {Object} dateConfig
|
|
5
|
-
* @property {Date} preSelect - The date object which should be preselected.
|
|
6
|
-
* @property {Date} minDate - The min date which you could select.
|
|
7
|
-
* @property {Date} maxDate - The max date which you could select.
|
|
8
|
-
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
9
|
-
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
10
|
-
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
11
|
-
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* This call will open a date select dialog.
|
|
15
|
-
* <div>Call: 30</div>
|
|
16
|
-
* @param {dateConfig} config - Define the configuration of this call
|
|
17
|
-
* @return {Promise} contains a timestamp as result
|
|
18
|
-
* @example chayns.dialog.date({
|
|
19
|
-
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
20
|
-
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
21
|
-
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
22
|
-
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
23
|
-
* 'minuteInterval': 15
|
|
24
|
-
* ).then(function (data) {
|
|
25
|
-
* console.log(data);
|
|
26
|
-
* });
|
|
27
|
-
*/
|
|
28
|
-
type DateConfig = {
|
|
29
|
-
title?: string;
|
|
30
|
-
message?: string;
|
|
31
|
-
buttons?: DialogButtonOld[];
|
|
32
|
-
minDate?: Date | number;
|
|
33
|
-
maxDate?: Date | number;
|
|
34
|
-
minuteInterval?: number;
|
|
35
|
-
preSelect?: Date | undefined | number;
|
|
36
|
-
multiselect?: boolean;
|
|
37
|
-
disabledDates?: Date[] | number[];
|
|
38
|
-
textBlocks?: DialogTextBlock[];
|
|
39
|
-
yearSelect?: boolean;
|
|
40
|
-
monthSelect?: boolean;
|
|
41
|
-
interval?: boolean;
|
|
42
|
-
minInterval?: number;
|
|
43
|
-
maxInterval?: number;
|
|
44
|
-
disabledIntervals?: Array<IntervalItem>;
|
|
45
|
-
disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
|
|
46
|
-
getLocalTime?: boolean;
|
|
47
|
-
dateType?: number;
|
|
48
|
-
autoSelectDate?: boolean;
|
|
49
|
-
};
|
|
50
|
-
export declare function date(config?: DateConfig): Promise<any>;
|
|
51
|
-
type preSelectObj = {
|
|
52
|
-
start?: number | undefined | Date;
|
|
53
|
-
end?: number | undefined | Date;
|
|
54
|
-
};
|
|
55
|
-
type preSelect = preSelectObj | Date | undefined | number | number[];
|
|
56
|
-
type AdvancedDateConfig = {
|
|
57
|
-
title?: string;
|
|
58
|
-
message?: string;
|
|
59
|
-
buttons?: DialogButtonOld[];
|
|
60
|
-
minDate?: Date | number;
|
|
61
|
-
maxDate?: Date | number;
|
|
62
|
-
minuteInterval?: number;
|
|
63
|
-
preSelect?: preSelect;
|
|
64
|
-
multiselect?: boolean;
|
|
65
|
-
disabledDates?: Date[] | number[];
|
|
66
|
-
textBlocks?: DialogTextBlock[];
|
|
67
|
-
yearSelect?: boolean;
|
|
68
|
-
monthSelect?: boolean;
|
|
69
|
-
interval?: boolean;
|
|
70
|
-
minInterval?: number;
|
|
71
|
-
maxInterval?: number;
|
|
72
|
-
disabledIntervals?: Array<IntervalItem>;
|
|
73
|
-
disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
|
|
74
|
-
getLocalTime?: boolean;
|
|
75
|
-
dateType?: number;
|
|
76
|
-
autoSelectDate?: boolean;
|
|
77
|
-
};
|
|
78
|
-
export declare function advancedDate(config?: AdvancedDateConfig): Promise<unknown>;
|
|
79
|
-
/**
|
|
80
|
-
* @typedef {number} dateDialogType
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* Enum for date dialog
|
|
84
|
-
* <div>DATE will open a dialog where you can select a special day</div>
|
|
85
|
-
* <div>TIME will open a dialog where you can only select a special time</div>
|
|
86
|
-
* <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
|
|
87
|
-
* @readonly
|
|
88
|
-
* @enum {dateDialogType}
|
|
89
|
-
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
90
|
-
*/
|
|
91
|
-
export declare const dateType: {
|
|
92
|
-
DATE: number;
|
|
93
|
-
TIME: number;
|
|
94
|
-
DATE_TIME: number;
|
|
95
|
-
};
|
|
96
|
-
export {};
|
|
1
|
+
import { DialogButtonOld, DialogTextBlock, IntervalItem, WeekDayIntervalObject } from "../../types/dialog";
|
|
2
|
+
/**
|
|
3
|
+
* The config object for date dialog
|
|
4
|
+
* @typedef {Object} dateConfig
|
|
5
|
+
* @property {Date} preSelect - The date object which should be preselected.
|
|
6
|
+
* @property {Date} minDate - The min date which you could select.
|
|
7
|
+
* @property {Date} maxDate - The max date which you could select.
|
|
8
|
+
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
9
|
+
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
10
|
+
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
11
|
+
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* This call will open a date select dialog.
|
|
15
|
+
* <div>Call: 30</div>
|
|
16
|
+
* @param {dateConfig} config - Define the configuration of this call
|
|
17
|
+
* @return {Promise} contains a timestamp as result
|
|
18
|
+
* @example chayns.dialog.date({
|
|
19
|
+
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
20
|
+
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
21
|
+
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
22
|
+
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
23
|
+
* 'minuteInterval': 15
|
|
24
|
+
* ).then(function (data) {
|
|
25
|
+
* console.log(data);
|
|
26
|
+
* });
|
|
27
|
+
*/
|
|
28
|
+
type DateConfig = {
|
|
29
|
+
title?: string;
|
|
30
|
+
message?: string;
|
|
31
|
+
buttons?: DialogButtonOld[];
|
|
32
|
+
minDate?: Date | number;
|
|
33
|
+
maxDate?: Date | number;
|
|
34
|
+
minuteInterval?: number;
|
|
35
|
+
preSelect?: Date | undefined | number;
|
|
36
|
+
multiselect?: boolean;
|
|
37
|
+
disabledDates?: Date[] | number[];
|
|
38
|
+
textBlocks?: DialogTextBlock[];
|
|
39
|
+
yearSelect?: boolean;
|
|
40
|
+
monthSelect?: boolean;
|
|
41
|
+
interval?: boolean;
|
|
42
|
+
minInterval?: number;
|
|
43
|
+
maxInterval?: number;
|
|
44
|
+
disabledIntervals?: Array<IntervalItem>;
|
|
45
|
+
disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
|
|
46
|
+
getLocalTime?: boolean;
|
|
47
|
+
dateType?: number;
|
|
48
|
+
autoSelectDate?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare function date(config?: DateConfig): Promise<any>;
|
|
51
|
+
type preSelectObj = {
|
|
52
|
+
start?: number | undefined | Date;
|
|
53
|
+
end?: number | undefined | Date;
|
|
54
|
+
};
|
|
55
|
+
type preSelect = preSelectObj | Date | undefined | number | number[];
|
|
56
|
+
type AdvancedDateConfig = {
|
|
57
|
+
title?: string;
|
|
58
|
+
message?: string;
|
|
59
|
+
buttons?: DialogButtonOld[];
|
|
60
|
+
minDate?: Date | number;
|
|
61
|
+
maxDate?: Date | number;
|
|
62
|
+
minuteInterval?: number;
|
|
63
|
+
preSelect?: preSelect;
|
|
64
|
+
multiselect?: boolean;
|
|
65
|
+
disabledDates?: Date[] | number[];
|
|
66
|
+
textBlocks?: DialogTextBlock[];
|
|
67
|
+
yearSelect?: boolean;
|
|
68
|
+
monthSelect?: boolean;
|
|
69
|
+
interval?: boolean;
|
|
70
|
+
minInterval?: number;
|
|
71
|
+
maxInterval?: number;
|
|
72
|
+
disabledIntervals?: Array<IntervalItem>;
|
|
73
|
+
disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
|
|
74
|
+
getLocalTime?: boolean;
|
|
75
|
+
dateType?: number;
|
|
76
|
+
autoSelectDate?: boolean;
|
|
77
|
+
};
|
|
78
|
+
export declare function advancedDate(config?: AdvancedDateConfig): Promise<unknown>;
|
|
79
|
+
/**
|
|
80
|
+
* @typedef {number} dateDialogType
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Enum for date dialog
|
|
84
|
+
* <div>DATE will open a dialog where you can select a special day</div>
|
|
85
|
+
* <div>TIME will open a dialog where you can only select a special time</div>
|
|
86
|
+
* <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
|
|
87
|
+
* @readonly
|
|
88
|
+
* @enum {dateDialogType}
|
|
89
|
+
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
90
|
+
*/
|
|
91
|
+
export declare const dateType: {
|
|
92
|
+
DATE: number;
|
|
93
|
+
TIME: number;
|
|
94
|
+
DATE_TIME: number;
|
|
95
|
+
};
|
|
96
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type DropUpAlert = {
|
|
2
|
-
callType?: number;
|
|
3
|
-
};
|
|
4
|
-
export declare function dropUpAlert(dialog?: DropUpAlert): Promise<unknown>;
|
|
5
|
-
export {};
|
|
1
|
+
type DropUpAlert = {
|
|
2
|
+
callType?: number;
|
|
3
|
+
};
|
|
4
|
+
export declare function dropUpAlert(dialog?: DropUpAlert): Promise<unknown>;
|
|
5
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
-
export declare const fileType: {
|
|
3
|
-
IMAGE: string;
|
|
4
|
-
VIDEO: string;
|
|
5
|
-
AUDIO: string;
|
|
6
|
-
DOCUMENT: string[];
|
|
7
|
-
};
|
|
8
|
-
type FileSelectInput = {
|
|
9
|
-
buttons?: DialogButtonOld[];
|
|
10
|
-
callType?: number;
|
|
11
|
-
multiselect?: boolean;
|
|
12
|
-
directory?: boolean;
|
|
13
|
-
chaynsToken?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function fileSelect(dialog?: FileSelectInput): Promise<unknown>;
|
|
16
|
-
export {};
|
|
1
|
+
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
+
export declare const fileType: {
|
|
3
|
+
IMAGE: string;
|
|
4
|
+
VIDEO: string;
|
|
5
|
+
AUDIO: string;
|
|
6
|
+
DOCUMENT: string[];
|
|
7
|
+
};
|
|
8
|
+
type FileSelectInput = {
|
|
9
|
+
buttons?: DialogButtonOld[];
|
|
10
|
+
callType?: number;
|
|
11
|
+
multiselect?: boolean;
|
|
12
|
+
directory?: boolean;
|
|
13
|
+
chaynsToken?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function fileSelect(dialog?: FileSelectInput): Promise<unknown>;
|
|
16
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
-
type iFrameDialog = {
|
|
3
|
-
buttons?: DialogButtonOld[];
|
|
4
|
-
callType?: number;
|
|
5
|
-
tappIframeName?: string;
|
|
6
|
-
url: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function iFrame(dialog?: iFrameDialog): Promise<unknown>;
|
|
9
|
-
export declare function _chaynsCallResponder(obj: any): void;
|
|
10
|
-
export {};
|
|
1
|
+
import { DialogButtonOld } from "../../types/dialog";
|
|
2
|
+
type iFrameDialog = {
|
|
3
|
+
buttons?: DialogButtonOld[];
|
|
4
|
+
callType?: number;
|
|
5
|
+
tappIframeName?: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function iFrame(dialog?: iFrameDialog): Promise<unknown>;
|
|
9
|
+
export declare function _chaynsCallResponder(obj: any): void;
|
|
10
|
+
export {};
|