@pega/react-sdk-components 8.23.10 → 8.23.11-debug

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 (262) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js +2 -3
  4. package/lib/bridge/Context/StoreContext.js.map +1 -1
  5. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  6. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  7. package/lib/bridge/helpers/sdk_component_map.js +22 -0
  8. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  9. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  10. package/lib/bridge/react_pconnect.js +2 -14
  11. package/lib/bridge/react_pconnect.js.map +1 -1
  12. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +13 -0
  13. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  14. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +26 -0
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  16. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  17. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  18. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  20. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  21. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +1 -1
  22. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  23. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  24. package/lib/components/designSystemExtension/Operator/Operator.js +12 -10
  25. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  26. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
  27. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  28. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  29. package/lib/components/field/CancelAlert/CancelAlert.js +9 -7
  30. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  31. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  32. package/lib/components/field/Checkbox/Checkbox.js +3 -3
  33. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  34. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  35. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  36. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  37. package/lib/components/field/Date/Date.d.ts.map +1 -1
  38. package/lib/components/field/Date/Date.js +11 -5
  39. package/lib/components/field/Date/Date.js.map +1 -1
  40. package/lib/components/field/DateTime/DateTime.js +1 -1
  41. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  42. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  43. package/lib/components/field/Decimal/Decimal.js +41 -8
  44. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  45. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  46. package/lib/components/field/Dropdown/Dropdown.js +21 -7
  47. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  48. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  49. package/lib/components/field/Phone/Phone.js +2 -1
  50. package/lib/components/field/Phone/Phone.js.map +1 -1
  51. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  52. package/lib/components/field/RadioButtons/RadioButtons.js +17 -4
  53. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  54. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  55. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  56. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  57. package/lib/components/field/TextInput/TextInput.js +20 -3
  58. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  59. package/lib/components/field/Time/Time.d.ts.map +1 -1
  60. package/lib/components/field/Time/Time.js +6 -2
  61. package/lib/components/field/Time/Time.js.map +1 -1
  62. package/lib/components/field/URL/URL.d.ts.map +1 -1
  63. package/lib/components/field/URL/URL.js +6 -2
  64. package/lib/components/field/URL/URL.js.map +1 -1
  65. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  66. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  67. package/lib/components/helpers/attachmentHelpers.d.ts +5 -5
  68. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  69. package/lib/components/helpers/attachmentHelpers.js +2 -2
  70. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  71. package/lib/components/helpers/auth.d.ts.map +1 -1
  72. package/lib/components/helpers/auth.js +11 -3
  73. package/lib/components/helpers/auth.js.map +1 -1
  74. package/lib/components/helpers/authManager.d.ts.map +1 -1
  75. package/lib/components/helpers/authManager.js +15 -12
  76. package/lib/components/helpers/authManager.js.map +1 -1
  77. package/lib/components/helpers/case-utils.d.ts +20 -0
  78. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  79. package/lib/components/helpers/case-utils.js +81 -0
  80. package/lib/components/helpers/case-utils.js.map +1 -0
  81. package/lib/components/helpers/common-utils.d.ts +2 -0
  82. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  83. package/lib/components/helpers/common-utils.js +5 -0
  84. package/lib/components/helpers/common-utils.js.map +1 -0
  85. package/lib/components/helpers/config_access.d.ts.map +1 -1
  86. package/lib/components/helpers/config_access.js +75 -82
  87. package/lib/components/helpers/config_access.js.map +1 -1
  88. package/lib/components/helpers/data_page.d.ts.map +1 -1
  89. package/lib/components/helpers/data_page.js.map +1 -1
  90. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  91. package/lib/components/helpers/date-format-utils.js +23 -14
  92. package/lib/components/helpers/date-format-utils.js.map +1 -1
  93. package/lib/components/helpers/event-utils.d.ts +1 -1
  94. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  95. package/lib/components/helpers/event-utils.js.map +1 -1
  96. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  97. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  98. package/lib/components/helpers/field-group-utils.js +3 -3
  99. package/lib/components/helpers/field-group-utils.js.map +1 -1
  100. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  101. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  102. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  103. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  104. package/lib/components/helpers/formatters/Currency.js +4 -3
  105. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  106. package/lib/components/helpers/formatters/CurrencyMap.d.ts +1132 -1399
  107. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  108. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  109. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  110. package/lib/components/helpers/formatters/Date.js +1 -1
  111. package/lib/components/helpers/formatters/Date.js.map +1 -1
  112. package/lib/components/helpers/formatters/common.d.ts +2 -2
  113. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  114. package/lib/components/helpers/formatters/common.js +4 -5
  115. package/lib/components/helpers/formatters/common.js.map +1 -1
  116. package/lib/components/helpers/formatters/index.d.ts +1 -1
  117. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  118. package/lib/components/helpers/formatters/index.js.map +1 -1
  119. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  120. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  121. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  122. package/lib/components/helpers/simpleTableHelpers.d.ts +2 -2
  123. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  124. package/lib/components/helpers/simpleTableHelpers.js +5 -2
  125. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  126. package/lib/components/helpers/state-utils.d.ts +4 -0
  127. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  128. package/lib/components/helpers/state-utils.js +36 -0
  129. package/lib/components/helpers/state-utils.js.map +1 -0
  130. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  131. package/lib/components/helpers/template-utils.js +0 -1
  132. package/lib/components/helpers/template-utils.js.map +1 -1
  133. package/lib/components/helpers/utils.d.ts +1 -1
  134. package/lib/components/helpers/utils.d.ts.map +1 -1
  135. package/lib/components/helpers/utils.js +9 -3
  136. package/lib/components/helpers/utils.js.map +1 -1
  137. package/lib/components/helpers/versionHelpers.d.ts +0 -6
  138. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  139. package/lib/components/helpers/versionHelpers.js +0 -6
  140. package/lib/components/helpers/versionHelpers.js.map +1 -1
  141. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  142. package/lib/components/infra/ActionButtons/ActionButtons.js +4 -2
  143. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  144. package/lib/components/infra/Assignment/Assignment.d.ts +1 -0
  145. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  146. package/lib/components/infra/Assignment/Assignment.js +27 -15
  147. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  148. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  149. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +17 -9
  150. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  151. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  152. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  153. package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
  154. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  155. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  156. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +17 -8
  157. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  158. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  159. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +4 -2
  160. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  161. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  162. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  163. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  164. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  165. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  166. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  167. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  168. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +7 -4
  169. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  170. package/lib/components/infra/MultiStep/MultiStep.js +2 -2
  171. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  172. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  173. package/lib/components/infra/NavBar/NavBar.js +6 -4
  174. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  175. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  176. package/lib/components/infra/RootContainer/RootContainer.js +12 -15
  177. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  178. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  179. package/lib/components/infra/Stages/Stages.js +2 -1
  180. package/lib/components/infra/Stages/Stages.js.map +1 -1
  181. package/lib/components/infra/View/View.d.ts +1 -1
  182. package/lib/components/infra/View/View.d.ts.map +1 -1
  183. package/lib/components/infra/View/View.js +6 -34
  184. package/lib/components/infra/View/View.js.map +1 -1
  185. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  186. package/lib/components/template/AppShell/AppShell.js +8 -8
  187. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  188. package/lib/components/template/CaseView/CaseView.d.ts +1 -1
  189. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  190. package/lib/components/template/CaseView/CaseView.js +37 -28
  191. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  192. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +3 -1
  193. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  194. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +13 -8
  195. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  196. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  197. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  198. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  199. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  200. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  201. package/lib/components/template/DefaultForm/DefaultForm.js +9 -5
  202. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  203. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  204. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  205. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  206. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  207. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  208. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -1
  209. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  210. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  211. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  212. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  213. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  214. package/lib/components/template/ListView/ListView.js +1 -1
  215. package/lib/components/template/ListView/ListView.js.map +1 -1
  216. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  217. package/lib/components/template/ListView/hooks.js +0 -1
  218. package/lib/components/template/ListView/hooks.js.map +1 -1
  219. package/lib/components/template/ListView/utils.d.ts +28 -16
  220. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  221. package/lib/components/template/ListView/utils.js +1 -2
  222. package/lib/components/template/ListView/utils.js.map +1 -1
  223. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  224. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  225. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  226. package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -2
  227. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  228. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  229. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  230. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  231. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -3
  232. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  233. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  234. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  235. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  236. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  237. package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
  238. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  239. package/lib/components/widget/Attachment/Attachment.css +15 -3
  240. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  241. package/lib/components/widget/Attachment/Attachment.js +29 -25
  242. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  243. package/lib/components/widget/CaseHistory/CaseHistory.js +3 -3
  244. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  245. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  246. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +17 -17
  247. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  248. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  249. package/lib/components/widget/QuickCreate/QuickCreate.js +2 -2
  250. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  251. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  252. package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
  253. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  254. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  255. package/lib/components/widget/ToDo/ToDo.js +10 -6
  256. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  257. package/lib/components_map.d.ts +3 -3
  258. package/lib/components_map.d.ts.map +1 -1
  259. package/lib/components_map.js +819 -818
  260. package/lib/components_map.js.map +1 -1
  261. package/lib/doc/KeyReleaseUpdates.md +44 -9
  262. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  // Helper singleton class to assist with loading and accessing
