chayns-api 1.1.0-8 → 1.1.3

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.
Files changed (168) hide show
  1. package/.babelrc +30 -30
  2. package/.eslintrc +17 -17
  3. package/.github/workflows/deploy_docs.yml +28 -28
  4. package/.github/workflows/publish.yml +21 -21
  5. package/LICENSE +21 -21
  6. package/README.md +54 -54
  7. package/dist/cjs/calls/dialogs/date.js +34 -34
  8. package/dist/cjs/calls/index.js +116 -108
  9. package/dist/cjs/calls/sendMessage.js +8 -8
  10. package/dist/cjs/calls/visibilityChangeListener.js +4 -4
  11. package/dist/cjs/components/AppDialogWrapper.js +2 -2
  12. package/dist/cjs/components/ChaynsProvider.js +3 -6
  13. package/dist/cjs/components/ErrorBoundary.js +1 -1
  14. package/dist/cjs/components/withCompatMode.js +2 -2
  15. package/dist/cjs/constants/languages.js +19 -0
  16. package/dist/cjs/handler/DialogHandler.js +1 -2
  17. package/dist/cjs/hooks/geoLocationListener.js +4 -4
  18. package/dist/cjs/hooks/scrollListener.js +8 -8
  19. package/dist/cjs/hooks/useAccessToken.js +3 -3
  20. package/dist/cjs/hooks/useCurrentPage.js +2 -2
  21. package/dist/cjs/hooks/useCustomData.js +2 -2
  22. package/dist/cjs/hooks/useDevice.js +2 -2
  23. package/dist/cjs/hooks/useDialogState.js +4 -4
  24. package/dist/cjs/hooks/useEnvironment.js +2 -2
  25. package/dist/cjs/hooks/useFunctions.js +2 -2
  26. package/dist/cjs/hooks/useIsAdminMode.js +2 -2
  27. package/dist/cjs/hooks/useLanguage.js +2 -2
  28. package/dist/cjs/hooks/usePages.js +4 -4
  29. package/dist/cjs/hooks/useParameters.js +2 -2
  30. package/dist/cjs/hooks/useSite.js +2 -2
  31. package/dist/cjs/hooks/useUser.js +2 -2
  32. package/dist/cjs/hooks/useValues.js +2 -2
  33. package/dist/cjs/hooks/windowMetricsListener.js +4 -4
  34. package/dist/cjs/host/ChaynsHost.js +1 -1
  35. package/dist/cjs/host/iframe/HostIframe.js +2 -2
  36. package/dist/cjs/host/module/ModuleHost.js +20 -23
  37. package/dist/cjs/host/module/utils/loadComponent.js +54 -57
  38. package/dist/cjs/host/module/utils/useDynamicScript.js +5 -7
  39. package/dist/cjs/index.js +5 -21
  40. package/dist/cjs/types/IChaynsReact.js +5 -4
  41. package/dist/cjs/util/deviceHelper.js +9 -2
  42. package/dist/cjs/util/heightHelper.js +1 -1
  43. package/dist/cjs/util/is.js +30 -0
  44. package/dist/cjs/util/transferNestedFunctions.js +5 -2
  45. package/dist/cjs/wrapper/AppWrapper.js +86 -43
  46. package/dist/cjs/wrapper/FrameWrapper.js +6 -2
  47. package/dist/cjs/wrapper/ModuleFederationWrapper.js +1 -1
  48. package/dist/cjs/wrapper/StaticChaynsApi.js +7 -0
  49. package/dist/esm/calls/dialogs/date.js +34 -34
  50. package/dist/esm/calls/index.js +114 -109
  51. package/dist/esm/calls/sendMessage.js +8 -8
  52. package/dist/esm/calls/visibilityChangeListener.js +4 -4
  53. package/dist/esm/components/AppDialogWrapper.js +1 -1
  54. package/dist/esm/components/ChaynsProvider.js +2 -5
  55. package/dist/esm/components/withCompatMode.js +1 -1
  56. package/dist/esm/constants/languages.js +13 -0
  57. package/dist/esm/handler/DialogHandler.js +2 -3
  58. package/dist/esm/hooks/geoLocationListener.js +4 -4
  59. package/dist/esm/hooks/scrollListener.js +8 -8
  60. package/dist/esm/hooks/useAccessToken.js +3 -3
  61. package/dist/esm/hooks/useCurrentPage.js +2 -2
  62. package/dist/esm/hooks/useCustomData.js +2 -2
  63. package/dist/esm/hooks/useDevice.js +2 -2
  64. package/dist/esm/hooks/useDialogState.js +4 -4
  65. package/dist/esm/hooks/useEnvironment.js +2 -2
  66. package/dist/esm/hooks/useFunctions.js +2 -2
  67. package/dist/esm/hooks/useIsAdminMode.js +2 -2
  68. package/dist/esm/hooks/useLanguage.js +2 -2
  69. package/dist/esm/hooks/usePages.js +4 -4
  70. package/dist/esm/hooks/useParameters.js +2 -2
  71. package/dist/esm/hooks/useSite.js +2 -2
  72. package/dist/esm/hooks/useUser.js +2 -2
  73. package/dist/esm/hooks/useValues.js +2 -2
  74. package/dist/esm/hooks/windowMetricsListener.js +4 -4
  75. package/dist/esm/host/iframe/HostIframe.js +1 -1
  76. package/dist/esm/host/module/ModuleHost.js +19 -22
  77. package/dist/esm/host/module/utils/loadComponent.js +53 -56
  78. package/dist/esm/index.js +1 -3
  79. package/dist/esm/types/IChaynsReact.js +5 -4
  80. package/dist/esm/util/deviceHelper.js +9 -2
  81. package/dist/esm/util/is.js +23 -0
  82. package/dist/esm/util/transferNestedFunctions.js +5 -2
  83. package/dist/esm/wrapper/AppWrapper.js +90 -45
  84. package/dist/esm/wrapper/FrameWrapper.js +6 -2
  85. package/dist/esm/wrapper/StaticChaynsApi.js +8 -1
  86. package/dist/types/calls/dialogs/alert.d.ts +1 -1
  87. package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
  88. package/dist/types/calls/dialogs/close.d.ts +1 -1
  89. package/dist/types/calls/dialogs/communication.d.ts +3 -3
  90. package/dist/types/calls/dialogs/confirm.d.ts +13 -13
  91. package/dist/types/calls/dialogs/date.d.ts +96 -96
  92. package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
  93. package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
  94. package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
  95. package/dist/types/calls/dialogs/index.d.ts +14 -14
  96. package/dist/types/calls/dialogs/input.d.ts +15 -15
  97. package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
  98. package/dist/types/calls/dialogs/open.d.ts +1 -1
  99. package/dist/types/calls/dialogs/select.d.ts +6 -6
  100. package/dist/types/calls/dialogs/signature.d.ts +7 -7
  101. package/dist/types/calls/dialogs/toast.d.ts +1 -1
  102. package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
  103. package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
  104. package/dist/types/calls/getUserInfo.d.ts +9 -9
  105. package/dist/types/calls/index.d.ts +255 -251
  106. package/dist/types/calls/sendMessage.d.ts +13 -13
  107. package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
  108. package/dist/types/components/AppDialogWrapper.d.ts +5 -5
  109. package/dist/types/components/ChaynsContext.d.ts +3 -3
  110. package/dist/types/components/ChaynsProvider.d.ts +11 -11
  111. package/dist/types/components/ErrorBoundary.d.ts +13 -13
  112. package/dist/types/components/WaitUntil.d.ts +7 -7
  113. package/dist/types/components/moduleWrapper.d.ts +4 -4
  114. package/dist/types/components/withCompatMode.d.ts +13 -13
  115. package/dist/types/constants/languages.d.ts +12 -0
  116. package/dist/types/handler/DialogHandler.d.ts +24 -18
  117. package/dist/types/helper/apiListenerHelper.d.ts +6 -6
  118. package/dist/types/hooks/geoLocationListener.d.ts +18 -18
  119. package/dist/types/hooks/index.d.ts +17 -17
  120. package/dist/types/hooks/scrollListener.d.ts +28 -28
  121. package/dist/types/hooks/useAccessToken.d.ts +6 -6
  122. package/dist/types/hooks/useCurrentPage.d.ts +4 -4
  123. package/dist/types/hooks/useCustomData.d.ts +4 -4
  124. package/dist/types/hooks/useDevice.d.ts +5 -5
  125. package/dist/types/hooks/useDialogState.d.ts +9 -9
  126. package/dist/types/hooks/useEnvironment.d.ts +5 -5
  127. package/dist/types/hooks/useFunctions.d.ts +5 -5
  128. package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
  129. package/dist/types/hooks/useLanguage.d.ts +5 -5
  130. package/dist/types/hooks/usePages.d.ts +18 -18
  131. package/dist/types/hooks/useParameters.d.ts +5 -5
  132. package/dist/types/hooks/useSite.d.ts +5 -5
  133. package/dist/types/hooks/useUser.d.ts +5 -5
  134. package/dist/types/hooks/useValues.d.ts +5 -5
  135. package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
  136. package/dist/types/host/ChaynsHost.d.ts +30 -30
  137. package/dist/types/host/iframe/HostIframe.d.ts +26 -26
  138. package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
  139. package/dist/types/host/module/ModuleHost.d.ts +27 -27
  140. package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
  141. package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -9
  142. package/dist/types/index.d.ts +20 -22
  143. package/dist/types/types/IChaynsReact.d.ts +859 -816
  144. package/dist/types/types/dialog.d.ts +41 -41
  145. package/dist/types/util/appCall.d.ts +2 -2
  146. package/dist/types/util/deviceHelper.d.ts +7 -7
  147. package/dist/types/util/heightHelper.d.ts +1 -1
  148. package/dist/types/util/is.d.ts +5 -0
  149. package/dist/types/util/postIframeForm.d.ts +1 -1
  150. package/dist/types/util/transferNestedFunctions.d.ts +1 -1
  151. package/dist/types/util/url.d.ts +1 -1
  152. package/dist/types/wrapper/AppWrapper.d.ts +19 -22
  153. package/dist/types/wrapper/FrameWrapper.d.ts +15 -15
  154. package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -10
  155. package/dist/types/wrapper/SsrWrapper.d.ts +11 -11
  156. package/dist/types/wrapper/StaticChaynsApi.d.ts +16 -9
  157. package/package.json +78 -79
  158. package/toolkit.config.js +20 -20
  159. package/tsconfig.json +56 -56
  160. package/dist/cjs/components/withHydrationBoundary.js +0 -58
  161. package/dist/cjs/constants/hydrationContext.js +0 -16
  162. package/dist/cjs/constants/index.js +0 -16
  163. package/dist/esm/components/withHydrationBoundary.js +0 -51
  164. package/dist/esm/constants/hydrationContext.js +0 -10
  165. package/dist/esm/constants/index.js +0 -1
  166. package/dist/types/components/withHydrationBoundary.d.ts +0 -17
  167. package/dist/types/constants/hydrationContext.d.ts +0 -9
  168. package/dist/types/constants/index.d.ts +0 -1
