d2aura 23.0.0

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 (274) hide show
  1. package/api/abstractApi.d.ts +21 -0
  2. package/api/abstractApi.js +56 -0
  3. package/api/abstractApi.js.map +1 -0
  4. package/api/abstractEntityApi.d.ts +37 -0
  5. package/api/abstractEntityApi.js +145 -0
  6. package/api/abstractEntityApi.js.map +1 -0
  7. package/api/advancedFilterApi.d.ts +56 -0
  8. package/api/advancedFilterApi.js +108 -0
  9. package/api/advancedFilterApi.js.map +1 -0
  10. package/api/archiveApi.d.ts +14 -0
  11. package/api/archiveApi.js +25 -0
  12. package/api/archiveApi.js.map +1 -0
  13. package/api/comparison/entityComparisonUtils.d.ts +4 -0
  14. package/api/comparison/entityComparisonUtils.js +15 -0
  15. package/api/comparison/entityComparisonUtils.js.map +1 -0
  16. package/api/constants/constants.d.ts +5 -0
  17. package/api/constants/constants.js +6 -0
  18. package/api/constants/constants.js.map +1 -0
  19. package/api/constants/d2ChartConstants.d.ts +5 -0
  20. package/api/constants/d2ChartConstants.js +6 -0
  21. package/api/constants/d2ChartConstants.js.map +1 -0
  22. package/api/edaApi.d.ts +36 -0
  23. package/api/edaApi.js +109 -0
  24. package/api/edaApi.js.map +1 -0
  25. package/api/impl/errorHandling.d.ts +1 -0
  26. package/api/impl/errorHandling.js +72 -0
  27. package/api/impl/errorHandling.js.map +1 -0
  28. package/api/impl/utils/reportError.d.ts +2 -0
  29. package/api/impl/utils/reportError.js +157 -0
  30. package/api/impl/utils/reportError.js.map +1 -0
  31. package/api/impl/utils/reportServiceMessage.d.ts +1 -0
  32. package/api/impl/utils/reportServiceMessage.js +29 -0
  33. package/api/impl/utils/reportServiceMessage.js.map +1 -0
  34. package/api/types/accessRight.d.ts +5 -0
  35. package/api/types/accessRight.js +7 -0
  36. package/api/types/accessRight.js.map +1 -0
  37. package/api/types/advancedFilter.d.ts +22 -0
  38. package/api/types/advancedFilter.js +16 -0
  39. package/api/types/advancedFilter.js.map +1 -0
  40. package/api/types/apiResult.d.ts +5 -0
  41. package/api/types/apiResult.js +2 -0
  42. package/api/types/apiResult.js.map +1 -0
  43. package/api/types/auditableEntity.d.ts +10 -0
  44. package/api/types/auditableEntity.js +2 -0
  45. package/api/types/auditableEntity.js.map +1 -0
  46. package/api/types/d2ArTypes.d.ts +5 -0
  47. package/api/types/d2ArTypes.js +2 -0
  48. package/api/types/d2ArTypes.js.map +1 -0
  49. package/api/types/d2ChartTypes.d.ts +26 -0
  50. package/api/types/d2ChartTypes.js +7 -0
  51. package/api/types/d2ChartTypes.js.map +1 -0
  52. package/api/types/dbBoolean.d.ts +5 -0
  53. package/api/types/dbBoolean.js +15 -0
  54. package/api/types/dbBoolean.js.map +1 -0
  55. package/api/types/entity.d.ts +7 -0
  56. package/api/types/entity.js +2 -0
  57. package/api/types/entity.js.map +1 -0
  58. package/api/types/entityListResult.d.ts +4 -0
  59. package/api/types/entityListResult.js +2 -0
  60. package/api/types/entityListResult.js.map +1 -0
  61. package/api/types/entityResult.d.ts +4 -0
  62. package/api/types/entityResult.js +2 -0
  63. package/api/types/entityResult.js.map +1 -0
  64. package/api/types/nounGender.d.ts +5 -0
  65. package/api/types/nounGender.js +7 -0
  66. package/api/types/nounGender.js.map +1 -0
  67. package/api/util/d2Boolean.d.ts +8 -0
  68. package/api/util/d2Boolean.js +14 -0
  69. package/api/util/d2Boolean.js.map +1 -0
  70. package/api/util/d2ChartUtils.d.ts +7 -0
  71. package/api/util/d2ChartUtils.js +62 -0
  72. package/api/util/d2ChartUtils.js.map +1 -0
  73. package/api/util/edaUtils.d.ts +5 -0
  74. package/api/util/edaUtils.js +33 -0
  75. package/api/util/edaUtils.js.map +1 -0
  76. package/api/util/fileUtils.d.ts +3 -0
  77. package/api/util/fileUtils.js +22 -0
  78. package/api/util/fileUtils.js.map +1 -0
  79. package/api/validation/abstractEntityValidationUtils.d.ts +8 -0
  80. package/api/validation/abstractEntityValidationUtils.js +24 -0
  81. package/api/validation/abstractEntityValidationUtils.js.map +1 -0
  82. package/core/types/panelConfiguration.d.ts +3 -0
  83. package/core/types/panelConfiguration.js +2 -0
  84. package/core/types/panelConfiguration.js.map +1 -0
  85. package/core/util/humanizeDuration.d.ts +1 -0
  86. package/core/util/humanizeDuration.js +24 -0
  87. package/core/util/humanizeDuration.js.map +1 -0
  88. package/core/util/isStringEmpty.d.ts +1 -0
  89. package/core/util/isStringEmpty.js +4 -0
  90. package/core/util/isStringEmpty.js.map +1 -0
  91. package/core/util/locationUtils.d.ts +10 -0
  92. package/core/util/locationUtils.js +34 -0
  93. package/core/util/locationUtils.js.map +1 -0
  94. package/coreui/abstractApp.d.ts +22 -0
  95. package/coreui/abstractApp.js +49 -0
  96. package/coreui/abstractApp.js.map +1 -0
  97. package/coreui/abstractListPanel.d.ts +88 -0
  98. package/coreui/abstractListPanel.js +426 -0
  99. package/coreui/abstractListPanel.js.map +1 -0
  100. package/coreui/abstractPage.d.ts +18 -0
  101. package/coreui/abstractPage.js +104 -0
  102. package/coreui/abstractPage.js.map +1 -0
  103. package/coreui/auth/loginForm.d.ts +27 -0
  104. package/coreui/auth/loginForm.js +47 -0
  105. package/coreui/auth/loginForm.js.map +1 -0
  106. package/coreui/auth/logoutButton.d.ts +9 -0
  107. package/coreui/auth/logoutButton.js +23 -0
  108. package/coreui/auth/logoutButton.js.map +1 -0
  109. package/coreui/components/about/aboutModalDialog.d.ts +30 -0
  110. package/coreui/components/about/aboutModalDialog.js +96 -0
  111. package/coreui/components/about/aboutModalDialog.js.map +1 -0
  112. package/coreui/components/advancedFilter/advancedFilterButton.d.ts +26 -0
  113. package/coreui/components/advancedFilter/advancedFilterButton.js +115 -0
  114. package/coreui/components/advancedFilter/advancedFilterButton.js.map +1 -0
  115. package/coreui/components/advancedFilter/advancedFilterColumnDefinitions.d.ts +18 -0
  116. package/coreui/components/advancedFilter/advancedFilterColumnDefinitions.js +39 -0
  117. package/coreui/components/advancedFilter/advancedFilterColumnDefinitions.js.map +1 -0
  118. package/coreui/components/advancedFilter/advancedFilterUtils.d.ts +12 -0
  119. package/coreui/components/advancedFilter/advancedFilterUtils.js +101 -0
  120. package/coreui/components/advancedFilter/advancedFilterUtils.js.map +1 -0
  121. package/coreui/components/advancedFilter/advancedFilterValidationUtils.d.ts +11 -0
  122. package/coreui/components/advancedFilter/advancedFilterValidationUtils.js +59 -0
  123. package/coreui/components/advancedFilter/advancedFilterValidationUtils.js.map +1 -0
  124. package/coreui/components/advancedFilter/advancedFilteredGrid.d.ts +55 -0
  125. package/coreui/components/advancedFilter/advancedFilteredGrid.js +165 -0
  126. package/coreui/components/advancedFilter/advancedFilteredGrid.js.map +1 -0
  127. package/coreui/components/advancedFilter/components/advancedFilterOperatorSelect.d.ts +14 -0
  128. package/coreui/components/advancedFilter/components/advancedFilterOperatorSelect.js +35 -0
  129. package/coreui/components/advancedFilter/components/advancedFilterOperatorSelect.js.map +1 -0
  130. package/coreui/components/advancedFilter/components/advancedFilterValueInput.d.ts +23 -0
  131. package/coreui/components/advancedFilter/components/advancedFilterValueInput.js +148 -0
  132. package/coreui/components/advancedFilter/components/advancedFilterValueInput.js.map +1 -0
  133. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionDetailPanel.d.ts +18 -0
  134. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionDetailPanel.js +82 -0
  135. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionDetailPanel.js.map +1 -0
  136. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListModalDialog.d.ts +23 -0
  137. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListModalDialog.js +58 -0
  138. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListModalDialog.js.map +1 -0
  139. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListPanel.d.ts +31 -0
  140. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListPanel.js +211 -0
  141. package/coreui/components/advancedFilter/conditionList/advancedFilterConditionListPanel.js.map +1 -0
  142. package/coreui/components/advancedFilter/filterList/advancedFilterListModalDialog.d.ts +15 -0
  143. package/coreui/components/advancedFilter/filterList/advancedFilterListModalDialog.js +48 -0
  144. package/coreui/components/advancedFilter/filterList/advancedFilterListModalDialog.js.map +1 -0
  145. package/coreui/components/advancedFilter/filterSave/filterSaveModalDialog.d.ts +18 -0
  146. package/coreui/components/advancedFilter/filterSave/filterSaveModalDialog.js +37 -0
  147. package/coreui/components/advancedFilter/filterSave/filterSaveModalDialog.js.map +1 -0
  148. package/coreui/components/advancedFilter/floatingColumnFilter/advancedFilterFloatingColumnComponent.d.ts +26 -0
  149. package/coreui/components/advancedFilter/floatingColumnFilter/advancedFilterFloatingColumnComponent.js +81 -0
  150. package/coreui/components/advancedFilter/floatingColumnFilter/advancedFilterFloatingColumnComponent.js.map +1 -0
  151. package/coreui/components/assignEntitiesToEntity/abstractEntitiesOnEntityList.d.ts +32 -0
  152. package/coreui/components/assignEntitiesToEntity/abstractEntitiesOnEntityList.js +102 -0
  153. package/coreui/components/assignEntitiesToEntity/abstractEntitiesOnEntityList.js.map +1 -0
  154. package/coreui/components/changePasswordModalDialog/changePasswordModalDialog.d.ts +23 -0
  155. package/coreui/components/changePasswordModalDialog/changePasswordModalDialog.js +83 -0
  156. package/coreui/components/changePasswordModalDialog/changePasswordModalDialog.js.map +1 -0
  157. package/coreui/components/colorTag/colorTag.d.ts +9 -0
  158. package/coreui/components/colorTag/colorTag.js +17 -0
  159. package/coreui/components/colorTag/colorTag.js.map +1 -0
  160. package/coreui/components/d2Chart/d2ChartOptions.d.ts +3 -0
  161. package/coreui/components/d2Chart/d2ChartOptions.js +73 -0
  162. package/coreui/components/d2Chart/d2ChartOptions.js.map +1 -0
  163. package/coreui/components/d2Chart/d2ChartPanel.d.ts +48 -0
  164. package/coreui/components/d2Chart/d2ChartPanel.js +325 -0
  165. package/coreui/components/d2Chart/d2ChartPanel.js.map +1 -0
  166. package/coreui/components/d2Chart/d2ChartTablePanel.d.ts +31 -0
  167. package/coreui/components/d2Chart/d2ChartTablePanel.js +121 -0
  168. package/coreui/components/d2Chart/d2ChartTablePanel.js.map +1 -0
  169. package/coreui/components/d2Chart/d2ChartToolboxPanel.d.ts +27 -0
  170. package/coreui/components/d2Chart/d2ChartToolboxPanel.js +116 -0
  171. package/coreui/components/d2Chart/d2ChartToolboxPanel.js.map +1 -0
  172. package/coreui/components/edaManager/abstract/edaManagerAbstractPanel.d.ts +51 -0
  173. package/coreui/components/edaManager/abstract/edaManagerAbstractPanel.js +169 -0
  174. package/coreui/components/edaManager/abstract/edaManagerAbstractPanel.js.map +1 -0
  175. package/coreui/components/edaManager/abstract/edaManagerAbstractTablePanel.d.ts +32 -0
  176. package/coreui/components/edaManager/abstract/edaManagerAbstractTablePanel.js +87 -0
  177. package/coreui/components/edaManager/abstract/edaManagerAbstractTablePanel.js.map +1 -0
  178. package/coreui/components/edaManager/abstract/edaManagerAbstractVectorList.d.ts +24 -0
  179. package/coreui/components/edaManager/abstract/edaManagerAbstractVectorList.js +98 -0
  180. package/coreui/components/edaManager/abstract/edaManagerAbstractVectorList.js.map +1 -0
  181. package/coreui/components/edaManager/compactPanel/edaManagerCompactPanel.d.ts +19 -0
  182. package/coreui/components/edaManager/compactPanel/edaManagerCompactPanel.js +52 -0
  183. package/coreui/components/edaManager/compactPanel/edaManagerCompactPanel.js.map +1 -0
  184. package/coreui/components/edaManager/compactPanel/initialLayout.d.ts +2 -0
  185. package/coreui/components/edaManager/compactPanel/initialLayout.js +26 -0
  186. package/coreui/components/edaManager/compactPanel/initialLayout.js.map +1 -0
  187. package/coreui/components/edaManager/components/detail/components/edaVectorMassChangeButton.d.ts +38 -0
  188. package/coreui/components/edaManager/components/detail/components/edaVectorMassChangeButton.js +182 -0
  189. package/coreui/components/edaManager/components/detail/components/edaVectorMassChangeButton.js.map +1 -0
  190. package/coreui/components/edaManager/components/detail/edaVectorDetailModalDialog.d.ts +23 -0
  191. package/coreui/components/edaManager/components/detail/edaVectorDetailModalDialog.js +122 -0
  192. package/coreui/components/edaManager/components/detail/edaVectorDetailModalDialog.js.map +1 -0
  193. package/coreui/components/edaManager/components/detail/edaVectorDetailTablePanel.d.ts +16 -0
  194. package/coreui/components/edaManager/components/detail/edaVectorDetailTablePanel.js +63 -0
  195. package/coreui/components/edaManager/components/detail/edaVectorDetailTablePanel.js.map +1 -0
  196. package/coreui/components/edaManager/components/detail/initialLayout.d.ts +2 -0
  197. package/coreui/components/edaManager/components/detail/initialLayout.js +29 -0
  198. package/coreui/components/edaManager/components/detail/initialLayout.js.map +1 -0
  199. package/coreui/components/edaManager/components/edaManagerTablePanel.d.ts +22 -0
  200. package/coreui/components/edaManager/components/edaManagerTablePanel.js +80 -0
  201. package/coreui/components/edaManager/components/edaManagerTablePanel.js.map +1 -0
  202. package/coreui/components/edaManager/components/edaManagerTimePanel.d.ts +22 -0
  203. package/coreui/components/edaManager/components/edaManagerTimePanel.js +38 -0
  204. package/coreui/components/edaManager/components/edaManagerTimePanel.js.map +1 -0
  205. package/coreui/components/edaManager/components/edaManagerVectorList.d.ts +11 -0
  206. package/coreui/components/edaManager/components/edaManagerVectorList.js +35 -0
  207. package/coreui/components/edaManager/components/edaManagerVectorList.js.map +1 -0
  208. package/coreui/components/edaManager/components/edaStepSelect/edaStepConstants.d.ts +0 -0
  209. package/coreui/components/edaManager/components/edaStepSelect/edaStepConstants.js +2 -0
  210. package/coreui/components/edaManager/components/edaStepSelect/edaStepConstants.js.map +1 -0
  211. package/coreui/components/edaManager/components/edaStepSelect/edaStepSelect.d.ts +13 -0
  212. package/coreui/components/edaManager/components/edaStepSelect/edaStepSelect.js +14 -0
  213. package/coreui/components/edaManager/components/edaStepSelect/edaStepSelect.js.map +1 -0
  214. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelect.d.ts +10 -0
  215. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelect.js +20 -0
  216. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelect.js.map +1 -0
  217. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelectModalDialog.d.ts +13 -0
  218. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelectModalDialog.js +22 -0
  219. package/coreui/components/edaManager/components/edaVectorSelect/edaVectorSelectModalDialog.js.map +1 -0
  220. package/coreui/components/edaManager/constants.d.ts +2 -0
  221. package/coreui/components/edaManager/constants.js +11 -0
  222. package/coreui/components/edaManager/constants.js.map +1 -0
  223. package/coreui/components/edaManager/panel/edaManagerPanel.d.ts +13 -0
  224. package/coreui/components/edaManager/panel/edaManagerPanel.js +32 -0
  225. package/coreui/components/edaManager/panel/edaManagerPanel.js.map +1 -0
  226. package/coreui/components/edaManager/panel/initialLayout.d.ts +2 -0
  227. package/coreui/components/edaManager/panel/initialLayout.js +39 -0
  228. package/coreui/components/edaManager/panel/initialLayout.js.map +1 -0
  229. package/coreui/components/editor/abstractEntityConfigPanel.d.ts +82 -0
  230. package/coreui/components/editor/abstractEntityConfigPanel.js +307 -0
  231. package/coreui/components/editor/abstractEntityConfigPanel.js.map +1 -0
  232. package/coreui/components/filePicker/filePicker.d.ts +20 -0
  233. package/coreui/components/filePicker/filePicker.js +57 -0
  234. package/coreui/components/filePicker/filePicker.js.map +1 -0
  235. package/coreui/components/grid/auditEntityRowStyleRules.d.ts +3 -0
  236. package/coreui/components/grid/auditEntityRowStyleRules.js +34 -0
  237. package/coreui/components/grid/auditEntityRowStyleRules.js.map +1 -0
  238. package/coreui/components/grid/detailHeaderPanel.d.ts +13 -0
  239. package/coreui/components/grid/detailHeaderPanel.js +29 -0
  240. package/coreui/components/grid/detailHeaderPanel.js.map +1 -0
  241. package/coreui/components/grid/standardColumns.d.ts +14 -0
  242. package/coreui/components/grid/standardColumns.js +150 -0
  243. package/coreui/components/grid/standardColumns.js.map +1 -0
  244. package/coreui/components/history/entityHistoryListPanel.d.ts +38 -0
  245. package/coreui/components/history/entityHistoryListPanel.js +154 -0
  246. package/coreui/components/history/entityHistoryListPanel.js.map +1 -0
  247. package/coreui/components/languageSelect/languageSelect.d.ts +17 -0
  248. package/coreui/components/languageSelect/languageSelect.js +28 -0
  249. package/coreui/components/languageSelect/languageSelect.js.map +1 -0
  250. package/coreui/components/modalWithIcon/openModalWithIcon.d.ts +8 -0
  251. package/coreui/components/modalWithIcon/openModalWithIcon.js +30 -0
  252. package/coreui/components/modalWithIcon/openModalWithIcon.js.map +1 -0
  253. package/coreui/components/select/abstractSelect.d.ts +57 -0
  254. package/coreui/components/select/abstractSelect.js +233 -0
  255. package/coreui/components/select/abstractSelect.js.map +1 -0
  256. package/coreui/components/select/abstractSelectModalDialog.d.ts +33 -0
  257. package/coreui/components/select/abstractSelectModalDialog.js +110 -0
  258. package/coreui/components/select/abstractSelectModalDialog.js.map +1 -0
  259. package/coreui/components/select/selectUtils.d.ts +4 -0
  260. package/coreui/components/select/selectUtils.js +14 -0
  261. package/coreui/components/select/selectUtils.js.map +1 -0
  262. package/coreui/components/titleWithCodePanel/titleWithCodePanel.d.ts +10 -0
  263. package/coreui/components/titleWithCodePanel/titleWithCodePanel.js +20 -0
  264. package/coreui/components/titleWithCodePanel/titleWithCodePanel.js.map +1 -0
  265. package/coreui/icons/icons.d.ts +3 -0
  266. package/coreui/icons/icons.js +18 -0
  267. package/coreui/icons/icons.js.map +1 -0
  268. package/coreui/layout/contextToolbar.d.ts +15 -0
  269. package/coreui/layout/contextToolbar.js +41 -0
  270. package/coreui/layout/contextToolbar.js.map +1 -0
  271. package/coreui/style/index.less +165 -0
  272. package/coreui/style/login.css +214 -0
  273. package/package.json +65 -0
  274. package/tsconfig.json +38 -0