2
2
  // the SDK Config JSON
3
3
  import { sdkGetAuthHeader } from './authManager';
4
- import Utils from './utils';
4
+ import { isEmptyObject } from './common-utils';
5
5
  // Create a singleton for this class (with async loading of config file) and export it
6
6
  // Note: Initialzing SdkConfigAccess to null seems to cause lots of compile issues with references
7
7
  // within other components and the value potentially being null (so try to leave it undefined)
@@ -18,7 +18,7 @@ class ConfigAccess {
18
18
  configurable: true,
19
19
  writable: true,
20
20
  value: async () => {
21
- if (Utils.isEmptyObject(this.sdkConfig)) {
21
+ if (isEmptyObject(this.sdkConfig)) {
22
22
  await getSdkConfig();
23
23
  }
24
24
  return this.sdkConfig;
@@ -33,10 +33,10 @@ class ConfigAccess {
33
33
  configurable: true,
34
34
  writable: true,
35
35
  value: () => {
36
- if (Utils.isEmptyObject(this.sdkConfig)) {
36
+ if (isEmptyObject(this.sdkConfig)) {
37
37
  const config = this.getSdkConfig();
38
38
  }
39
- return this.sdkConfig["authConfig"];
39
+ return this.sdkConfig['authConfig'];
40
40
  }
41
41
  });
42
42
  /**
@@ -48,16 +48,16 @@ class ConfigAccess {
48
48
  configurable: true,
49
49
  writable: true,
50
50
  value: () => {
51
- if (Utils.isEmptyObject(this.sdkConfig)) {
51
+ if (isEmptyObject(this.sdkConfig)) {
52
52
  const config = this.getSdkConfig();
53
53
  }
54
- return this.sdkConfig["serverConfig"];
54
+ return this.sdkConfig['serverConfig'];
55
55
  }
56
56
  });
57
57
  /**
58
- * @param {String} key the key to be inserted/updated in serverConfig
59
- * @param {String} value the value to be assigned to the given key
60
- */
58
+ * @param {String} key the key to be inserted/updated in serverConfig
59
+ * @param {String} value the value to be assigned to the given key
60
+ */
61
61
  Object.defineProperty(this, "setSdkConfigServer", {
62
62
  enumerable: true,
63
63
  configurable: true,
@@ -95,9 +95,9 @@ class ConfigAccess {
95
95
  * @returns Promise of config file fetch
96
96
  */
97
97
  async readSdkConfig() {
98
- if (Utils.isEmptyObject(this.sdkConfig)) {
99
- return fetch("./sdk-config.json")
100
- .then((response) => {
98
+ if (isEmptyObject(this.sdkConfig)) {
99
+ return fetch('./sdk-config.json')
100
+ .then(response => {
101
101
  if (response.ok) {
102
102
  return response.json();
103
103
  }
@@ -105,12 +105,13 @@ class ConfigAccess {
105
105
  throw new Error(`Failed with status:${response.status}`);
106
106
  }
107
107
  })
108
- .then((data) => {
108
+ .then(data => {
109
109
  this.sdkConfig = data;
110
110
  this.fixupConfigSettings();
111
111
  return Promise.resolve(this.sdkConfig);
112
- }).catch(err => {
113
- console.error("Fetch for sdk-config.js failed.");
112
+ })
113
+ .catch(err => {
114
+ console.error('Fetch for sdk-config.js failed.');
114
115
  console.error(err);
115
116
  return Promise.reject(err);
116
117
  });
@@ -121,98 +122,91 @@ class ConfigAccess {
121
122
  }
122
123
  // Adjust any settings like setting up defaults or making sure URIs have a trailing slash
123
124
  fixupConfigSettings() {
124
- const oServerConfig = this.sdkConfig["serverConfig"];
125
+ const oServerConfig = this.sdkConfig['serverConfig'];
125
126
  // If not present, then use current root path
126
127
  oServerConfig.sdkContentServerUrl = oServerConfig.sdkContentServerUrl || window.location.origin;
127
128
  // Needs a trailing slash so add one if not there
128
129
  if (!oServerConfig.sdkContentServerUrl.endsWith('/')) {
129
130
  oServerConfig.sdkContentServerUrl = `${oServerConfig.sdkContentServerUrl}/`;
130
131
  }
131
- console.log(`Using sdkContentServerUrl: ${this.sdkConfig["serverConfig"].sdkContentServerUrl}`);
132
+ console.log(`Using sdkContentServerUrl: ${this.sdkConfig['serverConfig'].sdkContentServerUrl}`);
132
133
  // Don't want a trailing slash for infinityRestServerUrl
133
134
  if (oServerConfig.infinityRestServerUrl.endsWith('/')) {
134
135
  oServerConfig.infinityRestServerUrl = oServerConfig.infinityRestServerUrl.slice(0, -1);
135
136
  }
136
137
  // Specify our own internal list of well known portals to exclude (if one not specified)
137
138
  if (!oServerConfig.excludePortals) {
138
- oServerConfig.excludePortals = ["pxExpress", "Developer", "pxPredictionStudio", "pxAdminStudio", "pyCaseWorker", "pyCaseManager7"];
139
+ oServerConfig.excludePortals = [
140
+ 'pxExpress',
141
+ 'Developer',
142
+ 'pxPredictionStudio',
143
+ 'pxAdminStudio',
144
+ 'pyCaseWorker',
145
+ 'pyCaseManager7'
146
+ ];
139
147
  console.warn(`No exludePortals entry found within serverConfig section of sdk-config.json. Using the following default list: ["pxExpress", "Developer", "pxPredictionStudio", "pxAdminStudio", "pyCaseWorker", "pyCaseManager7"]`);
140
148
  }
141
149
  }
142
150
  /**
143
- * If this.sdkConfig.serverConfig.appPortal is set, leave it and the specified portal will be used.
144
- * If not set, set this.sdkConfig.serverConfig.appPortal to default portal of currently logged in user
151
+ * Get available portals which supports SDK
152
+ * @returns list of available portals (portals other than excludingPortals list)
145
153
  */
146
- async selectPortal() {
147
- if (Utils.isEmptyObject(this.sdkConfig)) {
148
- await getSdkConfig();
149
- }
150
- const serverConfig = this.sdkConfig.serverConfig;
151
- if ((serverConfig.appPortal !== "") &&
152
- (serverConfig.appPortal !== undefined)) {
153
- // use the specified portal
154
- console.log(`Using appPortal: ${serverConfig.appPortal}`);
155
- return;
156
- }
157
- const userAccessGroup = PCore.getEnvironmentInfo().getAccessGroup();
158
- const dataPageName = "D_OperatorAccessGroups";
159
- const serverUrl = serverConfig.infinityRestServerUrl;
160
- const appAlias = serverConfig.appAlias;
161
- const appAliasPath = appAlias ? `/app/${appAlias}` : '';
162
- const arExcludedPortals = serverConfig["excludePortals"];
163
- // Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find
164
- // a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal
165
- await fetch(`${serverUrl}${appAliasPath}/api/v1/data/${dataPageName}`, {
166
- method: 'GET',
167
- headers: {
168
- 'Content-Type': 'application/json',
169
- 'Authorization': sdkGetAuthHeader()
170
- }
171
- })
172
- .then(response => {
173
- if (response.ok && response.status === 200) {
174
- return response.json();
154
+ async getAvailablePortals() {
155
+ return new Promise(async (resolve, reject) => {
156
+ if (isEmptyObject(this.sdkConfig)) {
157
+ await getSdkConfig();
175
158
  }
176
- else {
177
- if (response.status === 401) {
178
- // Might be either a real token expiration or revoke, but more likely that the "api" service package is misconfigured
179
- throw (new Error(`Attempt to access ${dataPageName} failed. The "api" service package is likely not configured to use "OAuth 2.0"`));
159
+ const serverConfig = this.sdkConfig.serverConfig;
160
+ const userAccessGroup = PCore.getEnvironmentInfo().getAccessGroup();
161
+ const dataPageName = 'D_OperatorAccessGroups';
162
+ const serverUrl = serverConfig.infinityRestServerUrl;
163
+ const appAlias = serverConfig.appAlias;
164
+ const appAliasPath = appAlias ? `/app/${appAlias}` : '';
165
+ const arExcludedPortals = serverConfig['excludePortals'];
166
+ let headers = {
167
+ Authorization: sdkGetAuthHeader(),
168
+ 'Content-Type': 'application/json'
169
+ };
170
+ // Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find
171
+ // a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal
172
+ fetch(`${serverUrl}${appAliasPath}/api/v1/data/${dataPageName}`, {
173
+ method: 'GET',
174
+ headers
175
+ })
176
+ .then(response => {
177
+ if (response.ok && response.status === 200) {
178
+ return response.json();
180
179
  }
181
- ;
182
- throw (new Error(`HTTP Error: ${response.status}`));
183
- }
184
- })
185
- .then(async (agData) => {
186
- let arAccessGroups = agData.pxResults;
187
- let selectedPortal = null;
188
- for (let ag of arAccessGroups) {
189
- if (ag.pyAccessGroup === userAccessGroup) {
190
- // Check if default portal works
191
- if (!arExcludedPortals.includes(ag.pyPortal)) {
192
- selectedPortal = ag.pyPortal;
180
+ else {
181
+ if (response.status === 401) {
182
+ // Might be either a real token expiration or revoke, but more likely that the "api" service package is misconfigured
183
+ throw new Error(`Attempt to access ${dataPageName} failed. The "api" service package is likely not configured to use "OAuth 2.0"`);
193
184
  }
194
- else {
185
+ throw new Error(`HTTP Error: ${response.status}`);
186
+ }
187
+ })
188
+ .then(async (agData) => {
189
+ const arAccessGroups = agData.pxResults;
190
+ const availablePortals = [];
191
+ for (let ag of arAccessGroups) {
192
+ if (ag.pyAccessGroup === userAccessGroup) {
195
193
  console.error(`Default portal for current operator (${ag.pyPortal}) is not compatible with SDK.\nConsider using a different operator, adjusting the default portal for this operator, or using "appPortal" setting within sdk-config.json to specify a specific portal to load.`);
196
- // Find first portal that is not excluded (might work)
197
194
  for (let portal of ag.pyUserPortals) {
198
195
  if (!arExcludedPortals.includes(portal.pyPortalLayout)) {
199
- selectedPortal = portal.pyPortalLayout;
200
- break;
196
+ availablePortals.push(portal.pyPortalLayout);
201
197
  }
202
198
  }
199
+ break;
203
200
  }
204
- break;
205
201
  }
206
- }
207
- if (selectedPortal) {
208
202
  // Found operator's current access group. Use its portal
209
- this.setSdkConfigServer("appPortal", selectedPortal);
210
- console.log(`Using non-excluded portal: ${serverConfig.appPortal}`);
211
- }
212
- })
213
- .catch(e => {
214
- console.error(e.message);
215
- // check specific error if 401, and wiped out if so stored token is stale. Fetch new tokens.
203
+ console.log(`Available portals: ${availablePortals}`);
204
+ resolve(availablePortals);
205
+ })
206
+ .catch(e => {
207
+ console.error(e.message);
208
+ // check specific error if 401, and wiped out if so stored token is stale. Fetch new tokens.
209
+ });
216
210
  });
217
211
  }
218
212
  }
@@ -224,10 +218,9 @@ async function createSdkConfigAccess() {
224
218
  await singleton.readSdkConfig();
225
219
  return singleton;
226
220
  }
227
- ;
228
221
  // Initialize exported SdkConfigAccess structure
229
222
  async function getSdkConfig() {
230
- return new Promise((resolve) => {
223
+ return new Promise(resolve => {
231
224
  let idNextCheck = null;
232
225
  if (!SdkConfigAccess && !SdkConfigAccessCreateInProgress) {
233
226
  SdkConfigAccessCreateInProgress = true;
@@ -237,7 +230,7 @@ async function getSdkConfig() {
237
230
  SdkConfigAccessCreateInProgress = false;
238
231
  // console.log(`SdkConfigAccess: ${JSON.stringify(SdkConfigAccess)}`);
239
232
  // Create and dispatch the SdkConfigAccessReady event
240
- const event = new CustomEvent("SdkConfigAccessReady", {});
233
+ const event = new CustomEvent('SdkConfigAccessReady', {});
241
234
  document.dispatchEvent(event);
242
235
  return resolve(SdkConfigAccess.sdkConfig);
243
236
  });
@@ -1 +1 @@
1
- {"version":3,"file":"config_access.js","sourceRoot":"","sources":["../../../src/components/helpers/config_access.js"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,uBAAuB;AACvB,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,sFAAsF;AACtF,kGAAkG;AAClG,+FAA+F;AAC/F,IAAI,eAAe,CAAC;AACpB,IAAI,+BAA+B,GAAG,KAAK,CAAC;AAG5C,MAAM,YAAY;IAEhB;QA6D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xC,eAAe,GAAG,eAAe,CAAC;gBAClC,+BAA+B,GAAG,KAAK,CAAC;gBACxC,sEAAsE;gBACtE,qDAAqD;gBACrD,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,sBAAsB,EAAE,EAAG,CAAC,CAAC;gBAC3D,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAC9B,OAAO,OAAO,CAAE,eAAe,CAAC,SAAS,CAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,gBAAgB,GAAG,GAAG,EAAE;gBAC5B,IAAI,eAAe,EAAG;oBACpB,IAAI,WAAW,EAAG;wBAChB,aAAa,CAAC,WAAW,CAAC,CAAC;qBAC5B;oBACD,OAAO,OAAO,CAAE,eAAe,CAAC,SAAS,CAAE,CAAC;iBAC7C;gBACD,WAAW,GAAG,WAAW,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;YACnD,CAAC,CAAC;YACF,IAAI,eAAe,EAAG;gBACpB,OAAO,OAAO,CAAE,eAAe,CAAC,SAAS,CAAE,CAAC;aAC7C;iBAAM;gBACL,WAAW,GAAG,WAAW,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;aAClD;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,IAAI,EAAG;IACT,IAAI,MAAM,GAAG,YAAY,EAAE,CAAC;CAC7B;AAED,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,CAAC","sourcesContent":["// Helper singleton class to assist with loading and accessing\n// the SDK Config JSON\nimport {sdkGetAuthHeader} from './authManager';\nimport Utils from './utils';\n\n// Create a singleton for this class (with async loading of config file) and export it\n// Note: Initialzing SdkConfigAccess to null seems to cause lots of compile issues with references\n// within other components and the value potentially being null (so try to leave it undefined)\nlet SdkConfigAccess;\nlet SdkConfigAccessCreateInProgress = false;\n\n\nclass ConfigAccess {\n\n constructor() {\n // sdkConfig is the JSON object read from the sdk-config.json file\n this.sdkConfig = {};\n // isConfigLoaded will be updated to true after the async load is complete\n this.isConfigLoaded = false;\n\n // The \"work\" to load the config file is done (asynchronously) via the initialize\n // (Factory function) below)\n }\n\n /**\n * Asynchronous initialization of the config file contents.\n * @returns Promise of config file fetch\n */\n async readSdkConfig() {\n if(Utils.isEmptyObject(this.sdkConfig)) {\n return fetch(\"./sdk-config.json\")\n .then ( (response) => {\n if( response.ok ) {\n return response.json();\n } else {\n throw new Error(`Failed with status:${response.status}`);\n }\n })\n .then ( (data) => {\n this.sdkConfig = data;\n this.fixupConfigSettings();\n return Promise.resolve(this.sdkConfig);\n }).catch(err => {\n console.error(\"Fetch for sdk-config.js failed.\");\n console.error(err);\n return Promise.reject(err);\n });\n } else {\n return Promise.resolve(this.sdkConfig);\n }\n }\n\n // Adjust any settings like setting up defaults or making sure URIs have a trailing slash\n fixupConfigSettings() {\n const oServerConfig = this.sdkConfig[\"serverConfig\"];\n // If not present, then use current root path\n oServerConfig.sdkContentServerUrl = oServerConfig.sdkContentServerUrl || window.location.origin;\n // Needs a trailing slash so add one if not there\n if( !oServerConfig.sdkContentServerUrl.endsWith('/') ) {\n oServerConfig.sdkContentServerUrl = `${oServerConfig.sdkContentServerUrl}/`;\n }\n console.log(`Using sdkContentServerUrl: ${this.sdkConfig[\"serverConfig\"].sdkContentServerUrl}`);\n\n // Don't want a trailing slash for infinityRestServerUrl\n if( oServerConfig.infinityRestServerUrl.endsWith('/') ) {\n oServerConfig.infinityRestServerUrl = oServerConfig.infinityRestServerUrl.slice(0, -1)\n }\n\n // Specify our own internal list of well known portals to exclude (if one not specified)\n if( !oServerConfig.excludePortals ) {\n oServerConfig.excludePortals = [\"pxExpress\", \"Developer\", \"pxPredictionStudio\", \"pxAdminStudio\", \"pyCaseWorker\", \"pyCaseManager7\"];\n console.warn(`No exludePortals entry found within serverConfig section of sdk-config.json. Using the following default list: [\"pxExpress\", \"Developer\", \"pxPredictionStudio\", \"pxAdminStudio\", \"pyCaseWorker\", \"pyCaseManager7\"]`);\n }\n }\n\n /**\n *\n * @returns the sdk-config JSON object\n */\n getSdkConfig = async () => {\n if(Utils.isEmptyObject(this.sdkConfig)) {\n await getSdkConfig();\n }\n return this.sdkConfig;\n }\n\n\n /**\n *\n * @returns the authConfig block in the SDK Config object\n */\n getSdkConfigAuth = () => {\n if(Utils.isEmptyObject(this.sdkConfig)) {\n const config = this.getSdkConfig();\n }\n return this.sdkConfig[\"authConfig\"];\n }\n\n /**\n *\n * @returns the serverConfig bloc from the sdk-config.json file\n */\n getSdkConfigServer = () => {\n if(Utils.isEmptyObject(this.sdkConfig)) {\n const config = this.getSdkConfig();\n }\n return this.sdkConfig[\"serverConfig\"];\n }\n\n\n /**\n * @param {String} key the key to be inserted/updated in serverConfig\n * @param {String} value the value to be assigned to the given key\n */\n setSdkConfigServer = (key, value) => {\n\n this.sdkConfig.serverConfig[key] = value;\n\n }\n\n /**\n * If this.sdkConfig.serverConfig.appPortal is set, leave it and the specified portal will be used.\n * If not set, set this.sdkConfig.serverConfig.appPortal to default portal of currently logged in user\n */\n async selectPortal() {\n\n if(Utils.isEmptyObject(this.sdkConfig)) {\n await getSdkConfig();\n }\n\n const serverConfig = this.sdkConfig.serverConfig;\n\n if ((serverConfig.appPortal !== \"\") &&\n (serverConfig.appPortal !== undefined) ) {\n // use the specified portal\n console.log(`Using appPortal: ${serverConfig.appPortal}`);\n return;\n }\n\n const userAccessGroup = PCore.getEnvironmentInfo().getAccessGroup();\n const dataPageName = \"D_OperatorAccessGroups\";\n const serverUrl = serverConfig.infinityRestServerUrl;\n const appAlias = serverConfig.appAlias;\n const appAliasPath = appAlias ? `/app/${appAlias}` : '';\n const arExcludedPortals = serverConfig[\"excludePortals\"];\n\n // Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find\n // a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal\n await fetch ( `${serverUrl}${appAliasPath}/api/v1/data/${dataPageName}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type' : 'application/json',\n 'Authorization' : sdkGetAuthHeader()\n }\n })\n .then( response => {\n if( response.ok && response.status === 200) {\n return response.json();\n } else {\n if( response.status === 401 ) {\n // Might be either a real token expiration or revoke, but more likely that the \"api\" service package is misconfigured\n throw( new Error(`Attempt to access ${dataPageName} failed. The \"api\" service package is likely not configured to use \"OAuth 2.0\"`));\n };\n throw( new Error(`HTTP Error: ${response.status}`));\n }\n })\n .then( async (agData) => {\n\n let arAccessGroups = agData.pxResults;\n let selectedPortal = null;\n\n for (let ag of arAccessGroups) {\n if (ag.pyAccessGroup === userAccessGroup) {\n // Check if default portal works\n if( !arExcludedPortals.includes(ag.pyPortal) ) {\n selectedPortal = ag.pyPortal;\n } else {\n console.error(`Default portal for current operator (${ag.pyPortal}) is not compatible with SDK.\\nConsider using a different operator, adjusting the default portal for this operator, or using \"appPortal\" setting within sdk-config.json to specify a specific portal to load.`);\n // Find first portal that is not excluded (might work)\n for (let portal of ag.pyUserPortals ) {\n if( !arExcludedPortals.includes(portal.pyPortalLayout) ) {\n selectedPortal = portal.pyPortalLayout;\n break;\n }\n }\n }\n break;\n }\n }\n if( selectedPortal ) {\n // Found operator's current access group. Use its portal\n this.setSdkConfigServer(\"appPortal\", selectedPortal);\n console.log(`Using non-excluded portal: ${serverConfig.appPortal}`);\n }\n })\n .catch( e => {\n console.error(e.message);\n // check specific error if 401, and wiped out if so stored token is stale. Fetch new tokens.\n });\n\n }\n\n /**\n * Path to the BootstrapCSS\n * @returns the locBootstrapCSS from the serverConfig block of the sdk-config.json file\n */\n getSdkConfigBootstrapCSS = () => {\n const serverConfig = this.getSdkConfigServer();\n const locBootstrapCSS = serverConfig.locBootstrapCSS;\n if (locBootstrapCSS === undefined) {\n console.error(`locBootstrapCSS: ${locBootstrapCSS}`);\n }\n return locBootstrapCSS;\n }\n\n}\n\n\n// Implement Factory function to allow async load\n// See https://stackoverflow.com/questions/49905178/asynchronous-operations-in-constructor/49906064#49906064 for inspiration\nasync function createSdkConfigAccess() {\n // Note that our initialize function returns a promise...\n let singleton = new ConfigAccess();\n await singleton.readSdkConfig();\n return singleton;\n};\n\n// Initialize exported SdkConfigAccess structure\nasync function getSdkConfig() {\n return new Promise( (resolve) => {\n let idNextCheck = null;\n if( !SdkConfigAccess && !SdkConfigAccessCreateInProgress ) {\n SdkConfigAccessCreateInProgress = true;\n createSdkConfigAccess().then( theConfigAccess => {\n // Key initialization of SdkConfigAccess\n SdkConfigAccess = theConfigAccess;\n SdkConfigAccessCreateInProgress = false;\n // console.log(`SdkConfigAccess: ${JSON.stringify(SdkConfigAccess)}`);\n // Create and dispatch the SdkConfigAccessReady event\n const event = new CustomEvent(\"SdkConfigAccessReady\", { });\n document.dispatchEvent(event);\n return resolve( SdkConfigAccess.sdkConfig );\n });\n } else {\n const fnCheckForConfig = () => {\n if( SdkConfigAccess ) {\n if( idNextCheck ) {\n clearInterval(idNextCheck);\n }\n return resolve( SdkConfigAccess.sdkConfig );\n }\n idNextCheck = setInterval(fnCheckForConfig, 500);\n };\n if( SdkConfigAccess ) {\n return resolve( SdkConfigAccess.sdkConfig );\n } else {\n idNextCheck = setInterval(fnCheckForConfig, 500);\n }\n }\n });\n}\n\nif( true ) {\n let ignore = getSdkConfig();\n}\n\nexport {SdkConfigAccess, getSdkConfig};\n"]}
1
+ {"version":3,"file":"config_access.js","sourceRoot":"","sources":["../../../src/components/helpers/config_access.js"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,uBAAuB;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,sFAAsF;AACtF,kGAAkG;AAClG,+FAA+F;AAC/F,IAAI,eAAe,CAAC;AACpB,IAAI,+BAA+B,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY;IAChB;QAuEA;;;WAGG;QACH;;;;mBAAe,KAAK,IAAI,EAAE;gBACxB,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;oBACjC,MAAM,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,CAAC,CAAC;YACnD,CAAC,CAAC;YACF,IAAI,eAAe,EAAE;gBACnB,OAAO,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;aAC3C;iBAAM;gBACL,WAAW,GAAG,WAAW,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;aAClD;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,IAAI,EAAE;IACR,IAAI,MAAM,GAAG,YAAY,EAAE,CAAC;CAC7B;AAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC","sourcesContent":["// Helper singleton class to assist with loading and accessing\n// the SDK Config JSON\nimport { sdkGetAuthHeader } from './authManager';\nimport { isEmptyObject } from './common-utils';\n\n// Create a singleton for this class (with async loading of config file) and export it\n// Note: Initialzing SdkConfigAccess to null seems to cause lots of compile issues with references\n// within other components and the value potentially being null (so try to leave it undefined)\nlet SdkConfigAccess;\nlet SdkConfigAccessCreateInProgress = false;\n\nclass ConfigAccess {\n constructor() {\n // sdkConfig is the JSON object read from the sdk-config.json file\n this.sdkConfig = {};\n // isConfigLoaded will be updated to true after the async load is complete\n this.isConfigLoaded = false;\n\n // The \"work\" to load the config file is done (asynchronously) via the initialize\n // (Factory function) below)\n }\n\n /**\n * Asynchronous initialization of the config file contents.\n * @returns Promise of config file fetch\n */\n async readSdkConfig() {\n if (isEmptyObject(this.sdkConfig)) {\n return fetch('./sdk-config.json')\n .then(response => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(`Failed with status:${response.status}`);\n }\n })\n .then(data => {\n this.sdkConfig = data;\n this.fixupConfigSettings();\n return Promise.resolve(this.sdkConfig);\n })\n .catch(err => {\n console.error('Fetch for sdk-config.js failed.');\n console.error(err);\n return Promise.reject(err);\n });\n } else {\n return Promise.resolve(this.sdkConfig);\n }\n }\n\n // Adjust any settings like setting up defaults or making sure URIs have a trailing slash\n fixupConfigSettings() {\n const oServerConfig = this.sdkConfig['serverConfig'];\n // If not present, then use current root path\n oServerConfig.sdkContentServerUrl = oServerConfig.sdkContentServerUrl || window.location.origin;\n // Needs a trailing slash so add one if not there\n if (!oServerConfig.sdkContentServerUrl.endsWith('/')) {\n oServerConfig.sdkContentServerUrl = `${oServerConfig.sdkContentServerUrl}/`;\n }\n console.log(`Using sdkContentServerUrl: ${this.sdkConfig['serverConfig'].sdkContentServerUrl}`);\n\n // Don't want a trailing slash for infinityRestServerUrl\n if (oServerConfig.infinityRestServerUrl.endsWith('/')) {\n oServerConfig.infinityRestServerUrl = oServerConfig.infinityRestServerUrl.slice(0, -1);\n }\n\n // Specify our own internal list of well known portals to exclude (if one not specified)\n if (!oServerConfig.excludePortals) {\n oServerConfig.excludePortals = [\n 'pxExpress',\n 'Developer',\n 'pxPredictionStudio',\n 'pxAdminStudio',\n 'pyCaseWorker',\n 'pyCaseManager7'\n ];\n console.warn(\n `No exludePortals entry found within serverConfig section of sdk-config.json. Using the following default list: [\"pxExpress\", \"Developer\", \"pxPredictionStudio\", \"pxAdminStudio\", \"pyCaseWorker\", \"pyCaseManager7\"]`\n );\n }\n }\n\n /**\n *\n * @returns the sdk-config JSON object\n */\n getSdkConfig = async () => {\n if (isEmptyObject(this.sdkConfig)) {\n await getSdkConfig();\n }\n return this.sdkConfig;\n };\n\n /**\n *\n * @returns the authConfig block in the SDK Config object\n */\n getSdkConfigAuth = () => {\n if (isEmptyObject(this.sdkConfig)) {\n const config = this.getSdkConfig();\n }\n return this.sdkConfig['authConfig'];\n };\n\n /**\n *\n * @returns the serverConfig bloc from the sdk-config.json file\n */\n getSdkConfigServer = () => {\n if (isEmptyObject(this.sdkConfig)) {\n const config = this.getSdkConfig();\n }\n return this.sdkConfig['serverConfig'];\n };\n\n /**\n * @param {String} key the key to be inserted/updated in serverConfig\n * @param {String} value the value to be assigned to the given key\n */\n setSdkConfigServer = (key, value) => {\n this.sdkConfig.serverConfig[key] = value;\n };\n\n /**\n * Get available portals which supports SDK\n * @returns list of available portals (portals other than excludingPortals list)\n */\n async getAvailablePortals() {\n return new Promise(async (resolve, reject) => {\n if (isEmptyObject(this.sdkConfig)) {\n await getSdkConfig();\n }\n\n const serverConfig = this.sdkConfig.serverConfig;\n\n const userAccessGroup = PCore.getEnvironmentInfo().getAccessGroup();\n const dataPageName = 'D_OperatorAccessGroups';\n const serverUrl = serverConfig.infinityRestServerUrl;\n const appAlias = serverConfig.appAlias;\n const appAliasPath = appAlias ? `/app/${appAlias}` : '';\n const arExcludedPortals = serverConfig['excludePortals'];\n let headers = {\n Authorization: sdkGetAuthHeader(),\n 'Content-Type': 'application/json'\n };\n\n // Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find\n // a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal\n fetch(`${serverUrl}${appAliasPath}/api/v1/data/${dataPageName}`, {\n method: 'GET',\n headers\n })\n .then(response => {\n if (response.ok && response.status === 200) {\n return response.json();\n } else {\n if (response.status === 401) {\n // Might be either a real token expiration or revoke, but more likely that the \"api\" service package is misconfigured\n throw new Error(\n `Attempt to access ${dataPageName} failed. The \"api\" service package is likely not configured to use \"OAuth 2.0\"`\n );\n }\n throw new Error(`HTTP Error: ${response.status}`);\n }\n })\n .then(async agData => {\n const arAccessGroups = agData.pxResults;\n const availablePortals = [];\n\n for (let ag of arAccessGroups) {\n if (ag.pyAccessGroup === userAccessGroup) {\n console.error(\n `Default portal for current operator (${ag.pyPortal}) is not compatible with SDK.\\nConsider using a different operator, adjusting the default portal for this operator, or using \"appPortal\" setting within sdk-config.json to specify a specific portal to load.`\n );\n for (let portal of ag.pyUserPortals) {\n if (!arExcludedPortals.includes(portal.pyPortalLayout)) {\n availablePortals.push(portal.pyPortalLayout);\n }\n }\n break;\n }\n }\n\n // Found operator's current access group. Use its portal\n console.log(`Available portals: ${availablePortals}`);\n\n resolve(availablePortals);\n })\n .catch(e => {\n console.error(e.message);\n // check specific error if 401, and wiped out if so stored token is stale. Fetch new tokens.\n });\n });\n }\n\n /**\n * Path to the BootstrapCSS\n * @returns the locBootstrapCSS from the serverConfig block of the sdk-config.json file\n */\n getSdkConfigBootstrapCSS = () => {\n const serverConfig = this.getSdkConfigServer();\n const locBootstrapCSS = serverConfig.locBootstrapCSS;\n if (locBootstrapCSS === undefined) {\n console.error(`locBootstrapCSS: ${locBootstrapCSS}`);\n }\n return locBootstrapCSS;\n };\n}\n\n// Implement Factory function to allow async load\n// See https://stackoverflow.com/questions/49905178/asynchronous-operations-in-constructor/49906064#49906064 for inspiration\nasync function createSdkConfigAccess() {\n // Note that our initialize function returns a promise...\n let singleton = new ConfigAccess();\n await singleton.readSdkConfig();\n return singleton;\n}\n\n// Initialize exported SdkConfigAccess structure\nasync function getSdkConfig() {\n return new Promise(resolve => {\n let idNextCheck = null;\n if (!SdkConfigAccess && !SdkConfigAccessCreateInProgress) {\n SdkConfigAccessCreateInProgress = true;\n createSdkConfigAccess().then(theConfigAccess => {\n // Key initialization of SdkConfigAccess\n SdkConfigAccess = theConfigAccess;\n SdkConfigAccessCreateInProgress = false;\n // console.log(`SdkConfigAccess: ${JSON.stringify(SdkConfigAccess)}`);\n // Create and dispatch the SdkConfigAccessReady event\n const event = new CustomEvent('SdkConfigAccessReady', {});\n document.dispatchEvent(event);\n return resolve(SdkConfigAccess.sdkConfig);\n });\n } else {\n const fnCheckForConfig = () => {\n if (SdkConfigAccess) {\n if (idNextCheck) {\n clearInterval(idNextCheck);\n }\n return resolve(SdkConfigAccess.sdkConfig);\n }\n idNextCheck = setInterval(fnCheckForConfig, 500);\n };\n if (SdkConfigAccess) {\n return resolve(SdkConfigAccess.sdkConfig);\n } else {\n idNextCheck = setInterval(fnCheckForConfig, 500);\n }\n }\n });\n}\n\nif (true) {\n let ignore = getSdkConfig();\n}\n\nexport { SdkConfigAccess, getSdkConfig };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"data_page.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,wEAoBvB,CAAC"}
1
+ {"version":3,"file":"data_page.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,wEAoBvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"data_page.js","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAC/D,IAAI,cAAc,CAAC;IACnB,IAAG,UAAU,EAAC;QACZ,cAAc,GAAG;YACf,oBAAoB,EAAE,UAAU;SACjC,CAAC;KACH;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,KAAK,CAAC,eAAe,EAAE;aACpB,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC;aAC9C,IAAI,CAAC,QAAQ,CAAC,EAAE;YACf,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE;YACT,IAAI,CAAC,EAAE;gBACL,8FAA8F;gBAC9F,MAAM,CAAC,CAAC,CAAC,CAAC;aACX;QACH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["declare const PCore;\n\n// eslint-disable-next-line import/prefer-default-export\nexport const getDataPage = (dataPageName, parameters, context) => {\n let dataViewParams;\n if(parameters){\n dataViewParams = {\n 'dataViewParameters': parameters\n };\n }\n return new Promise((resolve, reject) => {\n PCore.getDataApiUtils()\n .getData(dataPageName, dataViewParams, context)\n .then(response => {\n resolve(response.data.data);\n })\n .catch(e => {\n if (e) {\n // check specific error if 401, and wiped out if so stored token is stale. Fetcch new tokens.\n reject(e);\n }\n });\n });\n};\n"]}
1
+ {"version":3,"file":"data_page.js","sourceRoot":"","sources":["../../../src/components/helpers/data_page.ts"],"names":[],"mappings":"AAGA,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAC/D,IAAI,cAAc,CAAC;IACnB,IAAG,UAAU,EAAC;QACZ,cAAc,GAAG;YACf,oBAAoB,EAAE,UAAU;SACjC,CAAC;KACH;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,KAAK,CAAC,eAAe,EAAE;aACpB,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC;aAC9C,IAAI,CAAC,QAAQ,CAAC,EAAE;YACf,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE;YACT,IAAI,CAAC,EAAE;gBACL,8FAA8F;gBAC9F,MAAM,CAAC,CAAC,CAAC,CAAC;aACX;QACH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 1 error)\ndeclare const PCore: any;\n\n// eslint-disable-next-line import/prefer-default-export\nexport const getDataPage = (dataPageName, parameters, context) => {\n let dataViewParams;\n if(parameters){\n dataViewParams = {\n 'dataViewParameters': parameters\n };\n }\n return new Promise((resolve, reject) => {\n PCore.getDataApiUtils()\n .getData(dataPageName, dataViewParams, context)\n .then(response => {\n resolve(response.data.data);\n })\n .catch(e => {\n if (e) {\n // check specific error if 401, and wiped out if so stored token is stale. Fetcch new tokens.\n reject(e);\n }\n });\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"date-format-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;CAuD7B,CAAA"}
1
+ {"version":3,"file":"date-format-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;CAkE7B,CAAC"}
@@ -1,13 +1,15 @@
1
1
  import { getLocale } from './formatters/common';
2
2
  export const dateFormatInfoDefault = {
3
- dateFormatString: "MM/DD/YYYY",
4
- dateFormatStringLong: "MMM DD, YYYY",
5
- dateFormatStringLC: "mm/dd/yyyy",
6
- dateFormatMask: "__/__/____"
3
+ dateFormatString: 'MM/DD/YYYY',
4
+ dateFormatStringLong: 'MMM DD, YYYY',
5
+ dateFormatStringLC: 'mm/dd/yyyy',
6
+ dateFormatMask: '__/__/____'
7
7
  };
8
8
  export const getDateFormatInfo = () => {
9
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
10
+ const localeCategory = 'CosmosFields';
9
11
  const theDateFormatInfo = dateFormatInfoDefault;
10
- const theLocale = getLocale(); // PCore.getEnvironmentInfo().getUseLocale() || "US-en";
12
+ const theLocale = getLocale();
11
13
  // NOTE: this date was chosen since it has a day larger than 12. If you change it,
12
14
  // you'll need to change the indexOf values below!
13
15
  const theTestDate = new Date(Date.parse('30 November 2023 12:00:00 GMT'));
@@ -18,27 +20,34 @@ export const getDateFormatInfo = () => {
18
20
  const locMM = theTestDateLocaleString.indexOf('11');
19
21
  const locDD = theTestDateLocaleString.indexOf('30');
20
22
  const locYYYY = theTestDateLocaleString.indexOf('2023');
23
+ // If localized placeholder exists for one of day/month/year then show it otherwise fall back to ddmmyyyy
24
+ const localizedPlaceholderExists = localizedVal('month_placeholder', localeCategory) !== 'month_placeholder' ||
25
+ localizedVal('day_placeholder', localeCategory) !== 'day_placeholder' ||
26
+ localizedVal('year_placeholder', localeCategory) !== 'year_placeholder';
21
27
  const arrPieces = [
22
28
  {
23
29
  loc: locMM,
24
30
  format: 'MM',
25
31
  longFormat: 'MMM',
26
- placeholder: 'mm',
27
- mask: '__'
32
+ placeholder: localizedPlaceholderExists ? localizedVal('month_placeholder', localeCategory) : 'mm',
33
+ mask: '__',
34
+ separator: theTestDateLocaleString[locMM + 2]
28
35
  },
29
36
  {
30
37
  loc: locDD,
31
38
  format: 'DD',
32
39
  longFormat: 'DD',
33
- placeholder: 'dd',
34
- mask: '__'
40
+ placeholder: localizedPlaceholderExists ? localizedVal('day_placeholder', localeCategory) : 'dd',
41
+ mask: '__',
42
+ separator: theTestDateLocaleString[locDD + 2]
35
43
  },
36
44
  {
37
45
  loc: locYYYY,
38
46
  format: 'YYYY',
39
47
  longFormat: 'YYYY',
40
- placeholder: 'yyyy',
41
- mask: '____'
48
+ placeholder: localizedPlaceholderExists ? localizedVal('year_placeholder', localeCategory) : 'yyyy',
49
+ mask: '____',
50
+ separator: theTestDateLocaleString[locYYYY + 4]
42
51
  }
43
52
  ];
44
53
  // Sort the associative array by order of appearance (loc) of each piece
@@ -50,10 +59,10 @@ export const getDateFormatInfo = () => {
50
59
  return 0;
51
60
  });
52
61
  // Construct the structure to return...
53
- theDateFormatInfo.dateFormatString = `${arrPieces[0].format}/${arrPieces[1].format}/${arrPieces[2].format}`;
62
+ theDateFormatInfo.dateFormatString = `${arrPieces[0].format}${arrPieces[0].separator}${arrPieces[1].format}${arrPieces[1].separator}${arrPieces[2].format}`;
54
63
  theDateFormatInfo.dateFormatStringLong = `${arrPieces[0].longFormat} ${arrPieces[1].longFormat}, ${arrPieces[2].longFormat}`;
55
- theDateFormatInfo.dateFormatStringLC = `${arrPieces[0].placeholder}/${arrPieces[1].placeholder}/${arrPieces[2].placeholder}`;
56
- theDateFormatInfo.dateFormatMask = `${arrPieces[0].mask}/${arrPieces[1].mask}/${arrPieces[2].mask}`;
64
+ theDateFormatInfo.dateFormatStringLC = `${arrPieces[0].placeholder}${arrPieces[0].separator}${arrPieces[1].placeholder}${arrPieces[1].separator}${arrPieces[2].placeholder}`;
65
+ theDateFormatInfo.dateFormatMask = `${arrPieces[0].mask}${arrPieces[0].separator}${arrPieces[1].mask}${arrPieces[1].separator}${arrPieces[2].mask}`;
57
66
  return theDateFormatInfo;
58
67
  };
59
68
  //# sourceMappingURL=date-format-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-format-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,gBAAgB,EAAE,YAAY;IAC9B,oBAAoB,EAAE,cAAc;IACpC,kBAAkB,EAAE,YAAY;IAChC,cAAc,EAAE,YAAY;CAC7B,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;IAChD,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC,CAAC,wDAAwD;IAEvF,kFAAkF;IAClF,mDAAmD;IACnD,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAC1E,MAAM,uBAAuB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAEvF,8FAA8F;IAE9F,qFAAqF;IACrF,sEAAsE;IACtE,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,SAAS,GAAG;QAChB;YACE,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,IAAI;SACX;QACD;YACE,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,CAAC,IAAI,EAAE,CAAC;IAEpG,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA","sourcesContent":["import { getLocale } from './formatters/common';\n\n\nexport const dateFormatInfoDefault = {\n dateFormatString: \"MM/DD/YYYY\",\n dateFormatStringLong: \"MMM DD, YYYY\",\n dateFormatStringLC: \"mm/dd/yyyy\",\n dateFormatMask: \"__/__/____\"\n}\n\nexport const getDateFormatInfo = () => {\n const theDateFormatInfo = dateFormatInfoDefault;\n const theLocale = getLocale(); // PCore.getEnvironmentInfo().getUseLocale() || \"US-en\";\n\n // NOTE: this date was chosen since it has a day larger than 12. If you change it,\n // you'll need to change the indexOf values below!\n const theTestDate = new Date(Date.parse('30 November 2023 12:00:00 GMT'));\n const theTestDateLocaleString = new Intl.DateTimeFormat(theLocale).format(theTestDate);\n\n // console.log(`theLocale: ${theLocale} theTestDateLocaleString: ${theTestDateLocaleString}`);\n\n // Build the format string based on where '11' (mm), '30' (dd), and '2023' (yyyy) are\n // Example: US locations are 0, 3, 6 but for NL locations are 3, 0, 6\n const locMM = theTestDateLocaleString.indexOf('11');\n const locDD = theTestDateLocaleString.indexOf('30');\n const locYYYY = theTestDateLocaleString.indexOf('2023');\n\n const arrPieces = [\n {\n loc: locMM,\n format: 'MM',\n longFormat: 'MMM',\n placeholder: 'mm',\n mask: '__'\n },\n {\n loc: locDD,\n format: 'DD',\n longFormat: 'DD',\n placeholder: 'dd',\n mask: '__'\n },\n {\n loc: locYYYY,\n format: 'YYYY',\n longFormat: 'YYYY',\n placeholder: 'yyyy',\n mask: '____'\n }\n ];\n\n // Sort the associative array by order of appearance (loc) of each piece\n arrPieces.sort((a, b) => {\n if (a.loc < b.loc) return -1;\n if (a.loc > b.loc) return 1;\n return 0;\n });\n\n // Construct the structure to return...\n theDateFormatInfo.dateFormatString = `${arrPieces[0].format}/${arrPieces[1].format}/${arrPieces[2].format}`;\n theDateFormatInfo.dateFormatStringLong = `${arrPieces[0].longFormat} ${arrPieces[1].longFormat}, ${arrPieces[2].longFormat}`;\n theDateFormatInfo.dateFormatStringLC = `${arrPieces[0].placeholder}/${arrPieces[1].placeholder}/${arrPieces[2].placeholder}`;\n theDateFormatInfo.dateFormatMask = `${arrPieces[0].mask}/${arrPieces[1].mask}/${arrPieces[2].mask}`;\n\n return theDateFormatInfo;\n}\n"]}
1
+ {"version":3,"file":"date-format-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/date-format-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,gBAAgB,EAAE,YAAY;IAC9B,oBAAoB,EAAE,cAAc;IACpC,kBAAkB,EAAE,YAAY;IAChC,cAAc,EAAE,YAAY;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC;IAC3D,MAAM,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;IAChD,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;IAE9B,kFAAkF;IAClF,mDAAmD;IACnD,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAC1E,MAAM,uBAAuB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAEvF,8FAA8F;IAE9F,qFAAqF;IACrF,sEAAsE;IACtE,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,yGAAyG;IACzG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,GAAG,GAAG,CAAC,CAAC,GAAG;YAAE,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;IAEH,uCAAuC;IACvC,iBAAiB,CAAC,gBAAgB,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5J,iBAAiB,CAAC,oBAAoB,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAC7H,iBAAiB,CAAC,kBAAkB,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7K,iBAAiB,CAAC,cAAc,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAEpJ,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { getLocale } from './formatters/common';\n\nexport const dateFormatInfoDefault = {\n dateFormatString: 'MM/DD/YYYY',\n dateFormatStringLong: 'MMM DD, YYYY',\n dateFormatStringLC: 'mm/dd/yyyy',\n dateFormatMask: '__/__/____'\n};\n\nexport const getDateFormatInfo = () => {\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'CosmosFields';\n const theDateFormatInfo = dateFormatInfoDefault;\n const theLocale = getLocale();\n\n // NOTE: this date was chosen since it has a day larger than 12. If you change it,\n // you'll need to change the indexOf values below!\n const theTestDate = new Date(Date.parse('30 November 2023 12:00:00 GMT'));\n const theTestDateLocaleString = new Intl.DateTimeFormat(theLocale).format(theTestDate);\n\n // console.log(`theLocale: ${theLocale} theTestDateLocaleString: ${theTestDateLocaleString}`);\n\n // Build the format string based on where '11' (mm), '30' (dd), and '2023' (yyyy) are\n // Example: US locations are 0, 3, 6 but for NL locations are 3, 0, 6\n const locMM = theTestDateLocaleString.indexOf('11');\n const locDD = theTestDateLocaleString.indexOf('30');\n const locYYYY = theTestDateLocaleString.indexOf('2023');\n\n // If localized placeholder exists for one of day/month/year then show it otherwise fall back to ddmmyyyy\n const localizedPlaceholderExists =\n localizedVal('month_placeholder', localeCategory) !== 'month_placeholder' ||\n localizedVal('day_placeholder', localeCategory) !== 'day_placeholder' ||\n localizedVal('year_placeholder', localeCategory) !== 'year_placeholder';\n\n const arrPieces = [\n {\n loc: locMM,\n format: 'MM',\n longFormat: 'MMM',\n placeholder: localizedPlaceholderExists ? localizedVal('month_placeholder', localeCategory) : 'mm',\n mask: '__',\n separator: theTestDateLocaleString[locMM+2]\n },\n {\n loc: locDD,\n format: 'DD',\n longFormat: 'DD',\n placeholder: localizedPlaceholderExists ? localizedVal('day_placeholder', localeCategory) : 'dd',\n mask: '__',\n separator: theTestDateLocaleString[locDD+2]\n },\n {\n loc: locYYYY,\n format: 'YYYY',\n longFormat: 'YYYY',\n placeholder: localizedPlaceholderExists ? localizedVal('year_placeholder', localeCategory) : 'yyyy',\n mask: '____',\n separator: theTestDateLocaleString[locYYYY+4]\n }\n ];\n\n // Sort the associative array by order of appearance (loc) of each piece\n arrPieces.sort((a, b) => {\n if (a.loc < b.loc) return -1;\n if (a.loc > b.loc) return 1;\n return 0;\n });\n\n // Construct the structure to return...\n theDateFormatInfo.dateFormatString = `${arrPieces[0].format}${arrPieces[0].separator}${arrPieces[1].format}${arrPieces[1].separator}${arrPieces[2].format}`;\n theDateFormatInfo.dateFormatStringLong = `${arrPieces[0].longFormat} ${arrPieces[1].longFormat}, ${arrPieces[2].longFormat}`;\n theDateFormatInfo.dateFormatStringLC = `${arrPieces[0].placeholder}${arrPieces[0].separator}${arrPieces[1].placeholder}${arrPieces[1].separator}${arrPieces[2].placeholder}`;\n theDateFormatInfo.dateFormatMask = `${arrPieces[0].mask}${arrPieces[0].separator}${arrPieces[1].mask}${arrPieces[1].separator}${arrPieces[2].mask}`;\n\n return theDateFormatInfo;\n};\n"]}
@@ -1,3 +1,3 @@
1
+ declare const handleEvent: (actions: any, eventType: any, propName: any, value: any) => void;
1
2
  export default handleEvent;
2
- declare function handleEvent(actions: any, eventType: any, propName: any, value: any): void;
3
3
  //# sourceMappingURL=event-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.js"],"names":[],"mappings":";AAEA,4FAeC"}
1
+ {"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,mEAehB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.js"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC1D,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,aAAa;YAChB,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR;YACE,MAAM;KACT;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// From DX Components src/utils/event-utils.js\n\nconst handleEvent = (actions, eventType, propName, value) => {\n switch (eventType) {\n case \"change\":\n actions.updateFieldValue(propName, value);\n break;\n case \"blur\":\n actions.triggerFieldChange(propName, value);\n break;\n case \"changeNblur\":\n actions.updateFieldValue(propName, value);\n actions.triggerFieldChange(propName, value);\n break;\n default:\n break;\n }\n};\n\nexport default handleEvent;\n"]}
1
+ {"version":3,"file":"event-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/event-utils.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC1D,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,aAAa;YAChB,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1C,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC5C,MAAM;QACR;YACE,MAAM;KACT;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// From DX Components src/utils/event-utils.js\n\nconst handleEvent = (actions, eventType, propName, value) => {\n switch (eventType) {\n case \"change\":\n actions.updateFieldValue(propName, value);\n break;\n case \"blur\":\n actions.triggerFieldChange(propName, value);\n break;\n case \"changeNblur\":\n actions.updateFieldValue(propName, value);\n actions.triggerFieldChange(propName, value);\n break;\n default:\n break;\n }\n};\n\nexport default handleEvent;\n"]}
@@ -1,3 +1,16 @@
1
- export function getReferenceList(pConn: any): string;
2
- export function buildView(pConn: any, index: any, viewConfigPath: any): any;
1
+ import { ReactElement } from 'react';
2
+ /**
3
+ *
4
+ * @param {*} pConn - pConnect object of the view
5
+ * @returns {string} - returns the name of referenceList
6
+ */
7
+ export declare const getReferenceList: (pConn: any) => any;
8
+ /**
9
+ * creates and returns react element of the view
10
+ * @param {*} pConn - pConnect object of the view
11
+ * @param {*} index - index of the fieldGroup item
12
+ * @param {*} viewConfigPath - boolean value to check for children in config
13
+ * @returns {*} - return the react element of the view
14
+ */
15
+ export declare function buildView(pConn: any, index: any, viewConfigPath: any): ReactElement;
3
16
  //# sourceMappingURL=field-group-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-group-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.js"],"names":[],"mappings":"AAUO,8CAHM,MAAM,CAclB;AASM,4EA0BN"}
1
+ {"version":3,"file":"field-group-utils.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAKpD;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,qBAW5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,cAAc,KAAA,GAAG,YAAY,CA0BpE"}
@@ -25,7 +25,7 @@ export const getReferenceList = pConn => {
25
25
  * @param {*} viewConfigPath - boolean value to check for children in config
26
26
  * @returns {*} - return the react element of the view
27
27
  */
28
- export const buildView = (pConn, index, viewConfigPath) => {
28
+ export function buildView(pConn, index, viewConfigPath) {
29
29
  const context = pConn.getContextName();
30
30
  const referenceList = getReferenceList(pConn);
31
31
  const isDatapage = referenceList.startsWith('D_');
@@ -44,11 +44,11 @@ export const buildView = (pConn, index, viewConfigPath) => {
44
44
  hasForm: true
45
45
  }
46
46
  };
47
- // eslint-disable-next-line no-undef
48
47
  const view = PCore.createPConnect(config);
49
48
  if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {
50
49
  view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');
51
50
  }
52
51
  return createElement(createPConnectComponent(), view);
53
- };
52
+ }
53
+ ;
54
54
  //# sourceMappingURL=field-group-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-group-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAElE;;;;GAIG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,EAAE;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC9B,WAAW,GAAG,KAAK,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC5D,IAAI,WAAW,EAAE,SAAS,EAAE;YAC1B,WAAW,GAAG,WAAW,EAAE,SAAS,CAAC;SACtC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YAC9E,WAAW,GAAG,GAAG,WAAW,YAAY,CAAC;SAC1C;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,UAAU;QAC9B,CAAC,CAAC,GAAG,aAAa,IAAI,KAAK,GAAG;QAC9B,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,EAAE,GAAG,aAAa,IAAI,KAAK,GAAG,CAAC;IAC5D,MAAM,IAAI,GAAG,cAAc;QACzB,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG;QACb,IAAI;QACJ,OAAO,EAAE;YACP,OAAO;YACP,aAAa;YACb,aAAa;YACb,OAAO,EAAE,IAAI;SACd;KACF,CAAC;IACF,oCAAoC;IACpC,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,WAAW,KAAK,aAAa,EAAE;QACzD,IAAI,CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;KACpE;IACD,OAAO,aAAa,CAAC,uBAAuB,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC,CAAC","sourcesContent":["import { createElement } from 'react';\n\nimport createPConnectComponent from '../../bridge/react_pconnect';\n\n/**\n *\n * @param {*} pConn - pConnect object of the view\n * @returns {string} - returns the name of referenceList\n */\n\nexport const getReferenceList = pConn => {\n let resolvePage = pConn.getComponentConfig().referenceList.replace('@P ', '');\n if (resolvePage.includes('D_')) {\n resolvePage = pConn.resolveDatasourceReference(resolvePage);\n if (resolvePage?.pxResults) {\n resolvePage = resolvePage?.pxResults;\n } else if (resolvePage.startsWith('D_') && !resolvePage.endsWith('.pxResults')) {\n resolvePage = `${resolvePage}.pxResults`;\n }\n }\n return resolvePage;\n};\n\n/**\n * creates and returns react element of the view\n * @param {*} pConn - pConnect object of the view\n * @param {*} index - index of the fieldGroup item\n * @param {*} viewConfigPath - boolean value to check for children in config\n * @returns {*} - return the react element of the view\n */\nexport const buildView = (pConn, index, viewConfigPath) => {\n const context = pConn.getContextName();\n const referenceList = getReferenceList(pConn);\n\n const isDatapage = referenceList.startsWith('D_');\n const pageReference = isDatapage\n ? `${referenceList}[${index}]`\n : `${pConn.getPageReference()}${referenceList}[${index}]`;\n const meta = viewConfigPath\n ? pConn.getRawMetadata().children[0].children[0]\n : pConn.getRawMetadata().children[0];\n const config = {\n meta,\n options: {\n context,\n pageReference,\n referenceList,\n hasForm: true\n }\n };\n // eslint-disable-next-line no-undef\n const view = PCore.createPConnect(config);\n if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {\n view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');\n }\n return createElement(createPConnectComponent(), view);\n};\n"]}
1
+ {"version":3,"file":"field-group-utils.js","sourceRoot":"","sources":["../../../src/components/helpers/field-group-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,OAAO,CAAC;AAEpD,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAGlE;;;;GAIG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,EAAE;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC9B,WAAW,GAAG,KAAK,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CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;KACpE;IACD,OAAO,aAAa,CAAC,uBAAuB,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAAA,CAAC","sourcesContent":["import { createElement, ReactElement } from 'react';\n\nimport createPConnectComponent from '../../bridge/react_pconnect';\n\n\n/**\n *\n * @param {*} pConn - pConnect object of the view\n * @returns {string} - returns the name of referenceList\n */\n\nexport const getReferenceList = pConn => {\n let resolvePage = pConn.getComponentConfig().referenceList.replace('@P ', '');\n if (resolvePage.includes('D_')) {\n resolvePage = pConn.resolveDatasourceReference(resolvePage);\n if (resolvePage?.pxResults) {\n resolvePage = resolvePage?.pxResults;\n } else if (resolvePage.startsWith('D_') && !resolvePage.endsWith('.pxResults')) {\n resolvePage = `${resolvePage}.pxResults`;\n }\n }\n return resolvePage;\n};\n\n/**\n * creates and returns react element of the view\n * @param {*} pConn - pConnect object of the view\n * @param {*} index - index of the fieldGroup item\n * @param {*} viewConfigPath - boolean value to check for children in config\n * @returns {*} - return the react element of the view\n */\nexport function buildView(pConn, index, viewConfigPath): ReactElement {\n const context = pConn.getContextName();\n const referenceList = getReferenceList(pConn);\n\n const isDatapage = referenceList.startsWith('D_');\n const pageReference = isDatapage\n ? `${referenceList}[${index}]`\n : `${pConn.getPageReference()}${referenceList}[${index}]`;\n const meta = viewConfigPath\n ? pConn.getRawMetadata().children[0].children[0]\n : pConn.getRawMetadata().children[0];\n const config = {\n meta,\n options: {\n context,\n pageReference,\n referenceList,\n hasForm: true\n }\n };\n\n const view = PCore.createPConnect(config);\n if (pConn.getConfigProps()?.displayMode === 'LABELS_LEFT') {\n view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');\n }\n return createElement(createPConnectComponent(), view);\n};\n"]}
@@ -1,5 +1,5 @@
1
- declare namespace _default {
2
- function TrueFalse(value: any, options: any): any;
3
- }
1
+ declare const _default: {
2
+ TrueFalse: (value: any, options: any) => any;
3
+ };
4
4
  export default _default;
5
5
  //# sourceMappingURL=Boolean.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Boolean.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.js"],"names":[],"mappings":";IA+Ba,kDAKP"}
1
+ {"version":3,"file":"Boolean.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.ts"],"names":[],"mappings":";;;AA8BA,wBAOE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Boolean.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.js"],"names":[],"mappings":"AAAA,SAAS,OAAO,CAAC,KAAK,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,EAAE;IACvE,IACE,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC;QACvB,KAAK,KAAK,KAAK;QACf,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,OAAO;QAC5C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,GAAG,EACb;QACA,OAAO,KAAK,IAAI,EAAE,CAAC;KACpB;IACD,IACE,KAAK,KAAK,IAAI;QACd,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,MAAM;QAC3C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,GAAG,EACb;QACA,OAAO,IAAI,IAAI,EAAE,CAAC;KACnB;IACD,IACE,UAAU;QACV,CAAC,KAAK,KAAK,MAAM;YACf,KAAK,KAAK,EAAE;YACZ,KAAK,KAAK,IAAI;YACd,OAAO,KAAK,KAAK,WAAW,CAAC,EAC/B;QACA,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe;IACb,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5B,OAAO,CAAC,KAAK,EAAE;QACb,GAAG,OAAO;QACV,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;KACf,CAAC;CACL,CAAC","sourcesContent":["function Boolean(value, { allowEmpty = true, tick = \"\", cross = \"\" } = {}) {\n if (\n (!allowEmpty && !value) ||\n value === false ||\n value?.toString()?.toLowerCase() === \"false\" ||\n value === 0 ||\n value === \"0\"\n ) {\n return cross || \"\";\n }\n if (\n value === true ||\n value?.toString()?.toLowerCase() === \"true\" ||\n value === 1 ||\n value === \"1\"\n ) {\n return tick || \"\";\n }\n if (\n allowEmpty &&\n (value === \"null\" ||\n value === \"\" ||\n value === null ||\n typeof value === \"undefined\")\n ) {\n return \"- -\";\n }\n return value;\n}\n\nexport default {\n TrueFalse: (value, options) =>\n Boolean(value, {\n ...options,\n tick: \"True\",\n cross: \"False\"\n })\n};\n"]}
1
+ {"version":3,"file":"Boolean.js","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Boolean.ts"],"names":[],"mappings":"AAAA,SAAS,OAAO,CAAC,KAAK,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,EAAE;IACvE,IACE,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC;QACvB,KAAK,KAAK,KAAK;QACf,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,OAAO;QAC5C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,GAAG,EACb;QACA,OAAO,KAAK,IAAI,EAAE,CAAC;KACpB;IACD,IACE,KAAK,KAAK,IAAI;QACd,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,MAAM;QAC3C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,GAAG,EACb;QACA,OAAO,IAAI,IAAI,EAAE,CAAC;KACnB;IACD,IACE,UAAU;QACV,CAAC,KAAK,KAAK,MAAM;YACf,KAAK,KAAK,EAAE;YACZ,KAAK,KAAK,IAAI;YACd,OAAO,KAAK,KAAK,WAAW,CAAC,EAC/B;QACA,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe;IACb,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5B,OAAO,CAAC,KAAK,EAAE;QACb,GAAG,OAAO;QACV,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;KACf,CAAC;CACL,CAAC","sourcesContent":["function Boolean(value, { allowEmpty = true, tick = \"\", cross = \"\" } = {}) {\n if (\n (!allowEmpty && !value) ||\n value === false ||\n value?.toString()?.toLowerCase() === \"false\" ||\n value === 0 ||\n value === \"0\"\n ) {\n return cross || \"\";\n }\n if (\n value === true ||\n value?.toString()?.toLowerCase() === \"true\" ||\n value === 1 ||\n value === \"1\"\n ) {\n return tick || \"\";\n }\n if (\n allowEmpty &&\n (value === \"null\" ||\n value === \"\" ||\n value === null ||\n typeof value === \"undefined\")\n ) {\n return \"- -\";\n }\n return value;\n}\n\nexport default {\n TrueFalse: (value, options) =>\n Boolean(value, {\n ...options,\n tick: \"True\",\n cross: \"False\"\n })\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/helpers/formatters/Currency.ts"],"names":[],"mappings":";;;;;;;;AAoEA,wBAcE"}