@magic-xpa/engine 4.1100.0-dev4110.19 → 4.1100.0-dev4110.191

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