@@ -0,0 +1,26 @@
1
+ import Entity from "./entity";
2
+ import { UnixTime } from "d2jsapi";
3
+ export declare enum LineStyleEnum {
4
+ SOLID = "solid",
5
+ DASHED = "dashed",
6
+ DOTTED = "dotted"
7
+ }
8
+ export interface D2ChartSeriesItem extends Omit<Entity, "note" | "locked"> {
9
+ fillColor?: boolean;
10
+ colorIndex?: number;
11
+ lineStyle?: LineStyleEnum;
12
+ }
13
+ export interface D2ChartRecord {
14
+ date: Date;
15
+ [key: string]: any;
16
+ }
17
+ export interface MarkAreaData {
18
+ name?: string;
19
+ xAxis: UnixTime | null;
20
+ }
21
+ export interface MarkArea {
22
+ itemStyle: {
23
+ color: string;
24
+ };
25
+ data: MarkAreaData[][];
26
+ }
@@ -0,0 +1,7 @@
1
+ export var LineStyleEnum;
2
+ (function (LineStyleEnum) {
3
+ LineStyleEnum["SOLID"] = "solid";
4
+ LineStyleEnum["DASHED"] = "dashed";
5
+ LineStyleEnum["DOTTED"] = "dotted";
6
+ })(LineStyleEnum || (LineStyleEnum = {}));
7
+ //# sourceMappingURL=d2ChartTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d2ChartTypes.js","sourceRoot":"","sources":["../../../../api/types/d2ChartTypes.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,gCAAe,CAAA;IAAE,kCAAiB,CAAA;IAAE,kCAAiB,CAAA;AACzD,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB","sourcesContent":["import Entity from \"./entity\";\r\nimport {UnixTime} from \"d2jsapi\";\r\n\r\n\r\nexport enum LineStyleEnum {\r\n SOLID = 'solid', DASHED = 'dashed', DOTTED = 'dotted'\r\n}\r\n\r\nexport interface D2ChartSeriesItem extends Omit<Entity, \"note\" | \"locked\"> {\r\n fillColor?: boolean\r\n colorIndex?: number\r\n lineStyle?: LineStyleEnum\r\n}\r\n\r\nexport interface D2ChartRecord {\r\n date: Date\r\n\r\n [key: string]: any\r\n}\r\n\r\nexport interface MarkAreaData {\r\n name?: string\r\n xAxis: UnixTime | null\r\n}\r\n\r\nexport interface MarkArea {\r\n itemStyle: { color: string }\r\n data: MarkAreaData[][]\r\n}"]}
@@ -0,0 +1,5 @@
1
+ export declare enum DbBoolean {
2
+ FALSE = 0,
3
+ TRUE = 1
4
+ }
5
+ export declare function getDbBooleanString(dbBoolean: DbBoolean): string;
@@ -0,0 +1,15 @@
1
+ import i18n from "d2core/i18n/i18n";
2
+ export var DbBoolean;
3
+ (function (DbBoolean) {
4
+ DbBoolean[DbBoolean["FALSE"] = 0] = "FALSE";
5
+ DbBoolean[DbBoolean["TRUE"] = 1] = "TRUE";
6
+ })(DbBoolean || (DbBoolean = {}));
7
+ export function getDbBooleanString(dbBoolean) {
8
+ switch (dbBoolean) {
9
+ case DbBoolean.FALSE:
10
+ return i18n("No");
11
+ case DbBoolean.TRUE:
12
+ return i18n("Yes");
13
+ }
14
+ }
15
+ //# sourceMappingURL=dbBoolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dbBoolean.js","sourceRoot":"","sources":["../../../../api/types/dbBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,2CAAK,CAAA;IACL,yCAAI,CAAA;AACR,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAoB;IACnD,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,KAAK;YAChB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,KAAK,SAAS,CAAC,IAAI;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC","sourcesContent":["import i18n from \"d2core/i18n/i18n\";\r\n\r\nexport enum DbBoolean {\r\n FALSE,\r\n TRUE,\r\n}\r\n\r\nexport function getDbBooleanString(dbBoolean: DbBoolean): string {\r\n switch (dbBoolean) {\r\n case DbBoolean.FALSE:\r\n return i18n(\"No\");\r\n case DbBoolean.TRUE:\r\n return i18n(\"Yes\");\r\n }\r\n}"]}
@@ -0,0 +1,7 @@
1
+ export default interface Entity {
2
+ code: string | null;
3
+ name: string | null;
4
+ note?: string | null;
5
+ id: number;
6
+ locked?: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../api/types/entity.ts"],"names":[],"mappings":"","sourcesContent":["export default interface Entity {\r\n code: string | null\r\n name: string | null\r\n note?: string | null\r\n // transient field required for data grid\r\n id: number\r\n // transient field representing locked state by current user\r\n locked?: boolean\r\n}"]}
@@ -0,0 +1,4 @@
1
+ import ApiResult from "./apiResult";
2
+ export default interface EntityListResult<T> extends ApiResult {
3
+ data: T[];
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=entityListResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityListResult.js","sourceRoot":"","sources":["../../../../api/types/entityListResult.ts"],"names":[],"mappings":"","sourcesContent":["import ApiResult from \"./apiResult\";\r\n\r\nexport default interface EntityListResult<T> extends ApiResult {\r\n data: T[]\r\n}"]}
@@ -0,0 +1,4 @@
1
+ import ApiResult from "./apiResult";
2
+ export default interface EntityResult<T> extends ApiResult {
3
+ data: T;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=entityResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityResult.js","sourceRoot":"","sources":["../../../../api/types/entityResult.ts"],"names":[],"mappings":"","sourcesContent":["import ApiResult from \"./apiResult\";\r\n\r\nexport default interface EntityResult<T> extends ApiResult {\r\n data: T\r\n}"]}
@@ -0,0 +1,5 @@
1
+ export declare enum NounGender {
2
+ MASCULINE = "[mg]",
3
+ FEMININE = "[fg]",
4
+ NEUTER = "[ng]"
5
+ }
@@ -0,0 +1,7 @@
1
+ export var NounGender;
2
+ (function (NounGender) {
3
+ NounGender["MASCULINE"] = "[mg]";
4
+ NounGender["FEMININE"] = "[fg]";
5
+ NounGender["NEUTER"] = "[ng]";
6
+ })(NounGender || (NounGender = {}));
7
+ //# sourceMappingURL=nounGender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nounGender.js","sourceRoot":"","sources":["../../../../api/types/nounGender.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IAClB,gCAAkB,CAAA;IAAE,+BAAiB,CAAA;IAAE,6BAAe,CAAA;AAC1D,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB","sourcesContent":["export enum NounGender {\r\n MASCULINE = '[mg]', FEMININE = '[fg]', NEUTER = '[ng]'\r\n}"]}
@@ -0,0 +1,8 @@
1
+ export declare enum D2Boolean {
2
+ TRUE = "vTrue",
3
+ FALSE = "vFalse"
4
+ }
5
+ export default class D2BooleanUtils {
6
+ static booleanToD2Boolean(value: boolean): D2Boolean;
7
+ static d2BooleanToBoolean(value: D2Boolean): boolean;
8
+ }
@@ -0,0 +1,14 @@
1
+ export var D2Boolean;
2
+ (function (D2Boolean) {
3
+ D2Boolean["TRUE"] = "vTrue";
4
+ D2Boolean["FALSE"] = "vFalse";
5
+ })(D2Boolean || (D2Boolean = {}));
6
+ export default class D2BooleanUtils {
7
+ static booleanToD2Boolean(value) {
8
+ return value ? D2Boolean.TRUE : D2Boolean.FALSE;
9
+ }
10
+ static d2BooleanToBoolean(value) {
11
+ return value === D2Boolean.TRUE;
12
+ }
13
+ }
14
+ //# sourceMappingURL=d2Boolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d2Boolean.js","sourceRoot":"","sources":["../../../../api/util/d2Boolean.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,2BAAc,CAAA;IACd,6BAAgB,CAAA;AACpB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,OAAO,OAAO,cAAc;IAE/B,MAAM,CAAC,kBAAkB,CAAC,KAAc;QACpC,OAAO,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,KAAgB;QACtC,OAAO,KAAK,KAAK,SAAS,CAAC,IAAI,CAAC;IACpC,CAAC;CAEJ","sourcesContent":["export enum D2Boolean {\r\n TRUE = \"vTrue\",\r\n FALSE = \"vFalse\",\r\n}\r\n\r\nexport default class D2BooleanUtils {\r\n\r\n static booleanToD2Boolean(value: boolean): D2Boolean {\r\n return value ? D2Boolean.TRUE : D2Boolean.FALSE;\r\n }\r\n\r\n static d2BooleanToBoolean(value: D2Boolean): boolean {\r\n return value === D2Boolean.TRUE;\r\n }\r\n\r\n}"]}
@@ -0,0 +1,7 @@
1
+ import { D2ChartRecord, MarkArea } from "../types/d2ChartTypes";
2
+ export default class D2ChartUtils {
3
+ static calendarRecordsToMarkAreas(d2ChartRecords: D2ChartRecord[]): {
4
+ [key: string]: MarkArea;
5
+ };
6
+ static getMissingDataMarkArea(d2ChartRecords: D2ChartRecord[], vectorFields: string[]): MarkArea;
7
+ }
@@ -0,0 +1,62 @@
1
+ import { CHART_CALENDAR_HOLIDAY_COLOR, CHART_CALENDAR_SATURDAY_COLOR, CHART_CALENDAR_SUNDAY_COLOR, CHART_MISSING_DATA_COLOR } from "../constants/d2ChartConstants";
2
+ import { takeWhile } from "lodash";
3
+ export default class D2ChartUtils {
4
+ static calendarRecordsToMarkAreas(d2ChartRecords) {
5
+ const saturdayMarkArea = { itemStyle: { color: CHART_CALENDAR_SATURDAY_COLOR }, data: [] };
6
+ const sundayMarkArea = { itemStyle: { color: CHART_CALENDAR_SUNDAY_COLOR }, data: [] };
7
+ const holidayMarkArea = { itemStyle: { color: CHART_CALENDAR_HOLIDAY_COLOR }, data: [] };
8
+ const groups = [];
9
+ for (let i = 0; i < d2ChartRecords.length;) {
10
+ const group = takeWhile(d2ChartRecords.slice(i), (value) => {
11
+ return value.__calendar === d2ChartRecords[i].__calendar;
12
+ });
13
+ groups.push(group);
14
+ i += group.length;
15
+ }
16
+ groups.forEach((value, index) => {
17
+ switch (value[0].__calendar) {
18
+ case 1:
19
+ saturdayMarkArea.data.push([{ xAxis: value[0].date.getTime() }, { xAxis: groups[index + 1]?.[0].date.getTime() ?? null }]);
20
+ break;
21
+ case 2:
22
+ sundayMarkArea.data.push([{ xAxis: value[0].date.getTime() }, { xAxis: groups[index + 1]?.[0].date.getTime() ?? null }]);
23
+ break;
24
+ case 3:
25
+ holidayMarkArea.data.push([{ xAxis: value[0].date.getTime() }, { xAxis: groups[index + 1]?.[0].date.getTime() ?? null }]);
26
+ break;
27
+ }
28
+ });
29
+ return {
30
+ ["saturday"]: saturdayMarkArea,
31
+ ["sunday"]: sundayMarkArea,
32
+ ["holiday"]: holidayMarkArea,
33
+ };
34
+ }
35
+ static getMissingDataMarkArea(d2ChartRecords, vectorFields) {
36
+ const markArea = { itemStyle: { color: CHART_MISSING_DATA_COLOR }, data: [] };
37
+ const groupsWithMissingData = [];
38
+ const groupsWithData = [];
39
+ for (let i = 0; i < d2ChartRecords.length;) {
40
+ const groupWithMissingData = takeWhile(d2ChartRecords.slice(i), value => {
41
+ return vectorFields.some(vectorField => value[vectorField] === undefined);
42
+ });
43
+ if (groupWithMissingData.length > 0) {
44
+ groupsWithMissingData.push(groupWithMissingData);
45
+ i += groupWithMissingData.length;
46
+ const groupWithData = takeWhile(d2ChartRecords.slice(i), value => {
47
+ return vectorFields.every(vectorField => value[vectorField] !== undefined);
48
+ });
49
+ groupsWithData.push(groupWithData);
50
+ i += groupWithData.length;
51
+ }
52
+ else {
53
+ i++;
54
+ }
55
+ }
56
+ groupsWithMissingData.forEach((value, index) => {
57
+ markArea.data.push([{ xAxis: value[0].date.getTime() }, { xAxis: groupsWithData[index]?.[0]?.date.getTime() ?? d2ChartRecords[d2ChartRecords.length - 1].date }]);
58
+ });
59
+ return markArea;
60
+ }
61
+ }
62
+ //# sourceMappingURL=d2ChartUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d2ChartUtils.js","sourceRoot":"","sources":["../../../../api/util/d2ChartUtils.ts"],"names":[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,CAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QAClK,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IACpB,CAAC;CAEJ","sourcesContent":["import {D2ChartRecord, MarkArea} from \"../types/d2ChartTypes\";\r\nimport {\r\n CHART_CALENDAR_HOLIDAY_COLOR,\r\n CHART_CALENDAR_SATURDAY_COLOR,\r\n CHART_CALENDAR_SUNDAY_COLOR, CHART_MISSING_DATA_COLOR\r\n} from \"../constants/d2ChartConstants\";\r\nimport {takeWhile} from \"lodash\";\r\n\r\nexport default class D2ChartUtils {\r\n static calendarRecordsToMarkAreas(d2ChartRecords: D2ChartRecord[]): { [key: string]: MarkArea } {\r\n const saturdayMarkArea: MarkArea = {itemStyle: {color: CHART_CALENDAR_SATURDAY_COLOR}, data: []}\r\n const sundayMarkArea: MarkArea = {itemStyle: {color: CHART_CALENDAR_SUNDAY_COLOR}, data: []}\r\n const holidayMarkArea: MarkArea = {itemStyle: {color: CHART_CALENDAR_HOLIDAY_COLOR}, data: []}\r\n\r\n // create groups\r\n const groups: D2ChartRecord[][] = [];\r\n for (let i = 0; i < d2ChartRecords.length;) {\r\n const group = takeWhile(d2ChartRecords.slice(i), (value) => {\r\n return value.__calendar === d2ChartRecords[i].__calendar;\r\n });\r\n groups.push(group);\r\n i += group.length;\r\n }\r\n\r\n // create mark area data\r\n groups.forEach((value, index) => {\r\n switch (value[0].__calendar) {\r\n case 1:\r\n saturdayMarkArea.data.push([{xAxis: value[0].date.getTime()}, {xAxis: groups[index + 1]?.[0].date.getTime() ?? null}]);\r\n break;\r\n case 2:\r\n sundayMarkArea.data.push([{xAxis: value[0].date.getTime()}, {xAxis: groups[index + 1]?.[0].date.getTime() ?? null}]);\r\n break;\r\n case 3:\r\n holidayMarkArea.data.push([{xAxis: value[0].date.getTime()}, {xAxis: groups[index + 1]?.[0].date.getTime() ?? null}]);\r\n break;\r\n }\r\n });\r\n\r\n return {\r\n [\"saturday\"]: saturdayMarkArea,\r\n [\"sunday\"]: sundayMarkArea,\r\n [\"holiday\"]: holidayMarkArea,\r\n };\r\n }\r\n\r\n static getMissingDataMarkArea(d2ChartRecords: D2ChartRecord[], vectorFields: string[]): MarkArea {\r\n const markArea: MarkArea = {itemStyle: {color: CHART_MISSING_DATA_COLOR}, data: []}\r\n\r\n const groupsWithMissingData: D2ChartRecord[][] = [];\r\n const groupsWithData: D2ChartRecord[][] = [];\r\n for (let i = 0; i < d2ChartRecords.length;) {\r\n const groupWithMissingData = takeWhile(d2ChartRecords.slice(i), value => {\r\n return vectorFields.some(vectorField => value[vectorField] === undefined);\r\n });\r\n if (groupWithMissingData.length > 0) {\r\n groupsWithMissingData.push(groupWithMissingData);\r\n i += groupWithMissingData.length;\r\n\r\n const groupWithData = takeWhile(d2ChartRecords.slice(i), value => {\r\n return vectorFields.every(vectorField => value[vectorField] !== undefined);\r\n });\r\n groupsWithData.push(groupWithData);\r\n i += groupWithData.length;\r\n } else {\r\n i++;\r\n }\r\n }\r\n\r\n groupsWithMissingData.forEach((value, index) => {\r\n markArea.data.push([{xAxis: value[0].date.getTime()}, {xAxis: groupsWithData[index]?.[0]?.date.getTime() ?? d2ChartRecords[d2ChartRecords.length - 1].date}]);\r\n });\r\n\r\n return markArea;\r\n }\r\n\r\n}"]}
@@ -0,0 +1,5 @@
1
+ import { EdaStepEnum } from "../edaApi";
2
+ export default class EdaUtils {
3
+ static toEdaStepSize(stepSize: number | null): EdaStepEnum;
4
+ static fromEdaStepSize(edaStep: EdaStepEnum): number;
5
+ }
@@ -0,0 +1,33 @@
1
+ import { EdaStepEnum } from "../edaApi";
2
+ export default class EdaUtils {
3
+ static toEdaStepSize(stepSize) {
4
+ switch (stepSize) {
5
+ case 900:
6
+ return EdaStepEnum.MINUTES_15;
7
+ case 3600:
8
+ return EdaStepEnum.HOUR;
9
+ case 86400:
10
+ return EdaStepEnum.DAY;
11
+ default:
12
+ console.warn("Invalid step size");
13
+ return EdaStepEnum.DEFAULT_VALUE;
14
+ }
15
+ }
16
+ static fromEdaStepSize(edaStep) {
17
+ switch (edaStep) {
18
+ case EdaStepEnum.MINUTES_15:
19
+ return 900;
20
+ case EdaStepEnum.HOUR:
21
+ return 3600;
22
+ case EdaStepEnum.DAY:
23
+ return 86400;
24
+ case EdaStepEnum.WEEK:
25
+ case EdaStepEnum.MONTH:
26
+ case EdaStepEnum.QUARTER:
27
+ case EdaStepEnum.DEFAULT_VALUE:
28
+ console.warn("Invalid eda step");
29
+ return 900;
30
+ }
31
+ }
32
+ }
33
+ //# sourceMappingURL=edaUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edaUtils.js","sourceRoot":"","sources":["../../../../api/util/edaUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,QAAQ;IAEzB,MAAM,CAAC,aAAa,CAAC,QAAuB;QACxC,QAAQ,QAAQ,EAAE,CAAC;YACf,KAAK,GAAG;gBACJ,OAAO,WAAW,CAAC,UAAU,CAAC;YAClC,KAAK,IAAI;gBACL,OAAO,WAAW,CAAC,IAAI,CAAC;YAC5B,KAAK,KAAK;gBACN,OAAO,WAAW,CAAC,GAAG,CAAC;YAC3B;gBACI,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBAClC,OAAO,WAAW,CAAC,aAAa,CAAC;QACzC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,OAAoB;QACvC,QAAQ,OAAO,EAAE,CAAC;YACd,KAAK,WAAW,CAAC,UAAU;gBACvB,OAAO,GAAG,CAAC;YACf,KAAK,WAAW,CAAC,IAAI;gBACjB,OAAO,IAAI,CAAC;YAChB,KAAK,WAAW,CAAC,GAAG;gBAChB,OAAO,KAAK,CAAC;YACjB,KAAK,WAAW,CAAC,IAAI,CAAC;YACtB,KAAK,WAAW,CAAC,KAAK,CAAC;YACvB,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,aAAa;gBAC1B,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;gBACjC,OAAO,GAAG,CAAC;QACnB,CAAC;IACL,CAAC;CAEJ","sourcesContent":["import {EdaStepEnum} from \"../edaApi\";\r\n\r\nexport default class EdaUtils {\r\n\r\n static toEdaStepSize(stepSize: number | null): EdaStepEnum {\r\n switch (stepSize) {\r\n case 900:\r\n return EdaStepEnum.MINUTES_15;\r\n case 3600:\r\n return EdaStepEnum.HOUR;\r\n case 86400:\r\n return EdaStepEnum.DAY;\r\n default:\r\n console.warn(\"Invalid step size\");\r\n return EdaStepEnum.DEFAULT_VALUE;\r\n }\r\n }\r\n\r\n static fromEdaStepSize(edaStep: EdaStepEnum): number {\r\n switch (edaStep) {\r\n case EdaStepEnum.MINUTES_15:\r\n return 900;\r\n case EdaStepEnum.HOUR:\r\n return 3600;\r\n case EdaStepEnum.DAY:\r\n return 86400;\r\n case EdaStepEnum.WEEK:\r\n case EdaStepEnum.MONTH:\r\n case EdaStepEnum.QUARTER:\r\n case EdaStepEnum.DEFAULT_VALUE:\r\n console.warn(\"Invalid eda step\");\r\n return 900;\r\n }\r\n }\r\n\r\n}"]}
@@ -0,0 +1,3 @@
1
+ export default class FileUtils {
2
+ static processDownloadedFile(arrayBuffer: ArrayBuffer, fileName: string): void;
3
+ }
@@ -0,0 +1,22 @@
1
+ import { ModalDialog } from "d2coreui/components/modal/modalDialog";
2
+ import i18n from "d2core/i18n/i18n";
3
+ export default class FileUtils {
4
+ static processDownloadedFile(arrayBuffer, fileName) {
5
+ if (arrayBuffer.byteLength !== 0) {
6
+ const blob = new Blob([arrayBuffer]);
7
+ const objectUrl = URL.createObjectURL(blob);
8
+ const a = document.createElement("a");
9
+ a.href = objectUrl;
10
+ a.download = fileName;
11
+ a.click();
12
+ }
13
+ else {
14
+ ModalDialog.error({
15
+ mode: "OK",
16
+ title: i18n("Download failed"),
17
+ content: i18n("Error downloading file \"%{fileName}\".", { fileName: fileName }),
18
+ });
19
+ }
20
+ }
21
+ }
22
+ //# sourceMappingURL=fileUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileUtils.js","sourceRoot":"","sources":["../../../../api/util/fileUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAkB,MAAM,uCAAuC,CAAC;AACnF,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,SAAS;IAE1B,MAAM,CAAC,qBAAqB,CAAC,WAAwB,EAAE,QAAgB;QACnE,IAAI,WAAW,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,IAAI,IAAI,CACjB,CAAC,WAAW,CAAC,CAChB,CAAC;YACF,MAAM,SAAS,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAE5C,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACtC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;YACnB,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACtB,CAAC,CAAC,KAAK,EAAE,CAAC;QACd,CAAC;aAAM,CAAC;YACJ,WAAW,CAAC,KAAK,CAAC;gBACd,IAAI,MAAoB;gBACxB,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBAC9B,OAAO,EAAE,IAAI,CAAC,yCAAyC,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC;aACjF,CAAC,CAAA;QACN,CAAC;IACL,CAAC;CAEJ","sourcesContent":["import {ModalDialog, ModalDialogMode} from \"d2coreui/components/modal/modalDialog\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\n\r\nexport default class FileUtils {\r\n\r\n static processDownloadedFile(arrayBuffer: ArrayBuffer, fileName: string) {\r\n if (arrayBuffer.byteLength !== 0) {\r\n const blob = new Blob(\r\n [arrayBuffer],\r\n );\r\n const objectUrl = URL.createObjectURL(blob);\r\n\r\n const a = document.createElement(\"a\");\r\n a.href = objectUrl;\r\n a.download = fileName;\r\n a.click();\r\n } else {\r\n ModalDialog.error({\r\n mode: ModalDialogMode.OK,\r\n title: i18n(\"Download failed\"),\r\n content: i18n(\"Error downloading file \\\"%{fileName}\\\".\", {fileName: fileName}),\r\n })\r\n }\r\n }\r\n\r\n}"]}
@@ -0,0 +1,8 @@
1
+ import { ValidateStatus } from "antd/lib/form/FormItem";
2
+ export type ErrorCode = string;
3
+ export declare enum AbstractEntityValidationErrorEnum {
4
+ CODE_REQUIRED = "CODE_REQUIRED",
5
+ CODE_DUPLICATE = "CODE_DUPLICATE",
6
+ NAME_REQUIRED = "NAME_REQUIRED"
7
+ }
8
+ export declare function getErrorInfo(possibleErrors: AbstractEntityValidationErrorEnum[], allErrors: ErrorCode[]): [ValidateStatus, string | undefined];
@@ -0,0 +1,24 @@
1
+ import i18n from "d2core/i18n/i18n";
2
+ export var AbstractEntityValidationErrorEnum;
3
+ (function (AbstractEntityValidationErrorEnum) {
4
+ AbstractEntityValidationErrorEnum["CODE_REQUIRED"] = "CODE_REQUIRED";
5
+ AbstractEntityValidationErrorEnum["CODE_DUPLICATE"] = "CODE_DUPLICATE";
6
+ AbstractEntityValidationErrorEnum["NAME_REQUIRED"] = "NAME_REQUIRED";
7
+ })(AbstractEntityValidationErrorEnum || (AbstractEntityValidationErrorEnum = {}));
8
+ function getValidationErrorString(error) {
9
+ switch (error) {
10
+ case AbstractEntityValidationErrorEnum.NAME_REQUIRED:
11
+ case AbstractEntityValidationErrorEnum.CODE_REQUIRED:
12
+ return i18n("Required");
13
+ case AbstractEntityValidationErrorEnum.CODE_DUPLICATE:
14
+ return i18n("Code Duplicated");
15
+ }
16
+ }
17
+ export function getErrorInfo(possibleErrors, allErrors) {
18
+ const foundError = possibleErrors.find(error => allErrors.includes(error));
19
+ if (foundError) {
20
+ return ["error", getValidationErrorString(foundError)];
21
+ }
22
+ return ["success", undefined];
23
+ }
24
+ //# sourceMappingURL=abstractEntityValidationUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractEntityValidationUtils.js","sourceRoot":"","sources":["../../../../api/validation/abstractEntityValidationUtils.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAIpC,MAAM,CAAN,IAAY,iCAKX;AALD,WAAY,iCAAiC;IAEzC,oEAA+B,CAAA;IAC/B,sEAAiC,CAAA;IACjC,oEAA+B,CAAA;AACnC,CAAC,EALW,iCAAiC,KAAjC,iCAAiC,QAK5C;AAED,SAAS,wBAAwB,CAAC,KAAwC;IACtE,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,iCAAiC,CAAC,aAAa,CAAC;QACrD,KAAK,iCAAiC,CAAC,aAAa;YAChD,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5B,KAAK,iCAAiC,CAAC,cAAc;YACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;AACL,CAAC;AASD,MAAM,UAAU,YAAY,CAAC,cAAmD,EAAE,SAAsB;IACpG,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3E,IAAI,UAAU,EAAE,CAAC;QACb,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import {ValidateStatus} from \"antd/lib/form/FormItem\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\n\r\nexport type ErrorCode = string;\r\n\r\nexport enum AbstractEntityValidationErrorEnum {\r\n // common errors\r\n CODE_REQUIRED = \"CODE_REQUIRED\",\r\n CODE_DUPLICATE = \"CODE_DUPLICATE\",\r\n NAME_REQUIRED = \"NAME_REQUIRED\",\r\n}\r\n\r\nfunction getValidationErrorString(error: AbstractEntityValidationErrorEnum): string {\r\n switch (error) {\r\n case AbstractEntityValidationErrorEnum.NAME_REQUIRED:\r\n case AbstractEntityValidationErrorEnum.CODE_REQUIRED:\r\n return i18n(\"Required\");\r\n case AbstractEntityValidationErrorEnum.CODE_DUPLICATE:\r\n return i18n(\"Code Duplicated\");\r\n }\r\n}\r\n\r\n/**\r\n * This will find errors in validation context and if there are some, \"error\" validate status with error message will be returned.\r\n * Otherwise, \"success\" with no error message will be returned.\r\n * @param possibleErrors - errors that are related to edited field\r\n * @param allErrors - all errors actually related with the object\r\n * returns validation status with error message (if there is any error)\r\n */\r\nexport function getErrorInfo(possibleErrors: AbstractEntityValidationErrorEnum[], allErrors: ErrorCode[]): [ValidateStatus, string | undefined] {\r\n const foundError = possibleErrors.find(error => allErrors.includes(error));\r\n\r\n if (foundError) {\r\n return [\"error\", getValidationErrorString(foundError)]\r\n }\r\n\r\n return [\"success\", undefined];\r\n}"]}
@@ -0,0 +1,3 @@
1
+ export interface PanelConfiguration {
2
+ readonly version: number;
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=panelConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panelConfiguration.js","sourceRoot":"","sources":["../../../../core/types/panelConfiguration.ts"],"names":[],"mappings":"","sourcesContent":["export interface PanelConfiguration {\r\n readonly version: number\r\n}"]}
@@ -0,0 +1 @@
1
+ export default function humanizeDuration(seconds: number, maxComponents?: number): string;
@@ -0,0 +1,24 @@
1
+ import dayjs from "d2core/dayjs";
2
+ export default function humanizeDuration(seconds, maxComponents) {
3
+ let result = "";
4
+ const duration = dayjs.duration(seconds, "seconds");
5
+ let components = 0;
6
+ const max = maxComponents ?? Number.POSITIVE_INFINITY;
7
+ if (components < max && duration.days() > 0) {
8
+ result = `${duration.days()}d `;
9
+ components += 1;
10
+ }
11
+ if (components < max && duration.hours() > 0) {
12
+ result += `${duration.hours()}h `;
13
+ components += 1;
14
+ }
15
+ if (components < max && duration.minutes() > 0) {
16
+ result += `${duration.minutes()}min `;
17
+ components += 1;
18
+ }
19
+ if (components < max && duration.seconds() > 0) {
20
+ result += `${duration.seconds()}sec `;
21
+ }
22
+ return result;
23
+ }
24
+ //# sourceMappingURL=humanizeDuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"humanizeDuration.js","sourceRoot":"","sources":["../../../../core/util/humanizeDuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAe,EAAE,aAAsB;IAC5E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,MAAM,GAAG,GAAG,aAAa,IAAI,MAAM,CAAC,iBAAiB,CAAC;IAEtD,IAAI,UAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;QAChC,UAAU,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;QAClC,UAAU,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACtC,UAAU,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import dayjs from \"d2core/dayjs\";\r\n\r\nexport default function humanizeDuration(seconds: number, maxComponents?: number): string {\r\n let result = \"\";\r\n const duration = dayjs.duration(seconds, \"seconds\");\r\n let components = 0;\r\n const max = maxComponents ?? Number.POSITIVE_INFINITY;\r\n\r\n if (components < max && duration.days() > 0) {\r\n result = `${duration.days()}d `;\r\n components += 1;\r\n }\r\n if (components < max && duration.hours() > 0) {\r\n result += `${duration.hours()}h `;\r\n components += 1;\r\n }\r\n if (components < max && duration.minutes() > 0) {\r\n result += `${duration.minutes()}min `;\r\n components += 1;\r\n }\r\n if (components < max && duration.seconds() > 0) {\r\n result += `${duration.seconds()}sec `;\r\n }\r\n\r\n return result;\r\n}"]}
@@ -0,0 +1 @@
1
+ export declare function isStringEmpty(value: string | null): boolean;
@@ -0,0 +1,4 @@
1
+ export function isStringEmpty(value) {
2
+ return value === null || value.trim() === "";
3
+ }
4
+ //# sourceMappingURL=isStringEmpty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isStringEmpty.js","sourceRoot":"","sources":["../../../../core/util/isStringEmpty.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,KAAoB;IAC9C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC","sourcesContent":["export function isStringEmpty(value: string | null): boolean {\r\n return value === null || value.trim() === \"\";\r\n}"]}
@@ -0,0 +1,10 @@
1
+ import { AdvancedFilterCondition } from "../../api/advancedFilterApi";
2
+ export default class LocationUtils {
3
+ static hasSearchParameter(hash: string): boolean;
4
+ static getSearchParameter(hash: string): {
5
+ columnName: string;
6
+ value: string;
7
+ } | undefined;
8
+ static getLocationWithoutSearchParameter(hash: string): string;
9
+ static hashToAdvancedFilterCondition(hash: string, allowedColumnName?: string): AdvancedFilterCondition | undefined;
10
+ }
@@ -0,0 +1,34 @@
1
+ import { AdvancedFilterOperator } from "../../api/advancedFilterApi";
2
+ import AdvancedFilterUtils from "../../coreui/components/advancedFilter/advancedFilterUtils";
3
+ import { AdvancedFilterValueType } from "../../api/types/advancedFilter";
4
+ export default class LocationUtils {
5
+ static hasSearchParameter(hash) {
6
+ return hash.includes("?");
7
+ }
8
+ static getSearchParameter(hash) {
9
+ if (this.hasSearchParameter(hash)) {
10
+ const searchParameter = hash.substring(hash.indexOf("?") + 1);
11
+ const split = searchParameter.split("=");
12
+ if (split.length === 2) {
13
+ return { columnName: split[0], value: split[1] };
14
+ }
15
+ }
16
+ return undefined;
17
+ }
18
+ static getLocationWithoutSearchParameter(hash) {
19
+ if (this.hasSearchParameter(hash)) {
20
+ return hash.substring(1, hash.indexOf("?"));
21
+ }
22
+ return hash.substring(1);
23
+ }
24
+ static hashToAdvancedFilterCondition(hash, allowedColumnName) {
25
+ if (allowedColumnName) {
26
+ const searchParameter = this.getSearchParameter(hash);
27
+ if (searchParameter && searchParameter.columnName === allowedColumnName && isFinite(Number(searchParameter.value))) {
28
+ return AdvancedFilterUtils.createNewCondition(-1, { columnName: searchParameter.columnName, valueType: AdvancedFilterValueType.NUMBER }, { operator: AdvancedFilterOperator.EQUALS, value: searchParameter.value });
29
+ }
30
+ }
31
+ return undefined;
32
+ }
33
+ }
34
+ //# sourceMappingURL=locationUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locationUtils.js","sourceRoot":"","sources":["../../../../core/util/locationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAC5F,OAAO,mBAAmB,MAAM,4DAA4D,CAAC;AAC7F,OAAO,EAAC,uBAAuB,EAAC,MAAM,gCAAgC,CAAC;AAEvE,MAAM,CAAC,OAAO,OAAO,aAAa;IAE9B,MAAM,CAAC,kBAAkB,CA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,SAAS,EAAE,uBAAuB,CAAC,MAAM,EAAC,EACnF,EAAC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,EAAC,CAC1E,CAAA;YACL,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CAEJ","sourcesContent":["import {AdvancedFilterCondition, AdvancedFilterOperator} from \"../../api/advancedFilterApi\";\r\nimport AdvancedFilterUtils from \"../../coreui/components/advancedFilter/advancedFilterUtils\";\r\nimport {AdvancedFilterValueType} from \"../../api/types/advancedFilter\";\r\n\r\nexport default class LocationUtils {\r\n\r\n static hasSearchParameter(hash: string) {\r\n return hash.includes(\"?\");\r\n }\r\n\r\n static getSearchParameter(hash: string): {columnName: string, value: string} | undefined {\r\n if (this.hasSearchParameter(hash)) {\r\n const searchParameter = hash.substring(hash.indexOf(\"?\") + 1);\r\n const split = searchParameter.split(\"=\");\r\n if (split.length === 2) {\r\n return {columnName: split[0], value: split[1]};\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n static getLocationWithoutSearchParameter(hash: string): string {\r\n if (this.hasSearchParameter(hash)) {\r\n return hash.substring(1, hash.indexOf(\"?\"));\r\n }\r\n return hash.substring(1);\r\n }\r\n\r\n static hashToAdvancedFilterCondition(hash: string, allowedColumnName?: string): AdvancedFilterCondition | undefined {\r\n if (allowedColumnName) {\r\n const searchParameter = this.getSearchParameter(hash);\r\n if (searchParameter && searchParameter.columnName === allowedColumnName && isFinite(Number(searchParameter.value))) {\r\n return AdvancedFilterUtils.createNewCondition(\r\n -1,\r\n {columnName: searchParameter.columnName, valueType: AdvancedFilterValueType.NUMBER},\r\n {operator: AdvancedFilterOperator.EQUALS, value: searchParameter.value},\r\n )\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n}"]}
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { D2WebApi, D2WebApiClient, D2WebApiConnection } from "d2jsapi";
3
+ export interface AbstractAppProps {
4
+ }
5
+ export interface AbstractAppState {
6
+ d2?: D2WebApi;
7
+ connection?: D2WebApiConnection;
8
+ location: string;
9
+ changePasswordModalDialogOpen: boolean;
10
+ aboutModalDialogOpen: boolean;
11
+ }
12
+ export default abstract class AbstractApp<P extends AbstractAppProps, S extends AbstractAppState> extends React.Component<P, S> {
13
+ constructor(props: Readonly<P>);
14
+ protected initialState: AbstractAppState;
15
+ abstract getAppName(): string;
16
+ abstract getDefaultPage(): string;
17
+ abstract registerStateChangeHandler(d2Api: D2WebApiClient): void;
18
+ componentDidMount(): void;
19
+ protected renderChangePasswordModalDialog(): React.JSX.Element;
20
+ protected renderAboutModalDialog(): React.JSX.Element;
21
+ protected renderLoading(): React.JSX.Element;
22
+ }
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { D2WebApiClient } from "d2jsapi";
3
+ import reportError from "../api/impl/utils/reportError";
4
+ import reportServiceMessage from "../api/impl/utils/reportServiceMessage";
5
+ import AboutModalDialog from "./components/about/aboutModalDialog";
6
+ import Spin from "antd/lib/spin";
7
+ import { LoadingOutlined } from "@ant-design/icons";
8
+ import ChangePasswordModalDialog from "./components/changePasswordModalDialog/changePasswordModalDialog";
9
+ import { isStringEmpty } from "../core/util/isStringEmpty";
10
+ export default class AbstractApp extends React.Component {
11
+ constructor(props) {
12
+ super(props);
13
+ this.initialState = {
14
+ location: isStringEmpty(window.location.hash) ? this.getDefaultPage() : window.location.hash.substring(1),
15
+ changePasswordModalDialogOpen: false,
16
+ aboutModalDialogOpen: false,
17
+ };
18
+ }
19
+ componentDidMount() {
20
+ const d2Api = new D2WebApiClient({
21
+ logLevel: window.location.href.indexOf("/dev/") >= 0 ? "debug" : "info"
22
+ });
23
+ d2Api.registerErrorHandler((source, details) => {
24
+ reportError(source, details);
25
+ });
26
+ d2Api.setServiceMessageHandler(serviceMessage => {
27
+ reportServiceMessage(serviceMessage);
28
+ });
29
+ d2Api.setPasswordChangeHandler(() => {
30
+ this.setState({ changePasswordModalDialogOpen: true });
31
+ });
32
+ d2Api.connect();
33
+ window.reportError = window.reportError.bind({ d2: d2Api });
34
+ this.registerStateChangeHandler(d2Api);
35
+ }
36
+ renderChangePasswordModalDialog() {
37
+ return (React.createElement(ChangePasswordModalDialog, { open: this.state.changePasswordModalDialogOpen, d2api: this.state.d2, passwordExpired: true, onCancel: () => {
38
+ this.setState({ changePasswordModalDialogOpen: false });
39
+ } }));
40
+ }
41
+ renderAboutModalDialog() {
42
+ return (React.createElement(AboutModalDialog, { visible: this.state.aboutModalDialogOpen, applicationName: this.getAppName(), onClose: () => this.setState({ aboutModalDialogOpen: false }) }));
43
+ }
44
+ renderLoading() {
45
+ return (React.createElement("div", { style: { height: "100%", display: "flex", justifyContent: "center", alignItems: "center" } },
46
+ React.createElement(Spin, { indicator: React.createElement(LoadingOutlined, { spin: true }), size: "large", spinning: true, percent: "auto" })));
47
+ }
48
+ }
49
+ //# sourceMappingURL=abstractApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractApp.js","sourceRoot":"","sources":["../../../coreui/abstractApp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,cAAc,EAAqB,MAAM,SAAS,CAAC;AACrE,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,yBAAyB,MAAM,kEAAkE,CAAC;AACzG,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAczD,MAAM,CAAC,OAAO,OAAgB,WAAoE,SAAQ,KAAK,CAAC,SAAe;IAC3H,YAAY,KAAkB;QAC1B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,iBAAY,GAAqB;YACvC,QAAQ,EAAE,aAAa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Q,EAAE,GAAG,EAAE;gBACX,IAAI,CAAC,QAAQ,CAAC,EAAC,6BAA6B,EAAE,KAAK,EAAC,CAAC,CAAA;YACzD,CAAC,GACH,CACL,CAAA;IACL,CAAC;IAES,sBAAsB;QAC5B,OAAO,CACH,oBAAC,gBAAgB,IACb,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,EACxC,eAAe,EAAE,IAAI,CAAC,UAAU,EAAE,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,oBAAoB,EAAE,KAAK,EAAC,CAAC,GAC7D,CACL,CAAA;IACL,CAAC;IAES,aAAa;QACnB,OAAO,CACH,6BAAK,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC;YACzF,oBAAC,IAAI,IAAC,SAAS,EAAE,oBAAC,eAAe,IAAC,IAAI,SAAE,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,QAAC,OAAO,EAAC,MAAM,GAAE,CAC9E,CACT,CAAC;IACN,CAAC;CAEJ","sourcesContent":["import React from \"react\";\r\nimport {D2WebApi, D2WebApiClient, D2WebApiConnection} from \"d2jsapi\";\r\nimport reportError from \"../api/impl/utils/reportError\";\r\nimport reportServiceMessage from \"../api/impl/utils/reportServiceMessage\";\r\nimport AboutModalDialog from \"./components/about/aboutModalDialog\";\r\nimport Spin from \"antd/lib/spin\";\r\nimport {LoadingOutlined} from \"@ant-design/icons\";\r\nimport ChangePasswordModalDialog from \"./components/changePasswordModalDialog/changePasswordModalDialog\";\r\nimport {isStringEmpty} from \"../core/util/isStringEmpty\";\r\n\r\nexport interface AbstractAppProps {\r\n}\r\n\r\nexport interface AbstractAppState {\r\n d2?: D2WebApi\r\n connection?: D2WebApiConnection\r\n location: string\r\n\r\n changePasswordModalDialogOpen: boolean\r\n aboutModalDialogOpen: boolean\r\n}\r\n\r\nexport default abstract class AbstractApp<P extends AbstractAppProps, S extends AbstractAppState> extends React.Component<P, S> {\r\n constructor(props: Readonly<P>) {\r\n super(props);\r\n }\r\n\r\n protected initialState: AbstractAppState = {\r\n location: isStringEmpty(window.location.hash) ? this.getDefaultPage() : window.location.hash.substring(1),\r\n changePasswordModalDialogOpen: false,\r\n aboutModalDialogOpen: false,\r\n }\r\n\r\n abstract getAppName(): string;\r\n\r\n abstract getDefaultPage(): string;\r\n\r\n abstract registerStateChangeHandler(d2Api: D2WebApiClient): void;\r\n\r\n componentDidMount() {\r\n const d2Api = new D2WebApiClient({\r\n logLevel: window.location.href.indexOf(\"/dev/\") >= 0 ? \"debug\" : \"info\"\r\n });\r\n d2Api.registerErrorHandler((source, details) => {\r\n reportError(source, details)\r\n });\r\n d2Api.setServiceMessageHandler(serviceMessage => {\r\n reportServiceMessage(serviceMessage);\r\n });\r\n d2Api.setPasswordChangeHandler(() => {\r\n this.setState({changePasswordModalDialogOpen: true});\r\n })\r\n d2Api.connect();\r\n // @ts-ignore\r\n window.reportError = window.reportError.bind({d2: d2Api});\r\n\r\n this.registerStateChangeHandler(d2Api);\r\n }\r\n\r\n protected renderChangePasswordModalDialog() {\r\n return (\r\n <ChangePasswordModalDialog\r\n open={this.state.changePasswordModalDialogOpen}\r\n d2api={this.state.d2!}\r\n passwordExpired\r\n onCancel={() => {\r\n this.setState({changePasswordModalDialogOpen: false})\r\n }}\r\n />\r\n )\r\n }\r\n\r\n protected renderAboutModalDialog() {\r\n return (\r\n <AboutModalDialog\r\n visible={this.state.aboutModalDialogOpen}\r\n applicationName={this.getAppName()}\r\n onClose={() => this.setState({aboutModalDialogOpen: false})}\r\n />\r\n )\r\n }\r\n\r\n protected renderLoading() {\r\n return (\r\n <div style={{height: \"100%\", display: \"flex\", justifyContent: \"center\", alignItems: \"center\"}}>\r\n <Spin indicator={<LoadingOutlined spin/>} size=\"large\" spinning percent=\"auto\"/>\r\n </div>\r\n );\r\n }\r\n\r\n}"]}