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