@@ -12,9 +12,11 @@ var _deviceHelper = _interopRequireWildcard(require("../util/deviceHelper"));
12
12
  var _getUserInfo = _interopRequireDefault(require("../calls/getUserInfo"));
13
13
  var _sendMessage = require("../calls/sendMessage");
14
14
  var _apiListenerHelper = require("../helper/apiListenerHelper");
15
+ var _languages = require("../constants/languages");
16
+ var _is = require("../util/is");
15
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
20
  /* eslint-disable */
19
21
  // @ts-nocheck
20
22
 
@@ -26,13 +28,15 @@ class AppWrapper {
26
28
  var _window, _colorMode, _window2, _AppInfo$TappSelected;
27
29
  const {
28
30
  AppInfo,
29
- AppUser
31
+ AppUser,
32
+ Device
30
33
  } = retVal;
31
34
  this.accessToken = AppUser.TobitAccessToken;
32
35
  const urlParams = new URLSearchParams(location.search);
33
36
  const urlParamsLowerCase = new URLSearchParams(location.search.toLowerCase());
34
37
  let tappId = urlParamsLowerCase.get('tappid');
35
38
  let colorMode = urlParamsLowerCase.get('colormode');
39
+ let color = AppInfo.color;
36
40
  if (colorMode) {
37
41
  try {
38
42
  colorMode = Number.parseInt(colorMode, 10);
@@ -45,6 +49,24 @@ class AppWrapper {
45
49
  // ignore
46
50
  }
47
51
  }
52
+ if (!color && urlParamsLowerCase.has('color')) {
53
+ color = urlParamsLowerCase.get('color');
54
+ if (!color.startsWith('#')) {
55
+ color = `#${color}`;
56
+ }
57
+ }
58
+ let userId = AppUser.TobitUserID;
59
+ if (typeof userId === 'string') {
60
+ try {
61
+ userId = Number.parseInt(userId, 10);
62
+ } catch {
63
+ // ignore
64
+ }
65
+ }
66
+ let language = AppInfo.Language;
67
+ if (!language) {
68
+ language = _languages.DeviceLanguage[Number.parseInt(Device === null || Device === void 0 ? void 0 : Device.LanguageID, 10)] || 'de';
69
+ }
48
70
  return {
49
71
  device: (0, _deviceHelper.default)(navigator.userAgent, 'image/webp'),
50
72
  environment: {
@@ -52,12 +74,11 @@ class AppWrapper {
52
74
  runtimeEnvironment: _IChaynsReact.RuntimeEnviroment.Unknown
53
75
  },
54
76
  language: {
55
- site: AppInfo.Language,
77
+ site: language,
56
78
  translation: null,
57
- device: AppInfo.Language,
58
- active: AppInfo.Language
79
+ device: language,
80
+ active: language
59
81
  },
60
- // ToDo: Find better way to detect
61
82
  site: {
62
83
  id: AppInfo.SiteID,
63
84
  locationId: AppInfo.LocationID,
@@ -73,7 +94,7 @@ class AppWrapper {
73
94
  },
74
95
  title: AppInfo.Title,
75
96
  colorMode: (_colorMode = colorMode) !== null && _colorMode !== void 0 ? _colorMode : AppInfo.colorMode,
76
- color: AppInfo.color,
97
+ color,
77
98
  domain: AppInfo.domain,
78
99
  font: {
79
100
  id: _IChaynsReact.Font.Roboto,
@@ -89,7 +110,7 @@ class AppWrapper {
89
110
  firstName: AppUser.FirstName,
90
111
  lastName: AppUser.LastName,
91
112
  gender: _IChaynsReact.Gender.Unknown,
92
- userId: AppUser.TobitUserID,
113
+ userId: userId,
93
114
  personId: AppUser.PersonID,
94
115
  uacGroups: []
95
116
  },
@@ -116,12 +137,6 @@ class AppWrapper {
116
137
  notImplemented(call) {
117
138
  console.warn(`call ${call} not implement in app`);
118
139
  }
119
- dispatchDialogChange(detail) {
120
- this.dialogs = detail;
121
- this.dialogEventTarget.dispatchEvent(new CustomEvent('change', {
122
- detail
123
- }));
124
- }
125
140
  counter = 0;
126
141
  appCall(action, value = {}, {
127
142
  callback,
@@ -313,7 +328,7 @@ class AppWrapper {
313
328
  (0, _appCall.default)(callObj);
314
329
  },
315
330
  login: async (value, callback, closeCallback) => {
316
- const res = await this.appCall({}, callback);
331
+ const res = await this.appCall(54, value);
317
332
  return {
318
333
  loginState: res === null || res === void 0 ? void 0 : res.loginState
319
334
  };
@@ -365,7 +380,8 @@ class AppWrapper {
365
380
  shouldRemove
366
381
  } = (0, _apiListenerHelper.removeApiListener)('geoLocationListener', id);
367
382
  if (shouldRemove) {
368
- // App does not support removal of request geo location call with permanent true which makes this a no-op
383
+ // App does not support removal of request geo location call with permanent true which makes this a
384
+ // no-op
369
385
  }
370
386
  },
371
387
  removeScrollListener: async id => {
@@ -520,51 +536,78 @@ class AppWrapper {
520
536
  });
521
537
  },
522
538
  createDialog: config => {
523
- return new _DialogHandler.default(config, this.functions.openDialog, this.functions.closeDialog);
539
+ return new _DialogHandler.default(config, this.functions.openDialog, this.functions.closeDialog, this.functions.dispatchEventToDialogClient, this.functions.addDialogClientEventListener);
524
540
  },
525
541
  openDialog: async (config, callback) => {
526
542
  const currentDialogId = appWrapperDialogId++;
527
- const eventTarget = new EventTarget();
528
- const resolve = result => {
543
+ const isSupported = (0, _is.isAppCallSupported)({
544
+ minAndroidVersion: 7137,
545
+ minIOSVersion: 6934
546
+ });
547
+ this.appCall(184, {
548
+ dialogContent: {
549
+ apiVersion: 5,
550
+ config
551
+ },
552
+ externalDialogUrl: isSupported ? undefined : 'https://tapp.chayns-static.space/api/dialog-v2/v1/index.html'
553
+ }, {
554
+ awaitResult: true
555
+ }).then(result => {
529
556
  callback(result);
530
- this.dispatchDialogChange(this.dialogs.filter(x => x.dialogId !== currentDialogId));
531
- };
532
- this.dispatchDialogChange([...this.dialogs, {
533
- config,
534
- resolve,
535
- dialogId: currentDialogId,
536
- eventTarget
537
- }]);
557
+ });
538
558
  return currentDialogId;
539
559
  },
540
- closeDialog: dialogId => {
560
+ closeDialog: (dialogId, result, buttonType = -1) => {
541
561
  const dialog = this.dialogs.find(x => x.dialogId === dialogId);
542
562
  if (dialog) {
543
563
  dialog.resolve({
544
- buttonType: -1
564
+ buttonType,
565
+ result
545
566
  });
546
567
  }
568
+ },
569
+ dispatchEventToDialogClient: () => this.notImplemented('dispatchEventToDialogClient'),
570
+ addDialogClientEventListener: () => this.notImplemented('addDialogClientEventListener'),
571
+ addAnonymousAccount: async () => {
572
+ return this.appCall(302);
547
573
  }
548
574
  };
549
575
  dialogs = [];
550
- dialogEventTarget = new EventTarget();
551
- getDialogEventTarget() {
552
- return this.dialogEventTarget;
553
- }
554
576
  async init() {
555
577
  this.values = this.mapOldApiToNew(await this.appCall(18));
556
- const callbackName = `chaynsApiV5Callback_${this.counter++}`;
557
- window.disablev4AccessTokenChangeListener = true;
558
- window[callbackName] = ({
559
- retVal: value
560
- }) => {
561
- this.mapOldApiToNew(value);
562
- };
563
578
  this.appCall(66, {
564
- enabled: true,
565
- callback: callbackName
579
+ enabled: true
580
+ }, {
581
+ callback: async () => {
582
+ this.values = this.mapOldApiToNew(await this.appCall(18));
583
+ document.dispatchEvent(new CustomEvent('chayns_api_data', {
584
+ detail: {
585
+ type: 'user',
586
+ value: this.values.user
587
+ }
588
+ }));
589
+ },
590
+ awaitResult: true
591
+ });
592
+ window.disablev4DesignSettingsChangeListener = true;
593
+ this.appCall(254, {
594
+ enabled: true
566
595
  }, {
567
- awaitResult: false
596
+ callback: ({
597
+ colorMode
598
+ }) => {
599
+ this.values.site = {
600
+ ...this.values.site,
601
+ colorMode
602
+ };
603
+ document.dispatchEvent(new CustomEvent('chayns_api_data', {
604
+ detail: {
605
+ type: 'site',
606
+ value: this.values.site
607
+ }
608
+ }));
609
+ },
610
+ awaitResult: true
568
611
  });
569
612
  return undefined;
570
613
  }
@@ -11,7 +11,7 @@ var _apiListenerHelper = require("../helper/apiListenerHelper");
11
11
  var _getUserInfo = _interopRequireDefault(require("../calls/getUserInfo"));
12
12
  var _sendMessage = require("../calls/sendMessage");
13
13
  var _heightHelper = require("../util/heightHelper");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
@@ -296,7 +296,11 @@ class FrameWrapper {
296
296
  // this.exposedFunctions.removeDialogHostEventListener(0);
297
297
  }
298
298
  },
299
- removeDialogClientEventListener: async () => {}
299
+ removeDialogClientEventListener: async () => {},
300
+ addAnonymousAccount: async () => {
301
+ if (!this.initialized) await this.ready;
302
+ return this.exposedFunctions.addAnonymousAccount();
303
+ }
300
304
  };
301
305
  initialized = false;
302
306
  constructor() {
@@ -9,7 +9,7 @@ var _visibilityChangeListener = require("../calls/visibilityChangeListener");
9
9
  var _apiListenerHelper = require("../helper/apiListenerHelper");
10
10
  var _getUserInfo = _interopRequireDefault(require("../calls/getUserInfo"));
11
11
  var _sendMessage = require("../calls/sendMessage");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  class ModuleFederationWrapper {
14
14
  constructor(values, functions) {
15
15
  this.values = values;
@@ -17,6 +17,13 @@ class StaticChaynsApi {
17
17
  this[k] = v;
18
18
  });
19
19
  }
20
+ getUser = () => this._wrapper.values.user;
20
21
  getSite = () => this._wrapper.values.site;
22
+ getCurrentPage = () => this._wrapper.values.currentPage;
23
+ getDevice = () => this._wrapper.values.device;
24
+ getLanguage = () => this._wrapper.values.language;
25
+ getParameters = () => this._wrapper.values.parameters;
26
+ getPages = () => this._wrapper.values.pages;
27
+ getEnvironment = () => this._wrapper.values.environment;
21
28
  }
22
29
  var _default = exports.default = StaticChaynsApi;
@@ -3,32 +3,32 @@ import { isDate, isNumber, isObject } from './utils/is';
3
3
  import { open } from './open';
4
4
  import { getDevice } from "../index";
5
5
 
6
- /**
7
- * The config object for date dialog
8
- * @typedef {Object} dateConfig
9
- * @property {Date} preSelect - The date object which should be preselected.
10
- * @property {Date} minDate - The min date which you could select.
11
- * @property {Date} maxDate - The max date which you could select.
12
- * @property {dateDialogType} dateType - The type of dialog you want to display.
13
- * @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
14
- * @property {string} message - The message that is displayed above the date dialog, only in apps supported
15
- * @property {string} title - The title that is displayed above the message, only in apps supported
6
+ /**
7
+ * The config object for date dialog
8
+ * @typedef {Object} dateConfig
9
+ * @property {Date} preSelect - The date object which should be preselected.
10
+ * @property {Date} minDate - The min date which you could select.
11
+ * @property {Date} maxDate - The max date which you could select.
12
+ * @property {dateDialogType} dateType - The type of dialog you want to display.
13
+ * @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
14
+ * @property {string} message - The message that is displayed above the date dialog, only in apps supported
15
+ * @property {string} title - The title that is displayed above the message, only in apps supported
16
16
  */
17
17
 
18
- /**
19
- * This call will open a date select dialog.
20
- * <div>Call: 30</div>
21
- * @param {dateConfig} config - Define the configuration of this call
22
- * @return {Promise} contains a timestamp as result
23
- * @example chayns.dialog.date({
24
- * 'dateType': chayns.dialog.dateType.DATE_TIME,
25
- * 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
26
- * 'minDate': new Date(2018, 6, 1, 15, 0, 0),
27
- * 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
28
- * 'minuteInterval': 15
29
- * ).then(function (data) {
30
- * console.log(data);
31
- * });
18
+ /**
19
+ * This call will open a date select dialog.
20
+ * <div>Call: 30</div>
21
+ * @param {dateConfig} config - Define the configuration of this call
22
+ * @return {Promise} contains a timestamp as result
23
+ * @example chayns.dialog.date({
24
+ * 'dateType': chayns.dialog.dateType.DATE_TIME,
25
+ * 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
26
+ * 'minDate': new Date(2018, 6, 1, 15, 0, 0),
27
+ * 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
28
+ * 'minuteInterval': 15
29
+ * ).then(function (data) {
30
+ * console.log(data);
31
+ * });
32
32
  */
33
33
 
34
34
  export function date() {
@@ -165,18 +165,18 @@ export function advancedDate() {
165
165
  });
166
166
  }
167
167
 
168
- /**
169
- * @typedef {number} dateDialogType
168
+ /**
169
+ * @typedef {number} dateDialogType
170
170
  */
171
171
 
172
- /**
173
- * Enum for date dialog
174
- * <div>DATE will open a dialog where you can select a special day</div>
175
- * <div>TIME will open a dialog where you can only select a special time</div>
176
- * <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
177
- * @readonly
178
- * @enum {dateDialogType}
179
- * @type {{DATE: number, TIME: number, DATE_TIME: number}}
172
+ /**
173
+ * Enum for date dialog
174
+ * <div>DATE will open a dialog where you can select a special day</div>
175
+ * <div>TIME will open a dialog where you can only select a special time</div>
176
+ * <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
177
+ * @readonly
178
+ * @enum {dateDialogType}
179
+ * @type {{DATE: number, TIME: number, DATE_TIME: number}}
180
180
  */
181
181
  export const dateType = {
182
182
  'DATE': 1,