@magic-xpa/engine 4.1100.0-dev4110.98 → 4.1100.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. package/README.md +7 -7
  2. package/{esm2020 → esm2022}/index.mjs +188 -188
  3. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  4. package/esm2022/src/AccessHelper.mjs +15 -0
  5. package/esm2022/src/ClientManager.mjs +421 -0
  6. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  7. package/{esm2020 → esm2022}/src/CommandsProcessorManager.mjs +25 -25
  8. package/esm2022/src/CommandsTable.mjs +162 -0
  9. package/esm2022/src/ConstInterface.mjs +517 -0
  10. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  11. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  12. package/esm2022/src/GUIManager.mjs +62 -0
  13. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  14. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  15. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  16. package/esm2022/src/ServerConfig.mjs +122 -0
  17. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  18. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  19. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  23. package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
  24. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +59 -59
  26. package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
  27. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
  28. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  29. package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
  32. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  33. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  34. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  35. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
  36. package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
  37. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
  38. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  41. package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
  42. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
  44. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  45. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
  47. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
  48. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
  49. package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  51. package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
  53. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
  54. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
  55. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  56. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  57. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  58. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  59. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
  60. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  61. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  62. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddRangeCommand.mjs +62 -62
  63. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddSortCommand.mjs +33 -33
  64. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  65. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  66. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  67. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  70. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  71. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  72. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  73. package/{esm2020 → esm2022}/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -132
  74. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  75. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  76. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  77. package/esm2022/src/data/DataView.mjs +1613 -0
  78. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  79. package/esm2022/src/data/DataviewManager.mjs +28 -0
  80. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  81. package/esm2022/src/data/DvCache.mjs +67 -0
  82. package/esm2022/src/data/Field.mjs +646 -0
  83. package/esm2022/src/data/FieldBase.mjs +15 -0
  84. package/esm2022/src/data/FieldsTable.mjs +103 -0
  85. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  86. package/{esm2020 → esm2022}/src/data/Key.mjs +88 -88
  87. package/esm2022/src/data/Record.mjs +880 -0
  88. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  89. package/esm2022/src/data/RecordsTable.mjs +267 -0
  90. package/{esm2020 → esm2022}/src/data/TaskTransactionManager.mjs +107 -103
  91. package/{esm2020 → esm2022}/src/data/XMLBasedDcValuesBuilder.mjs +74 -74
  92. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  93. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  94. package/esm2022/src/env/Environment.mjs +487 -0
  95. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  96. package/esm2022/src/env/LanguageData.mjs +227 -0
  97. package/{esm2020 → esm2022}/src/env/MirrorString.mjs +65 -65
  98. package/esm2022/src/event/ActionManager.mjs +91 -0
  99. package/esm2022/src/event/Event.mjs +1333 -0
  100. package/esm2022/src/event/EventHandler.mjs +766 -0
  101. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  102. package/esm2022/src/event/EventsManager.mjs +2988 -0
  103. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  104. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  105. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  106. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  107. package/esm2022/src/exp/ExpTable.mjs +57 -0
  108. package/esm2022/src/exp/Expression.mjs +200 -0
  109. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  110. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  111. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  112. package/{esm2020 → esm2022}/src/exp/GlobalParamsTable.mjs +85 -85
  113. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  114. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  115. package/esm2022/src/gui/FormsTable.mjs +66 -0
  116. package/esm2022/src/gui/MgControl.mjs +363 -0
  117. package/esm2022/src/gui/MgForm.mjs +1224 -0
  118. package/esm2022/src/http/HttpManager.mjs +97 -0
  119. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  120. package/{esm2020 → esm2022}/src/http/client/HttpClientBase.mjs +132 -132
  121. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  122. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  123. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  124. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  125. package/{esm2020 → esm2022}/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -18
  126. package/{esm2020 → esm2022}/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -18
  127. package/{esm2020 → esm2022}/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -18
  128. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
  129. package/{esm2020 → esm2022}/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -25
  130. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandBase.mjs +24 -24
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandFactory.mjs +60 -60
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  133. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  134. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  135. package/{esm2020 → esm2022}/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +16 -16
  136. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  137. package/{esm2020 → esm2022}/src/remote/ResetUserSortRemoteDataviewCommand.mjs +15 -15
  138. package/esm2022/src/remote/ServerError.mjs +40 -0
  139. package/{esm2020 → esm2022}/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +19 -19
  140. package/esm2022/src/rt/Argument.mjs +265 -0
  141. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  142. package/esm2022/src/rt/Boundary.mjs +152 -0
  143. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  144. package/esm2022/src/rt/DataviewHeaderBase.mjs +98 -0
  145. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  146. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  147. package/{esm2020 → esm2022}/src/rt/DataviewHeadersSaxHandler.mjs +38 -38
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStack.mjs +94 -94
  149. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  150. package/{esm2020 → esm2022}/src/rt/HandlersTable.mjs +96 -96
  151. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  153. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  154. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  155. package/esm2022/src/rt/Operation.mjs +735 -0
  156. package/esm2022/src/rt/OperationTable.mjs +67 -0
  157. package/esm2022/src/rt/Recompute.mjs +355 -0
  158. package/{esm2020 → esm2022}/src/rt/RecomputeTable.mjs +62 -62
  159. package/{esm2020 → esm2022}/src/rt/RemoteDataviewHeader.mjs +108 -108
  160. package/esm2022/src/rt/ResultValue.mjs +10 -0
  161. package/esm2022/src/rt/TableCache.mjs +177 -0
  162. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  163. package/esm2022/src/rt/Transaction.mjs +53 -0
  164. package/esm2022/src/security/UserDetails.mjs +71 -0
  165. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  166. package/esm2022/src/tasks/MGData.mjs +552 -0
  167. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  168. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  169. package/{esm2020 → esm2022}/src/tasks/RemoteTaskService.mjs +44 -44
  170. package/esm2022/src/tasks/Task.mjs +2499 -0
  171. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  172. package/{esm2020 → esm2022}/src/tasks/TaskServiceBase.mjs +24 -24
  173. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  174. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  175. package/{esm2020 → esm2022}/src/tasks/sort/SortCollection.mjs +67 -67
  176. package/{esm2020 → esm2022}/src/util/ConstUtils.mjs +13 -13
  177. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  178. package/{esm2020 → esm2022}/src/util/HeapSort.mjs +69 -69
  179. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  181. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  182. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  183. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  184. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  185. package/esm2022/src/util/PrmMap.mjs +152 -0
  186. package/esm2022/src/util/ReturnResult.mjs +46 -0
  187. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  188. package/esm2022/src/util/Scrambler.mjs +89 -0
  189. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  190. package/{esm2020 → esm2022}/src/util/cookie.service.mjs +92 -92
  191. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29888 -29690
  192. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  193. package/index.d.ts +187 -187
  194. package/package.json +8 -14
  195. package/src/AccessHelper.d.ts +20 -20
  196. package/src/ClientManager.d.ts +35 -32
  197. package/src/CommandsProcessorBase.d.ts +23 -23
  198. package/src/CommandsProcessorManager.d.ts +6 -6
  199. package/src/CommandsTable.d.ts +22 -22
  200. package/src/ConstInterface.d.ts +516 -515
  201. package/src/CurrentClientVersion.d.ts +1 -1
  202. package/src/FlowMonitorInterface.d.ts +15 -15
  203. package/src/GUIManager.d.ts +17 -17
  204. package/src/GlobalCommandsManager.d.ts +17 -17
  205. package/src/GuiEventsProcessor.d.ts +24 -24
  206. package/src/ICommandsTable.d.ts +9 -9
  207. package/src/ServerConfig.d.ts +35 -34
  208. package/src/bridge/IGuiEvent.d.ts +19 -19
  209. package/src/bridge/MagicBridge.d.ts +16 -16
  210. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  211. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  212. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  214. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  216. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  217. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
  218. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  219. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  220. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
  221. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
  222. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
  223. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  224. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  225. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  226. package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
  227. package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
  228. package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
  229. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
  230. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  231. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  232. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
  233. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
  234. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
  235. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  236. package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
  237. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
  238. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
  239. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
  240. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
  241. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  242. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
  243. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
  244. package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
  245. package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
  246. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  247. package/src/commands/DataViewCommandBase.d.ts +6 -6
  248. package/src/commands/IClientCommand.d.ts +2 -2
  249. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  250. package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
  251. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  252. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  253. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  254. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  255. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  256. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  257. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  258. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  259. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  262. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  263. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  264. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  265. package/src/communications/IConnectionStateManager.d.ts +4 -4
  266. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  267. package/src/data/DataSourceIdKey.d.ts +2 -2
  268. package/src/data/DataView.d.ts +162 -162
  269. package/src/data/DataViewBase.d.ts +12 -12
  270. package/src/data/DataviewManager.d.ts +14 -14
  271. package/src/data/DataviewManagerBase.d.ts +11 -11
  272. package/src/data/DvCache.d.ts +15 -15
  273. package/src/data/Field.d.ts +103 -103
  274. package/src/data/FieldBase.d.ts +23 -23
  275. package/src/data/FieldsTable.d.ts +27 -27
  276. package/src/data/IRecordsTable.d.ts +7 -7
  277. package/src/data/Key.d.ts +15 -15
  278. package/src/data/Record.d.ts +157 -156
  279. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  280. package/src/data/RecordsTable.d.ts +38 -38
  281. package/src/data/TaskTransactionManager.d.ts +17 -17
  282. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  283. package/src/enums.d.ts +21 -21
  284. package/src/env/EnvVariablesTable.d.ts +17 -17
  285. package/src/env/Environment.d.ts +118 -118
  286. package/src/env/ILanguageData.d.ts +3 -3
  287. package/src/env/LanguageData.d.ts +20 -20
  288. package/src/env/MirrorString.d.ts +15 -15
  289. package/src/event/ActionManager.d.ts +14 -14
  290. package/src/event/Event.d.ts +79 -79
  291. package/src/event/EventHandler.d.ts +66 -66
  292. package/src/event/EventHandlerPosition.d.ts +25 -25
  293. package/src/event/EventsManager.d.ts +205 -204
  294. package/src/event/IEventsManager.d.ts +77 -77
  295. package/src/event/RunTimeEvent.d.ts +126 -123
  296. package/src/event/RunTimeEventBase.d.ts +5 -5
  297. package/src/event/UserEventsTable.d.ts +11 -11
  298. package/src/exp/ExpTable.d.ts +11 -11
  299. package/src/exp/Expression.d.ts +37 -37
  300. package/src/exp/ExpressionDict.d.ts +12 -12
  301. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  302. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  303. package/src/exp/GlobalParamsTable.d.ts +19 -19
  304. package/src/exp/YesNoExp.d.ts +9 -9
  305. package/src/gui/CreatedFormVector.d.ts +10 -10
  306. package/src/gui/FormsTable.d.ts +15 -15
  307. package/src/gui/MgControl.d.ts +60 -60
  308. package/src/gui/MgForm.d.ts +96 -93
  309. package/src/http/HttpManager.d.ts +25 -25
  310. package/src/http/client/HttpClientAsync.d.ts +16 -16
  311. package/src/http/client/HttpClientBase.d.ts +30 -30
  312. package/src/http/client/HttpClientEvents.d.ts +18 -18
  313. package/src/http/client/HttpClientSync.d.ts +17 -17
  314. package/src/http/client/HttpUtility.d.ts +10 -10
  315. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  316. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  319. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  320. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  321. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  322. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  323. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  324. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  325. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  329. package/src/remote/ServerError.d.ts +16 -16
  330. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  331. package/src/rt/Argument.d.ts +36 -36
  332. package/src/rt/ArgumentsList.d.ts +24 -24
  333. package/src/rt/Boundary.d.ts +27 -27
  334. package/src/rt/CompMainPrgTable.d.ts +10 -10
  335. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  336. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  337. package/src/rt/DataviewHeaders.d.ts +12 -12
  338. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  339. package/src/rt/ExecutionStack.d.ts +22 -22
  340. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  341. package/src/rt/HandlersTable.d.ts +19 -19
  342. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  343. package/src/rt/IDataviewHeader.d.ts +10 -10
  344. package/src/rt/IResultValue.d.ts +4 -4
  345. package/src/rt/LastFocusedManager.d.ts +23 -23
  346. package/src/rt/Operation.d.ts +97 -97
  347. package/src/rt/OperationTable.d.ts +15 -15
  348. package/src/rt/Recompute.d.ts +41 -41
  349. package/src/rt/RecomputeTable.d.ts +9 -9
  350. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  351. package/src/rt/ResultValue.d.ts +7 -7
  352. package/src/rt/TableCache.d.ts +29 -29
  353. package/src/rt/TableCacheManager.d.ts +10 -10
  354. package/src/rt/Transaction.d.ts +23 -23
  355. package/src/security/UserDetails.d.ts +16 -16
  356. package/src/tasks/IMGDataCollection.d.ts +26 -26
  357. package/src/tasks/MGData.d.ts +63 -63
  358. package/src/tasks/MGDataCollection.d.ts +42 -42
  359. package/src/tasks/RCTimer.d.ts +13 -13
  360. package/src/tasks/RemoteTaskService.d.ts +16 -16
  361. package/src/tasks/Task.d.ts +312 -312
  362. package/src/tasks/TaskBase.d.ts +123 -123
  363. package/src/tasks/TaskServiceBase.d.ts +16 -16
  364. package/src/tasks/TasksTable.d.ts +21 -21
  365. package/src/tasks/sort/Sort.d.ts +4 -4
  366. package/src/tasks/sort/SortCollection.d.ts +11 -11
  367. package/src/util/ConstUtils.d.ts +3 -3
  368. package/src/util/FlowMonitorQueue.d.ts +70 -70
  369. package/src/util/HeapSort.d.ts +6 -6
  370. package/src/util/IMirrorXML.d.ts +6 -6
  371. package/src/util/IServerConfig.d.ts +11 -11
  372. package/src/util/MgBlockingQueue.d.ts +5 -5
  373. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  374. package/src/util/MgPriorityQueue.d.ts +13 -13
  375. package/src/util/ParamParseResult.d.ts +6 -6
  376. package/src/util/PrmMap.d.ts +28 -28
  377. package/src/util/ReturnResult.d.ts +18 -18
  378. package/src/util/ReturnResultBase.d.ts +11 -11
  379. package/src/util/Scrambler.d.ts +10 -10
  380. package/src/util/UniqueIDUtils.d.ts +4 -4
  381. package/src/util/cookie.service.d.ts +8 -8
  382. package/esm2020/src/AccessHelper.mjs +0 -9
  383. package/esm2020/src/ClientManager.mjs +0 -399
  384. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  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/ColumnSortEventCommand.mjs +0 -26
  396. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  397. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  398. package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
  399. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  400. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  401. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  402. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  403. package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
  404. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  405. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  406. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  407. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  408. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  409. package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
  410. package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
  411. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  412. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  413. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  414. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  415. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  416. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  417. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  418. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  419. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  420. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  421. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  422. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  423. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  424. package/esm2020/src/data/DataView.mjs +0 -1610
  425. package/esm2020/src/data/DataviewManager.mjs +0 -28
  426. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  427. package/esm2020/src/data/DvCache.mjs +0 -67
  428. package/esm2020/src/data/Field.mjs +0 -646
  429. package/esm2020/src/data/FieldBase.mjs +0 -18
  430. package/esm2020/src/data/FieldsTable.mjs +0 -103
  431. package/esm2020/src/data/Record.mjs +0 -846
  432. package/esm2020/src/data/RecordsTable.mjs +0 -267
  433. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  434. package/esm2020/src/env/Environment.mjs +0 -489
  435. package/esm2020/src/env/LanguageData.mjs +0 -226
  436. package/esm2020/src/event/ActionManager.mjs +0 -91
  437. package/esm2020/src/event/Event.mjs +0 -1333
  438. package/esm2020/src/event/EventHandler.mjs +0 -766
  439. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  440. package/esm2020/src/event/EventsManager.mjs +0 -2975
  441. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  442. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  443. package/esm2020/src/exp/ExpTable.mjs +0 -59
  444. package/esm2020/src/exp/Expression.mjs +0 -200
  445. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  446. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4208
  447. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  448. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  449. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  450. package/esm2020/src/gui/FormsTable.mjs +0 -66
  451. package/esm2020/src/gui/MgControl.mjs +0 -353
  452. package/esm2020/src/gui/MgForm.mjs +0 -1181
  453. package/esm2020/src/http/HttpManager.mjs +0 -97
  454. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  455. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  456. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  457. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  458. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  459. package/esm2020/src/remote/ServerError.mjs +0 -40
  460. package/esm2020/src/rt/Argument.mjs +0 -265
  461. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  462. package/esm2020/src/rt/Boundary.mjs +0 -152
  463. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  464. package/esm2020/src/rt/DataviewHeaderBase.mjs +0 -96
  465. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  466. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  467. package/esm2020/src/rt/Operation.mjs +0 -735
  468. package/esm2020/src/rt/OperationTable.mjs +0 -67
  469. package/esm2020/src/rt/Recompute.mjs +0 -355
  470. package/esm2020/src/rt/ResultValue.mjs +0 -12
  471. package/esm2020/src/rt/TableCache.mjs +0 -177
  472. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  473. package/esm2020/src/rt/Transaction.mjs +0 -53
  474. package/esm2020/src/security/UserDetails.mjs +0 -71
  475. package/esm2020/src/tasks/MGData.mjs +0 -552
  476. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  477. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  478. package/esm2020/src/tasks/Task.mjs +0 -2496
  479. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  480. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  481. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  482. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  483. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  484. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  485. package/esm2020/src/util/PrmMap.mjs +0 -151
  486. package/esm2020/src/util/ReturnResult.mjs +0 -46
  487. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  488. package/esm2020/src/util/Scrambler.mjs +0 -89
  489. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  490. package/fesm2015/magic-xpa-engine.mjs +0 -30837
  491. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  492. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -1,16 +1,16 @@
