@magic-xpa/engine 4.1100.0-dev4110.25 → 4.1100.0-dev4110.250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (521) hide show
  1. package/{esm2020 → esm2022}/index.mjs +188 -188
  2. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  3. package/esm2022/src/AccessHelper.mjs +15 -0
  4. package/esm2022/src/ClientManager.mjs +416 -0
  5. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  6. package/esm2022/src/CommandsProcessorManager.mjs +26 -0
  7. package/esm2022/src/CommandsTable.mjs +162 -0
  8. package/esm2022/src/ConstInterface.mjs +517 -0
  9. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  10. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  11. package/esm2022/src/GUIManager.mjs +62 -0
  12. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  13. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  14. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  15. package/esm2022/src/ServerConfig.mjs +122 -0
  16. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  17. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  18. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  19. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  22. package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
  23. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  24. package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
  25. package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
  26. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
  27. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  28. package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
  29. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  32. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  33. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  34. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
  35. package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
  36. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
  37. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
  38. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  40. package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
  41. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
  42. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  44. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
  45. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
  47. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
  48. package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
  49. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  50. package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
  51. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
  52. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
  53. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
  54. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  55. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  56. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  57. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  58. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
  59. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  60. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  61. package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
  62. package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
  63. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  64. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  65. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  66. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  67. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  70. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  71. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  72. package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
  73. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  74. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  75. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  76. package/esm2022/src/data/DataView.mjs +1613 -0
  77. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  78. package/esm2022/src/data/DataviewManager.mjs +28 -0
  79. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  80. package/esm2022/src/data/DvCache.mjs +67 -0
  81. package/esm2022/src/data/Field.mjs +646 -0
  82. package/esm2022/src/data/FieldBase.mjs +15 -0
  83. package/esm2022/src/data/FieldsTable.mjs +103 -0
  84. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  85. package/esm2022/src/data/Key.mjs +88 -0
  86. package/esm2022/src/data/Record.mjs +880 -0
  87. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  88. package/esm2022/src/data/RecordsTable.mjs +267 -0
  89. package/esm2022/src/data/TaskTransactionManager.mjs +107 -0
  90. package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
  91. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  92. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  93. package/esm2022/src/env/Environment.mjs +487 -0
  94. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  95. package/esm2022/src/env/LanguageData.mjs +227 -0
  96. package/esm2022/src/env/MirrorString.mjs +65 -0
  97. package/esm2022/src/event/ActionManager.mjs +91 -0
  98. package/esm2022/src/event/Event.mjs +1333 -0
  99. package/esm2022/src/event/EventHandler.mjs +766 -0
  100. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  101. package/esm2022/src/event/EventsManager.mjs +2988 -0
  102. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  103. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  104. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  105. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  106. package/esm2022/src/exp/ExpTable.mjs +57 -0
  107. package/esm2022/src/exp/Expression.mjs +200 -0
  108. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  109. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  110. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  111. package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
  112. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  113. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  114. package/esm2022/src/gui/FormsTable.mjs +66 -0
  115. package/esm2022/src/gui/MgControl.mjs +363 -0
  116. package/esm2022/src/gui/MgForm.mjs +1224 -0
  117. package/esm2022/src/http/HttpManager.mjs +97 -0
  118. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  119. package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
  120. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  121. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  122. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  123. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  124. package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
  125. package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
  126. package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
  127. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
  128. package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
  129. package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
  130. package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  133. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  134. package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
  135. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  136. package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
  137. package/esm2022/src/remote/ServerError.mjs +40 -0
  138. package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
  139. package/esm2022/src/rt/Argument.mjs +265 -0
  140. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  141. package/esm2022/src/rt/Boundary.mjs +152 -0
  142. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  143. package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
  144. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  145. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  146. package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
  147. package/esm2022/src/rt/ExecutionStack.mjs +94 -0
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  149. package/esm2022/src/rt/HandlersTable.mjs +96 -0
  150. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  151. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  153. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  154. package/esm2022/src/rt/Operation.mjs +735 -0
  155. package/esm2022/src/rt/OperationTable.mjs +67 -0
  156. package/esm2022/src/rt/Recompute.mjs +355 -0
  157. package/esm2022/src/rt/RecomputeTable.mjs +63 -0
  158. package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
  159. package/esm2022/src/rt/ResultValue.mjs +10 -0
  160. package/esm2022/src/rt/TableCache.mjs +177 -0
  161. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  162. package/esm2022/src/rt/Transaction.mjs +53 -0
  163. package/esm2022/src/security/UserDetails.mjs +71 -0
  164. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  165. package/esm2022/src/tasks/MGData.mjs +552 -0
  166. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  167. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  168. package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
  169. package/esm2022/src/tasks/Task.mjs +2499 -0
  170. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  171. package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
  172. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  173. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  174. package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
  175. package/esm2022/src/util/ConstUtils.mjs +14 -0
  176. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  177. package/esm2022/src/util/HeapSort.mjs +70 -0
  178. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  179. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  181. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  182. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  183. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  184. package/esm2022/src/util/PrmMap.mjs +152 -0
  185. package/esm2022/src/util/ReturnResult.mjs +46 -0
  186. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  187. package/esm2022/src/util/Scrambler.mjs +89 -0
  188. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  189. package/esm2022/src/util/cookie.service.mjs +92 -0
  190. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29883 -29693
  191. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  192. package/index.d.ts +187 -187
  193. package/package.json +8 -14
  194. package/src/AccessHelper.d.ts +20 -20
  195. package/src/ClientManager.d.ts +35 -32
  196. package/src/CommandsProcessorBase.d.ts +23 -23
  197. package/src/CommandsProcessorManager.d.ts +6 -6
  198. package/src/CommandsTable.d.ts +22 -22
  199. package/src/ConstInterface.d.ts +516 -515
  200. package/src/CurrentClientVersion.d.ts +1 -1
  201. package/src/FlowMonitorInterface.d.ts +15 -15
  202. package/src/GUIManager.d.ts +17 -17
  203. package/src/GlobalCommandsManager.d.ts +17 -17
  204. package/src/GuiEventsProcessor.d.ts +24 -24
  205. package/src/ICommandsTable.d.ts +9 -9
  206. package/src/ServerConfig.d.ts +35 -34
  207. package/src/bridge/IGuiEvent.d.ts +19 -19
  208. package/src/bridge/MagicBridge.d.ts +16 -16
  209. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  210. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  211. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  212. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
  214. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  216. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
  217. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  218. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  219. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
  220. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
  221. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
  222. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  223. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  224. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  225. package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
  226. package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
  227. package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
  228. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
  229. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  230. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  231. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
  232. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
  233. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
  234. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  235. package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
  236. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
  237. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
  238. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
  239. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
  240. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  241. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
  242. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
  243. package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
  244. package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
  245. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  246. package/src/commands/DataViewCommandBase.d.ts +6 -6
  247. package/src/commands/IClientCommand.d.ts +2 -2
  248. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  249. package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
  250. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  251. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  252. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  253. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  254. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  255. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  256. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  257. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  258. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  259. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  262. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  263. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  264. package/src/communications/IConnectionStateManager.d.ts +4 -4
  265. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  266. package/src/data/DataSourceIdKey.d.ts +2 -2
  267. package/src/data/DataView.d.ts +162 -162
  268. package/src/data/DataViewBase.d.ts +12 -12
  269. package/src/data/DataviewManager.d.ts +14 -14
  270. package/src/data/DataviewManagerBase.d.ts +11 -11
  271. package/src/data/DvCache.d.ts +15 -15
  272. package/src/data/Field.d.ts +103 -103
  273. package/src/data/FieldBase.d.ts +23 -23
  274. package/src/data/FieldsTable.d.ts +27 -27
  275. package/src/data/IRecordsTable.d.ts +7 -7
  276. package/src/data/Key.d.ts +15 -15
  277. package/src/data/Record.d.ts +157 -156
  278. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  279. package/src/data/RecordsTable.d.ts +38 -38
  280. package/src/data/TaskTransactionManager.d.ts +17 -17
  281. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  282. package/src/enums.d.ts +21 -21
  283. package/src/env/EnvVariablesTable.d.ts +17 -17
  284. package/src/env/Environment.d.ts +118 -118
  285. package/src/env/ILanguageData.d.ts +3 -3
  286. package/src/env/LanguageData.d.ts +20 -20
  287. package/src/env/MirrorString.d.ts +15 -15
  288. package/src/event/ActionManager.d.ts +14 -14
  289. package/src/event/Event.d.ts +79 -79
  290. package/src/event/EventHandler.d.ts +66 -66
  291. package/src/event/EventHandlerPosition.d.ts +25 -25
  292. package/src/event/EventsManager.d.ts +205 -204
  293. package/src/event/IEventsManager.d.ts +77 -77
  294. package/src/event/RunTimeEvent.d.ts +126 -123
  295. package/src/event/RunTimeEventBase.d.ts +5 -5
  296. package/src/event/UserEventsTable.d.ts +11 -11
  297. package/src/exp/ExpTable.d.ts +11 -11
  298. package/src/exp/Expression.d.ts +37 -37
  299. package/src/exp/ExpressionDict.d.ts +12 -12
  300. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  301. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  302. package/src/exp/GlobalParamsTable.d.ts +19 -19
  303. package/src/exp/YesNoExp.d.ts +9 -9
  304. package/src/gui/CreatedFormVector.d.ts +10 -10
  305. package/src/gui/FormsTable.d.ts +15 -15
  306. package/src/gui/MgControl.d.ts +60 -60
  307. package/src/gui/MgForm.d.ts +96 -93
  308. package/src/http/HttpManager.d.ts +25 -25
  309. package/src/http/client/HttpClientAsync.d.ts +16 -16
  310. package/src/http/client/HttpClientBase.d.ts +30 -30
  311. package/src/http/client/HttpClientEvents.d.ts +18 -18
  312. package/src/http/client/HttpClientSync.d.ts +17 -17
  313. package/src/http/client/HttpUtility.d.ts +10 -10
  314. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  315. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  316. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  319. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  320. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  321. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  322. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  323. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  324. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  325. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ServerError.d.ts +16 -16
  329. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  330. package/src/rt/Argument.d.ts +36 -36
  331. package/src/rt/ArgumentsList.d.ts +24 -24
  332. package/src/rt/Boundary.d.ts +27 -27
  333. package/src/rt/CompMainPrgTable.d.ts +10 -10
  334. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  335. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  336. package/src/rt/DataviewHeaders.d.ts +12 -12
  337. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  338. package/src/rt/ExecutionStack.d.ts +22 -22
  339. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  340. package/src/rt/HandlersTable.d.ts +19 -19
  341. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  342. package/src/rt/IDataviewHeader.d.ts +10 -10
  343. package/src/rt/IResultValue.d.ts +4 -4
  344. package/src/rt/LastFocusedManager.d.ts +23 -23
  345. package/src/rt/Operation.d.ts +97 -97
  346. package/src/rt/OperationTable.d.ts +15 -15
  347. package/src/rt/Recompute.d.ts +41 -41
  348. package/src/rt/RecomputeTable.d.ts +9 -9
  349. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  350. package/src/rt/ResultValue.d.ts +7 -7
  351. package/src/rt/TableCache.d.ts +29 -29
  352. package/src/rt/TableCacheManager.d.ts +10 -10
  353. package/src/rt/Transaction.d.ts +23 -23
  354. package/src/security/UserDetails.d.ts +16 -16
  355. package/src/tasks/IMGDataCollection.d.ts +26 -26
  356. package/src/tasks/MGData.d.ts +63 -63
  357. package/src/tasks/MGDataCollection.d.ts +42 -42
  358. package/src/tasks/RCTimer.d.ts +13 -13
  359. package/src/tasks/RemoteTaskService.d.ts +16 -16
  360. package/src/tasks/Task.d.ts +312 -312
  361. package/src/tasks/TaskBase.d.ts +123 -123
  362. package/src/tasks/TaskServiceBase.d.ts +16 -16
  363. package/src/tasks/TasksTable.d.ts +21 -21
  364. package/src/tasks/sort/Sort.d.ts +4 -4
  365. package/src/tasks/sort/SortCollection.d.ts +11 -11
  366. package/src/util/ConstUtils.d.ts +3 -3
  367. package/src/util/FlowMonitorQueue.d.ts +70 -70
  368. package/src/util/HeapSort.d.ts +6 -6
  369. package/src/util/IMirrorXML.d.ts +6 -6
  370. package/src/util/IServerConfig.d.ts +11 -11
  371. package/src/util/MgBlockingQueue.d.ts +5 -5
  372. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  373. package/src/util/MgPriorityQueue.d.ts +13 -13
  374. package/src/util/ParamParseResult.d.ts +6 -6
  375. package/src/util/PrmMap.d.ts +28 -28
  376. package/src/util/ReturnResult.d.ts +18 -18
  377. package/src/util/ReturnResultBase.d.ts +11 -11
  378. package/src/util/Scrambler.d.ts +10 -10
  379. package/src/util/UniqueIDUtils.d.ts +4 -4
  380. package/src/util/cookie.service.d.ts +8 -8
  381. package/esm2020/src/AccessHelper.mjs +0 -9
  382. package/esm2020/src/ClientManager.mjs +0 -399
  383. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  384. package/esm2020/src/CommandsProcessorManager.mjs +0 -26
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/bridge/MagicBridge.mjs +0 -41
  393. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  394. package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
  395. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  396. package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
  397. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  398. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  399. package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
  400. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  401. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  402. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  403. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  404. package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
  405. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  406. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  407. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  408. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  409. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  410. package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
  411. package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
  412. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  413. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  414. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  415. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  416. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  417. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  418. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  419. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  420. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  421. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  422. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  423. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  424. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  425. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  426. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  427. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  428. package/esm2020/src/data/DataView.mjs +0 -1610
  429. package/esm2020/src/data/DataviewManager.mjs +0 -28
  430. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  431. package/esm2020/src/data/DvCache.mjs +0 -67
  432. package/esm2020/src/data/Field.mjs +0 -646
  433. package/esm2020/src/data/FieldBase.mjs +0 -18
  434. package/esm2020/src/data/FieldsTable.mjs +0 -103
  435. package/esm2020/src/data/Key.mjs +0 -88
  436. package/esm2020/src/data/Record.mjs +0 -846
  437. package/esm2020/src/data/RecordsTable.mjs +0 -267
  438. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  439. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  440. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  441. package/esm2020/src/env/Environment.mjs +0 -489
  442. package/esm2020/src/env/LanguageData.mjs +0 -226
  443. package/esm2020/src/env/MirrorString.mjs +0 -65
  444. package/esm2020/src/event/ActionManager.mjs +0 -91
  445. package/esm2020/src/event/Event.mjs +0 -1333
  446. package/esm2020/src/event/EventHandler.mjs +0 -766
  447. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  448. package/esm2020/src/event/EventsManager.mjs +0 -2975
  449. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  450. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  451. package/esm2020/src/exp/ExpTable.mjs +0 -59
  452. package/esm2020/src/exp/Expression.mjs +0 -200
  453. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  454. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  455. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  456. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  457. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  458. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  459. package/esm2020/src/gui/FormsTable.mjs +0 -66
  460. package/esm2020/src/gui/MgControl.mjs +0 -353
  461. package/esm2020/src/gui/MgForm.mjs +0 -1181
  462. package/esm2020/src/http/HttpManager.mjs +0 -97
  463. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  464. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  465. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  466. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  467. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  468. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  469. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  470. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  471. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  472. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  473. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  474. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  475. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  476. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  477. package/esm2020/src/remote/ServerError.mjs +0 -40
  478. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  479. package/esm2020/src/rt/Argument.mjs +0 -265
  480. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  481. package/esm2020/src/rt/Boundary.mjs +0 -152
  482. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  483. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  484. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  485. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  486. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  487. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  488. package/esm2020/src/rt/Operation.mjs +0 -735
  489. package/esm2020/src/rt/OperationTable.mjs +0 -67
  490. package/esm2020/src/rt/Recompute.mjs +0 -355
  491. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  492. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  493. package/esm2020/src/rt/ResultValue.mjs +0 -12
  494. package/esm2020/src/rt/TableCache.mjs +0 -177
  495. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  496. package/esm2020/src/rt/Transaction.mjs +0 -53
  497. package/esm2020/src/security/UserDetails.mjs +0 -71
  498. package/esm2020/src/tasks/MGData.mjs +0 -552
  499. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  500. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  501. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  502. package/esm2020/src/tasks/Task.mjs +0 -2495
  503. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  504. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  505. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  506. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  507. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  508. package/esm2020/src/util/ConstUtils.mjs +0 -14
  509. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  510. package/esm2020/src/util/HeapSort.mjs +0 -70
  511. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  512. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  513. package/esm2020/src/util/PrmMap.mjs +0 -151
  514. package/esm2020/src/util/ReturnResult.mjs +0 -46
  515. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  516. package/esm2020/src/util/Scrambler.mjs +0 -89
  517. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  518. package/esm2020/src/util/cookie.service.mjs +0 -92
  519. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  520. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  521. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,1224 @@