1
- import { ApplicationException } from "@magic-xpa/mscorelib";
2
- export var RecordOutOfDataViewException_ExceptionType;
3
- (function (RecordOutOfDataViewException_ExceptionType) {
4
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["TOP"] = 0] = "TOP";
5
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["BOTTOM"] = 1] = "BOTTOM";
6
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["REC_SUFFIX_FAILED"] = 2] = "REC_SUFFIX_FAILED";
7
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["NONE"] = 3] = "NONE";
8
- })(RecordOutOfDataViewException_ExceptionType || (RecordOutOfDataViewException_ExceptionType = {}));
9
- export class RecordOutOfDataViewException extends ApplicationException {
10
- constructor(type) {
11
- super((type === RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED) ? "Record Suffix Failed" :
12
- ("Record out of the " + ((type === RecordOutOfDataViewException_ExceptionType.TOP) ? "top" : "bottom") + " bound of the Data View"));
13
- this.name = "RecordOutOfDataViewException";
14
- }
15
- }
1
+ import { ApplicationException } from "@magic-xpa/mscorelib";
2
+ export var RecordOutOfDataViewException_ExceptionType;
3
+ (function (RecordOutOfDataViewException_ExceptionType) {
4
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["TOP"] = 0] = "TOP";
5
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["BOTTOM"] = 1] = "BOTTOM";
6
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["REC_SUFFIX_FAILED"] = 2] = "REC_SUFFIX_FAILED";
7
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["NONE"] = 3] = "NONE";
8
+ })(RecordOutOfDataViewException_ExceptionType || (RecordOutOfDataViewException_ExceptionType = {}));
9
+ export class RecordOutOfDataViewException extends ApplicationException {
10
+ constructor(type) {
11
+ super((type === RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED) ? "Record Suffix Failed" :
12
+ ("Record out of the " + ((type === RecordOutOfDataViewException_ExceptionType.TOP) ? "top" : "bottom") + " bound of the Data View"));
13
+ this.name = "RecordOutOfDataViewException";
14
+ }
15
+ }
16
16
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZGF0YS9SZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uLnRzIl0sIm5hbWVzIjpbXSw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ZXh0ZW5kcyBBcHBsaWNhdGlvbkV4Y2VwdGlvbiB7XHJcblxyXG4gIC8vLyA8c3VtbWFyeT4gQ1RPUjwvc3VtbWFyeT5cclxuICAvLy8gPHBhcmFtIG5hbWU9XCJ0eXBlXCI+dGhlIHR5cGUgPC9wYXJhbT5cclxuICBjb25zdHJ1Y3Rvcih0eXBlOiBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uX0V4Y2VwdGlvblR5cGUpIHtcclxuICAgIHN1cGVyKCh0eXBlID09PSBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uX0V4Y2VwdGlvblR5cGUuUkVDX1NVRkZJWF9GQUlMRUQpID8gXCJSZWNvcmQgU3VmZml4IEZhaWxlZFwiIDpcclxuICAgICAgKFwiUmVjb3JkIG91dCBvZiB0aGUgXCIgKyAoKHR5cGUgPT09IFJlY29yZE91dE9mRGF0YVZpZXdFeGNlcHRpb25fRXhjZXB0aW9uVHlwZS5UT1ApID8gXCJ0b3BcIiA6IFwiYm90dG9tXCIpICsgXCIgYm91bmQgb2YgdGhlIERhdGEgVmlld1wiKSk7XHJcbiAgICB0aGlzLm5hbWUgPSBcIlJlY29yZE91dE9mRGF0YVZpZXdFeGNlcHRpb25cIjtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,267 @@
1
+ import { Record } from "./Record";
2
+ import { DataModificationTypes } from "@magic-xpa/gui";
3
+ import { ApplicationException, Hashtable, Int32, List } from "@magic-xpa/mscorelib";
4
+ import { Logger } from "@magic-xpa/utils";
5
+ export class RecordsTable {
6
+ static REC_NOT_FOUND = -1;
7
+ _useLinkedList = false;
8
+ _hashTab = null;
9
+ _initialCurrRecId = Int32.MinValue;
10
+ _records = null;
11
+ _serverCurrRec = null;
12
+ InsertedRecordsCount = 0;
13
+ constructor(withLinkedListOrRecordTable) {
14
+ if (withLinkedListOrRecordTable.constructor === Boolean) {
15
+ this._records = new List();
16
+ this._hashTab = new Hashtable(100, 0.7);
17
+ this._useLinkedList = withLinkedListOrRecordTable;
18
+ this.InsertedRecordsCount = Int32.MinValue;
19
+ }
20
+ else
21
+ Object.assign(this, withLinkedListOrRecordTable);
22
+ }
23
+ fillData(dataview, insertAt, parser) {
24
+ let c = 'N';
25
+ let record = null;
26
+ let flag = false;
27
+ this.InsertedRecordsCount = 0;
28
+ this._initialCurrRecId = Int32.MinValue;
29
+ let nextTag = parser.getNextTag();
30
+ while (nextTag !== null && nextTag === "rec") {
31
+ let record2 = new Record(dataview);
32
+ record2.Initialize();
33
+ let isCurrRec = record2.fillData(parser);
34
+ if (isCurrRec && !dataview.HasMainTable) {
35
+ let dcRefs2;
36
+ let dcRefs = dcRefs2 = record2.getDcRefs();
37
+ try {
38
+ for (let i = 0; i < this.getSize(); i = i + 1) {
39
+ this.getRecByIdx(i).setDcRefs(dcRefs);
40
+ }
41
+ }
42
+ finally {
43
+ if (dcRefs2 !== null) {
44
+ (dcRefs2).Dispose();
45
+ }
46
+ }
47
+ }
48
+ if (isCurrRec) {
49
+ if (dataview.getTask().getMode() !== 'C') {
50
+ record2.setOldRec();
51
+ }
52
+ this._initialCurrRecId = record2.getId();
53
+ this._serverCurrRec = record2.replicate();
54
+ if (c === 'N') {
55
+ c = 'C';
56
+ }
57
+ else {
58
+ c = 'F';
59
+ }
60
+ }
61
+ else {
62
+ record2.setOldRec();
63
+ c = 'T';
64
+ }
65
+ let foundRec = this.getRecord(record2.getId());
66
+ if (foundRec !== null) {
67
+ let updated = foundRec.Updated;
68
+ let modified = foundRec.Modified;
69
+ let computed = foundRec.isComputed();
70
+ let prevRec = foundRec.getPrevRec();
71
+ let nextRec = foundRec.getNextRec();
72
+ foundRec.setSameAs(record2, false);
73
+ foundRec.setPrevRec(prevRec);
74
+ foundRec.setNextRec(nextRec);
75
+ foundRec.setComputed(computed);
76
+ if (modified)
77
+ foundRec.setModified();
78
+ if (updated)
79
+ foundRec.setUpdated();
80
+ }
81
+ else {
82
+ this.InsertRecord(insertAt, record2);
83
+ if (dataview.getTask().isTableWithAbsolutesScrollbar()) {
84
+ if (dataview.TotalRecordsCount === 0 && dataview.RecordsBeforeCurrentView == 0)
85
+ dataview.TotalRecordsCount = dataview.TotalRecordsCount + 1;
86
+ if (dataview.RecordsBeforeCurrentView > 0 && insertAt === 'B')
87
+ dataview.RecordsBeforeCurrentView = dataview.RecordsBeforeCurrentView - 1;
88
+ }
89
+ if (isCurrRec && dataview.getTask().getMode() === 'C')
90
+ record2.setMode(DataModificationTypes.Insert);
91
+ record2.setComputed(true);
92
+ }
93
+ nextTag = parser.getNextTag();
94
+ if (!isCurrRec)
95
+ record = record2;
96
+ flag = true;
97
+ }
98
+ let num = 0;
99
+ while (!dataview.HasMainTable && record !== null && num < dataview.getChunkSize() - 1) {
100
+ let record4 = new Record(dataview);
101
+ record4.Initialize();
102
+ record4.setSameAs(record, false, record.getId() + num + 1);
103
+ record4.setOldRec();
104
+ this.addRec(record4);
105
+ num = num + 1;
106
+ }
107
+ if (this._initialCurrRecId === Int32.MinValue) {
108
+ if (flag)
109
+ this._serverCurrRec = null;
110
+ else {
111
+ if (dataview.getCurrRec() !== null)
112
+ this._serverCurrRec = (dataview.getCurrRec()).replicate();
113
+ else
114
+ this._serverCurrRec = null;
115
+ }
116
+ }
117
+ return c;
118
+ }
119
+ InsertRecord(insertAt, record) {
120
+ if (insertAt === 'B') {
121
+ let insertedRecordsCount = this.InsertedRecordsCount;
122
+ this.InsertedRecordsCount = insertedRecordsCount + 1;
123
+ this.insertRecord(record, 0);
124
+ }
125
+ else
126
+ this.addRec(record);
127
+ }
128
+ buildXML(message, skipCurrRec, currRecId) {
129
+ for (let i = 0; i < this._records.length; i = i + 1) {
130
+ let record = this._records.get_Item(i);
131
+ if (!record.SendToServer || (skipCurrRec && record.getId() === currRecId))
132
+ continue;
133
+ let prevRec;
134
+ let record2 = prevRec = record.getPrevRec();
135
+ let recIdx;
136
+ while (prevRec !== null && typeof prevRec !== "undefined" &&
137
+ (prevRec.getMode() === DataModificationTypes.Insert || !prevRec.SendToServer) &&
138
+ record.getMode() === DataModificationTypes.Insert &&
139
+ ((recIdx = this.getRecIdx(prevRec.getId())) > i || recIdx === RecordsTable.REC_NOT_FOUND || !prevRec.SendToServer)) {
140
+ prevRec = prevRec.getPrevRec();
141
+ record.setPrevRec(prevRec);
142
+ }
143
+ record.buildXML(message, false);
144
+ if (prevRec !== record2) {
145
+ record.setPrevRec(record2);
146
+ }
147
+ }
148
+ }
149
+ getRecord(id) {
150
+ return this._hashTab.get_Item(id);
151
+ }
152
+ getRecIdx(id) {
153
+ let result = RecordsTable.REC_NOT_FOUND;
154
+ let record = this.getRecord(id);
155
+ if (record !== null) {
156
+ result = this._records.indexOf(record);
157
+ }
158
+ return result;
159
+ }
160
+ getRecByIdx(idx) {
161
+ if (idx < 0 || idx >= this._records.length) {
162
+ Logger.Instance.WriteDevToLog("in RecordsTable.getRecByIdx() index out of bounds: " + idx);
163
+ return null;
164
+ }
165
+ return this._records.get_Item(idx);
166
+ }
167
+ removeAll() {
168
+ this._records.Clear();
169
+ this._hashTab.Clear();
170
+ }
171
+ getSize() {
172
+ return this._records.length;
173
+ }
174
+ getInitialCurrRecId() {
175
+ return this._initialCurrRecId;
176
+ }
177
+ addRecord(rec) {
178
+ if (this._records.indexOf(rec) < 0) {
179
+ this.addRec(rec);
180
+ }
181
+ }
182
+ addRec(rec) {
183
+ if (this._useLinkedList && this._records.length > 0) {
184
+ let record = this._records.get_Item(this._records.length - 1);
185
+ record.setNextRec(rec);
186
+ rec.setPrevRec(record);
187
+ }
188
+ this._records.push(rec);
189
+ this._hashTab.set_Item(rec.getHashKey(), rec);
190
+ }
191
+ insertRecord(rec, idx) {
192
+ if (this._useLinkedList) {
193
+ if (idx > 0) {
194
+ let record = this._records.get_Item(idx - 1);
195
+ rec.setPrevRec(record);
196
+ record.setNextRec(rec);
197
+ }
198
+ if (idx !== this._records.length) {
199
+ let record2 = this._records.get_Item(idx);
200
+ rec.setNextRec(record2);
201
+ record2.setPrevRec(rec);
202
+ }
203
+ }
204
+ this._records.Insert(idx, rec);
205
+ this._hashTab.set_Item(rec.getHashKey(), rec);
206
+ }
207
+ removeRecord(recIdxOrRec) {
208
+ if (arguments.length === 1 && (recIdxOrRec === null || recIdxOrRec.constructor === Number)) {
209
+ this.removeRecord_0(recIdxOrRec);
210
+ return;
211
+ }
212
+ this.removeRecord_1(recIdxOrRec);
213
+ }
214
+ removeRecord_0(recIdx) {
215
+ if (recIdx >= 0 && recIdx < this._records.length) {
216
+ let record = this._records.get_Item(recIdx);
217
+ let useLinkedList = this._useLinkedList;
218
+ if (useLinkedList) {
219
+ if (recIdx > 0) {
220
+ let record2 = this._records.get_Item(recIdx - 1);
221
+ record2.setNextRec(record.getNextRec());
222
+ }
223
+ if (recIdx + 1 < this._records.length) {
224
+ let record2 = this._records.get_Item(recIdx + 1);
225
+ record2.setPrevRec(record.getPrevRec());
226
+ }
227
+ }
228
+ this._hashTab.Remove(record.getHashKey());
229
+ this._records.RemoveAt(recIdx);
230
+ return;
231
+ }
232
+ throw new ApplicationException("in RecordsTable.removeRecord(): invalid index: " + recIdx);
233
+ }
234
+ removeRecord_1(rec) {
235
+ let num = this._records.indexOf(rec);
236
+ if (num >= 0) {
237
+ this.removeRecord(num);
238
+ }
239
+ }
240
+ replicate() {
241
+ let recordsTable = new RecordsTable(this);
242
+ recordsTable._records = new List();
243
+ recordsTable._hashTab = new Hashtable(100, 0.7);
244
+ for (let i = 0; i < this._records.length; i = i + 1) {
245
+ let record = this._records.get_Item(i).replicate();
246
+ recordsTable._records.push(record);
247
+ recordsTable._hashTab.set_Item(record.getHashKey(), record);
248
+ }
249
+ return recordsTable;
250
+ }
251
+ getServerCurrRec() {
252
+ return this._serverCurrRec;
253
+ }
254
+ zeroServerCurrRec() {
255
+ this._serverCurrRec = null;
256
+ }
257
+ GetSize() {
258
+ return this.getSize();
259
+ }
260
+ GetRecByIdx(idx) {
261
+ return this.getRecByIdx(idx);
262
+ }
263
+ RemoveAll() {
264
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pO1xyXG4gICAgICBsZXQgaXNDdXJyUmVjOiBib29sZWFuID0gcmVjb3JkMi5maWxsRGF0YShwYXJzZXIpO1xyXG4gICAgICBpZiAoaXNDdXJyUmVjICYmICFkYXRhdmlldy5IYXNNYWluVGFibGUpIHtcclxuICAgICAgICBsZXQgZGNSZWZzMjogT2JqZWN0UmVmZXJlbmNlc0NvbGxlY3Rpb247XHJcbiAgICAgICAgbGV0IGRjUmVmczogT2JqZWN0UmVmZXJlbmNlc0NvbGxlY3Rpb24gPSBkY1JlZnMyID0gcmVjb3JkMi5nZXREY1JlZnMoKTtcclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgZm9yIChsZXQgaTogbnVtYmVyID0gMDsgaSA8IHRoaXMuZ2V0U2l6ZSgpOyBpID0gaSArIDEpIHtcclxuICAgICAgICAgICAgdGhpcy5nZXRSZWNCeUlkeChpKS5zZXREY1JlZnMoZGNSZWZzKTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZmluYWxseSB7XHJcbiAgICAgICAgICBpZiAoZGNSZWZzMiAhPT0gbnVsbCkge1xyXG4gICAgICAgICAgICAoZGNSZWZzMikuRGlzcG9zZSgpO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICBpZiAoaXNDdXJyUmVjKSB7XHJcbiAgICAgICAgaWYgKGRhdGF2aWV3LmdldFRhc2soKS5nZXRNb2RlKCkgIT09ICdDJykge1xyXG4gICAgICAgICAgcmVjb3JkMi5zZXRPbGRSZWMoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5faW5pdGlhbEN1cnJSZWNJZCA9IHJlY29yZDIuZ2V0SWQoKTtcclxuXHJcbiAgICAgICAgLy8gc2F2ZSB0aGUgY3VycmVudCByZWNvcmQgYXMgc2VudCBieSB0aGUgc2VydmVyLlxyXG4gICAgICAgIHRoaXMuX3NlcnZlckN1cnJSZWMgPSByZWNvcmQyLnJlcGxpY2F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