1
+ import { Commands, CommandType, DataModificationTypes, GuiEnvironment, Manager, MgFormBase, PropInterface } from '@magic-xpa/gui';
2
+ import { Constants, InternalInterface, Logger, MgControlType, Misc, Priority, XMLConstants } from '@magic-xpa/utils';
3
+ import { ApplicationException, Debug, Exception, Int32, isNullOrUndefined, NString, RefParam, StringBuilder } from '@magic-xpa/mscorelib';
4
+ import { MgControl } from './MgControl';
5
+ import { RecordOutOfDataViewException } from '../data/RecordOutOfDataViewException';
6
+ import { SET_DISPLAYLINE_BY_DV } from '../data/DataView';
7
+ import { TaskBase } from '../tasks/TaskBase';
8
+ import { ServerError } from '../remote/ServerError';
9
+ import { ConstInterface } from '../ConstInterface';
10
+ import { LastFocusedManager } from '../rt/LastFocusedManager';
11
+ import { CreatedFormVector } from './CreatedFormVector';
12
+ import { AccessHelper } from '../AccessHelper';
13
+ import { ClientManager } from '../ClientManager';
14
+ export class MgForm extends MgFormBase {
15
+ static TIME_LIMIT = 50;
16
+ IsMovingInView = false;
17
+ PrevDisplayLine = 0;
18
+ RefreshAllRows = false;
19
+ IgnoreFirstRecordCycle = false;
20
+ MovedToFirstControl = false;
21
+ _suffixDone = false;
22
+ hiddenControlsIsnsList = null;
23
+ static _createdForms = new CreatedFormVector();
24
+ _transferringDataToGUI = false;
25
+ isFetchingRecordsAhead = false;
26
+ constructor() {
27
+ super();
28
+ }
29
+ static get CreatedForms() {
30
+ return MgForm._createdForms;
31
+ }
32
+ get InRestore() {
33
+ return this._inRestore;
34
+ }
35
+ get TransferringDataToGUI() {
36
+ return this._transferringDataToGUI;
37
+ }
38
+ get shouldFetchRecordsAheadFromServer() {
39
+ if (this.isTableWithPagination()) {
40
+ let prop = this._tableMgControl.GetComputedProperty(PropInterface.PROP_TYPE_SERVER_READ_AHEAD);
41
+ return (prop != null ? prop.GetComputedValueBoolean() : false);
42
+ }
43
+ else
44
+ return false;
45
+ }
46
+ async FetchRecordsAheadFromServer() {
47
+ this.isFetchingRecordsAhead = true;
48
+ await this.GetDataview().FetchRecordsAheadFromServer();
49
+ this.isFetchingRecordsAhead = false;
50
+ }
51
+ GetDataview() {
52
+ let dv = null;
53
+ if (this._task != null)
54
+ dv = this._task.DataView;
55
+ return (dv);
56
+ }
57
+ async moveInView(unit, direction) {
58
+ let oldRecId = Int32.MinValue;
59
+ let currRec = this.GetDataview().getCurrRec();
60
+ let oldTaskMode = ' ';
61
+ let returnToVisibleLine = false;
62
+ let recordOutOfView = false;
63
+ let visibleLine = 0;
64
+ try {
65
+ this.IsMovingInView = true;
66
+ let oldDisplayLine = this.DisplayLine;
67
+ if (unit === Constants.MOVE_UNIT_TABLE) {
68
+ try {
69
+ if (direction === Constants.MOVE_DIRECTION_BEGIN) {
70
+ await this.GetDataview().setCurrRecByIdx(Constants.MG_DATAVIEW_FIRST_RECORD, true, false, true, SET_DISPLAYLINE_BY_DV);
71
+ if (this.isLineMode()) {
72
+ this.GetDataview().setTopRecIdx(0);
73
+ await this.setCurrRowByDisplayLine(0, false, false);
74
+ }
75
+ }
76
+ else {
77
+ await this.GetDataview().setCurrRecByIdx(Constants.MG_DATAVIEW_LAST_RECORD, true, false, true, SET_DISPLAYLINE_BY_DV);
78
+ if (this.isLineMode()) {
79
+ this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx() - this._rowsInPage + 1);
80
+ if (this.GetDataview().getTopRecIdx() >= 0)
81
+ await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(), false, false);
82
+ else {
83
+ this.GetDataview().setTopRecIdx(0);
84
+ await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(), false, false);
85
+ }
86
+ }
87
+ }
88
+ this.updateDisplayLineByDV();
89
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
90
+ }
91
+ catch (ex) {
92
+ if (ex instanceof RecordOutOfDataViewException)
93
+ Logger.Instance.WriteDevToLog(ex.Message);
94
+ }
95
+ }
96
+ else {
97
+ this.getTopIndexFromGUI();
98
+ let size;
99
+ if (unit === Constants.MOVE_UNIT_PAGE && this.isLineMode()) {
100
+ switch (direction) {
101
+ case Constants.MOVE_DIRECTION_BEGIN:
102
+ size = this.GetDataview().getCurrRecIdx() - this.GetDataview().getTopRecIdx();
103
+ break;
104
+ case Constants.MOVE_DIRECTION_END:
105
+ let last = this.GetDataview().getTopRecIdx() + this._rowsInPage - 1;
106
+ last = Math.min(last, this.GetDataview().getSize() - 1);
107
+ size = last - this.GetDataview().getCurrRecIdx();
108
+ break;
109
+ default:
110
+ returnToVisibleLine = true;
111
+ size = this._rowsInPage;
112
+ break;
113
+ }
114
+ }
115
+ else
116
+ size = 1;
117
+ size = (direction === Constants.MOVE_DIRECTION_PREV ||
118
+ direction === Constants.MOVE_DIRECTION_BEGIN
119
+ ? -size
120
+ : size);
121
+ if (this.isLineMode()) {
122
+ visibleLine = this.getVisibleLine();
123
+ if (visibleLine < 0) {
124
+ visibleLine = 0;
125
+ recordOutOfView = true;
126
+ }
127
+ if (visibleLine > this._rowsInPage + 1) {
128
+ visibleLine = this._rowsInPage;
129
+ recordOutOfView = true;
130
+ }
131
+ if (unit === Constants.MOVE_UNIT_PAGE &&
132
+ (direction === Constants.MOVE_DIRECTION_NEXT ||
133
+ direction === Constants.MOVE_DIRECTION_PREV) ||
134
+ unit === Constants.MOVE_UNIT_ROW &&
135
+ (direction === Constants.MOVE_DIRECTION_NEXT && visibleLine === this._rowsInPage - 1 ||
136
+ direction === Constants.MOVE_DIRECTION_PREV && visibleLine === 0)) {
137
+ if (direction === Constants.MOVE_DIRECTION_PREV &&
138
+ (unit === Constants.MOVE_UNIT_ROW || unit === Constants.MOVE_UNIT_PAGE) &&
139
+ visibleLine === 0 && this.GetDataview().getCurrRecIdx() === 0 && this.GetDataview().IncludesFirst())
140
+ return;
141
+ if (direction === Constants.MOVE_DIRECTION_NEXT && unit === Constants.MOVE_UNIT_PAGE &&
142
+ visibleLine === this.getLastValidRow() && this.GetDataview().getCurrRecIdx() === this.GetDataview().getSize() - 1 && this.GetDataview().IncludesLast())
143
+ return;
144
+ oldRecId = (this.GetDataview().getCurrRec()).getId();
145
+ this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx() + size);
146
+ this.GetDataview().setTopRecIdxModified(true);
147
+ try {
148
+ this._suffixDone = false;
149
+ await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx() + size, true, false);
150
+ this.GetDataview().setTopRecIdxModified(false);
151
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
152
+ }
153
+ catch (ex) {
154
+ if (ex instanceof RecordOutOfDataViewException) {
155
+ this.GetDataview().setTopRecIdxModified(false);
156
+ if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
157
+ this.GetDataview().restoreTopRecIdx();
158
+ await this.restoreOldDisplayLine(oldDisplayLine);
159
+ return;
160
+ }
161
+ if (this.GetDataview().getTopRecIdx() < 0) {
162
+ this.GetDataview().setTopRecIdx(0);
163
+ try {
164
+ await this.setCurrRowByDisplayLine(0, true, false);
165
+ }
166
+ catch (exception) {
167
+ if (exception instanceof Exception) {
168
+ if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
169
+ this.GetDataview().restoreTopRecIdx();
170
+ await this.restoreOldDisplayLine(oldDisplayLine);
171
+ return;
172
+ }
173
+ }
174
+ }
175
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
176
+ }
177
+ else if (unit !== Constants.MOVE_UNIT_ROW && this.GetDataview().recExists(this.GetDataview().getTopRecIdx())) {
178
+ let newRecId = (this.GetDataview().getCurrRec()).getId();
179
+ if (newRecId === oldRecId && !this._suffixDone) {
180
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_SUFFIX);
181
+ if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
182
+ this.GetDataview().restoreTopRecIdx();
183
+ await this.restoreOldDisplayLine(oldDisplayLine);
184
+ return;
185
+ }
186
+ try {
187
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
188
+ await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + this.getLastValidRow(), false, true);
189
+ visibleLine = this.getLastValidRow();
190
+ }
191
+ catch (Exception) {
192
+ }
193
+ }
194
+ }
195
+ else {
196
+ this.GetDataview().restoreTopRecIdx();
197
+ await this.restoreOldDisplayLine(oldDisplayLine);
198
+ if (unit === Constants.MOVE_UNIT_ROW && direction === Constants.MOVE_DIRECTION_NEXT) {
199
+ if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE)
200
+ this._task.setExecEndTask();
201
+ else
202
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
203
+ }
204
+ return;
205
+ }
206
+ Logger.Instance.WriteDevToLog(ex.Message);
207
+ }
208
+ }
209
+ }
210
+ else {
211
+ try {
212
+ oldTaskMode = this._task.getMode();
213
+ oldRecId = (this.GetDataview().getCurrRec()).getId();
214
+ await this.setCurrRowByDisplayLine(oldDisplayLine + size, true, false);
215
+ if (!this.GetDataview().recExistsById(oldRecId)) {
216
+ if (size > 0 || oldTaskMode !== Constants.TASK_MODE_CREATE)
217
+ if (size !== -1 || this.GetDataview().recExists(oldDisplayLine))
218
+ await this.setCurrRowByDisplayLine(oldDisplayLine, false, false);
219
+ else
220
+ Logger.Instance.WriteDevToLog(NString.Format("skipped setcurrRow for row {0}", oldDisplayLine));
221
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
222
+ }
223
+ else if (AccessHelper.eventsManager.GetStopExecutionFlag()) {
224
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
225
+ }
226
+ }
227
+ catch (ex) {
228
+ if (ex instanceof RecordOutOfDataViewException) {
229
+ if (this.GetDataview().recExistsById(oldRecId)) {
230
+ await this.restoreOldDisplayLine(oldDisplayLine);
231
+ if (!currRec.Synced && oldTaskMode === Constants.TASK_MODE_CREATE) {
232
+ this._task.setMode(Constants.TASK_MODE_CREATE);
233
+ currRec.clearMode();
234
+ currRec.setMode(DataModificationTypes.Insert);
235
+ currRec.setNewRec();
236
+ }
237
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
238
+ }
239
+ else {
240
+ if (oldTaskMode === Constants.TASK_MODE_CREATE && oldDisplayLine > 0)
241
+ await this.restoreOldDisplayLine(oldDisplayLine - 1);
242
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
243
+ }
244
+ if (size <= 0 || AccessHelper.eventsManager.GetStopExecutionFlag())
245
+ Logger.Instance.WriteDevToLog(ex.Message);
246
+ else {
247
+ if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE) {
248
+ this._task.setExecEndTask();
249
+ return;
250
+ }
251
+ else {
252
+ if (this._task.ActionManager.isEnabled(InternalInterface.MG_ACT_CRELINE))
253
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
254
+ else {
255
+ let doRecordSuffix = true;
256
+ let refdoRecordSuffix = new RefParam(doRecordSuffix);
257
+ if (!await AccessHelper.eventsManager.DoTaskLevelRecordSuffix(this._task, refdoRecordSuffix))
258
+ await AccessHelper.eventsManager.DoTaskLevelRecordPrefix(this._task);
259
+ doRecordSuffix = refdoRecordSuffix.value;
260
+ }
261
+ }
262
+ }
263
+ return;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ else {
269
+ try {
270
+ await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx() + size, true, false, true, SET_DISPLAYLINE_BY_DV);
271
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
272
+ }
273
+ catch (ex) {
274
+ if (ex instanceof RecordOutOfDataViewException) {
275
+ if (size > 0) {
276
+ if (!this._task.IsInteractive && this._task.getMode() !== Constants.TASK_MODE_CREATE)
277
+ this._task.setExecEndTask();
278
+ else
279
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
280
+ }
281
+ else
282
+ Logger.Instance.WriteDevToLog(ex.Message);
283
+ return;
284
+ }
285
+ else if (ex instanceof ServerError) {
286
+ await this._task.stop();
287
+ this._task.abort();
288
+ await AccessHelper.eventsManager.ProcessAbortingError(ex);
289
+ }
290
+ else if (ex instanceof Exception) {
291
+ Logger.Instance.WriteDevToLog(ex.Message);
292
+ return;
293
+ }
294
+ }
295
+ }
296
+ }
297
+ if (returnToVisibleLine) {
298
+ if (recordOutOfView) {
299
+ if (visibleLine === 0)
300
+ this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx());
301
+ else
302
+ this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx() - this._rowsInPage);
303
+ this.SetTableTopIndex();
304
+ }
305
+ else {
306
+ this.SetTableTopIndex();
307
+ await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + visibleLine, false, true);
308
+ }
309
+ }
310
+ else
311
+ this.SetTableTopIndex();
312
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_PREFIX);
313
+ }
314
+ catch (e) {
315
+ if (e instanceof RecordOutOfDataViewException) {
316
+ Logger.Instance.WriteDevToLog(e.Message);
317
+ }
318
+ }
319
+ finally {
320
+ this.SelectRow();
321
+ this.IsMovingInView = false;
322
+ }
323
+ }
324
+ async addRec(doSuffix, isCrelineAbove) {
325
+ let newLine = 1;
326
+ let currLine = -1;
327
+ if (!this._task.DataView.isEmptyDataview())
328
+ currLine = this.getVisibleLine();
329
+ if (this.isTableWithAbsoluteScrollbar()) {
330
+ this.GetDataview().TotalRecordsCount += 1;
331
+ this.RefreshAllRows = true;
332
+ }
333
+ let newRecIdx = await this.GetDataview().addRecord(doSuffix, false, isCrelineAbove);
334
+ if (newRecIdx > -1) {
335
+ if (this.isLineMode()) {
336
+ let newCurrRow;
337
+ if (this.GetDataview().getSize() === 0 || this.GetDataview().getTopRecIdx() === Int32.MinValue) {
338
+ this.GetDataview().setTopRecIdx(0);
339
+ newCurrRow = 0;
340
+ }
341
+ else if (currLine === this._rowsInPage - 1) {
342
+ this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx() + 1);
343
+ newCurrRow = this.getVisibleLine();
344
+ }
345
+ else {
346
+ if (isCrelineAbove)
347
+ newCurrRow = currLine > 0 ? currLine : 0;
348
+ else
349
+ newCurrRow = currLine + 1;
350
+ }
351
+ newLine = this.GetDataview().getTopRecIdx() + newCurrRow;
352
+ this.removeRecordsAfterIdx(this.GetDataview().getTopRecIdx() + newCurrRow);
353
+ try {
354
+ if (!this._task.DataView.isEmptyDataview())
355
+ this._task.setMode(Constants.TASK_MODE_CREATE);
356
+ await this.setCurrRowByDisplayLine(newLine, false, false);
357
+ }
358
+ catch (ex) {
359
+ if (ex instanceof RecordOutOfDataViewException) {
360
+ Logger.Instance.WriteDevToLog(NString.Format("in Form.addRec() {0}", ex.Message));
361
+ }
362
+ }
363
+ await this.RefreshDisplay(Constants.TASK_REFRESH_TABLE);
364
+ }
365
+ }
366
+ else if (this.isTableWithAbsoluteScrollbar()) {
367
+ this.GetDataview().TotalRecordsCount -= 1;
368
+ this.RefreshAllRows = false;
369
+ }
370
+ }
371
+ async delCurrRec() {
372
+ let topTableRow = super.isLineMode() && this.GetDataview().getTopRecIdx() === this.GetDataview().getCurrRecIdx();
373
+ await this.GetDataview().removeCurrRec();
374
+ if (this.GetDataview().isEmpty() && !this._task.IsTryingToStop) {
375
+ if (this._task.DataView.isEmptyDataview()) {
376
+ await this.addRec(false, false);
377
+ }
378
+ else {
379
+ if (await this._task.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)) {
380
+ if (this._task.getMode() !== Constants.TASK_MODE_CREATE)
381
+ this._task.setMode(Constants.TASK_MODE_CREATE);
382
+ this._task.enableCreateActs(true);
383
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
384
+ }
385
+ else
386
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_EXIT);
387
+ }
388
+ }
389
+ if (!this.GetDataview().isEmpty()) {
390
+ if (topTableRow)
391
+ this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx());
392
+ if (super.isLineMode()) {
393
+ if (super.HasTable()) {
394
+ if (this.isTableWithAbsoluteScrollbar()) {
395
+ this.GetDataview().TotalRecordsCount--;
396
+ this.RefreshAllRows = true;
397
+ }
398
+ this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx());
399
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
400
+ }
401
+ else
402
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
403
+ }
404
+ else {
405
+ try {
406
+ await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(), true, true, true, SET_DISPLAYLINE_BY_DV);
407
+ }
408
+ catch (ex) {
409
+ if (ex instanceof RecordOutOfDataViewException) {
410
+ }
411
+ else
412
+ throw ex;
413
+ }
414
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
415
+ }
416
+ }
417
+ }
418
+ async cancelEdit(isActCancel, isQuitEvent) {
419
+ let mode = this._task.getMode();
420
+ let newMode;
421
+ let row = 0;
422
+ let execRecPrefix = false;
423
+ if (this.GetDataview().getSize() === 1 && mode === Constants.TASK_MODE_CREATE)
424
+ newMode = Constants.TASK_MODE_CREATE;
425
+ else
426
+ newMode = Constants.TASK_MODE_MODIFY;
427
+ let recRemoved = await this.GetDataview().cancelEdit(false, false);
428
+ this.GetDataview().setPrevCurrRec(null);
429
+ if ((this.GetDataview().isEmpty() || ((isActCancel && recRemoved) && (!GuiEnvironment.Environment.GetSpecialCancelOnCreate()) && this._task.getOriginalTaskMode() === Constants.TASK_MODE_CREATE)) && !this._task.IsTryingToStop) {
430
+ let orgCancelWasRaised = this._task.cancelWasRaised();
431
+ this._task.setCancelWasRaised(isActCancel);
432
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_CRELINE);
433
+ this._task.setCancelWasRaised(orgCancelWasRaised);
434
+ }
435
+ else if (isActCancel)
436
+ execRecPrefix = true;
437
+ if (!this.GetDataview().isEmpty()) {
438
+ if (super.isLineMode()) {
439
+ try {
440
+ if (super.HasTable()) {
441
+ row = this.getVisibleLine();
442
+ if (row < 0 || row >= this._rowsInPage) {
443
+ let topRecIdx = this.GetDataview().getTopRecIdx();
444
+ let currRecIdx = this.GetDataview().getCurrRecIdx();
445
+ if (topRecIdx > currRecIdx)
446
+ this.GetDataview().setTopRecIdx(currRecIdx);
447
+ row = 0;
448
+ }
449
+ await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + row, false, true);
450
+ }
451
+ }
452
+ catch (ex) {
453
+ if (ex instanceof RecordOutOfDataViewException) {
454
+ if (row !== 0)
455
+ Logger.Instance.WriteDevToLog(NString.Format("in Form.cancelEdit() {0}", ex.Message));
456
+ }
457
+ else
458
+ throw ex;
459
+ }
460
+ if (super.HasTable()) {
461
+ if (this.isTableWithAbsoluteScrollbar() && recRemoved) {
462
+ this.GetDataview().TotalRecordsCount--;
463
+ this.RefreshAllRows = true;
464
+ }
465
+ this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx());
466
+ }
467
+ }
468
+ else {
469
+ try {
470
+ await this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(), false, true, true, SET_DISPLAYLINE_BY_DV);
471
+ }
472
+ catch (ex) {
473
+ if (ex instanceof RecordOutOfDataViewException) {
474
+ Logger.Instance.WriteDevToLog("in Form.cancelEdit() error in Screen mode for Current Record");
475
+ }
476
+ else
477
+ throw ex;
478
+ }
479
+ }
480
+ this._task.setMode(newMode);
481
+ if (!this._task.InEndTask)
482
+ await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
483
+ if (!this._task.InEndTask)
484
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
485
+ }
486
+ if (execRecPrefix) {
487
+ this._task.setLevel(Constants.TASK_LEVEL_TASK);
488
+ let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
489
+ if (lastParkedCtrl !== null) {
490
+ if (lastParkedCtrl.getForm().getTask().pathContains(this._task))
491
+ for (let parent = lastParkedCtrl.getForm().getTask(); parent !== null && parent !== this._task; parent = parent.getParent()) {
492
+ parent.setLevel(Constants.TASK_LEVEL_TASK);
493
+ (parent.DataView.getCurrRec()).resetModified();
494
+ }
495
+ else
496
+ lastParkedCtrl.getForm().getTask().setLevel(Constants.TASK_LEVEL_TASK);
497
+ }
498
+ if (!isQuitEvent) {
499
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_PREFIX);
500
+ await AccessHelper.eventsManager.HandleParkabilityOnRowChange(this._task);
501
+ }
502
+ }
503
+ }
504
+ async refreshOnExpressions() {
505
+ for (let i = 0; i < this.CtrlTab.getSize(); i = i + 1) {
506
+ let mgControl = ((this.CtrlTab.getCtrl(i) instanceof MgControl) ? this.CtrlTab.getCtrl(i) : null);
507
+ if (mgControl != null)
508
+ await mgControl.refreshOnExpression();
509
+ else
510
+ Debug.Assert(false);
511
+ }
512
+ await super.refreshPropsOnExpression();
513
+ }
514
+ removeRefsToCtrls() {
515
+ let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
516
+ if (lastFocusedControl !== null && lastFocusedControl.getForm() === this)
517
+ LastFocusedManager.setLastFocusedControl(this._task, null);
518
+ super.removeRefsToCtrls();
519
+ }
520
+ getCtrlByCtrlName(ctrlName) {
521
+ return this.CtrlTab.getCtrl(ctrlName);
522
+ }
523
+ getSubFormCtrlByName(ctrlName) {
524
+ let guiParentTask;
525
+ let destSubForm = null;
526
+ for (guiParentTask = this._task; destSubForm === null && guiParentTask !== null && guiParentTask.getForm() !== null; guiParentTask = guiParentTask.getParent()) {
527
+ destSubForm = guiParentTask.getForm().getCtrlByName(ctrlName, MgControlType.CTRL_TYPE_SUBFORM);
528
+ if (destSubForm == null) {
529
+ if (!guiParentTask.IsSubForm || NString.Equals(guiParentTask.getForm().getSubFormCtrl().Name, ctrlName, true))
530
+ break;
531
+ }
532
+ }
533
+ return destSubForm;
534
+ }
535
+ setSuffixDone() {
536
+ this._suffixDone = true;
537
+ }
538
+ getDestinationRow() {
539
+ return this._destTblRow;
540
+ }
541
+ setSubFormCtrl(subFormCtrl) {
542
+ Debug.Assert(this._subFormCtrl === null && subFormCtrl !== null);
543
+ this._subFormCtrl = subFormCtrl;
544
+ }
545
+ getSubFormCtrlForTask(taskId) {
546
+ let curr = null;
547
+ let parentCtrlTab;
548
+ let guiParentForm = null;
549
+ let destSubForm = null;
550
+ for (guiParentForm = this; guiParentForm != null; guiParentForm = guiParentForm.ParentForm) {
551
+ parentCtrlTab = guiParentForm.CtrlTab;
552
+ for (let i = 0; i < parentCtrlTab.getSize(); i++) {
553
+ curr = ((parentCtrlTab.getCtrl(i) instanceof MgControl) ? parentCtrlTab.getCtrl(i) : null);
554
+ if (curr != null && curr.isSubform() && (curr.getSubformTaskId() != null))
555
+ if (curr.getSubformTaskId() === taskId) {
556
+ destSubForm = curr;
557
+ break;
558
+ }
559
+ }
560
+ if (destSubForm != null)
561
+ break;
562
+ }
563
+ return destSubForm;
564
+ }
565
+ removeRecordsAfterIdx(idx) {
566
+ let removeAll = false;
567
+ if (this.isTableWithPagination())
568
+ this.setTableItemsCount(false);
569
+ else {
570
+ if (idx <= this._rowsInPage + 1 && this.GetDataview().getSize() > this._rowsInPage)
571
+ idx = 0;
572
+ if (idx === 0)
573
+ removeAll = true;
574
+ super.SetTableItemsCount(idx, removeAll);
575
+ this.setTableItemsCount(false);
576
+ }
577
+ }
578
+ isRowValidated(idx) {
579
+ if (this.Rows.length <= idx || idx < 0)
580
+ return false;
581
+ let row = this.Rows.get_Item(idx);
582
+ if (row == null)
583
+ return false;
584
+ return row.Created && row.Validated;
585
+ }
586
+ async transferDataToGui() {
587
+ let saveRowIdx = this.GetDataview().getCurrRecIdx();
588
+ let maxTime = Misc.getSystemMilliseconds() + MgForm.TIME_LIMIT;
589
+ let updated = false;
590
+ let currentEditingControl = super.getTask().CurrentEditingControl;
591
+ try {
592
+ let bkpRecord = this.GetDataview().backupCurrent();
593
+ while (Misc.getSystemMilliseconds() < maxTime && this.RefreshRepeatableAllowed) {
594
+ if (this._lastRowSent + 1 >= this.GetDataview().getSize()) {
595
+ this.RefreshUI();
596
+ break;
597
+ }
598
+ else if (this.isTableWithPagination() && this._lastRowSent + 1 >= this.getMaxRowsInPaginatedTable()) {
599
+ this.RefreshUI();
600
+ break;
601
+ }
602
+ this._lastRowSent++;
603
+ this._transferringDataToGUI = true;
604
+ this.AllowedSubformRecompute = false;
605
+ if (!this.isRowValidated(this._lastRowSent)) {
606
+ super.checkAndCreateRow(this._lastRowSent);
607
+ if (this._lastRowSent !== saveRowIdx) {
608
+ super.getTask().CurrentEditingControl = null;
609
+ await this.setCurrRowByDisplayLine(this._lastRowSent, false, true);
610
+ await super.refreshControls(true);
611
+ updated = true;
612
+ }
613
+ }
614
+ this.AllowedSubformRecompute = true;
615
+ this._transferringDataToGUI = false;
616
+ }
617
+ if (updated) {
618
+ await this.restoreBackup(saveRowIdx, bkpRecord);
619
+ await super.refreshControls(true);
620
+ super.getTask().CurrentEditingControl = currentEditingControl;
621
+ }
622
+ }
623
+ catch (ex) {
624
+ if (ex instanceof RecordOutOfDataViewException) {
625
+ Logger.Instance.WriteDevToLog(ex.Message);
626
+ }
627
+ else
628
+ throw ex;
629
+ }
630
+ this._transferingData = false;
631
+ this.checkAndCreateRowsEvent();
632
+ }
633
+ checkAndCreateRowsEvent() {
634
+ if (this._tableMgControl !== null && this.Opened && this.RefreshRepeatableAllowed) {
635
+ let size = this.GetDataview().getSize();
636
+ if (this._lastRowSent >= this.Rows.length) {
637
+ this._lastRowSent = this.Rows.length - 1;
638
+ }
639
+ let transferDataToGui = this._lastRowSent < (size - 1);
640
+ if (this.isTableWithPagination() && (this._lastRowSent + 1) >= this.getMaxRowsInPaginatedTable())
641
+ transferDataToGui = false;
642
+ if (transferDataToGui && !this._transferingData) {
643
+ AccessHelper.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl, InternalInterface.MG_ACT_DV_TO_GUI, Priority.LOWEST);
644
+ this._transferingData = true;
645
+ }
646
+ else if (this.shouldFetchRecordsAheadFromServer && !transferDataToGui && (!this.GetDataview().IncludesLast() || !this.GetDataview().IncludesFirst())) {
647
+ AccessHelper.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl, InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER, Priority.LOWEST);
648
+ }
649
+ }
650
+ }
651
+ async setRowData(desiredTopIndex, sendAll) {
652
+ let saveRowIdx = this.GetDataview().getCurrRecIdx();
653
+ let diff = 0;
654
+ let getPrevChunk = false;
655
+ let getNextChunk = false;
656
+ let updated = false;
657
+ if (desiredTopIndex !== Int32.MinValue) {
658
+ if (desiredTopIndex < 0) {
659
+ getPrevChunk = true;
660
+ this.GetDataview().setTopRecIdx(0);
661
+ }
662
+ else if (desiredTopIndex + this._rowsInPage + 1 >= this.GetDataview().getSize())
663
+ getNextChunk = true;
664
+ }
665
+ else
666
+ desiredTopIndex = this.GetDataview().getTopRecIdx();
667
+ let bkpRecord = this.GetDataview().backupCurrent();
668
+ this._transferringDataToGUI = true;
669
+ this.AllowedSubformRecompute = false;
670
+ let diffRef = new RefParam(diff);
671
+ updated = await this.refreshRows(desiredTopIndex, sendAll, saveRowIdx, diffRef);
672
+ diff = diffRef.value;
673
+ if ((getPrevChunk && diff !== 0) || getNextChunk) {
674
+ this.GetDataview().setTopRecIdx(desiredTopIndex + diff);
675
+ this.SetTableTopIndex();
676
+ if (this._topIndexUpdated) {
677
+ this._topIndexUpdated = false;
678
+ }
679
+ }
680
+ this.AllowedSubformRecompute = true;
681
+ this._transferringDataToGUI = false;
682
+ if (updated) {
683
+ await this.restoreBackup(saveRowIdx + diff, bkpRecord);
684
+ await super.refreshControls(true);
685
+ }
686
+ super.SelectRow();
687
+ if (getPrevChunk) {
688
+ let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
689
+ if (lastFocusedControl !== null && lastFocusedControl.getParentTable() === this._tableMgControl) {
690
+ }
691
+ }
692
+ }
693
+ async refreshRows(desiredTopIndex, sendAll, saveRowIdx, diffRef) {
694
+ let index = 0;
695
+ let updated = false;
696
+ diffRef.value = 0;
697
+ let orgIncludesFirst = this.GetDataview().IncludesFirst();
698
+ let orgIncludesLast = this.GetDataview().IncludesLast();
699
+ for (let i = 0; i < this._rowsInPage; i++) {
700
+ let idx = desiredTopIndex + i;
701
+ let prevTopIdx = this.GetDataview().getTopRecIdx();
702
+ try {
703
+ index = idx + diffRef.value;
704
+ if (!this.isRowValidated(idx) || sendAll || this.RefreshAllRows) {
705
+ if (index >= 0)
706
+ super.checkAndCreateRow(index);
707
+ if (saveRowIdx + diffRef.value !== index) {
708
+ await this.setCurrRowByDisplayLine(index, false, true);
709
+ await super.refreshControls(true);
710
+ }
711
+ updated = true;
712
+ }
713
+ }
714
+ catch (ex) {
715
+ if (ex instanceof RecordOutOfDataViewException) {
716
+ if (super.isRowCreated(index))
717
+ super.markRowNOTCreated(index);
718
+ break;
719
+ }
720
+ else
721
+ throw ex;
722
+ }
723
+ finally {
724
+ diffRef.value = diffRef.value + (this.GetDataview().getTopRecIdx() - prevTopIdx);
725
+ prevTopIdx = this.GetDataview().getTopRecIdx();
726
+ if (!updated && this.GetDataview().DataviewBoundriesAreChanged(orgIncludesFirst, orgIncludesLast))
727
+ updated = true;
728
+ }
729
+ }
730
+ this.RefreshUI();
731
+ this.RefreshAllRows = false;
732
+ return updated;
733
+ }
734
+ getVisibleLine() {
735
+ let currRecIdx = 0;
736
+ if (this.GetDataview().getCurrRecIdx() !== Int32.MinValue)
737
+ currRecIdx = this.GetDataview().getCurrRecIdx();
738
+ return currRecIdx - Math.max(this.GetDataview().getTopRecIdx(), 0);
739
+ }
740
+ async bringRecordToPage() {
741
+ if (this._tableMgControl !== null && !this._task.DataView.isEmptyDataview()) {
742
+ let topIndex = Commands.getTopIndex(this._tableMgControl);
743
+ let currIdx = this.GetDataview().getCurrRecIdx();
744
+ let newTopIndex = topIndex;
745
+ if (!this.isTableWithPagination()) {
746
+ if (topIndex > currIdx) {
747
+ this._topIndexUpdated = true;
748
+ newTopIndex = currIdx;
749
+ }
750
+ else if (topIndex + this._rowsInPage - 1 < currIdx) {
751
+ this._topIndexUpdated = true;
752
+ if (this._rowsInPage > 0)
753
+ newTopIndex = currIdx - this._rowsInPage + 1;
754
+ else
755
+ newTopIndex = currIdx;
756
+ }
757
+ }
758
+ else {
759
+ let currGuiIdx = this.getGuiRowidx(currIdx);
760
+ let newTopGuiIndex = (currGuiIdx) - ((currGuiIdx) % this._rowsInPage);
761
+ newTopIndex = this.getDvRowIdx(newTopGuiIndex);
762
+ if (newTopIndex !== this._prevGuiTopIndex || this.IsMovingInView)
763
+ this._topIndexUpdated = true;
764
+ }
765
+ if (this.GetDataview().getTopRecIdx() !== newTopIndex || this._topIndexUpdated) {
766
+ this.GetDataview().setTopRecIdx(newTopIndex);
767
+ this.SetTableTopIndex();
768
+ await this.setRowData(Int32.MinValue, false);
769
+ this._topIndexUpdated = false;
770
+ }
771
+ }
772
+ }
773
+ invalidateTable() {
774
+ for (let i = 0; i < this.Rows.length; i++) {
775
+ let row = this.Rows.get_Item(i);
776
+ if (row !== null)
777
+ row.Validated = false;
778
+ }
779
+ this._lastRowSent = -1;
780
+ this.checkAndCreateRowsEvent();
781
+ }
782
+ getPrevLine(line) {
783
+ return line - 1;
784
+ }
785
+ clearTableColumnSortMark(clearSortMark) {
786
+ if (clearSortMark) {
787
+ }
788
+ }
789
+ async stopRowEditing(idx) {
790
+ if (this.getIsRowEditingFromGui(idx)) {
791
+ Commands.addValueWithLine(CommandType.SET_NOT_IS_ROW_EDITING, this, this.isLineMode() ? idx : 0, this.isLineMode());
792
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
793
+ Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
794
+ }
795
+ }
796
+ async startRowEditing(idx) {
797
+ if (!this.getIsRowEditingFromGui(idx)) {
798
+ Commands.addValueWithLine(CommandType.SET_IS_ROW_EDITING, this, this.isLineMode() ? idx : 0, this.isLineMode());
799
+ await this.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
800
+ Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
801
+ }
802
+ }
803
+ getIsRowEditingFromGui(displayIndex) {
804
+ let isRowEditing = Commands.getIsRowEditing(this, this.isLineMode() ? displayIndex : 0, this.isLineMode());
805
+ return isRowEditing;
806
+ }
807
+ async RefreshDisplay(refreshType) {
808
+ let task = this._task;
809
+ if (this.isFetchingRecordsAhead)
810
+ return false;
811
+ if (task.isAborting())
812
+ return false;
813
+ let currRec = this.GetDataview().getCurrRec();
814
+ if (currRec !== null && currRec.InCompute && !currRec.isNewRec())
815
+ return false;
816
+ if (this._inRefreshDisp)
817
+ return false;
818
+ this._inRefreshDisp = true;
819
+ try {
820
+ if (refreshType === Constants.TASK_REFRESH_FORM || refreshType === Constants.TASK_REFRESH_TABLE) {
821
+ if (super.HasTable() && this.Opened)
822
+ await this.refreshTable();
823
+ }
824
+ if (refreshType === Constants.TASK_REFRESH_FORM || refreshType === Constants.TASK_REFRESH_CURR_REC) {
825
+ if (refreshType === Constants.TASK_REFRESH_CURR_REC && super.hasTable()) {
826
+ this.SetTableTopIndex();
827
+ super.SelectRow();
828
+ await this.fetchPrevChunkForCurrentPage();
829
+ }
830
+ await super.refreshProps();
831
+ await super.refreshControls(false);
832
+ }
833
+ }
834
+ catch (ex) {
835
+ if (ex instanceof Exception) {
836
+ Logger.Instance.WriteExceptionToLogWithMsg(NString.Format("{0} : {1} in task {2}", ex.GetType(), ex.Message, super.getTask().PreviouslyActiveTaskId));
837
+ }
838
+ else
839
+ throw ex;
840
+ }
841
+ finally {
842
+ this._inRefreshDisp = false;
843
+ }
844
+ if (refreshType === Constants.TASK_REFRESH_CURR_REC && (!super.isLineMode() || this._tableRefreshed)) {
845
+ this.FormRefreshed = true;
846
+ if (this._task.isFirstRecordCycle() || AccessHelper.eventsManager.getIsInViewRefresh()) {
847
+ Commands.addNoParameters(CommandType.SET_WC_IDLE, this);
848
+ AccessHelper.eventsManager.setIsInViewRefresh(false);
849
+ }
850
+ }
851
+ return true;
852
+ }
853
+ RefreshUI() {
854
+ if (!this.getTask().isMainProg()) {
855
+ Commands.addNoParameters(CommandType.REFRESH_TASK, this.getForm());
856
+ }
857
+ }
858
+ async refreshTable() {
859
+ if (this.isFetchingRecordsAhead)
860
+ return;
861
+ Logger.Instance.WriteGuiToLog("Start form.refreshTable()");
862
+ this.updateDisplayLineByDV();
863
+ let oldCurrRow = this.DisplayLine;
864
+ let currRecIdx = this.GetDataview().getCurrRecIdx();
865
+ if (!this._tableRefreshed && currRecIdx >= 0) {
866
+ oldCurrRow = this.GetDataview().getCurrRecIdx();
867
+ if (oldCurrRow + 1 > this._rowsInPage)
868
+ this.GetDataview().setTopRecIdx(oldCurrRow - Math.floor(this._rowsInPage / 2) + 1);
869
+ else
870
+ this.GetDataview().setTopRecIdx(0);
871
+ }
872
+ else {
873
+ if (oldCurrRow === Int32.MinValue)
874
+ oldCurrRow = 0;
875
+ if (this.GetDataview().getTopRecIdx() === Int32.MinValue)
876
+ this.GetDataview().setTopRecIdx(currRecIdx);
877
+ }
878
+ if (this.GetDataview().getTopRecIdx() < 0)
879
+ return;
880
+ oldCurrRow = oldCurrRow - this.GetDataview().getTopRecIdx();
881
+ let bkpRecord = this.GetDataview().backupCurrent();
882
+ this._tableRefreshed = true;
883
+ let oriTransferDataToGui = this._transferringDataToGUI;
884
+ if (!oriTransferDataToGui)
885
+ this._transferringDataToGUI = true;
886
+ this.AllowedSubformRecompute = false;
887
+ for (let i = 0; i < this._rowsInPage; i++) {
888
+ let topIndex = this.GetDataview().getTopRecIdx();
889
+ if (topIndex < 0) {
890
+ this.GetDataview().setTopRecIdx(0);
891
+ topIndex = 0;
892
+ }
893
+ let idx = topIndex + i;
894
+ try {
895
+ super.checkAndCreateRow(idx);
896
+ if (i !== oldCurrRow) {
897
+ await this.setCurrRowByDisplayLine(idx, false, true);
898
+ await super.refreshControls(true);
899
+ }
900
+ }
901
+ catch (ex) {
902
+ if (ex.name == "RecordOutOfDataViewException") {
903
+ if (super.isRowCreated(idx))
904
+ super.markRowNOTCreated(idx);
905
+ break;
906
+ }
907
+ else
908
+ throw ex;
909
+ }
910
+ }
911
+ this.AllowedSubformRecompute = true;
912
+ if (!oriTransferDataToGui)
913
+ this._transferringDataToGUI = false;
914
+ await this.restoreBackup(oldCurrRow + this.GetDataview().getTopRecIdx(), bkpRecord);
915
+ await super.refreshControls(true);
916
+ this.RefreshUI();
917
+ Logger.Instance.WriteGuiToLog("End form.refreshTable()");
918
+ }
919
+ updateDisplayLineByDV() {
920
+ this.DisplayLine = this.recordIdx2DisplayLine(this.GetDataview().getCurrRecIdx());
921
+ }
922
+ async setCurrRowByDisplayLine(displayLine, doSuffix, ignoreCurrRec) {
923
+ let recIdx = this.displayLine2RecordIdx(displayLine);
924
+ await this.setCurrRowByRecIdx(recIdx, doSuffix, ignoreCurrRec, displayLine);
925
+ if (super.HasTable())
926
+ this.updateDisplayLineByDV();
927
+ else
928
+ this.DisplayLine = displayLine;
929
+ }
930
+ async setCurrRowByRecIdx(rowNum, doSuffix, ignoreCurrRec, displayLine) {
931
+ if (this.GetDataview() === null || (!super.hasTable() && rowNum !== 0))
932
+ throw new ApplicationException("in Form.setCurrRow() no table ");
933
+ try {
934
+ this._destTblRow = rowNum;
935
+ await this.GetDataview().setCurrRecByIdx(rowNum, doSuffix, ignoreCurrRec, true, displayLine);
936
+ }
937
+ finally {
938
+ this._destTblRow = rowNum - this.GetDataview().getTopRecIdx();
939
+ }
940
+ }
941
+ getLastValidRow() {
942
+ return Math.min(this._rowsInPage - 1, this.GetDataview().getSize() - 1 - this.GetDataview().getTopRecIdx());
943
+ }
944
+ recordIdx2DisplayLine(recIdx) {
945
+ return recIdx;
946
+ }
947
+ displayLine2RecordIdx(displayLine) {
948
+ return displayLine;
949
+ }
950
+ async restoreOldDisplayLine(displayLine) {
951
+ try {
952
+ this._inRestore = true;
953
+ await this.setCurrRowByDisplayLine(displayLine, false, true);
954
+ }
955
+ catch (ex) {
956
+ if (ex instanceof RecordOutOfDataViewException) {
957
+ }
958
+ else
959
+ throw ex;
960
+ }
961
+ finally {
962
+ this._inRestore = false;
963
+ }
964
+ }
965
+ getTopIndexFromGUI() {
966
+ let topDisplayLine = super.getTopIndexFromGUI();
967
+ if (super.hasTable())
968
+ this.GetDataview().setTopRecIdx(this.displayLine2RecordIdx(topDisplayLine));
969
+ return topDisplayLine;
970
+ }
971
+ getCurrRecPosInForm() {
972
+ let topDisplayLine = super.getTopIndexFromGUI();
973
+ return this.DisplayLine - topDisplayLine + 1;
974
+ }
975
+ async restoreBackup(oldDisplayLine, bkpRecord) {
976
+ if (bkpRecord.getId() >= 0 && this.GetDataview().getRecIdx(bkpRecord.getId()) >= 0 && oldDisplayLine >= 0 && oldDisplayLine < this.GetDataview().getSize() && this.GetDataview().getCurrRecIdx() >= 0 && bkpRecord.getMode() === DataModificationTypes.None) {
977
+ this.GetDataview().restoreCurrent(bkpRecord);
978
+ this.updateDisplayLineByDV();
979
+ }
980
+ else
981
+ await this.restoreOldDisplayLine(oldDisplayLine);
982
+ }
983
+ ConstructMgControl(type, taskOrParentMgForm, parentControlOrParentControlIdx) {
984
+ if (arguments.length === 0) {
985
+ return this.ConstructMgControl_0();
986
+ }
987
+ if (arguments.length === 3 && (type === null || type.constructor === Number) && (taskOrParentMgForm === null || taskOrParentMgForm instanceof TaskBase) && (parentControlOrParentControlIdx === null || parentControlOrParentControlIdx.constructor === Number)) {
988
+ return this.ConstructMgControl_1(type, taskOrParentMgForm, parentControlOrParentControlIdx);
989
+ }
990
+ return this.ConstructMgControl_2(type, taskOrParentMgForm, parentControlOrParentControlIdx);
991
+ }
992
+ ConstructMgControl_0() {
993
+ return new MgControl();
994
+ }
995
+ ConstructMgControl_1(type, task, parentControl) {
996
+ return new MgControl(type, task, parentControl);
997
+ }
998
+ ConstructMgControl_2(type, parentMgForm, parentControlIdx) {
999
+ return new MgControl(type, parentMgForm, parentControlIdx);
1000
+ }
1001
+ alreadyMovedToFirstControl() {
1002
+ return this._task.getMGData().AlreadyMovedToFirstControl();
1003
+ }
1004
+ async firstTableRefresh() {
1005
+ if (this._tableMgControl !== null) {
1006
+ super.firstTableRefresh();
1007
+ this.setTableItemsCount(false);
1008
+ await this.refreshTable();
1009
+ super.SelectRow();
1010
+ }
1011
+ }
1012
+ InsertTableItems(idx, count) {
1013
+ if (this._tableMgControl != null) {
1014
+ this.Rows.InsertRange(new Array(count));
1015
+ this.InsertTableChildrenArrays(idx, count);
1016
+ this._lastRowSent = -1;
1017
+ }
1018
+ this.setTableItemsCount(false);
1019
+ }
1020
+ setTableItemsCount(removeAll) {
1021
+ let tableItemsCount;
1022
+ if (this.isTableWithAbsoluteScrollbar()) {
1023
+ if (this._task.getOriginalTaskMode() === Constants.TASK_MODE_CREATE
1024
+ && this._task.getMode() == Constants.TASK_MODE_CREATE) {
1025
+ tableItemsCount = this.GetDataview().getSize();
1026
+ if (this.GetDataview().RecordsBeforeCurrentView > 0) {
1027
+ this.GetDataview().RecordsBeforeCurrentView = 0;
1028
+ this.SetRecordsBeforeCurrentView(0);
1029
+ this.RefreshUI();
1030
+ }
1031
+ }
1032
+ else {
1033
+ tableItemsCount = (this.GetDataview().TotalRecordsCount > 0) ? this.GetDataview().TotalRecordsCount : 1;
1034
+ this.SetRecordsBeforeCurrentView(this.GetDataview().RecordsBeforeCurrentView);
1035
+ }
1036
+ }
1037
+ else {
1038
+ tableItemsCount = this.GetDataview().getSize();
1039
+ }
1040
+ super.SetTableItemsCount(this.GetDataview().getSize(), tableItemsCount, removeAll);
1041
+ }
1042
+ InitTableControl(dvSize, tableItemsCount, removeAll) {
1043
+ if (arguments.length === 0) {
1044
+ this.InitTableControl_00();
1045
+ return;
1046
+ }
1047
+ this.InitTableControl_01(dvSize, tableItemsCount, removeAll);
1048
+ }
1049
+ InitTableControl_00() {
1050
+ let dvSize = 1;
1051
+ let tableItemsCount = 1;
1052
+ if (this.isTableWithAbsoluteScrollbar() && this.GetDataview().TotalRecordsCount > 0) {
1053
+ let recordsBeforeCurrentView = this.GetDataview().RecordsBeforeCurrentView;
1054
+ tableItemsCount = this.GetDataview().TotalRecordsCount;
1055
+ Commands.addWithNumber(CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW, this._tableMgControl, recordsBeforeCurrentView);
1056
+ }
1057
+ this.InitTableControl(dvSize, tableItemsCount, false);
1058
+ this.SetTableTopIndex();
1059
+ }
1060
+ InitTableControl_01(dvSize, tableItemsCount, removeAll) {
1061
+ if (this._tableMgControl !== null) {
1062
+ if (removeAll) {
1063
+ Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_FIRST, this._tableMgControl, 0, true);
1064
+ Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_LAST, this._tableMgControl, 0, true);
1065
+ }
1066
+ else {
1067
+ Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_FIRST, this._tableMgControl, 0, this.GetDataview().IncludesFirst() || this.GetDataview().IsOneWayKey);
1068
+ Commands.addBoolWithLine(CommandType.SET_TABLE_INCLUDES_LAST, this._tableMgControl, 0, this.GetDataview().IncludesLast());
1069
+ Commands.addBoolWithLine(CommandType.SET_EMPTY_DATAVIEW, this._tableMgControl, 0, this.GetDataview().isEmptyDataview());
1070
+ }
1071
+ super.InitTableControl(dvSize, tableItemsCount, removeAll);
1072
+ this.checkAndCreateRowsEvent();
1073
+ }
1074
+ }
1075
+ SetTableTopIndex() {
1076
+ if (this._tableMgControl !== null) {
1077
+ let index = this.GetDataview().getTopRecIdx();
1078
+ if (index === Int32.MinValue)
1079
+ index = 0;
1080
+ if (!this.isTableWithPagination()) {
1081
+ if (this.GetDataview().IncludesLast()) {
1082
+ if (index + this._rowsInPage > this.GetDataview().getSize()) {
1083
+ if (this.GetDataview().IncludesFirst() || this.GetDataview().getSize() > this._rowsInPage + 1) {
1084
+ index = Math.max(this.GetDataview().getSize() - this._rowsInPage, 0);
1085
+ this.GetDataview().setTopRecIdx(index);
1086
+ this._topIndexUpdated = true;
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ if (index !== this._prevGuiTopIndex || this.IsMovingInView) {
1092
+ Commands.addWithNumber(CommandType.SET_TABLE_TOP_INDEX, this._tableMgControl, index);
1093
+ this._prevGuiTopIndex = this.getGuiRowidx(index);
1094
+ }
1095
+ }
1096
+ }
1097
+ async createForm() {
1098
+ await super.createForm();
1099
+ MgForm.CreatedForms.add(this);
1100
+ }
1101
+ UpdateStatusBar() {
1102
+ }
1103
+ initInnerObjects(foundTagName) {
1104
+ if (foundTagName === null)
1105
+ return false;
1106
+ let parser = Manager.GetCurrentRuntimeContext().Parser;
1107
+ if (foundTagName === XMLConstants.MG_TAG_RECOMPUTE) {
1108
+ Logger.Instance.WriteDevToLog("goes to recompute form");
1109
+ this._task.RecomputeFillData(parser);
1110
+ return true;
1111
+ }
1112
+ return super.initInnerObjects(foundTagName);
1113
+ }
1114
+ toString() {
1115
+ return "{" + this.constructor.name + ": task=" + this._task + ", Id=" + this._userStateId + "}";
1116
+ }
1117
+ GetHiddenControlListXML() {
1118
+ let xml = new StringBuilder();
1119
+ if (this.hiddenControlsIsnsList !== null && this.hiddenControlsIsnsList.length > 0) {
1120
+ xml.Append("<" + ConstInterface.MG_TAG_HIDDEN_CONTOLS + " " + ConstInterface.MG_ATTR_ISNS + "=\"");
1121
+ this.hiddenControlsIsnsList.forEach((change) => {
1122
+ xml.Append(change + ",");
1123
+ });
1124
+ xml.Remove(xml.Length - 1, 1);
1125
+ xml.Append("\"/>");
1126
+ this.hiddenControlsIsnsList = null;
1127
+ }
1128
+ return xml.ToString();
1129
+ }
1130
+ ShouldBehaveAsModal() {
1131
+ let shouldBeModal = false;
1132
+ if (!this._task.IsInteractive && !this._task.isMainProg())
1133
+ shouldBeModal = TaskBase.ShouldNonInteractiveBeModal();
1134
+ else {
1135
+ let parentTask = this._task.ParentTask;
1136
+ if (parentTask !== null && !parentTask.IsInteractive && !parentTask.isMainProg())
1137
+ shouldBeModal = parentTask.ShouldNonInteractiveChildBeModal();
1138
+ }
1139
+ return shouldBeModal;
1140
+ }
1141
+ isTableWithPagination() {
1142
+ return this.isTableWithAbsoluteScrollbar();
1143
+ }
1144
+ isTableWithAbsoluteScrollbar() {
1145
+ let tableWithAbsoluteScrollbar = false;
1146
+ if (this._tableMgControl !== null)
1147
+ tableWithAbsoluteScrollbar = this._tableMgControl.IsTableWithAbsoluteScrollbar();
1148
+ return tableWithAbsoluteScrollbar;
1149
+ }
1150
+ SetRecordsBeforeCurrentView(value) {
1151
+ if (this._tableMgControl !== null) {
1152
+ Commands.addWithNumber(CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW, this._tableMgControl, value);
1153
+ }
1154
+ }
1155
+ buildFormName() {
1156
+ let name = this.UniqueName;
1157
+ let task = this.getTask();
1158
+ name = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + '_' + name;
1159
+ while (task.IsSubtask) {
1160
+ task = task.StudioParentTask;
1161
+ name = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + '_' + name;
1162
+ }
1163
+ name = name.replace(/ /g, "_");
1164
+ name = name.replace(/-/g, "_");
1165
+ return name;
1166
+ }
1167
+ async fetchPrevChunkForCurrentPage() {
1168
+ if (this.isTableWithAbsoluteScrollbar() && this.GetDataview().TotalRecordsCount > 0) {
1169
+ let recPosOnPage = this.GetDataview().RecordsBeforeCurrentView % this._rowsInPage;
1170
+ if (recPosOnPage > 0 && this.DisplayLine === 0) {
1171
+ await this.setRowData(-recPosOnPage, false);
1172
+ }
1173
+ }
1174
+ }
1175
+ getGuiRowidx(dvRowIdx) {
1176
+ return dvRowIdx + this.GetDataview().RecordsBeforeCurrentView;
1177
+ }
1178
+ getDvRowIdx(guiRowIdx) {
1179
+ return guiRowIdx - this.GetDataview().RecordsBeforeCurrentView;
1180
+ }
1181
+ async moveToFirstParkabelControl(callByDestSubForm) {
1182
+ let task = this.getTask();
1183
+ let parkableCtrl = null;
1184
+ parkableCtrl = await this.getValidParkableControl();
1185
+ ClientManager.handlingFirstParkableControl = true;
1186
+ if (!isNullOrUndefined(parkableCtrl))
1187
+ await parkableCtrl.invoke();
1188
+ else if (!callByDestSubForm)
1189
+ await AccessHelper.eventsManager.HandleNonParkableControls(task);
1190
+ ClientManager.handlingFirstParkableControl = false;
1191
+ }
1192
+ async getValidParkableControl() {
1193
+ let ctrlName = await this.getFirstParkableControlName();
1194
+ let ctrl = await this.GetCtrl(ctrlName);
1195
+ if (!isNullOrUndefined(ctrl)) {
1196
+ switch (ctrl.Type) {
1197
+ case MgControlType.CTRL_TYPE_BUTTON:
1198
+ case MgControlType.CTRL_TYPE_CHECKBOX:
1199
+ case MgControlType.CTRL_TYPE_RADIO:
1200
+ case MgControlType.CTRL_TYPE_COMBO:
1201
+ case MgControlType.CTRL_TYPE_LIST:
1202
+ case MgControlType.CTRL_TYPE_TEXT:
1203
+ if (!ctrl.isParkable(true))
1204
+ ctrl = null;
1205
+ break;
1206
+ default:
1207
+ ctrl = null;
1208
+ break;
1209
+ }
1210
+ }
1211
+ return ctrl;
1212
+ }
1213
+ async getFirstParkableControlName() {
1214
+ let ctrlName = '';
1215
+ if (this.checkIfExistProp(PropInterface.PROP_TYPE_PARK_FIRST_ON)) {
1216
+ if (this.getProp(PropInterface.PROP_TYPE_PARK_FIRST_ON).isExpression())
1217
+ ctrlName = await this.getProp(PropInterface.PROP_TYPE_PARK_FIRST_ON).getValue();
1218
+ else
1219
+ ctrlName = this.getProp(PropInterface.PROP_TYPE_PARK_FIRST_ON).getOrgValue();
1220
+ }
1221
+ return ctrlName;
1222
+ }
1223
+ }
1224
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWdGb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9ndWkvTWdGb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxRQUFRLEVBQ1IsV0FBVyxFQUVYLHFCQUFxQixFQUNyQixjQUFjLEVBQ2QsT0FBTyxFQUVQLFVBQVUsRUFDVixhQUFhLEVBRWQsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQ0wsU0FBUyxFQUNULGlCQUFpQixFQUNqQixNQUFNLEVBQ04sYUFBYSxFQUNiLElBQUksRUFDSixRQUFRLEVBQ1IsWUFBWSxFQUViLE1BQU0sa0JBQWtCLENBQUM7QUFDMUIsT0FBTyxFQUNMLG9CQUFvQixFQUNwQixLQUFLLEVBQ0wsU0FBUyxFQUNULEtBQUssRUFDTCxpQkFBaUIsRUFFakIsT0FBTyxFQUNQLFFBQVEsRUFDUixhQUFhLEVBQ2QsTUFBTSxzQkFBc0IsQ0FBQztBQUM5QixPQUFPLEVBQUMsU0FBUyxFQUFDLE1BQU0sYUFBYSxDQUFDO0FBQ3RD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aXNpYmxlTGluZSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgc2l6ZSA9IHRoaXMuX3Jvd3NJblBhZ2U7XHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICAgIHNpemUgPSAxO1xyXG5cclxuICAgICAgICBzaXplID0gKGRpcmVjdGlvbiA9PT0gQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX1BSRVYgfHxcclxuICAgICAgICBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9CRUdJTlxyXG4gICAgICAgICAgPyAtc2l6ZVxyXG4gICAgICAgICAgOiBzaXplKTtcclxuXHJcbiAgICAgICAgaWYgKHRoaXMuaXNMaW5lTW9kZSgpKSB7XHJcbiAgICAgICAgICB2aXNpYmxlTGluZSA9IHRoaXMuZ2V0VmlzaWJsZUxpbmUoKTtcclxuICAgICAgICAgIGlmICh2aXNpYmxlTGluZSA8IDApIHtcclxuICAgICAgICAgICAgdmlzaWJsZUxpbmUgPSAwO1xyXG4gICAgICAgICAgICByZWNvcmRPdXRPZlZpZXcgPSB0cnVlO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgaWYgKHZpc2libGVMaW5lID4gdGhpcy5fcm93c0luUGFnZSArIDEpIHtcclxuICAgICAgICAgICAgdmlzaWJsZUxpbmUgPSB0aGlzLl9yb3dzSW5QYWdlO1xyXG4gICAgICAgICAgICByZWNvcmRPdXRPZlZpZXcgPSB0cnVlO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgLy8gc2Nyb2xsaW5nIHRoZSB0YWJsZSBvbmUgcGFnZSBvciBvbmUgcm93IHVwIG9yIGRvd25cclxuICAgICAgICAgIGlmICh1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1BBR0UgJiZcclxuICAgICAgICAgICAgKGRpcmVjdGlvbiA9PT0gQ29uc3RhbnRz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TW9kaWZpZWQoZmFsc2UpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9GT1JNKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgICAgICAgICBpZiAoZXggaW5zdGFuY2VvZiBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkuc2V0VG9wUmVjSWR4TW9kaWZpZWQoZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICAgICAgKDxEYXRhVmlldz50aGlzLkdldERhdGF2aWV3KCkpLnJlc3RvcmVUb3BSZWNJZHgoKTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgICB0aGlzLkdldERhdGF2aWV3KCkuc2V0VG9wUmVjSWR4KDApO1xyXG4gICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUoMCwgdHJ1ZSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIGNhdGNoIChleGNlcHRpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZXhjZXB0aW9uIGluc3RhbmNlb2YgRXhjZXB0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAvLyBRQ1IgIzk5NTQ5Njogd2hlbiB0aGUgcmVjb3JkIHN1ZmZpeCBmYWlsZWQgZ28gYmFjayB0byB0aGVcclxuICAgICAgICAgICAgICAgICAgICAgIC8vIG9yaWdpbmFsIHJvd1xyXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgKDxEYXRhVmlldz50aGlzLkdldERhdGF2aWV3KCkpLnJlc3RvcmVUb3BSZWNJZHgoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9GT1JNKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHVuaXQgIT09IENvbnN0YW50cy5NT1ZFX1VOSVRfUk9XICYmICg8RGF0YVZpZXc+dGhpcy5HZXREYXRhdmlldygpKS5yZWNFeGlzdHModGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpKSkge1xyXG4gICAgICAgICAgICAgICAgICAvLyBRQ1IgIzk5MjEwMTogaWYgd2UgcmVhY2hlZCB0aGlzIHBvaW50IGl0IG1lYW5zIHRoYXQgdGhlIHJlYyBzdWZmaXhcclxuICAgICAgICAgICAgICAgICAgLy8gd2Fzbid0IGV4ZWN1dGVkIHNvIHdlIG11c3QgaGFuZGxlIGl0IGJlZm9yZSB3ZSBnbyB0byBhIG5ldyByb3dcclxuICAgICAgICAgICAgICAgICAgbGV0IG5ld1JlY0lkOiBudW1iZXIgPSAodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWMoKSkuZ2V0SWQoKTtcclxuICAgICAgICAgICAgICAgICAgaWYgKG5ld1JlY0lkID09PSBvbGRSZWNJZCAmJiAhdGhpcy5fc3VmZml4RG9uZSlcclxuICAgICAgICAgICAgICAgICAgICAvLyBRQ1IgNzU4NjM5XHJcbiAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGhpcy5fdGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkucmVzdG9yZVRvcFJlY0lkeCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zZXRDdXJyUm93QnlEaXNwbGF5TGluZSh0aGlzLkdldERhdGF2aWV3KCkuZ2V0VG9wUmVjSWR4KCkgKyB0aGlzLmdldExhc3RWYWxpZFJvdygpLCBmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICB2aXNpYmxlTGluZSA9IHRoaXMuZ2V0TGFzdFZhbGlkUm93KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChFeGNlcHRpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAoPERhdGFWaWV3PnRoaXMuR2V0RGF0YXZpZXcoKSkucmVzdG9yZVRvcFJlY0lkeCgpO1xyXG4gICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnJlc3RvcmVPbGREaXNwbGF5TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgIGlmICh1bml0ID09PSBDb25zdGFudHMuTU9WRV9VTklUX1JPVyAmJiBkaXJlY3Rpb24gPT09IENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9ORVhUKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbm9uIGludGVyYWN0aXZlLCBlbmQgb2YgZGF0YSBtZWFucyBlbmQgb2Ygb3duZXJUYXNrLCB1bmxlc3Mgd2UgYXJlIGluIGNyZWF0ZSBtb2RlLlxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fdGFzay5Jc0ludGVyYWN0aXZlICYmIHRoaXMuX3Rhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSlcclxuICAgICAgICAgICAgICAgICAgICAgICg8VGFza0Jhc2U+dGhpcy5fdGFzaykuc2V0RXhlY0VuZFRhc2soKTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGhpcy5fdGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NSRUxJTkUpO1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgLy8gbW92aW5nIHRoZSBtYXJraW5nIG9uZSByb3cgdXAgb3IgZG93blxyXG4gICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgb2xkVGFza01vZGUgPSB0aGlzLl90YXNrLmdldE1vZGUoKTtcclxuXHJcbiAgICAgICAgICAgICAgb2xkUmVjSWQgPSAodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWMoKSkuZ2V0SWQoKTtcclxuICAgICAgICAgICAgICBhd2FpdCB0aGlzLnNldEN1cnJSb3dCeURpc3BsYXlMaW5lKG9sZERpc3BsYXlMaW5lICsgc2l6ZSwgdHJ1ZSwgZmFsc2UpO1xyXG5cclxuICAgICAgICAgICAgICAvLyBpZiB0aGUgcmVjb3JkIHdhcyBkZWxldGVkIGluIFJ1biBUaW1lIGJ5IEZvcmNlIERlbGV0ZSBmb3IgZXhhbXBsZVxyXG4gICAgICAgICAgICAgIGlmICghKDxEYXRhVmlldz50aGlzLkdldERhdGF2aWV3KCkpLnJlY0V4aXN0c0J5SWQob2xkUmVjSWQpKSB7XHJcbiAgICAgICAgICAgICAgICB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ICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9DVVJSX1JFQyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgaWYgKG9sZFRhc2tNb2RlID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSAmJiBvbGREaXNwbGF5TGluZSA+IDApXHJcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZXN0b3JlT2xkRGlzcGxheUxpbmUob2xkRGlzcGxheUxpbmUgLSAxKTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHNpemUgPD0gMCB8fCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKVxyXG4gICAgICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhleC5NZXNzYWdlKTtcclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAvLyBub24gaW50ZXJhY3RpdmUsIGVuZCBvZiBkYXRhIG1lYW5zIGVuZCBvZiBvd25lclRhc2ssIHVubGVzcyB3ZSBhcmUgaW4gY3JlYXRlIG1vZGUuXHJcbiAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5fdGFzay5Jc0ludGVyYWN0aXZlICYmIHRoaXMuX3Rhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSkge1xyXG4gICAgICAgICAgICAgICAgICAgICg8VGFza0Jhc2U+dGhpcy5fdGFzaykuc2V0RXhlY0VuZFRhc2soKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3Rhc2suQWN0aW9uTWFuYWdlci5pc0VuYWJsZWQoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NSRUxJTkUpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgQWNjZXNzSGVscGVyLmV2ZW50c01hbmFnZXIuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRoaXMuX3Rhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FKTtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgIC8vIGZpeGVkIGJ1ZyAjOjk0MTc2Mywgd2hpbGUgY3JlYXRlIGlzbid0IGFsbG93ZWQgbmVlZCB0byBkbyBzdWZmaXggYW5kIHByZWZpeCBvZiB0aGUgY3VycmVudCByZWNvcmRcclxuICAgICAgICAgICAgICAgICAgICAgIGxldCBkb1JlY29yZFN1ZmZpeDogYm9vbGVhbiA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVmZG9SZWNvcmRTdWZmaXg6IFJlZlBhcmFtPGJvb2xlYW4+ID0gbmV3IFJlZlBhcmFtKGRvUmVjb3JkU3VmZml4KTtcclxuICAgICAgICAgICAgICAgICAgICAgIGlmICghIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkRvVGFza0xldmVsUmVjb3JkU3VmZml4KDxUYXNrQmFzZT50aGlzLl90YXNrLCByZWZkb1JlY29yZFN1ZmZpeCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLkRvVGFza0xldmVsUmVjb3JkUHJlZml4KHRoaXMuX3Rhc2spO1xyXG4gICAgICAgICAgICAgICAgICAgICAgZG9SZWNvcmRTdWZmaXggPSByZWZkb1JlY29yZFN1ZmZpeC52YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gaWYgdGhlIGZvcm0gZG9lcyBub3QgaGF2ZSBhIHRhYmxlLCBtb3ZlIHRvIG9uZSByb3cgaW4gdGhlIGNob3NlbiBEaXJlY3Rpb25cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuR2V0RGF0YXZpZXcoKS5zZXRDdXJyUmVjQnlJZHgodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWNJZHgoKSArIHNpemUsIHRydWUsIGZhbHNlLCB0cnVlLCBTRVRfRElTUExBWUxJTkVfQllfRFYpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLlJlZnJlc2hEaXNwbGF5KENvbnN0YW50cy5UQVNLX1JFRlJFU0hfRk9STSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgICAgICAgaWYgKGV4IGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgIGlmIChzaXplID4gMCkge1xyXG4gICAgICAgICAgICAgICAgLy8gbm9uIGludGVyYWN0aXZlLCBlbmQgb2YgZGF0YSBtZWFucyBlbmQgb2Ygb3duZXJUYXNrLCB1bmxlc3Mgd2UgYXJlIGluIGNyZWF0ZSBtb2RlLlxyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLl90YXNrLklzSW50ZXJhY3RpdmUgJiYgdGhpcy5fdGFzay5nZXRNb2RlKCkgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKVxyXG4gICAgICAgICAgICAgICAgICAoPFRhc2tCYXNlPnRoaXMuX3Rhc2spLnNldEV4ZWNFbmRUYXNrKCk7XHJcbiAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0aGlzLl90YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1JFTElORSk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChleCBpbnN0YW5jZW9mIFNlcnZlckVycm9yKSB7XHJcbiAgICAgICAgICAgICAgYXdhaXQgKDxUYXNrQmFzZT50aGlzLl90YXNrKS5zdG9wKCk7XHJcbiAgICAgICAgICAgICAgKDxUYXNrQmFzZT50aGlzLl90YXNrKS5hYm9ydCgpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IEFjY2Vzc0hlbHBlci5ldmVudHNNYW5hZ2VyLlByb2Nlc3NBYm9ydGluZ0Vycm9yKGV4KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChleCBpbnN0YW5jZW9mIEV4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGV4Lk1lc3NhZ2UpO1xyXG4gICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxu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UxpbmUodGhpcy5HZXREYXRhdmlldygpLmdldFRvcFJlY0lkeCgpICsgcm93LCBmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgICAgaWYgKGV4IGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAvLyBubyBleGNlcHRpb24gc2hvdWxkIHJlYWxseSBiZSBjYXVnaHQgaGVyZS5cclxuICAgICAgICAgICAgaWYgKHJvdyAhPT0gMClcclxuICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhOU3RyaW5nLkZvcm1hdChcImluIEZvcm0uY2FuY2VsRWRpdCgpIHswfVwiLCBleC5NZXNzYWdlKSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIHRocm93IGV4O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoc3VwZXIuSGFzVGFibGUoKSkge1xyXG4gICAgICAgICAgLy8gRGVjcmVtZW50IHRoZSBUb3RhbFJlY29yZHNDb3VudCBhcyByZWNvcmQgYmVpbmcgZGVsZXRlZC5cclxuICAgICAgICAgIGlmICh0aGlzLmlzVGFibGVXaXRoQWJzb2x1dGVTY3JvbGxiYXIoKSAmJiByZWNSZW1vdmVkKVxyXG4gICAgICAgICAge1xyXG4gICAgICAgICAgICB0aGlzLkdldERhdGF2aWV3KCkuVG90YWxSZWNvcmRzQ291bnQtLTtcclxuICAgICAgICAgICAgdGhpcy5SZWZyZXNoQWxsUm93cyA9IHRydWU7XHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgdGhpcy5yZW1vdmVSZWNvcmRzQWZ0ZXJJZHgodGhpcy5HZXREYXRhdmlldygpLmdldEN1cnJSZWNJZHgoKSk7XHJcbiAgICAgICAgfVxyXG4gICAgICB9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