{"version":3,"sources":["gui/Components/ScreenElements/Editors/CommonStyle.module.css","gui/Components/ScreenHeader/ScreenHeader.module.scss","gui/Components/ScreenElements/TreeView.module.css","gui/Components/ScreenElements/Editors/CheckList.module.scss","model/entities/ErrorDialog.module.scss","gui/Components/Splitter/Splitter.module.scss","gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox.module.scss","gui/Components/WebScreen/WebScreen.module.scss","gui/Workbench/ScreenArea/CustomSplitter.module.scss","gui/Components/TagInput/TagInput.module.css","gui/Components/ScreenElements/Editors/ColorEditor.module.scss","gui/Components/Form/CheckBox.module.scss","gui/Components/MainMenu/MainMenuItem.module.scss","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsLookup.module.scss","gui/Components/TabbedView/TabbedViewHandle.module.scss","gui/Components/DataViewHeader/DataViewHeaderButton.module.scss","gui/Components/ScreenElements/DataView.module.css","gui/Components/ScreenElements/Editors/NumberEditor.module.scss","gui/Components/Form/RadioButton.module.scss","gui/Components/ScreenToolbar/ScreenToolbarAction.module.scss","gui/Components/Dialogs/AboutDialog.module.scss","gui/Components/Sidebar/SidebarSectionHeader.module.scss","gui/Components/WorkQueues/WorkQueuesItem.module.scss","gui/connections/CFavorites.module.scss","gui/Workbench/ScreenArea/ScreenArea.module.scss","gui/Components/Icon/Icon.module.scss","gui/Components/DataViewHeader/DataViewHeaderAction.module.scss","gui/Components/Dropdowner/Dropdowner.module.scss","gui/Components/DataViewHeader/DataViewHeader.module.scss","gui/Components/Dropdown/DropdownItem.module.scss","gui/Workbench/ScreenArea/FormView/FormView.module.scss","gui/Components/Form/FormField.module.scss","gui/Components/ScreenElements/Editors/TagInputEditor.module.css","gui/Components/ScreenElements/Table/Scrollee.module.css","gui/Components/ScreenElements/Table/Scroller.module.css","gui/Workbench/ScreenArea/TableView/TableView.module.scss","gui/Components/WorkflowFinishedPanel/WorkflowFinishedPanel.module.scss","gui/Components/MainBar/MainBar.module.scss","gui/Components/ScreenTabsArea/ScreenTabsArea.module.scss","gui/Components/WorkbenchPage/WorkbenchPage.module.scss","gui/Components/TabbedView/TabbedViewHandleRow.module.scss","model/actions/Actions/processActionQueryResult.module.scss","gui/Components/DataViewHeader/DataViewHeaderButtonGroup.module.scss","gui/Components/DataViewHeader/DataViewHeaderGroup.module.scss","gui/Components/Dropdown/Dropdown.module.scss","gui/Components/Dropdown/DropdownDivider.module.scss","gui/Components/ScreenElements/DataViewLoading.module.css","gui/Workbench/ScreenArea/FormView/FormRoot.module.scss","gui/Components/ScreenElements/Editors/ImageEditor.module.scss","modules/Editors/DropdownEditor/Cells/BooleanCell.module.scss","modules/Editors/DropdownEditor/Cells/NumberCell.module.scss","gui/Components/ScreenElements/Editors/BoolEditor.module.scss","gui/Components/Form/FormSection.module.scss","gui/Components/Form/FormSectionHeader.module.scss","gui/Components/Form/FormLabel.module.scss","modules/DataView/Perspective/FormPerspective/FormPerspectiveDirector.module.scss","gui/Components/ScreenElements/Table/Canvas.module.css","gui/Components/ScreenElements/Table/HeaderRow.module.scss","gui/Components/ScreenElements/Table/PositionedField.module.css","gui/Components/ScreenElements/Table/SelectionCheckboxHeader.module.scss","modules/DataView/Perspective/TablePerspective/TablePerspectiveDirector.module.scss","gui/Components/ScreenToolbar/ScreenToolbar.module.scss","gui/Components/ScreenToolbar/ScreenToolbarPusher.module.scss","gui/Components/ScreenToolbar/ScreenToolbarActionGroup.module.scss","gui/Components/Sidebar/AlertCounter.module.scss","gui/Components/Sidebar/LogoSection.module.scss","gui/Components/Sidebar/Sidebar.module.scss","gui/Components/Sidebar/SidebarSection.module.scss","gui/Components/Sidebar/SidebarSectionDivider.module.scss","gui/Components/MainMenu/MainMenuUL.module.scss","gui/Components/MainMenu/MainMenuLI.module.scss","gui/Components/Sidebar/SidebarSectionBody.module.scss","gui/connections/MenuComponents/EditButton.module.scss","gui/Components/SidebarInfoSection/SidebarRecordInfo.module.scss","gui/connections/CSidebar.module.scss","gui/Components/ScreenHeader/ScreenHeaderAction.module.scss","gui/Components/ScreenHeader/ScreenHeaderPusher.module.scss","gui/Components/ScreenHeader/ScreenHeaderDivider.module.scss","gui/Components/Screen/ScreenContainer.module.scss","gui/Components/TabbedView/TabbedViewPanel.module.scss","gui/Components/TabbedView/TabbedView.module.scss","gui/Components/TabbedView/TabbedViewPanelsContainer.module.scss","gui/Components/ScreenElements/Box.module.css","gui/Components/ScreenElements/Label.module.css","gui/Components/ScreenElements/VBox.module.scss","gui/Components/ScreenElements/HBox.module.scss","gui/Components/Screen/Screen.module.scss","gui/Components/Fullscreen/Fullscreen.module.scss","gui/Components/Dialog/DialogStack.module.scss","gui/Components/ScreenElements/Editors/DateTimeEditor.module.scss","gui/Components/Dialogs/SearchDialog.module.scss","gui/Components/Dialogs/DialogsCommon.module.css","gui/Components/Dialogs/FavoriteFolderPropertiesDialog.module.scss","gui/Components/UserMenuDropdown/UserMenuDropdown.module.scss","gui/Components/ScreenElements/Editors/TextEditor.module.scss","gui/Components/Dialogs/SaveFilterDialog.module.css","model/selectors/getApplication.ts","model/selectors/getApi.ts","oauth.ts","gui/Components/MainBar/MainBar.tsx","gui/Components/ScreenTabsArea/ScreenTabsArea.tsx","gui/Components/Splitter/Splitter.tsx","gui/Components/WorkbenchPage/WorkbenchPage.tsx","model/selectors/getWorkbench.ts","gui/Components/Icon/Icon.tsx","gui/Components/TabbedView/TabbedViewHandle.tsx","gui/Components/TabbedView/TabbedViewHandleRow.tsx","model/selectors/getWorkbenchLifecycle.ts","model/selectors/getOpenedScreen.ts","model/entities/types/IOpenedScreen.ts","model/selectors/FormScreen/getFormScreen.ts","model/entities/types/IFormScreen.ts","model/selectors/FormScreen/getFormScreenLifecycle.ts","model/actions/FormScreen/reloadScreen.ts","model/entities/types/IDataView.ts","model/selectors/DataView/getDataView.ts","model/selectors-tree/selectionCheckboxes.ts","model/entities/types/IProperty.ts","model/selectors/DataView/getProperty.ts","model/selectors/MainMenu/getMainMenuEnvelope.ts","model/selectors/MainMenu/getMainMenu.ts","model/selectors-tree/mainMenu.ts","utils/cookies.ts","model/selectors-tree/index.ts","model/selectors-tree/column.ts","model/selectors-tree/error.ts","model/selectors/WorkQueues/getWorkQueues.ts","model/actions/WorkQueues/stopWorkQueues.ts","model/selectors/getApplicationLifecycle.ts","model/actions/User/performLogout.ts","utils/translation.tsx","model/actions/handleError.tsx","model/actions/SelectionDialog/types.ts","gui/Components/Dialogs/QuestionSaveData.tsx","model/selectors/TablePanelView/getTablePanelView.ts","model/entities/OpenedScreen.ts","model/entities/types/IAction.ts","model/selectors/Actions/getAction.ts","model/actions-tree/formScreen.ts","model/entities/types/IUrlOpenMethod.ts","model/actions-tree/index.ts","model/actions/Workbench/openNewUrl.ts","model/selectors/DataView/getDataViewsByEntity.ts","model/selectors/DataSources/getDataSourceByEntity.ts","model/actions/RowStates/putRowStateValue.ts","model/selectors/RowState/getRowStatesByEntity.ts","model/selectors/FormScreen/getDataViewList.ts","model/selectors/DataView/getIsBindingRoot.ts","model/selectors/DataSources/getDataSources.ts","model/selectors/FormScreen/getDataViewCache.ts","model/actions/DataLoading/processCRUDResult.ts","model/selectors/MainMenu/getMainMenuItemById.ts","model/actions/Actions/processActionResult.ts","model/selectors/DataView/getDataViewByModelInstanceId.ts","model/selectors/Actions/getActionCaption.ts","model/selectors/getSearcher.ts","model/actions/WorkQueues/refreshWorkQueues.ts","model/entities/types/IDataSource.ts","model/entities/types/IMainMenu.ts","model/selectors/DataSources/getDataSource.ts","model/selectors/DataView/getColumnNamesToLoad.ts","model/selectors/DataSources/getDataSourceFields.ts","model/selectors/DataView/getDataStructureEntityId.ts","model/selectors/DataView/getGridId.ts","model/selectors/DataView/getDataViewByGridId.ts","model/selectors/FormScreen/getisFormScreenDirty.ts","model/selectors/FormScreen/getIsSuppressSave.ts","model/selectors/getDialogStack.ts","model/selectors/getIsActiveScreen.ts","utils/objects.ts","model/selectors/DataView/getDataViewLifecycle.ts","model/actions/DataView/navigateAsChild.ts","model/selectors/DataView/getBindingChildren.ts","model/selectors/DataView/getEntity.ts","model/selectors/DataView/getMasterRowId.ts","model/selectors/DataView/getBindingRoot.ts","model/selectors/TablePanelView/getSelectedRowId.ts","model/selectors/DataView/getBindingParents.ts","model/selectors/DataView/getBindingParent.ts","model/selectors/DataView/getParentRowId.ts","model/selectors/isLazyLoading.ts","model/selectors/getSessionId.ts","model/selectors/getMenuItemId.ts","model/entities/types/IOrderingConfiguration.ts","model/entities/OrigamApiHelpers.ts","model/selectors/DataView/getFilterConfiguration.ts","model/selectors/DataView/getUserFilters.ts","model/selectors/DataView/getOrderingConfiguration.ts","model/selectors/DataView/getUserOrdering.ts","utils/arrays.ts","model/selectors/DataView/getDataTable.ts","model/selectors/DataView/getGrouper.ts","gui/Workbench/ScreenArea/TableView/VisibleRowsMonitor.ts","model/selectors/DataView/getUserFilterLookups.ts","gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader.ts","model/entities/RowState.ts","utils/flow.ts","model/entities/DataViewLifecycle/DataViewLifecycle.ts","model/selectors/DataView/getIsBindingParent.ts","model/entities/LookupLoader.ts","utils/flashColorFormat.ts","model/selectors/RowState/getRowStates.ts","model/selectors/RowState/getRowStateById.ts","model/selectors/RowState/getRowStateIsDisabledAction.ts","model/entities/Action.ts","model/entities/ActionParameter.ts","model/entities/ComponentBinding.ts","model/entities/DataSource.ts","model/entities/DataSourceField.ts","model/entities/AdditionalRowData.ts","model/selectors/isInfiniteScrollingActive.ts","utils/dataRow.ts","model/entities/ScrollRowContainer.ts","model/selectors/DataView/getDataViewPropertyById.ts","model/entities/ListRowContainer.ts","model/entities/NumberFormating.ts","model/entities/DataTable.ts","model/entities/types/IPanelViewType.ts","model/selectors/getRowContainer.ts","model/selectors/DataSources/getDataSourceFieldByIndex.ts","model/selectors/DataView/getSelectedRow.ts","model/selectors/getIsDialog.ts","model/selectors/DataSources/getDataSourceFieldByName.ts","model/selectors/RowState/getRowStateMayCauseFlicker.ts","model/selectors/TablePanelView/getTableViewProperties.ts","model/selectors/DataView/getIsSelectionCheckboxesShown.ts","model/selectors/TablePanelView/getGroupingConfiguration.ts","gui/Components/ScreenElements/Table/TableRendering/tableRows.ts","model/selectors/TablePanelView/getLeadingColumnCount.tsx","gui/Workbench/ScreenArea/TableView/GridDimensions.ts","gui/Components/ScreenElements/Table/SimpleScrollState.ts","model/selectors/MainMenu/getMainMenuState.ts","gui/Components/Dialogs/SearchDialog.tsx","model/actions-ui/ScreenToolbar/openSearchWindow.tsx","model/entities/FormFocusManager.ts","model/selectors/DataView/getSelectionMember.ts","model/selectors/DataView/getPropertyOrdering.ts","model/selectors/DataSources/getDataSourceFieldIndexByName.ts","model/actions-ui/MainMenu/onMainMenuItemClick.ts","model/selectors/RecordInfo/getRecordInfo.ts","model/actions-ui/onSelectedRowChange.ts","utils/runInFlowWithHandler.ts","model/selectors/TablePanelView/getConfigurationManager.ts","model/entities/GridFocusManager.ts","model/entities/DataView.ts","model/selectors/DataView/getLookupLoader.ts","model/selectors/DataView/getParentRow.ts","model/selectors/DataView/getBindingToParent.ts","model/entities/DropDownColumn.ts","utils/string.ts","model/selectors/PortalSettings/getStringFilterConfig.ts","model/entities/FilterConfiguration.ts","model/entities/FormPanelView/FormPanelView.ts","utils/sync.ts","utils/image.ts","utils/values.ts","model/entities/ScreenPictureCache.ts","model/entities/types/ILookup.ts","model/entities/DataViewCache.ts","model/entities/FormScreen.ts","model/entities/Lookup.ts","model/selectors/DataView/getProperties.ts","model/entities/OrderingConfiguration.ts","model/entities/types/IPropertyColumn.ts","model/entities/Property.ts","model/selectors/DialogStack/getDialogStack.ts","model/entities/types/AggregationType.ts","gui/Components/ScreenElements/Table/TableRendering/common/ValueBox.ts","gui/Components/ScreenElements/Table/TableRendering/common/Memoized.ts","gui/Components/ScreenElements/Table/TableRendering/renderingValues.ts","model/selectors/DataView/getFieldErrorMessage.ts","model/selectors/RowState/getRowStateAllowRead.ts","model/selectors/RowState/getRowStateForegroundColor.ts","model/selectors/RowState/getRowStateRowBgColor.ts","utils/canvas.ts","utils/colorUtils.ts","model/actions/actionSync.ts","model/actions-ui-tree/index.ts","model/actions-ui-tree/actions.ts","model/actions-ui-tree/workflow.ts","gui/Components/ScreenElements/Table/TableRendering/onClick.ts","gui/Components/ScreenElements/Table/TableRendering/DebugTableMonitor.ts","gui/Components/ScreenElements/Table/TableRendering/cells/cellAlignment.ts","gui/Components/ScreenElements/Table/TableRendering/cells/dataCellRenderer.ts","gui/Components/ScreenElements/Table/TableRendering/cells/dataCell.ts","model/selectors/Workbench/getShowToolTipsForMemoFieldsOnly.ts","model/actions-tree/selectionCheckboxes.ts","gui/Components/ScreenElements/Table/TableRendering/cells/selectionCheckboxCell.ts","model/entities/Aggregatioins.ts","gui/Components/ScreenElements/Table/TableRendering/cells/aggregationCell.ts","gui/Components/ScreenElements/Table/TableRendering/rowCells/groupRowCells.ts","model/actions-ui/DataView/TableView/onGroupHeaderToggleClick.ts","gui/Components/ScreenElements/Table/TableRendering/cells/groupCell.ts","gui/Components/ScreenElements/Table/TableRendering/rowCells/dataRowCells.ts","gui/Components/ScreenElements/Table/TableRendering/currentCellLayerIndex.ts","gui/Components/ScreenElements/Table/TableRendering/currentRowCells.ts","gui/Components/ScreenElements/Table/TableRendering/currentCell.ts","gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon.ts","model/entities/types/GroupingUnit.ts","gui/Components/Dialogs/ColumnsDialog.tsx","gui/Components/Dialogs/NewConfigurationDialog.tsx","model/selectors/DataView/getActivePanelView.ts","model/actions/DataView/TableView/saveColumnConfigurations.ts","model/entities/TablePanelView/ColumnConfigurationDialog.tsx","model/actions-ui/DataView/TableView/onFieldChange.ts","model/selectors/DataView/getSelectedRowIndex.ts","model/selectors/TablePanelView/getCellValue.ts","model/selectors/TablePanelView/getSelectedColumnId.ts","model/selectors/TablePanelView/getSelectedColumnIndex.ts","model/actions/DataView/TableView/flushCurrentRowData.ts","model/selectors/RowState/getRowStateAllowUpdate.ts","model/selectors/RowState/isReadOnly.ts","gui/Components/Dialogs/ChangeMasterRecordDialog.tsx","model/selectors/DataView/getSelectedRowErrorMessages.ts","model/entities/FormScreenLifecycle/questionSaveDataAfterRecordChange.tsx","model/actions/Actions/processActionQueryInfo.tsx","model/entities/TablePanelView/TablePanelView.tsx","utils/common.ts","xmlInterpreters/xmlUtils.ts","model/entities/GroupingConfiguration.ts","gui/Components/ScreenElements/Table/TableRendering/GroupItem.ts","model/entities/GrouperCommon.ts","model/entities/DateGroupData.ts","dic/Container.ts","model/entities/ServerSideGrouper.ts","model/entities/ClientSideGrouper.ts","modules/DataView/DataViewUI.tsx","modules/DataView/DataViewTypes.ts","gui/Components/Dropdowner/Dropdowner.tsx","gui/Components/DataViewHeader/DataViewHeader.tsx","gui/Components/DataViewHeader/DataViewHeaderButton.tsx","gui/Components/DataViewHeader/DataViewHeaderButtonGroup.tsx","gui/Components/DataViewHeader/DataViewHeaderDropDownItem.tsx","gui/Components/DataViewHeader/DataViewHeaderGroup.tsx","gui/Components/Dropdown/Dropdown.tsx","gui/Components/Dropdown/DropdownItem.tsx","gui/Components/Dialogs/SaveFilterDialog.tsx","gui/connections/FilterDropDown.tsx","model/selectors/DataView/getFilterGroupManager.ts","model/selectors/getColumnConfigurationDialog.ts","model/actions-ui/DataView/TableView/shouldProceedToChangeRow.ts","model/actions/DataView/selectNextRow.ts","model/actions/DataView/selectPrevRow.ts","model/selectors/Actions/getIsEnabledAction.ts","modules/DataView/ViewConfiguration.ts","model/selectors/DataView/getActivePerspective.ts","model/selectors/DataView/getIsAddButtonVisible.ts","model/selectors/RowState/getRelationState.ts","model/actions/DataView/selectFirstRow.ts","model/actions/DataView/selectLastRow.ts","gui/Components/Dropdown/DropdownDivider.tsx","gui/connections/CDataViewHeader.tsx","model/selectors/DataView/getTrueSelectedRowIndex.ts","model/selectors/DataView/getTotalGroupRowCount.ts","model/selectors/DataView/getExpandedGroupRowCount.ts","model/selectors/DataView/getPanelViewActions.ts","model/selectors/DataView/getPanelMenuActions.ts","model/selectors/DataView/getDataViewLabel.ts","model/selectors/TablePanelView/getIsFilterControlsDisplayed.ts","model/actions-ui/DataView/onColumnConfigurationClick.ts","model/actions-ui/DataView/onExportToExcelClick.ts","model/actions-ui/DataView/onDeleteRowClick.ts","model/actions-ui/DataView/onCreateRowClick.ts","model/actions-ui/DataView/onMoveRowUpClick.ts","model/actions-ui/DataView/getIsRowMovingDisabled.ts","model/actions-ui/DataView/onMoveRowDownClick.ts","model/actions-ui/DataView/onCopyRowClick.ts","model/actions-ui/DataView/onFilterButtonClick.ts","model/actions-ui/DataView/onFirstRowClick.ts","model/actions-ui/DataView/onPrevRowClick.ts","model/actions-ui/DataView/onNextRowClick.ts","model/actions-ui/DataView/onLastRowClick.ts","model/selectors/DataView/getIsMoveRowMenuVisible.ts","model/selectors/DataView/getIsDelButtonVisible.ts","model/selectors/DataView/getIsCopyButtonVisible.ts","model/selectors/DataView/getAreCrudButtonsEnabled.ts","model/actions-ui/RecordInfo/onRecordInfoClick.ts","model/selectors/DataView/getIsDataViewWorking.ts","model/selectors/FormScreen/getIsFormScreenWorking.ts","model/selectors/DataView/getDataViewById.ts","gui/Components/ScreenElements/DataViewLoading.tsx","model/entities/TreeDataTable.ts","gui/Components/ScreenElements/TreeView.tsx","utils/events.ts","gui/Components/ScreenElements/DataView.tsx","model/selectors/DataView/getIsDataViewOrFormScreenWorking.1.ts","model/selectors/DataView/getIsDataViewOrFormScreenWorking.ts","gui/Components/DataViewHeader/DataViewHeaderAction.tsx","modules/DataView/Perspective/Perspective.ts","modules/DataView/Perspective/MapPerspective/stores/MapObjectsStore.ts","modules/DataView/Perspective/MapPerspective/MapPerspective.ts","modules/DataView/Perspective/MapPerspective/MapPerspectiveUI.tsx","modules/DataView/Perspective/MapPerspective/stores/MapNavigationStore.ts","modules/DataView/Perspective/MapPerspective/stores/MapRoutefinderStore.ts","modules/DataView/Perspective/MapPerspective/stores/MapSearchStore.ts","modules/DataView/Perspective/MapPerspective/stores/MapSetupStore.ts","modules/DataView/Perspective/MapPerspective/stores/MapRootStore.ts","modules/DataView/Perspective/MapPerspective/MapPerspectiveSearch.tsx","modules/DataView/Perspective/MapPerspective/MapPerspectiveDirector.tsx","modules/DataView/Perspective/MapPerspective/MapPerspectiveModule.tsx","modules/DataView/Perspective/FormPerspective/FormPerspective.ts","gui/Workbench/ScreenArea/FormView/FormView.tsx","gui/Workbench/ScreenArea/FormView/FormRoot.tsx","gui/Components/ToolTip/FormatTooltipText.tsx","gui/Components/ScreenElements/Editors/BlobEditor.tsx","gui/Components/ScreenElements/Editors/CheckList.tsx","gui/Components/ScreenElements/Editors/ImageEditor.tsx","gui/Components/ScreenElements/Editors/NumberEditor.tsx","modules/Editors/DropdownEditor/Cells/CellsCommon.tsx","modules/Editors/DropdownEditor/Cells/BooleanCellDriver.tsx","modules/Editors/DropdownEditor/Cells/HeaderCell.tsx","modules/Editors/DropdownEditor/Cells/NumberCellDriver.tsx","modules/Editors/DropdownEditor/Cells/TextCellDriver.tsx","modules/Editors/DropdownEditor/DropdownEditorCommon.tsx","modules/Editors/DropdownEditor/DropdownEditorApi.tsx","modules/Editors/DropdownEditor/DropdownEditorBehavior.tsx","utils/textMeasurement.ts","modules/Editors/DropdownEditor/DropdownEditorBody.tsx","modules/Editors/DropdownEditor/DropdownEditorInput.tsx","modules/Editors/DropdownEditor/DropdownEditorControl.tsx","modules/Editors/DropdownEditor/DropdownEditorData.tsx","modules/Editors/DropdownEditor/DropdownEditorLookupListCache.ts","modules/Editors/DropdownEditor/DropdownTableModel.ts","modules/Editors/DropdownEditor/TagInputEditorData.tsx","modules/Editors/DropdownEditor/Cells/DateCellDriver.tsx","xmlInterpreters/getMomentFormat.ts","modules/Editors/DropdownEditor/DropdownEditor.tsx","gui/Components/TagInput/TagInput.tsx","gui/Components/ScreenElements/Editors/TagInputEditor.tsx","gui/Components/ScreenElements/Editors/TextEditor.tsx","model/actions-ui/DataView/TableView/onFieldBlur.ts","gui/Components/ScreenElements/Editors/BoolEditor.tsx","gui/Components/ScreenElements/Editors/DateCompleter.tsx","gui/Components/ScreenElements/Editors/DateTimeEditor.tsx","gui/Components/ScreenElements/Editors/ColorEditor.tsx","gui/Workbench/ScreenArea/FormView/FormViewEditor.tsx","gui/Components/Form/FormField.tsx","model/actions-ui/DataView/OnTextFieldAutoUpdate.tsx","model/actions/DropdownEditor/onDropdownEditorClick.ts","model/selectors/RowState/getRowStateNameOverride.ts","gui/Components/Form/FormSectionHeader.tsx","gui/Components/Form/FormSection.tsx","gui/Components/Form/FormLabel.tsx","gui/Components/Form/RadioButton.tsx","gui/Components/Form/CheckBox.tsx","gui/contexts/GUIContexts.ts","gui/Workbench/ScreenArea/FormView/FormBuilder.tsx","modules/DataView/Perspective/FormPerspective/FormPerspectiveDirector.tsx","modules/DataView/Perspective/FormPerspective/FormPerspectiveModule.ts","modules/DataView/Perspective/TablePerspective/TablePerspective.ts","model/actions/DataView/TableView/selectPrevColumn.ts","model/actions/DataView/TableView/selectNextColumn.ts","model/actions-ui/DataView/TableView/onColumnHeaderClick.ts","gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox.tsx","gui/Components/CheckBox/Checkbox.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSetting.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsBoolean.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsString.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsDate.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsNumber.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsLookup.tsx","model/entities/getAllLookupIds.tsx","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsTagInput.tsx","gui/Components/ScreenElements/Table/FilterSettings/FilterSettings.tsx","model/selectors/DataView/getFilterSettingByProperty.ts","model/actions-ui/DataView/TableView/onApplyFilterSetting.ts","gui/Components/ScreenElements/Table/Header.tsx","gui/Components/ScreenElements/Table/Canvas.tsx","gui/Components/ScreenElements/Table/HeaderRow.tsx","gui/Components/ScreenElements/Table/PositionedField.tsx","gui/Components/ScreenElements/Table/Scrollee.tsx","gui/Components/ScreenElements/Table/Scroller.tsx","gui/Components/ScreenElements/Table/TableRendering/drawableRowIndex.ts","gui/Components/ScreenElements/Table/TableRendering/drawableColumnIndex.ts","gui/Components/ScreenElements/Table/TableRendering/renderTable.ts","model/actions-ui/DataView/TableView/onColumnOrderChangeFinished.ts","gui/Components/ScreenElements/Table/Table.tsx","gui/Workbench/ScreenArea/TableView/TableViewEditor.tsx","model/selectors/TablePanelView/getSelectedProperty.ts","model/actions-ui/DataView/TableView/onFieldKeyDown.ts","model/actions-ui/DataView/TableView/onNoCellClick.ts","model/actions-ui/DataView/TableView/onOutsideTableClick.ts","model/actions-tree/setAllSelectionStates.ts","gui/Components/ScreenElements/Table/SelectionCheckBoxHeader.tsx","gui/Workbench/ScreenArea/TableView/TableView.tsx","model/actions-ui/DataView/TableView/onTableKeyDown.ts","model/selectors/TablePanelView/getFixedColumnsCount.ts","model/selectors/TablePanelView/getColumnHeaders.ts","model/actions-ui/DataView/TableView/onColumnWidthChanged.ts","model/selectors/TablePanelView/getIsEditing.ts","model/actions-ui/DataView/TableView/onColumnWidthChangeFinished.ts","modules/DataView/Perspective/TablePerspective/TablePerspectiveDirector.tsx","modules/DataView/Perspective/TablePerspective/TablePerspectiveModule.ts","modules/DataView/DataViewModule.tsx","modules/DataView/Perspective/PerspectiveModule.ts","modules/Lookup/Clock.ts","modules/Lookup/LookupApi.ts","modules/Lookup/LookupCacheDependencies.ts","modules/Lookup/LookupCacheIndividual.ts","modules/Lookup/LookupCacheMulti.ts","modules/Lookup/LookupCleanerLoader.ts","modules/Lookup/common.ts","modules/Lookup/LookupLoaderIndividual.ts","modules/Lookup/LookupLoaderMulti.ts","modules/Lookup/LookupResolver.ts","modules/Lookup/LookupScopeRegistry.ts","modules/Lookup/LookupModule.ts","modules/Screen/FormScreen/ScreenEvents.ts","modules/Screen/FormScreen/FormScreenModule.ts","modules/Screen/ScreenModule.ts","rootContainer.ts","registerModules.ts","model/entities/OrigamAPI.ts","modules/DataView/DataViewAPI.ts","modules/DataView/TableCursor.ts","modules/DataView/DataViewData.ts","modules/Screen/ScreenAPI.ts","xmlInterpreters/filterXml.ts","model/entities/FilterGroupManager.ts","model/entities/TablePanelView/tableColumnConfiguration.ts","model/entities/TablePanelView/tableConfiguration.ts","model/entities/TablePanelView/configurationManager.ts","xmlInterpreters/createConfigurationManager.ts","xmlInterpreters/screenXml.ts","model/actions/DataView/startEditingFirstCell.ts","model/selectors/DataView/getFormFocusManager.ts","model/selectors/DataView/getAllBindingChildren.ts","model/entities/FormScreenLifecycle/UpdateRequestAggregator.tsx","gui/Components/Dialog/DialogUtils.tsx","plugins/tools/PluginData.ts","plugins/tools/Localizer.ts","plugins/tools/PluginLibrary.tsx","plugins/tools/PluginRegistration.ts","model/entities/FormScreenLifecycle/FormScreenLifecycle.tsx","model/actions/RowStates/refreshRowStates.ts","model/selectors/FormScreen/getAutorefreshPeriod.ts","model/selectors/DataView/getBindingParametersFromParent.ts","model/factories/createFormScreenEnvelope.ts","model/factories/createOpenedScreen.ts","model/selectors/getOpenedScreens.ts","xmlInterpreters/menuXml.ts","model/entities/MainMenu.ts","model/entities/WorkbenchLifecycle/WorkbenchLifecycle.ts","utils/esproxy.ts","model/entities/WebScreen.ts","model/actions-ui/ScreenHeader/onWorkflowNextClick.ts","model/selectors/Chatrooms/getChatrooms.ts","model/selectors/Chatrooms/getNotifications.ts","model/selectors/MainMenu/getFavorites.ts","utils/debugHelpers.ts","model/actions-ui/ScreenToolbar/onRefreshSessionClick.ts","model/actions/closeForm.ts","model/actions-ui/ScreenTabHandleRow/onScreenTabCloseClick.ts","gui/Components/Utilities/ErrorBoundary.tsx","model/selectors/getOpenedNonDialogScreenItems.ts","gui/connections/CScreenTabbedViewHandleRow.tsx","model/actions-ui/ScreenTabHandleRow/onScreenTabHandleClick.ts","gui/Components/ScreenToolbar/ScreenToolbar.tsx","gui/Components/ScreenToolbar/ScreenToolbarAction.tsx","gui/Components/ScreenToolbar/ScreenToolbarPusher.tsx","gui/Components/ScreenToolbar/ScreenToolbarActionGroup.tsx","model/selectors/getActiveScreen.ts","model/actions-ui/ScreenToolbar/onSaveSessionClick.ts","gui/Components/UserMenuDropdown/UserMenuBlock.tsx","gui/Components/Dialogs/AboutDialog.tsx","gui/Components/UserMenuDropdown/UserMenuDropdown.tsx","model/selectors/User/getLoggedUserName.ts","model/entities/types/IWebScreen.ts","model/selectors/WebScreen/getWebScreen.ts","model/selectors/User/getUserAvatarLink.ts","model/selectors/User/getCustomAssetsRoute.ts","model/selectors/FormScreen/getIsSuppressRefresh.ts","model/selectors/User/getHelpUrl.ts","gui/connections/CScreenToolbar.tsx","model/actions-ui/ScreenToolbar/onScreenToolbarLogoutClick.ts","model/selectors/getActiveScreenActions.ts","model/actions-ui/ScreenToolbar/onReloadWebScreen.ts","gui/Components/Sidebar/AlertCounter.tsx","gui/Components/Sidebar/LogoSection.tsx","gui/Components/Sidebar/Sidebar.tsx","gui/Components/Sidebar/SidebarSection.tsx","gui/Components/Sidebar/SidebarSectionDivider.tsx","gui/Components/Sidebar/SidebarSectionHeader.tsx","gui/Components/MainMenu/MainMenuUL.tsx","gui/Components/MainMenu/MainMenuLI.tsx","gui/Components/MainMenu/MainMenuItem.tsx","model/selectors/MainMenu/getIsMainMenuLoading.ts","gui/Components/Dialogs/ChooseFavoriteFolderDialog.tsx","gui/Workbench/MainMenu/IMenuItemIcon.tsx","gui/getIconUrl.ts","model/actions-ui/MainMenu/onResetColumnConfigClick.ts","gui/Components/Sidebar/SidebarSectionBody.tsx","gui/connections/MenuComponents/EditButton.tsx","gui/connections/CMainMenu.tsx","gui/Components/WorkQueues/WorkQueuesItem.tsx","model/actions-ui/WorkQueues/onWorkQueuesListItemClick.ts","gui/connections/CWorkQueues.tsx","gui/connections/types.ts","model/selectors/WorkQueues/getWorkQueuesItems.ts","gui/Components/SidebarInfoSection/SidebarRecordInfo.tsx","gui/Components/SidebarInfoSection/SidebarRecordAudit.tsx","gui/connections/CSidebarInfoSection.tsx","model/actions/Chatrooms/onChatroomsListItemClick.ts","gui/connections/CChatSection.tsx","gui/Components/Search/SearchResults.tsx","model/entities/types/ISearchResult.ts","gui/Components/Dialogs/FavoriteFolderPropertiesDialog.tsx","gui/connections/MenuComponents/PinButton.tsx","gui/connections/CFavorites.tsx","gui/connections/CSidebar.tsx","model/actions-ui/RecordInfo/addRecordInfoExpandRequestHandler.ts","model/actions-ui/RecordInfo/addRecordAuditExpandRequestHandler.ts","model/selectors/WorkQueues/getWorkQueuesTotalItemCount.ts","model/selectors/PortalSettings/getShowChat.ts","model/selectors/PortalSettings/getShowWorkQues.ts","model/selectors/getLogoUrl.ts","gui/Components/ScreenHeader/ScreenHeader.tsx","gui/Components/ScreenHeader/ScreenHeaderAction.tsx","gui/Components/ScreenHeader/ScreenHeaderPusher.tsx","model/selectors/Workbench/getIsCurrentScreenFull.ts","model/selectors/FormScreen/getIsScreenOrAnyDataViewWorking.ts","model/selectors/getIsTopmostNonDialogScreen.ts","model/selectors/getTopmostNonDialogScreenItem.ts","gui/Components/ScreenHeader/ScreenHeaderDivider.tsx","model/actions-ui/ScreenHeader/onWorkflowAbortClick.ts","gui/connections/CScreenHeader.tsx","model/actions-ui/ScreenHeader/onFullscreenClick.ts","gui/Components/Screen/ScreenContainer.tsx","gui/Components/TabbedView/TabbedViewPanel.tsx","gui/Components/TabbedView/TabbedView.tsx","gui/Components/TabbedView/TabbedViewPanelsContainer.tsx","gui/connections/CScreenSectionTabbedView.tsx","model/actions/FormScreen/saveSplitPanelConfiguration.ts","model/actions-ui/Splitter/splitterPositionToServerValue.ts","model/actions-ui/Splitter/onSplitterPositionChangeFinished.ts","gui/Components/ScreenElements/Box.tsx","gui/Components/ScreenElements/Label.tsx","gui/Components/ScreenElements/VBox.tsx","gui/Components/WorkflowFinishedPanel/WorkflowFinishedPanel.tsx","gui/Components/ScreenElements/HBox.tsx","gui/Workbench/ScreenArea/FormScreenBuilder.tsx","gui/Components/Screen/Screen.tsx","gui/Components/WebScreen/WebScreen.tsx","model/actions/Workbench/openScreenByReference.ts","model/actions/Global/executeWeblink.ts","model/actions/Global/onRootElementClick.ts","gui/connections/CScreen.tsx","model/actions/WebScreen/onIFrameClick.ts","gui/connections/CScreenContent.tsx","model/actions-ui/SelectionDialog/onSelectionDialogActionButtonClick.ts","gui/Workbench/ScreenArea/ScreenBuilder.tsx","gui/Workbench/ScreenArea/ScreenArea.tsx","gui/connections/CDialogContent.tsx","model/selectors/getOpenedDialogScreenItems.ts","gui/Components/Fullscreen/Fullscreen.tsx","gui/connections/pages/CWorkbenchPage.tsx","gui/Components/Dialog/DialogStack.tsx","gui/connections/CMain.tsx","Root.tsx","model/entities/ErrorDialog.tsx","model/entities/Application.ts","model/entities/Workbench.ts","model/actions/Workbench/openScreenByReferenceAndLookup.ts","model/selectors/MainMenu/menuNode.ts","model/selectors/MainMenu/getMainMenuUI.ts","model/entities/Searcher.ts","model/actions/Workbench/onSearchResultClick.ts","model/entities/OpenedScreens.ts","utils/PeriodicLoader.ts","model/entities/WorkQueues.ts","model/actions-ui/WorkQueues/onRefreshWorkQueues.ts","model/entities/RecordInfo.ts","modules/Lookup/LookupListCacheMulti.ts","model/entities/Chatrooms.ts","model/actions/Chatrooms/onRefreshChatrooms.ts","model/entities/Notifications.ts","model/actions/Notifications/GetNotificationBoxContent.ts","model/entities/Favorites.ts","model/entities/SidebarState.ts","model/actions-ui/RecordInfo/onSidebarInfoSectionCollapsed.ts","model/actions-ui/RecordInfo/onSidebarInfoSectionExpanded.ts","model/actions-ui/RecordInfo/onSidebarAuditSectionExpanded.ts","model/factories/createWorkbench.ts","modules/Workbench/WorkbenchModule.ts","model/actions/FormScreen/stopAutoreload.ts","model/actions/Workbench/stopAllFormsAutorefresh.ts","gui/Components/Dialogs/QuestionLogoutWithDirtyData.tsx","model/entities/ApplicationLifecycle.tsx","model/entities/DialogStack.ts","model/factories/createApplication.ts","serviceWorker.ts","utils/mouse.ts","RootError.tsx","index.tsx","gui/Components/ScreenElements/Editors/BlobEditor.module.scss","gui/Components/Search/SearchResults.module.scss","gui/Components/ScreenElements/Table/Table.module.scss","gui/Components/ScreenElements/Table/Header.module.scss","gui/Components/Dialogs/ColumnsDialog.module.scss","gui/connections/CMainMenu.module.scss","modules/DataView/Perspective/MapPerspective/MapPerspectiveUI.module.scss","gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsCommon.module.scss","gui/connections/MenuComponents/HeaderButton.module.scss","RootError.module.scss"],"names":["module","exports","getApplication","ctx","cn","parent","getApi","api","window","location","href","split","windowLocation","config","authority","client_id","redirect_uri","response_type","scope","post_logout_redirect_uri","response_mode","automaticSilentRenew","silent_redirect_uri","userManager","Oidc","UserManager","ensureLogin","a","authOvr","sessionStorage","getItem","setItem","access_token","hash","startsWith","signinRedirectCallback","replace","user","urlpart","history","replaceState","getUser","signinRedirect","logoff","signoutRedirect","MainBar","props","className","cx","S","root","children","ScreenTabsArea","SplitterPanel","observer","refPanel","elm","elmPanel","this","type","width","size","height","ref","splitterPanel","style","React","Component","computed","SplitterDivider","isDragging","top","relativeLoc","left","domRef","onMouseDown","splitterDivider","Splitter","action","bound","draggingDividerId","initSizes","_","debounce","initSizesImm","runInAction","i","panels","length","panel","sizeMap","set","dividerSizeMap","contentRect","bounds","announceContainerSize","differentSizeRequested","containerWidth","containerHeight","isInitialized","newWidth","newHeight","Math","abs","containerSize","dividerSizeSum","Array","from","values","reduce","b","undefined","sizeOverrideFirstPanel","sizeRatio","entries","key","value","firstPanelSize","max","slice","acc","get","event","handleId","isResizing","dividerRelativeLoc","mouseLocStart","screenY","screenX","addEventListener","handleWindowMouseUp","handleWindowMouseMove","preventDefault","computeNewSizes","size1","size2","findIndex","draggingIds","id1","id2","removeEventListener","newSizes","onSizeChangeFinished","dividerId","content","push","STYLE","dontPrintLeftPane","onResize","handleDividerResize","measureRef","divider","handleDividerMouseDown","handleResize","observable","Map","WorkbenchPage","SSplitter","sidebar","mainbar","getWorkbench","workbench","Error","Icon","src","toLowerCase","endsWith","title","tooltip","alt","TabbedViewHandle","onClick","isActive","isDirty","id","label","hasCloseBtn","closeBtn","onCloseClick","onCloseMouseDown","TabbedViewHandleRow","getWorkbenchLifecycle","workbenchLifecycle","getOpenedScreen","o","$type_IOpenedScreen","getFormScreen","$type_IFormScreen","getFormScreenLifecycle","formScreenLifecycle","reloadScreen","refreshSession","isIDataView","$type_IDataView","getDataView","IDockType","getIsSelectedRowId","hasSelectedRowId","getSelectedRowIds","selectedRowIds","getProperty","$type_IProperty","getMainMenuEnvelope","mainMenuEnvelope","getMainMenu","mainMenu","_locale","DateSequence","_defaultDateFormats","selectionCheckboxes","isLinkToForm","isLink","getLinkMenuId","property","linkDependsOnValue","getMenuId","LookupId","lookupId","ReferenceId","linkToMenuId","getItemById","getDialogController","errorDialogController","getWorkQueues","workQueues","stopWorkQueues","stopTimer","getApplicationLifecycle","applicationLifecycle","performLogout","getCookie","name","parts","document","cookie","cookieValue","pop","shift","getLocaleFromCookie","results","unescape","match","parseDateSequence","candidate","DayMonthYear","MonthDayYear","getDefaultCsDateFormatDataFromCookie","parameters","map","pair","getCookieParameters","defaultDateSeparator","getParameter","defaultTimeSeparator","defaultDateTimeSeparator","defaultDateSequence","defaultLongDateFormat","defaultShortDateFormat","defaultTimeFormat","error","isValidLocalizationCookie","e","console","warn","initLocaleCookie","defaultLocalizationCookie","newCookieValue","debugShowTranslations","localStorage","translations","translationsInit","locale","axios","result","data","response","status","localeParent","then","catch","error2","T","defaultContent","translKey","showingDefault","hasOwnProperty","backgroundColor","HANDLED","Symbol","handleError","selectors","dismissErrors","pushError","promise","flow","IActionResultType","QuestionSaveData","refPrimaryBtn","elmPrimaryBtn","setTimeout","focus","titleButtons","buttonsCenter","autoFocus","tabIndex","onSaveClick","onDontSaveClick","onCancelClick","buttonsLeft","buttonsRight","CS","dialogContent","screenTitle","getTablePanelView","tablePanelView","IActionType","IActionPlacement","IActionMode","DialogInfo","OpenedScreen","dialogInfo","parentContext","parentSessionId","isBeingClosed","lazyLoading","menuItemId","menuItemType","order","_title","isClosed","Object","assign","formScreen","dynamicTitle","state","dataView","dataViews","isFormViewActive","triggerOnFocusTable","screen","getAction","$type_IAction","IUrlUpenMethod","refresh","openNewUrl","url","urlOpenMethod","OrigamTab","win","open","getDataViewsByEntity","entity","getDataSourceByEntity","putRowStateValue","rowStates","dataSource","rowState","getRowStatesByEntity","putValue","getDataViewList","getIsBindingRoot","isBindingRoot","getDataSources","dataSources","getDataViewCache","dataViewCache","IResponseOperation","processCRUDResult","resortTables","sourceDataView","isArray","resultItem","f","operation","Update","Create","Delete","FormSaved","CurrentRecordNeedsUpdate","FormNeedsRefresh","DeleteAllData","dataTable","clearRecordDirtyValues","objectId","wrappedObject","substituteRecord","UpdateData","updateSortAndFilter","retainPreviousSelection","selectedRow","reselectOrSelectFirst","formFocusManager","stopAutoFocus","gridFocusManager","focusTableIfNeeded","setDirty","dataSourceRow","shouldLockNewRowAtTop","modelInstanceId","isLazyLoading","insertRecord","firstVisibleRowIndex","lifecycle","stopSelectedRowReaction","selectRow","changeMasterRow","startSelectedRowReaction","tableRows","row","getRowById","deleteRowAndSelectNext","lookupMultiEngine","cacheDependencies","lookupCleanerReloaderById","collectedLookupIds","getDependencyLookupIdsByCacheKeys","ds","lookupCacheKey","reloadLookupLabels","lookupListCache","deleteLookup","requestDataAfterSelectionChange","navigateChildren","suppressRefresh","clear","BREAK_RECURSION","getMainMenuItemById","rawMenu","menuUI","recursive","node","attributes","elements","new_ProcessActionResult","dep","getPanelFunc","find","item","getDataViewByModelInstanceId","openNewForm","closeForm","refreshForm","actions","getActionCaption","caption","crudResult","processActionResult2","actionResultList","indexedList","index","sort","DestroyForm","actionResultItem","OpenForm","RefreshData","OpenUrl","Script","menuItem","request","refreshOnReturnType","typeString","isModalDialog","dialogWidth","dialogHeight","changes","isDialog","Function","script","actionScript","message","stackTrace","getSearcher","searcher","refreshWorkQueues","getWorkQueueList","indexWorkQueues","items","IMainMenuItemType","getDataSource","$type_IDataSource","getColumnNamesToLoad","fields","getDataSourceFields","field","filter","getDataStructureEntityId","dataStructureEntityId","getGridId","getDataViewByGridId","gridId","getIsFormScreenDirty","openedScreen","isSleeping","isSleepingDirty","isLoading","getIsSuppressSave","suppressSave","getDialogStack","dialogStack","getIsActiveScreen","map2obj","k","v","cssString2Object","cssString","x","trim","splitPropertyPair","obj","getDataViewLifecycle","navigateAsChild","rows","getBindingChildren","childBindings","cb","childDataView","getEntity","getMasterRowId","bindingRoot","getBindingRoot","selectedRowId","getSelectedRowId","getBindingParents","parentBindings","pb","parentDataView","getBindingParent","bps","getParentRowId","bp","openScreen","FormRefWithSelection","getSessionId","sessionId","getMenuItemId","IOrderByDirection","joinWithAND","filterItems","join","arrayToString","array","valuesToRightHandSide","val1","val2","val1IsArray","val2IsArray","toFilterValueForm","toFilterItem","columnId","dataType","operator","upperLimit","Date","setDate","getDate","Intl","DateTimeFormat","year","month","day","formatToParts","upperLimitString","concat","substitutedOperator","val1Formatted","moment","isMoment","toOrigamServerString","isNaN","getFilterConfiguration","filterConfiguration","getUserFilters","args","activeFilters","excludePropertyId","propertyId","setting","isComplete","filterValue1","filterValue2","filterToFilterItem","getOrderingConfiguration","orderingConfiguration","parseToIOrderByDirection","DESC","ASC","NONE","parseToOrdering","candidateArray","direction","getUserOrdering","defaultOrderings","getDefaultOrderings","userOrderings","ordering","rangeQuery","elementGetterL","elementGetterR","elementCount","start","end","firstGreaterThanNumber","elementGetter","num","element","indexLeft","indexRight","currentIndex","floor","firstGteIndex","lastLessThanNumber","min","lastLteIndex","getDataTable","getGrouper","serverSideGrouper","clientSideGrouper","prototype","remove","indexOf","splice","groupBy","keyGetter","forEach","collection","VisibleRowsMonitor","gridDimensions","scrollState","getRowBottom","getRowTop","rowCount","scrollTop","contentBounds","visibleRowsRange","OpenGroupVisibleRowsMonitor","visibleRowsAll","expandedGroupIndex","topLevelGroups","group","isExpanded","firstIndex","lastIndex","getUserFilterLookups","lookupMap","keys","IIdState","SCROLL_ROW_CHUNK","NullIScrollLoader","rowsContainer","groupFilter","visibleRowsMonitor","InfiniteScrollLoader","$type_InfiniteScrollLoader","debugDisposer","reactionDisposer","lastRequestedStartOffset","lastRequestedEndOffset","requestProcessor","FlowQueueProcessor","prependListeners","appendListeners","appendLines","tailLoadingNeeded","nextEndOffset","getRows","MenuId","SessionFormIdentifier","DataStructureEntityId","Filter","getFilters","FilterLookups","Ordering","RowLimit","MasterRowId","Parameters","RowOffset","ColumnNames","oldDistanceToStart","distanceToStart","appendRecords","isFull","isLastRowLoaded","newDistanceToStart","newTop","scrollTo","listener","prependLines","headLoadingNeeded","nextStartOffset","prependRecords","isFirstRowLoaded","registerResetListener","handleRowContainerReset","updateTotalRowCount","totalRowCount","rowsInLastChunk","lastStartOffset","distanceToEnd","autorun","reaction","enqueue","filters","userFilters","dispose","mainLoopDelayMilliseconds","delayBetweenCallsMilliseconds","flowQueue","stopRequested","delayBetweenCallsMillis","mainLoopDelayMills","timeoutHandle","milliseconds","Promise","resolve","clearTimeout","currentFlow","sleep","FlowBusyMonitor","flowLeft","_inFlow","isWorking","isWorkingDelayed","DataViewLifecycle","$type_IDataViewLifecycle","monitor","disposers","onSelectedRowIdChangeImm","inFlow","rowSelectedReactionsDisabled","isBindingParent","bind","_selectedRowReactionDisposer","changeMasterRowCanceller","fireImmediately","self","equals","comparer","structural","wasRunning","setRecords","selectFirstRow","loadGetData","createCanceller","setMasterRecord","Entity","RowId","clearDataCache","Axios","isCancel","binding","bindingPairs","bindingPair","parentDsField","getFieldByName","parentPropertyId","parentValue","getCellValueByDataSourceField","childDsField","childPropertyId","isRootEntity","isRootGrid","buildDetailFilter","parentRowId","masterRowId","getData","all","isPreloaded","allRows","LookupLoader","collectedQuery","willLoad","loadedItems","waitingRequesters","triggerLoad","throttle","triggerLoadImm","query","existingItem","q","existingIds","Set","LabelIds","add","ensureScheduleLoad","when","loadingDone","loadingError","getLookupLabelsEx","flashColor2htmlColor","flashColor","toString","toUpperCase","padStart","htmlColor2FlashColor","htmlColor","parseInt","RowState","$type_IRowState","suppressWorkingStatus","containers","isSomethingLoading","containersToLoad","reportBusyStatus","container","rowId","isValid","processingSate","every","LOADING","getRowStates","Ids","states","firstLoadingPerformed","ERROR","temporaryContainersValues","has","RowStateContainer","atom","createAtom","requestAnimationFrame","reportObserved","rowStateItem","rowIds","RowStateItem","allowCreate","allowDelete","foregroundColor","columns","column","rs","RowStateColumnItem","dynamicLabel","allowRead","allowUpdate","disabledActions","relations","rowStateContainer","onBecomeUnobservedListeners","onBecomeObservedListeners","getRowStateById","getValue","getRowStateIsDisableAction","actionId","Action","groupId","placement","iconUrl","mode","isDefault","Always","ActiveRecord","selRowId","MultipleCheckboxes","selectedIds","some","Toolbar","ActionParameter","$type_IActionParameter","fieldName","ComponentBindingPair","ComponentBinding","$type_IComponentBinding","parentId","parentEntity","childId","childEntity","childPropertyType","c","parentDataTable","getPropertyById","getCellValue","bindingController","DataSource","identifier","filedNames","DataSourceField","$type_IDataSourceField","AdditionalRowData","$type_IAdditionalRowData","isInfiniteScrollingActive","dataViewAttributes","IsRootGrid","fixRowIdentifier","identifierIndex","ScrollRowContainer","rowIdGetter","$type_ScrollRowContainer","resetListeners","addedRowPositionLocked","chunk","findChunkByRowId","rowOffset","getRowIdxById","rowChunks","flatMap","delete","indexInContainer","rowCounter","indexInChunk","rowChunk","lastChunk","identifierDataIndex","findChunkByRowIndex","insert","RowChunk","rowsIn","isFinal","notifyResetListeners","trySubstitute","resetListener","unshift","filteredChunk","replaceDuplicateRows","newChunk","replaceRows","isInitial","MAX_CHUNKS_TO_HOLD","shallow","idMap","makeIdMap","existingRow","rowIndex","sourceChunk","duplicateRowIndicesInSource","duplicateRow","getRow","indexInThisChunk","getIndex","nonDuplicateRows","includes","shiftIdMapDown","shiftIdMapUp","entry","idx","getDataViewPropertyById","properties","childProperties","ListRowContainer","updateSortAndFilterDebounced","orderings","orderingComboProps","getOrderingProperty","prop","filterComboProps","term","allComboProps","lookupEngine","lookupResolver","resolveList","getAllValuesOfProp","modelId","preloadLookups","filteringFunction","row1","row2","internalRowOrderingFunc","sortedIds","propertyFilterIdToExclude","idToRow","forcedLastRowId","directionMultiplier","orderingFunction","r","shouldLockNewRowPosition","newRowId","getRowId","rowExistsAlready","clearCacheLater","formatCache","formatNumberWithLocale","customNumericFormat","fnGetResult","keyIndex","simpleKeys","nextItem","getOrSetCached","customFormat","CustomNumericFormat","toLocaleString","minimumFractionDigits","maximumFractionDigits","useGrouping","useThousandsSeparator","getCurrentDecimalSeparator","getSeparator","getCurrentGroupSeparator","separatorType","NumberFormat","part","formatNumber","format","fractionFormat","RegExp","test","getFractionFormat","splitByPoint","minDigits","IPanelViewType","DataTable","$type_IDataTable","rowRemovedListeners","stop","identifierProperty","dataIndex","additionalRowData","ard","dirtyFormValues","dirtyValues","getOriginalCellValue","dsField","getFilteredRows","resolveCellText","isLookup","valueItem","resolveValue","getTrueIndexById","isEmptyAndLoading","getFirstRow","getExistingRowIdxById","newRow","getAdditionalRowDataById","getAdditionalRowData","hasRowDirtyValues","isEmpty","createAdditionalData","additionalData","deleteAdditionalRowData","notifyRowRemovedListeners","rowsAddedSinceSave","rowData","oldRow","dataSourceField","getFieldByIndex","clearUnneededAdditionalRowData","substitute","unlockAddedRowPosition","getSelectedRow","getIsDialog","getDataSourceFieldByName","getRowStateMayCauseFlicker","mayCauseFlicker","getTableViewProperties","tableProperties","getIsSelectionCheckboxesShown","showSelectionCheckboxes","getGroupingConfiguration","groupingConfiguration","TableGroupRow","groupLevel","sourceGroup","groupLabel","columnDisplayValue","getLeadingColumnCount","isCheckBoxedTable","orderedGroupingColumnSettings","GridDimensions","getRowCount","getIsSelectionCheckboxes","defaultRowHeight","tableViewProperties","columnWidth","imageProperty","tableViewPropertiesOriginal","columnCount","getColumnRight","dataColumnIndex","displayedColumnIndex","dataColumnIndexToDisplayedIndex","displayedColumnDimensionsCom","right","getRowHeight","rowHeight","columnWidths","groupedColumnIds","tableColumnIds","widths","w","SimpleScrollState","scrollLeft","scrollToFunction","coords","getMainMenuState","sidebarState","mainMenuState","SEARCH_DIALOG_KEY","SearchDialog","input","refInput","scrollDivRef","createRef","resultElementMap","timeout","selectNextResult","scrollToCell","selectPreviousResult","selectedResult","onResultItemClick","searchOnServer","highlightItem","scrollElement","current","selectedElement","selectedElementRectangle","getBoundingClientRect","scrollRectangle","distanceOverTop","scrollBarHeight","clientHeight","distanceUnderBottom","bottom","resultIndices","getSelectedResultIndices","groupIndex","indexInGroup","target","onSearchFieldChange","onKeyDown","topPosiotionProc","inputRow","icon","placeholder","onInputKeyDown","onChange","onInputChange","resultGroups","resultArea","resultsContainer","registerElementRef","ResultGroup","resultGroupRow","onGroupClick","arrow","groupName","selected","description","ResultItem","divRef","resultIemRow","mouseOver","resultIemRowHovered","resultIemRowSelected","onMouseOver","evt","onMouseOut","itemIcon","itemContents","itemTitle","itemTextSeparator","itemText","openSearchWindow","closeDialog","pushDialog","FormFocusManager","autoFocusDisabled","objectMap","focusAbleContainers","lastFocused","focusable","focusAbleObject","focusAbleContainer","FocusAbleObjectContainer","existingContainer","compare","focusAndRemember","disabled","focusNext","isOpen","forceAutoFocus","activeElement","focusNextInternal","callNumber","currentContainerIndex","nextIndex","previousIndex","focusPrevious","tabIndexNullable","fractionIndex","tabIndexFractions","y","compareFraction","fraction","getSelectionMember","selectionMember","getPropertyOrdering","getOrdering","getDataSourceFieldIndexByName","onMainMenuItemClick","getRecordInfo","recordInfo","onSelectedRowChange","onPossibleSelectedRowChange","menuId","onSelectedRowMaybeChanged","wrapInFlowWithHandler","runWithHandler","runInFlowWithHandler","runGeneratorInFlowWithHandler","generator","getConfigurationManager","configurationManager","GridFocusManager","focusTableOnReload","activeEditor","filterInputHasFocus","isFilterControlsDisplayed","tagName","getGridFocusManager","SavedViewState","DataView","_isFormViewActive","_isTableViewActive","orderProperty","activateFormView","activateTableView","defaultPanelView","Table","isHeadless","isMapSupported","disableActionButtons","showAddButton","showDeleteButton","showSelectionCheckboxesSetting","isGridHeightDynamic","orderMember","isDraggingEnabled","dataMember","newRecordView","confirmSelectionChange","defaultActions","formViewUI","formPanelView","lookupLoader","isFirst","dataViewRowCursor","dataViewApi","dataViewData","viewStateStack","infiniteScrollLoader","selectAllCheckboxChecked","isEnabled","isSelected","filteredRows","filteredRowIds","updatedRow","idToSelectNext","getNextExistingRowId","getPrevExistingRowId","deleteRow","setSelectedRowId","removeSelectedRowId","isGrouping","newState","addSelectedRowId","allGroups","getRowIndex","selectedRowIndex","getRowByExistingIdx","PanelHeader","PanelMenu","SelectionDialogAction","bindingParent","isAnyBindingAncestorWorking","getBindingsByChildId","getBindingsByParentId","parentRow","getParentRow","bindingToParent","getBindingToParent","parentDataSourceField","moveSelectedRowDownIndexwise","moveSelectedRowUpIndexwise","positionIndex","selectedRowPosition","nextRow","setDirtyValue","previous","newId","getNextRowId","getPreviousRowId","fieldIndex","produce","draft","idParameter","isSingleRecordEdit","newValue","readOnly","setFormDirtyValue","loadFirstPage","loadLastPage","firstRow","lastRow","getLastRow","previouslySelectedRowExists","focusedDataViewId","scrollToCurrentCell","registerDisposer","rowsCount","reData","rootGroups","level","childGroups","g","childRows","flattenToTableRows","getScrollLoader","isGroupingOff","viewId","visibleColumnIds","activeTableConfiguration","columnConfigurations","columnConfig","isVisible","allTableProperties","Caption","FieldName","Format","formatterPattern","PolymorphRules","controlPropertyId","ControlField","Rules","getPolymorphicRules","getExcelFile","Fields","RowIds","LazyLoadedEntityInput","controlPropertyValue","DropDownColumn","$type_IDropDownColumn","Latinize","compareStrings","localeCompare","prepareForFilter","text","filterConfig","portalSettings","caseSensitive","accentSensitive","getStringFilterConfig","latin_map","prepareAnyForFilter","String","val","latinize","isLatin","FilterConfiguration","implicitFilters","filteringOnOffHandlers","$type_IFilterConfigurationData","applyNewFiltering","applyNewFilteringImm","handler","clearFilters","setFilter","existingIndex","filteringOnOffHandler","ignorePropertyId","isPresentInDetail","implicitFilterPredicate","userFilterPredicate","cellValue","filterVal1","cellText","getOriginalCellText","t1","substr","t0","t2","parseFloat","filterVal2","cellValues","filterValues1","filterVal","implicitFilter","sourceField","filterValue","operatorCode","dis","comboProps","FormPanelView","$type_IFormPanelView","CriticalSection","tokensIn","tokenQueue","fnResolve","fnReject","reject","TriggerablePromise","incTokens","decTokens","dequeue","fn","enterPromise","leave","enterGenerator","IMAGE_TYPE","R","U","processedImageURL","str","search","isEmbedded","charAt","IDropDownType","ScreenPictureCache","atoms","procUrl","img","Image","reportChanged","onload","onerror","atomBecameObserved","DataViewCache","dataMap","cacheKey","makeCacheKey","parentRecordId","rootRecordId","callGetData","ChildEntity","ParentRecordId","RootRecordId","FormScreen","dataUpdateCRS","pictureCache","dynamicTitleSource","openingOrder","showInfoPanel","showWorkflowCancelButton","showWorkflowNextButton","autoRefreshInterval","refreshOnFocus","cacheOnClient","autoSaveOnListRecordChange","requestSaveAfterUpdate","screenUI","autoWorkflowNext","componentBindings","panelConfigurations","position","defaultOrdering","clearAll","splitSource","dataSourceName","columnName","view","dv","toolbarActions","section","dialogActions","conf","isFormField","log","cnt","strrep","roots","FormScreenEnvelope","$type_IFormScreenEnvelope","initUIResult","preloadIsDirty","loadDirtyRow","rootDataViews","rootDataView","dirtyRowResult","selectedRowExists","Lookup","$type_ILookup","dropDownShowUniqueValues","dropDownType","EagerlyLoadedGrid","cached","searchByFirstColumnOnly","dropDownColumns","dropDownParameters","param","parameterName","getProperties","IPropertyColumn","OrderingConfiguration","maybeApplyOrdering","ordIndex","lookup","orderingClone","cloneDeep","curOrd","newOrdering","isEqual","cycleOrdering","mul","res","cmpSign","sign","Property","autoSort","nameOverride","captionLength","captionPosition","Text","dock","multiline","isPassword","isRichText","maxLength","allowReturnToForm","isTree","modelFormatterPattern","gridColumnWidth","isAggregatedColumn","isLookupColumn","toolTip","suppressEmptyColumns","supportsServerSideSorting","fieldType","xmlNode","dataSourceIndex","AggregationType","tryParseAggregationType","parseAggregationType","SUM","AVG","MIN","MAX","COUNT","ValueBox","_value","_active","Memoized","valueFn","_computed","scRenderTable","scRenderRow","scRenderCell","context","context2d","currentRowRightBorderDrawn","setCurrentRowRightBorderDrawn","selectionColumnShown","drawingColumnIndex","viewportWidth","viewportHeight","viewportLeft","viewportTop","worldWidth","gridLeadCellDimensions","worldHeight","tableRowsCount","groupingColumnIds","groupingColumnCount","currentRow","currentDataRow","fixedColumnCount","realFixedColumnCount","propertyById","clickSubscriptions","mouseMoveSubscriptions","mouseOverSubscriptions","recordId","getFieldErrorMessage","dsFieldErrors","errors","errMap","fieldErrors","dsIndexStr","errMsg","getRowStateAllowRead","getRowStateForegroundColor","rowStateForegroundColor","getRowStateRowBgColor","createElement","getContext","CPR","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","shadeHexColor","color","percent","t","p","G","B","round","crs_fieldBlur_ActionClick","onActionClick","runGenerator","onExecuteAction","onWorkflowCloseClick","onRepeatClick","onWorkflowRepeatClick","clearTableDebugValues","tableId","tableDebugMonitor","setTableDebugRendered","ensureTableDataExists","rendered","setTableDebugValue","CellAlignment","isFirstColumn","paddingRight","paddingLeft","alignment","cellPaddingRight","getPaddingLeft","numberCellPaddingRight","cellPaddingLeft","currentDataCellRenderer","ctx2d","currentProperty","cellAlignment","CheckBoxCellRenderer","DateCellRenderer","TagInputCellRenderer","CheckListCellRenderer","GenericCellRenderer","ImageCellRenderer","ColorCellRenderer","fillStyle","currentCellValue","fillRect","currentColumnLeft","currentRowTop","currentColumnWidth","currentRowHeight","currentCellText","font","checkBoxCharacterFontSize","textAlign","textBaseline","fillText","xCenter","topTextOffset","currentColumnId","momentValue","dateTimeText","save","getComputedStyle","documentElement","getPropertyValue","restore","getImage","complete","iw","ih","WR","HR","ratio","finIW","finIH","drawImage","getCustomTextStyle","cellPaddingLeftFirstCell","getPaddingRight","dataColumnsWidths","dataColumnsDraws","applyScrollTranslation","isRowCursor","thisCellRectangle","columnLeft","rowTop","setCellRectangle","firstColumn","isColumnOrderChangeSource","columnOrderChangingSourceId","getBackGroundColor","drawSelectedRowBorder","frontStripWidth","drawDataCellBackground","isInvalid","currentCellErrorMessage","isCurrentCellLoading","leftOffset","topBottomOffset","selectRowBorderWidth","beginPath","moveTo","lineTo","fill","drawInvalidDataSymbol","clipCell","isHidden","fontSize","drawCellText","drawCellValue","cellClickableArea","getCellClickableArea","checkboxClickableArea","getCheckboxClickableArea","h","isDouble","setEditing","defaultAction","firstEnabledDefaultAction","actionsUi","onCellClick","registerClickHandler","cellRenderer","cellWidth","showToolTipsForMemoFieldsOnly","getShowToolTipsForMemoFieldsOnly","cellTextRendered","textWidth","measureText","hasTooltip","currentTooltipText","registerToolTipGetter","currentColumnLeftVisible","currentColumnWidthVisible","setSelectedStateRowId","toggleSelectedId","setSelectedState","selectionCheckboxCellsDraws","drawSelectionCheckboxBackground","checkBoxCellPaddingLeft","newSelectionState","onFlushData","selectionCheckboxEmptyCellsWidths","selectionCheckboxEmptyCellsDraws","parseAggregations","objectArray","object","aggregationToString","aggregation","formattedValue","calcAggregations","aggregationInfos","aggregationInfo","ColumnName","calculateAggregationValue","aggregationCellDraws","isGroupRow","groupRow","aggregations","drawAggregationText","isCurrentGroupRow","onGroupHeaderToggleClick","groupHeader","loadChildren","groupRowEmptyCellsWidths","groupRowEmptyCellsDraws","drawEmptyGroupCell","groupRowContentCellsWidths","grpCnt","groupRowContentCellsDraws","drawGroupCell","strokeStyle","lineWidth","stroke","drawEmptyGroupCellBackground","drawGroupCellBackground","columnLabel","columnValue","shouldCloseOtherGroups","groupsToKeepOpen","allParents","unselectRowIfInClosedGroup","otherGroups","isInfinitelyScrolled","dataRowCellsWidths","dataRowCellsDraws","dataRowColumnIds","isCurrentDataRow","_currentCellLayerIndex","setLayerIndex","layerIndex","currentCellLayerIndex","computeDimensions","cellWidths","leftVisible","widthVisible","fixedColumnWidth","currentRowCellsDimensions","currentRowCellsDraws","currentColumnRight","getPolymophicProperty","stripHtml","currentCellTextMultiline","polymorphicProperty","isCellTextResolving","translate","rect","clip","frontStripeWidth","offset","dataCellOffset","GroupingUnit","groupingUnitToLabel","groupingUnit","Year","Month","Day","Hour","Minute","groupingUnitToString","unit","ColumnsDialog","configuration","sortedColumnConfigs","refGrid","optionA","columnOptions","optionB","setTimeGroupingUnit","columnConfCopy","groupingIndex","reverse","columnConfItem","timeGroupingUnit","selectedAggregation","aggregationType","onOkClick","onSaveAsClick","columnTable","fixedRowCount","renderCell","lockedColumns","lockedColumnsInput","handleFixedColumnsCountChange","columnIndex","canGroup","canAggregate","aggregationOptions","AggregationOption","selectedAggregationOption","option","timeunitOptions","TimeUnitOption","selectedTimeUnitOption","setVisible","checked","checkBox","setGrouping","options","selectedOption","onOptionClick","setAggregation","cellClass","columnTableCell","checkBoxCell","Obsv","Observer","rowClassName","getCellClass","getCell","TableHeader","getHeader","columnWidthHandle","NewConfigurationDialog","inpuContainer","textInput","onNameChanged","onKeydown","notification","getActivePanelView","activePanelView","saveColumnConfigurations","allTableConfigurations","updateColumnWidth","sortColumnConfiguartions","tablePropertyIds","saveObjectConfiguration","sessionFormIdentifier","instanceId","tableConfigurations","defaultView","ColumnConfigurationDialog","tableConfigBeforeChanges","dialogKey","dialogId","groupingOnClient","configManager","optionsMap","columnConfiguration","deepClone","getColumnOptions","columnsConfiguration","onColumnConfCancel","onColumnConfigurationSubmit","onColumnConfSubmit","revertChanges","cloneAndActivate","groupingWasOnBefore","apply","groupingIsOffNow","loadInitialData","onFieldChange","onFieldChangeG","flushFormToTable","getSelectedRowIndex","getSelectedColumnId","selectedColumnId","getSelectedColumnIndex","selectedColumnIndex","flushCurrentRowData","finishEditing","getRowStateAllowUpdate","isReadOnly","ChangeMasterRecordDialog","getSelectedRowErrorMessages","IQuestionDeleteDataAnswer","IQuestionChangeRecordAnswer","processActionQueryInfo","queryInfo","canContinue","severity","questionSaveDataAfterRecordChange","tabTitle","Yes","No","Cancel","handleUserInputOnChangingRow","saveSessionQuery","queryResult","saveSession","saveResult","throwChangesAway","errorMessages","bla","TablePanelView","$type_ITablePanelView","columnConfigurationDialog","filterGroupManager","handleScrolling","AggregationContainer","subId","onScrollToCurrentCellHandlers","onFocusTableHandlers","_currentTooltipText","hiddenPropertyIds","tableCanvas","lastVisibleRowIndex","rowIdx","columnIdx","getCellText","selectedProperty","deleteAdditionalCellData","isControlInteraction","onCellClickInternal","propertyMap","ctrlKey","metaKey","navigateLookupLink","selectCell","isEditing","selectCellAsync","runRecordChangedReaction","_this","selPropId","nextRowWhenEnd","newProp","setSelectedColumnId","selectNextRow","selectFirstColumn","prevRowWhenStart","selectPrevRow","selectLastColumn","idx1","idx2","tmp","idSource","idTarget","columnOrderChangingTargetId","myId","triggerOnScrollToCellShortest","cellOffset","getCellOffset","rectangleMap","rectangle","aggregationTypes","currentIdent","getIdent","ContribArray","$iid","iterator","xmlObj","pred","n","findStopping","assignIIds","xmlTree","GroupingConfiguration","onOffHandlers","groupingSettings","nextEntry","wasEmpty","notifyOnOffHandlers","ClientSideGroupItem","expansionListener","grouper","groupFilters","_isExpanded","allChildGroups","getAllParents","_childRows","ServerSideGroupItem","scrollLoader","composeGroupingFilter","registerAppendListener","registerPrependListener","momentValueStart","momentValueEnd","hour","minute","groupNode","notifyGroupClosed","parents","childGroup","containingGroup","g1","g2","child","previousRow","previousGroup","currentGroup","sameLevelGroups","currentGroupIndex","getPreviousNonEmptyGroup","nextGroup","getNextNonEmptyGroup","ILifetime","GenericGroupData","_label","other","DateGroupData","ServerSideGrouper","groupDisposers","loadGroupsDebounced","loadGroupsImm","loadChildrenReactionDebounced","loadChildrenReaction","refreshTrigger","delay","loadGroups","firstGroupingColumn","expandedGroupDisplayValues","aggregationList","groupData","loadAndExpandChildren","nextColumnToGroupBy","composeFinalFilter","groupChildrenOrdering","reload","nextColumnSettings","lifeCycle","loadChildGroups","loadChildRows","rowGroup","groupingFilter","groupDataItem","getGroupData","yearValue","monthValue","dayValue","hourValue","minuteValue","M","d","m","s","create","disposer","ClientSideGrouper","groups","makeGroups","loadRecursively","loadChildrenInternal","groupingColumnSettings","orderingDirection","groupToGroupDataList","findDataIndex","groupMap","calcAggregation","valuesToAggregate","nextColumnName","Registration","regCreator","regCreatorEx","regClass","typeSymbol","instancePerDependency","instancePerLifetimeScope","instancePerNamedLifetimeScope","instancePerSwitchedLifetimeScope","singleInstance","onPreparing","onActivating","onActivated","onRelease","Registrator","registration","nameOrSwitchingFunction","Container","registrations","instances","transientInstances","disposeEvents","WeakMap","scopeName","isDisposed","scheduledOnActivated","_onThisScopeDisposed","_onThisScopeWillDispose","sym","creator","creatorEx","creatorArgs","checkDisposed","pushCurrentContainer","findAllRegistrations","resolveByRegistration","popCurrentContainer","findRegistration","symName","providePerDependency","provideSingle","providePerLifetimeScope","providePerSwitchedLifetimeScope","providePerNamedLifetimeScope","defaultLifetime","PerDependency","PerLifetimeScope","Single","instance","registerScope","pushCreator","_creatorStack","_creatorStackTop","newFromRegistration","replaceInstance","newInstance","getBottomContainer","findRootContainer","provideFromContainer","findFirstNamedContainer","detached","triggerOnThisScopeWillDispose","disposeEvent","triggerOnThisScopeDisposed","disposeWithChildren","findFirstContainer","_currentContainerStack","_currentContainerStackTop","getTopContainer","currentContainer","resolveFlowFinished","TypeSymbol","enumerationCacheKey","_registeredScopes","scopeFor","DataViewBodyUI","contrib","asArray","render","IDataViewBodyUI","DataViewToolbarUI","IDataViewToolbarUI","SectionViewSwitchers","IDataView","DroppedBox","elmDropdown","refDropdown","dropdownRef","isStillMounted","handleMaybeClose","contains","onOutsideInteraction","onCloseRequest","clientWidth","innerWidth","innerHeight","tBounds","triggerRect","dBounds","dropdownRect","openEvent","clientX","clientY","calcPosition","ReactDOM","createPortal","droppedBox","getElementById","Dropdowner","refMeasTrigger","elmMeasTrigger","refMeasDropdown","elmMeasDropdown","_isDropped","persist","isDropped","reMeasure","onDroppedDown","onDroppedUp","setDropped","measure","mRefTrigger","cRectTrigger","mRefDropdown","cRectDropdown","dropdownerContainer","onContainerMouseDown","trigger","refTrigger","DataViewHeader","inner","DataViewHeaderButton","enabled","hidden","DataViewHeaderButtonGroup","DataViewHeaderDropDownItem","DataViewHeaderGroup","noDivider","grovable","noShrink","Dropdown","DropdownItem","isDisabled","SaveFilterDialog","filterName","isGlobal","chcekBoxinput","onIsGlobalClicked","FilterDropDown","filterManager","filterGroup","setFilterGroup","saveActiveFiltersAsNewFilterGroup","filterGroups","DataViewHeaderAction","refDom","filtersHidden","clearFiltersAndClose","noFilterActive","setSelectedFilterGroupAsDefault","defaultFilter","resetDefaultFilterGroup","onSaveFilterClick","selectedFilterGroup","isSelectedFilterGroupDefault","deleteFilterGroup","cancelSelectedFilter","onDropItemClick","getColumnConfigurationDialog","shouldProceedToChangeRow","scrollToCurrentRow","getIsEnabledAction","ViewConfiguration","saveConfiguration","getActivePerspectiveTag","tag","IViewConfiguration","getActivePerspective","$cont","viewConfiguration","activePerspective","getIsAddButtonVisible","relationRowState","relation","getRelationRowState","selectLastRow","DropdownDivider","isAddRecordShortcut","shiftKey","isDeleteRecordShortcut","isDuplicateRecordShortcut","isFilterRecordShortcut","CDataViewHeaderInner","hiddenActionIds","allActions","shouldBeShown","allMenuActions","relevantMenuActions","setMenuDropped","uiActions","relevantActions","renderAction","actionsToRender","childActions","otherAction","trueSelectedRowIndex","count","getTotalRowCount","groupRowCount","getExpandedGroupRowCount","hasSomeRelevantActions","panelViewActions","panelMenuActions","activeConfigName","getDataViewLabel","isFilterSettingsVisible","onColumnConfigurationClickEvt","onColumnConfigurationClick","onColumnConfClick","onExportToExcelClickEvt","onExportToExcelClick","exportToExcel","onDeleteRowClickEvt","onDeleteRowClick","onDeleteRow","onCreateRowClickEvt","onCreateRowClick","onCreateRow","onMoveRowUpClickEvt","onMoveRowUpClick","moveSelectedRowUp","isRowMovingDisabled","getIsRowMovingDisabled","onMoveRowDownClickEvt","onMoveRowDownClick","moveSelectedRowDown","onCopyRowClickEvt","onCopyRowClick","onCopyRow","onFilterButtonClickEvt","onFilterButtonClick","onFilterDisplayClick","onFirstRowClickEvt","onPrevRowClick","onFirstRowClick","onPrevRowClickEvt","onNextRowClickEvt","onNextRowClick","onLastRowClickEvt","onLastRowClick","isMoveRowMenuVisible","currentRowId","getIsMoveRowMenuVisible","isAddButton","isDelButton","getIsDelButtonVisible","isCopyButton","getIsCopyButtonVisible","crudButtonsEnabled","getAreCrudButtonsEnabled","uiToolbar","goToFirstRowDisabled","goToLastRowDisabled","customTableConfigsExist","customTableConfigurations","isBreak640","isBarVisible","isActionsOnly","extension","renderActions","onShortcut","shortcutPredicate","renderRowCount","renderSection","onRecordInfoClick","onOpenRecordInfoClick","defaultTableConfiguration","saveTableConfigurations","tableConfig","deleteActiveTableConfiguration","renderMenuActions","contextType","MobXProviderContext","CDataViewHeader","useContext","CtxDataViewHeaderExtension","getIsDataViewWorking","getIsFormScreenWorkingDelayed","getDataViewById","DataViewLoading","TreeDataTable","idProperty","parentIdProperty","$type_TreeDataTable","sortTreeRows","getChildren","getParentId","compareLabels","getLabel","TreeView","nodes","Node","expansionGetter","expanded","otherNode","treeView","onRowClick","onCaretClick","_parent","isFolder","countParents","parentCount","Row","stopPropagation","nodeSelected","handleRowClick","nodeLabel","getIndent","noSelect","expander","handleCaretClick","PubSub","subscribers","subscriber","arg","DataViewHeaderExtension","iid","createContext","DataViewInner","inject","dataViewHeaderExtension","flexGrow","minHeight","minWidth","flexShrink","uiBody","overlayContainer","dataViewContentContainer","Provider","getDataViewStyle","renderUiBodyWithHeader","DataViewContext","tableKeyDownChannel","subscribe","CtxDataView","useState","DataViewHeaderActionInner","_disposer","dataViewContext","subscribeTableKeyDownHandler","handleTriggerAreaKeyDown","kbdHandlerUp","prevProps","kbdHandlerDown","handleMouseDown","handleClick","IMapObjectType","Perspective","deactivate","activateDefault","IPerspective","MapPerspective","perspective","anounceActivePerspective","IMapPerspective","MapObjectsStore","mapSetupStore","mapSearchStore","mapNavigationStore","setup","mapLocationMember","mapTextMember","mapIconMember","mapAzimuthMember","mapColorMember","fldIdentifier","isReadOnlyView","fldLocationIndex","objectGeoJson","wktParse","fldNameIndex","fldIconIndex","fldColorIndex","azimuth","fldIconAzimuth","geoJson","wktStringify","selectSearchResultById","navigationStore","highlightSelectedSearchResult","L","Default","_getIconUrl","mergeOptions","iconRetinaUrl","require","shadowUrl","MAP_ANIMATE_SETTING","animate","duration","getOptionsEPSG","crs","CRS","EPSG4326","MapPerspectiveCom","elmMapDiv","refMapDiv","leafletMap","leafletMapObjects","FeatureGroup","leafletMapRoute","editingObjectsRepaintDisabled","_disposers","_isCancelAction","mapControl","mapControlDisposers","mapFittedToLayers","lmap","_isMounted","mapCenter","panTo","coordinates","loc","mapDrawnObjectLayers","lLayer","lastDetailedObject","panToLayer","getBounds","fitBounds","pad","getLatLng","latLng","isPropActiveDifferent","mountLeaflet","isPropMapCenterDifferent","panToCenter","setStyle","setIcon","divIcon","getIcon","highlightLayer","unHighlightLayer","mapLayers","rawLayer","tileLayer","getUrl","getOptions","zIndex","wms","layer","fromEntries","layerList","getTitle","getMapObjects","POINT","pq","qs","parse","iconAnchor","anchor","JSON","iconRotation","myIcon","html","marker","bindTooltip","POLYGON","polygon","LINESTRING","polyline","getRoutefinderRoute","getRoutefinderEditables","dashArray","opacity","weight","clearLayers","addLayer","geoJSON","toGeoJSON","geometry","getCounterClockWisePolygonPoints","polygonGeometry","area","layers","features","routefinderUpdate","getLayers","lng","lat","onRoutefinderGeometryChange","onRoutefinderGeometryEditStart","handleRoutefinderEditStart","onRoutefinderGeometryEditCancel","onRoutefinderGeometryEditSave","handleRoutefinderEditStop","edit","_toolbars","oldEditDisable","disable","arguments","draw","oldDrawDisable","activateNormalControls","addControl","Control","Draw","featureGroup","poly","allowIntersection","circle","circlemarker","point","setMapControlCancelHack","on","Event","CREATED","handleRoutefinderOjectCreated","EDITED","handleRoutefinderObjectEdited","DELETED","handleRoutefinderObjectDeleted","DRAWVERTEX","handleRoutefinderVertexDrawn","EDITVERTEX","handleRoutefinderVertexEdited","EDITSTART","EDITSTOP","DRAWSTART","handleRoutefinderDrawStart","DRAWSTOP","handleRoutefinderDrawStop","off","removeControl","showArea","handleOjectCreated","handleObjectEdited","handleObjectDeleted","defaultEnabled","setZoom","initialZoom","control","leafletlayersDescriptor","collapsed","addTo","scale","allLayerBounds","latLngBounds","extend","onLayerClick","getCenter","highlightSelectedLayer","panToFirstObject","mapRoutefinderRoute","mapRoutefinderEditables","initLeaflet","initLeafletDrawControls","invalidateSize","mapDiv","MapNavigationStore","refMapComponent","elmMapComponent","panToSelectedObject","activateRoutingControls","setupStore","searchStore","selectedSearchResult","MapRoutefinderStore","mapObjectsStore","routeLatLngs","driveThruPoints","navigation","coord","driveThruPointsEditing","objects","handleGeometryChange","mapObjectsRoute","calculateRoute","gjsCoords","smapCoords","ll","SMap","Coords","fromWGS84","Route","route","getResults","handleResultsError","handleResultsReceived","SearchStore","refSearchField","elmSearchField","mapObjects","searchPhrase","allMapObjects","toLocaleLowerCase","measureSearchField","handleWindowMouseDown","dropDown","select","fitToSelectedSearchResult","dropUp","resultId","MapLayer","mapLayerParameters","rawOptions","minZoom","maxZoom","MapSetupStore","rootStore","mapResolutionRaw","textColorMember","textLocationMember","textRotationMember","mapCenterRaw","zoom","MapRootStore","mapRoutefinderStore","CtxMapRootStore","MapPerspectiveSearch","mapSearch","searchInputValue","handleSearchInputChange","handleSearchInputKeyDown","onFocus","handleSearchInputFocus","handleClearClick","handleClearMouseDown","handleCaretMouseDown","MapPerspectiveSearchDropdown","dropdownTop","dropdownLeft","dropdownWidth","mapSearchDropdown","SearchResults","searchResults","searchResult","c1","c2","handleSearchResultClick","searchWords","textToHighlight","MapPerspectiveDirector","dataViewToolbarUI","dataViewBodyUI","mapPerspective","toolbarActionsExtension","ToolbarActionsExtension","put","MapContentUI","handleToolbarBtnClick","del","teardown","IMapPerspectiveDirector","MapPerspectiveComContainer","toolbarExtension","useEffect","getRootStore","MapPerspectiveNavigation","mapZoom","mapObjectsEditable","handleEditingStarted","handleEditingFinished","handleEditingCancelled","handleLayerClick","handleMapMounted","mapToolbarButton","handleCenterMapClick","handleLookupObjectClick","SCOPE_MapPerspective","FormPerspective","saveNewState","Form","IFormPerspective","FormView","formView","formViewForm","onSubmit","FormRoot","elmFormRoot","refFormRoot","handleWindowClick","formRoot","splitToLines","BlobEditor","changeManyFields","fieldId","elmInput","imageObjectUrl","subscribeToFocusManager","fileList","files","upload","getDownloadToken","FileName","isPreview","token","getBlob","downloadToken","progressValue","speedValue","isUploading","file","getUploadToken","DateCreated","DateLastModified","lastTime","lastSize","putBlob","uploadToken","fileName","loaded","total","timeStamp","changeSet","editorContainer","renderInput","invalidMessage","focused","blobEditor","focusedBorder","standardBorder","onBlur","onEditorBlur","download","multiple","handleFileChange","toFixed","CheckListControler","lookupList","llitem","getLookupList","Identifier","Id","ShowUniqueValues","SearchText","PageSize","PageNumber","CheckList","CheckListRaw","isReadonly","controller","loadLookupList","inputRefs","focusLeft","inputsOnTheLeft","hasYEqualTo","isOnTheLeftOf","i1","i2","focusRight","inputsOnTheRight","isOnTheRightOf","focusUp","inputsAbove","hasXEqualTo","isAbove","focusDown","inputsBelow","isBelow","inputSetter","inputRef","CheckListItem","isFocused","setIsFocused","useRef","InputReference","boundingRect","click","onMouseUp","focusedLabel","unFocusedLabel","ImageEditor","preparedUrl","image","NumberEditor","formatForDisplay","cursorPosition","rawValue","replaceAll","customNumberFormat","Number","updateTextOverflowState","setState","handleBlur","textOverflow","offsetWidth","scrollWidth","onTextOverflowChanged","formatForOnChange","cleanChars","invalidCharactersBeforeCursor","char","isValidCharacter","selectionStart","cleanValue","getValidCharacters","isValidNumber","selectionEnd","customStyle","getStyle","autoComplete","handleChange","handleKeyDown","onDoubleClick","handleFocus","bodyCellClass","withCursor","CtxCell","visibleRowIndex","visibleColumnIndex","BooleanCellDriver","behavior","getRowIdentifierByIndex","chosenRowId","cursorRowId","cell","handleTableCellClicked","formattedText","DefaultHeaderCellDriver","NumberCellDriver","TextCellDriver","LazilyLoadedGrid","DropdownEditorApi","rowCursor","searchTerm","dropdownType","columnNames","selectedId","showUniqueValues","pageSize","willLoadPage","DropdownEditorBehavior","cache","dontClearScrollToRow","willLoadNextPage","handleInputChangeDeb","handleInputChangeImm","runningPromise","_refInputDisposer","refInputElement","elmInputElement","refDropdownBody","elmDropdownBody","userEnteredValue","ensureRequestCancelled","clearData","scrollToRowIndex","setFilterPhrase","hasCachedListRows","setData","getCachedListRows","ensureRequestRunning","scrollToChosenRowIfPossible","makeFocused","getRowIndexById","chooseNewValue","wasDropped","prevRowId","getRowIdBeforeId","trySelectFirstRow","selectChosenRow","scrollToCursoredRowIfNeeded","nextRowId","getRowIdAfterId","scrollHeight","runGetLookupList","cancel","inputValue","compareLookUpItems","setCachedListRows","appendData","clean","item1","item2","decorate","dummyCanvas","getTextWidth","getCssStyle","getCanvasFontSize","el","body","fontWeight","fontFamily","DropdownEditorBody","refCtxBody","CtxDropdownRefBody","beh","CtxDropdownEditor","useMemo","drivers","columnDrivers","editorDataTable","rectCtrl","CtxDropdownCtrlRect","handleBodyMouseDown","DropdownEditorTable","refMultiGrid","hasHeader","hoveredRowIndex","cellPadding","maxHeight","driverCount","scrollbarSize","horiz","horizontal","vert","vertical","Prov","isHoveredRow","getDriver","bodyCellDriver","headerCellDriver","columnWidthSum","currentCellWidth","columnGrowFactor","scrollToRow","scrollToAlignment","onScrollbarPresenceChange","handleScrollbarPresenceChange","classNameTopRightGrid","table","classNameBottomRightGrid","renderTableCell","onScroll","handleScroll","DropdownEditorInput","editorData","isResolving","handleInputChange","handleInputKeyDown","handleInputFocus","handleInputBlur","autoCorrect","autoCapitalize","spellCheck","TriggerContextMenu","handleRefreshClick","TriggerContextMenuState","behaviour","handleScreenMouseDown","clearCache","DropdownEditorControl","CtxDropdownRefCtrl","triggerContextMenu","handleControlMouseDown","handleInputBtnClick","onContextMenu","handleTriggerContextMenu","DropdownEditorData","idsInEditor","getIsCellTextLoading","setNewValue","DropdownEditorLookupListCache","setLookupList","hasLookupList","DropdownDataTable","dropdownEditorData","Index","filterPhrase","rowsBeforeRedundancyFilter","getRowIdentifier","visibleColumnNames","outer","columnNameToIndex","dataRowIndex","getRowByIndex","getRowAfterId","getRowBeforeId","phrase","DropdownColumnDrivers","driversFilter","driver","allDrivers","IndexItem","phraseLower","matches","textInLower","phraseInLower","TagInputEditorData","newArray","DateCellDriver","replaceDefaultDateFormats","formatFromServer","getMomentFormat","propertyXmlNode","nodeAttributes","csFormat","FormatterPattern","momentFormat","csToMomentFormat","Name","ModelInstanceId","DropdownEditorSetup","DropdownEditor","isBodyDisplayed","onDropupRequest","renderCtrl","editor","renderDropdown","minSideMargin","XmlBuildDropdownEditor","mobxContext","dropdownEditorApi","dropdownEditorSetup","dropdownEditorBehavior","tagEditor","dropdownEditorDataTable","dropdownEditorLookupListCache","rat","DropDownShowUniqueValues","DropDownType","Cached","SearchByFirstColumnOnly","SuppressEmptyColumns","columnIdsWithNoData","propertyXml","Column","pat","ParameterName","dropdownEditorInfrastructure","TagInput","tagInputContainer","TagInputAdd","tagInputAdd","TagInputItemDelete","tagInputItemDelete","TagInputItem","tagInputItem","TagInputEditor","textualValues","removeItem","removedItem","setValue","inputElement","setInputElement","previousValueRef","tagInput","filterInput","customInputClass","TextEditor","currentValue","lastAutoUpdatedValue","updateInterval","isMultiline","startAutoUpdate","setInterval","onAutoUpdate","renderValueTag","wrapText","isMultiLine","scrollY","noScrollY","dangerouslySetInnerHTML","__html","RichTextEditor","getMultilineDivClass","multiLine","EditorState","createEmpty","internalEditorState","setInternalEditorState","internalEditorStateHtml","setInternalEditorStateHtml","onEditorStateChange","useCallback","newEditorState","draftToHtml","convertToRaw","getCurrentContent","querySelector","blocksFromHtml","htmlToDraft","contentBlocks","entityMap","contentState","ContentState","createFromBlockArray","editorState","createWithContent","overflow","wrapperClassName","editorClassName","onFieldBlur","focusEditor","BoolEditor","forceTakeFocus","readOnlyNoGrey","DateCompleter","dateSequence","expectedFormat","dateSeparator","timeSeparator","dateTimeSeparator","timeNowFunc","expectedDateFormat","datetimeTextIn","trimmedText","isUSCompletionTriggered","isEUCompletionTriggered","dateAndTime","dateText","completeDate","autoCompleteDate","timeText","completeTime","autoCompleteTime","completeDateTime","dateTime","second","incompleteTime","completeTimeWithSeparators","completeTimeWithoutSeparators","substring","splitTime","incompleteDate","completeDateWithSeparators","completeDateWithoutSeparators","addMonthAndYear","addYear","addSeparators","now","usDateString","date","dayAndMonth","getDoubleDayAndMonthFormat","secondIndex","lastIndexOf","dateLength","CalendarWidget","displayedMonth","startOf","days","calendarWidgetDayHeaderCell","toISOString","weekInc","today","isNeighbourMonth","isSelectedDay","isSame","selectedDay","isToday","dayCopy","calendarWidgetCell","calendarWidgetNeighbourMonthCell","calendarWidgetSelectedDay","handleDayClick","weeks","calendarWidgetRow","getDates","subtract","months","years","onDayClick","calendarWidgetContainer","calendarWidgetDayTable","calendarWidgetHeader","calendarWidgetMonthControls","calendarWidgetControlBtn","handleMonthDecClick","handleMonthIncClick","calendarWidgetTitle","calendarWidgetYearControls","handleYearDecClick","handleYearIncClick","getDayHeaders","getDateRows","initialDisplayDate","DateTimeEditor","refDropdowner","elmDropdowner","_hLocationInterval","refContainer","elmContainer","makeDroppedDown","isDroppedDown","makeDroppedUp","makeFocusedIfNeeded","dirtyTextualValue","setShowFormatHint","isShowFormatHintTooltip","measureInputElement","handleWindowMouseWheel","clearInterval","completedMoment","getDateCompleter","autoCompletedMoment","formatMomentValue","formatData","outputFormat","inputRect","formattedMomentValue","textfieldValue","onChangeByCalendar","handleContainerMouseDown","FormatHintTooltip","line1","autocompletedText","line2","outputFormatToShow","handleTextfieldChange","dropdownSymbol","droppedPanelContainer","customFormatContainsDate","renderWithCalendarWidget","renderInputFieldOnly","tooltipHeight","setTooltipHeight","formatHintTooltip","ColorEditor","refDroppedPanelContainer","elmDroppedPanelContainer","machine","interpret","createMachine","UI","initial","CLOSED_INACTIVE","DROPDOWN_SYMBOL_MOUSE_DOWN","PICKER_DROPPED_DOWN","INPUT_FIELD_FOCUS","CLOSED_ACTIVE","INPUT_FIELD_BLUR","INPUT_FIELD_KEY_DOWN","cond","OPEN","PICKER_KEY_DOWN","PICKER_OUTSIDE_INTERACTION","PICKER_DROPPED_UP","after","applyPickedValue","commitAppliedValue","revertAppliedValue","pickValueFromApplied","setDroppedDown","setDroppedUp","focusPickerContainer","focusInputField","signalComponentBlur","guards","eventKeyIsEnter","payload","eventKeyIsEscape","onTransition","changed","machineState","colorResult","pickedColor","hex","appliedValue","send","colorDiv","colorRect","handleColorChange","disableAlpha","ICaptionPosition","FormViewEditor","focusManager","resolveNumericCellAlignment","makeOnKeyDownCallBack","textEditor","valueObj","updateData","Values","updateObject","onTextFieldAutoUpdate","onDropdownEditorClick","firstCheckInput","canUpload","inputEditor","DomEvent","getEditor","FormField","ovrCaption","getRowStateDynamicLabel","Left","captionColor","Right","isCheckbox","Top","display","Fill","finalToolTip","equalLengthLines","formatToolTipLinesPlaintext","line","formatTooltipPlaintext","None","hideCaption","captionStyle","getToolTip","formFieldStyle","textualValue","FormSectionHeader","foreGroundColor","FormSection","hasTitle","FormLabel","RadioButton","inputId","uuidv4","onSelected","htmlFor","labelColor","CheckBox","CtxPanelVisibility","FormBuilder","xmlFormRootObject","notifyClick","setLastFocused","form","xfo","Type","Width","Height","X","Y","Title","Value","radioInput","TabIndex","updateRadioButtonValue","findStrings","buildForm","FormPerspectiveDirector","formPerspective","IFormPerspectiveDirector","SCOPE_FormPerspective","TablePerspective","onTablePerspectiveShown","ITablePerspective","selectPrevColumn","selectNextColumn","onColumnHeaderClick","addOrdering","setOrdering","FilterSettingsComboBox","measureThrottled","measureImm","refMeasure","elmMeasure","handleWindowScroll","refTriggerMeasure","triggerContentRect","handleTriggerClick","dropdown","handleDropdownClick","FilterSettingsComboBoxItem","dropdownItem","Checkbox","onClickCapture","indeterminate","FilterSetting","Operator","numberValue","captionGetter","_caption","operators","operatorNumber","between","greaterThan","lessThan","greaterThanOrEquals","lessThanOrEquals","notEquals","notBetween","notStartsWith","notEndsWith","notContains","isNull","isNotNull","in","notIn","filterMapComboBox","filterMap","filterTypeToNumber","filterType","typeNumber","filterTypeFromNumber","filterOperatorNum","columnType","stringValue","OPERATORS","FilterSettingsBoolean","handleValueClick","OpCombo","op","OpEditors","inputTag","onCurrentValueChanged","FilterSettingsString","timeOutId","handleFilterTypeChange","dateFormatCs","dateFormatMoment","isoDay","removeTimeZone","FilterSettingsDate","newSetting","handleSettingChange","isoDateString","removeInvalidCharacters","onCurrentValue1Changed","separator","invalidChars","allowDecimalSeparator","clearedValue","firstSeparatorIndex","lastSeparatorIndex","currentValue1","currentValue2","onCurrentValue2Changed","FilterSettingsNumber","LOOKUP_TYPE_OPERATORS","enableLookupTypeFilters","oldOperator","newOperator","lookupOperatorTypes","operatorGroupChanges","FilterBuildDropdownEditor","handleSelectedItemsChange","handleTermChange","FilterSettingsLookup","LookupFilterSetting","_lookupId","DropDownApi","FilterEditorData","valueToRemove","getAllLookupIds","getFilterListValues","listValues","listValue","FilterSettingsTagInput","TagInputFilterSetting","FilterSettings","getSettings","defaultValue","getSettingByPropertyId","getFilterSettingByProperty","onApplyFilterSetting","onFilterValueChange","defaultSettings","allLookupIds","Header","width0","mouseX0","mouseY0","width1","handleWindowMouseMoveForColumnWidthChange","handleWindowMouseUpForColumnWidthChange","shVecX","onColumnWidthChange","onColumnWidthChangeFinished","headerDividerWidth","isLast","maxWidth","isFixed","renderHeader","draggableId","provided","innerRef","draggableProps","dragHandleProps","header","makeHeaderStyle","inHeaderRow","orderingOrder","additionalHeaderContent","additionalContentsRow","handleHeaderWidthHandleMouseDown","rightSeparator","middleSeparator","Canvas","ctxCanvas","refCanvasElement","ceil","canvasWidthPX","canvasHeightPX","canvasWidthCSS","canvasHeightCSS","canvas","canvasProps","refCanvas","HeaderRow","headerRow","headerElements","PositionedField","worldBounds","cellRectangle","scrollOffsetSource","positionedField","onMouseEnter","fixedColumnsCount","Scrollee","scrollee","scrolleeShifted","fixedVert","offsetTop","fixedHoriz","offsetLeft","Scroller","lastScrollLeft","lastScrollTop","clickHandler","SequentialSingleDoubleClickHandler","runOnclick","lastMouseX","lastMouseY","elmScrollerDiv","forceScrollLeft","scrollingDisabled","offsetHeight","scrollerRect","onMouseMove","distanceSinceLastMove","sqrt","boundingRectangle","onMouseLeave","onOutsideClick","scroller","handleMouseMove","handleMouseLeave","refScrollerDiv","fakeContent","contentWidth","horizontalScrollbarSize","contentHeight","verticalScrollbarSize","timer","singleClickIsRunning","firstEvent","doubleClickDelayMillis","ms","singleClick","event1","event2","doubleClick","lastDrawableRowIndex","lastDrawableColumnIndex","dimensions","wpRight","renderTable","aCtx","aCtx2d","aTableRows","aGroupedColumnIds","aTableColumnIds","aPropertyById","aScrollLeft","aScrollTop","aViewportWidth","aViewportHeight","aIsCheckBoxedTable","aGridLeadCellDimensions","aColumnWidths","aFixedColumnCount","aClickSubscriptions","aMouseMoveSubscriptions","aMouseOverSubscriptions","aRowHeight","i0","renderRow","renderRowInternal","fixColC","firstDrCI","wpLeft","firstDrawableColumnIndex","lastDrCI","onColumnOrderChangeFinished","swapColumns","onColumnOrderChanged","createTableRenderer","groupedColumnSettings","scrollTopObs","box","scrollLeftObs","viewportWidthObs","viewportHeightObs","drawTable","settings","setScroll","domRect","handlingResult","canvasX","canvasY","handled","handleTableClick","handleTableMouseMove","setViewportSize","getToolTipContent","toolTipGetter","getTooltip","ctxPanelVisibility","refTable","RawTable","tableRenderer","_contentBounds","domNode","findDOMNode","elmScroller","onOutsideTableClick","elmCanvasFixed","elmCanvasMoving","refCanvasMovingComponent","elmCanvasElement","scheduler","listenForScrollToCell","colIdx","scrollToCellShortest","remeasureCellArea","getColumnLeft","fixedColumnsWidth","fixedHeaderContainers","headerContainers","freeHeaderContainers","toolTipData","mouseInToolTipEnabledArea","onContentBoundsChanged","handleTableScroll","setScrollOffset","destination","destinationHeaderIndex","source","editorCellRectangle","editingRowIndex","editingColumnIndex","getCellRectangle","loadingOverlay","loadingIcon","headers","hasFixedColumns","fixedHeaders","onDragEnd","onColumnDragEnd","droppableId","droppableProps","freeHeaders","cellAreaContainer","canvasRow","isEditorMounted","onMouseLeaveToolTipEnabledArea","renderEditor","refScroller","handleScrollerClick","handleScrollerMouseMove","TableViewEditor","actualProperty","onEditorKeyDown","onFieldKeyDown","tabEvent","isFirstColumnSelected","isLastColumnSelected","dontHandleNextScroll","clearCurrentCellEditData","customBackgroundColor","isFirsColumn","resolveCellAlignment","onNoCellClick","updateRowStates","loadValues","SelectionCheckBoxHeader","selectionState","isChecked","TableViewInner","onColumnDialogCancel","onColumnDialogOk","onTableKeyDown","refTableDisposer","elmTable","d1","subOnFocusTable","focusTable","d2","subOnScrollToCellShortest","headerRenderer","HeaderRenderer","getFixedColumnCount","getColumnHeaders","setColumnWidth","onColumnWidthChanged","onColumnOrderChange","onColumnOrderAttendantsChange","initializeNewScrollLoader","registerGroupingOnOffHandler","isMainDataView","setColumnOrderChangeAttendants","handleTableKeyDown","isSelectionCheckboxes","setTableCanvas","TableView","columnOrderChangeSourceId","columnOrderChangeTargetId","isColumnOrderChanging","targetId","columnDimensions","leadingColumnCount","selectionCheckBoxesShown","dataColumnCount","HeaderContainer","renderSelectionCheckBoxHeader","columnsToFix","renderDummyHeader","renderDataHeader","columnHeaders","makeAdditionalHeaderContent","filterControlsDisplayed","aggregationData","headerContent","filterRow","agg","aggregationRow","TablePerspectiveDirector","tablePerspective","ITablePerspectiveDirector","SCOPE_TablePerspective","SCOPE_DataView","register","registerClass","scopedInstance","FormPerspectiveModule","MapPerspectiveModule","TablePerspectiveModule","Clock","getTime","handle","IClock","LookupApi","requestRaw","v1","resultRaw","lookupResolved","labelId","labelValue","LookupCacheDependencies","heldLookupIds","newDeps","newDep","inputLookupIds","cacheKeys","collectedIds","ids","LookupCacheIndividual","getLookupLabels","labels","addLookupLabels","LookupCacheMulti","clock","cleanerReloader","recordBirthdate","handleOutdatingTimerTick","getTimeMs","idsToClean","indivLabels","LookupLabelsCleanerReloader","resolver","cleanAndReload","idGen","handlers","LookupLoaderIndividual","loader","resultListeners","setInterrest","resetInterrest","labelIds","loadList","LookupLoaderMulti","interrests","loading","loadingAtom","triggerLoadDeb","l1k","l1v","l2k","lookupInterrests","LookupResolver","resolved","globalAtom","keysToDelete","isString","cachedLabels","handleAtomObserved","handleAtomUnobserved","missingKeys","cachedResultMap","loadedResultMap","entryArray","innerLoadedMap","createIndividualLookupEngine","multiLookupEngine","lookupCacheMulti","lookupLoaderMulti","lookupCacheIndividual","lookupLoaderIndividual","lookupCleanerReloader","handleResultingLabels","startup","ScreenEvents","focusField","IScreenEvents","SCOPE_FormScreen","SCOPE_Screen","FormScreenModule","$root","PerspectiveModule","DataViewModule","ScreenModule","IAuditLogColumnIndices","DataViewAPI","IRowCursor","RowCursor","DataViewData","ScreenAPI","OrigamAPI","errorHandler","onApiResponse","axiosInstance","urlPrefix","chatroomsUrlPrefix","accessToken","createAxiosInstance","baseURL","httpAuthHeader","interceptors","use","constructor","Authorization","tokenSource","CancelToken","canceller","any","credentials","post","xmlJs","params","addParent","alwaysChildren","xml2js","formDefinition","FormSessionId","method","menu","cancelToken","resultData","customConfigurationXml","customConfigurations","encodedConfig","btoa","encodeURIComponent","tableConfigurationsXml","ObjectInstanceId","SectionNameAndData","CachedFormIds","DateTime","userName","UserName","oldValue","OldValue","NewValue","actionType","ActionType","reportUrl","IsPreview","SubmitImmediately","onUploadProgress","responseType","fieNameRegex","headerFileName","exec","fileDownload","IOrigamAPI","filterJsonToFilterGroup","filterJson","details","detail","value1","value2","addFilterGroups","panelConfigurationJson","initialFilter","FilterGroupManager","_defaultFilter","registerFilteringOnOffHandler","filteringOn","cloneFilterGroup","setFilters","val1ServerForm","val2ServerForm","filterToServerVersion","saveFilter","PanelId","getFilterGroupServerVersion","IsDefault","filterGroupId","deleteFilter","filterId","resetDefaultFilter","PanelInstanceId","setDefaultFilter","TableColumnConfiguration","getPrototypeOf","TableConfiguration","newinstance","columnConfifuration","clearGrouping","setPropertyHidden","setType","columnIdA","columnIdB","columnIdxA","columnIdxB","propertyIds","congigA","configB","DefaultConfigId","ConfigurationManager","customConfigurationsMap","configToActivate","groupingWasActine","newConfiguration","newName","newConfig","configName","makeColumnConfigurations","tableConfigNode","columnConfigNode","tableConfiguration","fixColumnWidth","parseIntOrZero","parseColumnConfigurationNode","parsedColumnConfigurationIds","newColumnConfigurations","createConfigurationManager","configurationNodes","defaultConfiguration","createDefault","tableConfigurationNodes","configurationNode","customConfigurationNodes","customConfigNode","decodedConfig","decodeURIComponent","escape","atob","parseCustomConfigurations","intValue","interpretScreenXml","findUIChildren","findActions","findParameters","n2","findFormRoot","getPropertyParameters","instance2XmlNode","parseProperty","propertyObject","ControlPropertyId","ControlPropertyValue","ReadOnly","CaptionLength","CaptionPosition","Dock","Multiline","IsPassword","IsRichText","AutoSort","MaxLength","GridColumnWidth","IdentifierIndex","ddProperty","ddParam","AllowReturnToForm","IsTree","Aggregated","IsLookupColumn","Style","SupportsServerSideSorting","FieldType","childProperty","screenDoc","panelConfigurationsRaw","lookupMenuMappings","panelViewFromNumber","pvn","$workbench","pcr","defaultSort","dataSourcesXml","windowXml","checkInfiniteScrollWillWork","xmlComponentBindings","screenAPI","scr","xmlBinding","existingBinding","ParentId","ChildId","componentBindingPair","ParentProperty","ChildProperty","ParentEntity","ChildPropertyType","foundLookupIds","DynamicFormLabelSource","AutoWorkflowNext","SuppressSave","SuppressRefresh","ShowInfoPanel","ShowWorkflowNextButton","ShowWorkflowCancelButton","AutoRefreshInterval","RefreshOnFocus","CacheOnClient","AutoSaveOnListRecordChange","RequestSaveAfterUpdate","LookupCacheKey","formPropertyIds","GroupId","IconUrl","Mode","Placement","confirmationMessage","ConfirmationMessage","parameter","getImplicitFilters","dataViewInstance","ModelId","NewRecordView","DefaultPanelView","IsMapSupported","IsHeadless","DisableActionButtons","ShowAddButton","ShowDeleteButton","ShowSelectionCheckboxes","IsGridHeightDynamic","SelectionMember","OrderMember","IsDraggingEnabled","DataMember","IsRootEntity","IsPreloaded","RequestDataAfterSelectionChange","ConfirmSelectionChange","IdProperty","ParentIdProperty","propId","gridConfigurationNodes","mapping","dependsOnValue","$screen","beginLifetimeScope","$formScreen","IFormScreen","$dataView","IDataViewTS","perspectiveTag","$tablePerspective","$formPerspective","isTableViewActive","dataViewXmlNode","populateMapViewSetup","mapPerspectiveDirector","lookupEngineById","lookupIndividualEngine","dataViewXml","filterNodes","RightSideValue","panelConfig","mss","attr","MapAzimuthMember","MapCenter","MapColorMember","MapIconMember","MapLocationMember","MapTextMember","TextColorMember","TextLocationMember","TextRotationMember","MapResolution","layerXmlNodes","layerXmlNode","layerAttr","mls","MapLayerSetup","parameterXmlNodes","parameterXmlnode","startEditingFirstCell","orderingPropertyId","firstProperty","getFormFocusManager","getAllBindingChildren","resultArray","getChildrenRecursive","childDatViews","ExtPromise","resolveFn","rejectFn","UpdateRequestAggregator","registeredRequests","itemJustEnqueued","currentRequest","interpreter","IDLE","UPDATE_REQUESTED","UPDATE_DEBOUNCING","DEQUEUE","always","UPDATING","API_RUNNING","invoke","onDone","onError","API_RESOLVED","API_REJECTED","exit","services","apiUpdateObject","enqueueRequest","updateObjectItem","mergeToQueue","dequeueToCurrentRequest","resolveCurrentPromise","rejectCurrentPromise","resetCurrentRequest","hasMoreItems","devTools","isRunning","askYesNoQuestion","question","yesLabel","noLabel","onYesClick","onNoClick","GuiHelper","PluginDataView","momentFormatterPattern","pluginName","setCustomConfiguration","getCustomConfiguration","Localizer","localizations","defaultLocale","messageFormat","defaultMessageFormat","_activeLocalization","_defaultLocalization","MessageFormat","getLocalization","localeLower","localization","translation","activeLocalization","defaultLocalization","compile","pluginFactoryFunctions","registerPlugin","factoryFunction","FilterPlugin","AuditPlugin","RadarChartPlugin","IQuestionSaveDataAnswer","pluginLibrary","pluginInstances","plugin","pluginData","guiHelper","createPluginData","getComponent","pluginId","makePluginInstance","refreshRowStates","closingScreens","WeakSet","FormScreenLifecycle02","$type_IFormScreenLifecycle","_updateRequestAggregator","initialSelectedRowId","_autoRefreshTimerHandle","_processedUpdateObjectResults","_readFirstChunkOfRowsRunning","_readFirstChunkOfRowsScheduled","readFirstChunkOfRowsWithGateDebounced","readFirstChunkOfRowsWithGate","actionRunning","flushData","createRow","copyRow","onRequestDeleteRow","selectedItems","executeAction","questionDeleteData","isDueToError","runAsync","questionSaveData","Save","NoSave","onReload","eagerLoading","workflowNextQuery","actionQueryInfo","workflowNext","uiResult","killForm","workflowAbort","workflowRepeat","onRequestScreenClose","autoRefreshPeriod","performAutoReload","clearAutoRefreshInterval","allDataViewsSteady","_steadyDebounceTimeout","currentRecordId","applyInitUIResult","initializePlugins","clearTotalCounts","loadData","keepCurrentData","updateTotalRowCounts","sortAndFilterReaction","startAutoRefreshIfNeeded","screenLevelPlugins","isIScreenPlugin","requestSessionRefresh","setScreenParameters","initialize","isISectionPlugin","getScreenParameters","setRowCount","lookupIdsToQuery","getUnhandledLookupIds","getLookupCacheDependencies","LookupIds","dependencies","putValues","setFormScreen","applyData","fieldToSelect","getFirstFormPropertyId","getGroups","GroupBy","GroupByLookupId","AggregatedColumns","columnSettings","groupByLookupId","orderingConfig","getAggregations","nonRootDataViews","saveViewState","readFirstChunkOfRows","restoreData","ObjectId","updateObjectResult","updateObjectDidRun","runUpdateObject","getDirtyValueRows","getDirtyValues","updateRequestAggregator","refocusLast","loadedData","restoreViewState","targetDataView","orderValues","nextOrderValue","createObject","RequestingGridId","getNewRowValues","bindingParametersFromParent","createObjectResult","childEntities","copyObject","OriginalId","Entities","ForcedValues","deleteObjectInOrderedList","deleteObjectResult","deleteObject","rowToDelete","newRowOrderMap","newOrder","OrderProperty","UpdatedOrderValues","cleaned","refreshLookups","reloadAggregations","loadAggregations","aggregationResult","executeActionQuery","ActionId","ParameterMappings","SelectedItems","InputParameters","RequestingGrid","entityKey","entityValue","reloadAggregationsDebounced","createFormScreenEnvelope","preloadedSessionId","createOpenedScreen","getOpenedScreens","openedScreens","IRefreshOnReturnType","MainMenuContent","$type_IMainMenuContent","MainMenuEnvelope","$type_IMainMenuEnvelope","Proxy","newVal","WebScreen","screenUrl","$type_IWebScreen","reloader","hasDynamicTitle","formTitle","onWorkflowNextClick","getChatrooms","chatrooms","getNotifications","notifications","getFavorites","favorites","WorkbenchLifecycle","$type_IWorkbenchLifecycle","alwaysOpenNew","forceOpenNew","getReportTabUrl","ReportRefWithSelection","findLastExistingTabItem","ReportReferenceMenuItem","activateItem","initUIForScreen","itemId","getReportFromMenu","WorkQueue","topic","parentScreen","screenToActivate","findTopmostItemExcept","deleteItem","destroyUI","requestParameters","formSessionId","isSessionRebirth","newFormScreen","newScreen","pushItem","rowIdToSelect","selectAndOpenRowById","isNewSession","initUI","IsNewSession","RegisterSession","DataRequested","IsSingleRecordEdit","RequestCurrentRecordId","initPortal","portalInfo","userInfo","avatarLink","logoUrl","customAssetsRoute","showChat","chatRefreshInterval","showWorkQueues","workQueueListRefreshInterval","helpUrl","filteringConfig","setXml","setMainMenu","indexMainMenu","sessions","session","startTimer","notificationBoxRefreshInterval","onRefreshSessionClick","onRequestScreenReload","parentFormScreen","ReloadActualRecord","RefreshCompleteForm","MergeModalDialogChanges","dataViewLifecycle","parentScreenSessionId","pendingChanges","change","onScreenTabCloseClick","onFormTabCloseClick","ErrorBoundary","errorInfo","onErrorCaught","ErrorBoundaryEncapsulated","handleScreenError","getOpenedNonDialogScreenItems","CScreenTabbedViewHandleRow","openedScreenItems","CScreenTabbedViewHandle","onScreenTabHandleClick","ScreenToolbar","ScreenToolbarAction","handleWindowKeyDown","rootRef","isLabelless","ScreenToolbarPusher","ScreenToolbarActionGroup","getActiveScreen","activeItem","onSaveSessionClick","onSaveSession","UserMenuBlock","avatarSection","pictureSection","avatarContainer","avatar","infoSection","actionSection","menuItemDivider","actionItems","AboutDialog","commitId","ORIGAM_CLIENT_REVISION_HASH","commitDate","ORIGAM_CLIENT_REVISION_DATE","contentArea","version","aboutInfo","serverVersion","rel","UserMenuDropdown","clickableAvatar","userNameLabel","onAboutClick","handleLogoutClick","getLoggedUserName","isIWebScreen","getWebScreen","getUserAvatarLink","getCustomAssetsRoute","getIsSuppressRefresh","getHelpUrl","isSaveShortcut","isRefreshShortcut","CScreenToolbar","application","getAboutInfo","onScreenToolbarLogoutClick","onSignOutClick","actionFilter","iconsWillBeShown","toolbar","actionGroup","getOverfullActionsDropdownContent","activeScreen","activeScreenActions","onReloadWebScreenClick","renderForFormScreen","renderForWebScreen","renderDefault","SidebarAlertCounter","LogoSection","Sidebar","SidebarSection","SidebarSectionDivider","SidebarSectionHeader","MainMenuUL","MainMenuLI","MainMenuItem","linkContainer","isOpenedScreen","isActiveScreen","isHighLighted","getIsMainMenuLoading","IMenuItemIcon","ChooseFavoriteFolderDialog","favorite","getIconUrl","iconName","iconPath","Workflow","Chat","Folder","onResetColumnConfigClick","resetScreenColumnConfiguration","SidebarSectionBody","EditButton","headerIcon","editIcon","headerIconHidden","headerIconActive","getClass","CMainMenu","editing","isAnyCommandVisible","ensureAtLeastOneCommandVisible","childElement","setIsOpen","topMenuHeader","mouseInHeader","onEditClick","listFromNode","childNode","itemForNode","CMainMenuCommandItem","activeMenuItemId","isOpenScreen","openedScreenIdSet","favoritesMenuItem","isInAnyFavoriteFolder","onAddToFavoritesClicked","CFavoritesMenuItem","editingEnabled","onRemoveFromFavoritesClicked","openItem","onIconClick","getIconSrc","deleteIcon","itemGrip","folderId","favoriteFolders","FavoritesAddRemoveButton","addToFavoritesIconContainer","addToFavoritesIcon","activeAddToFavoritesIcon","CMainMenuFolderItem","itemRef","setReference","flipIsOpen","highLightedItemId","WorkQueuesItem","isEmphasized","onWorkQueuesListItemClick","onWorkQueueListItemClick","IInfoSubsection","CWorkQueues","workQueueItems","sortedItems","countTotal","SidebarRecordInfo","lines","SidebarRecordAudit","CSidebarInfoSection","activeSubsection","Info","info","Audit","audit","onChatroomsListItemClick","CChatSection","unreadMessageCount","SearchResultItem","textContainer","resultItemName","resultItemDescription","FavoriteFolderPropertiesDialog","isPinned","onIsPinnedClicked","PinButton","getAllElementsRecursive","CFavorites","dragStateContainer","DragStateContainer","removeOutdatedMenuItemIds","allMenuNodes","getAllElements","missingIds","folder","itemIds","removeList","defaultFavoritesFolderId","createFolder","updateFolder","flipEditEnabled","onHeaderClick","menuNodes","favoritesList","isDragDisabled","onCreateNewFolderClick","favoritesFolderHeader","forceOpen","setPinned","canBeDeleted","removeFolder","onFolderPropertiesClick","forceOpenSection","CSidebar","activeInfoSubsection","activeSection","addInfoSectionExpandHandler","handleExpandRecordInfo","addAuditSectionExpandHandler","addRecordAuditExpandRequestHandler","handleExpandRecordAuditLog","firstNonEmpty","workQueuesItemsCount","totalItemCount","totalUnreadMessages","sourceFolderId","getIdFromDropIdentifier","destinationFolderId","destinationFolder","sourceFolder","moveItemInFolder","moveItemBetweenFolders","getShowChat","showWorkQues","getShowWorkQues","notificationBox","logoLeft","renderWorkQuesSection","renderChatSection","resultCount","searchResultGroups","ScreenHeader","progressIndicator","indefinite","ScreenHeaderAction","ScreenHeaderPusher","getIsCurrentScreenFull","isFullScreen","getIsScreenOrAnyDataViewWorking","getIsTopmostNonDialogScreen","topmostNonDialogScreen","screens","stackPosition","getTopmostOpenedNonDialogScreenItem","ScreenheaderDivider","onWorkflowAbortClick","CScreenHeader","CScreenHeaderInner","isFullscreen","isNextButton","isCancelButton","workflowActionBtn","setFullscreen","ScreenContainer","TabbedViewPanel","TabbedView","TabbedViewPanelsContainer","CScreenSectionTabbedView","tabId","activePanelId","activeBox","boxes","firstGridId","getFirstGridId","dataViewMap","activateTab","nextNode","saveSplitPanelConfiguration","InstanceId","Position","panelSizeRatioToServerValue","serverValueToPanelSizeRatio","serverStoredSizeRatio","panelPositionRatio","onSplitterPositionChangeFinished","panelSizeRatioServerValue","setPanelSize","Box","Label","VBox","vBox","getVBoxStyle","WorkflowFinishedPanel","isRepeatButton","isCloseButton","HBox","hBox","getHBoxStyle","FormScreenBuilder","xso","showWorkflowCloseButton","showWorkflowRepeatButton","Message","getPanelPosition","panelId1","panelId2","panel1SizeRatio","panel2SizeRatio","xmlWindowObject","buildScreen","Screen","mouseDowned","setMouseDowned","handleMouseup","refIFrame","onLoad","onLoadStart","webContent","transparentOverlay","openScreenByReference","categoryId","referenceId","getMenuIdByReference","Category","onMainMenuItemIdClick","executeWeblink","urlPath","urlQuery","onRootElementClick","nodeName","getAttribute","actionUrl","urlParts","WebScreenComposite","setLoading","setTabTitleFromIFrame","frameWindow","contentDocument","setTitle","headNode","mo","MutationObserver","observe","subtree","characterData","childList","disconnect","initIFrame","closeOrigamTab","onIFrameClick","setReloader","contentWindow","CScreen","CScreenInner","CScreenContent","DialogScreenBuilder","DialogScreen","renderActionButtons","actionButtonHeader","titleIsWorking","isPrimary","flexDirection","CDialogContent","openedDialogItems","Fullscreen","CWorkbenchPage","handleRootElementClick","ApplicationDialogStack","stackedDialogs","close","DialogStack","closeOnClickOutside","cloneElement","component","modalWindowOverlay","onOverlayClick","getStackedDialogs","CMain","Root","NewExternalPromise","ErrorDialogController","errorStack","errItem","errorMessage","exception","exMessage","innerException","InnerException","handleMessageField","timestamp","displayDialog","isDialogDisplayed","previouslyFocusedElement","errItemIndex","dismissError","ErrorDialogComponent","dialogBigIconColumn","dialogMessageColumn","errorMessageList","errMessage","errorMessageListItem","errorMessageDatetime","Application","$type_IApplication","run","Workbench","$type_IWorkbench","openedDialogScreens","openScreenByReferenceAndLookup","dataSourceLookupId","getPath","nodeLabels","openSingleMenuFolder","folderNode","closeAll","nodesToOpen","Searcher","nodeIndex","workQueueIndex","chatsIndex","doSearchTerm","doSearchTermImm","serverResultGroups","workQueueResultGroup","menuResultGroup","chatResultGroup","newGroup","selectFirst","onItemServerClick","SearchResultGroup","onSearchResultsChange","searchInMenu","searchInWorkQueues","searchInChat","chatSearchResults","latinizedLowerLabel","onChatItemClicked","scrollToItem","latinizedTerm","workQueueSearchResults","onWorkQueueItemClicked","onSubMenuClicked","onCommandClicked","NodeContainer","OpenedScreens","$type_IOpenedScreens","maxStackPosition","setActive","itemsSortedByStackPosition","PeriodicLoader","loadFunction","getChSuccessfulApi","INITIALIZED","START","PERFORMING_LOAD","FAILED","SOME_API_SUCCESS","WAIT_PERIOD_REST","REST_DELAY","svcLoadFunction","valueOf","svcSuccessfulApiSubs","callback","onReceive","delays","refreshIntervalMs","WorkQueues","$type_IWorkQueues","onRefreshWorkQueues","hRefreshTimer","refreshInterval","RecordInfo","$type_IRecordInfo","displayedFor","idgen","infoSectionExpandHandlers","auditSectionExpandHandlers","myid","recordInfoExpanded","recordAuditExpanded","triggerInfoSectionExpand","loadRecordInfo","willLoadNewInfo","triggerAuditSectionExpand","hasValidLoadedFor","rawInfo","infoCellStruct","LookupListCacheMulti","lists","Chatrooms","onRefreshChatrooms","chatRooms","getChatroomsList","indexChats","getChatroomList","Notifications","getNotificationBoxContent","Favorites","xmlConverter","XmlToFavoritesConverter","getFolder","xml","foldersFromXml","xmlToFolders","FavoriteFolder","saveFavorites","menuIds","xmlFavorites","favoriteIdsToXml","ConfigXml","folderToRemove","fromIndex","toIndex","parsedXml","folderXml","parseToFavoriteFolder","folderToXml","SidebarState","MainMenuState","_activeSection","onSidebarInfoSectionCollapsed","onSidebarInfoSectionExpanded","onSidebarAuditSectionExpanded","refMap","folderStateMap","scrollIntoView","_highLightedItemId","createWorkbench","workbenchLookupListCache","origamApi","createMultiLookupEngine","stopAutoreload","stopAllFormsAutorefresh","QuestionLogoutWithDirtyData","ApplicationLifecycle","$type_IApplicationLifecycle","performLogin","requestSignout","isSomeDirtyScreen","reuseAuthToken","login","Password","password","anounceAuthToken","setLoginPageMessage","resetAccessToken","resetWorkbench","logout","setAccessToken","setWorkbench","msg","loginPageMessage","nextId","dialogDimensions","useKey","dlg","createApplication","apiErrorHandler","Boolean","hostname","preventDoubleclickSelect","MOUSE_DOWN","DEAD_PERIOD","domEvent","isNotEditable","targetTag","RootError","navigator","platform","alert","alertDanger","renderMessage","returnLink","inPageLink","locationHash","TOKEN_OVR_HASH","BACKEND_OVR_HASH","backendUrl","newUrl","origin","Cookie","BACKEND_OVR_RETURN_HASH","events","addUserLoaded","lang","process","REACT_APP_SELENIUM_KICK","main","serviceWorker","ready","unregister"],"mappings":";+GACAA,EAAOC,QAAU,CAAC,OAAS,4BAA4B,gBAAkB,qCAAqC,aAAe,oC,oBCA7HD,EAAOC,QAAU,CAAC,KAAO,2BAA2B,kBAAoB,wCAAwC,WAAa,iCAAiC,WAAa,iCAAiC,kBAAoB,0C,oBCAhOD,EAAOC,QAAU,CAAC,SAAW,2BAA2B,SAAW,2BAA2B,SAAW,2BAA2B,UAAY,4BAA4B,KAAO,uBAAuB,aAAe,iC,oBCAzND,EAAOC,QAAU,CAAC,KAAO,wBAAwB,aAAe,gCAAgC,eAAiB,kCAAkC,KAAO,wBAAwB,gBAAkB,qC,oBCApMD,EAAOC,QAAU,CAAC,cAAgB,mCAAmC,iBAAmB,sCAAsC,qBAAuB,0CAA0C,qBAAuB,0CAA0C,oBAAsB,yCAAyC,oBAAsB,2C,oBCArVD,EAAOC,QAAU,CAAC,QAAU,0BAA0B,KAAO,uBAAuB,MAAQ,0B,oBCA5FD,EAAOC,QAAU,CAAC,QAAU,wCAAwC,UAAY,0CAA0C,eAAiB,+CAA+C,SAAW,yCAAyC,aAAe,+C,oBCA7PD,EAAOC,QAAU,CAAC,KAAO,wBAAwB,WAAa,8BAA8B,kBAAoB,qCAAqC,WAAa,8BAA8B,WAAa,8BAA8B,mBAAqB,wC,oBCAhQD,EAAOC,QAAU,CAAC,QAAU,gCAAgC,KAAO,6BAA6B,MAAQ,gC,oBCAxGD,EAAOC,QAAU,CAAC,kBAAoB,oCAAoC,YAAc,8BAA8B,aAAe,+BAA+B,mBAAqB,uC,oBCAzLD,EAAOC,QAAU,CAAC,sBAAwB,2CAA2C,eAAiB,oCAAoC,MAAQ,2BAA2B,aAAe,kCAAkC,gBAAkB,qCAAqC,SAAW,8BAA8B,UAAY,iC,oB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L,OAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,KACL,OAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,OAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KACL,SAAK,MACL,SAAK,MACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,KACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,IACL,SAAK,KAEPE,OAAOptB,UAAUstB,SAAW,WAC1B,OA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Aa,iCAAiC,iBAAmB,uCAAuC,iBAAmB,yC,mBCA7ID,EAAOC,QAAU,CAAC,MAAQ,yBAAyB,YAAc,+BAA+B,KAAO,wBAAwB,WAAa,8BAA8B,WAAa,iC","file":"static/js/main.b046049d.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"editor\":\"CommonStyle_editor__2bkxP\",\"editorContainer\":\"CommonStyle_editorContainer___F2tc\",\"notification\":\"CommonStyle_notification__knYkq\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenHeader_root__3JCgg\",\"progressIndicator\":\"ScreenHeader_progressIndicator__SOQvL\",\"indefinite\":\"ScreenHeader_indefinite__zJi2v\",\"slideright\":\"ScreenHeader_slideright__1r7fe\",\"workflowActionBtn\":\"ScreenHeader_workflowActionBtn__3T14W\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"noSelect\":\"TreeView_noSelect__d0VX1\",\"expander\":\"TreeView_expander__306Lt\",\"treeView\":\"TreeView_treeView__Qxx_e\",\"nodeLabel\":\"TreeView_nodeLabel__Qridt\",\"node\":\"TreeView_node___3hG4\",\"nodeSelected\":\"TreeView_nodeSelected__1JyAQ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"CheckList_root__25bNk\",\"focusedLabel\":\"CheckList_focusedLabel__3Gm0W\",\"unFocusedLabel\":\"CheckList_unFocusedLabel__1rmUM\",\"item\":\"CheckList_item__viH4I\",\"editorContainer\":\"CheckList_editorContainer__AV-Ky\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dialogContent\":\"ErrorDialog_dialogContent__3AWv4\",\"errorMessageList\":\"ErrorDialog_errorMessageList__1Xpo0\",\"errorMessageListItem\":\"ErrorDialog_errorMessageListItem__2AFQB\",\"errorMessageDatetime\":\"ErrorDialog_errorMessageDatetime__ZAg6b\",\"dialogBigIconColumn\":\"ErrorDialog_dialogBigIconColumn__I1S8o\",\"dialogMessageColumn\":\"ErrorDialog_dialogMessageColumn__3Eq2G\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"divider\":\"Splitter_divider__1-V_T\",\"root\":\"Splitter_root__39UQ7\",\"panel\":\"Splitter_panel__12M4V\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"trigger\":\"FilterSettingsComboBox_trigger__35wdC\",\"container\":\"FilterSettingsComboBox_container__7K4__\",\"dropdownSymbol\":\"FilterSettingsComboBox_dropdownSymbol__1pdkb\",\"dropdown\":\"FilterSettingsComboBox_dropdown__11NuA\",\"dropdownItem\":\"FilterSettingsComboBox_dropdownItem__jKMhw\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"WebScreen_root__2Bi_-\",\"webContent\":\"WebScreen_webContent__1g8sV\",\"progressIndicator\":\"WebScreen_progressIndicator__2dVHL\",\"indefinite\":\"WebScreen_indefinite__11hGC\",\"slideright\":\"WebScreen_slideright__2rwji\",\"transparentOverlay\":\"WebScreen_transparentOverlay__vgXPs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"divider\":\"CustomSplitter_divider__2ULQc\",\"root\":\"CustomSplitter_root__1BBB1\",\"panel\":\"CustomSplitter_panel__3OaRs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tagInputContainer\":\"TagInput_tagInputContainer__36ZtY\",\"tagInputAdd\":\"TagInput_tagInputAdd__3D7Em\",\"tagInputItem\":\"TagInput_tagInputItem__1ablY\",\"tagInputItemDelete\":\"TagInput_tagInputItemDelete__354xq\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"droppedPanelContainer\":\"ColorEditor_droppedPanelContainer__17x4c\",\"dropdownSymbol\":\"ColorEditor_dropdownSymbol__JrzBh\",\"input\":\"ColorEditor_input__z8tZe\",\"notification\":\"ColorEditor_notification__1ngTS\",\"editorContainer\":\"ColorEditor_editorContainer__yFyY4\",\"colorDiv\":\"ColorEditor_colorDiv__A6bDk\",\"colorRect\":\"ColorEditor_colorRect__24Wiq\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"caption\":\"CheckBox_caption__TbhgX\",\"editor\":\"CheckBox_editor__7FL18\",\"focusedLabel\":\"CheckBox_focusedLabel__1gDKL\",\"unFocusedLabel\":\"CheckBox_unFocusedLabel__1kvBE\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"anchor\":\"MainMenuItem_anchor__1AU5m\",\"icon\":\"MainMenuItem_icon__1rZQI\",\"label\":\"MainMenuItem_label__1z8lj\",\"linkContainer\":\"MainMenuItem_linkContainer__1Qjeq\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"droppedPanel\":\"FilterSettingsLookup_droppedPanel__3uSty\",\"optionGridCell\":\"FilterSettingsLookup_optionGridCell__2cjsx\",\"noItemsFound\":\"FilterSettingsLookup_noItemsFound__3PPQy\",\"tagInput\":\"FilterSettingsLookup_tagInput__2hPZX\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TabbedViewHandle_root__Gb-zZ\",\"label\":\"TabbedViewHandle_label__2ICls\",\"closeBtn\":\"TabbedViewHandle_closeBtn__1oGgb\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"disabled\":\"DataViewHeaderButton_disabled__3Sb1B\",\"enabled\":\"DataViewHeaderButton_enabled__BWLf3\",\"root\":\"DataViewHeaderButton_root__R9BQn\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dataView\":\"DataView_dataView__4_CH4\",\"dataViewOverlay\":\"DataView_dataViewOverlay__2vo6k\",\"dataViewLoadingLabel\":\"DataView_dataViewLoadingLabel___GGk3\",\"overlayContainer\":\"DataView_overlayContainer__1h9xy\",\"dataViewContentContainer\":\"DataView_dataViewContentContainer__1Yf4L\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"input\":\"NumberEditor_input__I-IS5\",\"editorContainer\":\"NumberEditor_editorContainer__2MR7r\",\"notification\":\"NumberEditor_notification__1V11W\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"RadioButton_root__3jjtt\",\"input\":\"RadioButton_input__2f5CJ\",\"label\":\"RadioButton_label__14XAR\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenToolbarAction_root__2ZQ3_\",\"icon\":\"ScreenToolbarAction_icon__19bdG\",\"label\":\"ScreenToolbarAction_label__2URSN\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"version\":\"AboutDialog_version__2CXBy\",\"contentArea\":\"AboutDialog_contentArea__2j_u2\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SidebarSectionHeader_root__ftzV6\",\"icon\":\"SidebarSectionHeader_icon__1LM8J\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"WorkQueuesItem_root__B4BTm\",\"icon\":\"WorkQueuesItem_icon__2wRgm\",\"label\":\"WorkQueuesItem_label__V_DSF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"favoritesList\":\"CFavorites_favoritesList__1Uk0B\",\"forceOpenSection\":\"CFavorites_forceOpenSection__3kwmX\",\"favoritesFolderHeader\":\"CFavorites_favoritesFolderHeader__2JnWz\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Root\":\"ScreenArea_Root__2Q_9t\",\"TabHandles\":\"ScreenArea_TabHandles__8tcvl\",\"TabHandle\":\"ScreenArea_TabHandle__5UzSc\",\"TabHandleCloseBtn\":\"ScreenArea_TabHandleCloseBtn__3Mx1O\",\"active\":\"ScreenArea_active__2PJGU\",\"dialogLoadingContent\":\"ScreenArea_dialogLoadingContent__12B6M\",\"actionButtonHeader\":\"ScreenArea_actionButtonHeader__l10yw\",\"workflowActionBtn\":\"ScreenArea_workflowActionBtn__PQWpx\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"Icon_root__CqOcA\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DataViewHeaderAction_root__OuNzO\",\"isDisabled\":\"DataViewHeaderAction_isDisabled__c-DzH\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"droppedBox\":\"Dropdowner_droppedBox__3eMR-\",\"dropdownerContainer\":\"Dropdowner_dropdownerContainer__VUtay\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DataViewHeader_root__1Q9T2\",\"inner\":\"DataViewHeader_inner__3A8BQ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DropdownItem_root__12S5F\",\"isSelected\":\"DropdownItem_isSelected__39ac3\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"formView\":\"FormView_formView__3jJPM\",\"formViewForm\":\"FormView_formViewForm__10lV-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"FormField_root__3LUGE\",\"caption\":\"FormField_caption__3gx48\",\"editor\":\"FormField_editor__2PAyF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tagInput\":\"TagInputEditor_tagInput__oeEAN\",\"filterInput\":\"TagInputEditor_filterInput__3dU-K\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"scrollee\":\"Scrollee_scrollee__3Yu_e\",\"scrolleeShifted\":\"Scrollee_scrolleeShifted__3CSmo\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"scroller\":\"Scroller_scroller__WjWwy\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"filterRow\":\"TableView_filterRow__i4rbG\",\"aggregationRow\":\"TableView_aggregationRow__2L_ls\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"WorkflowFinishedPanel_root__2Z5Ko\",\"message\":\"WorkflowFinishedPanel_message__2fSz6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"MainBar_root__1zY7B\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenTabsArea_root__VJgCG\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"divider\":\"WorkbenchPage_divider__2b10o\",\"root\":\"WorkbenchPage_root__aU2RD\",\"panel\":\"WorkbenchPage_panel__1WDDf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TabbedViewHandleRow_root__KXZQy\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dialogContent\":\"processActionQueryResult_dialogContent__1OXj3\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DataViewHeaderButtonGroup_root__2pKk8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DataViewHeaderGroup_root__2c_fU\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"Dropdown_root__22jux\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"DropdownDivider_root__2rsCv\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"DataViewLoading_container__1yhU0\",\"label\":\"DataViewLoading_label__ufbvS\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"formRoot\":\"FormRoot_formRoot__3rXqs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"image\":\"ImageEditor_image__tqEFe\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"cell\":\"BooleanCell_cell__NsFl0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"cell\":\"NumberCell_cell__2o3mX\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"editorContainer\":\"BoolEditor_editorContainer__1Rfi8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"FormSection_root__3qVCm\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"FormSectionHeader_root__3YiyH\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"FormLabel_root__2czrI\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"FormPerspectiveDirector_root__AOjH_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"canvas\":\"Canvas_canvas__3x8YC\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"headerRow\":\"HeaderRow_headerRow__2HKQo\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"positionedField\":\"PositionedField_positionedField__25cNU\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SelectionCheckboxHeader_root__GPpim\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TablePerspectiveDirector_root__2iH1h\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenToolbar_root__3fBcz\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenToolbarPusher_root__3iYNy\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenToolbarActionGroup_root__1BoUz\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"AlertCounter_root__2hDl8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"LogoSection_root__1YKIZ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"Sidebar_root__3UKuC\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SidebarSection_root__APXMV\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SidebarSectionDivider_root__zk-DF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"MainMenuUL_root__2ziC-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"MainMenuLI_root__1PJn9\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SidebarSectionBody_root__2-avj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"editIcon\":\"EditButton_editIcon__2flAn\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SidebarRecordInfo_root__3pmwa\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"logoLeft\":\"CSidebar_logoLeft__2SXVd\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenHeaderAction_root__p4UYN\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenHeaderPusher_root__99Cmk\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenHeaderDivider_root__3leZ_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"ScreenContainer_root__1WGK9\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TabbedViewPanel_root__3a8FM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TabbedView_root__273Qz\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"TabbedViewPanelsContainer_root__2ye5J\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"box\":\"Box_box__ixR2G\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"label\":\"Label_label__2cv9m\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"vBox\":\"VBox_vBox__1eHBF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"hBox\":\"HBox_hBox__3YKlp\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"Screen_root__3ezCB\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"Fullscreen_root__3a-dw\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modalWindowOverlay\":\"DialogStack_modalWindowOverlay__1xD--\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"calendarWidgetControlBtn\":\"DateTimeEditor_calendarWidgetControlBtn__j6Kmf\",\"droppedPanelContainer\":\"DateTimeEditor_droppedPanelContainer__3V5mM\",\"calendarWidgetDayTable\":\"DateTimeEditor_calendarWidgetDayTable__lC7t-\",\"calendarWidgetRow\":\"DateTimeEditor_calendarWidgetRow__3uLNB\",\"calendarWidgetCell\":\"DateTimeEditor_calendarWidgetCell__3Dr7G\",\"calendarWidgetSelectedDay\":\"DateTimeEditor_calendarWidgetSelectedDay__2jqJR\",\"calendarWidgetDayHeaderCell\":\"DateTimeEditor_calendarWidgetDayHeaderCell__1wSdQ\",\"calendarWidgetNeighbourMonthCell\":\"DateTimeEditor_calendarWidgetNeighbourMonthCell__3UiK9\",\"calendarWidgetHeader\":\"DateTimeEditor_calendarWidgetHeader__1DDPW\",\"calendarWidgetYearControls\":\"DateTimeEditor_calendarWidgetYearControls__1ssoe\",\"calendarWidgetMonthControls\":\"DateTimeEditor_calendarWidgetMonthControls__3av-o\",\"calendarWidgetTitle\":\"DateTimeEditor_calendarWidgetTitle__1rzc7\",\"dropdownSymbol\":\"DateTimeEditor_dropdownSymbol__2OUVn\",\"input\":\"DateTimeEditor_input__3pRbQ\",\"notification\":\"DateTimeEditor_notification__GiM2e\",\"editorContainer\":\"DateTimeEditor_editorContainer__2wUpo\",\"formatHintTooltip\":\"DateTimeEditor_formatHintTooltip__2v6xY\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"SearchDialog_root__1Illf\",\"icon\":\"SearchDialog_icon__1ao2p\",\"inputRow\":\"SearchDialog_inputRow__2JETJ\",\"input\":\"SearchDialog_input__3w6kk\",\"resultsContainer\":\"SearchDialog_resultsContainer__1YX1N\",\"resultGroupRow\":\"SearchDialog_resultGroupRow__vmPIt\",\"arrow\":\"SearchDialog_arrow__2zkHI\",\"resultArea\":\"SearchDialog_resultArea__2LZ2K\",\"groupName\":\"SearchDialog_groupName__3msXB\",\"resultIemRow\":\"SearchDialog_resultIemRow__35aYW\",\"resultIemRowSelected\":\"SearchDialog_resultIemRowSelected__3vsPg\",\"resultIemRowHovered\":\"SearchDialog_resultIemRowHovered__3RTf8\",\"itemIcon\":\"SearchDialog_itemIcon__A2eBj\",\"itemTitle\":\"SearchDialog_itemTitle__20hcn\",\"itemTextSeparator\":\"SearchDialog_itemTextSeparator__3ba_s\",\"itemContents\":\"SearchDialog_itemContents__3KIPx\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dialogContent\":\"DialogsCommon_dialogContent___D9Ed\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"inpuContainer\":\"FavoriteFolderPropertiesDialog_inpuContainer__3p44p\",\"lastRow\":\"FavoriteFolderPropertiesDialog_lastRow__2CODr\",\"row\":\"FavoriteFolderPropertiesDialog_row__3Au0n\",\"label\":\"FavoriteFolderPropertiesDialog_label__3FS4A\",\"textInput\":\"FavoriteFolderPropertiesDialog_textInput__3ysnQ\",\"chcekBoxinput\":\"FavoriteFolderPropertiesDialog_chcekBoxinput__1mWmU\",\"notification\":\"FavoriteFolderPropertiesDialog_notification__Lr9Gq\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"avatarSection\":\"UserMenuDropdown_avatarSection__1bnYB\",\"avatarContainer\":\"UserMenuDropdown_avatarContainer__m7Bob\",\"avatar\":\"UserMenuDropdown_avatar__3_yBf\",\"clickableAvatar\":\"UserMenuDropdown_clickableAvatar__3HoaO\",\"pictureSection\":\"UserMenuDropdown_pictureSection__CPtUK\",\"infoSection\":\"UserMenuDropdown_infoSection__1-Fov\",\"userNameLabel\":\"UserMenuDropdown_userNameLabel__2iF5z\",\"root\":\"UserMenuDropdown_root__3zBC3\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"input\":\"TextEditor_input__3da08\",\"scrollY\":\"TextEditor_scrollY__3yg0R\",\"noScrollY\":\"TextEditor_noScrollY__2BD0R\",\"wrapText\":\"TextEditor_wrapText__LCQLl\",\"multiLine\":\"TextEditor_multiLine__2YNzY\",\"editorContainer\":\"TextEditor_editorContainer__1hK_O\",\"notification\":\"TextEditor_notification__2C3Mt\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"inpuContainer\":\"SaveFilterDialog_inpuContainer__2jLRN\",\"row\":\"SaveFilterDialog_row__1eMoD\",\"label\":\"SaveFilterDialog_label__1Dbhj\",\"textInput\":\"SaveFilterDialog_textInput__1e_c-\",\"chcekBoxinput\":\"SaveFilterDialog_chcekBoxinput__1Km6L\"};","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IApplication } from '../entities/types/IApplication';\r\n\r\nexport function getApplication(ctx?: any): IApplication {\r\n let cn = ctx;\r\n while (cn.parent) {\r\n cn = cn.parent;\r\n }\r\n return cn;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApplication } from \"./getApplication\";\r\nimport { IApi } from \"../entities/types/IApi\";\r\n\r\nexport function getApi(ctx: any): IApi {\r\n return getApplication(ctx).api;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport Oidc from \"oidc-client\";\r\n\r\nconst [windowLocation] = window.location.href.split(\"#\");\r\n\r\nconst config = {\r\n authority: `${windowLocation}`,\r\n client_id: \"origamWebClient\",\r\n redirect_uri: `${windowLocation}#origamClientCallback/`,\r\n response_type: \"code\",\r\n scope: \"openid IdentityServerApi offline_access\",\r\n post_logout_redirect_uri: `${windowLocation}`,\r\n response_mode: \"query\",\r\n automaticSilentRenew: true,\r\n silent_redirect_uri: `${windowLocation}#origamClientCallbackRenew/`,\r\n};\r\n\r\nexport const userManager = new Oidc.UserManager(config);\r\n\r\nexport async function ensureLogin() {\r\n const authOvr = sessionStorage.getItem(\"origamAuthTokenOverride\");\r\n if (authOvr) {\r\n sessionStorage.setItem(\"origamAuthTokenOverride\", authOvr);\r\n return {access_token: authOvr};\r\n }\r\n if (window.location.hash.startsWith(\"#origamClientCallback/\")) {\r\n const user = await userManager.signinRedirectCallback(\r\n window.location.hash.replace(\"#origamClientCallback/\", \"\")\r\n );\r\n const [urlpart] = window.location.href.split(\"#\");\r\n window.history.replaceState(null, \"\", urlpart);\r\n return user;\r\n } else {\r\n const user = await userManager.getUser();\r\n if (user) {\r\n return user;\r\n } else {\r\n await userManager.signinRedirect();\r\n }\r\n }\r\n}\r\n\r\nexport async function logoff() {\r\n await userManager.signoutRedirect();\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/MainBar/MainBar.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport const MainBar: React.FC<{}> = props => (\r\n
\r\n {props.children}\r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenTabsArea/ScreenTabsArea.module.scss\";\r\n\r\nexport const ScreenTabsArea: React.FC = props => (\r\n
{props.children}
\r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Splitter/Splitter.module.scss\";\r\nimport { action, computed, observable, runInAction } from \"mobx\";\r\nimport { observer, Observer } from \"mobx-react\";\r\n\r\nimport Measure, { ContentRect } from \"react-measure\";\r\nimport _ from \"lodash\";\r\nimport cx from \"classnames\";\r\n\r\n@observer\r\nclass SplitterPanel extends React.Component<{\r\n type: \"isHoriz\" | \"isVert\";\r\n size: number;\r\n className?: string;\r\n}> {\r\n refPanel = (elm: any) => (this.elmPanel = elm);\r\n elmPanel: HTMLDivElement | null = null;\r\n\r\n componentDidMount() {\r\n }\r\n\r\n @computed get style() {\r\n switch (this.props.type) {\r\n case \"isHoriz\":\r\n return {width: this.props.size};\r\n case \"isVert\":\r\n return {height: this.props.size};\r\n }\r\n return undefined;\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nclass SplitterDivider extends React.Component<{\r\n type: \"isHoriz\" | \"isVert\";\r\n className?: string;\r\n domRef: any;\r\n isDragging: boolean;\r\n relativeLoc: number;\r\n onMouseDown?(event: any): void;\r\n}> {\r\n @computed get style() {\r\n if (!this.props.isDragging) return {};\r\n switch (this.props.type) {\r\n case \"isVert\":\r\n return {top: this.props.relativeLoc};\r\n case \"isHoriz\":\r\n return {left: this.props.relativeLoc};\r\n }\r\n return undefined;\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class Splitter extends React.Component<{\r\n type: \"isHoriz\" | \"isVert\";\r\n sizeOverrideFirstPanel?: number;\r\n dontPrintLeftPane?: boolean;\r\n id?: string;\r\n panels: Array<[any, number, React.ReactNode]>;\r\n onSizeChangeFinished?(\r\n panelId1: any,\r\n panelId2: any,\r\n panel1Ratio: number,\r\n panel2Ratio: number\r\n ): void;\r\n STYLE?: any;\r\n}> {\r\n @observable containerWidth = 0;\r\n @observable containerHeight = 0;\r\n @observable isInitialized = false;\r\n @observable sizeMap: Map = new Map();\r\n @observable dividerSizeMap: Map = new Map();\r\n @observable isResizing = false;\r\n @observable mouseLocStart = 0;\r\n @observable dividerRelativeLoc = 0;\r\n draggingDividerId: any;\r\n\r\n constructor(props: any) {\r\n super(props);\r\n runInAction(() => {\r\n for (let i = 0; i < this.props.panels.length; i++) {\r\n const panel = this.props.panels[i];\r\n this.sizeMap.set(panel[0], panel[1]);\r\n if (i < this.props.panels.length - 1) {\r\n this.dividerSizeMap.set(panel[0], 0);\r\n }\r\n }\r\n });\r\n }\r\n\r\n @action.bound\r\n handleResize(contentRect: ContentRect) {\r\n const {bounds} = contentRect;\r\n if (bounds) {\r\n this.announceContainerSize(bounds.width, bounds.height);\r\n }\r\n }\r\n\r\n @action.bound\r\n announceContainerSize(width: number, height: number) {\r\n if (width > 0 && height > 0 && this.differentSizeRequested(width, height)) {\r\n this.containerWidth = width;\r\n this.containerHeight = height;\r\n this.initSizes();\r\n this.isInitialized = true;\r\n }\r\n }\r\n\r\n differentSizeRequested(newWidth: number, newHeight: number) {\r\n return Math.abs(newHeight - this.containerHeight) > 0.001 ||\r\n Math.abs(newWidth - this.containerWidth) > 0.001\r\n }\r\n\r\n @action.bound initSizesImm() {\r\n // TODO: Fix nested splitter initSize (first panel overridden by initial size by resizing its container)\r\n\r\n //console.log(Array.from(this.dividerSizeMap.entries()));\r\n const containerSize =\r\n this.props.type === \"isVert\" ? this.containerHeight : this.containerWidth;\r\n const dividerSizeSum = Array.from(this.dividerSizeMap.values()).reduce(\r\n (a, b) => a + b,\r\n 0\r\n );\r\n if (this.props.sizeOverrideFirstPanel === undefined) {\r\n //console.log(\"Divider size sum\", dividerSizeSum);\r\n const sizeToDivide = containerSize - dividerSizeSum; // TODO: Include handle sizes?\r\n\r\n const initSizeSum = Array.from(this.sizeMap.values()).reduce(\r\n (a, b) => a + b,\r\n 0\r\n );\r\n const sizeRatio = sizeToDivide / initSizeSum;\r\n for (let [key, value] of this.sizeMap.entries()) {\r\n this.sizeMap.set(key, value * sizeRatio);\r\n //console.log(\"Set\", key, value * sizeRatio);\r\n }\r\n } else if (this.props.panels.length > 0) {\r\n const firstPanelSize = Math.max(this.props.sizeOverrideFirstPanel, 20);\r\n const sizeToDivide = containerSize - dividerSizeSum - firstPanelSize;\r\n const initSizeSum = this.props.panels\r\n .slice(1)\r\n .reduce((acc, panel) => acc + (this.sizeMap.get(panel[0]) || 0), 0);\r\n const sizeRatio = sizeToDivide / initSizeSum;\r\n\r\n for (let [key, value] of this.sizeMap.entries()) {\r\n if (key === this.props.panels[0][0]) continue;\r\n this.sizeMap.set(key, value * sizeRatio);\r\n }\r\n this.sizeMap.set(this.props.panels[0][0], firstPanelSize);\r\n }\r\n }\r\n\r\n initSizes = _.debounce(this.initSizesImm, 10);\r\n\r\n @action.bound handleDividerMouseDown(event: any, handleId: any) {\r\n this.draggingDividerId = handleId;\r\n this.isResizing = true;\r\n this.dividerRelativeLoc = 0;\r\n this.mouseLocStart =\r\n this.props.type === \"isVert\" ? event.screenY : event.screenX;\r\n window.addEventListener(\"mouseup\", this.handleWindowMouseUp);\r\n window.addEventListener(\"mousemove\", this.handleWindowMouseMove);\r\n }\r\n\r\n @action.bound handleWindowMouseMove(event: any) {\r\n event.preventDefault();\r\n const dividerRelativeLoc =\r\n (this.props.type === \"isVert\" ? event.screenY : event.screenX) -\r\n this.mouseLocStart;\r\n const [size1, size2] = this.computeNewSizes(dividerRelativeLoc);\r\n if (size1 >= 20 && size2 >= 20) {\r\n this.dividerRelativeLoc = dividerRelativeLoc;\r\n }\r\n }\r\n\r\n get draggingIds() {\r\n const id1 = this.draggingDividerId;\r\n const id2 = this.props.panels[\r\n this.props.panels.findIndex(\r\n panel => panel[0] === this.draggingDividerId\r\n )! + 1\r\n ][0];\r\n return [id1, id2];\r\n }\r\n\r\n computeNewSizes(dividerRelativeLoc: number) {\r\n const [id1, id2] = this.draggingIds;\r\n return [\r\n this.sizeMap.get(id1)! + dividerRelativeLoc,\r\n this.sizeMap.get(id2)! - dividerRelativeLoc\r\n ];\r\n }\r\n\r\n get newSizes() {\r\n return this.computeNewSizes(this.dividerRelativeLoc);\r\n }\r\n\r\n @action.bound handleWindowMouseUp(event: any) {\r\n this.isResizing = false;\r\n window.removeEventListener(\"mouseup\", this.handleWindowMouseUp);\r\n window.removeEventListener(\"mousemove\", this.handleWindowMouseMove);\r\n const [id1, id2] = this.draggingIds;\r\n const [size1, size2] = this.newSizes;\r\n this.sizeMap.set(id1, size1);\r\n this.sizeMap.set(id2, size2);\r\n if (this.props.onSizeChangeFinished) {\r\n if (this.props.type === \"isHoriz\") {\r\n this.props.onSizeChangeFinished(id1, id2, size1 / this.containerWidth, size2);\r\n } else {\r\n this.props.onSizeChangeFinished(id1, id2, size1 / this.containerHeight, size2);\r\n }\r\n }\r\n }\r\n\r\n @action.bound handleDividerResize(contentRect: ContentRect, dividerId: any) {\r\n //console.log(\"Divider resize\", contentRect.bounds, dividerId);\r\n if (contentRect.bounds) {\r\n const value = this.props.type === \"isVert\"\r\n ? contentRect.bounds.height\r\n : contentRect.bounds.width\r\n if (this.dividerSizeMap.get(dividerId) !== value) {\r\n this.dividerSizeMap.set(dividerId, value);\r\n this.initSizes();\r\n }\r\n }\r\n }\r\n\r\n render() {\r\n const content: React.ReactNode[] = [];\r\n for (let i = 0; i < this.props.panels.length; i++) {\r\n const panel = this.props.panels[i];\r\n content.push(\r\n \r\n {panel[2]}\r\n \r\n );\r\n if (i < this.props.panels.length - 1) {\r\n content.push(\r\n \r\n this.handleDividerResize(contentRect, panel[0])\r\n }\r\n >\r\n {({measureRef}) => (\r\n \r\n {() => (\r\n \r\n this.handleDividerMouseDown(event, panel[0])\r\n }\r\n />\r\n )}\r\n \r\n )}\r\n \r\n );\r\n }\r\n }\r\n return (\r\n \r\n {({measureRef}) => (\r\n \r\n {() => (\r\n \r\n {this.isInitialized && content}\r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/WorkbenchPage/WorkbenchPage.module.scss\";\r\nimport SSplitter from \"gui/Workbench/ScreenArea/CustomSplitter.module.scss\";\r\nimport { Splitter } from \"gui/Components/Splitter/Splitter\";\r\n\r\nexport const WorkbenchPage: React.FC<{\r\n sidebar: React.ReactNode;\r\n mainbar: React.ReactNode;\r\n}> = props => (\r\n
\r\n \r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IWorkbench } from \"../entities/types/IWorkbench\";\r\nimport { getApplication } from \"./getApplication\";\r\n\r\nexport function getWorkbench(ctx: any): IWorkbench {\r\n const workbench = getApplication(ctx).workbench;\r\n if (!workbench) {\r\n throw new Error(\"No workbench in Application.\");\r\n }\r\n return workbench;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport Svg from \"react-inlinesvg\";\r\nimport S from \"gui/Components/Icon/Icon.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport class Icon extends React.Component<{\r\n src: string;\r\n className?: string;\r\n tooltip?: string\r\n}> {\r\n render() {\r\n if (!this.props.src) {\r\n return null;\r\n }\r\n if (this.props.src.toLowerCase().endsWith(\"svg\")) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/TabbedView/TabbedViewHandle.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\n\r\nexport class TabbedViewHandle extends React.Component<{\r\n title?: string;\r\n id?: string;\r\n isActive?: boolean;\r\n hasCloseBtn?: boolean;\r\n isDirty?: boolean;\r\n onClick?(event: any): void;\r\n onCloseClick?(event: any): void;\r\n onCloseMouseDown?(event: any): void;\r\n}> {\r\n render() {\r\n return (\r\n \r\n
{this.props.children}
\r\n {this.props.hasCloseBtn && (\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/TabbedView/TabbedViewHandleRow.module.scss\";\r\n\r\nexport class TabbedViewHandleRow extends React.Component<{\r\n className?: string;\r\n}> {\r\n render() {\r\n return
\r\n {this.props.children}\r\n
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"./getWorkbench\";\r\n\r\nexport function getWorkbenchLifecycle(ctx: any) {\r\n return getWorkbench(ctx).workbenchLifecycle;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IOpenedScreen, isIOpenedScreen } from \"../entities/types/IOpenedScreen\";\r\n\r\nexport function getOpenedScreen(ctx: any): IOpenedScreen {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIOpenedScreen(cn)) return cn;\r\n if (!cn) return undefined as any;\r\n cn = cn.parent;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFormScreenEnvelope } from \"./IFormScreen\";\r\nimport { IMainMenuItemType } from \"./IMainMenu\";\r\n\r\nexport interface IDialogInfo {\r\n width: number;\r\n height: number;\r\n}\r\n\r\n\r\nexport interface IOpenedScreenData {\r\n menuItemId: string;\r\n menuItemType: IMainMenuItemType;\r\n lazyLoading: boolean;\r\n dialogInfo?: IDialogInfo;\r\n order: number;\r\n tabTitle: string;\r\n content: IFormScreenEnvelope;\r\n parameters: { [key: string]: any };\r\n isSleeping?: boolean;\r\n isSleepingDirty?: boolean;\r\n}\r\n\r\nexport interface IOpenedScreen extends IOpenedScreenData {\r\n parentContext: IOpenedScreen | undefined;\r\n $type_IOpenedScreen: 1;\r\n\r\n isActive: boolean;\r\n isDialog: boolean;\r\n isClosed: boolean;\r\n stackPosition: number;\r\n isBeingClosed: boolean;\r\n formTitle: string;\r\n\r\n setActive(state: boolean): void;\r\n\r\n setContent(screen: IFormScreenEnvelope): void;\r\n\r\n screenUrl?: string;\r\n parent?: any;\r\n hasDynamicTitle: boolean;\r\n}\r\n\r\nexport const isIOpenedScreen = (o: any): o is IOpenedScreen =>\r\n o?.$type_IOpenedScreen;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFormScreen, isIFormScreen } from \"model/entities/types/IFormScreen\";\r\n\r\nexport function getFormScreen(ctx: any): IFormScreen {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIFormScreen(cn)) {\r\n return cn;\r\n }\r\n cn = cn.parent;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"./IDataView\";\r\nimport { IDataSource } from \"./IDataSource\";\r\nimport { IComponentBinding } from \"./IComponentBinding\";\r\nimport { IFormScreenLifecycle02 } from \"./IFormScreenLifecycle\";\r\nimport { IAction } from \"./IAction\";\r\nimport { IRefreshOnReturnType } from \"../WorkbenchLifecycle/WorkbenchLifecycle\";\r\nimport { IPanelConfiguration } from \"./IPanelConfiguration\";\r\nimport { CriticalSection } from \"utils/sync\";\r\nimport { ScreenPictureCache } from \"../ScreenPictureCache\";\r\nimport { DataViewCache } from \"../DataViewCache\";\r\n\r\n/*\r\nexport interface ILoadedFormScreenData {\r\n title: string;\r\n menuId: string;\r\n openingOrder: number;\r\n showInfoPanel: boolean;\r\n autoRefreshInterval: number;\r\n cacheOnClient: boolean;\r\n autoSaveOnListRecordChange: boolean;\r\n requestSaveAfterUpdate: boolean;\r\n dataViews: IDataView[];\r\n dataSources: IDataSource[];\r\n componentBindings: IComponentBinding[];\r\n screenUI: any;\r\n formScreenLifecycle: IFormScreenLifecycle;\r\n sessionId: string;\r\n}\r\n\r\nexport interface ILoadedFormScreen extends ILoadedFormScreenData {\r\n $type_ILoadedFormScreen: 1;\r\n\r\n isDirty: boolean;\r\n\r\n isLoading: false;\r\n rootDataViews: IDataView[];\r\n dontRequestData: boolean;\r\n\r\n getBindingsByChildId(childId: string): IComponentBinding[];\r\n getBindingsByParentId(parentId: string): IComponentBinding[];\r\n getDataViewByModelInstanceId(modelInstanceId: string): IDataView | undefined;\r\n getDataViewsByEntity(entity: string): IDataView[];\r\n getDataSourceByEntity(entity: string): IDataSource | undefined;\r\n\r\n toolbarActions: Array<{ section: string; actions: IAction[] }>;\r\n dialogActions: IAction[];\r\n\r\n setDirty(state: boolean): void;\r\n\r\n printMasterDetailTree(): void;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport interface ILoadingFormScreenData {\r\n formScreenLifecycle: IFormScreenLifecycle;\r\n}\r\n\r\nexport interface ILoadingFormScreen extends ILoadingFormScreenData {\r\n $type_ILoadingFormScreen: 1;\r\n\r\n isLoading: true;\r\n parent?: any;\r\n\r\n start(): void;\r\n}\r\n\r\nexport type IFormScreen = ILoadingFormScreen | ILoadedFormScreen;\r\n\r\nexport const isILoadingFormScreen = (o: any): o is ILoadingFormScreen =>\r\n o.$type_ILoadingFormScreen;\r\nexport const isILoadedFormScreen = (o: any): o is ILoadedFormScreen =>\r\n o.$type_ILoadedFormScreen; */\r\n\r\nexport interface IFormScreenEnvelopeData {\r\n formScreenLifecycle: IFormScreenLifecycle02;\r\n preloadedSessionId?: string;\r\n refreshOnReturnType?: IRefreshOnReturnType;\r\n}\r\n\r\nexport interface IFormScreenEnvelope extends IFormScreenEnvelopeData {\r\n $type_IFormScreenEnvelope: 1;\r\n\r\n isLoading: boolean;\r\n formScreen?: IFormScreen;\r\n\r\n setFormScreen(formScreen?: IFormScreen): void;\r\n\r\n start(initUIResult: any, preloadIsDirty?: boolean): Generator;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport interface IFormScreenData {\r\n title: string;\r\n menuId: string;\r\n dynamicTitleSource: string | undefined;\r\n openingOrder: number;\r\n autoWorkflowNext: boolean;\r\n showInfoPanel: boolean;\r\n showWorkflowCancelButton: boolean;\r\n showWorkflowNextButton: boolean;\r\n autoRefreshInterval: number;\r\n refreshOnFocus: boolean;\r\n cacheOnClient: boolean;\r\n suppressSave: boolean;\r\n suppressRefresh: boolean;\r\n autoSaveOnListRecordChange: boolean;\r\n requestSaveAfterUpdate: boolean;\r\n dataViews: IDataView[];\r\n dataSources: IDataSource[];\r\n componentBindings: IComponentBinding[];\r\n screenUI: any;\r\n panelConfigurations: Map;\r\n formScreenLifecycle: IFormScreenLifecycle02;\r\n sessionId: string;\r\n}\r\n\r\nexport interface IFormScreen extends IFormScreenData {\r\n $type_IFormScreen: 1;\r\n\r\n isDirty: boolean;\r\n\r\n isLoading: false;\r\n rootDataViews: IDataView[];\r\n nonRootDataViews: IDataView[];\r\n isLazyLoading: boolean;\r\n toolbarActions: Array<{ section: string; actions: IAction[] }>;\r\n dialogActions: IAction[];\r\n dynamicTitle: string | undefined;\r\n\r\n dataUpdateCRS: CriticalSection;\r\n\r\n pictureCache: ScreenPictureCache;\r\n dataViewCache: DataViewCache;\r\n\r\n clearDataCache(): void;\r\n\r\n getPanelPosition(id: string): number | undefined;\r\n\r\n getData(childEntity: string, modelInstanceId: string, parentRecordId: string, rootRecordId: string): Promise;\r\n\r\n getBindingsByChildId(childId: string): IComponentBinding[];\r\n\r\n getBindingsByParentId(parentId: string): IComponentBinding[];\r\n\r\n getDataViewByModelInstanceId(modelInstanceId: string): IDataView | undefined;\r\n\r\n getDataViewsByEntity(entity: string): IDataView[];\r\n\r\n getDataSourceByEntity(entity: string): IDataSource | undefined;\r\n\r\n getFirstFormPropertyId(): string | undefined;\r\n\r\n setPanelSize(id: string, size: number): void;\r\n\r\n setDirty(state: boolean): void;\r\n\r\n setTitle(title: string): void;\r\n\r\n printMasterDetailTree(): void;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport const isIFormScreenEnvelope = (o: any): o is IFormScreenEnvelope =>\r\n o.$type_IFormScreenEnvelope;\r\n\r\nexport const isIFormScreen = (o: any): o is IFormScreen => o.$type_IFormScreen;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from './getFormScreen';\r\n\r\nexport function getFormScreenLifecycle(ctx: any) {\r\n return getFormScreen(ctx).formScreenLifecycle;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport function reloadScreen(ctx: any) {\r\n return function*reloadScreen() {\r\n yield*getFormScreenLifecycle(ctx).refreshSession();\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IPanelViewType } from \"./IPanelViewType\";\r\nimport { IProperty } from \"./IProperty\";\r\nimport { IDataSource } from \"./IDataSource\";\r\nimport { IDataTable } from \"./IDataTable\";\r\nimport { IComponentBinding } from \"./IComponentBinding\";\r\nimport { IDataViewLifecycle } from \"../DataViewLifecycle/types/IDataViewLifecycle\";\r\nimport { ITablePanelView } from \"../TablePanelView/types/ITablePanelView\";\r\nimport { IFormPanelView } from \"../FormPanelView/types/IFormPanelView\";\r\nimport { IAction } from \"./IAction\";\r\nimport { ILookupLoader } from \"./ILookupLoader\";\r\nimport { ServerSideGrouper } from \"../ServerSideGrouper\";\r\nimport { ClientSideGrouper } from \"../ClientSideGrouper\";\r\nimport { IGridDimensions, IScrollState } from \"../../../gui/Components/ScreenElements/Table/types\";\r\nimport { ITableRow } from \"../../../gui/Components/ScreenElements/Table/TableRendering/types\";\r\nimport { BoundingRect } from \"react-measure\";\r\nimport { FormFocusManager } from \"../FormFocusManager\";\r\nimport { DataViewData } from \"../../../modules/DataView/DataViewData\";\r\nimport { DataViewAPI } from \"../../../modules/DataView/DataViewAPI\";\r\nimport { RowCursor } from \"../../../modules/DataView/TableCursor\";\r\nimport { IInfiniteScrollLoader } from \"gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { IAggregation } from \"./IAggregation\";\r\nimport { GridFocusManager } from \"../GridFocusManager\";\r\n\r\nexport interface IDataViewData {\r\n id: string;\r\n modelInstanceId: string;\r\n name: string;\r\n modelId: string;\r\n defaultPanelView: IPanelViewType;\r\n isHeadless: boolean;\r\n isMapSupported: boolean;\r\n disableActionButtons: boolean;\r\n showAddButton: boolean;\r\n showDeleteButton: boolean;\r\n showSelectionCheckboxesSetting: boolean;\r\n type: string;\r\n attributes: any;\r\n\r\n isGridHeightDynamic: boolean;\r\n selectionMember: string;\r\n orderMember: string;\r\n isDraggingEnabled: boolean;\r\n entity: string;\r\n dataMember: string;\r\n isRootGrid: boolean;\r\n isRootEntity: boolean;\r\n isPreloaded: boolean;\r\n requestDataAfterSelectionChange: boolean;\r\n confirmSelectionChange: boolean;\r\n properties: IProperty[];\r\n actions: IAction[];\r\n dataTable: IDataTable;\r\n formViewUI: any;\r\n activePanelView: IPanelViewType;\r\n tablePanelView: ITablePanelView;\r\n formPanelView: IFormPanelView;\r\n lifecycle: IDataViewLifecycle;\r\n lookupLoader: ILookupLoader;\r\n serverSideGrouper: ServerSideGrouper;\r\n clientSideGrouper: ClientSideGrouper;\r\n isFirst: boolean;\r\n newRecordView: string | undefined;\r\n\r\n dataViewRowCursor: RowCursor;\r\n dataViewApi: DataViewAPI;\r\n dataViewData: DataViewData;\r\n}\r\n\r\nexport interface IDataView extends IDataViewData {\r\n $type_IDataView: 1;\r\n\r\n orderProperty: IProperty | undefined;\r\n isBindingRoot: boolean;\r\n isBindingParent: boolean;\r\n isAnyBindingAncestorWorking: boolean;\r\n isWorking: boolean;\r\n parentBindings: IComponentBinding[];\r\n childBindings: IComponentBinding[];\r\n bindingRoot: IDataView;\r\n bindingParent: IDataView | undefined;\r\n isValidRowSelection: boolean;\r\n selectedRowId: string | undefined;\r\n selectedRowIndex: number | undefined;\r\n trueSelectedRowIndex: number | undefined;\r\n totalRowCount: number | undefined;\r\n selectedRow: any[] | undefined;\r\n dataSource: IDataSource;\r\n bindingParametersFromParent: { [key: string]: string };\r\n showSelectionCheckboxes: boolean;\r\n panelViewActions: IAction[];\r\n panelMenuActions: IAction[];\r\n toolbarActions: IAction[];\r\n dialogActions: IAction[];\r\n formFocusManager: FormFocusManager;\r\n gridFocusManager: GridFocusManager;\r\n firstEnabledDefaultAction: IAction | undefined;\r\n defaultActions: IAction[];\r\n aggregationData: IAggregation[];\r\n\r\n isSelected(id: string): boolean;\r\n\r\n hasSelectedRowId(id: string): boolean;\r\n\r\n selectedRowIds: Set;\r\n\r\n addSelectedRowId(id: string): void;\r\n\r\n removeSelectedRowId(id: string): void;\r\n\r\n setSelectedState(rowId: string, newState: boolean): void;\r\n\r\n selectNextRow(): void;\r\n\r\n selectPrevRow(): void;\r\n\r\n onFieldChange(event: any, row: any[], property: IProperty, value: any): void;\r\n\r\n loadFirstPage(): Generator;\r\n\r\n loadLastPage(): Generator;\r\n\r\n selectFirstRow(): void;\r\n\r\n selectLastRow(): void;\r\n\r\n reselectOrSelectFirst(): void;\r\n\r\n selectRow(row: any[]): void;\r\n\r\n setSelectedRowId(id: string | undefined): void;\r\n\r\n setRecords(rows: any[][]): Promise;\r\n\r\n appendRecords(rows: any[][]): void;\r\n\r\n substituteRecord(row: any[]): void;\r\n\r\n deleteRowAndSelectNext(row: any[]): void;\r\n\r\n clear(): void;\r\n\r\n navigateLookupLink(property: IProperty, row: any[]): Generator;\r\n\r\n saveViewState(): void;\r\n\r\n restoreViewState(): void;\r\n\r\n start(): void;\r\n\r\n stop(): void;\r\n\r\n scrollState: IScrollState;\r\n tableRows: ITableRow[];\r\n\r\n onReload(): void;\r\n\r\n gridDimensions: IGridDimensions;\r\n contentBounds: BoundingRect | undefined;\r\n infiniteScrollLoader: IInfiniteScrollLoader | undefined;\r\n\r\n parent?: any;\r\n\r\n moveSelectedRowUp(): void;\r\n\r\n moveSelectedRowDown(): void;\r\n\r\n setRowCount(rowCount: number | undefined): void;\r\n\r\n isTableViewActive: () => boolean;\r\n isFormViewActive: () => boolean;\r\n activateFormView: ((args: { saveNewState: boolean }) => Promise) | undefined;\r\n activateTableView: (() => Promise) | undefined;\r\n\r\n initializeNewScrollLoader(): void;\r\n\r\n exportToExcel(): void;\r\n\r\n isLazyLoading: Boolean;\r\n}\r\n\r\nexport const isIDataView = (o: any): o is IDataView => o?.$type_IDataView;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView, isIDataView } from \"../../entities/types/IDataView\";\r\n\r\nexport function getDataView(ctx: any): IDataView {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIDataView(cn)) {\r\n return cn;\r\n }\r\n if (!cn) return undefined as any;\r\n cn = cn?.parent;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport default {\r\n getIsSelectedRowId(ctx: any, id: string) {\r\n return getDataView(ctx).hasSelectedRowId(id);\r\n },\r\n getSelectedRowIds(ctx: any) {\r\n return getDataView(ctx).selectedRowIds;\r\n },\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { ICaptionPosition } from \"./ICaptionPosition\";\r\nimport { IPropertyColumn } from \"./IPropertyColumn\";\r\nimport { ILookup } from \"./ILookup\";\r\nimport { ILookupIndividualEngine } from \"../Property\";\r\n\r\nexport enum IDockType {\r\n Dock = \"Dock\",\r\n Fill = \"Fill\",\r\n}\r\n\r\nexport interface IPropertyData {\r\n id: string;\r\n tabIndex: string | undefined;\r\n modelInstanceId: string;\r\n name: string;\r\n readOnly: boolean;\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n captionLength: number;\r\n captionPosition?: ICaptionPosition;\r\n entity: string;\r\n column: IPropertyColumn;\r\n dock?: IDockType;\r\n multiline: boolean;\r\n isPassword: boolean;\r\n isRichText: boolean;\r\n maxLength: number;\r\n gridColumnWidth: number;\r\n columnWidth: number;\r\n formatterPattern: string;\r\n modelFormatterPattern: string;\r\n customNumericFormat?: string;\r\n isAggregatedColumn: boolean;\r\n isLookupColumn: boolean;\r\n autoSort: boolean;\r\n toolTip: string;\r\n suppressEmptyColumns: boolean;\r\n supportsServerSideSorting: boolean;\r\n\r\n controlPropertyValue?: string;\r\n controlPropertyId?: string;\r\n parameters?: any;\r\n allowReturnToForm?: boolean;\r\n isTree?: boolean;\r\n style: any;\r\n identifier?: string;\r\n lookup?: ILookup;\r\n lookupId?: string;\r\n xmlNode: any;\r\n fieldType: string;\r\n}\r\n\r\nexport interface IProperty extends IPropertyData {\r\n $type_IProperty: 1;\r\n\r\n dataSourceIndex: number;\r\n dataIndex: number;\r\n isLookup: boolean;\r\n lookupEngine?: ILookupIndividualEngine;\r\n\r\n childProperties: IProperty[];\r\n linkToMenuId?: string;\r\n linkDependsOnValue: boolean;\r\n isLink: boolean;\r\n nameOverride: string | null | undefined;\r\n isFormField: boolean;\r\n\r\n\r\n getPolymophicProperty(row: any[]): IProperty;\r\n\r\n setColumnWidth(width: number): void;\r\n\r\n stop(): void;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport const isIProperty = (o: any): o is IProperty => o.$type_IProperty;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty, isIProperty } from \"../../entities/types/IProperty\";\r\n\r\nexport function getProperty(ctx: any): IProperty {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIProperty(cn)) {\r\n return cn;\r\n }\r\n cn = cn.parent;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\nexport function getMainMenuEnvelope(ctx: any) {\r\n return getWorkbench(ctx).mainMenuEnvelope;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IMainMenu } from \"../../entities/types/IMainMenu\";\r\nimport { getMainMenuEnvelope } from \"./getMainMenuEnvelope\";\r\n\r\nexport function getMainMenu(ctx: any): IMainMenu | undefined {\r\n return getMainMenuEnvelope(ctx).mainMenu;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getMainMenu } from \"model/selectors/MainMenu/getMainMenu\"\r\n\r\nexport default {\r\n getItemById(ctx: any, id: string) {\r\n // TODO: What if MainMenu is not yet loaded?\r\n return getMainMenu(ctx)!.getItemById(id);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApi } from \"model/selectors/getApi\";\r\n\r\nfunction getCookie(name: string): string {\r\n const value = \"; \" + document.cookie;\r\n const parts = value.split(\"; \" + name + \"=\");\r\n\r\n if (parts.length === 2) {\r\n const cookieValue = parts.pop()!.split(\";\").shift();\r\n return cookieValue ? cookieValue : \"\";\r\n }\r\n return \"\";\r\n}\r\n\r\nlet _locale: any;\r\n\r\nexport function getLocaleFromCookie(): string {\r\n if (!_locale) {\r\n const cookieValue = unescape(getCookie(\"origamCurrentLocale\"));\r\n const pattern = /c=([a-zA-Z-]+)\\|/i;\r\n const results = cookieValue.match(pattern);\r\n if (results) {\r\n _locale = results[1];\r\n } else {\r\n throw new Error(\"Locale cookie was not found. Was the function \\\"initLocaleCookie\\\" called?\");\r\n }\r\n }\r\n return _locale;\r\n}\r\n\r\nexport interface IDefaultDateFormats {\r\n defaultDateSeparator: string;\r\n defaultTimeSeparator: string;\r\n defaultDateTimeSeparator: string;\r\n defaultDateSequence: DateSequence;\r\n defaultLongDateFormat: string;\r\n defaultShortDateFormat: string;\r\n defaultTimeFormat: string;\r\n}\r\n\r\nexport enum DateSequence {\r\n DayMonthYear = 0, MonthDayYear = 1\r\n}\r\n\r\nexport function parseDateSequence(candidate: string) {\r\n switch (candidate) {\r\n case \"DayMonthYear\":\r\n return DateSequence.DayMonthYear;\r\n case \"MonthDayYear\":\r\n return DateSequence.MonthDayYear;\r\n default:\r\n throw new Error(\"Cannot parse \\\"\" + candidate + \"\\\" to DateSequence\")\r\n }\r\n}\r\n\r\nlet _defaultDateFormats: IDefaultDateFormats | undefined;\r\n\r\nexport function getDefaultCsDateFormatDataFromCookie(): IDefaultDateFormats {\r\n if (!_defaultDateFormats) {\r\n const cookieValue = unescape(getCookie(\"origamCurrentLocale\"));\r\n try {\r\n const parameters = getCookieParameters(cookieValue);\r\n\r\n _defaultDateFormats = {\r\n defaultDateSeparator: getParameter(\"defaultDateSeparator\", parameters),\r\n defaultTimeSeparator: getParameter(\"defaultTimeSeparator\", parameters),\r\n defaultDateTimeSeparator: getParameter(\"defaultDateTimeSeparator\", parameters),\r\n defaultDateSequence: parseDateSequence(getParameter(\"defaultDateSequence\", parameters)),\r\n defaultLongDateFormat: getParameter(\"defaultLongDateFormat\", parameters),\r\n defaultShortDateFormat: getParameter(\"defaultShortDateFormat\", parameters),\r\n defaultTimeFormat: getParameter(\"defaultTimeFormat\", parameters),\r\n }\r\n } catch (error) {\r\n throw new Error(\"Could not parse locale cookie value \\\"\" + cookieValue + \"\\\". \" + error);\r\n }\r\n }\r\n return _defaultDateFormats;\r\n}\r\n\r\nfunction getCookieParameters(cookieValue: string) {\r\n return cookieValue\r\n .split(\"|\")\r\n .map(pair => pair.split(\"=\"))\r\n .reduce(function (map: { [key: string]: string }, pair) {\r\n map[pair[0]] = pair[1];\r\n return map;\r\n }, {});\r\n}\r\n\r\nfunction isValidLocalizationCookie(cookieValue: string) {\r\n if (!cookieValue) {\r\n return false;\r\n }\r\n try {\r\n getDefaultCsDateFormatDataFromCookie();\r\n return true;\r\n } catch (e) {\r\n console.warn(\"Error when parsing localization cookie:\" + e); // eslint-disable-line no-console\r\n return false;\r\n }\r\n}\r\n\r\nfunction getParameter(name: string, parameters: { [key: string]: string }) {\r\n let value = parameters[name];\r\n if (value === undefined || value === null) {\r\n throw new Error(\"Parameter named \\\"\" + name + \"\\\" was not found\");\r\n }\r\n return value;\r\n}\r\n\r\nexport async function initLocaleCookie(ctx: any) {\r\n const cookieValue = unescape(getCookie(\"origamCurrentLocale\"));\r\n if (isValidLocalizationCookie(cookieValue)) {\r\n return;\r\n }\r\n const api = getApi(ctx);\r\n document.cookie = \"origamCurrentLocale=\" + await api.defaultLocalizationCookie();\r\n\r\n const newCookieValue = unescape(getCookie(\"origamCurrentLocale\"));\r\n if (!isValidLocalizationCookie(newCookieValue)) {\r\n throw new Error(\"Could not parse localization cookie: \" + newCookieValue);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport selectionCheckboxes from \"./selectionCheckboxes\";\r\nimport column from \"./column\";\r\nimport mainMenu from \"./mainMenu\";\r\nimport error from \"./error\";\r\n\r\nexport default {\r\n selectionCheckboxes,\r\n column,\r\n mainMenu,\r\n error\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getProperty } from \"model/selectors/DataView/getProperty\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\n\r\nexport default {\r\n isLinkToForm(ctx: any) {\r\n return getProperty(ctx).isLink;\r\n },\r\n\r\n async getLinkMenuId(ctx: any, value: any) {\r\n const property = getProperty(ctx);\r\n if (property.linkDependsOnValue) {\r\n const api = getApi(ctx);\r\n return await api.getMenuId({\r\n LookupId: property.lookupId!,\r\n ReferenceId: value\r\n });\r\n }\r\n return property.linkToMenuId;\r\n }\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IErrorDialogController } from \"model/entities/types/IErrorDialog\";\r\nimport { getApplication } from \"model/selectors/getApplication\";\r\n\r\nexport default {\r\n getDialogController(ctx: any): IErrorDialogController {\r\n return getApplication(ctx).errorDialogController;\r\n }\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\nexport function getWorkQueues(ctx: any) {\r\n return getWorkbench(ctx).workQueues;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkQueues } from \"model/selectors/WorkQueues/getWorkQueues\"\r\n\r\nexport function stopWorkQueues(ctx: any) {\r\n return function*stopWorkQueues() {\r\n yield*(getWorkQueues(ctx)!.stopTimer());\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IApplicationLifecycle } from \"../entities/types/IApplicationLifecycle\";\r\nimport { getApplication } from \"./getApplication\";\r\n\r\nexport function getApplicationLifecycle(ctx: any): IApplicationLifecycle {\r\n return getApplication(ctx).applicationLifecycle;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApplicationLifecycle } from \"model/selectors/getApplicationLifecycle\"\r\n\r\nexport function performLogout(ctx: any) {\r\n return function*performLogout() {\r\n yield*getApplicationLifecycle(ctx).performLogout();\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport axios from \"axios\";\r\nimport { getLocaleFromCookie } from \"./cookies\";\r\n\r\nconst debugShowTranslations = window.localStorage.getItem(\"debugShowTranslations\") === \"true\";\r\n\r\nlet translations = {} as { [k: string]: string };\r\n\r\nexport async function translationsInit(ctx: any) {\r\n const locale = getLocaleFromCookie();\r\n try {\r\n const result = await axios.get(`locale/localization_${locale}.json`, {});\r\n translations = result.data\r\n } catch (error) {\r\n if (error.response.status === 404) {\r\n const localeParent = locale.split(\"-\")[0]\r\n axios.get(`locale/localization_${localeParent}.json`, {})\r\n .then(result => translations = result.data)\r\n .catch(error2 => console.error(error2)) /* eslint-disable-line no-console */\r\n }\r\n console.error(error) /* eslint-disable-line no-console */\r\n }\r\n}\r\n\r\nexport function T(defaultContent: any, translKey: string, ...p: any[]) {\r\n let result;\r\n let showingDefault = false;\r\n if (translations.hasOwnProperty(translKey)) {\r\n result = translations[translKey];\r\n } else {\r\n result = defaultContent;\r\n showingDefault = true;\r\n }\r\n for (let i = 0; i < p.length; i++) {\r\n result = result.replace(`{${i}}`, p[i]);\r\n }\r\n if (debugShowTranslations) {\r\n if (showingDefault) {\r\n console.error(`Could not find translation for: \"${translKey}\", showing default: \"${result}\"`); // eslint-disable-line no-console\r\n return (\r\n \r\n {result}\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {result}\r\n \r\n );\r\n }\r\n } else {\r\n return result;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport selectors from \"model/selectors-tree\";\r\nimport { stopWorkQueues } from \"./WorkQueues/stopWorkQueues\";\r\nimport { performLogout } from \"./User/performLogout\";\r\nimport { T } from \"utils/translation\";\r\nimport { flow } from \"mobx\";\r\n\r\nconst HANDLED = Symbol(\"_$ErrorHandled\");\r\n\r\nexport function handleError(ctx: any) {\r\n return function*handleError(error: any) {\r\n if (error.response && error.response.status === 474) {\r\n // 747 ~ ServerObjectDisposed happens when the user closes a form before all pending requests have\r\n // finished (RowStates for example)\r\n return;\r\n }\r\n if (error.response && error.response.status === 401) {\r\n yield*stopWorkQueues(ctx)();\r\n selectors.error.getDialogController(ctx).dismissErrors();\r\n yield*selectors.error.getDialogController(ctx).pushError(\r\n T(\r\n `Your request is no longer authorized, which means that \r\n you were either logged out or your session expired. Please log in again.`,\r\n \"request_no_longer_authorized\"\r\n )\r\n );\r\n yield*performLogout(ctx)();\r\n return;\r\n } else {\r\n if (error[HANDLED]) {\r\n yield error[HANDLED];\r\n return;\r\n }\r\n const promise = flow(() => selectors.error.getDialogController(ctx).pushError(error))()\r\n error[HANDLED] = promise;\r\n yield promise;\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IActionResultType {\r\n UpdateData = \"UpdateData\",\r\n RefreshData = \"RefreshData\",\r\n OpenForm = \"OpenForm\",\r\n OpenUrl = \"OpenUrl\",\r\n ChangeUI = \"ChangeUI\",\r\n DestroyForm = \"DestroyForm\",\r\n Script = \"Script\"\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { observer } from \"mobx-react\";\r\nimport CS from \"./DialogsCommon.module.css\";\r\nimport { T } from \"../../../utils/translation\";\r\n\r\n@observer\r\nexport class QuestionSaveData extends React.Component<{\r\n screenTitle: string;\r\n onSaveClick?: (event: any) => void;\r\n onDontSaveClick?: (event: any) => void;\r\n onCancelClick?: (event: any) => void;\r\n}> {\r\n refPrimaryBtn = (elm: any) => (this.elmPrimaryBtn = elm);\r\n elmPrimaryBtn: any;\r\n\r\n componentDidMount() {\r\n setTimeout(() => {\r\n if (this.elmPrimaryBtn) {\r\n this.elmPrimaryBtn.focus?.();\r\n }\r\n }, 150);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n {T(\"Save\", \"save\")}\r\n \r\n \r\n {T(\"Don't Save\", \"close_without_saving\")}\r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n {T(\"Do you wish to save changes in {0}?\", \"do_you_wish_to_save\", this.props.screenTitle)}\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"../DataView/getDataView\";\r\n\r\nexport function getTablePanelView(ctx: any) {\r\n return getDataView(ctx)?.tablePanelView;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDialogInfo, IOpenedScreen, IOpenedScreenData } from \"./types/IOpenedScreen\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { IFormScreenEnvelope } from \"./types/IFormScreen\";\r\nimport { IMainMenuItemType } from \"./types/IMainMenu\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport class DialogInfo implements IDialogInfo {\r\n constructor(public width: number, public height: number) {\r\n }\r\n}\r\n\r\nexport class OpenedScreen implements IOpenedScreen {\r\n dialogInfo?: IDialogInfo | undefined;\r\n parentContext: IOpenedScreen | undefined;\r\n $type_IOpenedScreen: 1 = 1;\r\n parentSessionId: string | undefined;\r\n\r\n isBeingClosed = false;\r\n\r\n constructor(data: IOpenedScreenData) {\r\n Object.assign(this, data);\r\n this.content.parent = this;\r\n }\r\n\r\n @observable stackPosition: number = 0;\r\n @observable isActive = false;\r\n lazyLoading: boolean = false;\r\n menuItemId: string = \"\";\r\n menuItemType: IMainMenuItemType = null as any;\r\n order: number = 0;\r\n _title: string = \"\";\r\n @observable isSleeping?: boolean = false;\r\n @observable isSleepingDirty?: boolean = false;\r\n isClosed: boolean = false;\r\n @observable content: IFormScreenEnvelope = null as any;\r\n parameters: { [key: string]: any } = {};\r\n\r\n get tabTitle() {\r\n return this.content.formScreen?.dynamicTitle ?? this._title;\r\n }\r\n\r\n get formTitle() {\r\n return this.content.formScreen?.dynamicTitle ?? this.content.formScreen?.title ?? \"\";\r\n }\r\n\r\n get hasDynamicTitle() {\r\n return !!this.content.formScreen?.dynamicTitle\r\n }\r\n\r\n set tabTitle(value: string) {\r\n this._title = value;\r\n }\r\n\r\n @computed get isDialog() {\r\n return this.dialogInfo !== undefined;\r\n }\r\n\r\n @action.bound\r\n setActive(state: boolean): void {\r\n this.isActive = state;\r\n if (state && this.content.formScreen) {\r\n const dataView = this.content.formScreen.dataViews.length > 0\r\n ? this.content.formScreen.dataViews[0]\r\n : undefined;\r\n if (dataView && !dataView.isFormViewActive()) {\r\n const tablePanelView = getTablePanelView(dataView);\r\n tablePanelView.triggerOnFocusTable();\r\n }\r\n }\r\n }\r\n\r\n @action.bound\r\n setContent(screen: IFormScreenEnvelope): void {\r\n this.content = screen;\r\n screen.parent = this;\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IActionParameter } from \"./IActionParameter\";\r\n\r\n\r\nexport enum IActionType {\r\n Report = \"Report\",\r\n ChangeUI = \"ChangeUI\",\r\n OpenForm = \"OpenForm\",\r\n Workflow = \"Workflow\",\r\n QueueAction = \"QueueAction\",\r\n SelectionDialogAction = \"SelectionDialogAction\",\r\n Dropdown = \"Dropdown\"\r\n}\r\n\r\nexport enum IActionPlacement {\r\n PanelHeader = \"PanelHeader\",\r\n Toolbar = \"Toolbar\",\r\n PanelMenu = \"PanelMenu\"\r\n}\r\n\r\nexport enum IActionMode {\r\n MultipleCheckboxes = \"MultipleCheckboxes\",\r\n ActiveRecord = \"ActiveRecord\",\r\n Always = \"Always\"\r\n}\r\n\r\nexport interface IActionData {\r\n type: IActionType;\r\n id: string;\r\n groupId: string;\r\n caption: string;\r\n placement: IActionPlacement;\r\n iconUrl: string;\r\n mode: IActionMode;\r\n isDefault: boolean;\r\n parameters: IActionParameter[];\r\n confirmationMessage?: string;\r\n}\r\n\r\nexport interface IAction extends IActionData {\r\n $type_IAction: 1;\r\n isEnabled: boolean;\r\n parent?: any;\r\n}\r\n\r\nexport const isIAction = (o: any): o is IAction => o.$type_IAction;","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isIAction } from \"model/entities/types/IAction\";\r\n\r\nexport function getAction(ctx: any) {\r\n let cn = ctx;\r\n while (!isIAction(cn)) cn = cn.parent;\r\n return cn;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\"\r\n\r\nexport default {\r\n refresh(ctx: any) {\r\n return function*refresh() {\r\n yield*getFormScreenLifecycle(ctx).refreshSession();\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IUrlUpenMethod {\r\n OrigamTab = \"OrigamTab\"\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport formScreen from \"./formScreen\";\r\nimport error from \"./error\";\r\nimport selectionCheckboxes from \"model/selectors-tree/selectionCheckboxes\";\r\n\r\nexport default {\r\n selectionCheckboxes,\r\n formScreen,\r\n error\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IUrlUpenMethod } from \"model/entities/types/IUrlOpenMethod\";\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function openNewUrl(ctx: any) {\r\n return function*openNewUrl(\r\n url: string,\r\n urlOpenMethod: IUrlUpenMethod,\r\n title: string\r\n ) {\r\n switch (urlOpenMethod) {\r\n case IUrlUpenMethod.OrigamTab:\r\n yield*getWorkbenchLifecycle(ctx).openNewUrl(url, title);\r\n break;\r\n default:\r\n // TODO: Transform url to be absolute to urlroot?\r\n const win = window.open(`${url}`, \"_blank\");\r\n win && win.focus();\r\n break;\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from '../FormScreen/getFormScreen';\r\n\r\nexport function getDataViewsByEntity(ctx: any, entity: string) {\r\n return getFormScreen(ctx).getDataViewsByEntity(entity);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from '../FormScreen/getFormScreen';\r\n\r\nexport function getDataSourceByEntity(ctx: any, entity: string) {\r\n return getFormScreen(ctx).getDataSourceByEntity(entity);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStatesByEntity } from \"model/selectors/RowState/getRowStatesByEntity\";\r\n\r\nexport function putRowStateValue(ctx: any) {\r\n return function putRowStateValue(entity: string, state: any) {\r\n const rowStates = getRowStatesByEntity(ctx, entity);\r\n rowStates && rowStates.putValue(state);\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSourceByEntity } from \"../DataSources/getDataSourceByEntity\";\r\n\r\nexport function getRowStatesByEntity(ctx: any, entity: string) {\r\n const dataSource = getDataSourceByEntity(ctx, entity);\r\n const rowStates = dataSource ? dataSource.rowState : undefined;\r\n return rowStates;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"./getFormScreen\";\r\n\r\nexport function getDataViewList(ctx: any) {\r\n return getFormScreen(ctx).dataViews;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getIsBindingRoot(ctx: any) {\r\n return getDataView(ctx).isBindingRoot;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"../FormScreen/getFormScreen\";\r\n\r\nexport function getDataSources(ctx: any) {\r\n return getFormScreen(ctx).dataSources\r\n}","import { DataViewCache } from \"../../entities/DataViewCache\";\r\nimport { getFormScreen } from \"./getFormScreen\";\r\n\r\nexport function getDataViewCache(ctx: any): DataViewCache {\r\n return getFormScreen(ctx).dataViewCache;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataViewsByEntity } from \"../../selectors/DataView/getDataViewsByEntity\";\r\nimport _ from \"lodash\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { putRowStateValue } from \"../RowStates/putRowStateValue\";\r\nimport { reloadScreen } from \"../FormScreen/reloadScreen\";\r\nimport { getDataViewList } from \"model/selectors/FormScreen/getDataViewList\";\r\nimport { getIsBindingRoot } from \"model/selectors/DataView/getIsBindingRoot\";\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\nimport { getDataSources } from \"model/selectors/DataSources/getDataSources\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { getDataViewCache } from \"../../selectors/FormScreen/getDataViewCache\";\r\n\r\nexport enum IResponseOperation {\r\n DeleteAllData = -2,\r\n Delete = -1, // OK\r\n Update = 0, // OK\r\n Create = 1, // OK\r\n FormSaved = 2, // OK ? - TODO: Check\r\n FormNeedsRefresh = 3,\r\n CurrentRecordNeedsUpdate = 4,\r\n RefreshPortal = 5,\r\n}\r\n\r\nexport interface ICRUDResult {\r\n entity: string;\r\n objectId: string;\r\n operation: IResponseOperation;\r\n requestingGrid: string | null;\r\n state: string | null;\r\n wrappedObject: any[];\r\n}\r\n\r\nexport function*processCRUDResult(ctx: any, result: ICRUDResult,\r\n resortTables?: boolean | undefined,\r\n sourceDataView?: IDataView): Generator {\r\n if (_.isArray(result)) {\r\n for (let resultItem of result) {\r\n yield*processCRUDResult(ctx, resultItem, resortTables, sourceDataView);\r\n }\r\n return;\r\n }\r\n // console.log(result)\r\n const resultItem = result;\r\n if (resultItem.state) {\r\n // TODO: Context for all CRUD ops?\r\n // TODO: Actions are pre data view vs state is related to entity?\r\n putRowStateValue(ctx)(resultItem.entity, resultItem.state);\r\n }\r\n switch (resultItem.operation) {\r\n case IResponseOperation.Update: {\r\n const dataViews = getDataViewsByEntity(ctx, resultItem.entity);\r\n for (let dataView of dataViews) {\r\n dataView.dataTable.clearRecordDirtyValues(resultItem.objectId, resultItem.wrappedObject);\r\n dataView.substituteRecord(resultItem.wrappedObject);\r\n getDataViewCache(dataView).UpdateData(dataView);\r\n if (resortTables) {\r\n yield dataView.dataTable.updateSortAndFilter({retainPreviousSelection: true});\r\n }\r\n if (!dataView.selectedRow) {\r\n dataView.reselectOrSelectFirst();\r\n }\r\n dataView.formFocusManager.stopAutoFocus();\r\n dataView.gridFocusManager.focusTableIfNeeded();\r\n }\r\n getFormScreen(ctx).setDirty(true);\r\n break;\r\n }\r\n case IResponseOperation.Create: {\r\n const dataViews = getDataViewsByEntity(ctx, resultItem.entity);\r\n for (let dataView of dataViews) {\r\n const tablePanelView = dataView.tablePanelView;\r\n const dataSourceRow = result.wrappedObject;\r\n const shouldLockNewRowAtTop = sourceDataView?.modelInstanceId === dataView.modelInstanceId;\r\n\r\n if (dataView.isLazyLoading) {\r\n yield dataView.dataTable.insertRecord(tablePanelView.firstVisibleRowIndex, dataSourceRow, shouldLockNewRowAtTop);\r\n try {\r\n dataView.lifecycle.stopSelectedRowReaction();\r\n dataView.selectRow(dataSourceRow);\r\n yield*dataView.lifecycle.changeMasterRow();\r\n } finally {\r\n dataView.lifecycle.startSelectedRowReaction();\r\n }\r\n } else {\r\n yield dataView.dataTable.insertRecord(dataView.tableRows.length, dataSourceRow, shouldLockNewRowAtTop);\r\n dataView.selectRow(dataSourceRow);\r\n }\r\n getDataViewCache(dataView).UpdateData(dataView);\r\n }\r\n getFormScreen(ctx).setDirty(true);\r\n break;\r\n }\r\n case IResponseOperation.Delete: {\r\n const dataViews = getDataViewsByEntity(ctx, resultItem.entity);\r\n for (let dataView of dataViews) {\r\n const row = dataView.dataTable.getRowById(resultItem.objectId);\r\n if (row) {\r\n dataView.deleteRowAndSelectNext(row);\r\n getDataViewCache(dataView).UpdateData(dataView);\r\n }\r\n }\r\n getFormScreen(ctx).setDirty(true);\r\n break;\r\n }\r\n case IResponseOperation.FormSaved: {\r\n getFormScreen(ctx).setDirty(false);\r\n const workbench = getWorkbench(ctx);\r\n const {cacheDependencies, lookupCleanerReloaderById} = workbench.lookupMultiEngine;\r\n const dataSources = getDataSources(ctx);\r\n const collectedLookupIds = cacheDependencies.getDependencyLookupIdsByCacheKeys(\r\n dataSources.map((ds) => ds.lookupCacheKey)\r\n );\r\n for (let lookupId of collectedLookupIds) {\r\n lookupCleanerReloaderById.get(lookupId)?.reloadLookupLabels();\r\n workbench.lookupListCache.deleteLookup(lookupId);\r\n }\r\n break;\r\n }\r\n case IResponseOperation.CurrentRecordNeedsUpdate: {\r\n // TODO: Throw away all data and force further navigation / throw away all rowstates\r\n const dataViews = getDataViewList(ctx);\r\n for (let dataView of dataViews) {\r\n if (getIsBindingRoot(dataView) && dataView.requestDataAfterSelectionChange) {\r\n yield*dataView.lifecycle.changeMasterRow();\r\n yield*dataView.lifecycle.navigateChildren();\r\n }\r\n if (!dataView.selectedRow) {\r\n dataView.reselectOrSelectFirst();\r\n }\r\n }\r\n break;\r\n }\r\n case IResponseOperation.FormNeedsRefresh: {\r\n if (!getFormScreen(ctx).suppressRefresh) {\r\n yield*reloadScreen(ctx)(); // TODO: It is not possible to reload data... Has to be done by different API endpoint\r\n }\r\n break;\r\n }\r\n case IResponseOperation.DeleteAllData: {\r\n const dataViews = getDataViewList(ctx);\r\n for (let dataView of dataViews) {\r\n dataView.clear();\r\n }\r\n break;\r\n }\r\n default:\r\n throw new Error(\"Unknown operation \" + resultItem.operation);\r\n }\r\n //}\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getMainMenu } from \"./getMainMenu\";\r\n\r\nconst BREAK_RECURSION = Symbol(\"BREAK_RECURSION\");\r\n\r\nexport function getMainMenuItemById(ctx: any, id: string) {\r\n const rawMenu = getMainMenu(ctx)!.menuUI;\r\n let result: any;\r\n\r\n function recursive(node: any) {\r\n if (node.attributes.id === id) {\r\n result = node;\r\n throw BREAK_RECURSION;\r\n }\r\n for (let child of node.elements) {\r\n recursive(child);\r\n }\r\n }\r\n\r\n try {\r\n recursive(rawMenu);\r\n } catch (e) {\r\n if (e === BREAK_RECURSION) {\r\n return result;\r\n }\r\n throw e;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IActionResultType } from \"../SelectionDialog/types\";\r\nimport { getWorkbenchLifecycle } from \"../../selectors/getWorkbenchLifecycle\";\r\nimport { DialogInfo } from \"model/entities/OpenedScreen\";\r\nimport { closeForm } from \"../closeForm\";\r\nimport { getActionCaption } from \"model/selectors/Actions/getActionCaption\";\r\nimport { IMainMenuItemType } from \"model/entities/types/IMainMenu\";\r\nimport { IDialogInfo } from \"model/entities/types/IOpenedScreen\";\r\n\r\nimport actions from \"model/actions-tree\";\r\nimport { IUrlUpenMethod } from \"model/entities/types/IUrlOpenMethod\";\r\nimport { openNewUrl } from \"../Workbench/openNewUrl\";\r\nimport { ICRUDResult, processCRUDResult } from \"../DataLoading/processCRUDResult\";\r\nimport { IRefreshOnReturnType } from \"model/entities/WorkbenchLifecycle/WorkbenchLifecycle\";\r\nimport { IDataView } from \"../../entities/types/IDataView\";\r\nimport { getDataViewByModelInstanceId } from \"../../selectors/DataView/getDataViewByModelInstanceId\";\r\nimport { getOpenedScreen } from \"../../selectors/getOpenedScreen\";\r\nimport { getMainMenuItemById } from \"model/selectors/MainMenu/getMainMenuItemById\";\r\n\r\nexport interface IOpenNewForm {\r\n (\r\n id: string,\r\n type: IMainMenuItemType,\r\n label: string,\r\n isLazyLoading: boolean,\r\n dialogInfo: IDialogInfo | undefined,\r\n parameters: { [key: string]: any },\r\n parentContext: any,\r\n requestParameters: object,\r\n formSessionId?: string,\r\n isSessionRebirth?: boolean,\r\n registerSession?: true,\r\n refreshOnReturnType?: IRefreshOnReturnType\r\n ): Generator; //boolean\r\n}\r\n\r\nexport interface IOpenNewUrl {\r\n (url: string, urlOpenMethod: IUrlUpenMethod, title: string): Generator;\r\n}\r\n\r\nexport interface IGetActionCaption {\r\n (): string;\r\n}\r\n\r\nexport interface ICloseForm {\r\n (): Generator;\r\n}\r\n\r\nexport interface IRefreshForm {\r\n (): Generator;\r\n}\r\n\r\nexport interface IProcessCRUDResult {\r\n (data: { crudResult: ICRUDResult, resortTables?: boolean }): Generator;\r\n}\r\n\r\nexport function new_ProcessActionResult(ctx: any) {\r\n const workbenchLifecycle = getWorkbenchLifecycle(ctx);\r\n const getPanelFunc = (modelInstanceId: string) => getDataViewByModelInstanceId(ctx, modelInstanceId)!;\r\n return processActionResult2({\r\n getPanelFunc: getPanelFunc,\r\n openNewForm: workbenchLifecycle.openNewForm,\r\n openNewUrl: openNewUrl(ctx),\r\n closeForm: closeForm(ctx),\r\n refreshForm: actions.formScreen.refresh(ctx),\r\n getActionCaption: () => getActionCaption(ctx),\r\n processCRUDResult: (data: { crudResult: ICRUDResult, resortTables?: boolean }) => processCRUDResult(ctx, data.crudResult, data.resortTables),\r\n parentContext: ctx\r\n });\r\n}\r\n\r\nexport function processActionResult2(dep: {\r\n getPanelFunc: (modelInstanceId: string) => IDataView;\r\n openNewForm: IOpenNewForm;\r\n openNewUrl: IOpenNewUrl;\r\n closeForm: ICloseForm;\r\n refreshForm: IRefreshForm;\r\n getActionCaption: IGetActionCaption;\r\n processCRUDResult: IProcessCRUDResult;\r\n parentContext: any\r\n}) {\r\n return function*processActionResult2(actionResultList: any[]) {\r\n const indexedList = actionResultList.map((item, index) => [index, item]);\r\n indexedList.sort((a: any, b: any) => {\r\n if (a[1].type === IActionResultType.DestroyForm) return -1;\r\n if (b[1].type === IActionResultType.DestroyForm) return 1;\r\n return a[0] - b[0]\r\n })\r\n for (let actionResultItem of indexedList.map(item => item[1])) {\r\n switch (actionResultItem.type) {\r\n case IActionResultType.OpenForm: {\r\n const menuItem = getMainMenuItemById(dep.parentContext, actionResultItem.request.objectId);\r\n const lazyLoading = menuItem\r\n ? menuItem?.attributes?.lazyLoading === \"true\"\r\n : false;\r\n const {request, refreshOnReturnType} = actionResultItem;\r\n const {\r\n objectId,\r\n typeString,\r\n parameters,\r\n isModalDialog,\r\n dialogWidth,\r\n dialogHeight,\r\n caption\r\n } = request;\r\n const dialogInfo = isModalDialog ? new DialogInfo(dialogWidth, dialogHeight) : undefined;\r\n yield*dep.openNewForm(\r\n objectId,\r\n typeString,\r\n caption || dep.getActionCaption(),\r\n lazyLoading,\r\n dialogInfo,\r\n parameters,\r\n dep.parentContext,\r\n actionResultItem.request,\r\n undefined,\r\n undefined,\r\n undefined,\r\n refreshOnReturnType,\r\n );\r\n break;\r\n }\r\n case IActionResultType.DestroyForm: {\r\n yield*dep.closeForm();\r\n break;\r\n }\r\n case IActionResultType.RefreshData: {\r\n yield*dep.refreshForm();\r\n break;\r\n }\r\n case IActionResultType.UpdateData: {\r\n yield*dep.processCRUDResult(\r\n {crudResult: actionResultItem.changes, resortTables: true}\r\n );\r\n break;\r\n }\r\n case IActionResultType.OpenUrl: {\r\n yield*dep.openNewUrl(\r\n actionResultItem.url,\r\n actionResultItem.urlOpenMethod,\r\n actionResultItem.request.caption\r\n );\r\n if (getOpenedScreen(dep.parentContext).isDialog) {\r\n yield*dep.closeForm();\r\n }\r\n break;\r\n }\r\n case IActionResultType.Script: {\r\n try {\r\n // eslint-disable-next-line no-new-func\r\n const actionScript = new Function(\"getPanel\", actionResultItem.script);\r\n actionScript(dep.getPanelFunc);\r\n } catch (e) {\r\n let message = \"An error occurred while executing custom script: \" + actionResultItem.script + \", \\n\" + e.message;\r\n if (e.stackTrace)\r\n message += (\", \\n\" + e.stackTrace);\r\n throw new Error(message)\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"../../entities/types/IDataView\";\r\nimport { getOpenedScreen } from \"../getOpenedScreen\";\r\n\r\nexport function getDataViewByModelInstanceId(ctx: any, modelInstanceId: string): IDataView | undefined {\r\n return getOpenedScreen(ctx).content.formScreen!.dataViews.find(\r\n item => item.modelInstanceId === modelInstanceId\r\n );\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getAction } from \"./getAction\";\r\n\r\nexport function getActionCaption(ctx: any) {\r\n return getAction(ctx).caption;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"./getWorkbench\";\r\n\r\nexport function getSearcher(ctx: any) {\r\n return getWorkbench(ctx).searcher;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getSearcher } from \"model/selectors/getSearcher\";\r\nimport { getWorkQueues } from \"model/selectors/WorkQueues/getWorkQueues\";\r\n\r\nexport function refreshWorkQueues(ctx: any) {\r\n return function*refreshWorkQueues() {\r\n const workQueues = getWorkQueues(ctx);\r\n yield*workQueues.getWorkQueueList();\r\n getSearcher(ctx).indexWorkQueues(workQueues.items);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataSourceField } from \"./IDataSourceField\";\r\nimport { IRowState } from \"./IRowState\";\r\n\r\nexport interface IDataSourceData {\r\n entity: string;\r\n identifier: string;\r\n lookupCacheKey: string;\r\n fields: IDataSourceField[];\r\n dataStructureEntityId: string;\r\n rowState: IRowState;\r\n}\r\n\r\nexport interface IDataSource extends IDataSourceData {\r\n $type_IDataSource: 1;\r\n\r\n getFieldByName(name: string): IDataSourceField | undefined;\r\n\r\n getFieldByIndex(idex: number): IDataSourceField | undefined;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport const isIDataSource = (o: any): o is IDataSource => o.$type_IDataSource;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { RefObject } from \"react\";\r\n\r\nexport enum IMainMenuItemType {\r\n FormRef = \"FormReferenceMenuItem\",\r\n FormRefWithSelection = \"FormReferenceMenuItem_WithSelection\",\r\n ReportRefWithSelection = \"ReportReferenceMenuItem_WithSelection\",\r\n WorkflowRef = \"WorkflowReferenceMenuItem\",\r\n WorkQueue = \"WorkQueue\",\r\n ReportReferenceMenuItem = \"ReportReferenceMenuItem\"\r\n}\r\n\r\nexport interface IMainMenuData {\r\n menuUI: any;\r\n}\r\n\r\nexport interface IMainMenuContent extends IMainMenuData {\r\n $type_IMainMenuContent: 1;\r\n\r\n getItemById(id: string): any;\r\n\r\n parent?: any;\r\n}\r\n\r\nexport interface IMainMenuEnvelope {\r\n $type_IMainMenuEnvelope: 1;\r\n\r\n mainMenu?: IMainMenu;\r\n isLoading: boolean;\r\n\r\n setMainMenu(mainMenu: IMainMenuContent | undefined): void;\r\n\r\n setLoading(state: boolean): void;\r\n\r\n parent?: any;\r\n}\r\n\r\n\r\nexport interface IMainMenuState {\r\n editing: boolean;\r\n highLightedItemId: string | undefined;\r\n\r\n highlightItem(itemId: string): void;\r\n\r\n closeAll(): void;\r\n\r\n isOpen(menuId: string): boolean;\r\n\r\n setIsOpen(menuId: string, state: boolean): void;\r\n\r\n flipIsOpen(menuId: string): void;\r\n\r\n setReference(id: string, ref: RefObject): void;\r\n\r\n scrollToItem(id: string): void\r\n}\r\n\r\nexport type IMainMenu = IMainMenuEnvelope & IMainMenuContent;\r\n\r\nexport const isIMainMenuContent = (o: any): o is IMainMenuContent => o.$type_IMainMenuContent;\r\nexport const isIMainMenuEnvelope = (o: any): o is IMainMenuEnvelope =>\r\n o.$type_IMainMenuEnvelope;\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isIDataView } from \"model/entities/types/IDataView\";\r\nimport { isIDataSource } from \"model/entities/types/IDataSource\";\r\n\r\nexport function getDataSource(ctx: any) {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIDataView(cn)) {\r\n return cn.dataSource;\r\n }\r\n if (isIDataSource(cn)) {\r\n return cn\r\n }\r\n cn = cn.parent;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSourceFields } from \"../DataSources/getDataSourceFields\";\r\n\r\nexport function getColumnNamesToLoad(ctx: any): string[] {\r\n return getDataSourceFields(ctx)\r\n .map(field => field.name)\r\n .filter(name => !name.startsWith(\"__\"));\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"./getDataSource\";\r\n\r\nexport function getDataSourceFields(ctx: any) {\r\n return getDataSource(ctx).fields\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"../DataSources/getDataSource\";\r\n\r\nexport function getDataStructureEntityId(ctx: any): string {\r\n return getDataSource(ctx).dataStructureEntityId;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getGridId(ctx: any): string {\r\n return getDataView(ctx).modelInstanceId;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"../getOpenedScreen\";\r\nimport { getGridId } from \"./getGridId\";\r\n\r\nexport function getDataViewByGridId(ctx: any, gridId: string) {\r\n return getOpenedScreen(ctx).content.formScreen!.dataViews.find(\r\n item => getGridId(item) === gridId\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"../getOpenedScreen\";\r\n\r\nexport function getIsFormScreenDirty(ctx: any) {\r\n const openedScreen = getOpenedScreen(ctx);\r\n if (openedScreen.isSleeping && openedScreen.isSleepingDirty) return true;\r\n if (openedScreen.content && !openedScreen.content.isLoading) {\r\n return openedScreen.content.formScreen!.isDirty;\r\n } else {\r\n return false;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"./getFormScreen\";\r\n\r\nexport function getIsSuppressSave(ctx: any) {\r\n return getFormScreen(ctx).suppressSave;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApplication } from './getApplication';\r\n\r\nexport function getDialogStack(ctx: any) {\r\n return getApplication(ctx).dialogStack;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"./getOpenedScreen\";\r\n\r\nexport function getIsActiveScreen(ctx: any) {\r\n return getOpenedScreen(ctx).isActive;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function map2obj(map: Map) {\r\n const result: { [key: string]: any } = {};\r\n for (let [k, v] of map.entries()) {\r\n result[k] = v;\r\n }\r\n return result;\r\n}\r\n\r\nfunction splitPropertyPair(pair: string) {\r\n return pair.split(\":\").map(x => x.trim())\r\n}\r\n\r\nexport function cssString2Object(cssString: string | undefined) {\r\n if (!cssString) {\r\n return undefined;\r\n }\r\n return cssString\r\n .split(\";\")\r\n .filter(pair => pair !== \"\")\r\n .map(pair => splitPropertyPair(pair))\r\n .reduce((obj: any, pair) => {\r\n obj[pair[0]] = pair[1];\r\n return obj;\r\n }\r\n , {})\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getDataViewLifecycle(ctx: any) {\r\n return getDataView(ctx).lifecycle;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataViewLifecycle } from \"model/selectors/DataView/getDataViewLifecycle\"\r\n\r\nexport function navigateAsChild(ctx: any, rows?: any[]) {\r\n return function*navigateAsChild() {\r\n yield*getDataViewLifecycle(ctx).navigateAsChild(rows);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getBindingChildren(ctx: any) {\r\n return getDataView(ctx).childBindings.map(cb => cb.childDataView)\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"../DataSources/getDataSource\";\r\n\r\nexport function getEntity(ctx: any) {\r\n return getDataSource(ctx).entity;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getBindingRoot } from './getBindingRoot';\r\n\r\nexport function getMasterRowId(ctx: any) {\r\n return getBindingRoot(ctx).selectedRowId;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getBindingRoot(ctx: any) {\r\n return getDataView(ctx).bindingRoot;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"../DataView/getDataView\";\r\n\r\nexport function getSelectedRowId(ctx: any) {\r\n return getDataView(ctx).selectedRowId;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getBindingParents(ctx: any) {\r\n return getDataView(ctx).parentBindings.map(pb => pb.parentDataView)\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getBindingParents } from \"./getBindingParents\";\r\n\r\nexport function getBindingParent(ctx: any) {\r\n const bps = getBindingParents(ctx);\r\n const bp = bps.length > 0 ? bps[0] : undefined;\r\n return bp;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getSelectedRowId } from \"../TablePanelView/getSelectedRowId\";\r\nimport { getBindingParent } from \"./getBindingParent\";\r\n\r\nexport function getParentRowId(ctx: any) {\r\n const bp = getBindingParent(ctx);\r\n return bp ? getSelectedRowId(bp) : undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IMainMenuItemType } from \"model/entities/types/IMainMenu\";\r\nimport { getOpenedScreen } from \"./getOpenedScreen\";\r\n\r\nexport function isLazyLoading(ctx: any) {\r\n const openScreen = getOpenedScreen(ctx);\r\n return openScreen.lazyLoading && openScreen.menuItemType !== IMainMenuItemType.FormRefWithSelection;\r\n // openScreen.menuItemType !== IMainMenuItemType.FormRefWithSelection means menu item opens a selection dialog\r\n // (which is never lazy loaded) and value of the \"openScreen.lazyLoading\" field is actually relevant to the form\r\n // which will be open after the selection dialog is closed.\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"./FormScreen/getFormScreen\";\r\n\r\nexport function getSessionId(ctx: any) {\r\n return getFormScreen(ctx).sessionId;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"./getOpenedScreen\";\r\n\r\nexport function getMenuItemId(ctx: any) {\r\n return getOpenedScreen(ctx).menuItemId;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nexport enum IOrderByDirection {\r\n NONE = \"NONE\",\r\n ASC = \"ASC\",\r\n DESC = \"DESC\"\r\n}\r\n\r\n\r\nexport interface IOrderByColumnSetting {\r\n ordering: IOrderByDirection;\r\n order: number;\r\n}\r\n\r\nexport interface IOrderingConfiguration {\r\n userOrderings: IOrdering[];\r\n orderings: IOrdering[];\r\n\r\n getOrdering(column: string): IOrderByColumnSetting;\r\n\r\n setOrdering(column: string): void;\r\n\r\n addOrdering(column: string): void;\r\n\r\n groupChildrenOrdering: IOrdering | undefined;\r\n\r\n getDefaultOrderings(): IOrdering[];\r\n\r\n parent?: any;\r\n orderingFunction: () => (row1: any[], row2: any[]) => number;\r\n}\r\n\r\nexport interface IOrdering {\r\n columnId: string;\r\n direction: IOrderByDirection;\r\n lookupId: string | undefined;\r\n}\r\n\r\nexport function parseToIOrderByDirection(candidate: string | undefined): IOrderByDirection {\r\n switch (candidate) {\r\n case \"Descending\":\r\n return IOrderByDirection.DESC;\r\n case \"Ascending\":\r\n return IOrderByDirection.ASC;\r\n case undefined:\r\n return IOrderByDirection.NONE;\r\n default:\r\n throw new Error(\"Option not implemented: \" + candidate)\r\n }\r\n}\r\n\r\nexport function parseToOrdering(candidateArray: any[]): IOrdering[] | undefined {\r\n if (!candidateArray || candidateArray.length === 0) return undefined;\r\n\r\n return candidateArray.filter(candidate => candidate.field || candidate.direction)\r\n .map(candidate => {\r\n return {\r\n columnId: candidate.field,\r\n direction: parseToIOrderByDirection(candidate.direction),\r\n lookupId: undefined\r\n };\r\n })\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport moment, { Moment } from \"moment\";\r\nimport { toOrigamServerString } from \"@origam/utils\";\r\nimport { IFilter } from \"./types/IFilter\";\r\n\r\nexport function joinWithAND(filterItems: string[]) {\r\n if (filterItems.length === 0) return \"\";\r\n if (filterItems.length === 1) return filterItems[0];\r\n return '[\"$AND\", ' + filterItems.join(\", \") + \"]\";\r\n}\r\n\r\nexport function joinWithOR(filterItems: string[]) {\r\n if (filterItems.length === 0) return \"\";\r\n if (filterItems.length === 1) return filterItems[0];\r\n return '[\"$OR\", ' + filterItems.join(\", \") + \"]\";\r\n}\r\n\r\nexport function filterToFilterItem(filter: IFilter) {\r\n return toFilterItem(\r\n filter.propertyId,\r\n filter.dataType,\r\n filter.setting.type,\r\n filter.setting.filterValue1,\r\n filter.setting.filterValue2\r\n );\r\n}\r\n\r\nfunction arrayToString(array: any[]) {\r\n return `[${array.join(\", \")}]`;\r\n}\r\n\r\nfunction valuesToRightHandSide(val1?: any, val2?: any) {\r\n const val1IsArray = Array.isArray(val1);\r\n const val2IsArray = Array.isArray(val2);\r\n\r\n if (val1 !== undefined && !val1IsArray && val2 !== undefined && !val2IsArray) {\r\n return arrayToString([toFilterValueForm(val1), toFilterValueForm(val2)]);\r\n }\r\n if (val1IsArray && val2 === undefined) {\r\n return arrayToString(val1.map((x: any) => toFilterValueForm(x)));\r\n } else if (!val1IsArray && val2 === undefined) {\r\n return toFilterValueForm(val1);\r\n } else if (val1 === undefined && !val2IsArray) {\r\n return toFilterValueForm(val2);\r\n }\r\n throw new Error(`Cannot convert values \"${val1}\" and \"${val2}\" to a right hand side`);\r\n}\r\n\r\nexport function toFilterItem(\r\n columnId: string,\r\n dataType: string | null,\r\n operator: string,\r\n val1?: any,\r\n val2?: any\r\n) {\r\n if (\r\n dataType === \"Date\" &&\r\n (operator === \"eq\" || operator === \"neq\") &&\r\n val1 !== undefined &&\r\n val1 !== \"\" &&\r\n val1 !== null &&\r\n val1.endsWith(\"T00:00:00.000\")\r\n ) {\r\n const upperLimit = new Date(val1);\r\n upperLimit.setDate(upperLimit.getDate() + 1);\r\n const dateTimeFormat = new Intl.DateTimeFormat(\"en\", {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n });\r\n const [{value: month}, , {value: day}, , {value: year}] = dateTimeFormat.formatToParts(\r\n upperLimit\r\n );\r\n const upperLimitString = year.concat(\"-\", month, \"-\", day, \"T00:00:00.000\");\r\n const substitutedOperator = operator === \"eq\" ? \"between\" : \"nbetween\";\r\n return `[\"${columnId}\", \"${substitutedOperator}\", ${valuesToRightHandSide(\r\n val1,\r\n upperLimitString\r\n )}]`;\r\n }\r\n const val1Formatted = moment.isMoment(val1)\r\n ? toOrigamServerString(val1 as Moment)\r\n : val1;\r\n return `[\"${columnId}\", \"${operator}\", ${valuesToRightHandSide(val1Formatted, val2)}]`;\r\n}\r\n\r\nfunction toFilterValueForm(value: any) {\r\n if (value === undefined) {\r\n return null;\r\n }\r\n return isNaN(value) ? '\"' + value + '\"' : value;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"../TablePanelView/getTablePanelView\";\r\n\r\nexport function getFilterConfiguration(ctx: any) {\r\n return getTablePanelView(ctx).filterConfiguration;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFilterConfiguration } from \"./getFilterConfiguration\";\r\nimport { filterToFilterItem, joinWithAND } from \"../../entities/OrigamApiHelpers\";\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getUserFilters(args: { ctx: any, excludePropertyId?: string }) {\r\n const dataView = getDataView(args.ctx);\r\n const filterConfiguration = getFilterConfiguration(dataView);\r\n const filterList = filterConfiguration.activeFilters\r\n .filter(filter => !args.excludePropertyId || args.excludePropertyId !== filter.propertyId)\r\n .filter(filter => filter.setting.isComplete)\r\n .map(filter => filterToFilterItem(filter));\r\n return joinWithAND(filterList);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"../TablePanelView/getTablePanelView\";\r\n\r\nexport function getOrderingConfiguration(ctx: any) {\r\n return getTablePanelView(ctx).orderingConfiguration;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOrderingConfiguration } from \"./getOrderingConfiguration\";\r\nimport { getDataStructureEntityId } from \"./getDataStructureEntityId\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { IOrderByDirection } from \"model/entities/types/IOrderingConfiguration\";\r\n\r\nexport function getUserOrdering(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n const orderingConfiguration = getOrderingConfiguration(dataView);\r\n const defaultOrderings = orderingConfiguration.getDefaultOrderings();\r\n if (defaultOrderings.length === 0) {\r\n const dataStructureEntityId = getDataStructureEntityId(dataView);\r\n throw new Error(`Cannot infinitely scroll on dataStructureEntity: ${dataStructureEntityId} because it has no default ordering on the displayed form.`)\r\n }\r\n return orderingConfiguration.userOrderings.length === 0\r\n ? defaultOrderings\r\n : orderingConfiguration.userOrderings\r\n .filter(ordering => ordering.direction !== IOrderByDirection.NONE);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function firstGteIndex(\r\n elementGetter: (index: number) => number,\r\n elementCount: number,\r\n num: number\r\n) {\r\n let indexLeft = 0;\r\n let indexRight = elementCount - 1;\r\n const T = num;\r\n let element;\r\n while (indexLeft <= indexRight) {\r\n const currentIndex = Math.floor((indexLeft + indexRight) / 2);\r\n element = elementGetter(currentIndex);\r\n if (element < T) {\r\n indexLeft = currentIndex + 1;\r\n } else if (element > T) {\r\n indexRight = currentIndex - 1;\r\n } else {\r\n return currentIndex;\r\n }\r\n }\r\n return Math.max(indexLeft, indexRight);\r\n}\r\n\r\nexport function lastLteIndex(\r\n elementGetter: (index: number) => number,\r\n elementCount: number,\r\n num: number\r\n) {\r\n let indexLeft = 0;\r\n let indexRight = elementCount - 1;\r\n const T = num;\r\n let element;\r\n while (indexLeft <= indexRight) {\r\n const currentIndex = Math.floor((indexLeft + indexRight) / 2);\r\n element = elementGetter(currentIndex);\r\n if (element < T) {\r\n indexLeft = currentIndex + 1;\r\n } else if (element > T) {\r\n indexRight = currentIndex - 1;\r\n } else {\r\n return currentIndex;\r\n }\r\n }\r\n return Math.min(indexLeft, indexRight);\r\n}\r\n\r\nexport function rangeQuery(\r\n elementGetterL: (index: number) => number,\r\n elementGetterR: (index: number) => number,\r\n elementCount: number,\r\n start: number,\r\n end: number\r\n) {\r\n const firstGreaterThanNumber = firstGteIndex(elementGetterL, elementCount, start);\r\n const lastLessThanNumber = lastLteIndex(elementGetterR, elementCount, end);\r\n return {lastLessThanNumber, firstGreaterThanNumber};\r\n}\r\n\r\ndeclare global {\r\n interface Array {\r\n remove(o: T): Array;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface Array {\r\n groupBy(keyGetter: (key: T) => K): Map;\r\n }\r\n}\r\n\r\nArray.prototype.remove = function (item) {\r\n const index = this.indexOf(item);\r\n if (index > -1) {\r\n this.splice(index, 1);\r\n }\r\n return this;\r\n}\r\n\r\nArray.prototype.groupBy = function (keyGetter: (key: T) => K) {\r\n const map = new Map();\r\n this.forEach((item) => {\r\n const key = keyGetter(item);\r\n const collection = map.get(key);\r\n if (!collection) {\r\n map.set(key, [item]);\r\n } else {\r\n collection.push(item);\r\n }\r\n });\r\n return map;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getDataTable(ctx: any) {\r\n return getDataView(ctx).dataTable;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\nimport { IGrouper } from \"model/entities/types/IGrouper\";\r\n\r\nexport function getGrouper(ctx: any): IGrouper {\r\n let dataView = getDataView(ctx);\r\n if (!dataView) {\r\n throw new Error(\"DataView is needed to determine what kind of grouper should be used\");\r\n }\r\n const serverSideGrouping = dataView.isLazyLoading\r\n return serverSideGrouping\r\n ? dataView.serverSideGrouper\r\n : dataView.clientSideGrouper;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGridDimensions } from \"../../../Components/ScreenElements/Table/types\";\r\nimport { SimpleScrollState } from \"../../../Components/ScreenElements/Table/SimpleScrollState\";\r\nimport { computed } from \"mobx\";\r\nimport { getDataView } from \"../../../../model/selectors/DataView/getDataView\";\r\nimport { rangeQuery } from \"../../../../utils/arrays\";\r\nimport { IDataTable } from \"../../../../model/entities/types/IDataTable\";\r\nimport { getDataTable } from \"../../../../model/selectors/DataView/getDataTable\";\r\nimport { getGrouper } from \"model/selectors/DataView/getGrouper\";\r\n\r\n\r\nexport interface IVisibleRowsMonitor {\r\n firstIndex: number;\r\n lastIndex: number;\r\n}\r\n\r\nexport class VisibleRowsMonitor implements IVisibleRowsMonitor {\r\n\r\n ctx: any;\r\n gridDimensions: IGridDimensions;\r\n scrollState: SimpleScrollState;\r\n\r\n constructor(ctx: any, gridDimensions: IGridDimensions, scrollState: SimpleScrollState) {\r\n this.ctx = ctx;\r\n this.gridDimensions = gridDimensions;\r\n this.scrollState = scrollState;\r\n }\r\n\r\n @computed\r\n get visibleRowsRange() {\r\n const dataView = getDataView(this.ctx);\r\n return rangeQuery(\r\n (i) => this.gridDimensions.getRowBottom(i),\r\n (i) => this.gridDimensions.getRowTop(i),\r\n this.gridDimensions.rowCount,\r\n this.scrollState.scrollTop,\r\n this.scrollState.scrollTop + (dataView.contentBounds?.height ?? 0)\r\n );\r\n }\r\n\r\n @computed\r\n get firstIndex() {\r\n return this.visibleRowsRange.firstGreaterThanNumber;\r\n }\r\n\r\n @computed\r\n get lastIndex() {\r\n return this.visibleRowsRange.lastLessThanNumber;\r\n }\r\n}\r\n\r\nexport class OpenGroupVisibleRowsMonitor implements IVisibleRowsMonitor {\r\n\r\n ctx: any;\r\n gridDimensions: IGridDimensions;\r\n scrollState: SimpleScrollState;\r\n visibleRowsAll: VisibleRowsMonitor;\r\n private dataTable: IDataTable;\r\n\r\n constructor(ctx: any, gridDimensions: IGridDimensions, scrollState: SimpleScrollState) {\r\n this.ctx = ctx;\r\n this.gridDimensions = gridDimensions;\r\n this.scrollState = scrollState;\r\n this.visibleRowsAll = new VisibleRowsMonitor(ctx, gridDimensions, scrollState);\r\n this.dataTable = getDataTable(ctx);\r\n }\r\n\r\n @computed\r\n get firstIndex() {\r\n const expandedGroupIndex = getGrouper(this.ctx).topLevelGroups\r\n .findIndex(group => group.isExpanded);\r\n return expandedGroupIndex > this.visibleRowsAll.firstIndex\r\n ? 0\r\n : this.visibleRowsAll.firstIndex - expandedGroupIndex;\r\n }\r\n\r\n @computed\r\n get lastIndex() {\r\n const expandedGroupIndex = getGrouper(this.ctx).topLevelGroups\r\n .findIndex(group => group.isExpanded);\r\n return this.visibleRowsAll.lastIndex - expandedGroupIndex;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getFilterConfiguration } from \"./getFilterConfiguration\";\r\n\r\nexport function getUserFilterLookups(ctx: any): { [key: string]: string } | undefined {\r\n const dataView = getDataView(ctx);\r\n const filterConfiguration = getFilterConfiguration(dataView);\r\n const lookupMap = filterConfiguration.activeFilters\r\n .filter((filter) => filter.setting.isComplete && filter.setting.lookupId)\r\n .reduce(function (lookupMap: { [key: string]: string }, filter) {\r\n lookupMap[filter.propertyId] = filter.setting.lookupId!;\r\n return lookupMap;\r\n }, {});\r\n\r\n return Object.keys(lookupMap).length !== 0 ? lookupMap : undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGridDimensions } from \"gui/Components/ScreenElements/Table/types\";\r\nimport { SimpleScrollState } from \"gui/Components/ScreenElements/Table/SimpleScrollState\";\r\nimport { action, autorun, computed, flow, IReactionDisposer, reaction } from \"mobx\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getColumnNamesToLoad } from \"model/selectors/DataView/getColumnNamesToLoad\";\r\nimport { joinWithAND } from \"model/entities/OrigamApiHelpers\";\r\nimport { getUserFilters } from \"model/selectors/DataView/getUserFilters\";\r\nimport { getUserOrdering } from \"model/selectors/DataView/getUserOrdering\";\r\nimport { IVisibleRowsMonitor, OpenGroupVisibleRowsMonitor } from \"./VisibleRowsMonitor\";\r\nimport { ScrollRowContainer } from \"model/entities/ScrollRowContainer\";\r\nimport { CancellablePromise } from \"mobx/lib/api/flow\";\r\nimport { getUserFilterLookups } from \"model/selectors/DataView/getUserFilterLookups\";\r\nimport { getDataView } from \"../../../../model/selectors/DataView/getDataView\";\r\n\r\nexport interface IInfiniteScrollLoaderData {\r\n gridDimensions: IGridDimensions;\r\n scrollState: SimpleScrollState;\r\n ctx: any;\r\n rowsContainer: ScrollRowContainer;\r\n groupFilter: string | undefined;\r\n visibleRowsMonitor: IVisibleRowsMonitor;\r\n}\r\n\r\nexport interface IInfiniteScrollLoader extends IInfiniteScrollLoaderData {\r\n start(): () => void;\r\n\r\n dispose(): void;\r\n\r\n loadLastPage(): Generator;\r\n\r\n loadFirstPage(): Generator;\r\n}\r\n\r\nexport const SCROLL_ROW_CHUNK = 1000;\r\nexport const MAX_CHUNKS_TO_HOLD = 10;\r\n\r\nexport class NullIScrollLoader implements IInfiniteScrollLoader {\r\n ctx: any = null as any;\r\n gridDimensions: IGridDimensions = null as any;\r\n scrollState: SimpleScrollState = null as any;\r\n rowsContainer: ScrollRowContainer = null as any;\r\n\r\n start(): () => void {\r\n return () => {\r\n };\r\n }\r\n\r\n dispose(): void {\r\n }\r\n\r\n groupFilter: string | undefined;\r\n visibleRowsMonitor: IVisibleRowsMonitor = null as any;\r\n\r\n *loadLastPage(): Generator {\r\n }\r\n\r\n *loadFirstPage(): Generator {\r\n }\r\n}\r\n\r\nexport class InfiniteScrollLoader implements IInfiniteScrollLoader {\r\n $type_InfiniteScrollLoader: 1 = 1;\r\n private debugDisposer: IReactionDisposer | undefined;\r\n private reactionDisposer: IReactionDisposer | undefined;\r\n visibleRowsMonitor: IVisibleRowsMonitor;\r\n\r\n constructor(data: IInfiniteScrollLoaderData) {\r\n Object.assign(this, data);\r\n this.rowsContainer.registerResetListener(() => this.handleRowContainerReset());\r\n this.visibleRowsMonitor = new OpenGroupVisibleRowsMonitor(this.ctx, this.gridDimensions, this.scrollState);\r\n this.requestProcessor.start();\r\n }\r\n\r\n *loadLastPage(): any {\r\n const api = getApi(this.ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(this.ctx);\r\n let dataView = getDataView(this.ctx);\r\n yield formScreenLifecycle.updateTotalRowCount(dataView);\r\n if (dataView.totalRowCount === undefined) {\r\n return;\r\n }\r\n let lastStartOffset\r\n if (dataView.totalRowCount > SCROLL_ROW_CHUNK) {\r\n const rowsInLastChunk = (dataView.totalRowCount! % SCROLL_ROW_CHUNK) + SCROLL_ROW_CHUNK;\r\n lastStartOffset = dataView.totalRowCount! - rowsInLastChunk;\r\n } else {\r\n lastStartOffset = 0;\r\n }\r\n\r\n const data = yield api.getRows({\r\n MenuId: getMenuItemId(this.ctx),\r\n SessionFormIdentifier: getSessionId(formScreenLifecycle),\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n Filter: this.getFilters(),\r\n FilterLookups: getUserFilterLookups(this.ctx),\r\n Ordering: getUserOrdering(this.ctx),\r\n RowLimit: SCROLL_ROW_CHUNK * 2,\r\n RowOffset: lastStartOffset,\r\n Parameters: {},\r\n MasterRowId: undefined,\r\n ColumnNames: getColumnNamesToLoad(this.ctx),\r\n })\r\n this.rowsContainer.set(data, lastStartOffset, true)\r\n\r\n this.reactionDisposer?.();\r\n setTimeout(() => {\r\n const newDistanceToStart = this.distanceToStart + SCROLL_ROW_CHUNK\r\n const newTop = this.gridDimensions.getRowTop(newDistanceToStart);\r\n this.scrollState.scrollTo({scrollTop: newTop});\r\n this.start();\r\n });\r\n }\r\n\r\n *loadFirstPage(): any {\r\n if (this.rowsContainer.isFirstRowLoaded) {\r\n return\r\n }\r\n const api = getApi(this.ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(this.ctx);\r\n const data = yield api.getRows({\r\n MenuId: getMenuItemId(this.ctx),\r\n SessionFormIdentifier: getSessionId(formScreenLifecycle),\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n Filter: this.getFilters(),\r\n FilterLookups: getUserFilterLookups(this.ctx),\r\n Ordering: getUserOrdering(this.ctx),\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n RowOffset: 0,\r\n Parameters: {},\r\n MasterRowId: undefined,\r\n ColumnNames: getColumnNamesToLoad(this.ctx),\r\n })\r\n this.rowsContainer.set(data)\r\n\r\n this.reactionDisposer?.();\r\n setTimeout(() => {\r\n const newTop = this.gridDimensions.getRowTop(0);\r\n this.scrollState.scrollTo({scrollTop: newTop});\r\n this.start();\r\n });\r\n }\r\n\r\n groupFilter: string | undefined;\r\n lastRequestedStartOffset: number = 0;\r\n lastRequestedEndOffset: number = 0;\r\n gridDimensions: IGridDimensions = null as any;\r\n scrollState: SimpleScrollState = null as any;\r\n ctx: any = null as any;\r\n rowsContainer: ScrollRowContainer = null as any;\r\n requestProcessor: FlowQueueProcessor = new FlowQueueProcessor(100, 100);\r\n\r\n @computed\r\n get distanceToStart() {\r\n return this.visibleRowsMonitor.firstIndex;\r\n }\r\n\r\n @computed\r\n get distanceToEnd() {\r\n return this.rowsContainer.rows.length - this.visibleRowsMonitor.lastIndex;\r\n }\r\n\r\n @computed\r\n get headLoadingNeeded() {\r\n return this.distanceToStart <= SCROLL_ROW_CHUNK * 0.9 && !this.rowsContainer.isFirstRowLoaded;\r\n }\r\n\r\n @computed\r\n get tailLoadingNeeded() {\r\n return this.distanceToEnd <= SCROLL_ROW_CHUNK * 0.9 && !this.rowsContainer.isLastRowLoaded;\r\n }\r\n\r\n @computed\r\n get incrementLoadingNeeded() {\r\n return this.headLoadingNeeded || this.tailLoadingNeeded;\r\n }\r\n\r\n @action.bound\r\n public start() {\r\n this.debugDisposer = autorun(() => {\r\n //console.log(\"distanceToStart: \" + this.distanceToStart);\r\n //console.log(\"distanceToEnd: \" + this.distanceToEnd);\r\n //console.log(\"headLoadingNeeded(): \" + this.headLoadingNeeded);\r\n //console.log(\"tailLoadingNeeded(): \" + this.tailLoadingNeeded);\r\n });\r\n this.reactionDisposer = reaction(\r\n () => {\r\n return [\r\n this.visibleRowsMonitor.firstIndex,\r\n this.visibleRowsMonitor.lastIndex,\r\n this.headLoadingNeeded,\r\n this.tailLoadingNeeded\r\n ];\r\n },\r\n () => {\r\n if (this.headLoadingNeeded) {\r\n this.requestProcessor.enqueue(() => this.prependLines());\r\n }\r\n if (this.tailLoadingNeeded) {\r\n this.requestProcessor.enqueue(() => this.appendLines());\r\n }\r\n }\r\n );\r\n return this.reactionDisposer;\r\n }\r\n\r\n prependListeners: ((data: any[][]) => void)[] = [];\r\n\r\n registerPrependListener(listener: (data: any[][]) => void): void {\r\n this.prependListeners.push(listener);\r\n }\r\n\r\n appendListeners: ((data: any[][]) => void)[] = [];\r\n\r\n registerAppendListener(listener: (data: any[][]) => void): void {\r\n this.appendListeners.push(listener);\r\n }\r\n\r\n handleRowContainerReset() {\r\n this.lastRequestedStartOffset = 0;\r\n this.lastRequestedEndOffset = 0;\r\n }\r\n\r\n getFilters() {\r\n const filters = [];\r\n if (this.groupFilter) {\r\n filters.push(this.groupFilter);\r\n }\r\n const userFilters = getUserFilters({ctx: this.ctx});\r\n if (userFilters) {\r\n filters.push(userFilters);\r\n }\r\n return joinWithAND(filters);\r\n }\r\n\r\n private appendLines = flow(function*(\r\n this: InfiniteScrollLoader\r\n ) {\r\n if (!this.tailLoadingNeeded) {\r\n return;\r\n }\r\n if (this.lastRequestedEndOffset === this.rowsContainer.nextEndOffset) {\r\n return;\r\n }\r\n this.lastRequestedEndOffset = this.rowsContainer.nextEndOffset;\r\n this.lastRequestedStartOffset = -1;\r\n\r\n const api = getApi(this.ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(this.ctx);\r\n\r\n const data = yield api.getRows({\r\n MenuId: getMenuItemId(this.ctx),\r\n SessionFormIdentifier: getSessionId(formScreenLifecycle),\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n Filter: this.getFilters(),\r\n FilterLookups: getUserFilterLookups(this.ctx),\r\n Ordering: getUserOrdering(this.ctx),\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n MasterRowId: undefined,\r\n Parameters: {},\r\n RowOffset: this.rowsContainer.nextEndOffset,\r\n ColumnNames: getColumnNamesToLoad(this.ctx),\r\n })\r\n const oldDistanceToStart = this.distanceToStart;\r\n this.rowsContainer.appendRecords(data)\r\n if (this.rowsContainer.isFull && !this.rowsContainer.isLastRowLoaded) {\r\n const newDistanceToStart = oldDistanceToStart - SCROLL_ROW_CHUNK\r\n const newTop = this.gridDimensions.getRowTop(newDistanceToStart);\r\n this.scrollState.scrollTo({scrollTop: newTop});\r\n }\r\n this.appendListeners.forEach(listener => listener(data));\r\n });\r\n\r\n\r\n private prependLines = flow(function*(\r\n this: InfiniteScrollLoader\r\n ) {\r\n if (!this.headLoadingNeeded) {\r\n return;\r\n }\r\n const nextStartOffset = this.rowsContainer.nextStartOffset;\r\n if (this.lastRequestedStartOffset === nextStartOffset || nextStartOffset < 0) {\r\n return;\r\n }\r\n this.lastRequestedStartOffset = nextStartOffset;\r\n this.lastRequestedEndOffset = 0;\r\n\r\n const api = getApi(this.ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(this.ctx);\r\n const data = yield api.getRows({\r\n MenuId: getMenuItemId(this.ctx),\r\n SessionFormIdentifier: getSessionId(formScreenLifecycle),\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n Filter: this.getFilters(),\r\n FilterLookups: getUserFilterLookups(this.ctx),\r\n Ordering: getUserOrdering(this.ctx),\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n RowOffset: nextStartOffset,\r\n Parameters: {},\r\n MasterRowId: undefined,\r\n ColumnNames: getColumnNamesToLoad(this.ctx),\r\n })\r\n const oldDistanceToStart = this.distanceToStart;\r\n this.rowsContainer.prependRecords(data);\r\n if (!this.rowsContainer.isFirstRowLoaded) {\r\n const newDistanceToStart = oldDistanceToStart + SCROLL_ROW_CHUNK\r\n const newTop = this.gridDimensions.getRowTop(newDistanceToStart);\r\n this.scrollState.scrollTo({scrollTop: newTop});\r\n }\r\n this.prependListeners.forEach(listener => listener(data));\r\n });\r\n\r\n dispose(): void {\r\n if (this.reactionDisposer) {\r\n this.reactionDisposer();\r\n }\r\n if (this.debugDisposer) {\r\n this.debugDisposer();\r\n }\r\n this.requestProcessor.dispose();\r\n this.prependListeners.length = 0;\r\n this.appendListeners.length = 0;\r\n }\r\n}\r\n\r\n// A better implementation:\r\n// https://medium.com/@karenmarkosyan/how-to-manage-promises-into-dynamic-queue-with-vanilla-javascript-9d0d1f8d4df5\r\nclass FlowQueueProcessor {\r\n\r\n private flowQueue: (() => CancellablePromise)[] = [];\r\n private stopRequested: boolean = false;\r\n private readonly delayBetweenCallsMillis: number;\r\n private readonly mainLoopDelayMills: number;\r\n private timeoutHandle: any;\r\n\r\n constructor(mainLoopDelayMilliseconds: number, delayBetweenCallsMilliseconds: number) {\r\n this.mainLoopDelayMills = mainLoopDelayMilliseconds;\r\n this.delayBetweenCallsMillis = delayBetweenCallsMilliseconds;\r\n }\r\n\r\n private sleep(milliseconds: number) {\r\n return new Promise(resolve => {\r\n this.timeoutHandle = setTimeout(resolve, milliseconds);\r\n });\r\n }\r\n\r\n enqueue(flow: () => CancellablePromise) {\r\n this.flowQueue.push(flow);\r\n }\r\n\r\n dispose() {\r\n this.stopRequested = true;\r\n clearTimeout(this.timeoutHandle);\r\n }\r\n\r\n async start() {\r\n while (true) {\r\n while (this.flowQueue.length > 0) {\r\n const currentFlow = this.flowQueue.shift()!;\r\n await currentFlow();\r\n await this.sleep(this.delayBetweenCallsMillis);\r\n }\r\n await this.sleep(this.mainLoopDelayMills);\r\n if (this.stopRequested) {\r\n return;\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport const isInfiniteScrollLoader = (o: any): o is InfiniteScrollLoader =>\r\n o?.$type_InfiniteScrollLoader;\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport _ from \"lodash\";\r\nimport { action, computed, createAtom, flow, IAtom, observable } from \"mobx\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { flashColor2htmlColor } from \"utils/flashColorFormat\";\r\nimport { IRowState, IRowStateColumnItem, IRowStateData, IRowStateItem } from \"./types/IRowState\";\r\nimport { FlowBusyMonitor } from \"../../utils/flow\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport enum IIdState {\r\n LOADING = \"LOADING\",\r\n ERROR = \"ERROR\"\r\n}\r\n\r\nexport class RowState implements IRowState {\r\n $type_IRowState: 1 = 1;\r\n suppressWorkingStatus: boolean = false;\r\n\r\n constructor(data: IRowStateData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n monitor: FlowBusyMonitor = new FlowBusyMonitor();\r\n\r\n get isWorking() {\r\n return this.monitor.isWorkingDelayed;\r\n }\r\n\r\n @observable firstLoadingPerformed = false;\r\n @observable temporaryContainersValues?: Map;\r\n @computed get mayCauseFlicker() {\r\n return !this.firstLoadingPerformed;\r\n }\r\n\r\n containers: Map = new Map();\r\n\r\n @observable\r\n isSomethingLoading = false;\r\n\r\n triggerLoadImm = flow(\r\n function*(this: RowState): any {\r\n if (this.isSomethingLoading) {\r\n return;\r\n }\r\n let containersToLoad: Map = new Map();\r\n let reportBusyStatus = true;\r\n try {\r\n while (true) {\r\n try {\r\n for (let container of this.containers.values()) {\r\n if(container.rowId && !container.isValid && !container.processingSate){\r\n containersToLoad.set(container.rowId, container);\r\n }\r\n }\r\n reportBusyStatus = Array.from(containersToLoad.values()).every(container => !container.suppressWorkingStatus);\r\n if(reportBusyStatus){\r\n this.monitor.inFlow++;\r\n }\r\n if (containersToLoad.size === 0) {\r\n break;\r\n }\r\n for (let container of containersToLoad.values()) {\r\n container.processingSate = IIdState.LOADING;\r\n }\r\n this.isSomethingLoading = true;\r\n const api = getApi(this);\r\n const states = yield api.getRowStates({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: getEntity(this),\r\n Ids: Array.from(containersToLoad.values()).map(container => container.rowId)\r\n });\r\n this.isSomethingLoading = false;\r\n this.firstLoadingPerformed = true;\r\n for (let state of states) {\r\n this.putValue(state);\r\n this.containers.get(state.id)!.processingSate = undefined;\r\n }\r\n } catch (error) {\r\n this.isSomethingLoading = false;\r\n this.firstLoadingPerformed = true;\r\n for (let container of containersToLoad.values()) {\r\n container.processingSate = IIdState.ERROR;\r\n }\r\n yield* handleError(this)(error);\r\n } finally {\r\n if(reportBusyStatus){\r\n this.monitor.inFlow--;\r\n }\r\n containersToLoad.forEach(container => container.suppressWorkingStatus = false);\r\n containersToLoad.clear();\r\n }\r\n }\r\n } finally {\r\n // After everything got loaded, here we switch back to provide the values just loaded.\r\n this.temporaryContainersValues = undefined;\r\n }\r\n }.bind(this)\r\n );\r\n\r\n triggerLoad = _.debounce(this.triggerLoadImm, 666);\r\n\r\n getValue(rowId: string) {\r\n if (!this.containers.has(rowId)) {\r\n this.containers.set(rowId, new RowStateContainer(rowId));\r\n }\r\n let container = this.containers.get(rowId)!;\r\n if (!container.atom) {\r\n container.suppressWorkingStatus = this.suppressWorkingStatus;\r\n container.atom = createAtom(\r\n `RowState atom [${rowId}]`,\r\n () =>\r\n requestAnimationFrame(() => {\r\n this.triggerLoad();\r\n }),\r\n () => {\r\n }\r\n )\r\n }\r\n container.atom.reportObserved?.();\r\n if (this.temporaryContainersValues && this.temporaryContainersValues.has(rowId)) {\r\n return this.temporaryContainersValues.get(rowId)?.rowStateItem;\r\n } else {\r\n return this.containers.get(rowId)?.rowStateItem;\r\n }\r\n }\r\n\r\n async loadValues(rowIds: string[]) {\r\n for (const rowId of rowIds) {\r\n if (!this.containers.has(rowId)) {\r\n this.containers.set(rowId, new RowStateContainer(rowId));\r\n }\r\n }\r\n await this.triggerLoadImm();\r\n }\r\n\r\n hasValue(rowId: string): boolean {\r\n return this.containers.has(rowId);\r\n }\r\n\r\n @action.bound\r\n putValue(state: any) {\r\n let rowStateItem = new RowStateItem(\r\n state.id,\r\n state.allowCreate,\r\n state.allowDelete,\r\n flashColor2htmlColor(state.foregroundColor),\r\n flashColor2htmlColor(state.backgroundColor),\r\n new Map(\r\n state.columns.map((column: any) => {\r\n const rs = new RowStateColumnItem(\r\n column.name,\r\n column.dynamicLabel,\r\n flashColor2htmlColor(column.foregroundColor),\r\n flashColor2htmlColor(column.backgroundColor),\r\n column.allowRead,\r\n column.allowUpdate\r\n );\r\n return [column.name, rs];\r\n })\r\n ),\r\n new Set(state.disabledActions),\r\n state.relations\r\n );\r\n if (!this.containers.has(state.id)) {\r\n this.containers.set(state.id, new RowStateContainer(state.id));\r\n }\r\n const container = this.containers.get(state.id);\r\n container!.rowStateItem = rowStateItem;\r\n container!.isValid = true;\r\n this.firstLoadingPerformed = true;\r\n }\r\n\r\n @action.bound reload() {\r\n // Store the rest of values to suppress flickering while reloading.\r\n this.temporaryContainersValues = new Map(this.containers.entries());\r\n // This actually causes reloading of the values (by views calling getValue(...) )\r\n for (let rowStateContainer of this.containers.values()) {\r\n rowStateContainer.atom?.onBecomeUnobservedListeners?.clear();\r\n rowStateContainer.atom?.onBecomeObservedListeners?.clear();\r\n rowStateContainer.atom = undefined;\r\n rowStateContainer.isValid = false;\r\n rowStateContainer.processingSate = undefined;\r\n }\r\n }\r\n\r\n @action.bound clearAll() {\r\n for (let rowStateContainer of this.containers.values()) {\r\n rowStateContainer.atom?.onBecomeUnobservedListeners?.clear();\r\n rowStateContainer.atom?.onBecomeObservedListeners?.clear();\r\n rowStateContainer.atom = undefined;\r\n rowStateContainer.isValid = false;\r\n rowStateContainer.processingSate = undefined;\r\n }\r\n this.firstLoadingPerformed = false;\r\n this.temporaryContainersValues = undefined;\r\n // TODO: Wait when something is currently loading.\r\n }\r\n\r\n parent?: any;\r\n}\r\n\r\nexport class RowStateItem implements IRowStateItem {\r\n constructor(\r\n public id: string,\r\n public allowCreate: boolean,\r\n public allowDelete: boolean,\r\n public foregroundColor: string | undefined,\r\n public backgroundColor: string | undefined,\r\n public columns: Map,\r\n public disabledActions: Set,\r\n public relations: any[]\r\n ) {\r\n }\r\n}\r\n\r\nexport class RowStateColumnItem implements IRowStateColumnItem {\r\n constructor(\r\n public name: string,\r\n public dynamicLabel: string | undefined | null,\r\n public foregroundColor: string | undefined,\r\n public backgroundColor: string | undefined,\r\n public allowRead: boolean,\r\n public allowUpdate: boolean\r\n ) {\r\n }\r\n}\r\n\r\nclass RowStateContainer {\r\n public rowId: string;\r\n\r\n @observable\r\n public rowStateItem: IRowStateItem | undefined;\r\n\r\n @observable\r\n public isValid: boolean = false;\r\n\r\n public processingSate: IIdState | undefined;\r\n public suppressWorkingStatus: boolean = false;\r\n\r\n constructor(\r\n rowId: string,\r\n public atom?: IAtom\r\n ) {\r\n this.rowId = rowId;\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observable } from \"mobx\";\r\n\r\nexport const busyDelayMillis = 500;\r\n\r\n// Delays setting \"isWorkingDelayed\" property by \"busyDelayMillis\" after \"inFlow\" counter is incremented from 0 to 1\r\nexport class FlowBusyMonitor {\r\n @observable _inFlow = 0;\r\n @observable isWorkingDelayed = false;\r\n @observable isWorking = false;\r\n private flowLeft = false;\r\n\r\n set inFlow(value: number) {\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n if (this._inFlow === 0 && value === 1) {\r\n this.flowLeft = false;\r\n\r\n this.isWorking = true\r\n setTimeout(() => {\r\n if (!this.flowLeft) {\r\n this.isWorkingDelayed = true\r\n }\r\n }, busyDelayMillis);\r\n } else if (this._inFlow === 1 && value === 0) {\r\n this.isWorkingDelayed = false;\r\n this.isWorking = false;\r\n this.flowLeft = true;\r\n }\r\n this._inFlow = value;\r\n }\r\n\r\n get inFlow() {\r\n return this._inFlow;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport Axios from \"axios\";\r\nimport { action, comparer, flow, reaction } from \"mobx\";\r\nimport { navigateAsChild } from \"model/actions/DataView/navigateAsChild\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getBindingChildren } from \"model/selectors/DataView/getBindingChildren\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getIsBindingParent } from \"model/selectors/DataView/getIsBindingParent\";\r\nimport { getIsBindingRoot } from \"model/selectors/DataView/getIsBindingRoot\";\r\nimport { getMasterRowId } from \"model/selectors/DataView/getMasterRowId\";\r\nimport { getParentRowId } from \"model/selectors/DataView/getParentRowId\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getApi } from \"../../selectors/getApi\";\r\nimport { getSelectedRowId } from \"../../selectors/TablePanelView/getSelectedRowId\";\r\nimport { IDataViewLifecycle } from \"./types/IDataViewLifecycle\";\r\nimport { processCRUDResult } from \"model/actions/DataLoading/processCRUDResult\";\r\nimport { IDataView } from \"../types/IDataView\";\r\nimport { getMenuItemId } from \"../../selectors/getMenuItemId\";\r\nimport { getDataStructureEntityId } from \"../../selectors/DataView/getDataStructureEntityId\";\r\nimport { SCROLL_ROW_CHUNK } from \"../../../gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { getColumnNamesToLoad } from \"../../selectors/DataView/getColumnNamesToLoad\";\r\nimport { joinWithAND, toFilterItem } from \"../OrigamApiHelpers\";\r\nimport { FlowBusyMonitor } from \"../../../utils/flow\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getUserFilterLookups } from \"model/selectors/DataView/getUserFilterLookups\";\r\n\r\nexport class DataViewLifecycle implements IDataViewLifecycle {\r\n $type_IDataViewLifecycle: 1 = 1;\r\n monitor: FlowBusyMonitor = new FlowBusyMonitor();\r\n\r\n get isWorking() {\r\n return this.monitor.isWorkingDelayed;\r\n }\r\n\r\n disposers: any[] = [];\r\n\r\n @action.bound\r\n start(): void {\r\n if (isLazyLoading(this)) {\r\n this.disposers.push(this.startSelectedRowReaction());\r\n }\r\n }\r\n\r\n onSelectedRowIdChangeImm = flow(\r\n function*(this: DataViewLifecycle) {\r\n if(!isLazyLoading(this)){\r\n return;\r\n }\r\n const dataView = getDataView(this);\r\n try {\r\n this.monitor.inFlow++;\r\n if (getIsBindingRoot(this)) {\r\n if (!getFormScreenLifecycle(this).rowSelectedReactionsDisabled(dataView)) {\r\n yield*this.changeMasterRow();\r\n }\r\n yield*this.navigateChildren();\r\n } else if (getIsBindingParent(this)) {\r\n yield*this.navigateChildren();\r\n }\r\n } catch (e) {\r\n // TODO: Move this method to action handler file?\r\n yield*handleError(this)(e);\r\n throw e;\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }.bind(this)\r\n );\r\n\r\n _selectedRowReactionDisposer: any;\r\n\r\n @action.bound\r\n async startSelectedRowReaction(fireImmediately?: boolean) {\r\n if (fireImmediately) {\r\n await this.onSelectedRowIdChangeImm();\r\n }\r\n\r\n const self = this;\r\n return (this._selectedRowReactionDisposer = reaction(\r\n () => {\r\n return getSelectedRowId(this);\r\n },\r\n () => self.onSelectedRowIdChangeImm(),\r\n {equals: comparer.structural}\r\n ));\r\n }\r\n\r\n async runRecordChangedReaction(action?: () => Generator) {\r\n let wasRunning = false;\r\n try {\r\n wasRunning = this.stopSelectedRowReaction();\r\n if (action) {\r\n await flow(action)();\r\n }\r\n } finally {\r\n if (wasRunning) {\r\n await this.startSelectedRowReaction(true);\r\n } else {\r\n await this.onSelectedRowIdChangeImm();\r\n }\r\n }\r\n }\r\n\r\n @action.bound stopSelectedRowReaction() {\r\n if (this._selectedRowReactionDisposer) {\r\n this._selectedRowReactionDisposer();\r\n this._selectedRowReactionDisposer = undefined;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n *navigateAsChild(rows?: any[]) {\r\n if (rows !== undefined && rows !== null) {\r\n const dataView = getDataView(this);\r\n yield dataView.setRecords(rows);\r\n dataView.selectFirstRow();\r\n } else {\r\n yield*this.loadGetData();\r\n }\r\n }\r\n\r\n changeMasterRowCanceller: any;\r\n\r\n *changeMasterRow(): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n this.changeMasterRowCanceller && this.changeMasterRowCanceller();\r\n this.changeMasterRowCanceller = api.createCanceller();\r\n const crudResult = yield api.setMasterRecord(\r\n {\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: getEntity(this),\r\n RowId: getSelectedRowId(this)!\r\n },\r\n this.changeMasterRowCanceller\r\n );\r\n yield*processCRUDResult(this, crudResult);\r\n getFormScreen(this).clearDataCache();\r\n } catch (error) {\r\n if (Axios.isCancel(error)) {\r\n return;\r\n }\r\n /*console.error(error);\r\n yield errDialogPromise(this)(error);*/\r\n throw error;\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n buildDetailFilter(dataView: IDataView) {\r\n const filterItems = [];\r\n for (let binding of dataView.parentBindings) {\r\n const selectedRow = binding.parentDataView.selectedRow;\r\n if (!selectedRow) {\r\n continue;\r\n }\r\n for (let bindingPair of binding.bindingPairs) {\r\n const parentDsField = binding.parentDataView.dataSource.getFieldByName(\r\n bindingPair.parentPropertyId\r\n );\r\n if (!parentDsField) {\r\n continue;\r\n }\r\n const parentValue = binding.parentDataView.dataTable.getCellValueByDataSourceField(\r\n selectedRow,\r\n parentDsField\r\n );\r\n const childDsField = binding.childDataView.dataSource.getFieldByName(\r\n bindingPair.childPropertyId\r\n );\r\n if (!childDsField) {\r\n continue;\r\n }\r\n filterItems.push(toFilterItem(childDsField.name, \"eq\", parentValue));\r\n }\r\n }\r\n return joinWithAND(filterItems);\r\n }\r\n\r\n\r\n *loadGetData(): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const dataView = getDataView(this);\r\n const api = getApi(this);\r\n let data;\r\n if (dataView.isRootEntity && !dataView.isRootGrid && isLazyLoading(this)) {\r\n if (dataView.parentBindings.length === 1) {\r\n data = [dataView.parentBindings[0].parentDataView.selectedRow];\r\n } else {\r\n data = yield api.getRows({\r\n MenuId: getMenuItemId(dataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(dataView),\r\n Filter: this.buildDetailFilter(dataView),\r\n FilterLookups: getUserFilterLookups(dataView),\r\n Ordering: [],\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n MasterRowId: undefined,\r\n RowOffset: 0,\r\n Parameters: {},\r\n ColumnNames: getColumnNamesToLoad(dataView),\r\n });\r\n }\r\n } else {\r\n const parentRowId = getParentRowId(this);\r\n const masterRowId = getMasterRowId(this);\r\n data = !parentRowId || !masterRowId\r\n ? []\r\n : yield getFormScreen(this).getData(getEntity(this), dataView.modelInstanceId, parentRowId, masterRowId);\r\n }\r\n yield dataView.setRecords(data);\r\n dataView.selectFirstRow();\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *navigateChildren(): Generator {\r\n try {\r\n this.monitor.inFlow++;\r\n const entity = getEntity(this);\r\n const dataView = getDataView(this);\r\n yield Promise.all(\r\n getBindingChildren(this).map(childDataView =>\r\n flow(function*() {\r\n try {\r\n const childEntity = getEntity(childDataView);\r\n if (childEntity === entity && childDataView.isPreloaded) {\r\n yield*navigateAsChild(childDataView, dataView.dataTable.allRows)();\r\n } else {\r\n yield*navigateAsChild(childDataView)();\r\n }\r\n } catch (e) {\r\n yield*handleError(childDataView)(e);\r\n }\r\n })()\r\n )\r\n );\r\n /*for (let bch of getBindingChildren(this)) {\r\n yield navigateAsChild(bch)();\r\n }*/\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getIsBindingParent(ctx: any) {\r\n return getDataView(ctx).isBindingParent;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport _ from \"lodash\";\r\nimport { action, computed, flow, observable, when } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { ILookupLoader } from \"./types/ILookupLoader\";\r\n\r\nexport class LookupLoader implements ILookupLoader {\r\n collectedQuery: {\r\n LookupId: string;\r\n MenuId: string | undefined;\r\n LabelIds: string[];\r\n }[] = [];\r\n\r\n @observable loadingScheduled = true;\r\n @observable loadingDone = false;\r\n @observable loadingError: undefined | any;\r\n willLoad = false;\r\n isLoading = false;\r\n\r\n loadedItems: { [key: string]: { [key: string]: any } } = {};\r\n waitingRequesters = 0;\r\n\r\n @observable inFlow = 0;\r\n\r\n @computed get isWorking() {\r\n return this.inFlow > 0;\r\n }\r\n\r\n async getLookupLabels(query: {\r\n LookupId: string;\r\n MenuId: string | undefined;\r\n LabelIds: string[];\r\n }) {\r\n try {\r\n const existingItem = this.collectedQuery.find(\r\n (q) => q.LookupId === query.LookupId && q.MenuId === query.MenuId\r\n );\r\n if (existingItem) {\r\n const existingIds = new Set(existingItem.LabelIds);\r\n query.LabelIds.forEach((id) => existingIds.add(id));\r\n existingItem.LabelIds = Array.from(existingIds);\r\n } else {\r\n this.collectedQuery.push(query);\r\n }\r\n this.ensureScheduleLoad();\r\n this.waitingRequesters++;\r\n await when(() => this.loadingDone || this.loadingError);\r\n if (this.loadingError) {\r\n throw this.loadingError;\r\n }\r\n const result = this.loadedItems[query.LookupId] || {};\r\n return result;\r\n } finally {\r\n this.waitingRequesters--;\r\n if (this.waitingRequesters === 0) {\r\n this.loadedItems = {};\r\n this.loadingError = undefined;\r\n }\r\n }\r\n }\r\n\r\n async triggerLoadImm() {\r\n const self = this;\r\n flow(function*() {\r\n if (self.isLoading) {\r\n return;\r\n }\r\n self.isLoading = true;\r\n try {\r\n self.inFlow++;\r\n while (self.willLoad) {\r\n const api = getApi(self);\r\n self.willLoad = false;\r\n const query = self.collectedQuery;\r\n self.collectedQuery = [];\r\n self.loadedItems = {\r\n ...self.loadedItems,\r\n ...(yield api.getLookupLabelsEx(query)),\r\n };\r\n if (!self.willLoad) {\r\n self.loadingDone = true;\r\n }\r\n }\r\n } catch (error) {\r\n // TODO: Better error handling.\r\n // TODO: Refactor to use generators\r\n yield*handleError(self)(error);\r\n } finally {\r\n self.inFlow--;\r\n self.isLoading = false;\r\n }\r\n })();\r\n }\r\n\r\n triggerLoad = _.throttle(this.triggerLoadImm.bind(this), 100);\r\n\r\n @action.bound ensureScheduleLoad() {\r\n this.loadingDone = false;\r\n this.willLoad = true;\r\n this.triggerLoad();\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function flashColor2htmlColor(flashColor: number) {\r\n if (flashColor === 0 || flashColor === null || flashColor === undefined) {\r\n return undefined;\r\n }\r\n return (\r\n \"#\" +\r\n (flashColor < 0 ? flashColor + 0xffffffff + 1 : flashColor)\r\n .toString(16)\r\n .slice(-6)\r\n .toUpperCase()\r\n .padStart(6, \"0\")\r\n );\r\n}\r\n\r\nexport function htmlColor2FlashColor(htmlColor: string | undefined | null) {\r\n if (htmlColor === undefined || htmlColor === null) {\r\n return htmlColor;\r\n }\r\n if (htmlColor.startsWith(\"#\")) {\r\n htmlColor = htmlColor.slice(1);\r\n }\r\n const flashColor = parseInt(htmlColor, 16);\r\n return flashColor;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"../DataSources/getDataSource\";\r\n\r\nexport function getRowStates(ctx: any) {\r\n return getDataSource(ctx).rowState;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStates } from \"./getRowStates\";\r\n\r\nexport function getRowStateById(ctx: any, id: string) {\r\n return getRowStates(ctx).getValue(id);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateIsDisableAction(ctx: any, rowId: string, actionId: string) {\r\n const rowState = getRowStateById(ctx, rowId);\r\n return rowState ? rowState.disabledActions.has(actionId) : true;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateIsDisableAction } from \"model/selectors/RowState/getRowStateIsDisabledAction\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { IAction, IActionData, IActionMode, IActionPlacement, IActionType } from \"./types/IAction\";\r\nimport { IActionParameter } from \"./types/IActionParameter\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport class Action implements IAction {\r\n $type_IAction: 1 = 1;\r\n\r\n constructor(data: IActionData) {\r\n Object.assign(this, data);\r\n this.parameters.forEach((o) => (o.parent = this));\r\n }\r\n\r\n type: IActionType = null as any;\r\n id: string = \"\";\r\n groupId: string = \"\";\r\n caption: string = \"\";\r\n placement: IActionPlacement = null as any;\r\n iconUrl: string = \"\";\r\n mode: IActionMode = null as any;\r\n isDefault: boolean = false;\r\n parameters: IActionParameter[] = [];\r\n\r\n get isEnabled() {\r\n if (this.mode === IActionMode.Always) {\r\n return true;\r\n }\r\n\r\n switch (this.mode) {\r\n case IActionMode.ActiveRecord: {\r\n const selRowId = getSelectedRowId(this);\r\n return selRowId ? !getRowStateIsDisableAction(this, selRowId, this.id) : false;\r\n }\r\n case IActionMode.MultipleCheckboxes: {\r\n const selectedIds = getDataView(this).selectedRowIds;\r\n return selectedIds.size > 0\r\n ? !Array.from(selectedIds)\r\n .map((rowId) => getRowStateIsDisableAction(this, rowId, this.id))\r\n .some((item) => item)\r\n : this.placement === IActionPlacement.Toolbar;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IActionParameter, IActionParameterData } from \"./types/IActionParameter\";\r\n\r\nexport class ActionParameter implements IActionParameter {\r\n $type_IActionParameter: 1 = 1;\r\n\r\n constructor(data: IActionParameterData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n name: string = \"\";\r\n fieldName: string = \"\";\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n IComponentBinding,\r\n IComponentBindingData,\r\n IComponentBindingPair,\r\n IComponentBindingPairData\r\n} from \"./types/IComponentBinding\";\r\nimport { computed } from \"mobx\";\r\nimport { IDataView } from \"./types/IDataView\";\r\nimport { getFormScreen } from \"../selectors/FormScreen/getFormScreen\";\r\nimport { getDataTable } from \"../selectors/DataView/getDataTable\";\r\n\r\nexport class ComponentBindingPair implements IComponentBindingPair {\r\n constructor(data: IComponentBindingPairData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n parent?: any;\r\n parentPropertyId: string = \"\";\r\n childPropertyId: string = \"\";\r\n}\r\n\r\nexport class ComponentBinding implements IComponentBinding {\r\n $type_IComponentBinding: 1 = 1;\r\n\r\n constructor(data: IComponentBindingData) {\r\n Object.assign(this, data);\r\n this.bindingPairs.forEach(o => (o.parent = this));\r\n }\r\n\r\n parentId: string = \"\";\r\n parentEntity: string = \"\";\r\n childId: string = \"\";\r\n childEntity: string = \"\";\r\n childPropertyType: string = \"\";\r\n bindingPairs: IComponentBindingPair[] = [];\r\n\r\n @computed get parentDataView(): IDataView {\r\n const screen = getFormScreen(this);\r\n return screen.getDataViewByModelInstanceId(this.parentId)!;\r\n }\r\n\r\n @computed get childDataView(): IDataView {\r\n const screen = getFormScreen(this);\r\n return screen.getDataViewByModelInstanceId(this.childId)!;\r\n }\r\n\r\n @computed get bindingController() {\r\n const c: Array<[string, any]> = [];\r\n const parentDataTable = getDataTable(this.parentDataView);\r\n for (let pair of this.bindingPairs) {\r\n const row = this.parentDataView.selectedRow;\r\n const property = parentDataTable.getPropertyById(pair.parentPropertyId);\r\n if (row && property) {\r\n c.push([\r\n pair.childPropertyId,\r\n parentDataTable.getCellValue(row, property)\r\n ]);\r\n }\r\n }\r\n return c;\r\n }\r\n\r\n @computed get isBindingControllerValid() {\r\n return this.bindingController.every(pair => pair[0] && pair[1])\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataSource, IDataSourceData } from \"./types/IDataSource\";\r\nimport { IDataSourceField } from \"./types/IDataSourceField\";\r\nimport { IRowState } from \"./types/IRowState\";\r\n\r\nexport class DataSource implements IDataSource {\r\n $type_IDataSource: 1 = 1;\r\n\r\n constructor(data: IDataSourceData) {\r\n Object.assign(this, data);\r\n this.fields.forEach(o => (o.parent = this));\r\n this.rowState.parent = this;\r\n }\r\n\r\n parent?: any;\r\n\r\n entity: string = \"\";\r\n dataStructureEntityId: string = \"\";\r\n identifier: string = \"\";\r\n lookupCacheKey: string = \"\";\r\n fields: IDataSourceField[] = [];\r\n rowState: IRowState = null as any;\r\n\r\n getFieldByName(name: string): IDataSourceField | undefined {\r\n let field = this.fields.find(field => field.name === name);\r\n if(!field){\r\n const filedNames = this.fields.map(field => field.name).join(\", \");\r\n throw new Error(`Filed named \"${name}\" was not found in data source fields : [${filedNames}]. Please make sure the DataBinding is set up correctly.`);\r\n }\r\n return field;\r\n }\r\n\r\n getFieldByIndex(index: number): IDataSourceField | undefined {\r\n return this.fields.find(field => field.index === index);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataSourceField, IDataSourceFieldData } from \"./types/IDataSourceField\";\r\n\r\nexport class DataSourceField implements IDataSourceField {\r\n $type_IDataSourceField: 1 = 1;\r\n\r\n constructor(data: IDataSourceFieldData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n parent?: any;\r\n name: string = \"\";\r\n index: number = 0;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IAdditionalRowData, } from \"./types/IAdditionalRecordData\";\r\nimport { observable } from \"mobx\";\r\n\r\nexport class AdditionalRowData implements IAdditionalRowData {\r\n $type_IAdditionalRowData: 1 = 1;\r\n\r\n @observable dirtyNew: boolean = false;\r\n @observable dirtyDeleted: boolean = false;\r\n @observable dirtyValues: Map = new Map();\r\n @observable dirtyFormValues: Map = new Map();\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isLazyLoading } from \"./isLazyLoading\";\r\nimport { getDataView } from \"./DataView/getDataView\";\r\n\r\nexport function isInfiniteScrollingActive(ctx: any, dataViewAttributes?: any) {\r\n\r\n const isRootGrid = dataViewAttributes\r\n ? dataViewAttributes.IsRootGrid === \"true\"\r\n : getDataView(ctx).isRootGrid\r\n\r\n return isLazyLoading(ctx) && isRootGrid;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function fixRowIdentifier(row: any[], identifierIndex: number) {\r\n row = [...row];\r\n const id = row[identifierIndex];\r\n if (id !== null && id !== undefined) {\r\n row[identifierIndex] = `${id}`;\r\n }\r\n return row;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { MAX_CHUNKS_TO_HOLD, SCROLL_ROW_CHUNK, } from \"../../gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { IRowsContainer } from \"./types/IRowsContainer\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { fixRowIdentifier } from \"utils/dataRow\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\n\r\n// The constants have to be defined here for the unit tests to work.\r\n// const MAX_CHUNKS_TO_HOLD = 20;\r\n// const SCROLL_ROW_CHUNK = 1000;\r\n\r\nexport class ScrollRowContainer implements IRowsContainer {\r\n $type_ScrollRowContainer: 1 = 1;\r\n\r\n constructor(rowIdGetter: (row: any[]) => string, parent: any) {\r\n this.rowIdGetter = rowIdGetter;\r\n this.parent = parent;\r\n }\r\n\r\n parent: any;\r\n @observable\r\n rowChunks: RowChunk[] = [];\r\n private readonly rowIdGetter: (row: any[]) => string;\r\n\r\n getTrueIndexById(id: string) {\r\n const chunk = this.findChunkByRowId(id);\r\n if (!chunk) {\r\n return undefined;\r\n }\r\n return chunk.rowOffset + chunk.getRowIdxById(id)!;\r\n }\r\n\r\n async updateSortAndFilter(data?: { retainPreviousSelection?: true }) {\r\n }\r\n\r\n start() {\r\n }\r\n\r\n stop() {\r\n }\r\n\r\n @computed\r\n get rows() {\r\n return this.rowChunks.flatMap((chunk) => chunk.rows);\r\n }\r\n\r\n get allRows() {\r\n return this.rows;\r\n }\r\n\r\n getAllValuesOfProp(property: IProperty) {\r\n return this.rows;\r\n }\r\n\r\n clear(): void {\r\n this.rowChunks.length = 0;\r\n }\r\n\r\n delete(row: any[]): void {\r\n const rowId = this.rowIdGetter(row);\r\n const chunk = this.findChunkByRowId(rowId);\r\n if (!chunk) {\r\n throw new Error(`Row with id \"${rowId}\" was not found`);\r\n }\r\n chunk.delete(rowId);\r\n }\r\n\r\n findChunkByRowId(rowId: string) {\r\n return this.rowChunks.find((chunk) => chunk.has(rowId));\r\n }\r\n\r\n findChunkByRowIndex(indexInContainer: number) {\r\n let rowCounter = 0;\r\n if (this.rowChunks.length === 0) {\r\n return {\r\n chunk: undefined,\r\n indexInChunk: undefined,\r\n };\r\n }\r\n for (let rowChunk of this.rowChunks) {\r\n const indexInChunk = indexInContainer - rowCounter;\r\n if (indexInChunk < rowChunk.rows.length) {\r\n return {\r\n chunk: rowChunk,\r\n indexInChunk: indexInChunk,\r\n };\r\n }\r\n rowCounter += rowChunk.rows.length;\r\n }\r\n const lastChunk = this.rowChunks[this.rowChunks.length - 1];\r\n return {\r\n chunk: lastChunk,\r\n indexInChunk: lastChunk.rows.length,\r\n };\r\n }\r\n\r\n insert(index: number, row: any[], shouldLockNewRowAtTop?: boolean): Promise {\r\n const dataTable = getDataTable(this);\r\n row = fixRowIdentifier(row, dataTable.identifierDataIndex);\r\n const {chunk, indexInChunk} = this.findChunkByRowIndex(index);\r\n if (!chunk) {\r\n this.rowChunks.push(new RowChunk(0, [row], this.rowIdGetter, undefined));\r\n } else {\r\n chunk.insert(indexInChunk!, row);\r\n }\r\n return Promise.resolve();\r\n }\r\n\r\n @action.bound\r\n async set(rowsIn: any[][], rowOffset: number = 0, isFinal: boolean | undefined = undefined): Promise {\r\n const dataTable = getDataTable(this);\r\n const rows: any[][] = [];\r\n for (let row of rowsIn) {\r\n rows.push(fixRowIdentifier(row, dataTable.identifierDataIndex));\r\n }\r\n this.clear();\r\n if (rows.length !== 0) {\r\n this.rowChunks.push(new RowChunk(rowOffset, rows, this.rowIdGetter, isFinal));\r\n }\r\n this.notifyResetListeners();\r\n }\r\n\r\n substitute(row: any[]): void {\r\n const dataTable = getDataTable(this);\r\n row = fixRowIdentifier(row, dataTable.identifierDataIndex);\r\n for (let chunk of this.rowChunks) {\r\n const foundAndSubstituted = chunk.trySubstitute(row);\r\n if (foundAndSubstituted) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n resetListeners: (() => void)[] = [];\r\n\r\n registerResetListener(listener: () => void) {\r\n this.resetListeners.push(listener);\r\n }\r\n\r\n notifyResetListeners() {\r\n for (let resetListener of this.resetListeners) {\r\n resetListener();\r\n }\r\n }\r\n\r\n get nextEndOffset() {\r\n return this.rowChunks.length === 0\r\n ? SCROLL_ROW_CHUNK\r\n : this.rowChunks[this.rowChunks.length - 1].rowOffset + SCROLL_ROW_CHUNK;\r\n }\r\n\r\n get nextStartOffset() {\r\n return this.rowChunks.length === 0 || this.rowChunks[0].rowOffset < SCROLL_ROW_CHUNK\r\n ? 0\r\n : this.rowChunks[0].rowOffset - SCROLL_ROW_CHUNK;\r\n }\r\n\r\n @action.bound\r\n prependRecords(rowsIn: any[][]) {\r\n const dataTable = getDataTable(this);\r\n const rows: any[][] = [];\r\n for (let row of rowsIn) {\r\n rows.push(fixRowIdentifier(row, dataTable.identifierDataIndex));\r\n }\r\n if (this.rowChunks.length === 0) {\r\n this.rowChunks.push(new RowChunk(0, rows, this.rowIdGetter, undefined));\r\n return;\r\n }\r\n const rowOffset = this.rowChunks[0].rowOffset - SCROLL_ROW_CHUNK;\r\n if (rowOffset < 0) {\r\n return;\r\n }\r\n this.rowChunks.unshift(new RowChunk(rowOffset, rows, this.rowIdGetter, undefined));\r\n if (this.rowChunks.length > MAX_CHUNKS_TO_HOLD) {\r\n this.rowChunks.pop();\r\n }\r\n }\r\n\r\n @action.bound\r\n appendRecords(rowsIn: any[][]) {\r\n const dataTable = getDataTable(this);\r\n const rows: any[][] = [];\r\n for (let row of rowsIn) {\r\n rows.push(fixRowIdentifier(row, dataTable.identifierDataIndex));\r\n }\r\n if (this.rowChunks.length === 0) {\r\n this.rowChunks.push(new RowChunk(0, rows, this.rowIdGetter, undefined));\r\n return;\r\n }\r\n const rowOffset = this.rowChunks[this.rowChunks.length - 1].rowOffset + SCROLL_ROW_CHUNK;\r\n const isFinal = rows.length < SCROLL_ROW_CHUNK;\r\n const rowChunk = new RowChunk(rowOffset, rows, this.rowIdGetter, isFinal);\r\n const filteredChunk = this.replaceDuplicateRows(rowChunk);\r\n this.rowChunks.push(filteredChunk);\r\n if (this.rowChunks.length > MAX_CHUNKS_TO_HOLD) {\r\n this.rowChunks.shift();\r\n }\r\n }\r\n\r\n replaceDuplicateRows(newChunk: RowChunk) {\r\n let filteredChunk = newChunk;\r\n for (let rowChunk of this.rowChunks) {\r\n filteredChunk = rowChunk.replaceRows(filteredChunk);\r\n }\r\n return filteredChunk;\r\n }\r\n\r\n @computed\r\n get isLastRowLoaded() {\r\n return this.rowChunks.length === 0 ? false : this.rowChunks[this.rowChunks.length - 1].isFinal;\r\n }\r\n\r\n @computed\r\n get isFirstRowLoaded() {\r\n return this.rowChunks.length === 0 ? false : this.rowChunks[0].isInitial;\r\n }\r\n\r\n @computed\r\n get isFull() {\r\n return this.rows.length === MAX_CHUNKS_TO_HOLD * SCROLL_ROW_CHUNK;\r\n }\r\n\r\n unlockAddedRowPosition(): void {\r\n }\r\n\r\n addedRowPositionLocked: boolean = false;\r\n\r\n getFirstRow(): any[] | undefined {\r\n if (this.rows.length === 0) {\r\n return undefined;\r\n }\r\n return this.rows[0];\r\n }\r\n\r\n getFilteredRows(args: { propertyFilterIdToExclude: string }): any[] {\r\n return [];\r\n }\r\n}\r\n\r\nclass RowChunk {\r\n rowOffset: number;\r\n @observable.shallow\r\n rows: any[];\r\n private rowIdGetter: (row: any[]) => string;\r\n isFinal: boolean;\r\n private idMap: Map;\r\n\r\n constructor(\r\n rowOffset: number,\r\n rows: any[],\r\n rowIdGetter: (row: any[]) => string,\r\n isFinal: boolean | undefined\r\n ) {\r\n this.rowIdGetter = rowIdGetter;\r\n this.isFinal = isFinal === undefined ? rows.length < SCROLL_ROW_CHUNK : isFinal;\r\n if (rowOffset < 0) {\r\n throw new Error(\"Offset cannot be less than 0\");\r\n }\r\n this.rowOffset = rowOffset;\r\n this.rows = rows;\r\n this.idMap = this.makeIdMap(rows);\r\n }\r\n\r\n makeIdMap(rows: any[][]) {\r\n const idMap = new Map();\r\n for (let i = 0; i < rows.length; i++) {\r\n idMap.set(this.rowIdGetter(rows[i]), i);\r\n }\r\n return idMap;\r\n }\r\n\r\n get isInitial() {\r\n return this.rowOffset === 0;\r\n }\r\n\r\n get length() {\r\n return this.rows.length;\r\n }\r\n\r\n trySubstitute(row: any[]) {\r\n const index = this.rows.findIndex(\r\n (existingRow) => this.rowIdGetter(existingRow) === this.rowIdGetter(row)\r\n );\r\n if (index > -1) {\r\n this.rows.splice(index, 1, row);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n getRow(id: string) {\r\n const rowIndex = this.idMap.get(id);\r\n if (rowIndex === undefined) {\r\n return undefined;\r\n }\r\n return this.rows[rowIndex];\r\n }\r\n\r\n replaceRows(sourceChunk: RowChunk) {\r\n const duplicateRowIndicesInSource: number[] = [];\r\n for (let id of this.idMap.keys()) {\r\n const duplicateRow = sourceChunk.getRow(id);\r\n if (duplicateRow) {\r\n const indexInThisChunk = this.idMap.get(id)!;\r\n this.rows[indexInThisChunk] = duplicateRow;\r\n duplicateRowIndicesInSource.push(sourceChunk.getIndex(id)!);\r\n }\r\n }\r\n\r\n if (duplicateRowIndicesInSource.length === 0) {\r\n return sourceChunk;\r\n } else {\r\n const nonDuplicateRows = sourceChunk.rows.filter(\r\n (row, i) => !duplicateRowIndicesInSource.includes(i)\r\n );\r\n return new RowChunk(\r\n sourceChunk.rowOffset,\r\n nonDuplicateRows,\r\n this.rowIdGetter,\r\n sourceChunk.isFinal\r\n );\r\n }\r\n }\r\n\r\n private getIndex(rowId: string) {\r\n return this.idMap.get(rowId);\r\n }\r\n\r\n has(rowId: string) {\r\n return this.getIndex(rowId) !== undefined;\r\n }\r\n\r\n delete(rowId: string) {\r\n const index = this.getIndex(rowId)!;\r\n this.idMap.delete(rowId);\r\n this.rows.splice(index, 1);\r\n this.shiftIdMapDown(index);\r\n }\r\n\r\n insert(index: number, row: any[]) {\r\n this.rows.splice(index, 0, row);\r\n const rowId = this.rowIdGetter(row);\r\n this.shiftIdMapUp(index);\r\n this.idMap.set(rowId, index);\r\n }\r\n\r\n private shiftIdMapDown(index: number) {\r\n for (let entry of Array.from(this.idMap.entries())) {\r\n if (entry[1] > index) {\r\n this.idMap.set(entry[0], entry[1] - 1);\r\n }\r\n }\r\n }\r\n\r\n private shiftIdMapUp(index: number) {\r\n for (let entry of Array.from(this.idMap.entries())) {\r\n if (entry[1] > index - 1) {\r\n this.idMap.set(entry[0], entry[1] + 1);\r\n }\r\n }\r\n }\r\n\r\n getRowIdxById(id: string) {\r\n const idx = this.rows.findIndex((row) => this.rowIdGetter(row) === id);\r\n return idx > -1 ? idx : undefined;\r\n }\r\n}\r\n\r\nexport const isScrollRowContainer = (o: any): o is ScrollRowContainer => o.$type_ScrollRowContainer;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getDataViewPropertyById(ctx: any, id: string) {\r\n return getDataView(ctx).properties\r\n .flatMap(property => [property, ...property.childProperties])\r\n .find(item => item.id === id);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, comparer, computed, flow, IReactionDisposer, observable, reaction } from \"mobx\";\r\nimport { IFilterConfiguration } from \"./types/IFilterConfiguration\";\r\nimport { IOrderByDirection, IOrdering, IOrderingConfiguration } from \"./types/IOrderingConfiguration\";\r\nimport { IRowsContainer } from \"./types/IRowsContainer\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport _ from \"lodash\";\r\nimport { fixRowIdentifier } from \"utils/dataRow\";\r\nimport { IDataView } from \"./types/IDataView\";\r\nimport { FlowBusyMonitor } from \"utils/flow\";\r\nimport { T } from \"utils/translation\";\r\n\r\nexport class ListRowContainer implements IRowsContainer {\r\n private orderingConfiguration: IOrderingConfiguration;\r\n private filterConfiguration: IFilterConfiguration;\r\n private reactionDisposer: IReactionDisposer | undefined;\r\n @observable\r\n private forcedLastRowId: string | undefined;\r\n\r\n constructor(\r\n orderingConfiguration: IOrderingConfiguration,\r\n filterConfiguration: IFilterConfiguration,\r\n rowIdGetter: (row: any[]) => string,\r\n parent: any\r\n ) {\r\n this.orderingConfiguration = orderingConfiguration;\r\n this.filterConfiguration = filterConfiguration;\r\n this.rowIdGetter = rowIdGetter;\r\n this.parent = parent;\r\n }\r\n\r\n @observable.shallow allRows: any[][] = [];\r\n rowIdGetter: (row: any[]) => any;\r\n\r\n @observable\r\n sortedIds: any[] | undefined;\r\n\r\n @computed get idToRow() {\r\n const entries = this.allRows.map(row => [this.rowIdGetter(row), row] as [any, any[]]);\r\n return new Map(entries);\r\n }\r\n\r\n async start() {\r\n this.reactionDisposer = reaction(\r\n () => [\r\n this.filterConfiguration.activeFilters.map((filter) => [\r\n filter.propertyId,\r\n Array.isArray(filter.setting.val1) ? [...filter.setting.val1] : filter.setting.val1,\r\n Array.isArray(filter.setting.val2) ? [...filter.setting.val2] : filter.setting.val2,\r\n filter.setting.type,\r\n ]),\r\n this.orderingConfiguration.orderings.map((x) => [x.columnId, x.direction])],\r\n () => this.updateSortAndFilterDebounced(),\r\n {\r\n equals: comparer.structural,\r\n }\r\n );\r\n await this.updateSortAndFilter();\r\n }\r\n\r\n stop() {\r\n this.reactionDisposer?.();\r\n }\r\n\r\n *preloadLookups() {\r\n const dataView = getDataView(this.orderingConfiguration);\r\n const dataTable = getDataTable(dataView);\r\n\r\n const orderingComboProps = this.orderingConfiguration.userOrderings\r\n .map(ordering => this.getOrderingProperty(dataView, ordering))\r\n .filter((prop) => prop.column === \"ComboBox\");\r\n\r\n const filterComboProps = this.filterConfiguration.activeFilters\r\n .map((term) => getDataViewPropertyById(this.filterConfiguration, term.propertyId)!)\r\n .filter((prop) => prop.column === \"ComboBox\");\r\n const allComboProps = Array.from(new Set(filterComboProps.concat(orderingComboProps)));\r\n\r\n yield Promise.all(\r\n allComboProps.map(async (prop) => {\r\n return prop.lookupEngine?.lookupResolver.resolveList(\r\n dataTable.getAllValuesOfProp(prop)\r\n );\r\n })\r\n );\r\n }\r\n\r\n getOrderingProperty(dataView: IDataView, ordering: IOrdering) {\r\n const property = getDataViewPropertyById(dataView, ordering.columnId)\r\n if (!property) {\r\n // throw new Error(`Panel ${dataView.modelId} has default sort set to column ${ordering.columnId}. This column does not exist in the panel. Cannot set default sort.`);\r\n throw new Error(T(`Panel ${dataView.modelId} has default sort set to column ${ordering.columnId}. This column does not exist in the panel. Cannot set default sort.`,\r\n \"invalid_sort_column\", dataView.modelId, ordering.columnId, dataView.name));\r\n }\r\n return property;\r\n }\r\n\r\n updateSortAndFilterDebounced = _.debounce(this.updateSortAndFilter, 10);\r\n monitor: FlowBusyMonitor = new FlowBusyMonitor();\r\n\r\n @action\r\n async updateSortAndFilter(data?: { retainPreviousSelection?: boolean }) {\r\n const self = this;\r\n await flow(\r\n function*() {\r\n yield*self.preloadLookups();\r\n let rows = self.allRows;\r\n if (self.filterConfiguration.filteringFunction()) {\r\n rows = rows.filter((row) => self.filterConfiguration.filteringFunction()(row));\r\n }\r\n if (self.orderingConfiguration.orderings.length !== 0) {\r\n rows = rows.sort((row1: any[], row2: any[]) => self.internalRowOrderingFunc(row1, row2));\r\n }\r\n self.sortedIds = rows.map(row => self.rowIdGetter(row));\r\n const dataView = getDataView(self);\r\n if (!data?.retainPreviousSelection) {\r\n dataView.reselectOrSelectFirst();\r\n }\r\n }\r\n )();\r\n }\r\n\r\n getFilteredRows(args: { propertyFilterIdToExclude: string }) {\r\n return this.allRows\r\n .filter((row) => this.filterConfiguration.filteringFunction(args.propertyFilterIdToExclude)(row));\r\n }\r\n\r\n @computed get rows() {\r\n if (!this.sortedIds) {\r\n return this.allRows;\r\n }\r\n return this.sortedIds\r\n .map(id => this.idToRow.get(id))\r\n .filter(row => row) as any[][];\r\n }\r\n\r\n internalRowOrderingFunc(row1: any[], row2: any[]) {\r\n if (this.forcedLastRowId !== undefined) {\r\n const orderings = this.orderingConfiguration.orderings;\r\n const directionMultiplier = orderings.length === 1 && orderings[0].direction === IOrderByDirection.DESC\r\n ? -1\r\n : 1;\r\n if (this.forcedLastRowId === this.rowIdGetter(row1)) return 1 * directionMultiplier;\r\n if (this.forcedLastRowId === this.rowIdGetter(row2)) return -1 * directionMultiplier;\r\n }\r\n return this.orderingConfiguration.orderingFunction()(row1, row2);\r\n }\r\n\r\n unlockAddedRowPosition(): void {\r\n this.forcedLastRowId = undefined;\r\n }\r\n\r\n clear(): void {\r\n this.allRows.length = 0;\r\n }\r\n\r\n delete(row: any[]): void {\r\n const rowId = this.rowIdGetter(row);\r\n const idx = this.allRows.findIndex((r) => this.rowIdGetter(r) === rowId);\r\n if (idx > -1) {\r\n this.allRows.splice(idx, 1);\r\n if (rowId === this.forcedLastRowId) {\r\n this.forcedLastRowId = undefined;\r\n }\r\n this.updateSortAndFilter({retainPreviousSelection: true});\r\n }\r\n }\r\n\r\n async insert(index: number, row: any[], shouldLockNewRowPosition?: boolean): Promise {\r\n const dataTable = getDataTable(this);\r\n row = fixRowIdentifier(row, dataTable.identifierDataIndex);\r\n const newRowId = dataTable.getRowId(row);\r\n const rowExistsAlready = this.allRows.some(row => dataTable.getRowId(row) === newRowId)\r\n if (rowExistsAlready) {\r\n return;\r\n }\r\n this.allRows.splice(index, 0, row);\r\n if (shouldLockNewRowPosition) {\r\n this.forcedLastRowId = this.rowIdGetter(row);\r\n }\r\n await this.updateSortAndFilter();\r\n }\r\n\r\n async set(rowsIn: any[][], rowOffset: number): Promise {\r\n const dataTable = getDataTable(this);\r\n const rows: any[][] = [];\r\n for (let row of rowsIn) {\r\n rows.push(fixRowIdentifier(row, dataTable.identifierDataIndex));\r\n }\r\n this.clear();\r\n for (let row of rows) this.allRows.push(row);\r\n await this.updateSortAndFilter();\r\n }\r\n\r\n appendRecords(rowsIn: any[][]) {\r\n let dataView = getDataView(this);\r\n if (dataView.type === \"SectionLevelPlugin\") {\r\n throw new Error(dataView.name + \" is a SectionLevelPlugin which does not allow navigation. This is not implemented. Please set the \\\"AllowNavigation\\\" property to true.\");\r\n }\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n substitute(row: any[]): void {\r\n const dataTable = getDataTable(this);\r\n row = fixRowIdentifier(row, dataTable.identifierDataIndex);\r\n const idx = this.allRows.findIndex((r) => this.rowIdGetter(r) === this.rowIdGetter(row));\r\n if (idx > -1) {\r\n this.allRows.splice(idx, 1, row);\r\n }\r\n }\r\n\r\n registerResetListener(listener: () => void): void {\r\n }\r\n\r\n parent: any;\r\n\r\n getTrueIndexById(id: string) {\r\n const idx = this.rows.findIndex((row) => this.rowIdGetter(row) === id);\r\n return idx > -1 ? idx : undefined;\r\n }\r\n\r\n get addedRowPositionLocked(): boolean {\r\n return this.forcedLastRowId !== undefined;\r\n }\r\n\r\n getFirstRow(): any[] | undefined {\r\n if (this.rows.length === 0) {\r\n return undefined;\r\n }\r\n return this.rows[0];\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getLocaleFromCookie } from \"../../utils/cookies\";\r\nimport _ from \"lodash\";\r\n\r\nconst clearCacheLater = _.debounce(() => {\r\n formatCache.clear();\r\n}, 10000);\r\nconst formatCache: any = new Map();\r\n\r\nfunction getOrSetCached(fnGetResult: () => any, ...simpleKeys: any[]) {\r\n let item = formatCache;\r\n let keyIndex = 0;\r\n for (let key of simpleKeys) {\r\n let nextItem = item.get(key);\r\n if (nextItem === undefined) {\r\n if (keyIndex === simpleKeys.length - 1) {\r\n item.set(key, (nextItem = fnGetResult()));\r\n } else {\r\n item.set(key, (nextItem = new Map()));\r\n }\r\n }\r\n item = nextItem;\r\n keyIndex++;\r\n }\r\n clearCacheLater();\r\n return item;\r\n}\r\n\r\nexport function formatNumberWithLocale(\r\n customNumericFormat: string | undefined,\r\n value: number,\r\n locale: string\r\n) {\r\n return getOrSetCached(\r\n () => {\r\n if (customNumericFormat) {\r\n const customFormat = new CustomNumericFormat(customNumericFormat);\r\n return value.toLocaleString(locale, {\r\n minimumFractionDigits: customFormat.minimumFractionDigits,\r\n maximumFractionDigits: customFormat.maximumFractionDigits,\r\n useGrouping: customFormat.useThousandsSeparator,\r\n });\r\n } else {\r\n return value.toLocaleString(locale);\r\n }\r\n },\r\n locale,\r\n customNumericFormat,\r\n value\r\n );\r\n}\r\n\r\nexport function getCurrentDecimalSeparator() {\r\n return getSeparator(\"decimal\");\r\n}\r\n\r\nexport function getCurrentGroupSeparator() {\r\n return getSeparator(\"group\");\r\n}\r\n\r\nfunction getSeparator(separatorType: string) {\r\n const locale = getLocaleFromCookie();\r\n const numberWithDecimalSeparator = 1000.1;\r\n return Intl.NumberFormat(locale)\r\n .formatToParts(numberWithDecimalSeparator)\r\n .find((part) => part.type === separatorType)!.value;\r\n}\r\n\r\nexport function formatNumber(\r\n customNumericFormat: string | undefined,\r\n dataType: string,\r\n value: number\r\n) {\r\n if(isNaN(value)){\r\n return \"\";\r\n }\r\n const locale = getLocaleFromCookie();\r\n if (customNumericFormat) {\r\n return formatNumberWithLocale(customNumericFormat, value, locale);\r\n }\r\n if (dataType === \"Currency\" || dataType === \"Float\") {\r\n return formatNumberWithLocale(\"### ###.00##########\", value, locale);\r\n } else {\r\n return formatNumberWithLocale(\"### ###\", value, locale);\r\n }\r\n}\r\n\r\nclass CustomNumericFormat {\r\n private format: string;\r\n private fractionFormat: string | undefined;\r\n\r\n constructor(format: string) {\r\n const containsAllowedChar = RegExp(\"^[# 0.]+$\").test(format);\r\n if (!containsAllowedChar) {\r\n throw new Error('Custom format contains unimplemented characters: \"' + format + '\"');\r\n }\r\n this.format = format.trim();\r\n this.fractionFormat = this.getFractionFormat(this.format);\r\n }\r\n\r\n getFractionFormat(format: string) {\r\n const splitByPoint = format.split(\".\");\r\n return splitByPoint.length < 2 ? undefined : splitByPoint[1];\r\n }\r\n\r\n get maximumFractionDigits() {\r\n return this.fractionFormat ? this.fractionFormat.length : undefined;\r\n }\r\n\r\n get minimumFractionDigits() {\r\n if (!this.fractionFormat) {\r\n return undefined;\r\n }\r\n const minDigits = this.fractionFormat.split(\"0\").length - 1;\r\n return minDigits === 0 ? undefined : minDigits;\r\n }\r\n\r\n get useThousandsSeparator() {\r\n return this.format.includes(\" \");\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataTable, IDataTableData } from \"./types/IDataTable\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { IProperty } from \"./types/IProperty\";\r\nimport { getDataView } from \"../selectors/DataView/getDataView\";\r\nimport { IAdditionalRowData } from \"./types/IAdditionalRecordData\";\r\nimport { AdditionalRowData } from \"./AdditionalRowData\";\r\nimport { IDataSourceField } from \"./types/IDataSourceField\";\r\nimport { getRowContainer } from \"../selectors/getRowContainer\";\r\nimport { IRowsContainer } from \"./types/IRowsContainer\";\r\nimport { formatNumber } from \"./NumberFormating\";\r\nimport { getDataSource } from \"model/selectors/DataSources/getDataSource\";\r\nimport { getDataSourceFieldByIndex } from \"model/selectors/DataSources/getDataSourceFieldByIndex\";\r\nimport { isArray } from \"lodash\";\r\n\r\nexport class DataTable implements IDataTable {\r\n $type_IDataTable: 1 = 1;\r\n rowsContainer: IRowsContainer = null as any;\r\n @observable\r\n isEmpty: boolean = false;\r\n @observable\r\n rowsAddedSinceSave = 0;\r\n\r\n constructor(data: IDataTableData) {\r\n Object.assign(this, data);\r\n this.rowsContainer = getRowContainer(\r\n data.formScreenLifecycle,\r\n data.dataViewAttributes,\r\n data.orderingConfiguration,\r\n data.filterConfiguration,\r\n (row: any[]) => this.getRowId(row),\r\n this\r\n );\r\n }\r\n\r\n rowRemovedListeners: (() => void)[] = [];\r\n\r\n notifyRowRemovedListeners() {\r\n this.rowRemovedListeners.forEach((listener) => listener());\r\n }\r\n\r\n async start() {\r\n await this.rowsContainer.start();\r\n }\r\n\r\n stop() {\r\n this.rowsContainer.stop();\r\n }\r\n\r\n get allRows() {\r\n return this.rowsContainer.allRows;\r\n }\r\n\r\n @computed get rows(): any[][] {\r\n return this.rowsContainer.rows;\r\n }\r\n\r\n @observable additionalRowData: Map = new Map();\r\n\r\n @computed\r\n get properties(): IProperty[] {\r\n return getDataView(this).properties;\r\n }\r\n\r\n @computed get dataSource() {\r\n return getDataSource(this);\r\n }\r\n\r\n @computed get identifierProperty() {\r\n return this.properties.find((prop) => prop.id === this.dataSource.identifier);\r\n }\r\n\r\n get identifierDataIndex() {\r\n return this.identifierProperty!.dataIndex;\r\n }\r\n\r\n getRowId(row: any[]): string {\r\n return row[this.identifierDataIndex];\r\n }\r\n\r\n getCellValue(row: any[], property: IProperty) {\r\n if (this.additionalRowData.has(this.getRowId(row))) {\r\n const ard = this.additionalRowData.get(this.getRowId(row))!;\r\n if (ard.dirtyFormValues.has(property.id)) {\r\n return ard.dirtyFormValues.get(property.id);\r\n }\r\n if (ard.dirtyValues.has(property.id)) {\r\n return ard.dirtyValues.get(property.id);\r\n }\r\n }\r\n return this.getOriginalCellValue(row, property);\r\n }\r\n\r\n getOriginalCellValue(row: any[], property: IProperty) {\r\n return row[property.dataIndex];\r\n }\r\n\r\n async updateSortAndFilter(data?: { retainPreviousSelection?: true }) {\r\n return this.rowsContainer.updateSortAndFilter(data);\r\n }\r\n\r\n getCellValueByDataSourceField(row: any[], dsField: IDataSourceField) {\r\n if (this.additionalRowData.has(this.getRowId(row))) {\r\n const ard = this.additionalRowData.get(this.getRowId(row))!;\r\n if (ard.dirtyFormValues.has(dsField.name)) {\r\n return ard.dirtyFormValues.get(dsField.name);\r\n }\r\n if (ard.dirtyValues.has(dsField.name)) {\r\n return ard.dirtyValues.get(dsField.name);\r\n }\r\n }\r\n return row[dsField.index];\r\n }\r\n\r\n // Returns all values from currently loaded rows (in case the table is infinitely scrolled)\r\n getAllValuesOfProp(property: IProperty): Set {\r\n const values = this.rowsContainer\r\n .getFilteredRows({propertyFilterIdToExclude: property.id})\r\n .map((row) => this.getCellValue(row, property)).filter((row) => row)\r\n if (values.some(value => isArray(value))) {\r\n return new Set(values.flatMap(array => array));\r\n }\r\n return new Set(values);\r\n }\r\n\r\n getCellText(row: any[], property: IProperty) {\r\n const value = this.getCellValue(row, property);\r\n return this.resolveCellText(property, value);\r\n }\r\n\r\n getOriginalCellText(row: any[], property: IProperty) {\r\n const value = this.getOriginalCellValue(row, property);\r\n return this.resolveCellText(property, value);\r\n }\r\n\r\n resolveCellText(property: IProperty, value: any): any {\r\n if (value === null || value === undefined || (Array.isArray(value) && value.length === 0))\r\n return \"\";\r\n if (property.isLookup && property.lookupEngine) {\r\n const {lookupEngine} = property;\r\n if (property.column === \"TagInput\") {\r\n if (!Array.isArray(value)) value = [value];\r\n const textArray = value.map((valueItem: any) =>\r\n lookupEngine.lookupResolver.resolveValue(`${valueItem}`)\r\n );\r\n return textArray || [];\r\n } else {\r\n if (Array.isArray(value)) {\r\n return value\r\n .map((item) => lookupEngine.lookupResolver.resolveValue(`${item}`))\r\n .join(\", \");\r\n }\r\n return lookupEngine.lookupResolver.resolveValue(`${value}`);\r\n }\r\n }\r\n if (property.column === \"Number\") {\r\n return formatNumber(property.customNumericFormat, property.entity, value);\r\n }\r\n return value;\r\n }\r\n\r\n getRowByExistingIdx(idx: number): any[] {\r\n return this.rows[idx];\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return this.rowsContainer.rows.find((row) => this.getRowId(row) === id);\r\n }\r\n\r\n getTrueIndexById(id: string) {\r\n return this.rowsContainer.getTrueIndexById(id);\r\n }\r\n\r\n getExistingRowIdxById(id: string) {\r\n const idx = this.rows.findIndex((row) => this.getRowId(row) === id);\r\n return idx > -1 ? idx : undefined;\r\n }\r\n\r\n isCellTextResolving(property: IProperty, value: any): boolean {\r\n if (value === null || value === undefined) return false;\r\n if (property.isLookup && property.lookupEngine) {\r\n const {lookupEngine} = property;\r\n if (property.column === \"TagInput\") {\r\n return value.some((valueItem: any) =>\r\n lookupEngine.lookupResolver.isEmptyAndLoading(`${valueItem}`)\r\n );\r\n } else {\r\n return lookupEngine.lookupResolver.isEmptyAndLoading(`${value}`);\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n getPropertyById(id: string) {\r\n return this.properties.find((prop) => prop.id === id);\r\n }\r\n\r\n getFirstRow(): any[] | undefined {\r\n return this.rowsContainer.getFirstRow();\r\n }\r\n\r\n getLastRow(): any[] | undefined {\r\n if (this.rows.length === 0) {\r\n return undefined;\r\n }\r\n return this.rows[this.rows.length - 1];\r\n }\r\n\r\n getNearestRow(row: any[]): any[] | undefined {\r\n const id = this.getRowId(row);\r\n let idx = this.getExistingRowIdxById(id);\r\n if (this.rows.length === 1) return;\r\n if (idx !== undefined) {\r\n if (idx === 0) {\r\n return this.rows[1];\r\n } else {\r\n return this.rows[idx - 1];\r\n }\r\n } else return;\r\n }\r\n\r\n getNextExistingRowId(id: string): string | undefined {\r\n const idx = this.rows.findIndex((r) => this.getRowId(r) === id);\r\n if (idx > -1) {\r\n const newRow = this.rows[idx + 1];\r\n return newRow ? this.getRowId(newRow) : undefined;\r\n }\r\n }\r\n\r\n getPrevExistingRowId(id: string): string | undefined {\r\n const idx = this.rows.findIndex((r) => this.getRowId(r) === id);\r\n if (idx > 0) {\r\n const newRow = this.rows[idx - 1];\r\n return newRow ? this.getRowId(newRow) : undefined;\r\n }\r\n }\r\n\r\n getAdditionalRowData(row: any[]) {\r\n return this.getAdditionalRowDataById(this.getRowId(row));\r\n }\r\n\r\n getAdditionalRowDataById(id: string) {\r\n return this.additionalRowData.get(id);\r\n }\r\n\r\n hasRowDirtyValues(row: any[]) {\r\n const ard = this.getAdditionalRowData(row);\r\n if (!ard) return;\r\n return ard.dirtyValues.size > 0;\r\n }\r\n\r\n getDirtyValues(row: any[]): Map {\r\n const ard = this.getAdditionalRowData(row);\r\n if (ard) {\r\n return ard.dirtyValues;\r\n } else {\r\n return new Map();\r\n }\r\n }\r\n\r\n getDirtyValueRows(): any[][] {\r\n return this.rows.filter((row) => this.hasRowDirtyValues(row));\r\n }\r\n\r\n @action.bound\r\n appendRecords(rows: any[][]): void {\r\n this.rowsContainer.appendRecords(rows);\r\n }\r\n\r\n @action.bound\r\n async setRecords(rows: any[][]) {\r\n this.clear();\r\n await this.rowsContainer.set(rows, 0, undefined);\r\n if (rows.length === 0) {\r\n this.isEmpty = true;\r\n }\r\n }\r\n\r\n @action.bound\r\n setFormDirtyValue(row: any[], propertyId: string, value: any) {\r\n this.createAdditionalData(row);\r\n this.additionalRowData.get(this.getRowId(row))!.dirtyFormValues.set(propertyId, value);\r\n }\r\n\r\n @action.bound\r\n flushFormToTable(row: any[]): void {\r\n const ard = this.getAdditionalRowData(row);\r\n if (ard) {\r\n for (let [propertyId, value] of ard.dirtyFormValues.entries()) {\r\n ard.dirtyValues.set(propertyId, value);\r\n }\r\n }\r\n }\r\n\r\n @action.bound setDirtyValue(row: any[], columnId: string, value: any) {\r\n this.createAdditionalData(row);\r\n const ard = this.getAdditionalRowData(row);\r\n if (ard) {\r\n ard.dirtyValues.set(columnId, value);\r\n }\r\n }\r\n\r\n\r\n @action.bound\r\n createAdditionalData(row: any[]) {\r\n if (!this.additionalRowData.has(this.getRowId(row))) {\r\n const ard = new AdditionalRowData();\r\n ard.parent = this;\r\n this.additionalRowData.set(this.getRowId(row), ard);\r\n }\r\n }\r\n\r\n @action.bound\r\n clearUnneededAdditionalRowData() {\r\n for (let [k, v] of Array.from(this.additionalRowData.entries())) {\r\n if (\r\n v.dirtyFormValues.size === 0 &&\r\n v.dirtyValues.size === 0\r\n ) {\r\n this.additionalRowData.delete(k);\r\n }\r\n }\r\n }\r\n\r\n @action.bound\r\n deleteAdditionalCellData(row: any[], propertyId: string) {\r\n const additionalData = this.additionalRowData.get(this.getRowId(row));\r\n if (!additionalData) {\r\n return;\r\n }\r\n additionalData.dirtyFormValues.delete(propertyId);\r\n additionalData.dirtyValues.delete(propertyId);\r\n }\r\n\r\n @action.bound\r\n deleteAdditionalRowData(row: any[]) {\r\n this.additionalRowData.delete(this.getRowId(row));\r\n }\r\n\r\n @action.bound\r\n deleteRow(row: any[]): void {\r\n this.deleteAdditionalRowData(row);\r\n this.rowsContainer.delete(row);\r\n this.notifyRowRemovedListeners();\r\n this.rowsAddedSinceSave--;\r\n }\r\n\r\n @action.bound\r\n clearRecordDirtyValues(id: string, newRow: any[]): void {\r\n const rowData = this.getAdditionalRowDataById(id);\r\n if (rowData) {\r\n const oldRow = this.getRowById(id)!;\r\n for (let i = 0; i < newRow.length; i++) {\r\n const dataSourceField = getDataSourceFieldByIndex(this, i)!;\r\n if (newRow[i] !== oldRow[i]) {\r\n rowData.dirtyFormValues.delete(dataSourceField.name);\r\n rowData.dirtyValues.delete(dataSourceField.name);\r\n }\r\n if (rowData.dirtyFormValues.get(dataSourceField.name) === newRow[i]) {\r\n rowData.dirtyFormValues.delete(dataSourceField.name);\r\n }\r\n if (rowData.dirtyValues.get(dataSourceField.name) === newRow[i]) {\r\n rowData.dirtyValues.delete(dataSourceField.name);\r\n }\r\n }\r\n this.clearUnneededAdditionalRowData();\r\n }\r\n }\r\n\r\n @action.bound\r\n substituteRecord(row: any[]): void {\r\n this.rowsContainer.substitute(row);\r\n }\r\n\r\n @action.bound\r\n async insertRecord(index: number, row: any[], shouldLockNewRowAtTop?: boolean): Promise {\r\n await this.rowsContainer.insert(index, row, shouldLockNewRowAtTop);\r\n this.rowsAddedSinceSave++;\r\n }\r\n\r\n @action.bound\r\n clear(): void {\r\n this.rowsContainer.clear();\r\n this.additionalRowData.clear();\r\n this.notifyRowRemovedListeners();\r\n }\r\n\r\n unlockAddedRowPosition(): void {\r\n this.rowsContainer.unlockAddedRowPosition();\r\n }\r\n\r\n get addedRowPositionLocked(): boolean {\r\n return this.rowsContainer.addedRowPositionLocked;\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IPanelViewType {\r\n Form = \"0\",\r\n Table = \"1\",\r\n Map = \"5\",\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isInfiniteScrollingActive } from \"./isInfiniteScrollingActive\";\r\nimport { IOrderingConfiguration } from \"../entities/types/IOrderingConfiguration\";\r\nimport { IFilterConfiguration } from \"../entities/types/IFilterConfiguration\";\r\nimport { ScrollRowContainer } from \"../entities/ScrollRowContainer\";\r\nimport { ListRowContainer } from \"../entities/ListRowContainer\";\r\n\r\nexport function getRowContainer(ctx: any, dataViewAttributes: any,\r\n orderingConfiguration: IOrderingConfiguration,\r\n filterConfiguration: IFilterConfiguration,\r\n rowIdGetter: (row: any[]) => string,\r\n parent: any) {\r\n return isInfiniteScrollingActive(ctx, dataViewAttributes)\r\n ? new ScrollRowContainer(rowIdGetter, parent)\r\n : new ListRowContainer(orderingConfiguration, filterConfiguration, rowIdGetter, parent);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"./getDataSource\";\r\n\r\nexport function getDataSourceFieldByIndex(ctx: any, index: number) {\r\n return getDataSource(ctx).getFieldByIndex(index);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getSelectedRow(ctx: any) {\r\n return getDataView(ctx).selectedRow;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"./getOpenedScreen\";\r\n\r\nexport function getIsDialog(ctx: any) {\r\n return getOpenedScreen(ctx).isDialog;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSource } from \"./getDataSource\";\r\n\r\nexport function getDataSourceFieldByName(ctx: any, name: string) {\r\n return getDataSource(ctx).getFieldByName(name);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStates } from \"./getRowStates\";\r\nimport { getDataView } from \"../DataView/getDataView\";\r\n\r\nexport function getRowStateMayCauseFlicker(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n return getRowStates(ctx).mayCauseFlicker && !dataView.dataTable.isEmpty;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from './getTablePanelView';\r\n\r\nexport function getTableViewProperties(ctx: any) {\r\n return getTablePanelView(ctx).tableProperties;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getIsSelectionCheckboxesShown(ctx: any) {\r\n return getDataView(ctx).showSelectionCheckboxes;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"./getTablePanelView\";\r\n\r\nexport function getGroupingConfiguration(ctx: any) {\r\n return getTablePanelView(ctx).groupingConfiguration;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGroupRow, IGroupTreeNode, ITableRow } from \"./types\";\r\n\r\nexport class TableGroupRow implements IGroupRow {\r\n constructor(public groupLevel: number, public sourceGroup: IGroupTreeNode) {\r\n }\r\n\r\n parent: IGroupRow | undefined;\r\n\r\n get columnLabel(): string {\r\n return this.sourceGroup.groupLabel;\r\n }\r\n\r\n get columnValue(): string {\r\n return this.sourceGroup.columnDisplayValue;\r\n }\r\n\r\n get isExpanded(): boolean {\r\n return this.sourceGroup.isExpanded;\r\n }\r\n}\r\n\r\n\r\nexport function flattenToTableRows(rootGroups: IGroupTreeNode[]) {\r\n const result: ITableRow[] = [];\r\n let level = 0;\r\n\r\n function recursive(group: IGroupTreeNode) {\r\n result.push(new TableGroupRow(level, group));\r\n if (!group.isExpanded) return;\r\n for (let g of group.childGroups) {\r\n level++;\r\n recursive(g);\r\n level--;\r\n }\r\n if (group.childGroups.length === 0) {\r\n result.push(...group.childRows);\r\n }\r\n }\r\n\r\n for (let group of rootGroups) {\r\n recursive(group);\r\n }\r\n return result;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getGroupingConfiguration } from \"./getGroupingConfiguration\";\r\nimport { getIsSelectionCheckboxesShown } from \"../DataView/getIsSelectionCheckboxesShown\";\r\n\r\nexport function getLeadingColumnCount(ctx: any) {\r\n const isCheckBoxedTable = getIsSelectionCheckboxesShown(ctx);\r\n const groupedColumnIds = getGroupingConfiguration(ctx).orderedGroupingColumnSettings;\r\n return groupedColumnIds.length + (isCheckBoxedTable ? 1 : 0);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGridDimensions } from \"../../../Components/ScreenElements/Table/types\";\r\nimport { action, computed } from \"mobx\";\r\nimport { IProperty } from \"../../../../model/entities/types/IProperty\";\r\nimport { getLeadingColumnCount } from \"../../../../model/selectors/TablePanelView/getLeadingColumnCount\";\r\nimport { getIsSelectionCheckboxesShown } from \"../../../../model/selectors/DataView/getIsSelectionCheckboxesShown\";\r\nimport { getGroupingConfiguration } from \"../../../../model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\n\r\nexport interface IGridDimensionsData {\r\n getTableViewProperties: () => IProperty[];\r\n getRowCount: () => number;\r\n getIsSelectionCheckboxes: () => boolean;\r\n ctx: any;\r\n defaultRowHeight: number;\r\n}\r\n\r\nexport class GridDimensions implements IGridDimensions {\r\n constructor(data: IGridDimensionsData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n @computed get columnWidths(): Map {\r\n return new Map(this.tableViewProperties.map((prop) => [prop.id, prop.columnWidth]));\r\n }\r\n\r\n getTableViewProperties: () => IProperty[] = null as any;\r\n getRowCount: () => number = null as any;\r\n getIsSelectionCheckboxes: () => boolean = null as any;\r\n ctx: any;\r\n defaultRowHeight: number = null as any;\r\n\r\n @computed get imageProperty() {\r\n for (let prop of this.tableViewProperties) {\r\n if (prop.column === \"Image\") {\r\n return prop;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n @computed get rowHeight(): number {\r\n if (this.imageProperty) return this.imageProperty.height;\r\n return this.defaultRowHeight;\r\n }\r\n\r\n\r\n @computed get isSelectionCheckboxes() {\r\n return this.getIsSelectionCheckboxes();\r\n }\r\n\r\n @computed get tableViewPropertiesOriginal() {\r\n return this.getTableViewProperties();\r\n }\r\n\r\n @computed get tableViewProperties() {\r\n return this.tableViewPropertiesOriginal;\r\n }\r\n\r\n @computed get rowCount() {\r\n return this.getRowCount();\r\n }\r\n\r\n @computed get columnCount() {\r\n return this.tableViewProperties.length;\r\n }\r\n\r\n get contentWidth() {\r\n if (this.columnCount === 0) return 0;\r\n return this.getColumnRight(this.columnCount - 1);\r\n }\r\n\r\n get contentHeight() {\r\n return this.getRowBottom(this.rowCount - 1);\r\n }\r\n\r\n getColumnLeft(dataColumnIndex: number): number {\r\n const displayedColumnIndex = this.dataColumnIndexToDisplayedIndex(dataColumnIndex);\r\n return this.displayedColumnDimensionsCom[displayedColumnIndex].left;\r\n }\r\n\r\n getColumnRight(dataColumnIndex: number): number {\r\n const displayedColumnIndex = this.dataColumnIndexToDisplayedIndex(dataColumnIndex);\r\n return this.displayedColumnDimensionsCom[displayedColumnIndex].right;\r\n }\r\n\r\n dataColumnIndexToDisplayedIndex(dataColumnIndex: number) {\r\n return dataColumnIndex + getLeadingColumnCount(this.ctx);\r\n }\r\n\r\n getRowTop(rowIndex: number): number {\r\n return rowIndex * this.getRowHeight(rowIndex);\r\n }\r\n\r\n getRowHeight(rowIndex: number): number {\r\n return this.rowHeight;\r\n }\r\n\r\n getRowBottom(rowIndex: number): number {\r\n return this.getRowTop(rowIndex) + this.getRowHeight(rowIndex);\r\n }\r\n\r\n @action.bound setColumnWidth(columnId: string, newWidth: number) {\r\n this.columnWidths.set(columnId, Math.max(newWidth, 20));\r\n }\r\n\r\n @computed get displayedColumnDimensionsCom(): { left: number; width: number; right: number }[] {\r\n const isCheckBoxedTable = getIsSelectionCheckboxesShown(this.ctx);\r\n const groupedColumnIds = getGroupingConfiguration(this.ctx).orderedGroupingColumnSettings;\r\n const tableColumnIds = getTableViewProperties(this.ctx).map((prop) => prop.id);\r\n const columnWidths = this.columnWidths;\r\n\r\n const widths = Array.from(\r\n (function*() {\r\n if (isCheckBoxedTable) yield 20;\r\n yield*groupedColumnIds.map((id) => 20);\r\n yield*tableColumnIds\r\n .map((id) => columnWidths.get(id))\r\n .filter((width) => width !== undefined) as number[];\r\n })()\r\n );\r\n let acc = 0;\r\n return Array.from(\r\n (function*() {\r\n for (let w of widths) {\r\n yield {\r\n left: acc,\r\n width: w,\r\n right: acc + w,\r\n };\r\n acc = acc + w;\r\n }\r\n })()\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IScrollState } from \"./types\";\r\nimport { action, observable } from \"mobx\";\r\n\r\nexport class SimpleScrollState implements IScrollState {\r\n scrollToFunction: ((coords: { scrollLeft?: number; scrollTop?: number }) => void) | undefined;\r\n\r\n constructor(scrollTop: number, scrollLeft: number) {\r\n this.scrollTop = scrollTop;\r\n this.scrollLeft = scrollLeft;\r\n }\r\n\r\n scrollTo(coords: { scrollLeft?: number; scrollTop?: number }) {\r\n if (this.scrollToFunction) {\r\n this.scrollToFunction(coords);\r\n }\r\n }\r\n\r\n @observable scrollTop = 0;\r\n @observable scrollLeft = 0;\r\n\r\n @action.bound\r\n setScrollOffset(event: any, scrollTop: number, scrollLeft: number): void {\r\n // console.log(\"scroll event: \", scrollTop, scrollLeft);\r\n this.scrollTop = scrollTop;\r\n this.scrollLeft = scrollLeft;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\n\r\nexport function getMainMenuState(ctx: any) {\r\n return getWorkbench(ctx).sidebarState.mainMenuState;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { observer } from \"mobx-react\";\r\nimport React, { RefObject } from \"react\";\r\nimport { T } from \"utils/translation\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport S from \"gui/Components/Dialogs/SearchDialog.module.scss\";\r\nimport { action, observable } from \"mobx\";\r\nimport { ISearchResult } from \"model/entities/types/ISearchResult\";\r\nimport { getSearcher } from \"model/selectors/getSearcher\";\r\nimport { ISearchResultGroup } from \"model/entities/types/ISearchResultGroup\";\r\nimport { getMainMenuState } from \"model/selectors/MainMenu/getMainMenuState\";\r\n\r\nconst DELAY_BEFORE_SERVER_SEARCH_MS = 1000;\r\nexport const SEARCH_DIALOG_KEY = \"Search Dialog\";\r\n\r\n@observer\r\nexport class SearchDialog extends React.Component<{\r\n ctx: any;\r\n onCloseClick: () => void;\r\n}> {\r\n\r\n input: HTMLInputElement | undefined;\r\n refInput = (elm: HTMLInputElement) => (this.input = elm);\r\n\r\n scrollDivRef: RefObject = React.createRef();\r\n resultElementMap: Map> = new Map();\r\n\r\n searcher = getSearcher(this.props.ctx);\r\n\r\n @observable\r\n value = \"\";\r\n\r\n timeout: NodeJS.Timeout | undefined;\r\n\r\n componentDidMount() {\r\n this.input?.focus();\r\n }\r\n\r\n @action.bound\r\n onKeyDown(event: any) {\r\n if (event.key === \"Escape\") {\r\n this.props.onCloseClick();\r\n return;\r\n }\r\n if (event.key === \"ArrowDown\") {\r\n event.preventDefault();\r\n this.searcher.selectNextResult();\r\n this.scrollToCell();\r\n return;\r\n }\r\n if (event.key === \"ArrowUp\") {\r\n event.preventDefault();\r\n this.searcher.selectPreviousResult();\r\n this.scrollToCell();\r\n return;\r\n }\r\n if (event.key === \"Enter\") {\r\n if (this.searcher.selectedResult) {\r\n this.searcher.selectedResult.onClick();\r\n this.onResultItemClick(this.searcher.selectedResult);\r\n } else {\r\n this.searcher.searchOnServer();\r\n }\r\n return;\r\n }\r\n }\r\n\r\n onResultItemClick(result: ISearchResult) {\r\n this.props.onCloseClick();\r\n getMainMenuState(this.props.ctx).highlightItem(result.id);\r\n }\r\n\r\n scrollToCell() {\r\n if (!this.searcher.selectedResult) {\r\n return;\r\n }\r\n const scrollElement = this.scrollDivRef.current;\r\n const selectedElement = this.resultElementMap.get(this.searcher.selectedResult.id)?.current;\r\n if (!selectedElement || !scrollElement) {\r\n return;\r\n }\r\n const selectedElementRectangle = selectedElement.getBoundingClientRect();\r\n const scrollRectangle = scrollElement.getBoundingClientRect();\r\n const distanceOverTop = scrollRectangle.top - selectedElementRectangle.top;\r\n\r\n const scrollBarHeight = scrollRectangle.height - scrollElement.clientHeight;\r\n const distanceUnderBottom = selectedElementRectangle.bottom - scrollRectangle.bottom + scrollBarHeight;\r\n\r\n if (distanceOverTop > 0) {\r\n scrollElement.scrollTop -= distanceOverTop;\r\n } else if (distanceUnderBottom > 0) {\r\n scrollElement.scrollTop += distanceUnderBottom;\r\n } else if (distanceOverTop === 0) {\r\n const resultIndices = this.searcher.getSelectedResultIndices();\r\n const topItemSelected = resultIndices.groupIndex === 0 && resultIndices.indexInGroup === 0;\r\n if (topItemSelected) {\r\n scrollElement.scrollTop = 0;\r\n }\r\n }\r\n }\r\n\r\n async onInputKeyDown(event: React.KeyboardEvent) {\r\n if (this.timeout) {\r\n clearTimeout(this.timeout);\r\n }\r\n this.timeout = setTimeout(() => {\r\n this.timeout = undefined;\r\n this.searcher.searchOnServer();\r\n }, DELAY_BEFORE_SERVER_SEARCH_MS)\r\n }\r\n\r\n onInputChange(event: React.ChangeEvent): void {\r\n this.value = event.target.value;\r\n this.searcher.onSearchFieldChange(this.value);\r\n }\r\n\r\n render() {\r\n return (\r\n this.onKeyDown(event)}\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n topPosiotionProc={30}\r\n >\r\n
\r\n
\r\n \r\n this.onInputKeyDown(event)}\r\n onChange={(event) => this.onInputChange(event)}\r\n />\r\n
\r\n {(this.searcher.resultGroups.length > 0) &&\r\n
\r\n
\r\n {this.searcher.resultGroups\r\n .map(group =>\r\n this.onResultItemClick(result)}\r\n selectedResult={this.searcher.selectedResult}\r\n registerElementRef={(id, ref) => this.resultElementMap.set(id, ref)}\r\n />)\r\n }\r\n
\r\n
\r\n }\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class ResultGroup extends React.Component<{\r\n name: string;\r\n group: ISearchResultGroup;\r\n onResultItemClick: (result: ISearchResult) => void;\r\n selectedResult: ISearchResult | undefined;\r\n registerElementRef: (id: string, ref: RefObject) => void;\r\n}> {\r\n\r\n onGroupClick() {\r\n this.props.group.isExpanded = !this.props.group.isExpanded;\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n
this.onGroupClick()}>\r\n {this.props.group.isExpanded ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n {this.props.name}\r\n
\r\n
\r\n
\r\n {this.props.group.isExpanded && this.props.group.results.map(result =>\r\n this.props.onResultItemClick(result)}\r\n selected={this.props.selectedResult?.id === result.id}\r\n registerElementRef={this.props.registerElementRef}\r\n />)\r\n }\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class ResultItem extends React.Component<{\r\n result: ISearchResult;\r\n onResultItemClick: () => void;\r\n selected: boolean;\r\n registerElementRef: (id: string, ref: RefObject) => void;\r\n}> {\r\n\r\n @observable\r\n mouseOver = false;\r\n\r\n divRef: RefObject = React.createRef();\r\n\r\n componentDidMount() {\r\n this.props.registerElementRef(this.props.result.id, this.divRef);\r\n }\r\n\r\n componentDidUpdate() {\r\n this.props.registerElementRef(this.props.result.id, this.divRef);\r\n }\r\n\r\n @action.bound\r\n onClick() {\r\n this.props.onResultItemClick();\r\n this.props.result.onClick();\r\n }\r\n\r\n render() {\r\n return (\r\n this.onClick()}\r\n onMouseOver={evt => this.mouseOver = true}\r\n onMouseOut={evt => this.mouseOver = false}>\r\n
\r\n \r\n
\r\n
\r\n
\r\n {this.props.result.label}\r\n
\r\n
\r\n {\" \"}\r\n
\r\n
\r\n {this.props.result.description}\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { SEARCH_DIALOG_KEY, SearchDialog } from \"gui/Components/Dialogs/SearchDialog\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { getSearcher } from \"model/selectors/getSearcher\";\r\nimport React from \"react\";\r\n\r\nexport function openSearchWindow(ctx: any) {\r\n getSearcher(ctx).clear();\r\n\r\n const closeDialog = getDialogStack(ctx).pushDialog(\r\n SEARCH_DIALOG_KEY,\r\n closeDialog()}\r\n />,\r\n undefined,\r\n true\r\n );\r\n}\r\n\r\nexport function isGlobalAutoFocusDisabled(ctx: any) {\r\n return getDialogStack(ctx).isOpen(SEARCH_DIALOG_KEY);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isGlobalAutoFocusDisabled } from \"model/actions-ui/ScreenToolbar/openSearchWindow\";\r\n\r\nexport class FormFocusManager {\r\n autoFocusDisabled = false;\r\n\r\n stopAutoFocus() {\r\n this.autoFocusDisabled = true;\r\n }\r\n\r\n objectMap: Map = new Map();\r\n focusAbleContainers: IFocusAbleObjectContainer[] = [];\r\n private lastFocused: IFocusable | undefined;\r\n\r\n setLastFocused(focusable: IFocusable) {\r\n this.lastFocused = focusable;\r\n }\r\n\r\n constructor(public parent: any) {\r\n }\r\n\r\n subscribe(focusAbleObject: IFocusable, name: string | undefined, tabIndex: string | undefined) {\r\n if (!focusAbleObject) {\r\n return;\r\n }\r\n const focusAbleContainer = new FocusAbleObjectContainer(focusAbleObject, name, tabIndex);\r\n const existingContainer = this.focusAbleContainers\r\n .find(container => container.name && container.name === name ||\r\n container.focusable === focusAbleObject);\r\n if (existingContainer) {\r\n this.focusAbleContainers.remove(existingContainer);\r\n }\r\n this.focusAbleContainers.push(focusAbleContainer);\r\n this.focusAbleContainers = this.focusAbleContainers.sort(FocusAbleObjectContainer.compare);\r\n }\r\n\r\n focus(name: string) {\r\n let focusable = this.focusAbleContainers.find((container) => container.name === name)?.focusable;\r\n this.focusAndRemember(focusable);\r\n }\r\n\r\n private focusAndRemember(focusable: IFocusable | undefined) {\r\n if (!focusable) {\r\n return;\r\n }\r\n this.lastFocused = focusable;\r\n focusable.focus();\r\n }\r\n\r\n refocusLast() {\r\n this.lastFocused?.focus();\r\n }\r\n\r\n forceAutoFocus() {\r\n const focusable = this.focusAbleContainers[0].focusable;\r\n if (focusable.disabled) {\r\n // (focusable as any).readOnly returns always false => readonly fields cannot be skipped\r\n this.focusNext(focusable);\r\n return;\r\n }\r\n setTimeout(() => {\r\n this.focusAndRemember(focusable);\r\n }, 0);\r\n }\r\n\r\n autoFocus() {\r\n if (this.focusAbleContainers.length === 0 || this.autoFocusDisabled || isGlobalAutoFocusDisabled(this.parent)) {\r\n return;\r\n }\r\n this.forceAutoFocus();\r\n }\r\n\r\n focusNext(activeElement: any) {\r\n this.focusNextInternal(activeElement, 0);\r\n }\r\n\r\n focusNextInternal(activeElement: any, callNumber: number) {\r\n if (callNumber > 20) {\r\n return;\r\n }\r\n const currentContainerIndex = this.focusAbleContainers.findIndex(\r\n (container) => container.focusable === activeElement\r\n );\r\n const nextIndex =\r\n this.focusAbleContainers.length - 1 > currentContainerIndex ? currentContainerIndex + 1 : 0;\r\n const focusable = this.focusAbleContainers[nextIndex].focusable;\r\n if (focusable !== activeElement && focusable.disabled) {\r\n this.focusNextInternal(focusable, callNumber + 1);\r\n } else {\r\n setTimeout(() => {\r\n this.focusAndRemember(focusable);\r\n });\r\n }\r\n }\r\n\r\n focusPrevious(activeElement: any) {\r\n const currentContainerIndex = this.focusAbleContainers.findIndex(\r\n (container) => container.focusable === activeElement\r\n );\r\n const previousIndex =\r\n currentContainerIndex === 0 ? this.focusAbleContainers.length - 1 : currentContainerIndex - 1;\r\n const focusable = this.focusAbleContainers[previousIndex].focusable;\r\n if (focusable.disabled) {\r\n this.focusPrevious(focusable);\r\n } else {\r\n setTimeout(() => {\r\n this.focusAndRemember(focusable);\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport interface IFocusAbleObjectContainer {\r\n name: string | undefined;\r\n tabIndexFractions: number[];\r\n focusable: IFocusable;\r\n\r\n has(fractionIndex: number): boolean;\r\n}\r\n\r\nexport class FocusAbleObjectContainer implements IFocusAbleObjectContainer {\r\n get tabIndexFractions(): number[] {\r\n if (this.tabIndexNullable) {\r\n return this.tabIndexNullable\r\n .split(\".\")\r\n .filter((x) => x !== \"\")\r\n .map((x) => parseInt(x));\r\n }\r\n return [1e6];\r\n }\r\n\r\n constructor(\r\n public focusable: IFocusable,\r\n public name: string | undefined,\r\n private tabIndexNullable: string | undefined\r\n ) {\r\n }\r\n\r\n // TabIndex is a string separated by decimal points for example: 13, 14.0, 14.2, 14.15\r\n // The \"fractions\" have to be compared separately because 14.15 is greater than 14.2\r\n // Comparison as numbers would give different results\r\n static compare(x: IFocusAbleObjectContainer, y: IFocusAbleObjectContainer) {\r\n return FocusAbleObjectContainer.compareFraction(x, y, 0);\r\n }\r\n\r\n static compareFraction(\r\n x: IFocusAbleObjectContainer,\r\n y: IFocusAbleObjectContainer,\r\n fractionIndex: number\r\n ): number {\r\n if (x.has(fractionIndex) && !y.has(fractionIndex)) {\r\n return 1;\r\n }\r\n if (!x.has(fractionIndex) && y.has(fractionIndex)) {\r\n return -1;\r\n }\r\n if (!x.has(fractionIndex) && !y.has(fractionIndex)) {\r\n return 0;\r\n }\r\n\r\n const fraction = x.tabIndexFractions[fractionIndex] - y.tabIndexFractions[fractionIndex];\r\n if (fraction !== 0) {\r\n return fraction;\r\n }\r\n\r\n return FocusAbleObjectContainer.compareFraction(x, y, fractionIndex + 1);\r\n }\r\n\r\n has(fractionIndex: number) {\r\n return this.tabIndexFractions.length - 1 >= fractionIndex;\r\n }\r\n}\r\n\r\nexport interface IFocusable {\r\n focus(): void;\r\n\r\n disabled: boolean;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getSelectionMember(ctx: any) {\r\n return getDataView(ctx).selectionMember;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOrderingConfiguration } from \"./getOrderingConfiguration\";\r\n\r\nexport function getPropertyOrdering(ctx: any, column: string) {\r\n return getOrderingConfiguration(ctx).getOrdering(column);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataSourceFieldByName } from \"./getDataSourceFieldByName\";\r\n\r\nexport function getDataSourceFieldIndexByName(ctx: any, name: string) {\r\n return getDataSourceFieldByName(ctx, name)?.index;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onMainMenuItemClick(ctx: any) {\r\n return flow(function*onMainMenuItemClick(args: {\r\n event: any;\r\n item: any;\r\n idParameter: string | undefined;\r\n isSingleRecordEdit?: boolean;\r\n forceOpenNew?: boolean;\r\n }) {\r\n try {\r\n yield*getWorkbenchLifecycle(ctx).onMainMenuItemClick(args);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\nexport function getRecordInfo(ctx: any) {\r\n return getWorkbench(ctx).recordInfo;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getRecordInfo } from \"model/selectors/RecordInfo/getRecordInfo\";\r\n\r\nexport function onSelectedRowChange(ctx: any) {\r\n return flow(function*onPossibleSelectedRowChange(\r\n menuId: string,\r\n dataStructureEntityId: string,\r\n rowId: string | undefined\r\n ) {\r\n yield*getRecordInfo(ctx).onSelectedRowMaybeChanged(\r\n menuId,\r\n dataStructureEntityId,\r\n rowId\r\n );\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function wrapInFlowWithHandler(args: { ctx: any; action: (() => Promise) | (() => void) }) {\r\n return flow(function*runWithHandler() {\r\n try {\r\n yield args.action();\r\n } catch (e) {\r\n yield*handleError(args.ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n\r\nexport function runInFlowWithHandler(args: { ctx: any, action: (() => Promise) | (() => void) }) {\r\n return wrapInFlowWithHandler(args)();\r\n}\r\n\r\nexport function runGeneratorInFlowWithHandler(args: { ctx: any, generator: Generator }) {\r\n return flow(function*runWithHandler() {\r\n try {\r\n return yield*args.generator;\r\n } catch (e) {\r\n yield*handleError(args.ctx)(e);\r\n throw e;\r\n }\r\n })();\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function getConfigurationManager(ctx: any) {\r\n return getDataView(ctx).tablePanelView.configurationManager;\r\n}","import { getTablePanelView } from \"../selectors/TablePanelView/getTablePanelView\";\r\nimport { getDataView } from \"../selectors/DataView/getDataView\";\r\nimport { IFocusable } from \"./FormFocusManager\";\r\nimport { getFilterConfiguration } from \"model/selectors/DataView/getFilterConfiguration\";\r\n\r\nexport class GridFocusManager {\r\n\r\n constructor(public parent: any) {\r\n }\r\n\r\n public focusTableOnReload: boolean = true;\r\n\r\n focusTableIfNeeded() {\r\n const filtersVisible = getFilterConfiguration(this.parent).isFilterControlsDisplayed;\r\n const filterInputHasFocus = filtersVisible && document.activeElement?.tagName === 'INPUT';\r\n if (this.focusTableOnReload && !filterInputHasFocus) {\r\n getTablePanelView(this)?.triggerOnFocusTable();\r\n } else {\r\n this.focusTableOnReload = true;\r\n }\r\n }\r\n\r\n activeEditor: IFocusable | undefined;\r\n\r\n focusEditor() {\r\n this.activeEditor?.focus();\r\n }\r\n}\r\n\r\nexport function getGridFocusManager(ctx: any) {\r\n return getDataView(ctx).gridFocusManager;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable, reaction } from \"mobx\";\r\nimport { getParentRow } from \"model/selectors/DataView/getParentRow\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getDataSourceByEntity } from \"model/selectors/DataSources/getDataSourceByEntity\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { getIsDialog } from \"model/selectors/getIsDialog\";\r\nimport { IDataViewLifecycle } from \"model/entities/DataViewLifecycle/types/IDataViewLifecycle\";\r\nimport { IFormPanelView } from \"model/entities/FormPanelView/types/IFormPanelView\";\r\nimport { ITablePanelView } from \"model/entities/TablePanelView/types/ITablePanelView\";\r\nimport { IAction, IActionPlacement, IActionType } from \"model/entities/types/IAction\";\r\nimport { IDataTable } from \"model/entities/types/IDataTable\";\r\nimport { IDataView, IDataViewData } from \"model/entities/types/IDataView\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getBindingToParent } from \"model/selectors/DataView/getBindingToParent\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { getBindingParent } from \"model/selectors/DataView/getBindingParent\";\r\nimport { ILookupLoader } from \"model/entities/types/ILookupLoader\";\r\nimport bind from \"bind-decorator\";\r\nimport { getRowStateMayCauseFlicker } from \"model/selectors/RowState/getRowStateMayCauseFlicker\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { ServerSideGrouper } from \"model/entities/ServerSideGrouper\";\r\nimport { ClientSideGrouper } from \"model/entities/ClientSideGrouper\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\nimport { getIsSelectionCheckboxesShown } from \"model/selectors/DataView/getIsSelectionCheckboxesShown\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { flattenToTableRows } from \"gui/Components/ScreenElements/Table/TableRendering/tableRows\";\r\nimport { GridDimensions } from \"gui/Workbench/ScreenArea/TableView/GridDimensions\";\r\nimport { SimpleScrollState } from \"gui/Components/ScreenElements/Table/SimpleScrollState\";\r\nimport { BoundingRect } from \"react-measure\";\r\nimport { IGridDimensions } from \"gui/Components/ScreenElements/Table/types\";\r\nimport { FormFocusManager } from \"model/entities/FormFocusManager\";\r\nimport { getRowStates } from \"model/selectors/RowState/getRowStates\";\r\nimport { getLookupLoader } from \"model/selectors/DataView/getLookupLoader\";\r\nimport { DataViewData } from \"modules/DataView/DataViewData\";\r\nimport { DataViewAPI } from \"modules/DataView/DataViewAPI\";\r\nimport { RowCursor } from \"modules/DataView/TableCursor\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport {\r\n IInfiniteScrollLoader,\r\n InfiniteScrollLoader,\r\n NullIScrollLoader,\r\n} from \"gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { ScrollRowContainer } from \"model/entities/ScrollRowContainer\";\r\nimport { VisibleRowsMonitor } from \"gui/Workbench/ScreenArea/TableView/VisibleRowsMonitor\";\r\nimport { getSelectionMember } from \"model/selectors/DataView/getSelectionMember\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getGrouper } from \"model/selectors/DataView/getGrouper\";\r\nimport { getUserFilters } from \"model/selectors/DataView/getUserFilters\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getUserOrdering } from \"model/selectors/DataView/getUserOrdering\";\r\nimport { getColumnNamesToLoad } from \"model/selectors/DataView/getColumnNamesToLoad\";\r\nimport { getUserFilterLookups } from \"model/selectors/DataView/getUserFilterLookups\";\r\nimport { isInfiniteScrollingActive } from \"model/selectors/isInfiniteScrollingActive\";\r\nimport { getPropertyOrdering } from \"model/selectors/DataView/getPropertyOrdering\";\r\nimport { IOrderByDirection } from \"model/entities/types/IOrderingConfiguration\";\r\n\r\nimport selectors from \"model/selectors-tree\";\r\nimport produce from \"immer\";\r\nimport { getDataSourceFieldIndexByName } from \"model/selectors/DataSources/getDataSourceFieldIndexByName\";\r\nimport { onMainMenuItemClick } from \"model/actions-ui/MainMenu/onMainMenuItemClick\";\r\nimport { onSelectedRowChange } from \"model/actions-ui/onSelectedRowChange\";\r\nimport { runInFlowWithHandler, } from \"utils/runInFlowWithHandler\";\r\nimport { IAggregation } from 'model/entities/types/IAggregation';\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\nimport { GridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nclass SavedViewState {\r\n constructor(public selectedRowId: string | undefined) {\r\n }\r\n}\r\n\r\nexport class DataView implements IDataView {\r\n $type_IDataView: 1 = 1;\r\n formFocusManager: FormFocusManager = new FormFocusManager(this);\r\n gridFocusManager: GridFocusManager = new GridFocusManager(this);\r\n\r\n @observable aggregationData: IAggregation[] = [];\r\n\r\n constructor(data: IDataViewData) {\r\n Object.assign(this, data);\r\n this.properties.forEach((o) => (o.parent = this));\r\n this.actions.forEach((o) => (o.parent = this));\r\n this.defaultActions = this.actions.filter((action) => action.isDefault);\r\n this.dataTable.parent = this;\r\n this.lifecycle.parent = this;\r\n this.tablePanelView.parent = this;\r\n this.formPanelView.parent = this;\r\n this.lookupLoader.parent = this;\r\n this.clientSideGrouper.parent = this;\r\n this.serverSideGrouper.parent = this;\r\n\r\n this.gridDimensions = new GridDimensions({\r\n getTableViewProperties: () => getTableViewProperties(this),\r\n getRowCount: () => this.tableRows.length,\r\n getIsSelectionCheckboxes: () =>\r\n getIsSelectionCheckboxesShown(this.tablePanelView),\r\n ctx: this,\r\n defaultRowHeight: this.tablePanelView.rowHeight,\r\n });\r\n\r\n this.orderProperty = this.properties.find(\r\n (prop) => prop.id === this.orderMember\r\n )!;\r\n this.dataTable.rowRemovedListeners.push(\r\n () => (this.selectAllCheckboxChecked = false)\r\n );\r\n }\r\n\r\n private _isFormViewActive = () => false;\r\n\r\n set isFormViewActive(value: () => boolean) {\r\n this._isFormViewActive = value;\r\n }\r\n\r\n get isFormViewActive() {\r\n return this._isFormViewActive;\r\n }\r\n\r\n private _isTableViewActive = () => false;\r\n\r\n set isTableViewActive(value: () => boolean) {\r\n this._isTableViewActive = value;\r\n }\r\n\r\n get isTableViewActive() {\r\n return this._isTableViewActive;\r\n }\r\n\r\n @action.bound\r\n setRowCount(rowCount: number) {\r\n this.rowCount = rowCount;\r\n this.dataTable.rowsAddedSinceSave = 0;\r\n }\r\n\r\n @observable\r\n rowCount: number | undefined;\r\n\r\n @computed\r\n get totalRowCount() {\r\n if (!this.rowCount) {\r\n return this.rowCount;\r\n }\r\n return this.rowCount + this.dataTable.rowsAddedSinceSave;\r\n }\r\n\r\n orderProperty: IProperty;\r\n activateFormView:\r\n | ((args: { saveNewState: boolean }) => Promise)\r\n | undefined;\r\n activateTableView: (() => Promise) | undefined;\r\n\r\n gridDimensions: IGridDimensions;\r\n\r\n id = \"\";\r\n modelInstanceId = \"\";\r\n name = \"\";\r\n modelId = \"\";\r\n defaultPanelView = IPanelViewType.Table;\r\n isHeadless = false;\r\n isMapSupported = false;\r\n disableActionButtons = false;\r\n showAddButton = false;\r\n showDeleteButton = false;\r\n showSelectionCheckboxesSetting = false;\r\n isGridHeightDynamic = false;\r\n selectionMember = \"\";\r\n orderMember = \"\";\r\n isDraggingEnabled = false;\r\n entity = \"\";\r\n dataMember = \"\";\r\n isRootGrid = false;\r\n isRootEntity = false;\r\n isPreloaded = false;\r\n newRecordView: string | undefined;\r\n requestDataAfterSelectionChange = false;\r\n confirmSelectionChange = false;\r\n properties: IProperty[] = [];\r\n actions: IAction[] = [];\r\n defaultActions: IAction[] = [];\r\n type: string = \"\";\r\n\r\n @observable tableViewProperties: IProperty[] = [];\r\n dataTable: IDataTable = null as any;\r\n formViewUI: any;\r\n lifecycle: IDataViewLifecycle = null as any;\r\n tablePanelView: ITablePanelView = null as any;\r\n formPanelView: IFormPanelView = null as any;\r\n lookupLoader: ILookupLoader = null as any;\r\n serverSideGrouper: ServerSideGrouper = null as any;\r\n clientSideGrouper: ClientSideGrouper = null as any;\r\n isFirst: boolean = null as any;\r\n\r\n dataViewRowCursor: RowCursor = null as any;\r\n dataViewApi: DataViewAPI = null as any;\r\n dataViewData: DataViewData = null as any;\r\n\r\n @observable selectAllCheckboxChecked = false;\r\n @observable selectedRowIds: Set = new Set();\r\n\r\n @observable activePanelView: IPanelViewType = IPanelViewType.Table;\r\n\r\n @observable selectedRowId: string | undefined;\r\n\r\n @computed get showSelectionCheckboxes() {\r\n return this.showSelectionCheckboxesSetting || !!this.selectionMember;\r\n }\r\n\r\n @computed get firstEnabledDefaultAction() {\r\n return this.defaultActions.find((action) => action.isEnabled);\r\n }\r\n\r\n @bind hasSelectedRowId(id: string) {\r\n return this.selectedRowIds.has(id);\r\n }\r\n\r\n appendRecords(rows: any[][]): void {\r\n this.dataTable.appendRecords(rows);\r\n this.selectedRowIds.clear();\r\n this.selectAllCheckboxChecked =\r\n this.dataTable.rows.length !== 0 &&\r\n this.dataTable.rows.every((row) =>\r\n this.isSelected(this.dataTable.getRowId(row))\r\n );\r\n }\r\n\r\n async setRecords(rows: any[][]): Promise {\r\n await this.dataTable.setRecords(rows);\r\n const filteredRows = this.dataTable.rows;\r\n const filteredRowIds = filteredRows.map((row) =>\r\n this.dataTable.getRowId(row)\r\n );\r\n this.selectedRowIds = new Set(\r\n Array.from(this.selectedRowIds).filter((id) =>\r\n filteredRowIds.includes(id)\r\n )\r\n );\r\n this.selectAllCheckboxChecked =\r\n this.dataTable.rows.length !== 0 &&\r\n this.dataTable.rows.every((row) =>\r\n this.isSelected(this.dataTable.getRowId(row))\r\n );\r\n }\r\n\r\n isSelected(rowId: string): boolean {\r\n const selectionMember = getSelectionMember(this);\r\n if (!!selectionMember) {\r\n const dataSourceField = getDataSourceFieldByName(this, selectionMember)!;\r\n if (!dataSourceField) {\r\n throw new Error(\r\n `SelectionMember \"${selectionMember}\" was not found in data source. Make sure the SelectionMember value in ${this.modelInstanceId} is correct`\r\n );\r\n }\r\n const updatedRow = this.dataTable.getRowById(rowId)!;\r\n return this.dataTable.getCellValueByDataSourceField(\r\n updatedRow,\r\n dataSourceField\r\n );\r\n }\r\n return this.selectedRowIds.has(rowId);\r\n }\r\n\r\n @action.bound addSelectedRowId(id: string) {\r\n this.selectedRowIds.add(id);\r\n }\r\n\r\n @action.bound removeSelectedRowId(id: string) {\r\n this.selectedRowIds.delete(id);\r\n this.selectAllCheckboxChecked = false;\r\n }\r\n\r\n @action.bound\r\n clear() {\r\n this.selectedRowIds.clear();\r\n this.dataTable.clear();\r\n }\r\n\r\n @action.bound\r\n deleteRowAndSelectNext(row: any[]) {\r\n const id = this.dataTable.getRowId(row);\r\n let idToSelectNext = this.dataTable.getNextExistingRowId(id);\r\n if (!idToSelectNext) {\r\n idToSelectNext = this.dataTable.getPrevExistingRowId(id);\r\n }\r\n\r\n this.selectedRowIds.delete(id);\r\n this.dataTable.deleteRow(row);\r\n\r\n this.setSelectedRowId(idToSelectNext);\r\n }\r\n\r\n @action.bound\r\n substituteRecord(row: any[]) {\r\n if(!getSelectionMember(this)){\r\n const rowId = this.dataTable.getRowId(row);\r\n this.removeSelectedRowId(rowId);\r\n }\r\n this.dataTable.substituteRecord(row);\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n getGrouper(this).substituteRecord(row);\r\n }\r\n }\r\n\r\n @action.bound setSelectedState(rowId: string, newState: boolean) {\r\n if (newState) {\r\n this.addSelectedRowId(rowId);\r\n } else {\r\n this.removeSelectedRowId(rowId);\r\n }\r\n }\r\n\r\n @computed get selectedRowIndex(): number | undefined {\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n return getGrouper(this).allGroups.some((group) => group.isExpanded)\r\n ? getGrouper(this).getRowIndex(this.selectedRowId!)\r\n : undefined;\r\n } else {\r\n return this.selectedRowId\r\n ? this.dataTable.getExistingRowIdxById(this.selectedRowId)\r\n : undefined;\r\n }\r\n }\r\n\r\n @computed get trueSelectedRowIndex(): number | undefined {\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n return getGrouper(this).allGroups.some((group) => group.isExpanded)\r\n ? getGrouper(this).getRowIndex(this.selectedRowId!)\r\n : undefined;\r\n } else {\r\n return this.selectedRowId\r\n ? this.dataTable.getTrueIndexById(this.selectedRowId)\r\n : undefined;\r\n }\r\n }\r\n\r\n @computed get selectedRow(): any[] | undefined {\r\n if (!this.selectedRowId) {\r\n return undefined;\r\n }\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n return getGrouper(this).getRowById(this.selectedRowId!);\r\n } else {\r\n return this.selectedRowIndex !== undefined\r\n ? this.dataTable.getRowByExistingIdx(this.selectedRowIndex)\r\n : undefined;\r\n }\r\n }\r\n\r\n @computed get isValidRowSelection(): boolean {\r\n return this.selectedRowIndex !== undefined;\r\n }\r\n\r\n @computed get panelViewActions() {\r\n const rowStateMayCauseFlicker = getRowStateMayCauseFlicker(this);\r\n if (rowStateMayCauseFlicker && !this.dataTable.isEmpty) {\r\n return [];\r\n }\r\n return this.actions.filter(\r\n (action) => action.placement === IActionPlacement.PanelHeader\r\n );\r\n }\r\n\r\n @computed get panelMenuActions() {\r\n const rowStateMayCauseFlicker = getRowStateMayCauseFlicker(this);\r\n if (rowStateMayCauseFlicker && !this.dataTable.isEmpty) {\r\n return [];\r\n }\r\n return this.actions.filter(\r\n (action) => action.placement === IActionPlacement.PanelMenu\r\n );\r\n }\r\n\r\n @computed get toolbarActions() {\r\n const rowStateMayCauseFlicker = getRowStateMayCauseFlicker(this);\r\n if (rowStateMayCauseFlicker && !this.dataTable.isEmpty) {\r\n return [];\r\n }\r\n return this.actions.filter(\r\n (action) =>\r\n action.placement === IActionPlacement.Toolbar &&\r\n action.type !== IActionType.SelectionDialogAction &&\r\n !getIsDialog(this)\r\n );\r\n }\r\n\r\n @computed get dialogActions() {\r\n return this.actions.filter(\r\n (action) =>\r\n action.type === IActionType.SelectionDialogAction || getIsDialog(this)\r\n );\r\n }\r\n\r\n @computed get isWorking() {\r\n return (\r\n this.lifecycle.isWorking ||\r\n getRowStates(this).isWorking ||\r\n getLookupLoader(this).isWorking\r\n );\r\n }\r\n\r\n @computed get isAnyBindingAncestorWorking() {\r\n if (this.isBindingRoot) {\r\n return false;\r\n } else {\r\n return (\r\n this.bindingParent.isWorking ||\r\n this.bindingParent.isAnyBindingAncestorWorking\r\n );\r\n }\r\n }\r\n\r\n @computed\r\n get isBindingRoot() {\r\n return this.parentBindings.length === 0;\r\n }\r\n\r\n @computed get isBindingParent() {\r\n return this.childBindings.length > 0;\r\n }\r\n\r\n @computed get bindingParent() {\r\n return this.parentBindings?.[0]?.parentDataView;\r\n }\r\n\r\n @computed get bindingRoot(): IDataView {\r\n // TODO: If there ever is multi parent case, remove duplicates in the result\r\n let root: IDataView = this;\r\n while (!root.isBindingRoot) {\r\n root = root.bindingParent!;\r\n }\r\n return root;\r\n }\r\n\r\n @computed\r\n get parentBindings() {\r\n const screen = getFormScreen(this);\r\n return screen.getBindingsByChildId(this.modelInstanceId);\r\n }\r\n\r\n @computed\r\n get childBindings() {\r\n const screen = getFormScreen(this);\r\n return screen.getBindingsByParentId(this.modelInstanceId);\r\n }\r\n\r\n @computed get dataSource() {\r\n return getDataSourceByEntity(this, this.entity)!;\r\n }\r\n\r\n @computed get bindingParametersFromParent() {\r\n const parentRow = getParentRow(this);\r\n if (parentRow) {\r\n const parent = getBindingParent(this);\r\n const parentDataTable = getDataTable(parent);\r\n\r\n const bindingToParent = getBindingToParent(this)!;\r\n const result: { [key: string]: string } = {};\r\n for (let bp of bindingToParent.bindingPairs) {\r\n const parentDataSourceField = getDataSourceFieldByName(\r\n parent,\r\n bp.parentPropertyId\r\n )!;\r\n result[bp.childPropertyId] =\r\n parentDataTable.getCellValueByDataSourceField(\r\n parentRow,\r\n parentDataSourceField\r\n );\r\n }\r\n return result;\r\n } else {\r\n return {};\r\n }\r\n }\r\n\r\n @action.bound moveSelectedRowUp() {\r\n if (!this.selectedRowId) {\r\n return;\r\n }\r\n const ordering = getPropertyOrdering(this, this.orderMember);\r\n if (ordering.ordering === IOrderByDirection.ASC) {\r\n this.moveSelectedRowDownIndexwise();\r\n } else {\r\n this.moveSelectedRowUpIndexwise();\r\n }\r\n }\r\n\r\n @action.bound moveSelectedRowDown() {\r\n if (!this.selectedRowId) {\r\n return;\r\n }\r\n const ordering = getPropertyOrdering(this, this.orderMember);\r\n if (ordering.ordering === IOrderByDirection.ASC) {\r\n this.moveSelectedRowUpIndexwise();\r\n } else {\r\n this.moveSelectedRowDownIndexwise();\r\n }\r\n }\r\n\r\n @action.bound moveSelectedRowUpIndexwise() {\r\n if (!this.selectedRowId) {\r\n return;\r\n }\r\n const dataTable = getDataTable(this);\r\n const selectedRow = dataTable.getRowById(this.selectedRowId)!;\r\n const positionIndex = getDataSourceFieldByName(\r\n this,\r\n this.orderMember\r\n )!.index;\r\n const selectedRowPosition = selectedRow[positionIndex];\r\n const nextRow = dataTable.rows.find(\r\n (row) => row[positionIndex] === selectedRowPosition + 1\r\n );\r\n if (!nextRow) {\r\n return;\r\n }\r\n selectedRow[positionIndex] += 1;\r\n nextRow[positionIndex] -= 1;\r\n this.dataTable.substituteRecord(selectedRow);\r\n this.dataTable.substituteRecord(nextRow);\r\n this.dataTable.updateSortAndFilter({retainPreviousSelection: true});\r\n this.dataTable.setDirtyValue(\r\n selectedRow,\r\n this.orderMember,\r\n selectedRow[positionIndex]\r\n );\r\n this.dataTable.setDirtyValue(\r\n nextRow,\r\n this.orderMember,\r\n nextRow[positionIndex]\r\n );\r\n }\r\n\r\n @action.bound moveSelectedRowDownIndexwise() {\r\n if (!this.selectedRowId) {\r\n return;\r\n }\r\n const dataTable = getDataTable(this);\r\n const selectedRow = dataTable.getRowById(this.selectedRowId)!;\r\n const positionIndex = getDataSourceFieldByName(\r\n this,\r\n this.orderMember\r\n )!.index;\r\n const selectedRowPosition = selectedRow[positionIndex];\r\n const previous = dataTable.rows.find(\r\n (row) => row[positionIndex] === selectedRowPosition - 1\r\n );\r\n if (!previous) {\r\n return;\r\n }\r\n selectedRow[positionIndex] -= 1;\r\n previous[positionIndex] += 1;\r\n this.dataTable.substituteRecord(selectedRow);\r\n this.dataTable.substituteRecord(previous);\r\n this.dataTable.updateSortAndFilter({retainPreviousSelection: true});\r\n this.dataTable.setDirtyValue(\r\n selectedRow,\r\n this.orderMember,\r\n selectedRow[positionIndex]\r\n );\r\n this.dataTable.setDirtyValue(\r\n previous,\r\n this.orderMember,\r\n previous[positionIndex]\r\n );\r\n }\r\n\r\n @action.bound selectNextRow() {\r\n const selectedRowId = getSelectedRowId(this);\r\n\r\n let newId = undefined;\r\n if (selectedRowId) {\r\n newId = getGroupingConfiguration(this).isGrouping\r\n ? getGrouper(this).getNextRowId(selectedRowId)\r\n : getDataTable(this).getNextExistingRowId(selectedRowId);\r\n }\r\n if (newId) {\r\n this.setSelectedRowId(newId);\r\n }\r\n }\r\n\r\n @action.bound selectPrevRow() {\r\n const selectedRowId = getSelectedRowId(this);\r\n\r\n let newId = undefined;\r\n if (selectedRowId) {\r\n newId = getGroupingConfiguration(this).isGrouping\r\n ? getGrouper(this).getPreviousRowId(selectedRowId)\r\n : getDataTable(this).getPrevExistingRowId(selectedRowId);\r\n }\r\n if (newId) {\r\n this.setSelectedRowId(newId);\r\n }\r\n }\r\n\r\n *navigateLookupLink(property: IProperty, row: any[]): any {\r\n const columnId = property.id;\r\n const fieldIndex = getDataSourceFieldIndexByName(this, columnId);\r\n if (fieldIndex === undefined) return;\r\n const value = row[fieldIndex];\r\n const menuId = yield selectors.column.getLinkMenuId(property, value);\r\n let menuItem = menuId && selectors.mainMenu.getItemById(this, menuId);\r\n if (menuItem) {\r\n menuItem = {...menuItem, parent: undefined, elements: []};\r\n menuItem = produce(menuItem, (draft: any) => {\r\n if (menuItem.attributes.type.startsWith(\"FormReferenceMenuItem\")) {\r\n draft.attributes.type = \"FormReferenceMenuItem\";\r\n }\r\n draft.attributes.lazyLoading = \"false\";\r\n });\r\n\r\n yield onMainMenuItemClick(this)({\r\n event: undefined,\r\n item: menuItem,\r\n idParameter: value,\r\n isSingleRecordEdit: true,\r\n });\r\n }\r\n }\r\n\r\n @action.bound onFieldChange(\r\n event: any,\r\n row: any[],\r\n property: IProperty,\r\n newValue: any\r\n ) {\r\n if (!property.readOnly) {\r\n const currentValue = getDataTable(this).getCellValue(row, property);\r\n if (newValue === currentValue) {\r\n return;\r\n }\r\n getDataTable(this).setFormDirtyValue(row, property.id, newValue);\r\n }\r\n }\r\n\r\n @action.bound\r\n *loadFirstPage(): any {\r\n if (this.infiniteScrollLoader) yield*this.infiniteScrollLoader!.loadFirstPage();\r\n }\r\n\r\n @action.bound\r\n *loadLastPage(): any {\r\n if (this.infiniteScrollLoader) yield*this.infiniteScrollLoader!.loadLastPage();\r\n }\r\n\r\n @action.bound selectFirstRow() {\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n return;\r\n }\r\n const dataTable = getDataTable(this);\r\n const firstRow = dataTable.getFirstRow();\r\n if (firstRow) {\r\n this.setSelectedRowId(dataTable.getRowId(firstRow));\r\n } else {\r\n this.setSelectedRowId(undefined);\r\n }\r\n }\r\n\r\n @action.bound selectLastRow() {\r\n if (getGroupingConfiguration(this).isGrouping) {\r\n return;\r\n }\r\n const dataTable = getDataTable(this);\r\n const lastRow = dataTable.getLastRow();\r\n if (lastRow) {\r\n this.setSelectedRowId(dataTable.getRowId(lastRow));\r\n } else {\r\n this.setSelectedRowId(undefined);\r\n }\r\n }\r\n\r\n reselectOrSelectFirst() {\r\n const previouslySelectedRowExists =\r\n this.selectedRowId && this.dataTable.getRowById(this.selectedRowId);\r\n if (!this.isRootGrid || !previouslySelectedRowExists || !this.selectedRow) {\r\n this.selectFirstRow();\r\n }\r\n }\r\n\r\n @action.bound selectRow(row: any[]) {\r\n this.setSelectedRowId(this.dataTable.getRowId(row));\r\n }\r\n\r\n @action.bound\r\n setSelectedRowId(id: string | undefined): void {\r\n if (this.selectedRowId === id) {\r\n return;\r\n }\r\n this.selectedRowId = id;\r\n if (this.isBindingParent) {\r\n this.childBindings.forEach((binding) =>\r\n binding.childDataView.dataTable.updateSortAndFilter()\r\n );\r\n }\r\n const self = this;\r\n if (!this.selectedRowId) {\r\n return;\r\n }\r\n\r\n if (getFormScreenLifecycle(this).focusedDataViewId === this.id) {\r\n runInFlowWithHandler({\r\n ctx: self,\r\n action: async () => {\r\n await onSelectedRowChange(self)(\r\n getMenuItemId(self),\r\n getDataStructureEntityId(self),\r\n self.selectedRowId\r\n );\r\n },\r\n });\r\n }\r\n }\r\n\r\n viewStateStack: SavedViewState[] = [];\r\n\r\n @action.bound\r\n saveViewState(): void {\r\n this.viewStateStack.push(new SavedViewState(this.selectedRowId));\r\n }\r\n\r\n @action.bound\r\n restoreViewState(): void {\r\n const state = this.viewStateStack.pop();\r\n if (state && state.selectedRowId) {\r\n this.setSelectedRowId(state.selectedRowId);\r\n if (!getSelectedRow(this)) {\r\n this.selectFirstRow();\r\n }\r\n getTablePanelView(this).scrollToCurrentCell();\r\n }\r\n }\r\n\r\n get isLazyLoading() {\r\n return isLazyLoading(this) && this.isRootGrid;\r\n }\r\n\r\n @action.bound\r\n async start() {\r\n this.lifecycle.start();\r\n const serverSideGrouping = this.isLazyLoading;\r\n if (serverSideGrouping) {\r\n this.serverSideGrouper.start();\r\n }\r\n getFormScreenLifecycle(this).registerDisposer(() =>\r\n this.serverSideGrouper.dispose()\r\n );\r\n await this.dataTable.start();\r\n getFormScreenLifecycle(this).registerDisposer(\r\n reaction(\r\n () => ({\r\n selectedRowId: this.selectedRowId,\r\n rowsCount: getDataTable(this).allRows.length,\r\n }),\r\n (reData: { selectedRowId: string | undefined; rowsCount: number }) => {\r\n if (getFormScreenLifecycle(this).rowSelectedReactionsDisabled(this)) {\r\n return;\r\n }\r\n if (reData.selectedRowId === undefined && reData.rowsCount > 0) {\r\n this.reselectOrSelectFirst();\r\n }\r\n },\r\n {\r\n fireImmediately: true,\r\n }\r\n )\r\n );\r\n await this.dataTable.start();\r\n }\r\n\r\n @action.bound stop() {\r\n this.properties.forEach((prop) => prop.stop());\r\n this.dataTable.stop();\r\n }\r\n\r\n @computed get tableRows() {\r\n const groupedColumnIds =\r\n getGroupingConfiguration(this).orderedGroupingColumnSettings;\r\n return groupedColumnIds.length === 0\r\n ? getDataTable(this).rows\r\n : flattenToTableRows(getGrouper(this).topLevelGroups);\r\n }\r\n\r\n scrollState = new SimpleScrollState(0, 0);\r\n\r\n @observable contentBounds: BoundingRect | undefined;\r\n infiniteScrollLoader: IInfiniteScrollLoader | undefined =\r\n new NullIScrollLoader();\r\n\r\n parent?: any;\r\n\r\n initializeNewScrollLoader() {\r\n if (this.infiniteScrollLoader) {\r\n this.infiniteScrollLoader.dispose();\r\n }\r\n this.infiniteScrollLoader = this.getScrollLoader();\r\n getFormScreenLifecycle(this).registerDisposer(\r\n this.infiniteScrollLoader.start()\r\n );\r\n }\r\n\r\n getScrollLoader() {\r\n const isGroupingOff =\r\n getGroupingConfiguration(this).orderedGroupingColumnSettings.length === 0;\r\n const rowsContainer = getDataTable(this).rowsContainer;\r\n if (rowsContainer instanceof ScrollRowContainer && isGroupingOff) {\r\n return new InfiniteScrollLoader({\r\n ctx: this,\r\n gridDimensions: this.gridDimensions,\r\n scrollState: this.scrollState,\r\n rowsContainer: rowsContainer as ScrollRowContainer,\r\n groupFilter: undefined,\r\n visibleRowsMonitor: new VisibleRowsMonitor(\r\n this,\r\n this.gridDimensions,\r\n this.scrollState\r\n ),\r\n });\r\n } else {\r\n return new NullIScrollLoader();\r\n }\r\n }\r\n\r\n // Called by client scripts\r\n focusFormViewControl(name: string) {\r\n this.formFocusManager.focus(name);\r\n }\r\n\r\n // Called by client scripts\r\n showView(viewId: string, focus: boolean) {\r\n throw new Error(\"showView method is not yet implemented.\");\r\n }\r\n\r\n // Called by client scripts\r\n switchToPanel(modelInstanceId: string) {\r\n throw new Error(\"switchToPanel method is not yet implemented.\");\r\n }\r\n\r\n onReload() {\r\n this.dataTable.unlockAddedRowPosition();\r\n }\r\n\r\n attributes: any;\r\n\r\n async exportToExcel() {\r\n const visibleColumnIds = getConfigurationManager(this)\r\n .activeTableConfiguration.columnConfigurations.filter(\r\n (columnConfig) => columnConfig.isVisible\r\n )\r\n .map((columnConfig) => columnConfig.propertyId);\r\n const fields = getTablePanelView(this)\r\n .allTableProperties.filter((property) =>\r\n visibleColumnIds.includes(property.id)\r\n )\r\n .map((property) => {\r\n return {\r\n Caption: property.name,\r\n FieldName: property.id,\r\n LookupId: property.lookupId,\r\n Format: property.formatterPattern,\r\n PolymorphRules: property.controlPropertyId\r\n ? {\r\n ControlField: property.controlPropertyId,\r\n Rules: this.getPolymorphicRules(property),\r\n }\r\n : undefined,\r\n };\r\n });\r\n const excelMaxRowCount = 1048576;\r\n const api = getApi(this);\r\n if (isInfiniteScrollingActive(this)) {\r\n await api.getExcelFile({\r\n Entity: this.entity,\r\n Fields: fields,\r\n SessionFormIdentifier: getSessionId(this),\r\n RowIds: [],\r\n LazyLoadedEntityInput: {\r\n SessionFormIdentifier: getSessionId(this),\r\n Filter: getUserFilters({ctx: this}),\r\n MenuId: getMenuItemId(this),\r\n DataStructureEntityId: getDataStructureEntityId(this),\r\n Ordering: getUserOrdering(this),\r\n RowLimit: excelMaxRowCount,\r\n RowOffset: 0,\r\n ColumnNames: getColumnNamesToLoad(this),\r\n FilterLookups: getUserFilterLookups(this),\r\n },\r\n });\r\n } else {\r\n await api.getExcelFile({\r\n Entity: this.entity,\r\n Fields: fields,\r\n SessionFormIdentifier: getSessionId(this),\r\n RowIds: this.dataTable.rows.map((row) => this.dataTable.getRowId(row)),\r\n LazyLoadedEntityInput: undefined,\r\n });\r\n }\r\n }\r\n\r\n private getPolymorphicRules(property: IProperty) {\r\n return property.childProperties\r\n .filter((prop) => prop.controlPropertyValue)\r\n .reduce((map: { [key: string]: string }, prop: IProperty) => {\r\n map[prop.controlPropertyValue!] = prop.id;\r\n return map;\r\n }, {});\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getLookupLoader(ctx: any) {\r\n return getDataView(ctx).lookupLoader;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getBindingParents } from \"./getBindingParents\";\r\nimport { getSelectedRow } from \"./getSelectedRow\";\r\n\r\nexport function getParentRow(ctx: any) {\r\n const bps = getBindingParents(ctx);\r\n const bp = bps.length > 0 ? bps[0] : undefined;\r\n return bp ? getSelectedRow(bp) : undefined;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getBindingToParent(ctx: any) {\r\n const pb = getDataView(ctx).parentBindings;\r\n return pb.length > 0 ? pb[0] : undefined;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDropDownColumn, IDropDownColumnData } from \"./types/IDropDownColumn\";\r\n\r\nexport class DropDownColumn implements IDropDownColumn {\r\n $type_IDropDownColumn: 1 = 1;\r\n\r\n constructor(data: IDropDownColumnData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n parent: any;\r\n\r\n id: string = \"\";\r\n name: string = \"\";\r\n entity: string = \"\";\r\n column: string = \"\";\r\n index: number = 0;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n/* eslint-disable */\r\nimport { getLocaleFromCookie } from \"./cookies\";\r\n\r\ndeclare global {\r\n interface String {\r\n latinize(): String;\r\n\r\n isLatin(): boolean;\r\n }\r\n}\r\n\r\n// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript\r\nconst Latinize = {} as any;\r\nLatinize.latin_map = {\r\n \"Á\": \"A\",\r\n \"Ă\": \"A\",\r\n \"Ắ\": \"A\",\r\n \"Ặ\": \"A\",\r\n \"Ằ\": \"A\",\r\n \"Ẳ\": \"A\",\r\n \"Ẵ\": \"A\",\r\n \"Ǎ\": \"A\",\r\n \"Â\": \"A\",\r\n \"Ấ\": \"A\",\r\n \"Ậ\": \"A\",\r\n \"Ầ\": \"A\",\r\n \"Ẩ\": \"A\",\r\n \"Ẫ\": \"A\",\r\n \"Ä\": \"A\",\r\n \"Ǟ\": \"A\",\r\n \"Ȧ\": \"A\",\r\n \"Ǡ\": \"A\",\r\n \"Ạ\": \"A\",\r\n \"Ȁ\": \"A\",\r\n \"À\": \"A\",\r\n \"Ả\": \"A\",\r\n \"Ȃ\": \"A\",\r\n \"Ā\": \"A\",\r\n \"Ą\": \"A\",\r\n \"Å\": \"A\",\r\n \"Ǻ\": \"A\",\r\n \"Ḁ\": \"A\",\r\n \"Ⱥ\": \"A\",\r\n \"Ã\": \"A\",\r\n \"Ꜳ\": \"AA\",\r\n \"Æ\": \"AE\",\r\n \"Ǽ\": \"AE\",\r\n \"Ǣ\": \"AE\",\r\n \"Ꜵ\": \"AO\",\r\n \"Ꜷ\": \"AU\",\r\n \"Ꜹ\": \"AV\",\r\n \"Ꜻ\": \"AV\",\r\n \"Ꜽ\": \"AY\",\r\n \"Ḃ\": \"B\",\r\n \"Ḅ\": \"B\",\r\n \"Ɓ\": \"B\",\r\n \"Ḇ\": \"B\",\r\n \"Ƀ\": \"B\",\r\n \"Ƃ\": \"B\",\r\n \"Ć\": \"C\",\r\n \"Č\": \"C\",\r\n \"Ç\": \"C\",\r\n \"Ḉ\": \"C\",\r\n \"Ĉ\": \"C\",\r\n \"Ċ\": \"C\",\r\n \"Ƈ\": \"C\",\r\n \"Ȼ\": \"C\",\r\n \"Ď\": \"D\",\r\n \"Ḑ\": \"D\",\r\n \"Ḓ\": \"D\",\r\n \"Ḋ\": \"D\",\r\n \"Ḍ\": \"D\",\r\n \"Ɗ\": \"D\",\r\n \"Ḏ\": \"D\",\r\n \"Dz\": \"D\",\r\n \"Dž\": \"D\",\r\n \"Đ\": \"D\",\r\n \"Ƌ\": \"D\",\r\n \"DZ\": \"DZ\",\r\n \"DŽ\": \"DZ\",\r\n \"É\": \"E\",\r\n \"Ĕ\": \"E\",\r\n \"Ě\": \"E\",\r\n \"Ȩ\": \"E\",\r\n \"Ḝ\": \"E\",\r\n \"Ê\": \"E\",\r\n \"Ế\": \"E\",\r\n \"Ệ\": \"E\",\r\n \"Ề\": \"E\",\r\n \"Ể\": \"E\",\r\n \"Ễ\": \"E\",\r\n \"Ḙ\": \"E\",\r\n \"Ë\": \"E\",\r\n \"Ė\": \"E\",\r\n \"Ẹ\": \"E\",\r\n \"Ȅ\": \"E\",\r\n \"È\": \"E\",\r\n \"Ẻ\": \"E\",\r\n \"Ȇ\": \"E\",\r\n \"Ē\": \"E\",\r\n \"Ḗ\": \"E\",\r\n \"Ḕ\": \"E\",\r\n \"Ę\": \"E\",\r\n \"Ɇ\": \"E\",\r\n \"Ẽ\": \"E\",\r\n \"Ḛ\": \"E\",\r\n \"Ꝫ\": \"ET\",\r\n \"Ḟ\": \"F\",\r\n \"Ƒ\": \"F\",\r\n \"Ǵ\": \"G\",\r\n \"Ğ\": \"G\",\r\n \"Ǧ\": \"G\",\r\n \"Ģ\": \"G\",\r\n \"Ĝ\": \"G\",\r\n \"Ġ\": \"G\",\r\n \"Ɠ\": \"G\",\r\n \"Ḡ\": \"G\",\r\n \"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"L\",\r\n \"Lj\": \"L\",\r\n \"Ł\": \"L\",\r\n \"LJ\": \"LJ\",\r\n \"Ḿ\": \"M\",\r\n \"Ṁ\": \"M\",\r\n \"Ṃ\": \"M\",\r\n \"Ɱ\": \"M\",\r\n \"Ń\": \"N\",\r\n \"Ň\": \"N\",\r\n \"Ņ\": \"N\",\r\n \"Ṋ\": \"N\",\r\n \"Ṅ\": \"N\",\r\n \"Ṇ\": \"N\",\r\n \"Ǹ\": \"N\",\r\n \"Ɲ\": \"N\",\r\n \"Ṉ\": \"N\",\r\n \"Ƞ\": \"N\",\r\n \"Nj\": \"N\",\r\n \"Ñ\": \"N\",\r\n \"NJ\": \"NJ\",\r\n \"Ó\": \"O\",\r\n \"Ŏ\": \"O\",\r\n \"Ǒ\": \"O\",\r\n \"Ô\": \"O\",\r\n \"Ố\": \"O\",\r\n \"Ộ\": \"O\",\r\n \"Ồ\": \"O\",\r\n \"Ổ\": \"O\",\r\n \"Ỗ\": \"O\",\r\n \"Ö\": \"O\",\r\n \"Ȫ\": \"O\",\r\n \"Ȯ\": \"O\",\r\n \"Ȱ\": \"O\",\r\n \"Ọ\": \"O\",\r\n \"Ő\": \"O\",\r\n \"Ȍ\": \"O\",\r\n \"Ò\": \"O\",\r\n \"Ỏ\": \"O\",\r\n \"Ơ\": \"O\",\r\n \"Ớ\": \"O\",\r\n \"Ợ\": \"O\",\r\n \"Ờ\": \"O\",\r\n \"Ở\": \"O\",\r\n \"Ỡ\": \"O\",\r\n \"Ȏ\": \"O\",\r\n \"Ꝋ\": \"O\",\r\n \"Ꝍ\": \"O\",\r\n \"Ō\": \"O\",\r\n \"Ṓ\": \"O\",\r\n \"Ṑ\": \"O\",\r\n \"Ɵ\": \"O\",\r\n \"Ǫ\": \"O\",\r\n \"Ǭ\": \"O\",\r\n \"Ø\": \"O\",\r\n \"Ǿ\": \"O\",\r\n \"Õ\": \"O\",\r\n \"Ṍ\": \"O\",\r\n \"Ṏ\": \"O\",\r\n \"Ȭ\": \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"Ẓ\": \"Z\",\r\n \"Ȥ\": \"Z\",\r\n \"Ẕ\": \"Z\",\r\n \"Ƶ\": \"Z\",\r\n \"IJ\": \"IJ\",\r\n \"Œ\": \"OE\",\r\n \"ᴀ\": \"A\",\r\n \"ᴁ\": \"AE\",\r\n \"ʙ\": \"B\",\r\n \"ᴃ\": \"B\",\r\n \"ᴄ\": \"C\",\r\n \"ᴅ\": \"D\",\r\n \"ᴇ\": \"E\",\r\n \"ꜰ\": \"F\",\r\n \"ɢ\": \"G\",\r\n \"ʛ\": \"G\",\r\n \"ʜ\": \"H\",\r\n \"ɪ\": \"I\",\r\n \"ʁ\": \"R\",\r\n \"ᴊ\": \"J\",\r\n \"ᴋ\": \"K\",\r\n \"ʟ\": \"L\",\r\n \"ᴌ\": \"L\",\r\n \"ᴍ\": \"M\",\r\n \"ɴ\": \"N\",\r\n \"ᴏ\": \"O\",\r\n \"ɶ\": \"OE\",\r\n \"ᴐ\": \"O\",\r\n \"ᴕ\": \"OU\",\r\n \"ᴘ\": \"P\",\r\n \"ʀ\": \"R\",\r\n \"ᴎ\": \"N\",\r\n \"ᴙ\": \"R\",\r\n \"ꜱ\": \"S\",\r\n \"ᴛ\": \"T\",\r\n \"ⱻ\": \"E\",\r\n \"ᴚ\": \"R\",\r\n \"ᴜ\": \"U\",\r\n \"ᴠ\": \"V\",\r\n \"ᴡ\": \"W\",\r\n \"ʏ\": \"Y\",\r\n \"ᴢ\": \"Z\",\r\n \"á\": \"a\",\r\n \"ă\": \"a\",\r\n \"ắ\": \"a\",\r\n \"ặ\": \"a\",\r\n \"ằ\": \"a\",\r\n \"ẳ\": \"a\",\r\n \"ẵ\": \"a\",\r\n \"ǎ\": \"a\",\r\n \"â\": \"a\",\r\n \"ấ\": \"a\",\r\n \"ậ\": \"a\",\r\n \"ầ\": \"a\",\r\n \"ẩ\": \"a\",\r\n \"ẫ\": \"a\",\r\n \"ä\": \"a\",\r\n \"ǟ\": \"a\",\r\n \"ȧ\": \"a\",\r\n \"ǡ\": \"a\",\r\n \"ạ\": \"a\",\r\n \"ȁ\": \"a\",\r\n \"à\": \"a\",\r\n \"ả\": \"a\",\r\n \"ȃ\": \"a\",\r\n \"ā\": \"a\",\r\n \"ą\": \"a\",\r\n \"ᶏ\": \"a\",\r\n \"ẚ\": \"a\",\r\n \"å\": \"a\",\r\n \"ǻ\": \"a\",\r\n \"ḁ\": \"a\",\r\n \"ⱥ\": \"a\",\r\n \"ã\": \"a\",\r\n \"ꜳ\": \"aa\",\r\n \"æ\": \"ae\",\r\n \"ǽ\": \"ae\",\r\n \"ǣ\": \"ae\",\r\n \"ꜵ\": \"ao\",\r\n \"ꜷ\": \"au\",\r\n \"ꜹ\": \"av\",\r\n \"ꜻ\": \"av\",\r\n \"ꜽ\": \"ay\",\r\n \"ḃ\": \"b\",\r\n \"ḅ\": \"b\",\r\n \"ɓ\": \"b\",\r\n \"ḇ\": \"b\",\r\n \"ᵬ\": \"b\",\r\n \"ᶀ\": \"b\",\r\n \"ƀ\": \"b\",\r\n \"ƃ\": \"b\",\r\n \"ɵ\": \"o\",\r\n \"ć\": \"c\",\r\n \"č\": \"c\",\r\n \"ç\": \"c\",\r\n \"ḉ\": \"c\",\r\n \"ĉ\": \"c\",\r\n \"ɕ\": \"c\",\r\n \"ċ\": \"c\",\r\n \"ƈ\": \"c\",\r\n \"ȼ\": \"c\",\r\n \"ď\": \"d\",\r\n \"ḑ\": \"d\",\r\n \"ḓ\": \"d\",\r\n \"ȡ\": \"d\",\r\n \"ḋ\": \"d\",\r\n \"ḍ\": \"d\",\r\n \"ɗ\": \"d\",\r\n \"ᶑ\": \"d\",\r\n \"ḏ\": \"d\",\r\n \"ᵭ\": \"d\",\r\n \"ᶁ\": \"d\",\r\n \"đ\": \"d\",\r\n \"ɖ\": \"d\",\r\n \"ƌ\": \"d\",\r\n \"ı\": \"i\",\r\n \"ȷ\": \"j\",\r\n \"ɟ\": \"j\",\r\n \"ʄ\": \"j\",\r\n \"dz\": \"dz\",\r\n \"dž\": \"dz\",\r\n \"é\": \"e\",\r\n \"ĕ\": \"e\",\r\n \"ě\": \"e\",\r\n \"ȩ\": \"e\",\r\n \"ḝ\": \"e\",\r\n \"ê\": \"e\",\r\n \"ế\": \"e\",\r\n \"ệ\": \"e\",\r\n \"ề\": \"e\",\r\n \"ể\": \"e\",\r\n \"ễ\": \"e\",\r\n \"ḙ\": \"e\",\r\n \"ë\": \"e\",\r\n \"ė\": \"e\",\r\n \"ẹ\": \"e\",\r\n \"ȅ\": \"e\",\r\n \"è\": \"e\",\r\n \"ẻ\": \"e\",\r\n \"ȇ\": \"e\",\r\n \"ē\": \"e\",\r\n \"ḗ\": \"e\",\r\n \"ḕ\": \"e\",\r\n \"ⱸ\": \"e\",\r\n \"ę\": \"e\",\r\n \"ᶒ\": \"e\",\r\n \"ɇ\": \"e\",\r\n \"ẽ\": \"e\",\r\n \"ḛ\": \"e\",\r\n \"ꝫ\": \"et\",\r\n \"ḟ\": \"f\",\r\n \"ƒ\": \"f\",\r\n \"ᵮ\": \"f\",\r\n \"ᶂ\": \"f\",\r\n \"ǵ\": \"g\",\r\n \"ğ\": \"g\",\r\n \"ǧ\": \"g\",\r\n \"ģ\": \"g\",\r\n \"ĝ\": \"g\",\r\n \"ġ\": \"g\",\r\n \"ɠ\": \"g\",\r\n \"ḡ\": \"g\",\r\n \"ᶃ\": \"g\",\r\n \"ǥ\": \"g\",\r\n \"ḫ\": \"h\",\r\n \"ȟ\": \"h\",\r\n \"ḩ\": \"h\",\r\n \"ĥ\": \"h\",\r\n \"ⱨ\": \"h\",\r\n \"ḧ\": \"h\",\r\n \"ḣ\": \"h\",\r\n \"ḥ\": \"h\",\r\n \"ɦ\": \"h\",\r\n \"ẖ\": \"h\",\r\n \"ħ\": \"h\",\r\n \"ƕ\": \"hv\",\r\n \"í\": \"i\",\r\n \"ĭ\": \"i\",\r\n \"ǐ\": \"i\",\r\n \"î\": \"i\",\r\n \"ï\": \"i\",\r\n \"ḯ\": \"i\",\r\n \"ị\": \"i\",\r\n \"ȉ\": \"i\",\r\n \"ì\": \"i\",\r\n \"ỉ\": \"i\",\r\n \"ȋ\": \"i\",\r\n \"ī\": \"i\",\r\n \"į\": \"i\",\r\n \"ᶖ\": \"i\",\r\n \"ɨ\": \"i\",\r\n \"ĩ\": \"i\",\r\n \"ḭ\": \"i\",\r\n \"ꝺ\": \"d\",\r\n \"ꝼ\": \"f\",\r\n \"ᵹ\": \"g\",\r\n \"ꞃ\": \"r\",\r\n \"ꞅ\": \"s\",\r\n \"ꞇ\": \"t\",\r\n \"ꝭ\": \"is\",\r\n \"ǰ\": \"j\",\r\n \"ĵ\": \"j\",\r\n \"ʝ\": \"j\",\r\n \"ɉ\": \"j\",\r\n \"ḱ\": \"k\",\r\n \"ǩ\": \"k\",\r\n \"ķ\": \"k\",\r\n \"ⱪ\": \"k\",\r\n \"ꝃ\": \"k\",\r\n \"ḳ\": \"k\",\r\n \"ƙ\": \"k\",\r\n \"ḵ\": \"k\",\r\n \"ᶄ\": \"k\",\r\n \"ꝁ\": \"k\",\r\n \"ꝅ\": \"k\",\r\n \"ĺ\": \"l\",\r\n \"ƚ\": \"l\",\r\n \"ɬ\": \"l\",\r\n \"ľ\": \"l\",\r\n \"ļ\": \"l\",\r\n \"ḽ\": \"l\",\r\n \"ȴ\": \"l\",\r\n \"ḷ\": \"l\",\r\n \"ḹ\": \"l\",\r\n \"ⱡ\": \"l\",\r\n \"ꝉ\": \"l\",\r\n \"ḻ\": \"l\",\r\n \"ŀ\": \"l\",\r\n \"ɫ\": \"l\",\r\n \"ᶅ\": \"l\",\r\n \"ɭ\": \"l\",\r\n \"ł\": \"l\",\r\n \"lj\": \"lj\",\r\n \"ſ\": \"s\",\r\n \"ẜ\": \"s\",\r\n \"ẛ\": \"s\",\r\n \"ẝ\": \"s\",\r\n \"ḿ\": \"m\",\r\n \"ṁ\": \"m\",\r\n \"ṃ\": \"m\",\r\n \"ɱ\": \"m\",\r\n \"ᵯ\": \"m\",\r\n \"ᶆ\": \"m\",\r\n \"ń\": \"n\",\r\n \"ň\": \"n\",\r\n \"ņ\": \"n\",\r\n \"ṋ\": \"n\",\r\n \"ȵ\": \"n\",\r\n \"ṅ\": \"n\",\r\n \"ṇ\": \"n\",\r\n \"ǹ\": \"n\",\r\n \"ɲ\": \"n\",\r\n \"ṉ\": \"n\",\r\n \"ƞ\": \"n\",\r\n \"ᵰ\": \"n\",\r\n \"ᶇ\": \"n\",\r\n \"ɳ\": \"n\",\r\n \"ñ\": \"n\",\r\n \"nj\": \"nj\",\r\n \"ó\": \"o\",\r\n \"ŏ\": \"o\",\r\n \"ǒ\": \"o\",\r\n \"ô\": \"o\",\r\n \"ố\": \"o\",\r\n \"ộ\": \"o\",\r\n \"ồ\": \"o\",\r\n \"ổ\": \"o\",\r\n \"ỗ\": \"o\",\r\n \"ö\": \"o\",\r\n \"ȫ\": \"o\",\r\n \"ȯ\": \"o\",\r\n \"ȱ\": \"o\",\r\n \"ọ\": \"o\",\r\n \"ő\": \"o\",\r\n \"ȍ\": \"o\",\r\n \"ò\": \"o\",\r\n \"ỏ\": \"o\",\r\n \"ơ\": \"o\",\r\n \"ớ\": \"o\",\r\n \"ợ\": \"o\",\r\n \"ờ\": \"o\",\r\n \"ở\": \"o\",\r\n \"ỡ\": \"o\",\r\n \"ȏ\": \"o\",\r\n \"ꝋ\": \"o\",\r\n \"ꝍ\": \"o\",\r\n \"ⱺ\": \"o\",\r\n \"ō\": \"o\",\r\n \"ṓ\": \"o\",\r\n \"ṑ\": \"o\",\r\n \"ǫ\": \"o\",\r\n \"ǭ\": \"o\",\r\n \"ø\": \"o\",\r\n \"ǿ\": \"o\",\r\n \"õ\": \"o\",\r\n \"ṍ\": \"o\",\r\n \"ṏ\": \"o\",\r\n \"ȭ\": \"o\",\r\n \"ƣ\": \"oi\",\r\n \"ꝏ\": \"oo\",\r\n \"ɛ\": \"e\",\r\n \"ᶓ\": \"e\",\r\n \"ɔ\": \"o\",\r\n \"ᶗ\": \"o\",\r\n \"ȣ\": \"ou\",\r\n \"ṕ\": \"p\",\r\n \"ṗ\": \"p\",\r\n \"ꝓ\": \"p\",\r\n \"ƥ\": \"p\",\r\n \"ᵱ\": \"p\",\r\n \"ᶈ\": \"p\",\r\n \"ꝕ\": \"p\",\r\n \"ᵽ\": \"p\",\r\n \"ꝑ\": \"p\",\r\n \"ꝙ\": \"q\",\r\n \"ʠ\": \"q\",\r\n \"ɋ\": \"q\",\r\n \"ꝗ\": \"q\",\r\n \"ŕ\": \"r\",\r\n \"ř\": \"r\",\r\n \"ŗ\": \"r\",\r\n \"ṙ\": \"r\",\r\n \"ṛ\": \"r\",\r\n \"ṝ\": \"r\",\r\n \"ȑ\": \"r\",\r\n \"ɾ\": \"r\",\r\n \"ᵳ\": \"r\",\r\n \"ȓ\": \"r\",\r\n \"ṟ\": \"r\",\r\n \"ɼ\": \"r\",\r\n \"ᵲ\": \"r\",\r\n \"ᶉ\": \"r\",\r\n \"ɍ\": \"r\",\r\n \"ɽ\": \"r\",\r\n \"ↄ\": \"c\",\r\n \"ꜿ\": \"c\",\r\n \"ɘ\": \"e\",\r\n \"ɿ\": \"r\",\r\n \"ś\": \"s\",\r\n \"ṥ\": \"s\",\r\n \"š\": \"s\",\r\n \"ṧ\": \"s\",\r\n \"ş\": \"s\",\r\n \"ŝ\": \"s\",\r\n \"ș\": \"s\",\r\n \"ṡ\": \"s\",\r\n \"ṣ\": \"s\",\r\n \"ṩ\": \"s\",\r\n \"ʂ\": \"s\",\r\n \"ᵴ\": \"s\",\r\n \"ᶊ\": \"s\",\r\n \"ȿ\": \"s\",\r\n \"ɡ\": \"g\",\r\n \"ᴑ\": \"o\",\r\n \"ᴓ\": \"o\",\r\n \"ᴝ\": \"u\",\r\n \"ť\": \"t\",\r\n \"ţ\": \"t\",\r\n \"ṱ\": \"t\",\r\n \"ț\": \"t\",\r\n \"ȶ\": \"t\",\r\n \"ẗ\": \"t\",\r\n \"ⱦ\": \"t\",\r\n \"ṫ\": \"t\",\r\n \"ṭ\": \"t\",\r\n \"ƭ\": \"t\",\r\n \"ṯ\": \"t\",\r\n \"ᵵ\": \"t\",\r\n \"ƫ\": \"t\",\r\n \"ʈ\": \"t\",\r\n \"ŧ\": \"t\",\r\n \"ᵺ\": \"th\",\r\n \"ɐ\": \"a\",\r\n \"ᴂ\": \"ae\",\r\n \"ǝ\": \"e\",\r\n \"ᵷ\": \"g\",\r\n \"ɥ\": \"h\",\r\n \"ʮ\": \"h\",\r\n \"ʯ\": \"h\",\r\n \"ᴉ\": \"i\",\r\n \"ʞ\": \"k\",\r\n \"ꞁ\": \"l\",\r\n \"ɯ\": \"m\",\r\n \"ɰ\": \"m\",\r\n \"ᴔ\": \"oe\",\r\n \"ɹ\": \"r\",\r\n \"ɻ\": \"r\",\r\n \"ɺ\": \"r\",\r\n \"ⱹ\": \"r\",\r\n \"ʇ\": \"t\",\r\n \"ʌ\": \"v\",\r\n \"ʍ\": \"w\",\r\n \"ʎ\": \"y\",\r\n \"ꜩ\": \"tz\",\r\n \"ú\": \"u\",\r\n \"ŭ\": \"u\",\r\n \"ǔ\": \"u\",\r\n \"û\": \"u\",\r\n \"ṷ\": \"u\",\r\n \"ü\": \"u\",\r\n \"ǘ\": \"u\",\r\n \"ǚ\": \"u\",\r\n \"ǜ\": \"u\",\r\n \"ǖ\": \"u\",\r\n \"ṳ\": \"u\",\r\n \"ụ\": \"u\",\r\n \"ű\": \"u\",\r\n \"ȕ\": \"u\",\r\n \"ù\": \"u\",\r\n \"ủ\": \"u\",\r\n \"ư\": \"u\",\r\n \"ứ\": \"u\",\r\n \"ự\": \"u\",\r\n \"ừ\": \"u\",\r\n \"ử\": \"u\",\r\n \"ữ\": \"u\",\r\n \"ȗ\": \"u\",\r\n \"ū\": \"u\",\r\n \"ṻ\": \"u\",\r\n \"ų\": \"u\",\r\n \"ᶙ\": \"u\",\r\n \"ů\": \"u\",\r\n \"ũ\": \"u\",\r\n \"ṹ\": \"u\",\r\n \"ṵ\": \"u\",\r\n \"ᵫ\": \"ue\",\r\n \"ꝸ\": \"um\",\r\n \"ⱴ\": \"v\",\r\n \"ꝟ\": \"v\",\r\n \"ṿ\": \"v\",\r\n \"ʋ\": \"v\",\r\n \"ᶌ\": \"v\",\r\n \"ⱱ\": \"v\",\r\n \"ṽ\": \"v\",\r\n \"ꝡ\": \"vy\",\r\n \"ẃ\": \"w\",\r\n \"ŵ\": \"w\",\r\n \"ẅ\": \"w\",\r\n \"ẇ\": \"w\",\r\n \"ẉ\": \"w\",\r\n \"ẁ\": \"w\",\r\n \"ⱳ\": \"w\",\r\n \"ẘ\": \"w\",\r\n \"ẍ\": \"x\",\r\n \"ẋ\": \"x\",\r\n \"ᶍ\": \"x\",\r\n \"ý\": \"y\",\r\n \"ŷ\": \"y\",\r\n \"ÿ\": \"y\",\r\n \"ẏ\": \"y\",\r\n \"ỵ\": \"y\",\r\n \"ỳ\": \"y\",\r\n \"ƴ\": \"y\",\r\n \"ỷ\": \"y\",\r\n \"ỿ\": \"y\",\r\n \"ȳ\": \"y\",\r\n \"ẙ\": \"y\",\r\n \"ɏ\": \"y\",\r\n \"ỹ\": \"y\",\r\n \"ź\": \"z\",\r\n \"ž\": \"z\",\r\n \"ẑ\": \"z\",\r\n \"ʑ\": \"z\",\r\n \"ⱬ\": \"z\",\r\n \"ż\": \"z\",\r\n \"ẓ\": \"z\",\r\n \"ȥ\": \"z\",\r\n \"ẕ\": \"z\",\r\n \"ᵶ\": \"z\",\r\n \"ᶎ\": \"z\",\r\n \"ʐ\": \"z\",\r\n \"ƶ\": \"z\",\r\n \"ɀ\": \"z\",\r\n \"ff\": \"ff\",\r\n \"ffi\": \"ffi\",\r\n \"ffl\": \"ffl\",\r\n \"fi\": \"fi\",\r\n \"fl\": \"fl\",\r\n \"ij\": \"ij\",\r\n \"œ\": \"oe\",\r\n \"st\": \"st\",\r\n \"ₐ\": \"a\",\r\n \"ₑ\": \"e\",\r\n \"ᵢ\": \"i\",\r\n \"ⱼ\": \"j\",\r\n \"ₒ\": \"o\",\r\n \"ᵣ\": \"r\",\r\n \"ᵤ\": \"u\",\r\n \"ᵥ\": \"v\",\r\n \"ₓ\": \"x\"\r\n};\r\nString.prototype.latinize = function () {\r\n return this.replace(/[^A-Za-z0-9\\[\\] ]/g, function (a) {\r\n return Latinize.latin_map[a] || a\r\n })\r\n};\r\nString.prototype.isLatin = function () {\r\n return this == this.latinize()\r\n}\r\n\r\nexport function latinize(str: string) {\r\n return str.replace(/[^A-Za-z0-9\\[\\] ]/g, function (a) {\r\n return Latinize.latin_map[a] || a\r\n })\r\n};\r\n\r\n/* eslint-enable */\r\n\r\nexport function compareStrings(a: string | undefined | null, b: string | undefined | null) {\r\n if (a === undefined || a === null) {\r\n return 1;\r\n } else if (b === undefined || b === null) {\r\n return -1;\r\n }\r\n const locale = getLocaleFromCookie();\r\n return a.toString().localeCompare(b.toString(), locale);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFilterConfig } from \"../../entities/types/IFilterConfig\";\r\nimport { getWorkbenchLifecycle } from \"../getWorkbenchLifecycle\";\r\nimport { latinize } from \"utils/string\";\r\n\r\nfunction getStringFilterConfig(ctx: any): IFilterConfig {\r\n return getWorkbenchLifecycle(ctx).portalSettings?.filterConfig ?? {\r\n caseSensitive: false,\r\n accentSensitive: true\r\n };\r\n}\r\n\r\nexport function prepareForFilter(ctx: any, text: string | undefined | null) {\r\n if (text === undefined || text === null) {\r\n return text;\r\n }\r\n const filterConfig = getStringFilterConfig(ctx);\r\n if (!filterConfig.caseSensitive) {\r\n text = text.toLowerCase();\r\n }\r\n if (!filterConfig.accentSensitive) {\r\n text = latinize(text);\r\n }\r\n return text;\r\n}\r\n\r\nexport function prepareAnyForFilter(ctx: any, value: any): any {\r\n\r\n if (typeof value === 'string' || value instanceof String) {\r\n return prepareForFilter(ctx, value as string);\r\n }\r\n if (Array.isArray(value)) {\r\n return value.map(val => prepareAnyForFilter(ctx, val))\r\n }\r\n return value;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport _ from \"lodash\";\r\nimport { action, comparer, computed, flow, observable, reaction } from \"mobx\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { getDataTable } from \"../selectors/DataView/getDataTable\";\r\nimport { IFilterConfiguration } from \"./types/IFilterConfiguration\";\r\nimport { getDataSource } from \"../selectors/DataSources/getDataSource\";\r\nimport { IFilter } from \"./types/IFilter\";\r\nimport { prepareAnyForFilter, prepareForFilter } from \"../selectors/PortalSettings/getStringFilterConfig\";\r\n\r\nexport class FilterConfiguration implements IFilterConfiguration {\r\n constructor(implicitFilters: IImplicitFilter[]) {\r\n this.implicitFilters = implicitFilters;\r\n this.start();\r\n }\r\n\r\n filteringOnOffHandlers: ((filteringOn: boolean) => void)[] = [];\r\n $type_IFilterConfigurationData: 1 = 1;\r\n\r\n implicitFilters: IImplicitFilter[];\r\n @observable activeFilters: IFilter[] = [];\r\n\r\n registerFilteringOnOffHandler(handler: (filteringOn: boolean) => void) {\r\n this.filteringOnOffHandlers.push(handler);\r\n }\r\n\r\n getSettingByPropertyId(propertyId: string): IFilter | undefined {\r\n return this.activeFilters.find((item) => item.propertyId === propertyId);\r\n }\r\n\r\n @action.bound\r\n setFilters(filters: IFilter[]) {\r\n this.clearFilters();\r\n filters.forEach((filter) => this.setFilter(filter));\r\n this.isFilterControlsDisplayed = true;\r\n }\r\n\r\n @action.bound\r\n setFilter(term: IFilter): void {\r\n const existingIndex = this.activeFilters.findIndex(\r\n (filter) => filter.propertyId === term.propertyId\r\n );\r\n if (existingIndex > -1) {\r\n this.activeFilters.splice(existingIndex, 1);\r\n }\r\n this.activeFilters.push(term);\r\n this.activeFilters = [...this.activeFilters];\r\n }\r\n\r\n @action.bound\r\n clearFilters(): void {\r\n if (this.activeFilters.length !== 0) {\r\n this.activeFilters = [];\r\n }\r\n }\r\n\r\n @observable isFilterControlsDisplayed: boolean = false;\r\n\r\n @action.bound\r\n onFilterDisplayClick(event: any): void {\r\n this.isFilterControlsDisplayed = !this.isFilterControlsDisplayed;\r\n if (this.isFilterControlsDisplayed) {\r\n // TODO: Wait for data loaded?\r\n } else {\r\n this.clearFilters();\r\n }\r\n for (let filteringOnOffHandler of this.filteringOnOffHandlers) {\r\n filteringOnOffHandler(this.isFilterControlsDisplayed);\r\n }\r\n }\r\n\r\n filteringFunction(ignorePropertyId?: string): (row: any[]) => boolean {\r\n return (row: any[]) => {\r\n if (!this.isPresentInDetail(row)) {\r\n return false;\r\n }\r\n for (let term of this.implicitFilters) {\r\n if ((!ignorePropertyId || ignorePropertyId !== term.propertyId) &&\r\n !this.implicitFilterPredicate(row, term)) {\r\n return false;\r\n }\r\n }\r\n for (let term of this.activeFilters) {\r\n if ((!ignorePropertyId || ignorePropertyId !== term.propertyId) &&\r\n !this.userFilterPredicate(row, term)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n }\r\n\r\n userFilterPredicate(row: any[], term: IFilter) {\r\n const dataTable = getDataTable(this);\r\n const prop = dataTable.getPropertyById(term.propertyId)!;\r\n const cellValue = prepareAnyForFilter(this, dataTable.getOriginalCellValue(row, prop));\r\n switch (prop.column) {\r\n case \"Text\": {\r\n const filterVal1 = prepareAnyForFilter(this, term.setting.val1);\r\n const cellText = prepareAnyForFilter(this, dataTable.getOriginalCellText(row, prop))!;\r\n if (cellValue === undefined) return true;\r\n\r\n switch (term.setting.type) {\r\n case \"contains\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return cellText.includes(filterVal1);\r\n }\r\n case \"ends\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return cellText.endsWith(filterVal1);\r\n }\r\n case \"eq\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return cellText === filterVal1;\r\n }\r\n case \"ncontains\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return !cellText.includes(filterVal1);\r\n }\r\n case \"nends\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return !cellText.endsWith(filterVal1);\r\n }\r\n case \"neq\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return cellText !== filterVal1;\r\n }\r\n case \"nnull\": {\r\n return cellValue !== null;\r\n }\r\n case \"nstarts\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return !cellText.startsWith(filterVal1);\r\n }\r\n case \"null\": {\r\n return cellValue === null;\r\n }\r\n case \"starts\": {\r\n if (filterVal1 === \"\" || filterVal1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return cellText.startsWith(filterVal1);\r\n }\r\n }\r\n break;\r\n }\r\n case \"Date\": {\r\n if (cellValue === undefined) return false;\r\n if (term.setting.type === \"nnull\") return cellValue !== null;\r\n if (term.setting.type === \"null\") return cellValue === null;\r\n if (\r\n term.setting.val1 === \"\" ||\r\n term.setting.val1 === undefined ||\r\n term.setting.val1 === null\r\n )\r\n return true;\r\n\r\n const t1 = term.setting.val1.split(\".\")[0].endsWith(\"T00:00:00\") && cellValue !== null\r\n ? cellValue.substr(0, 10).concat(\"T00:00:00\")\r\n : cellValue;\r\n\r\n switch (term.setting.type) {\r\n case \"between\": {\r\n if (\r\n term.setting.val2 === \"\" ||\r\n term.setting.val2 === undefined ||\r\n term.setting.val2 === null\r\n )\r\n return true;\r\n if (cellValue === null) return false;\r\n const t0 = term.setting.val1;\r\n let t2 = term.setting.val2;\r\n if (t2.endsWith(\"T00:00:00\")) {\r\n t2 = t2.substr(0, 10).concat(\"T23:59:59\")\r\n }\r\n return t0 <= t1 && t1 <= t2;\r\n }\r\n case \"eq\":\r\n if (cellValue === null) return false;\r\n return t1 === term.setting.val1;\r\n case \"gt\":\r\n if (cellValue === null) return false;\r\n return t1 > term.setting.val1;\r\n case \"gte\":\r\n if (cellValue === null) return false;\r\n return t1 >= term.setting.val1;\r\n case \"lt\":\r\n if (cellValue === null) return false;\r\n return t1 < term.setting.val1;\r\n case \"lte\":\r\n if (cellValue === null) return false;\r\n return t1 <= term.setting.val1;\r\n case \"nbetween\": {\r\n if (\r\n term.setting.val2 === \"\" ||\r\n term.setting.val2 === undefined ||\r\n term.setting.val2 === null\r\n )\r\n return true;\r\n if (cellValue === null) return false;\r\n const t0 = term.setting.val1;\r\n const t2 = term.setting.val2;\r\n return t1 < t0 || t1 > t2;\r\n }\r\n case \"neq\":\r\n if (cellValue === null) return false;\r\n return t1 !== term.setting.val1;\r\n }\r\n break;\r\n }\r\n case \"Number\": {\r\n if (cellValue === undefined) return true;\r\n const t1 = prop.column === \"Number\" ? parseFloat(cellValue) : cellValue;\r\n\r\n switch (term.setting.type) {\r\n case \"between\": {\r\n if (\r\n term.setting.val1 === \"\" ||\r\n term.setting.val2 === \"\" ||\r\n term.setting.val1 === undefined ||\r\n term.setting.val2 === undefined\r\n )\r\n return true;\r\n if (cellValue === null) return false;\r\n const t0 = parseFloat(term.setting.val1);\r\n const t2 = parseFloat(term.setting.val2);\r\n return t0 <= t1 && t1 <= t2;\r\n }\r\n case \"eq\":\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return t1 === parseFloat(term.setting.val1);\r\n case \"gt\":\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return t1 > parseFloat(term.setting.val1);\r\n case \"gte\":\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return t1 >= parseFloat(term.setting.val1);\r\n case \"lt\":\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n return t1 < parseFloat(term.setting.val1);\r\n case \"lte\":\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n if (cellValue === null) return false;\r\n\r\n return t1 <= parseFloat(term.setting.val1);\r\n case \"nbetween\": {\r\n if (\r\n term.setting.val1 === \"\" ||\r\n term.setting.val2 === \"\" ||\r\n term.setting.val1 === undefined ||\r\n term.setting.val2 === undefined\r\n )\r\n return true;\r\n if (cellValue === null) return false;\r\n const t0 = parseFloat(term.setting.val1);\r\n const t2 = parseFloat(term.setting.val2);\r\n return t1 < t0 || t1 > t2;\r\n }\r\n case \"neq\":\r\n if (cellValue === null) return false;\r\n if (term.setting.val1 === \"\" || term.setting.val1 === undefined) return true;\r\n return t1 !== parseFloat(term.setting.val1);\r\n case \"nnull\":\r\n return t1 !== null;\r\n case \"null\":\r\n return t1 === null;\r\n }\r\n break;\r\n }\r\n case \"ComboBox\": {\r\n const filterVal1 = prepareAnyForFilter(this, term.setting.val1) || [];\r\n const filterVal2 = prepareAnyForFilter(this, term.setting.val2) || \"\";\r\n const cellText = prepareForFilter(this, dataTable.getOriginalCellText(row, prop))!;\r\n switch (term.setting.type) {\r\n case \"starts\": {\r\n if (filterVal2 === \"\") return true;\r\n if (cellText === null) return false;\r\n return cellText.startsWith(filterVal2);\r\n }\r\n case \"nstarts\": {\r\n if (filterVal2 === \"\") return true;\r\n if (cellText === null) return false;\r\n return !cellText.startsWith(filterVal2);\r\n }\r\n case \"in\":\r\n case \"eq\": {\r\n if (filterVal1.length === 0) return true;\r\n if (cellValue === null) return false;\r\n if (filterVal1.findIndex((item: any) => item === cellValue) > -1) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n case \"nin\":\r\n case \"neq\": {\r\n if (filterVal1.length === 0) return true;\r\n if (cellValue === null) return false;\r\n if (filterVal1.findIndex((item: any) => item === cellValue) > -1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n case \"null\": {\r\n return cellValue === null;\r\n }\r\n case \"nnull\": {\r\n return cellValue !== null;\r\n }\r\n case \"contains\": {\r\n if (filterVal2 === \"\") return true;\r\n if (cellText === null) return false;\r\n return cellText.includes(filterVal2);\r\n }\r\n case \"ncontains\": {\r\n if (filterVal2 === \"\") return true;\r\n if (cellText === null) return false;\r\n return !cellText.includes(filterVal2);\r\n }\r\n }\r\n break;\r\n }\r\n case \"TagInput\": {\r\n const cellValues = prepareAnyForFilter(this, dataTable.getOriginalCellValue(row, prop));\r\n const filterValues1 = prepareAnyForFilter(this, term.setting.val1);\r\n switch (term.setting.type) {\r\n case \"in\":\r\n case \"eq\": {\r\n if (filterValues1 === undefined || filterValues1.length === 0) return true;\r\n if (!cellValues || cellValues.length === 0) return false;\r\n return cellValues.some((val: any) =>\r\n filterValues1.some(\r\n (filterVal: any) => filterVal === val)\r\n );\r\n }\r\n case \"nin\":\r\n case \"neq\": {\r\n if (filterValues1 === undefined || filterValues1.length === 0) return true;\r\n if (!cellValues || cellValues.length === 0) return true;\r\n return cellValues.every((val: any) =>\r\n filterValues1.every(\r\n (filterVal: any) => filterVal !== val)\r\n );\r\n }\r\n case \"null\": {\r\n return !cellValues || cellValues.length === 0;\r\n }\r\n case \"nnull\": {\r\n return cellValues && cellValues.length > 0;\r\n }\r\n\r\n }\r\n return true;\r\n }\r\n case \"CheckBox\": {\r\n switch (term.setting.type) {\r\n case \"eq\": {\r\n if (term.setting.val1 === undefined) return true;\r\n const bool1 = dataTable.getOriginalCellValue(row, prop);\r\n return bool1 === !!term.setting.val1;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n implicitFilterPredicate(row: any[], implicitFilter: IImplicitFilter) {\r\n const dataTable = getDataTable(this);\r\n const dataSource = getDataSource(dataTable);\r\n const sourceField = dataSource.getFieldByName(implicitFilter.propertyId)!;\r\n const cellValue = prepareAnyForFilter(this, dataTable.getCellValueByDataSourceField(row, sourceField));\r\n const filterValue = prepareAnyForFilter(this, implicitFilter.value);\r\n\r\n switch (parseInt(implicitFilter.operatorCode)) {\r\n case 1:\r\n return filterValue === String(cellValue);\r\n case 10:\r\n return filterValue !== String(cellValue);\r\n case 15:\r\n return cellValue === null;\r\n case 16:\r\n return cellValue !== null;\r\n default:\r\n throw new Error(`Operator code ${implicitFilter.operatorCode} not implemented.`);\r\n }\r\n }\r\n\r\n isPresentInDetail(row: any[]): boolean {\r\n if (this.dataView.isBindingRoot) return true;\r\n for (let binding of this.dataView.parentBindings) {\r\n const selectedRow = binding.parentDataView.selectedRow;\r\n if (!selectedRow) {\r\n return false;\r\n }\r\n for (let bindingPair of binding.bindingPairs) {\r\n const parentDsField = binding.parentDataView.dataSource.getFieldByName(\r\n bindingPair.parentPropertyId\r\n );\r\n if (!parentDsField) {\r\n return false;\r\n }\r\n const parentValue = binding.parentDataView.dataTable.getCellValueByDataSourceField(\r\n selectedRow,\r\n parentDsField\r\n );\r\n const childDsField = binding.childDataView.dataSource.getFieldByName(\r\n bindingPair.childPropertyId\r\n );\r\n if (!childDsField) {\r\n return false;\r\n }\r\n const childValue = binding.childDataView.dataTable.getCellValueByDataSourceField(\r\n row,\r\n childDsField\r\n );\r\n if (parentValue !== childValue) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n @computed get dataView() {\r\n return getDataView(this);\r\n }\r\n\r\n disposers: any[] = [];\r\n\r\n @action.bound start() {\r\n this.disposers.push(\r\n reaction(\r\n () => {\r\n return this.activeFilters.map((filter) => [\r\n filter.propertyId,\r\n filter.setting.val1,\r\n filter.setting.val2,\r\n filter.setting.type,\r\n ]);\r\n },\r\n () => {\r\n this.applyNewFiltering();\r\n },\r\n\r\n {equals: comparer.structural}\r\n )\r\n );\r\n }\r\n\r\n @action.bound applyNewFilteringImm = flow(function*(this: FilterConfiguration) {\r\n const dataView = getDataView(this);\r\n const dataTable = getDataTable(dataView);\r\n if (!dataView.isLazyLoading) {\r\n if (this.activeFilters.length > 0) {\r\n const comboProps = this.activeFilters\r\n .filter((filter) => filter.setting.isComplete)\r\n .map((term) => getDataViewPropertyById(this, term.propertyId)!)\r\n .filter((prop) => prop.column === \"ComboBox\");\r\n\r\n yield Promise.all(\r\n comboProps.map(async (prop) => {\r\n return prop.lookupEngine?.lookupResolver.resolveList(\r\n dataTable.getAllValuesOfProp(prop)\r\n );\r\n })\r\n );\r\n }\r\n }\r\n });\r\n\r\n applyNewFiltering = _.throttle(this.applyNewFilteringImm, 200);\r\n\r\n @action.bound stop() {\r\n this.disposers.forEach((dis) => dis());\r\n }\r\n\r\n parent?: any;\r\n}\r\n\r\ninterface IImplicitFilter {\r\n propertyId: string;\r\n operatorCode: string;\r\n value: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFormPanelView } from \"./types/IFormPanelView\";\r\n\r\nexport class FormPanelView implements IFormPanelView {\r\n $type_IFormPanelView: 1 = 1;\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\ninterface ITriggerablePromise extends Promise {\r\n resolve(arg?: T): void;\r\n\r\n reject(arg?: any): void;\r\n}\r\n\r\nexport function TriggerablePromise() {\r\n let fnResolve;\r\n let fnReject;\r\n const promise = new Promise((resolve, reject) => {\r\n fnResolve = resolve;\r\n fnReject = reject;\r\n });\r\n (promise as any).resolve = fnResolve;\r\n (promise as any).reject = fnReject;\r\n return promise as ITriggerablePromise;\r\n}\r\n\r\nexport class CriticalSection {\r\n\r\n tokensIn = 0;\r\n\r\n tokenQueue: ITriggerablePromise[] = [];\r\n\r\n enqueue() {\r\n const promise = TriggerablePromise();\r\n this.tokenQueue.push(promise);\r\n return promise;\r\n }\r\n\r\n dequeue() {\r\n const promise = this.tokenQueue.shift();\r\n promise?.resolve();\r\n }\r\n\r\n incTokens() {\r\n this.tokensIn++;\r\n }\r\n\r\n decTokens() {\r\n this.tokensIn--;\r\n }\r\n\r\n enterPromise() {\r\n this.incTokens();\r\n if (this.tokensIn > 1) {\r\n return this.enqueue();\r\n }\r\n }\r\n\r\n *enterGenerator() {\r\n this.incTokens();\r\n if (this.tokensIn > 1) {\r\n yield this.enqueue();\r\n }\r\n }\r\n\r\n leave() {\r\n this.decTokens();\r\n if (this.tokensIn > 0) {\r\n this.dequeue();\r\n }\r\n }\r\n\r\n async runAsync(fn: () => Promise) {\r\n try {\r\n await this.enterPromise();\r\n return fn();\r\n } finally {\r\n this.leave();\r\n }\r\n }\r\n\r\n *runGenerator(fn: () => Generator) {\r\n try {\r\n yield*this.enterGenerator();\r\n return yield*fn();\r\n } finally {\r\n this.leave();\r\n }\r\n }\r\n}\r\n\r\nexport function sleep(ms: number) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isBase64 } from \"./values\";\r\n\r\nconst IMAGE_TYPE: { [key: string]: string } = {\r\n \"/\": \"jpg\",\r\n i: \"png\",\r\n R: \"gif\",\r\n U: \"webp\",\r\n};\r\n\r\nexport function processedImageURL(value?: string) {\r\n if (!value) {\r\n return {\r\n isEmbedded: false,\r\n value: null,\r\n };\r\n }\r\n\r\n if (value.length > 512 || isBase64(value)) {\r\n return {isEmbedded: true, value: `data:image/${IMAGE_TYPE[value.charAt(0)]};base64,${value}`};\r\n } else {\r\n return {isEmbedded: false, value};\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function isBase64(str?: string) {\r\n if (!str) return false;\r\n return str.search(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/) > -1;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, createAtom, observable } from \"mobx\";\r\nimport { processedImageURL } from \"utils/image\";\r\n\r\nexport class ScreenPictureCache {\r\n @observable items = new Map();\r\n atoms = new Map();\r\n\r\n @action.bound\r\n atomBecameObserved(url: string, atom: any) {\r\n if (!this.items.has(url)) {\r\n const procUrl = processedImageURL(url);\r\n const img = new Image();\r\n this.items.set(url, img);\r\n atom.reportChanged();\r\n img.onload = () => {\r\n atom.reportChanged();\r\n };\r\n img.onerror = () => {\r\n this.items.set(url, null);\r\n };\r\n img.src = procUrl.value!;\r\n }\r\n }\r\n\r\n getImage(url: string) {\r\n if (!this.atoms.has(url)) {\r\n const atom = createAtom(\r\n \"ImageCacheAtom\",\r\n () => {\r\n this.atomBecameObserved(url, atom);\r\n },\r\n () => {\r\n this.atoms.delete(url);\r\n }\r\n );\r\n this.atoms.set(url, atom);\r\n }\r\n const atom = this.atoms.get(url);\r\n atom.reportObserved();\r\n return this.items.get(url)!;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDropDownColumn } from \"./IDropDownColumn\";\r\n\r\nexport enum IDropDownType {\r\n EagerlyLoadedGrid = \"EagerlyLoadedGrid\",\r\n LazilyLoadedGrid = \"LazilyLoadedGrid\",\r\n EagerlyLoadedTree = \"EagerlyLoadedTree\",\r\n}\r\n\r\nexport interface IDropDownParameter {\r\n parameterName: string;\r\n fieldName: string;\r\n}\r\n\r\nexport interface ILookupData {\r\n lookupId: string;\r\n dropDownShowUniqueValues: boolean;\r\n identifier: string;\r\n identifierIndex: number;\r\n dropDownType: IDropDownType;\r\n cached: boolean;\r\n searchByFirstColumnOnly: boolean;\r\n dropDownColumns: IDropDownColumn[];\r\n dropDownParameters: IDropDownParameter[];\r\n}\r\n\r\nexport interface ILookup extends ILookupData {\r\n $type_ILookup: 1;\r\n\r\n parameters: { [key: string]: any };\r\n parent?: any;\r\n}\r\n\r\nexport const isILookup = (o: any): o is ILookup => o.$type_ILookup;\r\n","import { IDataView } from \"./types/IDataView\";\r\nimport { getApi } from \"../selectors/getApi\";\r\nimport { getSessionId } from \"../selectors/getSessionId\";\r\nimport { getParentRowId } from \"../selectors/DataView/getParentRowId\";\r\nimport { getMasterRowId } from \"../selectors/DataView/getMasterRowId\";\r\n\r\nexport class DataViewCache {\r\n constructor(private ctx: any) {\r\n }\r\n\r\n dataMap = new Map();\r\n\r\n public UpdateData(dataView: IDataView) {\r\n const parentRowId = getParentRowId(dataView);\r\n const masterRowId = getMasterRowId(dataView);\r\n if (!parentRowId || !masterRowId) {\r\n return;\r\n }\r\n const cacheKey = this.makeCacheKey(dataView.modelInstanceId, parentRowId, masterRowId);\r\n this.dataMap.set(cacheKey, [...dataView.dataTable.allRows])\r\n }\r\n\r\n public async getData(args: { childEntity: string, modelInstanceId: string, parentRecordId: string, rootRecordId: string }) {\r\n const cacheKey = this.makeCacheKey(args.modelInstanceId, args.parentRecordId, args.rootRecordId);\r\n if (!this.dataMap.has(cacheKey)) {\r\n const rows = await this.callGetData(args.childEntity, args.parentRecordId, args.rootRecordId);\r\n this.dataMap.set(cacheKey, rows);\r\n }\r\n return this.dataMap.get(cacheKey);\r\n }\r\n\r\n public clear() {\r\n this.dataMap.clear();\r\n }\r\n\r\n private callGetData(childEntity: string, parentRecordId: string, rootRecordId: string) {\r\n const api = getApi(this.ctx);\r\n const dataPromise = api.getData({\r\n SessionFormIdentifier: getSessionId(this.ctx),\r\n ChildEntity: childEntity,\r\n ParentRecordId: parentRecordId,\r\n RootRecordId: rootRecordId,\r\n });\r\n return dataPromise;\r\n }\r\n\r\n private makeCacheKey(childEntity: string, parentRecordId: string, rootRecordId: string) {\r\n return childEntity + \"_\" + parentRecordId + \"_\" + rootRecordId;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"./types/IDataView\";\r\nimport { IDataSource } from \"./types/IDataSource\";\r\nimport { IComponentBinding } from \"./types/IComponentBinding\";\r\nimport { IFormScreenLifecycle02 } from \"./types/IFormScreenLifecycle\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { IAction } from \"./types/IAction\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { IFormScreen, IFormScreenData, IFormScreenEnvelope, IFormScreenEnvelopeData, } from \"./types/IFormScreen\";\r\nimport { IPanelConfiguration } from \"./types/IPanelConfiguration\";\r\nimport { CriticalSection } from \"utils/sync\";\r\nimport { getRowStates } from \"model/selectors/RowState/getRowStates\";\r\nimport { ScreenPictureCache } from \"./ScreenPictureCache\";\r\nimport { DataViewCache } from \"./DataViewCache\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { ICRUDResult, IResponseOperation, processCRUDResult } from \"model/actions/DataLoading/processCRUDResult\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\n\r\nexport class FormScreen implements IFormScreen {\r\n\r\n $type_IFormScreen: 1 = 1;\r\n\r\n constructor(data: IFormScreenData) {\r\n Object.assign(this, data);\r\n this.formScreenLifecycle.parent = this;\r\n this.dataViews.forEach((o) => (o.parent = this));\r\n this.dataSources.forEach((o) => (o.parent = this));\r\n this.componentBindings.forEach((o) => (o.parent = this));\r\n }\r\n\r\n parent?: any;\r\n\r\n dataUpdateCRS = new CriticalSection();\r\n pictureCache = new ScreenPictureCache();\r\n dataViewCache = new DataViewCache(this);\r\n\r\n @observable isDirty: boolean = false;\r\n dynamicTitleSource: string | undefined;\r\n sessionId: string = \"\";\r\n @observable title: string = \"\";\r\n suppressSave: boolean = false;\r\n suppressRefresh: boolean = false;\r\n menuId: string = \"\";\r\n openingOrder: number = 0;\r\n showInfoPanel: boolean = false;\r\n showWorkflowCancelButton: boolean = false;\r\n showWorkflowNextButton: boolean = false;\r\n autoRefreshInterval: number = 0;\r\n refreshOnFocus: boolean = false;\r\n cacheOnClient: boolean = false;\r\n autoSaveOnListRecordChange: boolean = false;\r\n requestSaveAfterUpdate: boolean = false;\r\n screenUI: any;\r\n @observable\r\n panelConfigurations: Map = new Map();\r\n isLoading: false = false;\r\n formScreenLifecycle: IFormScreenLifecycle02 = null as any;\r\n autoWorkflowNext: boolean = null as any;\r\n\r\n dataViews: IDataView[] = [];\r\n dataSources: IDataSource[] = [];\r\n componentBindings: IComponentBinding[] = [];\r\n\r\n setPanelSize(id: string, size: number) {\r\n if (!this.panelConfigurations.has(id)) {\r\n this.panelConfigurations.set(\r\n id,\r\n {\r\n position: undefined,\r\n defaultOrdering: undefined\r\n }\r\n )\r\n }\r\n this.panelConfigurations.get(id)!.position = size;\r\n }\r\n\r\n getData(childEntity: string, modelInstanceId: string, parentRecordId: string, rootRecordId: string) {\r\n this.dataSources.filter(dataSource => dataSource.entity === childEntity)\r\n .forEach(dataSource => getRowStates(dataSource).clearAll());\r\n return this.dataViewCache.getData({\r\n childEntity: childEntity,\r\n modelInstanceId: modelInstanceId,\r\n parentRecordId: parentRecordId,\r\n rootRecordId: rootRecordId\r\n });\r\n }\r\n\r\n clearDataCache() {\r\n this.dataViewCache.clear();\r\n }\r\n\r\n\r\n get dynamicTitle() {\r\n if (!this.dynamicTitleSource) {\r\n return undefined;\r\n }\r\n const splitSource = this.dynamicTitleSource.split(\".\");\r\n const dataSourceName = splitSource[0];\r\n const columnName = splitSource[1];\r\n\r\n const dataView = this.dataViews.find((view) => view.entity === dataSourceName);\r\n if (!dataView) return undefined;\r\n const dataSource = this.dataSources.find((view) => view.entity === dataSourceName);\r\n if (!dataSource) return undefined;\r\n const dataSourceField = dataSource!.getFieldByName(columnName);\r\n const dataTable = dataView!.dataTable;\r\n const firstRow = dataTable.rows[0];\r\n return firstRow\r\n ? dataTable.getCellValueByDataSourceField(firstRow, dataSourceField!)\r\n : undefined;\r\n }\r\n\r\n @computed get isLazyLoading() {\r\n return isLazyLoading(this);\r\n }\r\n\r\n @computed get rootDataViews(): IDataView[] {\r\n return this.dataViews.filter((dv) => dv.isBindingRoot);\r\n }\r\n\r\n @computed get nonRootDataViews(): IDataView[] {\r\n return this.dataViews.filter((dv) => !dv.isBindingRoot);\r\n }\r\n\r\n @action.bound setTitle(title: string) {\r\n this.title = title;\r\n }\r\n\r\n getBindingsByChildId(childId: string) {\r\n return this.componentBindings.filter((b) => b.childId === childId);\r\n }\r\n\r\n getBindingsByParentId(parentId: string) {\r\n return this.componentBindings.filter((b) => b.parentId === parentId);\r\n }\r\n\r\n getDataViewByModelInstanceId(modelInstanceId: string): IDataView | undefined {\r\n return this.dataViews.find((dv) => dv.modelInstanceId === modelInstanceId);\r\n }\r\n\r\n getDataViewsByEntity(entity: string): IDataView[] {\r\n return this.dataViews.filter((dv) => dv.entity === entity);\r\n }\r\n\r\n getDataSourceByEntity(entity: string): IDataSource | undefined {\r\n return this.dataSources.find((ds) => ds.entity === entity);\r\n }\r\n\r\n @computed get toolbarActions() {\r\n const result: Array<{ section: string; actions: IAction[] }> = [];\r\n for (let dv of this.dataViews) {\r\n if (dv.toolbarActions.length > 0) {\r\n result.push({\r\n section: dv.name,\r\n actions: dv.toolbarActions,\r\n });\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n @computed get dialogActions() {\r\n const result: IAction[] = [];\r\n for (let dv of this.dataViews) {\r\n result.push(...dv.dialogActions);\r\n }\r\n return result;\r\n }\r\n\r\n getPanelPosition(id: string): number | undefined {\r\n const conf = this.panelConfigurations.get(id.toLowerCase());\r\n return conf ? conf.position : undefined;\r\n }\r\n\r\n @action.bound\r\n setDirty(state: boolean): void {\r\n if (this.suppressSave && state === true) {\r\n return;\r\n }\r\n this.isDirty = state;\r\n }\r\n\r\n getFirstFormPropertyId() {\r\n for (let dv of this.dataViews) {\r\n for (let prop of dv.properties) {\r\n if (prop.isFormField) return prop.id;\r\n }\r\n }\r\n }\r\n\r\n /* eslint-disable no-console */\r\n printMasterDetailTree() {\r\n const strrep = (cnt: number, str: string) => {\r\n let result = \"\";\r\n for (let i = 0; i < cnt; i++) result = result + str;\r\n return result;\r\n };\r\n\r\n const recursive = (dataView: IDataView, level: number) => {\r\n console.log(\r\n `${strrep(level, \" \")}${dataView?.name} (${dataView?.entity} - ${dataView?.modelId})`\r\n );\r\n if (!dataView) {\r\n return;\r\n }\r\n for (let chb of dataView.childBindings) {\r\n recursive(chb.childDataView, level + 1);\r\n }\r\n };\r\n console.log(\"View bindings\");\r\n console.log(\"=============\");\r\n const roots = Array.from(this.dataViews.values()).filter((dv) => dv.isBindingRoot);\r\n for (let dv of roots) {\r\n recursive(dv, 0);\r\n }\r\n console.log(\"=============\");\r\n console.log(\"End of View bindings\");\r\n console.log(\"\");\r\n }\r\n\r\n /* eslint-enable no-console */\r\n}\r\n\r\nexport class FormScreenEnvelope implements IFormScreenEnvelope {\r\n $type_IFormScreenEnvelope: 1 = 1;\r\n\r\n constructor(data: IFormScreenEnvelopeData) {\r\n Object.assign(this, data);\r\n this.formScreenLifecycle.parent = this;\r\n }\r\n\r\n @observable formScreen?: IFormScreen | undefined;\r\n formScreenLifecycle: IFormScreenLifecycle02 = null as any;\r\n\r\n @computed get isLoading() {\r\n return !this.formScreen;\r\n }\r\n\r\n @action.bound\r\n setFormScreen(formScreen?: IFormScreen | undefined): void {\r\n if (formScreen) {\r\n formScreen.parent = this;\r\n }\r\n this.formScreen = formScreen;\r\n }\r\n\r\n *start(initUIResult: any, preloadIsDirty?: boolean): Generator {\r\n yield*this.formScreenLifecycle.start(initUIResult);\r\n if (this.formScreen) {\r\n this.formScreen.setDirty(!!preloadIsDirty);\r\n if(preloadIsDirty && isLazyLoading(this.formScreen)){\r\n yield*this.loadDirtyRow(this.formScreen);\r\n }\r\n }\r\n }\r\n\r\n *loadDirtyRow(formScreen: IFormScreen){\r\n for (let rootDataView of formScreen.rootDataViews) {\r\n const api = getApi(rootDataView)\r\n const isDirty = getFormScreen(rootDataView).isDirty\r\n if(isDirty){\r\n const dirtyRowResult = (yield api.getRow({\r\n SessionFormIdentifier: getSessionId(rootDataView),\r\n Entity: getEntity(rootDataView),\r\n RowId: getSelectedRowId(rootDataView)!\r\n })) as ICRUDResult;\r\n\r\n const selectedRowExists = rootDataView.selectedRowId &&\r\n rootDataView.dataTable.getRowById(rootDataView.selectedRowId);\r\n dirtyRowResult.operation = selectedRowExists\r\n ? IResponseOperation.Update\r\n : IResponseOperation.Create;\r\n\r\n yield*processCRUDResult(rootDataView, dirtyRowResult) as any;\r\n }\r\n }\r\n }\r\n\r\n parent?: any;\r\n}\r\n\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDropDownColumn } from \"./types/IDropDownColumn\";\r\nimport { IDropDownParameter, IDropDownType, ILookup, ILookupData } from \"./types/ILookup\";\r\n\r\nexport enum IIdState {\r\n LOADING = \"LOADING\",\r\n ERROR = \"ERROR\",\r\n}\r\n\r\nexport class Lookup implements ILookup {\r\n constructor(data: ILookupData) {\r\n Object.assign(this, data);\r\n this.dropDownColumns.forEach((o) => (o.parent = this));\r\n }\r\n\r\n $type_ILookup: 1 = 1;\r\n\r\n lookupId: string = \"\";\r\n dropDownShowUniqueValues: boolean = false;\r\n identifier: string = \"\";\r\n identifierIndex: number = 0;\r\n dropDownType: IDropDownType = IDropDownType.EagerlyLoadedGrid;\r\n cached: boolean = false;\r\n searchByFirstColumnOnly: boolean = false;\r\n dropDownColumns: IDropDownColumn[] = [];\r\n dropDownParameters: IDropDownParameter[] = [];\r\n\r\n parent?: any;\r\n\r\n get parameters() {\r\n const parameters: { [key: string]: any } = {};\r\n for (let param of this.dropDownParameters) {\r\n parameters[param.parameterName] = param.fieldName;\r\n }\r\n return parameters;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"../../entities/types/IProperty\";\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getProperties(ctx: any): IProperty[] {\r\n return getDataView(ctx).properties;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, flow, observable } from \"mobx\";\r\nimport {\r\n IOrderByColumnSetting,\r\n IOrderByDirection,\r\n IOrdering,\r\n IOrderingConfiguration,\r\n} from \"./types/IOrderingConfiguration\";\r\nimport _ from \"lodash\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { getProperties } from \"../selectors/DataView/getProperties\";\r\nimport { compareStrings } from \"../../utils/string\";\r\n\r\nfunction cycleOrdering(direction: IOrderByDirection) {\r\n switch (direction) {\r\n case IOrderByDirection.ASC:\r\n return IOrderByDirection.DESC;\r\n case IOrderByDirection.DESC:\r\n return IOrderByDirection.NONE;\r\n case IOrderByDirection.NONE:\r\n default:\r\n return IOrderByDirection.ASC;\r\n }\r\n}\r\n\r\nfunction flipOrdering(direction: IOrderByDirection) {\r\n return direction === IOrderByDirection.DESC\r\n ? IOrderByDirection.ASC\r\n : IOrderByDirection.DESC;\r\n}\r\n\r\nexport class OrderingConfiguration implements IOrderingConfiguration {\r\n @observable userOrderings: IOrdering[] = [];\r\n private defaultOrderings: IOrdering[];\r\n\r\n constructor(defaultOrderings: IOrdering[] | undefined) {\r\n this.defaultOrderings = defaultOrderings ?? [];\r\n this.userOrderings = this.defaultOrderings;\r\n }\r\n\r\n getDefaultOrderings() {\r\n return this.defaultOrderings;\r\n }\r\n\r\n @computed get orderings() {\r\n return this.userOrderings.length !== 0 ? this.userOrderings : this.defaultOrderings;\r\n }\r\n\r\n @computed get groupChildrenOrdering(): IOrdering | undefined {\r\n return this.userOrderings.length === 0 || !this.userOrderings[0] ? undefined : this.userOrderings[0];\r\n }\r\n\r\n getOrdering(column: string): IOrderByColumnSetting {\r\n const ordIndex = this.orderings.findIndex((item) => item.columnId === column);\r\n if (ordIndex === -1) {\r\n return {\r\n order: 0,\r\n ordering: IOrderByDirection.NONE,\r\n };\r\n } else {\r\n return {\r\n order: ordIndex,\r\n ordering: this.orderings[ordIndex].direction,\r\n };\r\n }\r\n }\r\n\r\n private newOrdering(columnId: string, direction: IOrderByDirection): IOrdering {\r\n const property = getProperties(this).find((prop) => prop.id === columnId);\r\n const lookupId = property && property.lookup && property.lookup.lookupId;\r\n return {\r\n columnId: columnId,\r\n direction: direction,\r\n lookupId: lookupId,\r\n };\r\n }\r\n\r\n @action.bound\r\n setOrdering(columnId: string): void {\r\n const orderingClone = _.cloneDeep(this.userOrderings);\r\n const curOrd = this.userOrderings.find((item) => item.columnId === columnId);\r\n this.userOrderings.length = 0;\r\n if (!curOrd) {\r\n this.userOrderings.push(this.newOrdering(columnId, IOrderByDirection.ASC));\r\n } else {\r\n this.userOrderings.push(this.newOrdering(columnId, flipOrdering(curOrd.direction)));\r\n }\r\n\r\n if (!_.isEqual(orderingClone, this.userOrderings)) {\r\n this.maybeApplyOrdering();\r\n }\r\n }\r\n\r\n @action.bound\r\n addOrdering(columnId: string): void {\r\n const orderingClone = _.cloneDeep(this.userOrderings);\r\n const curOrd = this.userOrderings.find((item) => item.columnId === columnId);\r\n if (!curOrd) {\r\n this.userOrderings.push(this.newOrdering(columnId, IOrderByDirection.ASC));\r\n } else {\r\n curOrd.direction = cycleOrdering(curOrd.direction);\r\n }\r\n\r\n if (!_.isEqual(orderingClone, this.userOrderings)) {\r\n this.maybeApplyOrdering();\r\n }\r\n }\r\n\r\n maybeApplyOrdering = flow(\r\n function*(this: OrderingConfiguration) {\r\n const dataView = getDataView(this);\r\n const dataTable = getDataTable(dataView);\r\n if (!dataView.isLazyLoading) {\r\n const comboProps = this.userOrderings\r\n .map((term) => getDataViewPropertyById(this, term.columnId)!)\r\n .filter((prop) => prop.column === \"ComboBox\");\r\n\r\n yield Promise.all(\r\n comboProps.map(async (prop) => {\r\n return prop.lookupEngine?.lookupResolver.resolveList(\r\n dataTable.getAllValuesOfProp(prop)\r\n );\r\n })\r\n );\r\n }\r\n }.bind(this)\r\n );\r\n\r\n @computed get orderingFunction(): () => (row1: any[], row2: any[]) => number {\r\n return () => (row1: any[], row2: any) => {\r\n const dataTable = getDataTable(this);\r\n let mul = 10 * this.orderings.length;\r\n let res = 0;\r\n for (let term of this.orderings) {\r\n const prop = dataTable.getPropertyById(term.columnId)!;\r\n let cmpSign = 0;\r\n switch (prop.column) {\r\n case \"Text\":\r\n case \"Date\":\r\n case \"ComboBox\":\r\n const txt1 = dataTable.getOriginalCellText(row1, prop);\r\n const txt2 = dataTable.getOriginalCellText(row2, prop);\r\n cmpSign = compareStrings(txt1, txt2);\r\n break;\r\n case \"CheckBox\": {\r\n const val1 = dataTable.getOriginalCellValue(row1, prop);\r\n const val2 = dataTable.getOriginalCellValue(row2, prop);\r\n cmpSign = compareStrings(`${val1}`, `${val2}`);\r\n break;\r\n }\r\n case \"Number\": {\r\n const val1 = dataTable.getOriginalCellValue(row1, prop);\r\n const val2 = dataTable.getOriginalCellValue(row2, prop);\r\n if (val1 === null) {\r\n cmpSign = 1;\r\n } else if (val2 === null) {\r\n cmpSign = -1;\r\n } else {\r\n cmpSign = Math.sign(val1 - val2);\r\n }\r\n break;\r\n }\r\n }\r\n res = res + mul * (term.direction === IOrderByDirection.DESC ? -1 : 1) * cmpSign;\r\n mul = mul / 10;\r\n }\r\n return res;\r\n };\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IPropertyColumn {\r\n Text = \"Text\",\r\n ComboBox = \"ComboBox\",\r\n TagInput = \"TagInput\",\r\n Date = \"Date\",\r\n Number = \"Number\",\r\n CheckBox = \"CheckBox\",\r\n CheckList = \"Checklist\",\r\n Image = \"Image\",\r\n Blob = \"Blob\",\r\n Polymorph = \"Polymorph\",\r\n Color = \"Color\"\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDockType, IProperty, IPropertyData } from \"./types/IProperty\";\r\nimport { ICaptionPosition } from \"./types/ICaptionPosition\";\r\nimport { IPropertyColumn } from \"./types/IPropertyColumn\";\r\nimport { action, computed, observable } from \"mobx\";\r\n\r\nimport { ILookup } from \"./types/ILookup\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { IDataSourceField } from \"./types/IDataSourceField\";\r\nimport { LookupResolver } from \"modules/Lookup/LookupResolver\";\r\nimport { LookupLabelsCleanerReloader } from \"modules/Lookup/LookupCleanerLoader\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\n\r\nexport class Property implements IProperty {\r\n $type_IProperty: 1 = 1;\r\n\r\n constructor(data: IPropertyData) {\r\n Object.assign(this, data);\r\n if (this.lookup) {\r\n this.lookup.parent = this;\r\n }\r\n }\r\n\r\n autoSort: boolean = false;\r\n id: string = \"\";\r\n tabIndex: string | undefined;\r\n modelInstanceId: string = \"\";\r\n name: string = \"\";\r\n nameOverride: string | null | undefined = null;\r\n readOnly: boolean = false;\r\n x: number = 0;\r\n y: number = 0;\r\n width: number = 0;\r\n height: number = 0;\r\n captionLength: number = 0;\r\n captionPosition?: ICaptionPosition;\r\n entity: string = \"\";\r\n column: IPropertyColumn = IPropertyColumn.Text;\r\n dock?: IDockType | undefined;\r\n multiline: boolean = false;\r\n isPassword: boolean = false;\r\n isRichText: boolean = false;\r\n maxLength: number = 0;\r\n allowReturnToForm?: boolean | undefined;\r\n isTree?: boolean | undefined;\r\n formatterPattern: string = \"\";\r\n modelFormatterPattern: string = \"\";\r\n customNumericFormat: string = \"\";\r\n gridColumnWidth: number = 100;\r\n @observable columnWidth: number = 100;\r\n identifier?: string;\r\n lookup?: ILookup;\r\n lookupId?: string;\r\n lookupEngine?: ILookupIndividualEngine = null as any;\r\n childProperties: IProperty[] = [];\r\n isAggregatedColumn: boolean = false;\r\n isLookupColumn: boolean = false;\r\n style: any;\r\n controlPropertyId?: string;\r\n toolTip: string = null as any;\r\n suppressEmptyColumns: boolean = false;\r\n supportsServerSideSorting: boolean = false;\r\n\r\n linkToMenuId?: string = undefined;\r\n linkDependsOnValue: boolean = false;\r\n fieldType: string = null as any;\r\n isFormField: boolean = false;\r\n\r\n get isLookup() {\r\n return !!this.lookup;\r\n }\r\n\r\n get isLink() {\r\n return !!this.linkToMenuId || this.linkDependsOnValue;\r\n }\r\n\r\n @action.bound setColumnWidth(width: number) {\r\n this.columnWidth = width;\r\n }\r\n\r\n @computed get dataSourceIndex(): number {\r\n return this.dataSourceField.index;\r\n }\r\n\r\n @computed get dataIndex() {\r\n return this.dataSourceIndex;\r\n }\r\n\r\n @computed get dataSourceField(): IDataSourceField {\r\n return getDataSourceFieldByName(this, this.id)!;\r\n }\r\n\r\n @action.bound\r\n stop() {\r\n\r\n }\r\n\r\n parent: any;\r\n xmlNode = undefined;\r\n\r\n getPolymophicProperty(row: any[]): IProperty {\r\n const dataSourceField = getDataSourceFieldByName(this, this.controlPropertyId!)!;\r\n const controlPropertyValue = getDataTable(this)\r\n .getCellValueByDataSourceField(row, dataSourceField);\r\n return this.childProperties\r\n .find(prop => prop.controlPropertyValue === controlPropertyValue)\r\n ?? this;\r\n }\r\n}\r\n\r\n\r\nexport interface ILookupIndividualEngine {\r\n lookupResolver: LookupResolver;\r\n lookupCleanerReloader: LookupLabelsCleanerReloader;\r\n\r\n startup(): void;\r\n\r\n teardown(): void;\r\n\r\n cleanAndReload(): void;\r\n};","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApplication } from \"../getApplication\";\r\n\r\nexport function getDialogStack(ctx?: any) {\r\n return getApplication(ctx).dialogStack;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum AggregationType { SUM = \"SUM\", AVG = \"AVG\", MIN = \"MIN\", MAX = \"MAX\", COUNT = \"COUNT\"}\r\n\r\nexport function tryParseAggregationType(candidate: any | undefined) {\r\n if (!candidate || candidate === \"0\") return undefined;\r\n return parseAggregationType(candidate);\r\n}\r\n\r\n\r\nexport function aggregationTypeToNumber(aggregationType: AggregationType | undefined) {\r\n switch (aggregationType) {\r\n case undefined:\r\n return 0;\r\n case AggregationType.SUM:\r\n return 1;\r\n case AggregationType.AVG:\r\n return 2;\r\n case AggregationType.MIN:\r\n return 3;\r\n case AggregationType.MAX:\r\n return 4;\r\n case AggregationType.COUNT:\r\n return 5;\r\n default:\r\n throw new Error(\"Cannot map \\\"\" + aggregationType + \"\\\" to number\")\r\n }\r\n}\r\n\r\nexport function parseAggregationType(candidate: any | undefined) {\r\n if (typeof candidate !== 'string') {\r\n throw new Error(\"Cannot map \\\"\" + candidate + \"\\\" to AggregationType\")\r\n }\r\n\r\n switch ((candidate as string).toUpperCase()) {\r\n case \"1\":\r\n case \"SUM\":\r\n return AggregationType.SUM;\r\n case \"2\":\r\n case \"AVG\":\r\n return AggregationType.AVG;\r\n case \"3\":\r\n case \"MIN\":\r\n return AggregationType.MIN;\r\n case \"4\":\r\n case \"MAX\":\r\n return AggregationType.MAX;\r\n case \"5\":\r\n case \"COUNT\":\r\n return AggregationType.COUNT;\r\n default:\r\n throw new Error(\"Cannot map \\\"\" + candidate + \"\\\" to AggregationType\")\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function ValueBox() {\r\n let _active = false;\r\n let _value: T | undefined;\r\n\r\n function get() {\r\n if (_active) return _value!;\r\n throw new Error(\"Value not set.\");\r\n }\r\n\r\n function set(value: T) {\r\n if (_active) throw new Error(\"Value already set.\");\r\n _value = value;\r\n _active = true;\r\n }\r\n\r\n function clear() {\r\n _value = undefined;\r\n _active = false;\r\n }\r\n\r\n get.get = get;\r\n get.set = set;\r\n get.clear = clear;\r\n\r\n return get;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function Memoized(valueFn: () => T) {\r\n\r\n let _computed = false;\r\n let _value: T | undefined;\r\n\r\n function get(): T {\r\n if (_computed) return _value!;\r\n _computed = true;\r\n return (_value = valueFn());\r\n }\r\n\r\n function clear() {\r\n _value = undefined;\r\n _computed = false;\r\n }\r\n\r\n get.get = get;\r\n get.clear = clear;\r\n\r\n return get;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { ValueBox } from \"./common/ValueBox\";\r\nimport { IClickSubsItem, IMouseOverSubsItem, ITableRow } from \"./types\";\r\nimport { Memoized } from \"./common/Memoized\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getIsSelectionCheckboxesShown } from \"model/selectors/DataView/getIsSelectionCheckboxesShown\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\n\r\nexport const scRenderTable: Array<() => void> = [];\r\nexport const scRenderRow: Array<() => void> = [];\r\nexport const scRenderCell: Array<() => void> = [];\r\n\r\nexport const context = ValueBox();\r\nscRenderTable.push(() => context.clear());\r\n\r\nexport const context2d = ValueBox();\r\nscRenderTable.push(() => context2d.clear());\r\n\r\nexport const rowIndex = ValueBox();\r\nscRenderRow.push(() => rowIndex.clear());\r\n\r\nlet currentRowRightBorderDrawn = false;\r\n\r\nexport function setCurrentRowRightBorderDrawn(value: boolean) {\r\n currentRowRightBorderDrawn = value;\r\n}\r\n\r\nexport function getCurrentRowRightBorderDrawn() {\r\n return currentRowRightBorderDrawn;\r\n}\r\n\r\nexport const rowId = () => dataTable().getRowId(currentDataRow());\r\n\r\nexport const selectionColumnShown = () => getIsSelectionCheckboxesShown(context());\r\n\r\nexport const dataCellOffset = () => {\r\n let offset = groupingColumnCount();\r\n if (selectionColumnShown()) {\r\n offset++;\r\n }\r\n return offset;\r\n}\r\n\r\nexport const drawingColumnIndex = ValueBox();\r\nscRenderCell.push(() => drawingColumnIndex.clear());\r\n\r\nexport const tableRows = ValueBox();\r\nscRenderTable.push(() => tableRows.clear());\r\n\r\nexport const viewportWidth = ValueBox();\r\nscRenderTable.push(() => viewportWidth.clear());\r\n\r\nexport const viewportHeight = ValueBox();\r\nscRenderTable.push(() => viewportHeight.clear());\r\n\r\nexport const scrollLeft = ValueBox();\r\nscRenderTable.push(() => scrollLeft.clear());\r\n\r\nexport const scrollTop = ValueBox();\r\nscRenderTable.push(() => scrollTop.clear());\r\n\r\nexport const viewportLeft = scrollLeft;\r\n\r\nexport const viewportTop = scrollTop;\r\n\r\nexport const viewportRight = () => viewportLeft() + viewportWidth();\r\n\r\nexport const viewportBottom = () => viewportTop() + viewportHeight();\r\n\r\nexport const worldWidth = Memoized(() => gridLeadCellDimensions().slice(-1)[0].right);\r\nscRenderTable.push(() => worldWidth.clear());\r\n\r\nexport const worldHeight = Memoized(() => tableRowsCount() * rowHeight());\r\nscRenderTable.push(() => worldHeight.clear());\r\n\r\nexport const rowHeight = ValueBox();\r\nscRenderTable.push(() => rowHeight.clear());\r\n\r\nexport const tableColumnIds = ValueBox();\r\nscRenderTable.push(() => tableColumnIds.clear());\r\n\r\nexport const groupingColumnIds = ValueBox();\r\nscRenderTable.push(() => groupingColumnIds.clear());\r\n\r\nexport const groupingColumnCount = () => groupingColumnIds().length;\r\n\r\nexport const isGrouping = () => groupingColumnIds().length > 0;\r\n\r\nexport function currentRow(): ITableRow {\r\n return tableRows()[rowIndex()];\r\n}\r\n\r\nexport function currentDataRow(): any[] {\r\n return currentRow() as any[];\r\n}\r\n\r\nexport const isCheckBoxedTable = ValueBox();\r\nscRenderTable.push(isCheckBoxedTable.clear);\r\n\r\nexport const fixedColumnCount = ValueBox();\r\nscRenderTable.push(fixedColumnCount.clear);\r\n\r\nexport const columnWidths = ValueBox>();\r\nscRenderTable.push(columnWidths.clear);\r\n\r\nexport const realFixedColumnCount = () =>\r\n isCheckBoxedTable() ? fixedColumnCount() + 1 : fixedColumnCount();\r\n\r\nexport const gridLeadCellDimensions = ValueBox<{ left: number; width: number; right: number }[]>();\r\nscRenderTable.push(gridLeadCellDimensions.clear);\r\n\r\nexport const propertyById = ValueBox>();\r\nscRenderTable.push(propertyById.clear);\r\n\r\nexport const tableRowsCount = () => tableRows().length;\r\n\r\nexport const clickSubscriptions = ValueBox();\r\nscRenderTable.push(() => {\r\n clickSubscriptions.clear();\r\n});\r\n\r\nexport const mouseMoveSubscriptions = ValueBox();\r\nscRenderTable.push(() => {\r\n mouseMoveSubscriptions.clear();\r\n});\r\n\r\nexport const mouseOverSubscriptions = ValueBox();\r\nscRenderTable.push(mouseOverSubscriptions.clear);\r\n\r\nexport const tablePanelView = () => getTablePanelView(context());\r\n// export const property = () => getTableViewPropertyById(tablePanelView(), dataRowColumnIds()[drawingColumnIndex()]!);// currentColumnId()!);\r\n//export const property = () => getTableViewPropertyByIdx(tablePanelView(), drawingColumnIndex() - realFixedColumnCount());// currentColumnId()!);\r\n\r\nexport const dataTable = () => getDataTable(tablePanelView());\r\nexport const dataView = () => getDataView(context());\r\nexport const recordId = () => dataTable().getRowId(currentDataRow());\r\n\r\nexport const formScreen = () => getFormScreen(context());\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getDataSourceFieldByName } from \"../DataSources/getDataSourceFieldByName\";\r\nimport { getDataTable } from \"./getDataTable\";\r\n\r\nexport function getFieldErrorMessage(ctx: any) {\r\n return function getFieldErrorMessage(row: any[], property: IProperty) {\r\n if (row) {\r\n const dataTable = getDataTable(ctx);\r\n const dsFieldErrors = getDataSourceFieldByName(ctx, \"__Errors\");\r\n const errors = dsFieldErrors\r\n ? dataTable.getCellValueByDataSourceField(row, dsFieldErrors)\r\n : null;\r\n\r\n const errMap: Map | undefined = errors\r\n ? new Map(\r\n Object.entries(\r\n errors.fieldErrors\r\n ).map(([dsIndexStr, errMsg]: [string, string]) => [parseInt(dsIndexStr, 10), errMsg])\r\n )\r\n : undefined;\r\n\r\n const errMsg = dsFieldErrors && errMap ? errMap.get(property.dataSourceIndex) : undefined;\r\n return errMsg;\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateAllowRead(\r\n ctx: any,\r\n rowId: string,\r\n columnId: string\r\n) {\r\n const rowState = getRowStateById(ctx, rowId);\r\n const column = rowState ? rowState.columns.get(columnId) : undefined;\r\n const allowRead = column ? column.allowRead : undefined;\r\n return allowRead !== undefined ? allowRead : true;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateForegroundColor(ctx: any, rowId: string) {\r\n const rowState = getRowStateById(ctx, rowId);\r\n const rowStateForegroundColor = rowState ? rowState.foregroundColor : undefined;\r\n if (rowStateForegroundColor) {\r\n return rowStateForegroundColor;\r\n }\r\n return rowState ? rowState.foregroundColor : undefined;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateRowBgColor(ctx: any, rowId: string | undefined) {\r\n if (rowId === undefined) {\r\n return undefined;\r\n }\r\n const rowState = getRowStateById(ctx, rowId);\r\n const rowStateBackgroundColor = rowState\r\n ? rowState.backgroundColor\r\n : undefined;\r\n return rowStateBackgroundColor;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nconst canvas = document.createElement(\"canvas\");\r\nconst context = canvas.getContext(\"2d\") as any;\r\n\r\nexport function getCanvasPixelRatio() {\r\n const devicePixelRatio = window.devicePixelRatio || 1;\r\n const backingStoreRatio =\r\n context!.webkitBackingStorePixelRatio ||\r\n context!.mozBackingStorePixelRatio ||\r\n context!.msBackingStorePixelRatio ||\r\n context!.oBackingStorePixelRatio ||\r\n context!.backingStorePixelRatio ||\r\n 1;\r\n\r\n const ratio = devicePixelRatio / backingStoreRatio;\r\n return ratio;\r\n}\r\n\r\n\r\nexport const CPR = () => getCanvasPixelRatio();\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function shadeHexColor(color: string | undefined, percent: number) {\r\n if (color === undefined) {\r\n return undefined;\r\n }\r\n // eslint-disable-next-line no-mixed-operators\r\n var f = parseInt(color.slice(1), 16), t = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent,\r\n R = f >> 16, G = f >> 8 & 0x00FF, B = f & 0x0000FF;\r\n return \"#\" + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + (Math.round((t - B) * p) + B)).toString(16).slice(1);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { CriticalSection } from \"utils/sync\";\r\n\r\nexport const crs_fieldBlur_ActionClick = new CriticalSection();\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport actions from \"./actions\";\r\nimport columnConfigurationDialog from './columnConfigurationDialog';\r\nimport dataView from './dataView';\r\nimport formView from './formView';\r\nimport loginPage from './loginPage';\r\nimport mainMenu from './mainMenu';\r\nimport screenHeader from './screenHeader';\r\nimport screenTabHandleRow from './screenTabHandleRow';\r\nimport screenToolbar from './screenToolbar';\r\nimport selectionDialog from './selectionDialog';\r\nimport splitter from './splitter';\r\nimport tableView from './tableView';\r\nimport workQueues from './workQueues';\r\nimport workflow from './workflow';\r\n\r\nexport default {\r\n actions,\r\n columnConfigurationDialog,\r\n dataView,\r\n formView,\r\n loginPage,\r\n mainMenu,\r\n screenHeader,\r\n screenTabHandleRow,\r\n screenToolbar,\r\n selectionDialog,\r\n splitter,\r\n tableView,\r\n workQueues,\r\n workflow\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { IAction, IActionMode } from \"model/entities/types/IAction\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getGridId } from \"model/selectors/DataView/getGridId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nimport selectors from \"model/selectors-tree\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { crs_fieldBlur_ActionClick } from \"model/actions/actionSync\";\r\n\r\nexport default {\r\n onActionClick(ctx: any) {\r\n return flow(function*onActionClick(event: any, action: IAction) {\r\n try {\r\n yield*crs_fieldBlur_ActionClick.runGenerator(function*() {\r\n if (!action.isEnabled) {\r\n return;\r\n }\r\n getDataView(ctx).formFocusManager.stopAutoFocus();\r\n const lifecycle = getFormScreenLifecycle(ctx);\r\n const gridId = getGridId(ctx);\r\n const entity = getEntity(ctx);\r\n const rowId = getSelectedRowId(ctx);\r\n switch (action.mode) {\r\n case IActionMode.Always:\r\n yield*lifecycle.onExecuteAction(gridId, entity, action, []);\r\n break;\r\n case IActionMode.ActiveRecord:\r\n if (rowId) {\r\n yield*lifecycle.onExecuteAction(gridId, entity, action, [rowId]);\r\n }\r\n break;\r\n case IActionMode.MultipleCheckboxes:\r\n const selectedRowIds = selectors.selectionCheckboxes.getSelectedRowIds(ctx);\r\n yield*lifecycle.onExecuteAction(gridId, entity, action, Array.from(selectedRowIds));\r\n break;\r\n }\r\n });\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n },\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport default {\r\n onCloseClick(ctx: any) {\r\n return flow(function*onCancelClick(event: any) {\r\n try {\r\n const lifecycle = getFormScreenLifecycle(ctx);\r\n yield*lifecycle.onWorkflowCloseClick(event);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n },\r\n\r\n onRepeatClick(ctx: any) {\r\n return flow(function*onRepeatClick(event: any) {\r\n try {\r\n const lifecycle = getFormScreenLifecycle(ctx);\r\n yield*lifecycle.onWorkflowRepeatClick(event);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n },\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { clickSubscriptions, mouseMoveSubscriptions, mouseOverSubscriptions, } from \"./renderingValues\";\r\nimport { IClickSubsItem, IMouseOverSubsItem } from \"./types\";\r\n\r\nexport function onClick(item: IClickSubsItem) {\r\n clickSubscriptions().push(item);\r\n}\r\n\r\nexport function handleTableClick(\r\n event: any,\r\n canvasX: number,\r\n canvasY: number,\r\n scrollLeft: number,\r\n scrollTop: number,\r\n clickSubscriptions: IClickSubsItem[]\r\n) {\r\n let handled = false;\r\n for (let h of clickSubscriptions) {\r\n if (h.x <= canvasX && h.x + h.w >= canvasX && h.y <= canvasY && h.y + h.h >= canvasY) {\r\n h.handler(event, canvasX, canvasY, canvasX, canvasY);\r\n handled = true;\r\n break;\r\n }\r\n }\r\n return {handled};\r\n}\r\n\r\nexport function onMouseMove(item: IClickSubsItem) {\r\n mouseMoveSubscriptions().push(item);\r\n}\r\n\r\nexport function handleTableMouseMove(\r\n event: any,\r\n canvasX: number,\r\n canvasY: number,\r\n scrollLeft: number,\r\n scrollTop: number,\r\n mouseMoveSubscriptions: IClickSubsItem[]\r\n) {\r\n let handled = false;\r\n for (let h of mouseMoveSubscriptions) {\r\n if (h.x <= canvasX && h.x + h.w >= canvasX && h.y <= canvasY && h.y + h.h >= canvasY) {\r\n h.handler(event, canvasX, canvasY, canvasX, canvasY);\r\n handled = true;\r\n break;\r\n }\r\n }\r\n return {handled};\r\n}\r\n\r\nexport function onMouseOver(item: IMouseOverSubsItem) {\r\n mouseOverSubscriptions().push(item);\r\n}\r\n\r\nexport function getTooltip(\r\n canvasX: number,\r\n canvasY: number,\r\n mouseOverSubscriptions: IMouseOverSubsItem[]\r\n) {\r\n for (let h of mouseOverSubscriptions) {\r\n if (h.x <= canvasX && h.x + h.w >= canvasX && h.y <= canvasY && h.y + h.h >= canvasY) {\r\n return h.toolTipGetter(canvasX, canvasY, canvasX, canvasY);\r\n }\r\n }\r\n return undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {getDataView} from \"model/selectors/DataView/getDataView\";\r\nimport _ from \"lodash\";\r\n\r\nexport function clearTableDebugValues(ctx: any){\r\n const dataView = getDataView(ctx);\r\n const tableId = dataView.modelInstanceId;\r\n const win = (window as any);\r\n if(win.tableDebugMonitor && win.tableDebugMonitor[tableId]){\r\n win.tableDebugMonitor[tableId].data = [];\r\n }\r\n}\r\nexport const setTableDebugRendered = _.debounce(setRenderedInternal, 200);\r\n\r\nfunction ensureTableDataExists(win: any, tableId: string) {\r\n if (!win.tableDebugMonitor) {\r\n win.tableDebugMonitor = {};\r\n }\r\n if (!win.tableDebugMonitor[tableId]) {\r\n win.tableDebugMonitor[tableId] = {\r\n data: [],\r\n rendered: false\r\n }\r\n }\r\n}\r\n\r\nexport function setRenderedInternal(ctx: any){\r\n const dataView = getDataView(ctx);\r\n const tableId = dataView.modelInstanceId;\r\n const win = (window as any);\r\n ensureTableDataExists(win, tableId);\r\n win.tableDebugMonitor[tableId].rendered = true;\r\n}\r\n\r\nexport function setTableDebugValue(ctx: any, propertyId: string | null, rowIndex: number, value: any){\r\n if(propertyId == null){\r\n return;\r\n }\r\n const dataView = getDataView(ctx);\r\n const tableId = dataView.modelInstanceId;\r\n const win = (window as any);\r\n ensureTableDataExists(win, tableId);\r\n if(!win.tableDebugMonitor[tableId].data[rowIndex]){\r\n win.tableDebugMonitor[tableId].data[rowIndex] = {};\r\n }\r\n win.tableDebugMonitor[tableId].data[rowIndex][propertyId] = value;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n cellPaddingLeft,\r\n cellPaddingRight,\r\n numberCellPaddingRight\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon\";\r\nimport { getPaddingLeft } from \"gui/Components/ScreenElements/Table/TableRendering/cells/dataCellRenderer\";\r\n\r\nexport class CellAlignment {\r\n\r\n paddingRight: number;\r\n paddingLeft: number;\r\n alignment: string;\r\n\r\n constructor(isFirstColumn: boolean, type: string, style: ({ [key: string]: string }) | undefined) {\r\n\r\n if (style?.[\"textAlign\"]) {\r\n if (style[\"textAlign\"] === \"center\") {\r\n this.paddingRight = 0;\r\n this.paddingLeft = 0;\r\n this.alignment = \"center\";\r\n } else if (style[\"textAlign\"] === \"left\") {\r\n this.paddingRight = cellPaddingRight;\r\n this.paddingLeft = getPaddingLeft(isFirstColumn);\r\n this.alignment = \"left\";\r\n } else if (style[\"textAlign\"] === \"right\") {\r\n this.paddingRight = numberCellPaddingRight;\r\n this.paddingLeft = cellPaddingLeft;\r\n this.alignment = \"right\";\r\n } else {\r\n throw new Error(`textAlign ${style[\"textAlign\"]} not implemented`);\r\n }\r\n return;\r\n }\r\n\r\n switch (type) {\r\n case \"Number\":\r\n this.paddingRight = numberCellPaddingRight;\r\n this.paddingLeft = cellPaddingLeft;\r\n this.alignment = \"right\";\r\n break;\r\n default:\r\n this.paddingRight = cellPaddingRight;\r\n this.paddingLeft = getPaddingLeft(isFirstColumn);\r\n this.alignment = \"left\";\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n currentCellText,\r\n currentCellValue,\r\n currentColumnId,\r\n currentColumnLeft,\r\n currentColumnWidth,\r\n currentProperty,\r\n currentRowHeight,\r\n currentRowTop,\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/currentCell\";\r\nimport {\r\n cellPaddingLeft,\r\n cellPaddingLeftFirstCell,\r\n cellPaddingRight,\r\n checkBoxCharacterFontSize,\r\n numberCellPaddingRight,\r\n topTextOffset,\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport moment from \"moment\";\r\nimport selectors from \"model/selectors-tree\";\r\nimport {\r\n context,\r\n drawingColumnIndex,\r\n formScreen,\r\n rowHeight,\r\n rowIndex,\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/renderingValues\";\r\nimport { flashColor2htmlColor } from \"utils/flashColorFormat\";\r\nimport { setTableDebugValue } from \"gui/Components/ScreenElements/Table/TableRendering/DebugTableMonitor\";\r\nimport { CellAlignment } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellAlignment\";\r\n\r\ninterface IDataCellRenderer {\r\n drawCellText(): void;\r\n cellText: string | undefined;\r\n}\r\n\r\nexport function currentDataCellRenderer(ctx2d: CanvasRenderingContext2D) {\r\n let property = currentProperty();\r\n const type = property.column;\r\n const cellAlignment = new CellAlignment( drawingColumnIndex() === 0, type, property.style);\r\n switch (type) {\r\n case \"CheckBox\":\r\n return new CheckBoxCellRenderer(ctx2d);\r\n case \"Date\":\r\n return new DateCellRenderer(ctx2d);\r\n case \"TagInput\":\r\n return new TagInputCellRenderer(ctx2d);\r\n case \"ComboBox\":\r\n case \"Checklist\":\r\n return new CheckListCellRenderer(ctx2d);\r\n case \"Number\":\r\n return new GenericCellRenderer(ctx2d, property.style, cellAlignment);\r\n case \"Image\":\r\n return new ImageCellRenderer(ctx2d);\r\n case \"Color\":\r\n return new ColorCellRenderer(ctx2d);\r\n default:\r\n return new GenericCellRenderer(ctx2d, property.style, cellAlignment);\r\n }\r\n}\r\n\r\nclass ColorCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n cellText = \"\";\r\n\r\n drawCellText(): void {\r\n this.ctx2d.fillStyle = flashColor2htmlColor(currentCellValue()) || \"black\";\r\n this.ctx2d.fillRect(\r\n (currentColumnLeft() + 3) * CPR(),\r\n (currentRowTop() + 3) * CPR(),\r\n (currentColumnWidth() - 2 * 3) * CPR(),\r\n (currentRowHeight() - 2 * 3) * CPR()\r\n );\r\n }\r\n}\r\n\r\nclass CheckBoxCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n get cellText() {\r\n return currentCellText();\r\n }\r\n\r\n drawCellText(): void {\r\n this.ctx2d.font = `${checkBoxCharacterFontSize * CPR()}px \"Font Awesome 5 Free\"`;\r\n this.ctx2d.textAlign = \"center\";\r\n this.ctx2d.textBaseline = \"middle\";\r\n\r\n this.ctx2d.fillText(\r\n !!this.cellText ? \"\\uf14a\" : \"\\uf0c8\",\r\n CPR() * xCenter(),\r\n CPR() * (currentRowTop() + topTextOffset - 5)\r\n );\r\n setTableDebugValue(context(), currentColumnId(), rowIndex(), this.cellText);\r\n }\r\n}\r\n\r\nclass DateCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n get cellText() {\r\n if (currentCellText() !== null && currentCellText() !== \"\") {\r\n let momentValue = moment(currentCellText());\r\n if (!momentValue.isValid()) {\r\n return undefined;\r\n }\r\n return momentValue.format(currentProperty().formatterPattern);\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n drawCellText(): void {\r\n const dateTimeText = this.cellText;\r\n if (dateTimeText) {\r\n this.ctx2d.fillText(\r\n dateTimeText,\r\n CPR() * (currentColumnLeft() + getPaddingLeft()),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n }\r\n setTableDebugValue(context(), currentColumnId(), rowIndex(), dateTimeText);\r\n }\r\n}\r\n\r\nclass TagInputCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n get cellText() {\r\n return currentCellText();\r\n }\r\n\r\n drawCellText(): void {\r\n if (this.cellText !== null) {\r\n this.ctx2d.fillText(\r\n \"\" + this.cellText!,\r\n CPR() * (currentColumnLeft() + getPaddingLeft()),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n }\r\n setTableDebugValue(context(), currentColumnId(), rowIndex(), this.cellText);\r\n }\r\n}\r\n\r\nclass CheckListCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n get cellText() {\r\n return currentCellText();\r\n }\r\n\r\n drawCellText(): void {\r\n let isLink = false;\r\n const property = currentProperty();\r\n if (property.isLookup && property.lookupEngine) {\r\n isLink = selectors.column.isLinkToForm(currentProperty());\r\n }\r\n\r\n if (isLink) {\r\n this.ctx2d.save();\r\n this.ctx2d.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--foreground1');\r\n }\r\n if (currentCellText() !== null) {\r\n this.ctx2d.fillText(\r\n \"\" + currentCellText()!,\r\n CPR() * (currentColumnLeft() + getPaddingLeft()),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n }\r\n setTableDebugValue(context(), currentColumnId(), rowIndex(), currentCellText());\r\n if (isLink) {\r\n this.ctx2d.restore();\r\n }\r\n }\r\n}\r\n\r\nclass ImageCellRenderer implements IDataCellRenderer {\r\n constructor(private ctx2d: CanvasRenderingContext2D) {\r\n }\r\n\r\n get cellText() {\r\n return currentCellText();\r\n }\r\n\r\n drawCellText(): void {\r\n const value = currentCellValue();\r\n if (!value) {\r\n return;\r\n }\r\n const {pictureCache} = formScreen();\r\n const img = pictureCache.getImage(value);\r\n\r\n if (!img || !img.complete) {\r\n return;\r\n }\r\n const property = currentProperty();\r\n const iw = img.width;\r\n const ih = img.height;\r\n const cw = property.columnWidth;\r\n const ch = property.height;\r\n const WR = cw / iw;\r\n const HR = ch / ih;\r\n let ratio = 0;\r\n if (Math.abs(1 - WR) < Math.abs(1 - HR)) {\r\n ratio = WR;\r\n } else {\r\n ratio = HR;\r\n }\r\n const finIW = ratio * iw;\r\n const finIH = ratio * ih;\r\n this.ctx2d.drawImage(\r\n img,\r\n CPR() * (xCenter() - finIW * 0.5),\r\n CPR() * (yCenter() - finIH * 0.5),\r\n CPR() * finIW,\r\n CPR() * finIH\r\n );\r\n }\r\n}\r\n\r\nclass GenericCellRenderer implements IDataCellRenderer {\r\n constructor(\r\n private ctx2d: CanvasRenderingContext2D,\r\n private style: ({[key: string]: string}) | undefined,\r\n private cellAlignment: CellAlignment) {\r\n }\r\n\r\n get cellText() {\r\n return currentCellText();\r\n }\r\n\r\n drawCellText(): void {\r\n if (currentCellText() !== null) {\r\n if (!currentProperty().isPassword) {\r\n this.ctx2d.font = getCustomTextStyle(this.style, this.ctx2d);\r\n let x = getCellXCoordinate(this.cellAlignment);\r\n this.ctx2d.textAlign = this.cellAlignment.alignment as CanvasTextAlign;\r\n this.ctx2d.fillText(\r\n \"\" + currentCellText()!,\r\n CPR() * x,\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n } else {\r\n this.ctx2d.fillText(\"*******\", numberCellPaddingRight * CPR(), 15 * CPR());\r\n }\r\n }\r\n setTableDebugValue(context(), currentColumnId(), rowIndex(), currentCellText())\r\n }\r\n}\r\n\r\nexport function getPaddingLeft(isFirstColumn?: boolean) {\r\n if(isFirstColumn === undefined){\r\n isFirstColumn = drawingColumnIndex() === 0\r\n }\r\n return isFirstColumn ? cellPaddingLeftFirstCell : cellPaddingLeft;\r\n}\r\n\r\nexport function getPaddingRight() {\r\n return cellPaddingRight;\r\n}\r\n\r\nexport function xCenter() {\r\n return currentColumnLeft() + currentColumnWidth() / 2;\r\n}\r\n\r\nexport function yCenter() {\r\n return currentRowTop() + rowHeight() / 2;\r\n}\r\n\r\nfunction getCustomTextStyle(style: ({[key: string]: string}) | undefined, ctx2d: CanvasRenderingContext2D){\r\n if(style?.[\"fontWeight\"] === \"bold\"){\r\n return \"bold \" + ctx2d.font\r\n }\r\n return ctx2d.font;\r\n}\r\n\r\nfunction getCellXCoordinate(cellAlignment: CellAlignment){\r\n\r\n if(cellAlignment.alignment === \"center\") {\r\n return xCenter() ;\r\n }\r\n else if(cellAlignment.alignment === \"right\"){\r\n return currentColumnLeft() + currentColumnWidth() - cellAlignment.paddingRight;\r\n }\r\n else {\r\n return currentColumnLeft() + cellAlignment.paddingLeft;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getRowStateAllowRead } from \"model/selectors/RowState/getRowStateAllowRead\";\r\nimport { getRowStateForegroundColor } from \"model/selectors/RowState/getRowStateForegroundColor\";\r\nimport { getRowStateRowBgColor } from \"model/selectors/RowState/getRowStateRowBgColor\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { shadeHexColor } from \"utils/colorUtils\";\r\nimport actionsUi from \"model/actions-ui-tree\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getShowToolTipsForMemoFieldsOnly } from \"model/selectors/Workbench/getShowToolTipsForMemoFieldsOnly\";\r\nimport {\r\n currentCellErrorMessage,\r\n currentColumnLeft,\r\n currentColumnLeftVisible,\r\n currentColumnWidth,\r\n currentColumnWidthVisible,\r\n currentProperty,\r\n currentRowHeight,\r\n currentRowTop,\r\n isCurrentCellLoading,\r\n} from \"../currentCell\";\r\nimport { onClick, onMouseMove } from \"../onClick\";\r\nimport {\r\n columnWidths,\r\n context,\r\n context2d,\r\n currentDataRow,\r\n drawingColumnIndex,\r\n recordId,\r\n rowIndex,\r\n tableColumnIds,\r\n tablePanelView,\r\n} from \"../renderingValues\";\r\nimport {\r\n applyScrollTranslation,\r\n checkBoxCharacterFontSize,\r\n clipCell,\r\n drawSelectedRowBorder,\r\n fontSize,\r\n frontStripWidth,\r\n selectRowBorderWidth,\r\n topTextOffset,\r\n} from \"./cellsCommon\";\r\nimport {\r\n currentDataCellRenderer,\r\n getPaddingLeft,\r\n getPaddingRight,\r\n xCenter,\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/cells/dataCellRenderer\";\r\n\r\nexport function dataColumnsWidths() {\r\n return tableColumnIds().map((id) => columnWidths().get(id) || 100);\r\n}\r\n\r\nexport function dataColumnsDraws() {\r\n return tableColumnIds().map((id) => () => {\r\n applyScrollTranslation();\r\n drawDataCellBackground();\r\n drawInvalidDataSymbol();\r\n clipCell();\r\n drawCellValue();\r\n registerClickHandler(id);\r\n registerToolTipGetter(id);\r\n });\r\n}\r\n\r\nfunction registerToolTipGetter(columnId: string) {\r\n const ctx2d = context2d();\r\n const property = currentProperty();\r\n const cellRenderer = currentDataCellRenderer(ctx2d);\r\n const cellClickableArea = getCellClickableArea();\r\n const cellWidth = currentColumnWidth();\r\n\r\n if (property.column === \"CheckBox\" || property.column === \"Image\" || property.column === \"Blob\") {\r\n return;\r\n }\r\n\r\n if (\r\n getShowToolTipsForMemoFieldsOnly(property) &&\r\n (property.column !== \"Text\" || !property.multiline)\r\n ) {\r\n return;\r\n }\r\n\r\n const cellTextRendered = cellRenderer.cellText;\r\n const textWidth = ctx2d.measureText(cellTextRendered).width / CPR();\r\n\r\n const hasTooltip = cellWidth - getPaddingLeft() - getPaddingRight() < textWidth;\r\n const tablePanelView = getTablePanelView(context());\r\n\r\n onMouseMove({\r\n x: cellClickableArea.x,\r\n y: cellClickableArea.y,\r\n w: cellClickableArea.width,\r\n h: cellClickableArea.height,\r\n handler(event: any) {\r\n if (hasTooltip) {\r\n tablePanelView.currentTooltipText = cellTextRendered;\r\n } else {\r\n tablePanelView.currentTooltipText = undefined;\r\n }\r\n },\r\n });\r\n}\r\n\r\nfunction registerClickHandler(columnId: string) {\r\n const ctx = context();\r\n const row = currentDataRow();\r\n\r\n const property = currentProperty();\r\n\r\n const cellClickableArea = getCellClickableArea();\r\n if (property.column === \"CheckBox\") {\r\n const checkboxClickableArea = getCheckboxClickableArea();\r\n onClick({\r\n x: checkboxClickableArea.x,\r\n y: checkboxClickableArea.y,\r\n w: checkboxClickableArea.width,\r\n h: checkboxClickableArea.height,\r\n handler(event: any) {\r\n flow(function*() {\r\n if (event.isDouble) {\r\n getTablePanelView(ctx).setEditing(false);\r\n const defaultAction = getDataView(ctx).firstEnabledDefaultAction;\r\n if (defaultAction) {\r\n yield actionsUi.actions.onActionClick(ctx)(event, defaultAction);\r\n }\r\n } else {\r\n yield*getTablePanelView(ctx).onCellClick(event, row, columnId, true);\r\n }\r\n })();\r\n },\r\n });\r\n onClick({\r\n x: cellClickableArea.x,\r\n y: cellClickableArea.y,\r\n w: cellClickableArea.width,\r\n h: cellClickableArea.height,\r\n handler(event: any) {\r\n flow(function*() {\r\n if (event.isDouble) {\r\n getTablePanelView(ctx).setEditing(false);\r\n const defaultAction = getDataView(ctx).firstEnabledDefaultAction;\r\n if (defaultAction && defaultAction.isEnabled) {\r\n yield actionsUi.actions.onActionClick(ctx)(event, defaultAction);\r\n }\r\n } else {\r\n yield*getTablePanelView(ctx).onCellClick(event, row, columnId, false);\r\n }\r\n })();\r\n },\r\n });\r\n } else {\r\n onClick({\r\n x: cellClickableArea.x,\r\n y: cellClickableArea.y,\r\n w: cellClickableArea.width,\r\n h: cellClickableArea.height,\r\n handler(event: any) {\r\n flow(function*() {\r\n if (event.isDouble) {\r\n getTablePanelView(ctx).setEditing(false);\r\n const defaultAction = getDataView(ctx).firstEnabledDefaultAction;\r\n if (defaultAction && defaultAction.isEnabled) {\r\n yield actionsUi.actions.onActionClick(ctx)(event, defaultAction);\r\n }\r\n } else {\r\n yield*getTablePanelView(ctx).onCellClick(event, row, columnId, false);\r\n }\r\n })();\r\n },\r\n });\r\n }\r\n}\r\n\r\nfunction getCellClickableArea() {\r\n return {\r\n x: currentColumnLeftVisible(),\r\n y: currentRowTop(),\r\n width: currentColumnWidthVisible(),\r\n height: currentRowHeight(),\r\n };\r\n}\r\n\r\nfunction getCheckboxClickableArea() {\r\n const fontSize = checkBoxCharacterFontSize;\r\n return {\r\n x: xCenter() - fontSize / 2,\r\n y: currentRowTop() + topTextOffset - 4 - fontSize / 2,\r\n width: fontSize,\r\n height: fontSize,\r\n };\r\n}\r\n\r\nexport function drawDataCellBackground() {\r\n const ctx2d = context2d();\r\n const ctx = context();\r\n const selectedRowId = getSelectedRowId(tablePanelView());\r\n const isRowCursor = recordId() === selectedRowId;\r\n\r\n const thisCellRectangle = {\r\n columnLeft: currentColumnLeft(),\r\n columnWidth: currentColumnWidth(),\r\n rowTop: currentRowTop(),\r\n rowHeight: currentRowHeight(),\r\n };\r\n getTablePanelView(ctx).setCellRectangle(rowIndex(), drawingColumnIndex(), thisCellRectangle);\r\n if (drawingColumnIndex() === 0) {\r\n getTablePanelView(ctx).firstColumn = currentProperty();\r\n }\r\n ctx2d.fillStyle = getBackGroundColor();\r\n ctx2d.fillRect(\r\n CPR() * currentColumnLeft(),\r\n CPR() * currentRowTop(),\r\n CPR() * currentColumnWidth(),\r\n CPR() * (currentRowHeight() - 1)\r\n );\r\n if (isRowCursor) {\r\n drawSelectedRowBorder(frontStripWidth);\r\n }\r\n}\r\n\r\nfunction drawInvalidDataSymbol() {\r\n const ctx2d = context2d();\r\n let isInvalid = !!currentCellErrorMessage();\r\n const property = currentProperty();\r\n const selectedRowId = getSelectedRowId(tablePanelView());\r\n const isRowCursor = recordId() === selectedRowId;\r\n\r\n let isLoading = false;\r\n if (property.isLookup && property.lookupEngine) {\r\n isLoading = isCurrentCellLoading();\r\n }\r\n\r\n if (isInvalid && !isLoading) {\r\n const leftOffset = drawingColumnIndex() === 0 && isRowCursor ? frontStripWidth / 2 : 0;\r\n const topBottomOffset = isRowCursor ? selectRowBorderWidth : 0;\r\n ctx2d.save();\r\n ctx2d.fillStyle = \"red\";\r\n ctx2d.beginPath();\r\n ctx2d.moveTo(\r\n leftOffset + currentColumnLeft() * CPR(),\r\n topBottomOffset + currentRowTop() * CPR()\r\n );\r\n ctx2d.lineTo(\r\n (leftOffset + currentColumnLeft() + 5) * CPR(),\r\n (currentRowTop() + 0.5 * currentRowHeight()) * CPR()\r\n );\r\n ctx2d.lineTo(\r\n leftOffset + currentColumnLeft() * CPR(),\r\n (currentRowTop() + currentRowHeight() - topBottomOffset) * CPR()\r\n );\r\n ctx2d.fill();\r\n ctx2d.restore();\r\n }\r\n}\r\n\r\nfunction drawCellValue() {\r\n const ctx2d = context2d();\r\n const property = currentProperty();\r\n const isHidden = !getRowStateAllowRead(tablePanelView(), recordId(), property.id);\r\n const foregroundColor = getRowStateForegroundColor(tablePanelView(), recordId());\r\n let isLoading = false;\r\n if (property.isLookup && property.lookupEngine) {\r\n isLoading = isCurrentCellLoading();\r\n }\r\n\r\n ctx2d.font = `${fontSize * CPR()}px \"IBM Plex Sans\", sans-serif`;\r\n if (isHidden) {\r\n return;\r\n }\r\n if (isLoading) {\r\n ctx2d.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--background6');\r\n ctx2d.fillText(\r\n \"Loading...\",\r\n CPR() * (currentColumnLeft() + getPaddingLeft()),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n } else {\r\n ctx2d.fillStyle = foregroundColor || \"black\";\r\n currentDataCellRenderer(ctx2d).drawCellText();\r\n }\r\n}\r\n\r\nfunction getBackGroundColor() {\r\n const isColumnOrderChangeSource =\r\n tablePanelView().columnOrderChangingSourceId === currentProperty().id;\r\n const selectedRowId = getSelectedRowId(tablePanelView());\r\n\r\n const isRowCursor = recordId() === selectedRowId;\r\n\r\n const backgroundColor = getRowStateRowBgColor(tablePanelView(), recordId());\r\n\r\n if (isColumnOrderChangeSource) {\r\n return getComputedStyle(document.documentElement).getPropertyValue('--background3');\r\n } else if (isRowCursor) {\r\n return backgroundColor\r\n ? shadeHexColor(backgroundColor, -0.1)!\r\n : getComputedStyle(document.documentElement).getPropertyValue('--foreground5');\r\n } else {\r\n if (backgroundColor) {\r\n return backgroundColor;\r\n } else {\r\n return rowIndex() % 2 === 1\r\n ? getComputedStyle(document.documentElement).getPropertyValue('--background2')\r\n : getComputedStyle(document.documentElement).getPropertyValue('--background1');\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getShowToolTipsForMemoFieldsOnly(ctx: any) {\r\n return getWorkbenchLifecycle(ctx).portalSettings?.showToolTipsForMemoFieldsOnly;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\"\r\n\r\nexport function hasSelectedRowId(ctx: any, id: string) {\r\n return getDataView(ctx).hasSelectedRowId(id);\r\n}\r\n\r\nexport function setSelectedStateRowId(ctx: any) {\r\n return function*toggleSelectedId(id: string, newState: boolean) {\r\n getDataView(ctx).setSelectedState(id, newState);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n context,\r\n context2d,\r\n currentDataRow,\r\n dataView,\r\n isCheckBoxedTable,\r\n recordId,\r\n rowId,\r\n tablePanelView\r\n} from \"../renderingValues\";\r\nimport {\r\n currentColumnLeft,\r\n currentColumnLeftVisible,\r\n currentColumnWidth,\r\n currentColumnWidthVisible,\r\n currentRowHeight,\r\n currentRowTop,\r\n} from \"../currentCell\";\r\nimport {\r\n applyScrollTranslation,\r\n checkBoxCellPaddingLeft,\r\n checkBoxCharacterFontSize,\r\n drawSelectedRowBorder,\r\n frontStripWidth,\r\n topTextOffset\r\n} from \"./cellsCommon\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { onClick } from \"../onClick\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getSelectionMember } from \"model/selectors/DataView/getSelectionMember\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { hasSelectedRowId, setSelectedStateRowId, } from \"model/actions-tree/selectionCheckboxes\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\n\r\nexport const selectionCheckBoxColumnWidth = 20;\r\n\r\nexport function selectionCheckboxCellsWidths() {\r\n return isCheckBoxedTable() ? [selectionCheckBoxColumnWidth] : [];\r\n}\r\n\r\nexport function selectionCheckboxCellsDraws() {\r\n return isCheckBoxedTable()\r\n ? [\r\n () => {\r\n applyScrollTranslation();\r\n drawSelectionCheckboxBackground();\r\n const ctx2d = context2d();\r\n ctx2d.fillStyle = \"black\";\r\n ctx2d.font = `${CPR() * checkBoxCharacterFontSize}px \"Font Awesome 5 Free\"`;\r\n const state = dataView().isSelected(rowId());\r\n ctx2d.fillText(\r\n state ? \"\\uf14a\" : \"\\uf0c8\",\r\n CPR() * (currentColumnLeft() + checkBoxCellPaddingLeft),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n registerClickHandler();\r\n },\r\n ]\r\n : [];\r\n}\r\n\r\nfunction registerClickHandler() {\r\n const ctx = context();\r\n const row = currentDataRow();\r\n onClick({\r\n x: currentColumnLeftVisible(),\r\n y: currentRowTop(),\r\n w: currentColumnWidthVisible(),\r\n h: currentRowHeight(),\r\n handler(event: any) {\r\n flow(function*() {\r\n // TODO: Move to tablePanelView\r\n let newSelectionState = false;\r\n const dataTable = getDataTable(ctx);\r\n const rowId = dataTable.getRowId(row);\r\n const selectionMember = getSelectionMember(ctx);\r\n if (!!selectionMember) {\r\n const dataSourceField = getDataSourceFieldByName(ctx, selectionMember);\r\n if (dataSourceField) {\r\n newSelectionState = !dataTable.getCellValueByDataSourceField(row, dataSourceField);\r\n dataTable.setDirtyValue(row, selectionMember, newSelectionState);\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n const updatedRow = dataTable.getRowById(rowId)!;\r\n newSelectionState = dataTable.getCellValueByDataSourceField(updatedRow, dataSourceField);\r\n yield*setSelectedStateRowId(ctx)(rowId, newSelectionState);\r\n }\r\n } else {\r\n newSelectionState = !hasSelectedRowId(ctx, rowId);\r\n yield*setSelectedStateRowId(ctx)(rowId, newSelectionState);\r\n }\r\n })();\r\n },\r\n });\r\n}\r\n\r\nexport function selectionCheckboxEmptyCellsWidths() {\r\n return isCheckBoxedTable() ? [selectionCheckBoxColumnWidth] : [];\r\n}\r\n\r\nexport function selectionCheckboxEmptyCellsDraws() {\r\n return isCheckBoxedTable()\r\n ? [\r\n () => {\r\n applyScrollTranslation();\r\n drawSelectionCheckboxBackground();\r\n },\r\n ]\r\n : [];\r\n}\r\n\r\nexport function drawSelectionCheckboxBackground() {\r\n const ctx2d = context2d();\r\n const selectedRowId = getSelectedRowId(tablePanelView());\r\n const isRowCursor = selectedRowId && recordId() === selectedRowId;\r\n ctx2d.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--background1');\r\n ctx2d.fillRect(\r\n CPR() * currentColumnLeft(),\r\n CPR() * currentRowTop(),\r\n CPR() * currentColumnWidth(),\r\n CPR() * currentRowHeight()\r\n );\r\n if (isRowCursor) {\r\n drawSelectedRowBorder(frontStripWidth / 2);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { AggregationType, parseAggregationType } from \"model/entities/types/AggregationType\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { IAggregationInfo } from \"model/entities/types/IAggregationInfo\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { IAggregation } from \"model/entities/types/IAggregation\";\r\nimport { IProperty } from \"./types/IProperty\";\r\nimport { formatNumber } from \"./NumberFormating\";\r\n\r\nexport function parseAggregations(objectArray: any[] | undefined): IAggregation[] | undefined {\r\n if (!objectArray) return undefined;\r\n return objectArray.map(object => {\r\n return {\r\n columnId: object[\"column\"],\r\n type: parseAggregationType(object[\"type\"]),\r\n value: object[\"value\"]\r\n }\r\n });\r\n}\r\n\r\nexport function aggregationToString(aggregation: IAggregation, property: IProperty) {\r\n function round(value: number) {\r\n return Math.round(value * 100) / 100\r\n }\r\n\r\n const formattedValue = formatNumber(\r\n property.customNumericFormat,\r\n property.entity ?? '',\r\n round(aggregation.value));\r\n\r\n if (aggregation.type === AggregationType.SUM) {\r\n return \"Σ \" + formattedValue\r\n }\r\n return aggregation.type + \": \" + formattedValue\r\n}\r\n\r\nexport function calcAggregations(dataView: IDataView, aggregationInfos: IAggregationInfo[]): IAggregation[] {\r\n return aggregationInfos.map(aggregationInfo => {\r\n return {\r\n columnId: aggregationInfo.ColumnName,\r\n type: aggregationInfo.AggregationType,\r\n value: calculateAggregationValue(dataView, aggregationInfo),\r\n }\r\n })\r\n}\r\n\r\nfunction calculateAggregationValue(dataView: IDataView, aggregationInfo: IAggregationInfo) {\r\n const properties = getProperties(dataView);\r\n const property = properties.find(prop => prop.id === aggregationInfo.ColumnName)!\r\n const values = dataView.dataTable.rows\r\n .map(row => dataView.dataTable.getCellValue(row, property) as number);\r\n\r\n if (values.length === 0) {\r\n return 0;\r\n }\r\n switch (aggregationInfo.AggregationType) {\r\n case AggregationType.SUM:\r\n return values.reduce((a, b) => a + b, 0);\r\n case AggregationType.AVG:\r\n return values.reduce((a, b) => a + b, 0) / values.length;\r\n case AggregationType.MAX:\r\n return Math.max(...values);\r\n case AggregationType.MIN:\r\n return Math.min(...values);\r\n case AggregationType.COUNT:\r\n return values.length;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { context2d, currentRow, recordId, tableColumnIds, tablePanelView } from \"../renderingValues\";\r\nimport { applyScrollTranslation, clipCell, fontSize, numberCellPaddingRight, topTextOffset } from \"./cellsCommon\";\r\nimport { getRowStateAllowRead } from \"model/selectors/RowState/getRowStateAllowRead\";\r\nimport { currentColumnId, currentColumnLeft, currentColumnWidth, currentProperty, currentRowTop } from \"../currentCell\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { isGroupRow } from \"../rowCells/groupRowCells\";\r\nimport { IGroupRow } from \"../types\";\r\nimport { dataColumnsWidths } from \"./dataCell\";\r\nimport { aggregationToString } from \"model/entities/Aggregatioins\";\r\n\r\n\r\nexport function aggregationColumnsWidths() {\r\n return dataColumnsWidths();\r\n}\r\n\r\nexport function aggregationCellDraws() {\r\n const row = currentRow();\r\n if (isGroupRow(row)) {\r\n return tableColumnIds().map((id) => () => drawAggregationCell());\r\n } else return [];\r\n}\r\n\r\nexport function drawAggregationCell() {\r\n applyScrollTranslation();\r\n clipCell();\r\n drawAggregationText();\r\n}\r\n\r\nfunction drawAggregationText() {\r\n const ctx2d = context2d();\r\n if (!currentColumnId()) return;\r\n const isHidden = !getRowStateAllowRead(tablePanelView(), recordId(), currentProperty().id)\r\n\r\n const row = currentRow();\r\n if (isHidden || !isGroupRow(row)) {\r\n return;\r\n }\r\n const groupRow = row as IGroupRow;\r\n if (!groupRow.sourceGroup.aggregations) {\r\n return;\r\n }\r\n const aggregation = groupRow.sourceGroup.aggregations\r\n .find(aggregation => aggregation.columnId === currentProperty().id)\r\n if (!aggregation) {\r\n return;\r\n }\r\n\r\n ctx2d.font = `${fontSize * CPR()}px \"IBM Plex Sans\", sans-serif`;\r\n ctx2d.fillStyle = \"black\";\r\n ctx2d.textAlign = \"right\";\r\n ctx2d.fillText(\r\n aggregationToString(aggregation, currentProperty()),\r\n CPR() * (currentColumnLeft() + currentColumnWidth() - numberCellPaddingRight),\r\n CPR() * (currentRowTop() + topTextOffset));\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGroupRow, ITableRow } from \"../types\";\r\nimport { selectionCheckboxEmptyCellsDraws, selectionCheckboxEmptyCellsWidths, } from \"../cells/selectionCheckboxCell\";\r\nimport { groupRowContentCellsDraws, groupRowContentCellsWidths, groupRowEmptyCellsWidths } from \"../cells/groupCell\";\r\nimport { currentRow } from \"../renderingValues\";\r\nimport { aggregationCellDraws, aggregationColumnsWidths } from \"../cells/aggregationCell\";\r\n\r\nexport function groupRowCellsWidths() {\r\n return [\r\n [...selectionCheckboxEmptyCellsWidths(), ...groupRowContentCellsWidths()],\r\n [...selectionCheckboxEmptyCellsWidths(), ...groupRowEmptyCellsWidths(), ...aggregationColumnsWidths()]\r\n ];\r\n}\r\n\r\nexport function groupRowCellsDraws() {\r\n return [\r\n [...selectionCheckboxEmptyCellsDraws(), ...groupRowContentCellsDraws()],\r\n [...selectionCheckboxEmptyCellsDraws().map(x => () => {\r\n }), ...aggregationCellDraws()]\r\n ];\r\n}\r\n\r\nexport function isGroupRow(row: ITableRow): row is IGroupRow {\r\n return (row as any).groupLevel !== undefined;\r\n}\r\n\r\nexport function isCurrentGroupRow() {\r\n return isGroupRow(currentRow());\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getGrouper } from \"model/selectors/DataView/getGrouper\";\r\nimport { IGroupRow } from \"gui/Components/ScreenElements/Table/TableRendering/types\";\r\n\r\nexport function onGroupHeaderToggleClick(ctx: any) {\r\n return flow(function*onGroupHeaderToggleClick(\r\n event: any,\r\n groupHeader: IGroupRow\r\n ) {\r\n yield*getGrouper(ctx).loadChildren(groupHeader.sourceGroup);\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n context,\r\n context2d,\r\n currentRow,\r\n gridLeadCellDimensions,\r\n groupingColumnCount,\r\n groupingColumnIds,\r\n isCheckBoxedTable,\r\n recordId,\r\n tablePanelView,\r\n worldWidth,\r\n} from \"../renderingValues\";\r\nimport { currentColumnLeft, currentColumnWidth, currentRowHeight, currentRowTop, } from \"../currentCell\";\r\nimport { IGroupRow, IGroupTreeNode } from \"../types\";\r\nimport { applyScrollTranslation, cellPaddingLeft, fontSize, selectRowBorderWidth, topTextOffset } from \"./cellsCommon\";\r\nimport { isGroupRow } from \"../rowCells/groupRowCells\";\r\nimport { onClick } from \"../onClick\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { onGroupHeaderToggleClick } from \"model/actions-ui/DataView/TableView/onGroupHeaderToggleClick\";\r\nimport { flow } from \"mobx\";\r\nimport { isInfiniteScrollingActive } from \"model/selectors/isInfiniteScrollingActive\";\r\nimport { getGrouper } from \"model/selectors/DataView/getGrouper\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getSelectedRowId } from \"../../../../../../model/selectors/TablePanelView/getSelectedRowId\";\r\n\r\nconst groupCellWidth = 20;\r\nconst expandSymbolFontSize = 15;\r\n\r\nexport function groupRowEmptyCellsWidths() {\r\n return groupingColumnIds().map(() => groupCellWidth);\r\n}\r\n\r\nexport function groupRowEmptyCellsDraws() {\r\n return groupingColumnIds().map((id) => () => {\r\n drawEmptyGroupCell();\r\n });\r\n}\r\n\r\nexport function groupRowContentCellsWidths() {\r\n const row = currentRow();\r\n if (isGroupRow(row)) {\r\n const grpCnt = groupingColumnCount();\r\n const result: number[] = [];\r\n for (let i = 0; i < grpCnt; i++) {\r\n if (i < row.groupLevel) result.push(groupCellWidth);\r\n else {\r\n result.push(worldWidth() - gridLeadCellDimensions()[i].left);\r\n break;\r\n }\r\n }\r\n return result;\r\n } else return [];\r\n}\r\n\r\nexport function groupRowContentCellsDraws() {\r\n const row = currentRow();\r\n if (isGroupRow(row)) {\r\n const grpCnt = groupingColumnCount();\r\n const result: (() => void)[] = [];\r\n for (let i = 0; i < grpCnt; i++) {\r\n if (i < row.groupLevel) result.push(drawEmptyGroupCell);\r\n else {\r\n result.push(drawGroupCell);\r\n break;\r\n }\r\n }\r\n return result;\r\n } else return [];\r\n}\r\n\r\nexport function drawEmptyGroupCell() {\r\n applyScrollTranslation();\r\n // clipCell();\r\n drawEmptyGroupCellBackground();\r\n}\r\n\r\nexport function drawGroupCell() {\r\n applyScrollTranslation();\r\n drawGroupCellBackground();\r\n\r\n const ctx2d = context2d();\r\n const row = currentRow();\r\n if (isGroupRow(row)) {\r\n const groupRow = row as IGroupRow;\r\n ctx2d.fillStyle = \"black\";\r\n ctx2d.font = `${CPR() * expandSymbolFontSize}px \"Font Awesome 5 Free\"`;\r\n const state = row.isExpanded;\r\n ctx2d.fillText(\r\n state ? \"\\uf146\" : \"\\uf0fe\",\r\n CPR() * (currentColumnLeft() + 6),\r\n CPR() * (currentRowTop() + topTextOffset + 1)\r\n );\r\n ctx2d.font = `${CPR() * fontSize}px \"IBM Plex Sans\", Arial, sans-serif`;\r\n ctx2d.fillText(\r\n `${row.columnLabel} : ${formatColumnValue(row.columnValue)} [${row.sourceGroup.rowCount}]`,\r\n CPR() * (currentColumnLeft() + cellPaddingLeft + groupCellWidth),\r\n CPR() * (currentRowTop() + topTextOffset)\r\n );\r\n\r\n const ctx = context();\r\n onClick({\r\n x: currentColumnLeft(),\r\n y: currentRowTop(),\r\n w: groupCellWidth,\r\n h: 20,\r\n handler(event: any) {\r\n flow(function*() {\r\n if (!row.sourceGroup.isExpanded && row.sourceGroup.childGroups.length === 0) {\r\n yield onGroupHeaderToggleClick(ctx)(event, groupRow);\r\n }\r\n const allGroups = getGrouper(ctx).allGroups;\r\n if (shouldCloseOtherGroups(row.sourceGroup, allGroups, ctx)) {\r\n const groupsToKeepOpen = [row.sourceGroup, ...row.sourceGroup.allParents]\r\n allGroups\r\n .filter(group => !groupsToKeepOpen.includes(group) && group.isExpanded)\r\n .forEach(group => group.isExpanded = false);\r\n }\r\n row.sourceGroup.isExpanded = !row.sourceGroup.isExpanded;\r\n\r\n unselectRowIfInClosedGroup(ctx, row);\r\n })();\r\n },\r\n });\r\n }\r\n}\r\n\r\nfunction unselectRowIfInClosedGroup(ctx: any, row: IGroupRow) {\r\n const dataView = getDataView(ctx);\r\n if (!row.sourceGroup.isExpanded && dataView.selectedRowId) {\r\n const containsSelectedRow = !!row.sourceGroup.getRowById(dataView.selectedRowId);\r\n if (containsSelectedRow) {\r\n dataView.selectedRowId = undefined;\r\n }\r\n }\r\n}\r\n\r\nfunction shouldCloseOtherGroups(sourceGroup: IGroupTreeNode, allGroups: IGroupTreeNode[], ctx: any) {\r\n const otherGroups = Array.from(allGroups).remove(sourceGroup);\r\n return isInfiniteScrollingActive(ctx, undefined)\r\n && otherGroups.some(group => group.isInfinitelyScrolled);\r\n}\r\n\r\nfunction formatColumnValue(value: string) {\r\n if (value === undefined || value === null) {\r\n return \"\";\r\n } else {\r\n return value\r\n }\r\n}\r\n\r\nexport function drawGroupCellBackground() {\r\n const ctx2d = context2d();\r\n ctx2d.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--background4');\r\n ctx2d.fillRect(\r\n CPR() * currentColumnLeft(),\r\n CPR() * currentRowTop(),\r\n CPR() * currentColumnWidth(),\r\n CPR() * currentRowHeight()\r\n );\r\n}\r\n\r\nexport function drawEmptyGroupCellBackground() {\r\n const ctx2d = context2d();\r\n ctx2d.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--background1');\r\n ctx2d.fillRect(\r\n CPR() * currentColumnLeft(),\r\n CPR() * currentRowTop(),\r\n CPR() * currentColumnWidth(),\r\n CPR() * currentRowHeight()\r\n );\r\n const selectedRowId = getSelectedRowId(tablePanelView());\r\n const isSelected = recordId() === selectedRowId;\r\n\r\n if (isSelected && isCheckBoxedTable()) {\r\n drawSelectedRowBorder();\r\n }\r\n}\r\n\r\nfunction drawSelectedRowBorder() {\r\n const ctx2d = context2d();\r\n ctx2d.beginPath();\r\n ctx2d.strokeStyle = getComputedStyle(document.documentElement).getPropertyValue('--foreground1');\r\n ctx2d.lineWidth = selectRowBorderWidth * CPR();\r\n ctx2d.moveTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + 1.5));\r\n ctx2d.lineTo(\r\n CPR() * currentColumnLeft() + CPR() * currentColumnWidth(),\r\n CPR() * (currentRowTop() + 1.5)\r\n );\r\n ctx2d.moveTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + currentRowHeight() - 1.5));\r\n ctx2d.lineTo(\r\n CPR() * currentColumnLeft() + CPR() * currentColumnWidth(),\r\n CPR() * (currentRowTop() + currentRowHeight() - 1.5)\r\n );\r\n ctx2d.stroke();\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { dataColumnsDraws, dataColumnsWidths } from \"../cells/dataCell\";\r\nimport { groupRowEmptyCellsDraws, groupRowEmptyCellsWidths } from \"../cells/groupCell\";\r\nimport { selectionCheckboxCellsDraws, selectionCheckboxCellsWidths } from \"../cells/selectionCheckboxCell\";\r\nimport { Memoized } from \"../common/Memoized\";\r\nimport { currentRow, scRenderRow, scRenderTable, tableColumnIds } from \"../renderingValues\";\r\nimport { ITableRow } from \"../types\";\r\n\r\n\r\nexport const dataRowCellsWidths = Memoized(() => {\r\n return [\r\n ...selectionCheckboxCellsWidths(),\r\n ...groupRowEmptyCellsWidths(),\r\n ...dataColumnsWidths()\r\n ]\r\n})\r\nscRenderRow.push(dataRowCellsWidths.clear);\r\n\r\nexport const dataRowCellsDraws = Memoized(() => {\r\n return [\r\n ...selectionCheckboxCellsDraws(),\r\n ...groupRowEmptyCellsDraws(),\r\n ...dataColumnsDraws()\r\n ]\r\n});\r\nscRenderRow.push(dataRowCellsDraws.clear);\r\n\r\nexport const dataRowColumnIds = Memoized(() => {\r\n return [\r\n ...selectionCheckboxCellsDraws().map(item => null),\r\n ...groupRowEmptyCellsDraws().map(item => null),\r\n ...tableColumnIds()\r\n ]\r\n})\r\nscRenderTable.push(dataRowColumnIds.clear);\r\n\r\nexport function isDataRow(row: ITableRow): row is any[] {\r\n return Array.isArray(row);\r\n}\r\n\r\nexport function isCurrentDataRow() {\r\n return isDataRow(currentRow())\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isCurrentGroupRow } from \"./rowCells/groupRowCells\";\r\n\r\nexport function cellLayerCount() {\r\n return isCurrentGroupRow() ? 2 : 1;\r\n}\r\n\r\nlet _currentCellLayerIndex = 0;\r\n\r\nexport function setLayerIndex(layerIndex: number) {\r\n _currentCellLayerIndex = layerIndex;\r\n}\r\n\r\nexport function currentCellLayerIndex() {\r\n return _currentCellLayerIndex;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Memoized } from \"./common/Memoized\";\r\nimport { isCheckBoxedTable, scRenderRow, scrollLeft } from \"./renderingValues\";\r\nimport { dataRowCellsDraws, dataRowCellsWidths, isCurrentDataRow } from \"./rowCells/dataRowCells\";\r\nimport { groupRowCellsDraws, groupRowCellsWidths, isCurrentGroupRow, } from \"./rowCells/groupRowCells\";\r\nimport { currentCellLayerIndex } from \"./currentCellLayerIndex\";\r\n\r\nfunction computeDimensions(cellWidths: number[]) {\r\n const result: { left: number; width: number; right: number; leftVisible: number; widthVisible: number; }[] = [];\r\n\r\n let acc = 0;\r\n for (let i = 0; i < cellWidths.length; i++) {\r\n const left = acc;\r\n const width = cellWidths[i];\r\n let leftVisible = left;\r\n let widthVisible = width;\r\n if (isCheckBoxedTable() && scrollLeft() > left) {\r\n if (i > 0) {\r\n const fixedColumnWidth = cellWidths[0]\r\n leftVisible = scrollLeft() + fixedColumnWidth\r\n widthVisible = width - (leftVisible - left)\r\n } else if (i === 0) {\r\n leftVisible = scrollLeft()\r\n }\r\n }\r\n acc = acc + width;\r\n const right = acc;\r\n result.push({left, width, right, leftVisible, widthVisible});\r\n }\r\n return result;\r\n}\r\n\r\nexport const currentRowCellsDimensions = Memoized(() => {\r\n if (isCurrentDataRow()) {\r\n return computeDimensions(dataRowCellsWidths());\r\n } else if (isCurrentGroupRow()) {\r\n return computeDimensions(groupRowCellsWidths()[currentCellLayerIndex()]);\r\n } else {\r\n return [];\r\n }\r\n});\r\nscRenderRow.push(() => currentRowCellsDimensions.clear());\r\n\r\nexport const currentRowCellsDraws = Memoized(() => {\r\n if (isCurrentDataRow()) {\r\n return dataRowCellsDraws();\r\n } else if (isCurrentGroupRow()) {\r\n return groupRowCellsDraws()[currentCellLayerIndex()];\r\n } else {\r\n return [];\r\n }\r\n});\r\nscRenderRow.push(currentRowCellsDraws.clear);\r\n\r\nexport function currentRowCellsCount() {\r\n return currentRowCellsDraws().length;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFieldErrorMessage } from \"model/selectors/DataView/getFieldErrorMessage\";\r\nimport { Memoized } from \"./common/Memoized\";\r\nimport { currentRowCellsDimensions, currentRowCellsDraws } from \"./currentRowCells\";\r\nimport { stripHtml } from \"string-strip-html\";\r\nimport {\r\n currentDataRow,\r\n currentRow,\r\n dataTable,\r\n drawingColumnIndex,\r\n gridLeadCellDimensions,\r\n propertyById,\r\n realFixedColumnCount,\r\n rowHeight,\r\n rowIndex,\r\n scRenderCell,\r\n} from \"./renderingValues\";\r\nimport { dataRowColumnIds } from \"./rowCells/dataRowCells\";\r\n\r\nexport function drawCurrentCell() {\r\n const colIdx = drawingColumnIndex();\r\n const cellDraws = currentRowCellsDraws();\r\n if (colIdx >= cellDraws.length) return;\r\n currentRowCellsDraws()[drawingColumnIndex()]();\r\n}\r\n\r\nexport function currentColumnLeft() {\r\n return currentRowCellsDimensions()[drawingColumnIndex()].left;\r\n}\r\n\r\nexport function currentColumnLeftVisible() {\r\n return currentRowCellsDimensions()[drawingColumnIndex()].leftVisible;\r\n}\r\n\r\nexport function currentColumnWidthVisible() {\r\n return currentRowCellsDimensions()[drawingColumnIndex()].widthVisible;\r\n}\r\n\r\nexport function currentColumnWidth() {\r\n return currentRowCellsDimensions()[drawingColumnIndex()].width;\r\n}\r\n\r\nexport function currentColumnRight() {\r\n return currentRowCellsDimensions()[drawingColumnIndex()].right;\r\n}\r\n\r\nexport function currentRowTop() {\r\n return rowIndex() * rowHeight();\r\n}\r\n\r\nexport function currentRowHeight() {\r\n return rowHeight();\r\n}\r\n\r\nexport function currentRowBottom() {\r\n return currentRowTop() + currentRowHeight();\r\n}\r\n\r\nexport function isCurrentCellFixed() {\r\n return drawingColumnIndex() < realFixedColumnCount();\r\n}\r\n\r\nexport function currentGridLeadCellLeft() {\r\n return gridLeadCellDimensions()[drawingColumnIndex()].left;\r\n}\r\n\r\nexport function currentGridLeadCellWidth() {\r\n return gridLeadCellDimensions()[drawingColumnIndex()].width;\r\n}\r\n\r\nexport function currentGridLeadCellRight() {\r\n return gridLeadCellDimensions()[drawingColumnIndex()].right;\r\n}\r\n\r\nexport function currentColumnId() {\r\n return dataRowColumnIds()[drawingColumnIndex()];\r\n}\r\n\r\nexport const currentProperty = () => {\r\n const property = propertyById().get(currentColumnId() as any)!;\r\n if (property.column === \"Polymorph\") {\r\n return property.getPolymophicProperty(currentRow() as any[]);\r\n } else {\r\n return property;\r\n }\r\n};\r\n\r\nexport const currentCellText = Memoized(() => {\r\n const value = currentCellValue();\r\n let text = dataTable().resolveCellText(currentProperty(), value);\r\n if (text && currentProperty().multiline) {\r\n text = stripHtml(text).result;\r\n }\r\n if (Array.isArray(text)) {\r\n text = text.join(\", \");\r\n }\r\n return text;\r\n});\r\nscRenderCell.push(() => currentCellText.clear());\r\n\r\nexport const currentCellTextMultiline = Memoized(() => {\r\n const value = currentCellValue();\r\n let text = dataTable().resolveCellText(currentProperty(), value);\r\n if (text && currentProperty().multiline) {\r\n text = text.split(\"\\n\");\r\n }\r\n return text;\r\n});\r\nscRenderCell.push(() => currentCellTextMultiline.clear());\r\n\r\nexport const currentCellValue = Memoized(() => {\r\n const property = propertyById().get(currentColumnId() as any)!\r\n if (property.column === \"Polymorph\") {\r\n const polymorphicProperty = currentProperty();\r\n return dataTable().getCellValue(currentDataRow(), polymorphicProperty);\r\n } else {\r\n return dataTable().getCellValue(currentDataRow(), property);\r\n }\r\n});\r\nscRenderCell.push(() => currentCellValue.clear());\r\n\r\nexport const currentCellErrorMessage = Memoized(() => {\r\n return getFieldErrorMessage(currentProperty())(currentDataRow(), currentProperty());\r\n});\r\nscRenderCell.push(() => currentCellErrorMessage.clear());\r\n\r\nexport const isCurrentCellLoading = Memoized(() => {\r\n const value = dataTable().isCellTextResolving(currentProperty(), currentCellValue());\r\n return value;\r\n});\r\nscRenderCell.push(() => isCurrentCellLoading.clear());\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n context2d,\r\n dataCellOffset,\r\n drawingColumnIndex,\r\n getCurrentRowRightBorderDrawn,\r\n scrollLeft,\r\n scrollTop,\r\n selectionColumnShown,\r\n setCurrentRowRightBorderDrawn,\r\n} from \"../renderingValues\";\r\nimport {\r\n currentColumnLeft,\r\n currentColumnRight,\r\n currentColumnWidth,\r\n currentRowHeight,\r\n currentRowTop,\r\n isCurrentCellFixed,\r\n} from \"../currentCell\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { getPaddingLeft, getPaddingRight } from \"./dataCellRenderer\";\r\n\r\nexport function applyScrollTranslation() {\r\n const ctx2d = context2d();\r\n ctx2d.translate(!isCurrentCellFixed() ? -CPR() * scrollLeft() : 0, -CPR() * scrollTop());\r\n}\r\n\r\nexport function clipCell() {\r\n const ctx2d = context2d();\r\n ctx2d.beginPath();\r\n ctx2d.rect(\r\n CPR() * (currentColumnLeft() + getPaddingLeft()),\r\n CPR() * currentRowTop(),\r\n CPR() * (currentColumnWidth() - getPaddingLeft() - getPaddingRight()),\r\n CPR() * currentRowHeight()\r\n );\r\n ctx2d.clip();\r\n}\r\n\r\nexport function drawSelectedRowBorder(frontStripeWidth: number) {\r\n const ctx2d = context2d();\r\n ctx2d.beginPath();\r\n ctx2d.strokeStyle = getComputedStyle(document.documentElement).getPropertyValue('--foreground1');\r\n ctx2d.lineWidth = selectRowBorderWidth * CPR();\r\n ctx2d.moveTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + 1.5));\r\n ctx2d.lineTo(\r\n CPR() * currentColumnLeft() + CPR() * currentColumnWidth(),\r\n CPR() * (currentRowTop() + 1.5)\r\n );\r\n ctx2d.moveTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + currentRowHeight() - 1.5));\r\n ctx2d.lineTo(\r\n CPR() * currentColumnLeft() + CPR() * currentColumnWidth(),\r\n CPR() * (currentRowTop() + currentRowHeight() - 1.5)\r\n );\r\n ctx2d.stroke();\r\n\r\n const currentIsTheLeftMostDataColumn = drawingColumnIndex() === dataCellOffset();\r\n\r\n if (currentIsTheLeftMostDataColumn && !selectionColumnShown()) {\r\n ctx2d.beginPath();\r\n ctx2d.lineWidth = frontStripeWidth * CPR();\r\n ctx2d.moveTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + 1.5));\r\n ctx2d.lineTo(CPR() * currentColumnLeft(), CPR() * (currentRowTop() + currentRowHeight() - 1.5));\r\n ctx2d.stroke();\r\n }\r\n if (!getCurrentRowRightBorderDrawn()) {\r\n ctx2d.beginPath();\r\n ctx2d.lineWidth = selectRowBorderWidth * CPR();\r\n ctx2d.moveTo(CPR() * currentColumnRight(), CPR() * (currentRowTop() + 1.5));\r\n ctx2d.lineTo(CPR() * currentColumnRight(), CPR() * (currentRowTop() + currentRowHeight() - 1.5));\r\n ctx2d.stroke();\r\n setCurrentRowRightBorderDrawn(true);\r\n }\r\n}\r\n\r\nexport const numberCellPaddingRight = 15;\r\nexport const cellPaddingLeft = 6;\r\nexport const cellPaddingRight = 6;\r\nexport const cellPaddingLeftFirstCell = 25;\r\nexport const cellPaddingRightFirstCell = 25;\r\nexport const topTextOffset = 17;\r\nexport const fontSize = 12;\r\nexport const checkBoxCellPaddingLeft = 5;\r\nexport const checkBoxCharacterFontSize = 12;\r\nexport const rowHeight = 25;\r\nexport const frontStripWidth = 8;\r\nexport const selectRowBorderWidth = 1;\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { T } from \"utils/translation\";\r\n\r\nexport enum GroupingUnit {\r\n Year, Month, Day, Hour, Minute\r\n}\r\n\r\nexport function groupingUnitToLabel(groupingUnit: GroupingUnit | undefined){\r\n switch(groupingUnit){\r\n case GroupingUnit.Year:\r\n return T(\"Year\", \"group_by_year\");\r\n case GroupingUnit.Month:\r\n return T(\"Month\", \"group_by_month\");\r\n case GroupingUnit.Day:\r\n return T(\"Day\", \"group_by_day\");\r\n case GroupingUnit.Hour:\r\n return T(\"Hour\", \"group_by_hour\");\r\n case GroupingUnit.Minute:\r\n return T(\"Minute\", \"group_by_minute\");\r\n default:\r\n return \"\";\r\n }\r\n}\r\n\r\nexport function groupingUnitToString(unit: GroupingUnit | undefined) {\r\n switch (unit) {\r\n case GroupingUnit.Year:\r\n return \"year\";\r\n case GroupingUnit.Month:\r\n return \"month\";\r\n case GroupingUnit.Day:\r\n return \"day\";\r\n case GroupingUnit.Hour:\r\n return \"hour\";\r\n case GroupingUnit.Minute:\r\n return \"minute\";\r\n case undefined:\r\n return undefined;\r\n default:\r\n throw new Error(\"GroupingUnitToString not implemented for value:\" + unit)\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"gui/Components/Dialogs/ColumnsDialog.module.scss\";\r\nimport React from \"react\";\r\nimport { CloseButton, ModalWindow } from \"@origam/components\";\r\nimport { AutoSizer, MultiGrid } from \"react-virtualized\";\r\nimport { bind } from \"bind-decorator\";\r\nimport { action, observable } from \"mobx\";\r\nimport { observer, Observer } from \"mobx-react\";\r\nimport { AggregationType, tryParseAggregationType, } from \"model/entities/types/AggregationType\";\r\nimport { T } from \"utils/translation\";\r\nimport { rowHeight } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon\";\r\nimport { GroupingUnit, groupingUnitToLabel } from \"model/entities/types/GroupingUnit\";\r\nimport { IColumnConfiguration, ITableConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { IColumnOptions } from \"model/entities/TablePanelView/ColumnConfigurationDialog\";\r\nimport { IOption, SimpleDropdown } from \"@origam/components\";\r\nimport { compareStrings } from \"utils/string\";\r\n\r\n@observer\r\nexport class ColumnsDialog extends React.Component<{\r\n columnOptions: Map;\r\n configuration: ITableConfiguration;\r\n onOkClick?: (configuration: ITableConfiguration) => void;\r\n onSaveAsClick: (event: any, configuration: ITableConfiguration) => void;\r\n onCancelClick?: (event: any) => void;\r\n onCloseClick?: (event: any) => void;\r\n}> {\r\n constructor(props: any) {\r\n super(props);\r\n this.configuration = this.props.configuration;\r\n this.sortedColumnConfigs = [...this.configuration.columnConfigurations].sort(\r\n (a, b) => {\r\n const optionA = this.props.columnOptions.get(a.propertyId)!;\r\n const optionB = this.props.columnOptions.get(b.propertyId)!;\r\n return compareStrings(optionA.name, optionB.name)\r\n }\r\n );\r\n }\r\n\r\n configuration: ITableConfiguration;\r\n sortedColumnConfigs: IColumnConfiguration[];\r\n\r\n @observable columnWidths = [70, 220, 110, 150, 90];\r\n\r\n refGrid = React.createRef();\r\n\r\n @action.bound setVisible(rowIndex: number, state: boolean) {\r\n this.sortedColumnConfigs[rowIndex].isVisible = state;\r\n }\r\n\r\n @action.bound setGrouping(rowIndex: number, state: boolean, entity: string) {\r\n if (entity === \"Date\") {\r\n if (state) {\r\n this.setTimeGroupingUnit(rowIndex, GroupingUnit.Day);\r\n } else {\r\n this.setTimeGroupingUnit(rowIndex, undefined);\r\n }\r\n }\r\n\r\n const columnConfCopy = [...this.sortedColumnConfigs];\r\n columnConfCopy.sort((a, b) => b.groupingIndex - a.groupingIndex);\r\n if (this.sortedColumnConfigs[rowIndex].groupingIndex === 0) {\r\n this.sortedColumnConfigs[rowIndex].groupingIndex =\r\n columnConfCopy[0].groupingIndex + 1;\r\n } else {\r\n this.sortedColumnConfigs[rowIndex].groupingIndex = 0;\r\n let groupingIndex = 1;\r\n columnConfCopy.reverse();\r\n for (let columnConfItem of columnConfCopy) {\r\n if (columnConfItem.groupingIndex > 0) {\r\n columnConfItem.groupingIndex = groupingIndex++;\r\n }\r\n }\r\n }\r\n }\r\n\r\n @action.bound setTimeGroupingUnit(rowIndex: number, groupingUnit: GroupingUnit | undefined) {\r\n this.sortedColumnConfigs[rowIndex].timeGroupingUnit = groupingUnit;\r\n }\r\n\r\n @action.bound setAggregation(rowIndex: number, selectedAggregation: any) {\r\n this.sortedColumnConfigs[rowIndex].aggregationType = tryParseAggregationType(\r\n selectedAggregation\r\n );\r\n }\r\n\r\n @action.bound handleFixedColumnsCountChange(event: any) {\r\n this.configuration.fixedColumnCount = parseInt(event.target.value, 10);\r\n }\r\n\r\n render() {\r\n return (\r\n }\r\n buttonsCenter={\r\n <>\r\n \r\n this.props.onOkClick && this.props.onOkClick(this.configuration)\r\n }\r\n >\r\n {T(\"OK\", \"button_ok\")}\r\n \r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n \r\n {({width, height}) => (\r\n \r\n {() => (\r\n {\r\n return this.columnWidths[index];\r\n }}\r\n rowHeight={rowHeight}\r\n width={width}\r\n height={height}\r\n />\r\n )}\r\n \r\n )}\r\n \r\n
\r\n
\r\n {T(\"Locked columns count\", \"column_config_locked_columns_count\")}\r\n \r\n
\r\n \r\n );\r\n }\r\n\r\n getCell(rowIndex: number, columnIndex: number) {\r\n const {\r\n isVisible,\r\n propertyId,\r\n aggregationType,\r\n groupingIndex,\r\n timeGroupingUnit,\r\n } = this.sortedColumnConfigs[rowIndex];\r\n\r\n const { name, entity, canGroup, canAggregate, modelInstanceId } = this.props.columnOptions.get(propertyId)!;\r\n\r\n const aggregationOptions = [\r\n new AggregationOption(\"\", undefined),\r\n new AggregationOption(T(\"SUM\", \"aggregation_sum\"), AggregationType.SUM),\r\n new AggregationOption(T(\"AVG\", \"aggregation_avg\"), AggregationType.AVG),\r\n new AggregationOption(T(\"MIN\", \"aggregation_min\"), AggregationType.MIN),\r\n new AggregationOption(T(\"MAX\", \"aggregation_max\"), AggregationType.MAX),\r\n ];\r\n const selectedAggregationOption = aggregationOptions.find(option => option.value === aggregationType)!;\r\n\r\n const timeunitOptions = [\r\n new TimeUnitOption(groupingUnitToLabel(GroupingUnit.Year), GroupingUnit.Year),\r\n new TimeUnitOption(groupingUnitToLabel(GroupingUnit.Month), GroupingUnit.Month),\r\n new TimeUnitOption(groupingUnitToLabel(GroupingUnit.Day), GroupingUnit.Day),\r\n new TimeUnitOption(groupingUnitToLabel(GroupingUnit.Hour), GroupingUnit.Hour),\r\n new TimeUnitOption(groupingUnitToLabel(GroupingUnit.Minute), GroupingUnit.Minute),\r\n ];\r\n const selectedTimeUnitOption = timeunitOptions.find(option => option.value === timeGroupingUnit)!;\r\n\r\n switch (columnIndex) {\r\n case 0:\r\n return (\r\n this.setVisible(rowIndex, event.target.checked)}\r\n checked={isVisible}\r\n />\r\n );\r\n case 1:\r\n return name;\r\n case 2:\r\n return (\r\n \r\n );\r\n case 3:\r\n if (groupingIndex > 0 && entity === \"Date\") {\r\n return (\r\n this.setTimeGroupingUnit(rowIndex, option.value)}\r\n />\r\n );\r\n } else {\r\n return \"\";\r\n }\r\n case 4:\r\n if (\r\n (entity === \"Currency\" ||\r\n entity === \"Integer\" ||\r\n entity === \"Float\" ||\r\n entity === \"Long\") &&\r\n canAggregate\r\n ) {\r\n return (\r\n this.setAggregation(rowIndex, option.value)}\r\n />\r\n );\r\n } else {\r\n return \"\";\r\n }\r\n default:\r\n return \"\";\r\n }\r\n }\r\n\r\n getCellClass(columnIndex: number){\r\n let cellClass = S.columnTableCell\r\n if(columnIndex === 0 || columnIndex === 2){\r\n cellClass += \" \" + S.checkBoxCell\r\n }\r\n return cellClass;\r\n }\r\n\r\n @bind renderCell(args: {\r\n columnIndex: number;\r\n rowIndex: number;\r\n style: any;\r\n key: any;\r\n }): React.ReactNode {\r\n const Obsv = Observer as any;\r\n if (args.rowIndex > 0) {\r\n const rowClassName = args.rowIndex % 2 === 0 ? \"even\" : \"odd\";\r\n return (\r\n \r\n {() => (\r\n
\r\n {this.getCell(args.rowIndex - 1, args.columnIndex)}\r\n
\r\n )}\r\n
\r\n );\r\n } else {\r\n return (\r\n \r\n {() => (\r\n \r\n )}\r\n \r\n );\r\n }\r\n }\r\n}\r\n\r\n@observer\r\nexport class TableHeader extends React.Component<{\r\n columnIndex: number;\r\n columnWidth: number;\r\n style: any;\r\n}> {\r\n getHeader(columnIndex: number) {\r\n switch (columnIndex) {\r\n case 0:\r\n return T(\"Visible\", \"column_config_visible\");\r\n case 1:\r\n return T(\"Name\", \"column_config_name\");\r\n case 2:\r\n return T(\"GroupBy\", \"column_config_group_by\");\r\n case 3:\r\n return T(\"Grouping Unit\", \"column_config_time_grouping_unit\");\r\n case 4:\r\n return T(\"Aggregation\", \"column_config_aggregation\");\r\n default:\r\n return \"?\";\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n {this.getHeader(this.props.columnIndex)}\r\n {this.props.columnIndex !== 4 &&
}\r\n
\r\n );\r\n }\r\n}\r\n\r\nclass AggregationOption implements IOption{\r\n constructor (\r\n public label: string,\r\n public value: AggregationType | undefined,\r\n ){\r\n }\r\n}\r\n\r\nclass TimeUnitOption implements IOption{\r\n constructor (\r\n public label: string,\r\n public value: GroupingUnit,\r\n ){\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport CS from \"gui/Components/Dialogs/DialogsCommon.module.css\";\r\nimport S from \"gui/Components/Dialogs/FavoriteFolderPropertiesDialog.module.scss\";\r\nimport { observable } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { T } from \"utils/translation\";\r\n\r\n@observer\r\nexport class NewConfigurationDialog extends React.Component<{\r\n onCancelClick: (event: any) => void;\r\n onOkClick: (name: string) => void;\r\n}> {\r\n @observable\r\n groupName: string = \"\";\r\n\r\n get isInvalid() {\r\n return this.groupName === \"\";\r\n }\r\n\r\n refInput = React.createRef();\r\n\r\n onNameChanged(event: any) {\r\n this.groupName = event.target.value;\r\n }\r\n\r\n componentDidMount() {\r\n this.refInput.current?.focus();\r\n }\r\n\r\n onKeydown(event: React.KeyboardEvent) {\r\n if (event.key === \"Enter\") {\r\n this.onOkClick();\r\n }\r\n }\r\n\r\n onOkClick() {\r\n if (this.isInvalid) {\r\n return;\r\n }\r\n this.props.onOkClick(this.groupName);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n
\r\n
\r\n
{T(\"Name:\", \"column_config_config_name\")}
\r\n this.onNameChanged(event)}\r\n onKeyDown={(event: React.KeyboardEvent) => this.onKeydown(event)}\r\n />\r\n {this.isInvalid && (\r\n
\r\n \r\n \r\n
\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IPanelViewType } from \"../../entities/types/IPanelViewType\";\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getActivePanelView(ctx: any): IPanelViewType {\r\n return getDataView(ctx).activePanelView;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getActivePanelView } from \"model/selectors/DataView/getActivePanelView\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\n\r\nexport function saveColumnConfigurations(ctx: any) {\r\n return function*saveColumnConfigurations() {\r\n const dataView = getDataView(ctx);\r\n const configurationManager = getConfigurationManager(ctx);\r\n const tablePanelView = getTablePanelView(ctx);\r\n\r\n if (configurationManager.allTableConfigurations.length === 0) {\r\n return;\r\n }\r\n\r\n const activeTableConfiguration = configurationManager.activeTableConfiguration;\r\n for (const property of getProperties(ctx)) {\r\n activeTableConfiguration.updateColumnWidth(property.id, property.columnWidth);\r\n }\r\n activeTableConfiguration.sortColumnConfiguartions(tablePanelView.tablePropertyIds);\r\n\r\n yield getApi(ctx).saveObjectConfiguration({\r\n sessionFormIdentifier: getSessionId(ctx),\r\n instanceId: dataView.modelInstanceId,\r\n tableConfigurations: configurationManager.allTableConfigurations,\r\n defaultView: getActivePanelView(ctx),\r\n });\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { action, computed } from \"mobx\";\r\nimport { getDialogStack } from \"../../selectors/DialogStack/getDialogStack\";\r\nimport { IColumnConfigurationDialog } from \"./types/IColumnConfigurationDialog\";\r\nimport { ColumnsDialog, } from \"gui/Components/Dialogs/ColumnsDialog\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { ITableConfiguration } from \"./types/IConfigurationManager\";\r\nimport { runGeneratorInFlowWithHandler, runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\nimport { NewConfigurationDialog } from \"gui/Components/Dialogs/NewConfigurationDialog\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { saveColumnConfigurations } from \"model/actions/DataView/TableView/saveColumnConfigurations\";\r\n\r\nexport interface IColumnOptions {\r\n canGroup: boolean;\r\n canAggregate: boolean;\r\n entity: string;\r\n name: string;\r\n modelInstanceId: string;\r\n}\r\n\r\nexport class ColumnConfigurationDialog implements IColumnConfigurationDialog {\r\n\r\n tableConfigBeforeChanges: ITableConfiguration | undefined;\r\n\r\n getColumnOptions() {\r\n const groupingOnClient = !isLazyLoading(this);\r\n const activeTableConfiguration = this.configManager.activeTableConfiguration;\r\n const optionsMap = new Map()\r\n\r\n for (let columnConfiguration of activeTableConfiguration.columnConfigurations) {\r\n const property = this.tablePanelView.allTableProperties\r\n .find(prop => prop.id === columnConfiguration.propertyId)!;\r\n optionsMap.set(\r\n property.id,\r\n {\r\n canGroup: groupingOnClient ||\r\n (!property.isAggregatedColumn && property.fieldType !== \"DetachedField\"),\r\n canAggregate: groupingOnClient ||\r\n (!property.isAggregatedColumn && !property.isLookupColumn && property.column !== \"TagInput\"),\r\n entity: property.entity,\r\n name: property.name,\r\n modelInstanceId: property.modelInstanceId\r\n })\r\n }\r\n return optionsMap;\r\n }\r\n\r\n @computed get columnsConfiguration() {\r\n this.tableConfigBeforeChanges = this.configManager.activeTableConfiguration.deepClone();\r\n return this.configManager.activeTableConfiguration;\r\n }\r\n\r\n dialogKey = \"\";\r\n dialogId = 0;\r\n\r\n @action.bound\r\n onColumnConfClick(event: any): void {\r\n this.dialogKey = `ColumnConfigurationDialog@${this.dialogId++}`;\r\n getDialogStack(this).pushDialog(\r\n this.dialogKey,\r\n \r\n );\r\n }\r\n\r\n @action.bound\r\n onColumnConfigurationSubmit(configuration: ITableConfiguration) {\r\n const self = this;\r\n runGeneratorInFlowWithHandler({\r\n ctx: this,\r\n generator: function*() {\r\n self.onColumnConfSubmit(configuration);\r\n self.tableConfigBeforeChanges = undefined;\r\n yield*saveColumnConfigurations(self)();\r\n }()\r\n })\r\n }\r\n\r\n @action.bound onColumnConfCancel(event: any): void {\r\n this.revertChanges();\r\n getDialogStack(this).closeDialog(this.dialogKey);\r\n }\r\n\r\n private revertChanges() {\r\n if (!this.tableConfigBeforeChanges) {\r\n throw new Error(\"TableConfiguration was not backed up\")\r\n }\r\n this.configManager.activeTableConfiguration = this.tableConfigBeforeChanges;\r\n }\r\n\r\n @action.bound onSaveAsClick(event: any, configuration: ITableConfiguration): void {\r\n const closeDialog = getDialogStack(this).pushDialog(\r\n \"\",\r\n {\r\n runInFlowWithHandler({\r\n ctx: this,\r\n action: () => {\r\n this.revertChanges();\r\n this.configManager.cloneAndActivate(configuration, name);\r\n this.onColumnConfigurationSubmit(this.configManager.activeTableConfiguration);\r\n }\r\n });\r\n closeDialog();\r\n }}\r\n onCancelClick={() => {\r\n this.revertChanges();\r\n closeDialog();\r\n }}\r\n />\r\n );\r\n }\r\n\r\n @action.bound onColumnConfSubmit(configuration: ITableConfiguration): void {\r\n const groupingWasOnBefore = this.tablePanelView?.groupingConfiguration.isGrouping;\r\n configuration.apply(this.tablePanelView);\r\n const groupingIsOffNow = !this.tablePanelView?.groupingConfiguration.isGrouping;\r\n\r\n if (groupingWasOnBefore && groupingIsOffNow) {\r\n getFormScreenLifecycle(this).loadInitialData();\r\n }\r\n getDialogStack(this).closeDialog(this.dialogKey);\r\n }\r\n\r\n @computed get tablePanelView() {\r\n return getTablePanelView(this);\r\n }\r\n\r\n get configManager() {\r\n return getConfigurationManager(this);\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"../../../selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onFieldChange(ctx: any) {\r\n return flow(onFieldChangeG(ctx));\r\n}\r\n\r\nexport function onFieldChangeG(ctx: any) {\r\n return function*onFieldChange(args: { event: any, row: any[], property: IProperty, value: any }) {\r\n const {property, row, event} = args;\r\n let value = args.value;\r\n try {\r\n if (property.column === \"ComboBox\" && value !== null) {\r\n value = `${value}`;\r\n }\r\n getDataView(ctx).onFieldChange(event, row, property, value);\r\n if (\r\n property.column === \"TagInput\" ||\r\n property.column === \"ComboBox\" ||\r\n property.column === \"CheckBox\" ||\r\n property.column === \"Checklist\" ||\r\n (property.column === \"Date\" && event.type === \"click\")\r\n ) {\r\n // Flush data to session when combo value changed.\r\n getDataTable(ctx).flushFormToTable(row);\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n };\r\n}\r\n\r\nexport function changeManyFields(ctx: any) {\r\n return function*changeManyFields(values: Array<{ fieldId: string; value: any }>) {\r\n const dataTable = getDataTable(ctx);\r\n const row = getSelectedRow(ctx);\r\n if (row) {\r\n for (let {fieldId, value} of values) {\r\n dataTable.setDirtyValue(row, fieldId, value);\r\n }\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getSelectedRowIndex(ctx: any) {\r\n return getDataView(ctx).selectedRowIndex;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataTable } from \"../DataView/getDataTable\";\r\nimport { getTablePanelView } from \"./getTablePanelView\";\r\nimport { IProperty } from \"../../entities/types/IProperty\";\r\n\r\nexport function getCellValueByIdx(ctx: any) {\r\n const tablePanelView = getTablePanelView(ctx);\r\n return function getCellValueByIdx(rowIndex: number, columnIndex: number) {\r\n return tablePanelView.getCellValueByIdx(rowIndex, columnIndex);\r\n };\r\n}\r\n\r\nexport function getCellValue(ctx: any, row: any[], property: IProperty) {\r\n return getDataTable(ctx).getCellValue(row, property);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"./getTablePanelView\";\r\n\r\nexport function getSelectedColumnId(ctx: any) {\r\n return getTablePanelView(ctx).selectedColumnId;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from './getTablePanelView';\r\n\r\nexport function getSelectedColumnIndex(ctx: any) {\r\n return getTablePanelView(ctx).selectedColumnIndex;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function flushCurrentRowData(ctx: any) {\r\n return function*flushCurrentRowData(finishEditing?: boolean) {\r\n const row = getSelectedRow(ctx);\r\n if (row) {\r\n getDataTable(ctx).flushFormToTable(row);\r\n if (finishEditing) getTablePanelView(ctx).setEditing(false);\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateAllowUpdate(ctx: any, rowId: string, columnId: string) {\r\n const rowState = getRowStateById(ctx, rowId);\r\n const column = rowState ? rowState.columns.get(columnId) : undefined;\r\n const allowUpdate = column ? column.allowUpdate : undefined;\r\n return allowUpdate !== undefined ? allowUpdate : true;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"../../entities/types/IProperty\";\r\nimport { getRowStateAllowUpdate } from \"./getRowStateAllowUpdate\";\r\n\r\nexport function isReadOnly(property: IProperty, rowId: string | undefined) {\r\n return property!.readOnly || !getRowStateAllowUpdate(property, rowId || \"\", property!.id);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport CS from \"./DialogsCommon.module.css\";\r\nimport { T } from \"../../../utils/translation\";\r\n\r\n@observer\r\nexport class ChangeMasterRecordDialog extends React.Component<{\r\n screenTitle: string;\r\n onSaveClick?: (event: any) => void;\r\n onDontSaveClick?: (event: any) => void;\r\n onCancelClick?: (event: any) => void;\r\n}> {\r\n refPrimaryBtn = (elm: any) => (this.elmPrimaryBtn = elm);\r\n elmPrimaryBtn: any;\r\n\r\n componentDidMount() {\r\n setTimeout(() => {\r\n if (this.elmPrimaryBtn) {\r\n this.elmPrimaryBtn.focus?.();\r\n }\r\n }, 159);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n {T(\"Yes\", \"button_yes\")}\r\n \r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n {\" \"}\r\n {T(\"Record has been changed. Do you want to save the changes?\", \"record_changed_info\")\r\n .split(\"\\\\n\")\r\n .join(\"\\n\")}\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTableViewProperties } from \"../TablePanelView/getTableViewProperties\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getFieldErrorMessage } from \"./getFieldErrorMessage\";\r\n\r\nexport function getSelectedRowErrorMessages(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n if (!dataView.selectedRow) {\r\n return [];\r\n }\r\n return getTableViewProperties(ctx)\r\n .map(property => getFieldErrorMessage(property)(dataView.selectedRow!, property))\r\n .filter(message => message);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, flow } from \"mobx\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport React from \"react\";\r\nimport { getOpenedScreen } from \"../../selectors/getOpenedScreen\";\r\nimport { ChangeMasterRecordDialog } from \"../../../gui/Components/Dialogs/ChangeMasterRecordDialog\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { IDataView } from \"../types/IDataView\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { isInfiniteScrollingActive } from \"model/selectors/isInfiniteScrollingActive\";\r\nimport { getSelectedRowErrorMessages } from \"model/selectors/DataView/getSelectedRowErrorMessages\";\r\nimport selectors from \"model/selectors-tree\";\r\nimport { processCRUDResult } from \"../../actions/DataLoading/processCRUDResult\";\r\nimport { processActionQueryInfo } from \"model/actions/Actions/processActionQueryInfo\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\n\r\nexport function questionSaveDataAfterRecordChange(ctx: any) {\r\n return new Promise(\r\n action((resolve: (value: IQuestionChangeRecordAnswer) => void) => {\r\n const closeDialog = getDialogStack(ctx).pushDialog(\r\n \"\",\r\n {\r\n closeDialog();\r\n resolve(IQuestionChangeRecordAnswer.Yes); // eslint-disable-line @typescript-eslint/no-use-before-define\r\n }}\r\n onDontSaveClick={() => {\r\n closeDialog();\r\n resolve(IQuestionChangeRecordAnswer.No); // eslint-disable-line @typescript-eslint/no-use-before-define\r\n }}\r\n onCancelClick={() => {\r\n closeDialog();\r\n resolve(IQuestionChangeRecordAnswer.Cancel); // eslint-disable-line @typescript-eslint/no-use-before-define\r\n }}\r\n />\r\n );\r\n })\r\n );\r\n}\r\n\r\nexport enum IQuestionDeleteDataAnswer {\r\n No = 0,\r\n Yes = 1,\r\n}\r\n\r\nexport async function handleUserInputOnChangingRow(dataView: IDataView) {\r\n const api = getApi(dataView);\r\n const openedScreen = getOpenedScreen(dataView);\r\n const sessionId = getSessionId(openedScreen.content.formScreen);\r\n const formScreen = getFormScreen(dataView);\r\n\r\n if (isInfiniteScrollingActive(dataView)) {\r\n switch (await questionSaveDataAfterRecordChange(dataView)) {\r\n case IQuestionChangeRecordAnswer.Cancel: // eslint-disable-line @typescript-eslint/no-use-before-define\r\n return false;\r\n case IQuestionChangeRecordAnswer.Yes: // eslint-disable-line @typescript-eslint/no-use-before-define\r\n return runGeneratorInFlowWithHandler({\r\n ctx: dataView,\r\n generator: function*(): Generator {\r\n const queryResult = yield api.saveSessionQuery(sessionId);\r\n const processQueryInfoResult = yield*processActionQueryInfo(dataView)(\r\n queryResult as any[],\r\n formScreen.title\r\n );\r\n if (!processQueryInfoResult.canContinue) {\r\n return false;\r\n }\r\n const saveResult = yield api.saveSession(sessionId);\r\n yield*processCRUDResult(dataView, saveResult as any);\r\n return true;\r\n }()\r\n });\r\n case IQuestionChangeRecordAnswer.No: // eslint-disable-line @typescript-eslint/no-use-before-define\r\n await flow(() =>\r\n getFormScreenLifecycle(dataView).throwChangesAway(dataView)\r\n )();\r\n return true;\r\n default:\r\n throw new Error(\"Option not implemented\");\r\n }\r\n } else {\r\n const errorMessages = dataView.childBindings\r\n .map((binding) => binding.childDataView)\r\n .concat(dataView)\r\n .flatMap((dataView) => getSelectedRowErrorMessages(dataView));\r\n if (errorMessages.length > 0) {\r\n await flow(function*bla() {\r\n yield*selectors.error\r\n .getDialogController(dataView)\r\n .pushError(errorMessages.join(\"\\n\"));\r\n })();\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nenum IQuestionChangeRecordAnswer {\r\n Yes = 0,\r\n No = 1,\r\n Cancel = 2,\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { action } from \"mobx\";\r\nimport { getDialogStack } from \"model/selectors/DialogStack/getDialogStack\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\nimport S from \"./processActionQueryResult.module.scss\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\n\r\nexport interface IQueryInfo {\r\n entityName: string;\r\n fieldName: string;\r\n message: string;\r\n severity: number;\r\n}\r\n\r\nexport interface IProcessActionQueryInfoResult {\r\n canContinue: boolean;\r\n}\r\n\r\nexport function processActionQueryInfo(ctx: any) {\r\n return function*processActionQueryInfo(\r\n queryInfo: any[],\r\n title: string\r\n ): Generator {\r\n let canContinue = true;\r\n if (queryInfo.length > 0) {\r\n for (let queryInfoItem of queryInfo) {\r\n if (queryInfoItem.severity === 0) canContinue = false;\r\n }\r\n\r\n yield new Promise(\r\n action((resolve: (p?: any) => void) => {\r\n const closeDialog = getDialogStack(ctx).pushDialog(\r\n \"\",\r\n \r\n {!canContinue && (\r\n {\r\n canContinue = false;\r\n closeDialog();\r\n resolve();\r\n }}\r\n >\r\n {T(\"Ok\", \"button_ok\")}\r\n \r\n )}\r\n {canContinue && (\r\n <>\r\n {\r\n canContinue = true;\r\n closeDialog();\r\n resolve();\r\n }}\r\n >\r\n {T(\"Yes\", \"button_yes\")}\r\n \r\n {\r\n canContinue = false;\r\n closeDialog();\r\n resolve();\r\n }}\r\n >\r\n {T(\"No\", \"button_no\")}\r\n \r\n \r\n )}\r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n
\r\n {queryInfo.map((item, idx) => (\r\n
\r\n {item.severity === 1 && (\r\n
\r\n \r\n
\r\n )}\r\n {item.severity === 0 && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n
{item.message}
\r\n
\r\n ))}\r\n
\r\n {canContinue && (\r\n <>{T(\"Do you wish to continue anyway?\", \"do_you_wish_to_continue\")}\r\n )}\r\n
\r\n \r\n );\r\n })\r\n );\r\n }\r\n return {canContinue};\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, flow, observable } from \"mobx\";\r\nimport { onFieldChangeG } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { getSelectedRowIndex } from \"model/selectors/DataView/getSelectedRowIndex\";\r\nimport { getCellValue } from \"model/selectors/TablePanelView/getCellValue\";\r\nimport { getSelectedColumnId } from \"model/selectors/TablePanelView/getSelectedColumnId\";\r\nimport { getSelectedColumnIndex } from \"model/selectors/TablePanelView/getSelectedColumnIndex\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { IFilterConfiguration } from \"model/entities/types/IFilterConfiguration\";\r\nimport { IOrderingConfiguration } from \"model/entities/types/IOrderingConfiguration\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { IColumnConfigurationDialog } from \"model/entities/TablePanelView/types/IColumnConfigurationDialog\";\r\nimport {\r\n ITableCanvas,\r\n ITablePanelView,\r\n ITablePanelViewData\r\n} from \"model/entities/TablePanelView/types/ITablePanelView\";\r\nimport { IGroupingConfiguration } from \"model/entities/types/IGroupingConfiguration\";\r\nimport { IAggregationInfo } from \"model/entities/types/IAggregationInfo\";\r\nimport { AggregationType } from \"model/entities/types/AggregationType\";\r\nimport { ICellRectangle } from \"model/entities/TablePanelView/types/ICellRectangle\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { flushCurrentRowData } from \"model/actions/DataView/TableView/flushCurrentRowData\";\r\nimport { isReadOnly } from \"model/selectors/RowState/isReadOnly\";\r\nimport { FilterGroupManager } from \"model/entities/FilterGroupManager\";\r\nimport { handleUserInputOnChangingRow } from \"../FormScreenLifecycle/questionSaveDataAfterRecordChange\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getGrouper } from \"model/selectors/DataView/getGrouper\";\r\nimport { IConfigurationManager } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\n\r\nexport class TablePanelView implements ITablePanelView {\r\n $type_ITablePanelView: 1 = 1;\r\n\r\n constructor(data: ITablePanelViewData) {\r\n Object.assign(this, data);\r\n this.columnConfigurationDialog.parent = this;\r\n this.filterConfiguration.parent = this;\r\n this.filterGroupManager.parent = this;\r\n this.orderingConfiguration.parent = this;\r\n this.groupingConfiguration.parent = this;\r\n }\r\n\r\n columnConfigurationDialog: IColumnConfigurationDialog = null as any;\r\n configurationManager: IConfigurationManager = null as any;\r\n filterConfiguration: IFilterConfiguration = null as any;\r\n filterGroupManager: FilterGroupManager = null as any;\r\n orderingConfiguration: IOrderingConfiguration = null as any;\r\n groupingConfiguration: IGroupingConfiguration = null as any;\r\n rowHeight: number = null as any;\r\n firstColumn: IProperty | undefined;\r\n handleScrolling = true;\r\n\r\n @observable rectangleMap: Map> = new Map>();\r\n\r\n @observable isEditing: boolean = false;\r\n @observable fixedColumnCount: number = 0;\r\n @observable tablePropertyIds: string[] = [];\r\n @observable hiddenPropertyIds: Map = new Map();\r\n @observable columnOrderChangingTargetId: string | undefined;\r\n @observable columnOrderChangingSourceId: string | undefined;\r\n\r\n @observable _currentTooltipText?: string = undefined;\r\n @computed get currentTooltipText() {\r\n return this._currentTooltipText;\r\n }\r\n\r\n set currentTooltipText(value: string | undefined) {\r\n this._currentTooltipText = value;\r\n }\r\n\r\n parent?: any;\r\n aggregations: AggregationContainer = new AggregationContainer();\r\n\r\n @computed get propertyMap() {\r\n return new Map(this.allTableProperties.map((x) => [x.id, x] as [string, IProperty]));\r\n }\r\n\r\n @computed get allTableProperties() {\r\n return this.tablePropertyIds\r\n .map((id) => getDataTable(this).getPropertyById(id))\r\n .filter((prop) => prop) as IProperty[];\r\n }\r\n\r\n @computed get tableProperties() {\r\n return this.allTableProperties.filter((prop) => !this.hiddenPropertyIds.get(prop.id));\r\n }\r\n\r\n @observable selectedColumnId: string | undefined;\r\n\r\n @computed get selectedRowId(): string | undefined {\r\n return getDataView(this).selectedRowId;\r\n }\r\n\r\n @computed get selectedColumnIndex(): number | undefined {\r\n const idx = this.tableProperties.findIndex((prop) => prop.id === this.selectedColumnId);\r\n return idx > -1 ? idx : undefined;\r\n }\r\n\r\n @computed get selectedRowIndex(): number | undefined {\r\n return getDataView(this).selectedRowIndex;\r\n }\r\n\r\n @computed get selectedProperty(): IProperty | undefined {\r\n return this.selectedColumnId ? getDataViewPropertyById(this, this.selectedColumnId) : undefined;\r\n }\r\n\r\n @observable.ref tableCanvas: ITableCanvas | null = null;\r\n\r\n @action.bound\r\n setTableCanvas(tableCanvas: ITableCanvas | null): void {\r\n this.tableCanvas = tableCanvas;\r\n }\r\n\r\n get firstVisibleRowIndex(): number {\r\n return this.tableCanvas ? this.tableCanvas.firstVisibleRowIndex : 0;\r\n }\r\n\r\n get lastVisibleRowIndex(): number {\r\n return this.tableCanvas ? this.tableCanvas.lastVisibleRowIndex : 0;\r\n }\r\n\r\n getCellValueByIdx(rowIdx: number, columnIdx: number) {\r\n const property = this.tableProperties[columnIdx]!;\r\n const row = this.dataTable.getRowByExistingIdx(rowIdx);\r\n return this.dataTable.getCellValue(row, property);\r\n }\r\n\r\n getCellTextByIdx(rowIdx: number, columnIdx: number) {\r\n const property = this.tableProperties[columnIdx]!;\r\n const row = this.dataTable.getRowByExistingIdx(rowIdx);\r\n return this.dataTable.getCellText(row, property);\r\n }\r\n\r\n clearCurrentCellEditData() {\r\n const row = getDataView(this).selectedRow;\r\n const propertyId = this.selectedProperty?.id;\r\n if (row && propertyId) {\r\n getDataView(this).dataTable.deleteAdditionalCellData(row, propertyId);\r\n }\r\n }\r\n\r\n *onCellClick(event: any, row: any[], columnId: string, isControlInteraction: boolean): any {\r\n const dataView = getDataView(this);\r\n const rowId = this.dataTable.getRowId(row);\r\n\r\n getTablePanelView(this).setEditing(false);\r\n yield*flushCurrentRowData(this)();\r\n const isDirty = getFormScreen(dataView).isDirty;\r\n\r\n if (isDirty && dataView.selectedRowId !== rowId) {\r\n const shouldProceedToSelectRow = yield handleUserInputOnChangingRow(dataView);\r\n if (!shouldProceedToSelectRow) {\r\n return;\r\n }\r\n }\r\n yield*this.onCellClickInternal(event, row, columnId, isControlInteraction);\r\n }\r\n\r\n *onCellClickInternal(event: any, row: any[], columnId: string, isControlInteraction: boolean) {\r\n const property = this.propertyMap.get(columnId)!;\r\n if (property.column !== \"CheckBox\" || !isControlInteraction) {\r\n if (property.isLink && property.column !== \"TagInput\" && (event.ctrlKey || event.metaKey)) {\r\n yield*getDataView(this).navigateLookupLink(property, row);\r\n } else {\r\n if (this.dataTable.getRowId(row) === this.selectedRowId) {\r\n this.selectCell(this.dataTable.getRowId(row) as string, property.id);\r\n this.setEditing(true);\r\n } else {\r\n const {isEditing} = this;\r\n if (isEditing) {\r\n this.setEditing(false);\r\n }\r\n yield*this.selectCellAsync(this.dataTable.getRowId(row) as string, property.id);\r\n if (isEditing) {\r\n this.setEditing(true);\r\n }\r\n }\r\n }\r\n } else {\r\n const rowId = this.dataTable.getRowId(row);\r\n yield*this.selectCellAsync(rowId, columnId);\r\n\r\n if (!isReadOnly(property!, rowId)) {\r\n yield*onFieldChangeG(this)({\r\n event: undefined,\r\n row: row,\r\n property: property,\r\n value: !getCellValue(this, row, property),\r\n });\r\n }\r\n }\r\n if (!getGroupingConfiguration(this).isGrouping) {\r\n this.scrollToCurrentCell();\r\n }\r\n }\r\n\r\n private*selectCellAsync(rowId: string, columnId: string,) {\r\n this.selectedColumnId = columnId;\r\n const dataView = getDataView(this);\r\n if (dataView.selectedRowId === rowId) {\r\n return;\r\n }\r\n yield dataView.lifecycle.runRecordChangedReaction(function*() {\r\n yield dataView.setSelectedRowId(rowId);\r\n });\r\n }\r\n\r\n *onNoCellClick() {\r\n if (this.isEditing) {\r\n this.setEditing(false);\r\n yield*flushCurrentRowData(this)();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleTableScroll(event: any, scrollTop: number, scrollLeft: number) {\r\n if (!this.handleScrolling) {\r\n this.handleScrolling = true;\r\n return;\r\n }\r\n\r\n const _this = this;\r\n flow(function*() {\r\n if (_this.isEditing) {\r\n _this.setEditing(false);\r\n yield*flushCurrentRowData(_this)();\r\n }\r\n })();\r\n }\r\n\r\n dontHandleNextScroll() {\r\n this.handleScrolling = false;\r\n }\r\n\r\n *onOutsideTableClick() {\r\n if (this.isEditing) {\r\n this.setEditing(false);\r\n yield*flushCurrentRowData(this)();\r\n }\r\n }\r\n\r\n @action.bound selectCell(rowId: string | undefined, columnId: string | undefined) {\r\n this.selectedColumnId = columnId;\r\n getDataView(this).setSelectedRowId(rowId);\r\n }\r\n\r\n isFirstColumnSelected(): boolean {\r\n const properties = getTableViewProperties(this);\r\n const selPropId = getSelectedColumnId(this);\r\n if (!selPropId) {\r\n return false;\r\n }\r\n const idx = properties.findIndex((prop) => prop.id === selPropId);\r\n return idx === 0;\r\n }\r\n\r\n isLastColumnSelected(): boolean {\r\n const properties = getTableViewProperties(this);\r\n const selPropId = getSelectedColumnId(this);\r\n if (!selPropId) {\r\n return false;\r\n }\r\n const idx = properties.findIndex((prop) => prop.id === selPropId);\r\n return idx === properties.length - 1;\r\n }\r\n\r\n @action.bound\r\n selectNextColumn(nextRowWhenEnd?: boolean): void {\r\n const properties = getTableViewProperties(this);\r\n const selPropId = getSelectedColumnId(this);\r\n if (selPropId) {\r\n const idx = properties.findIndex((prop) => prop.id === selPropId);\r\n if (idx < properties.length - 1) {\r\n const newProp = properties[idx + 1];\r\n this.setSelectedColumnId(newProp.id);\r\n } else if (nextRowWhenEnd && properties.length > 1) {\r\n const rowId = getSelectedRowId(this);\r\n getDataView(this).selectNextRow();\r\n if (rowId !== getSelectedRowId(this)) {\r\n this.selectFirstColumn();\r\n }\r\n }\r\n }\r\n }\r\n\r\n @action.bound\r\n selectPrevColumn(prevRowWhenStart?: boolean): void {\r\n const properties = getTableViewProperties(this);\r\n const selPropId = getSelectedColumnId(this);\r\n if (selPropId) {\r\n const idx = properties.findIndex((prop) => prop.id === selPropId);\r\n if (idx > 0) {\r\n const newProp = properties[idx - 1];\r\n this.setSelectedColumnId(newProp.id);\r\n } else if (prevRowWhenStart && properties.length > 1) {\r\n const rowId = getSelectedRowId(this);\r\n getDataView(this).selectPrevRow();\r\n if (rowId !== getSelectedRowId(this)) {\r\n this.selectLastColumn();\r\n }\r\n }\r\n }\r\n }\r\n\r\n @action.bound selectFirstColumn(): void {\r\n const properties = getTableViewProperties(this);\r\n const newProp = properties[0];\r\n this.setSelectedColumnId(newProp.id);\r\n }\r\n\r\n @action.bound selectLastColumn(): void {\r\n const properties = getTableViewProperties(this);\r\n const newProp = properties[properties.length - 1];\r\n this.setSelectedColumnId(newProp.id);\r\n }\r\n\r\n @action.bound\r\n setSelectedColumnId(id: string | undefined): void {\r\n this.selectedColumnId = id;\r\n }\r\n\r\n @action.bound\r\n setEditing(state: boolean): void {\r\n this.isEditing = state;\r\n }\r\n\r\n @action.bound\r\n swapColumns(id1: string, id2: string): void {\r\n const idx1 = this.tablePropertyIds.findIndex((id) => id === id1);\r\n const idx2 = this.tablePropertyIds.findIndex((id) => id === id2);\r\n const tmp = this.tablePropertyIds[idx1];\r\n this.tablePropertyIds[idx1] = this.tablePropertyIds[idx2];\r\n this.tablePropertyIds[idx2] = tmp;\r\n }\r\n\r\n @action.bound\r\n setColumnOrderChangeAttendants(idSource: string | undefined, idTarget: string | undefined): void {\r\n this.columnOrderChangingTargetId = idTarget;\r\n this.columnOrderChangingSourceId = idSource;\r\n }\r\n\r\n subId = 0;\r\n onScrollToCurrentCellHandlers: Map void> = new Map();\r\n\r\n subOnScrollToCellShortest(fn: (rowIdx: number, columnIdx: number) => void): () => void {\r\n const myId = this.subId++;\r\n this.onScrollToCurrentCellHandlers.set(myId, fn);\r\n return () => this.onScrollToCurrentCellHandlers.delete(myId);\r\n }\r\n\r\n @action.bound scrollToCurrentRow() {\r\n const rowIdx = getSelectedRowIndex(this);\r\n if (rowIdx !== undefined) {\r\n this.triggerOnScrollToCellShortest(rowIdx, 0);\r\n }\r\n }\r\n\r\n @action.bound scrollToCurrentCell() {\r\n const rowIdx = getSelectedRowIndex(this);\r\n const columnIdx = getSelectedColumnIndex(this);\r\n if (rowIdx !== undefined && columnIdx !== undefined) {\r\n this.triggerOnScrollToCellShortest(rowIdx, columnIdx);\r\n }\r\n }\r\n\r\n @action.bound triggerOnScrollToCellShortest(rowIdx: number, columnIdx: number) {\r\n for (let h of this.onScrollToCurrentCellHandlers.values()) h(rowIdx, columnIdx);\r\n }\r\n\r\n onFocusTableHandlers: Map void> = new Map();\r\n\r\n subOnFocusTable(fn: () => void): () => void {\r\n const myId = this.subId++;\r\n this.onFocusTableHandlers.set(myId, fn);\r\n return () => this.onFocusTableHandlers.delete(myId);\r\n }\r\n\r\n @action.bound\r\n setPropertyHidden(propertyId: string, state: boolean): void {\r\n if (state) {\r\n this.hiddenPropertyIds.set(propertyId, true);\r\n } else {\r\n this.hiddenPropertyIds.delete(propertyId);\r\n }\r\n }\r\n\r\n @action.bound triggerOnFocusTable() {\r\n for (let h of this.onFocusTableHandlers.values()) h();\r\n }\r\n\r\n @computed get dataTable() {\r\n return getDataTable(this);\r\n }\r\n\r\n getCellRectangle(rowIndex: number, columnIndex: number) {\r\n const groupingConfig = getGroupingConfiguration(this);\r\n let cellOffset = {row: 0, column: 0};\r\n if (groupingConfig.isGrouping) {\r\n const rowId = getDataView(this).selectedRowId;\r\n cellOffset = getGrouper(this).getCellOffset(rowId!);\r\n }\r\n if (!this.rectangleMap.has(rowIndex + cellOffset.row)) {\r\n return {\r\n columnLeft: 0,\r\n columnWidth: 0,\r\n rowTop: 0,\r\n rowHeight: 0,\r\n };\r\n }\r\n return this.rectangleMap.get(rowIndex + cellOffset.row)!.get(columnIndex + cellOffset.column)!;\r\n }\r\n\r\n setCellRectangle(rowId: number, columnId: number, rectangle: ICellRectangle) {\r\n if (!this.rectangleMap.has(rowId)) {\r\n this.rectangleMap.set(rowId, new Map());\r\n }\r\n this.rectangleMap.get(rowId)!.set(columnId, rectangle);\r\n }\r\n}\r\n\r\nexport class AggregationContainer {\r\n @observable aggregationTypes: Map = new Map();\r\n\r\n getType(columnId: string) {\r\n return this.aggregationTypes.get(columnId);\r\n }\r\n\r\n setType(columnId: string, aggregationType: AggregationType | undefined) {\r\n if (!aggregationType && this.aggregationTypes.has(columnId)) {\r\n this.aggregationTypes.delete(columnId);\r\n return;\r\n }\r\n if (!aggregationType && !this.aggregationTypes.has(columnId)) return;\r\n\r\n this.aggregationTypes.set(columnId, aggregationType);\r\n }\r\n\r\n @computed get aggregationList(): IAggregationInfo[] {\r\n // @ts-ignore\r\n return Array.from(this.aggregationTypes.entries())\r\n .filter((entry) => entry[1])\r\n .map((entry) => {\r\n return {\r\n ColumnName: entry[0],\r\n AggregationType: entry[1],\r\n };\r\n });\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observable } from \"mobx\";\r\n\r\nlet currentIdent = 1;\r\n\r\nexport function getIdent() {\r\n return currentIdent++;\r\n}\r\n\r\nexport interface IIId {\r\n $iid: number;\r\n}\r\n\r\nexport class ContribArray {\r\n @observable items = new Map();\r\n\r\n put(item: T & IIId) {\r\n this.items.set(item.$iid, item);\r\n return () => this.items.delete(item.$iid);\r\n }\r\n\r\n del(item: IIId) {\r\n this.items.delete(item.$iid);\r\n }\r\n\r\n [Symbol.iterator]() {\r\n return this.items.values()[Symbol.iterator]();\r\n }\r\n\r\n asArray() {\r\n return Array.from(this);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getIdent } from \"utils/common\";\r\n\r\nexport function find(xmlObj: any, pred: (node: any) => boolean) {\r\n function recursive(n: any) {\r\n if (xmlObj !== n && pred(n)) {\r\n result.push(n);\r\n }\r\n if (n.elements) {\r\n for (let chn of n.elements) {\r\n recursive(chn);\r\n }\r\n }\r\n }\r\n\r\n const result: any[] = [];\r\n recursive(xmlObj);\r\n return result;\r\n}\r\n\r\nexport function findStopping(xmlObj: any, pred: (node: any) => boolean) {\r\n function recursive(n: any) {\r\n if (xmlObj !== n && pred(n)) {\r\n result.push(n);\r\n } else if (n.elements) {\r\n for (let chn of n.elements) {\r\n recursive(chn);\r\n }\r\n }\r\n }\r\n\r\n const result: any[] = [];\r\n recursive(xmlObj);\r\n return result;\r\n}\r\n\r\nexport function assignIIds(xmlTree: any) {\r\n function recursive(node: any) {\r\n node.$iid = getIdent();\r\n if (node.elements) {\r\n for (let e of node.elements) recursive(e);\r\n }\r\n }\r\n\r\n recursive(xmlTree);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { IGroupingConfiguration, IGroupingSettings } from \"./types/IGroupingConfiguration\";\r\nimport { GroupingUnit } from \"./types/GroupingUnit\";\r\n\r\nexport class GroupingConfiguration implements IGroupingConfiguration {\r\n @observable groupingSettings: Map = new Map();\r\n onOffHandlers: (() => void)[] = [];\r\n\r\n @computed get isGrouping() {\r\n return this.groupingSettings.size > 0;\r\n }\r\n\r\n @computed get groupingColumnCount() {\r\n return this.groupingSettings.size;\r\n }\r\n\r\n @computed get orderedGroupingColumnSettings() {\r\n const entries = Array.from(this.groupingSettings.entries());\r\n entries.sort((a, b) => a[1].groupIndex - b[1].groupIndex);\r\n return entries.map((item) => item[1]);\r\n }\r\n\r\n @computed get firstGroupingColumn() {\r\n return this.orderedGroupingColumnSettings[0];\r\n }\r\n\r\n nextColumnToGroupBy(columnId: string) {\r\n const currentIndex = this.groupingSettings.get(columnId)?.groupIndex;\r\n if (!currentIndex) {\r\n return undefined\r\n }\r\n const nextIndex = currentIndex + 1;\r\n const nextEntry = Array.from(this.groupingSettings.entries())\r\n .find(entry => entry[1].groupIndex === nextIndex);\r\n return nextEntry ? nextEntry[1] : undefined\r\n }\r\n\r\n @action.bound\r\n setGrouping(columnId: string, groupingUnit: GroupingUnit | undefined, groupingIndex: number): void {\r\n const wasEmpty = this.groupingSettings.size === 0\r\n this.groupingSettings.set(\r\n columnId,\r\n {\r\n columnId: columnId,\r\n groupingUnit: groupingUnit,\r\n groupIndex: groupingIndex\r\n }\r\n );\r\n if (wasEmpty) {\r\n this.notifyOnOffHandlers();\r\n }\r\n }\r\n\r\n @action.bound\r\n clearGrouping(): void {\r\n this.groupingSettings.clear();\r\n this.notifyOnOffHandlers();\r\n }\r\n\r\n parent?: any;\r\n\r\n notifyOnOffHandlers() {\r\n for (let handler of this.onOffHandlers) {\r\n handler();\r\n }\r\n }\r\n\r\n registerGroupingOnOffHandler(handler: () => void): void {\r\n this.onOffHandlers.push(handler);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { computed, observable } from \"mobx\";\r\nimport { IGroupTreeNode } from \"./types\";\r\nimport { IGrouper } from \"../../../../../model/entities/types/IGrouper\";\r\nimport { IAggregation } from \"../../../../../model/entities/types/IAggregation\";\r\nimport { getOrderingConfiguration } from \"../../../../../model/selectors/DataView/getOrderingConfiguration\";\r\nimport {\r\n InfiniteScrollLoader,\r\n SCROLL_ROW_CHUNK\r\n} from \"../../../../Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { getDataView } from \"../../../../../model/selectors/DataView/getDataView\";\r\nimport { joinWithAND, toFilterItem } from \"../../../../../model/entities/OrigamApiHelpers\";\r\nimport { OpenGroupVisibleRowsMonitor } from \"../../../../Workbench/ScreenArea/TableView/VisibleRowsMonitor\";\r\nimport { getDataTable } from \"../../../../../model/selectors/DataView/getDataTable\";\r\nimport { ScrollRowContainer } from \"../../../../../model/entities/ScrollRowContainer\";\r\nimport { GroupingUnit } from \"model/entities/types/GroupingUnit\";\r\nimport moment from \"moment\";\r\n\r\nexport interface IGroupItemData {\r\n childGroups: IGroupTreeNode[];\r\n childRows: any[][];\r\n columnId: string;\r\n columnValue: string;\r\n columnDisplayValue: string;\r\n groupLabel: string;\r\n parent: IGroupTreeNode | undefined;\r\n rowCount: number;\r\n aggregations: IAggregation[] | undefined;\r\n grouper: IGrouper;\r\n}\r\n\r\nexport interface IServerSideGroupItemData extends IGroupItemData {\r\n groupingUnit: GroupingUnit | undefined;\r\n}\r\n\r\nexport interface IClientSideGroupItemData extends IGroupItemData {\r\n expansionListener: (item: ClientSideGroupItem) => void;\r\n}\r\n\r\nexport class ClientSideGroupItem implements IClientSideGroupItemData, IGroupTreeNode {\r\n constructor(data: IClientSideGroupItemData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n isInfinitelyScrolled = false;\r\n expansionListener: (item: ClientSideGroupItem) => void = null as any;\r\n @observable childGroups: IGroupTreeNode[] = null as any;\r\n @observable _childRows: any[][] = null as any;\r\n columnId: string = null as any;\r\n columnValue: string = null as any;\r\n groupLabel: string = null as any;\r\n parent: IGroupTreeNode | undefined = null as any;\r\n rowCount: number = null as any;\r\n columnDisplayValue: string = null as any;\r\n aggregations: IAggregation[] | undefined = undefined;\r\n grouper: IGrouper = null as any;\r\n groupFilters: string[] = [];\r\n\r\n get level() {\r\n return this.allParents.length;\r\n }\r\n\r\n @observable\r\n private _isExpanded = false;\r\n\r\n public get isExpanded() {\r\n return this._isExpanded;\r\n }\r\n\r\n public set isExpanded(value) {\r\n this._isExpanded = value;\r\n this.expansionListener(this);\r\n }\r\n\r\n get allChildGroups(): IGroupTreeNode[] {\r\n return allChildGroups(this);\r\n }\r\n\r\n get allParents(): IGroupTreeNode[] {\r\n return getAllParents(this);\r\n }\r\n\r\n substituteRecord(row: any[]): void {\r\n }\r\n\r\n getRowIndex(rowId: string): number | undefined {\r\n return this._childRows.findIndex(row => getDataTable(this.grouper).getRowId(row) === rowId);\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return this._childRows.find(row => getDataTable(this.grouper).getRowId(row) === id);\r\n }\r\n\r\n @computed get childRows() {\r\n const orderingConfiguration = getOrderingConfiguration(this.grouper);\r\n\r\n if (orderingConfiguration.userOrderings.length === 0) {\r\n return this._childRows;\r\n } else {\r\n return this._childRows.slice().sort(orderingConfiguration.orderingFunction());\r\n }\r\n }\r\n\r\n set childRows(rows: any[][]) {\r\n this._childRows = rows;\r\n }\r\n\r\n composeGroupingFilter(): string {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n dispose(): void {\r\n }\r\n}\r\n\r\nexport class ServerSideGroupItem implements IGroupTreeNode {\r\n constructor(data: IServerSideGroupItemData) {\r\n const dataTable = getDataTable(data.grouper);\r\n this._childRows = new ScrollRowContainer(\r\n (row: any[]) => dataTable.getRowId(row),\r\n dataTable);\r\n Object.assign(this, data);\r\n\r\n const dataView = getDataView(this.grouper);\r\n this.scrollLoader = new InfiniteScrollLoader({\r\n ctx: this.grouper,\r\n gridDimensions: dataView.gridDimensions,\r\n scrollState: dataView.scrollState,\r\n rowsContainer: this._childRows,\r\n groupFilter: this.composeGroupingFilter(),\r\n visibleRowsMonitor: new OpenGroupVisibleRowsMonitor(this.grouper, dataView.gridDimensions, dataView.scrollState)\r\n })\r\n this.scrollLoader.registerAppendListener(data => dataTable.appendRecords(data))\r\n this.scrollLoader.registerPrependListener(data => dataTable.appendRecords(data))\r\n }\r\n\r\n @observable childGroups: IGroupTreeNode[] = null as any;\r\n columnId: string = null as any;\r\n columnValue: string = null as any;\r\n groupLabel: string = null as any;\r\n parent: IGroupTreeNode | undefined = null as any;\r\n rowCount: number = null as any;\r\n columnDisplayValue: string = null as any;\r\n aggregations: IAggregation[] | undefined = undefined;\r\n grouper: IGrouper = null as any;\r\n scrollLoader: InfiniteScrollLoader;\r\n _childRows: ScrollRowContainer;\r\n groupingUnit: GroupingUnit = null as any;\r\n\r\n\r\n get level() {\r\n return this.allParents.length;\r\n }\r\n\r\n get isInfinitelyScrolled() {\r\n return this.rowCount >= SCROLL_ROW_CHUNK && this.isExpanded && this.childRows.length > 0\r\n }\r\n\r\n get allChildGroups(): IGroupTreeNode[] {\r\n return allChildGroups(this);\r\n }\r\n\r\n get allParents(): IGroupTreeNode[] {\r\n return getAllParents(this);\r\n }\r\n\r\n substituteRecord(row: any[]): any {\r\n this._childRows.substitute(row);\r\n }\r\n\r\n getRowIndex(rowId: string): number | undefined {\r\n return this.childRows.findIndex(row => getDataTable(this.grouper).getRowId(row) === rowId);\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return this.childRows.find(row => getDataTable(this.grouper).getRowId(row) === id);\r\n }\r\n\r\n @computed get childRows() {\r\n return this._childRows.rows;\r\n }\r\n\r\n set childRows(rows: any[][]) {\r\n if (rows.length > 0) {\r\n this.scrollLoader.start();\r\n getDataTable(this.grouper).appendRecords(rows);\r\n }\r\n this._childRows.set(rows);\r\n }\r\n\r\n get groupFilters() {\r\n if (this.groupingUnit !== undefined) {\r\n const momentValueStart = moment(this.columnValue);\r\n const momentValueEnd = moment(this.columnValue);\r\n switch (this.groupingUnit) {\r\n case GroupingUnit.Year:\r\n momentValueEnd.set({'year': momentValueStart.year() + 1});\r\n break;\r\n case GroupingUnit.Month:\r\n momentValueEnd.set({'month': momentValueStart.month() + 1});\r\n break;\r\n case GroupingUnit.Day:\r\n momentValueEnd.set({'day': momentValueStart.day() + 1});\r\n break;\r\n case GroupingUnit.Hour:\r\n momentValueEnd.set({'hour': momentValueStart.hour() + 1});\r\n break;\r\n case GroupingUnit.Minute:\r\n momentValueEnd.set({'minute': momentValueStart.minute() + 1});\r\n break;\r\n default:\r\n throw new Error(\"Filter generation for groupingUnit:\" + this.groupingUnit + \" not implemented\");\r\n }\r\n return [\r\n toFilterItem(this.columnId, null, \"gte\", momentValueStart),\r\n toFilterItem(this.columnId, null, \"lt\", momentValueEnd)\r\n ];\r\n } else {\r\n return [toFilterItem(this.columnId, null, \"eq\", this.columnValue)]\r\n }\r\n }\r\n\r\n composeGroupingFilter(): string {\r\n const filters = getAllParents(this)\r\n .concat([this])\r\n .flatMap(groupNode => groupNode.groupFilters)\r\n return joinWithAND(filters);\r\n }\r\n\r\n @observable private _isExpanded = false;\r\n\r\n get isExpanded(): boolean {\r\n return this._isExpanded;\r\n }\r\n\r\n set isExpanded(value: boolean) {\r\n if (!value) {\r\n this.grouper.notifyGroupClosed(this);\r\n }\r\n this._isExpanded = value;\r\n }\r\n\r\n dispose(): void {\r\n this.scrollLoader.dispose();\r\n }\r\n}\r\n\r\nfunction getAllParents(group: IGroupTreeNode) {\r\n const parents: IGroupTreeNode[] = [];\r\n let parent = group.parent;\r\n while (parent) {\r\n parents.push(parent);\r\n parent = parent.parent;\r\n }\r\n return parents;\r\n}\r\n\r\nfunction allChildGroups(group: IGroupTreeNode): IGroupTreeNode[] {\r\n const allChildGroups = group.childGroups.flatMap(childGroup => childGroup.allChildGroups)\r\n return [...group.childGroups, ...allChildGroups];\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGrouper } from \"./types/IGrouper\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { IProperty } from \"./types/IProperty\";\r\nimport { ICellOffset, IGroupTreeNode } from \"gui/Components/ScreenElements/Table/TableRendering/types\";\r\n\r\n\r\nexport function getAllLoadedValuesOfProp(property: IProperty, grouper: IGrouper): Set {\r\n const dataTable = getDataTable(grouper);\r\n return new Set(\r\n grouper.allGroups\r\n .filter(group => group.isExpanded)\r\n .flatMap(group => group.childRows)\r\n .map((row) => dataTable.getCellValue(row, property))\r\n .filter((row) => row)\r\n );\r\n}\r\n\r\n\r\nexport function getRowById(grouper: IGrouper, id: string): any[] | undefined {\r\n return grouper.allGroups\r\n .map(group => group.getRowById(id))\r\n .find(row => row)\r\n}\r\n\r\nexport function getRowIndex(grouper: IGrouper, rowId: string): number | undefined {\r\n return grouper.allGroups\r\n .filter(group => group.childGroups.length === 0)\r\n .map(group => group.getRowIndex(rowId))\r\n .find(index => index !== -1);\r\n}\r\n\r\nexport function getRowCount(grouper: IGrouper, rowId: string) {\r\n return grouper.allGroups\r\n .find(group => group.childGroups.length === 0 && group.getRowById(rowId))\r\n ?.rowCount\r\n}\r\n\r\nexport function getCellOffset(grouper: IGrouper, rowId: string): ICellOffset {\r\n const containingGroup = grouper.allGroups\r\n .filter(group => group.getRowById(rowId) && group.isExpanded)\r\n .sort((g1, g2) => g2.level - g1.level)[0]\r\n\r\n let rowOffset = 0;\r\n for (const group of grouper.allGroups) {\r\n rowOffset++;\r\n if (group === containingGroup) {\r\n return {\r\n row: rowOffset,\r\n column: group.level + 1\r\n }\r\n }\r\n if (group.isExpanded && !group.childGroups.some(child => child.isExpanded)) {\r\n rowOffset += group.childRows.length;\r\n }\r\n }\r\n return {\r\n row: 0,\r\n column: 0\r\n }\r\n}\r\n\r\nexport function getPreviousRowId(grouper: IGrouper, rowId: string): string {\r\n const group = grouper.allGroups\r\n .find(group => group.getRowById(rowId))!;\r\n const indexInGroup = group.getRowIndex(rowId);\r\n if (indexInGroup !== undefined && indexInGroup !== 0) {\r\n const previousRow = group.childRows[indexInGroup - 1]\r\n return getDataTable(grouper).getRowId(previousRow);\r\n } else {\r\n const previousGroup = getPreviousNonEmptyGroup(grouper, group);\r\n if (previousGroup === undefined) {\r\n return rowId;\r\n }\r\n const previousRow = previousGroup.childRows[previousGroup.childRows.length - 1];\r\n return getDataTable(grouper).getRowId(previousRow);\r\n }\r\n}\r\n\r\nexport function getNextRowId(grouper: IGrouper, rowId: string): string {\r\n const group = grouper.allGroups\r\n .find(group => group.getRowById(rowId))!;\r\n const indexInGroup = group.getRowIndex(rowId);\r\n if (indexInGroup !== undefined && indexInGroup !== (group.rowCount - 1)) {\r\n const nextRow = group.childRows[indexInGroup + 1]\r\n return getDataTable(grouper).getRowId(nextRow);\r\n } else {\r\n const nextGroup = getNextNonEmptyGroup(grouper, group);\r\n if (nextGroup === undefined) {\r\n return rowId;\r\n }\r\n const nextRow = nextGroup.childRows[0];\r\n return getDataTable(grouper).getRowId(nextRow);\r\n }\r\n}\r\n\r\nfunction getPreviousNonEmptyGroup(grouper: IGrouper, currentGroup: IGroupTreeNode) {\r\n const sameLevelGroups = grouper.allGroups\r\n .filter(group => currentGroup.level === group.level && group.rowCount > 0 && group.isExpanded)\r\n const currentGroupIndex = sameLevelGroups.indexOf(currentGroup);\r\n return currentGroupIndex === 0\r\n ? undefined\r\n : sameLevelGroups[currentGroupIndex - 1];\r\n}\r\n\r\nfunction getNextNonEmptyGroup(grouper: IGrouper, currentGroup: IGroupTreeNode) {\r\n const sameLevelGroups = grouper.allGroups\r\n .filter(group => currentGroup.level === group.level && group.rowCount > 0 && group.isExpanded)\r\n const currentGroupIndex = sameLevelGroups.indexOf(currentGroup);\r\n return currentGroupIndex === sameLevelGroups.length - 1\r\n ? undefined\r\n : sameLevelGroups[currentGroupIndex + 1];\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Moment } from \"moment\";\r\nimport { GroupingUnit } from \"./types/GroupingUnit\";\r\nimport { getLocaleFromCookie } from \"utils/cookies\";\r\n\r\n\r\nexport interface IGroupData {\r\n value: any;\r\n label: string;\r\n rows: any[][];\r\n\r\n compare(other: IGroupData): number;\r\n}\r\n\r\nexport class GenericGroupData implements IGroupData {\r\n private readonly _label: any;\r\n\r\n constructor(public value: string, label: any) {\r\n this._label = Array.isArray(label) ? label.join(\", \") : label;\r\n }\r\n\r\n public get label() {\r\n return this._label;\r\n }\r\n\r\n public rows: any[][] = [];\r\n\r\n compare(other: IGroupData): number {\r\n if (this.label && other.label) {\r\n if (typeof this.label === \"string\") {\r\n return this.label.localeCompare(other.label, getLocaleFromCookie());\r\n } else {\r\n return this.label > other.label ? 1 : -1;\r\n }\r\n } else if (!this.label) {\r\n return -1;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n}\r\n\r\nexport class DateGroupData implements IGroupData {\r\n constructor(\r\n public value: Moment | undefined,\r\n public label: string\r\n ) {\r\n }\r\n\r\n public rows: any[][] = [];\r\n\r\n public static create(value: Moment, groupingUnit: GroupingUnit): IGroupData {\r\n if (!value.isValid()) {\r\n new DateGroupData(undefined, \"\");\r\n }\r\n\r\n let groupLabel = \"\";\r\n switch (groupingUnit) {\r\n case GroupingUnit.Year:\r\n value.set({'month': 0, 'date': 1, 'hour': 0, 'minute': 0, 'second': 0});\r\n groupLabel = value.format(\"YYYY\");\r\n break;\r\n case GroupingUnit.Month:\r\n value.set({'date': 1, 'hour': 0, 'minute': 0, 'second': 0});\r\n groupLabel = value.format(\"YYYY-MM\");\r\n break;\r\n case GroupingUnit.Day:\r\n value.set({'hour': 0, 'minute': 0, 'second': 0});\r\n groupLabel = value.format(\"YYYY-MM-DD\");\r\n break;\r\n case GroupingUnit.Hour:\r\n value.set({'minute': 0, 'second': 0});\r\n groupLabel = value.format(\"YYYY-MM-DD h:00\");\r\n break;\r\n case GroupingUnit.Minute:\r\n value.set({'second': 0});\r\n groupLabel = value.format(\"YYYY-MM-DD h:mm\");\r\n break;\r\n }\r\n return new DateGroupData(value, groupLabel);\r\n }\r\n\r\n compare(other: IGroupData): number {\r\n if (this.value && !other.value) return -1;\r\n if (!this.value && other.value) return 1;\r\n if (!this.value && !other.value) return 0;\r\n if (this.value!.isValid() && other.value.isValid()) {\r\n if (this.value! > other.value) {\r\n return 1;\r\n } else if (this.value! < other.value) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n } else if (!this.value) {\r\n return -1;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum ILifetime {\r\n PerDependency,\r\n PerLifetimeScope,\r\n Single,\r\n}\r\n\r\nclass Registration {\r\n regCreator?: (...args: any[]) => TInstance;\r\n regCreatorEx?: (container: Container, ...args: any[]) => TInstance;\r\n regClass?: new (...args: any[]) => TInstance;\r\n\r\n typeSymbol?: ITypeSymbol;\r\n instancePerDependency?: boolean;\r\n instancePerLifetimeScope?: boolean;\r\n instancePerNamedLifetimeScope?: string;\r\n instancePerSwitchedLifetimeScope?: ($cont: Container) => Container | undefined;\r\n singleInstance?: boolean;\r\n\r\n onPreparing: Array<(args: IOnPreparingArgs) => void> = [];\r\n onActivating: Array<(args: IOnActivatingArgs) => void> = [];\r\n onActivated: Array<(args: IOnActivatedArgs) => void> = [];\r\n onRelease: Array<(args: IOnReleaseArgs) => void> = [];\r\n}\r\n\r\nclass Registrator implements IRegistrator {\r\n constructor(private registration: Registration) {\r\n }\r\n\r\n transientInstance(): IRegistrator {\r\n this.registration.instancePerDependency = true;\r\n return this;\r\n }\r\n\r\n singleInstance(): IRegistrator {\r\n this.registration.singleInstance = true;\r\n return this;\r\n }\r\n\r\n scopedInstance(\r\n nameOrSwitchingFunction?: string | (($cont: Container) => Container | undefined)\r\n ): IRegistrator {\r\n if (nameOrSwitchingFunction) {\r\n if (typeof nameOrSwitchingFunction === \"function\") {\r\n this.registration.instancePerSwitchedLifetimeScope = nameOrSwitchingFunction;\r\n } else {\r\n this.registration.instancePerNamedLifetimeScope = nameOrSwitchingFunction;\r\n }\r\n } else {\r\n this.registration.instancePerLifetimeScope = true;\r\n }\r\n return this;\r\n }\r\n\r\n onActivated(handler: (args: IOnActivatedArgs) => void): IRegistrator {\r\n this.registration.onActivated.push(handler);\r\n return this;\r\n }\r\n\r\n onActivating(handler: (args: IOnActivatingArgs) => void): IRegistrator {\r\n this.registration.onActivating.push(handler);\r\n return this;\r\n }\r\n\r\n onPreparing(handler: (args: IOnPreparingArgs) => void): IRegistrator {\r\n this.registration.onPreparing.push(handler);\r\n return this;\r\n }\r\n\r\n onRelease(handler: (args: IOnReleaseArgs) => void): IRegistrator {\r\n this.registration.onRelease.push(handler);\r\n return this;\r\n }\r\n\r\n forward(\r\n fn: (registrator: Registrator) => Registrator\r\n ): Registrator {\r\n return fn(this);\r\n }\r\n}\r\n\r\nexport class Container implements IContainer {\r\n constructor(private options: { defaultLifetime: ILifetime }) {\r\n }\r\n\r\n private registrations: Map, Array>> = new Map();\r\n public instances: Map, any> = new Map();\r\n private transientInstances: any[] = [];\r\n private disposeEvents = new WeakMap) => void>>();\r\n\r\n private parent?: Container;\r\n private children: Container[] = [];\r\n public scopeName?: string;\r\n\r\n private isDisposed = false;\r\n\r\n scheduledOnActivated: Array<() => void> = [];\r\n\r\n register(\r\n sym: ITypeSymbol,\r\n creator?: (...creatorArgs: any[]) => TInstance,\r\n creatorEx?: (container: Container, ...creatorArgs: any[]) => TInstance\r\n ): IRegistrator {\r\n const registration = new Registration();\r\n registration.typeSymbol = sym;\r\n registration.regCreator = creator;\r\n registration.regCreatorEx = creatorEx;\r\n if (!this.registrations.has(sym)) {\r\n this.registrations.set(sym, []);\r\n }\r\n const registrations = this.registrations.get(sym);\r\n if (registrations) registrations.push(registration);\r\n const registrator = new Registrator(registration);\r\n return registrator;\r\n }\r\n\r\n registerClass(\r\n sym: ITypeSymbol,\r\n regClass: new (...args: any[]) => TInstance\r\n ): IRegistrator {\r\n const registration = new Registration();\r\n registration.typeSymbol = sym;\r\n registration.regClass = regClass;\r\n if (!this.registrations.has(sym)) {\r\n this.registrations.set(sym, []);\r\n }\r\n const registrations = this.registrations.get(sym);\r\n if (registrations) registrations.push(registration);\r\n const registrator = new Registrator(registration);\r\n return registrator;\r\n }\r\n\r\n checkDisposed() {\r\n if (this.isDisposed) {\r\n debugger;\r\n throw new Error(\"Trying to resolve from a disposed container.\");\r\n }\r\n }\r\n\r\n resolveAll(sym: ITypeSymbol, creatorArgs?: any[]): TInstance[] {\r\n this.checkDisposed();\r\n pushCurrentContainer(this);\r\n try {\r\n const registrations = this.findAllRegistrations(sym);\r\n return registrations.map((registration) =>\r\n this.resolveByRegistration(registration, creatorArgs || [])\r\n );\r\n } finally {\r\n popCurrentContainer();\r\n }\r\n }\r\n\r\n resolve(sym: ITypeSymbol, ...creatorArgs: any[]): TInstance {\r\n this.checkDisposed();\r\n pushCurrentContainer(this);\r\n try {\r\n const registration = this.findRegistration(sym);\r\n if (registration) {\r\n return this.resolveByRegistration(registration, creatorArgs || []);\r\n } else {\r\n debugger;\r\n throw new Error(\"No registration for symbol \" + sym.symName);\r\n }\r\n } finally {\r\n popCurrentContainer();\r\n }\r\n }\r\n\r\n resolveOptional(\r\n sym: ITypeSymbol,\r\n ...creatorArgs: any[]\r\n ): TInstance | undefined {\r\n this.checkDisposed();\r\n pushCurrentContainer(this);\r\n try {\r\n const registration = this.findRegistration(sym);\r\n if (registration) {\r\n return this.resolveByRegistration(registration, creatorArgs || []);\r\n } else {\r\n return;\r\n }\r\n } finally {\r\n popCurrentContainer();\r\n }\r\n }\r\n\r\n resolveByRegistration(registration: Registration, creatorArgs: any[]) {\r\n //console.log('Resolve:', registration.typeSymbol)\r\n for (let h of registration.onPreparing) h({container: this});\r\n if (registration.instancePerDependency) {\r\n return this.providePerDependency(registration, creatorArgs);\r\n } else if (registration.singleInstance) {\r\n return this.provideSingle(registration, creatorArgs);\r\n } else if (registration.instancePerLifetimeScope) {\r\n return this.providePerLifetimeScope(registration, creatorArgs);\r\n } else if (registration.instancePerSwitchedLifetimeScope) {\r\n return this.providePerSwitchedLifetimeScope(registration, creatorArgs);\r\n } else if (registration.instancePerNamedLifetimeScope) {\r\n return this.providePerNamedLifetimeScope(registration, creatorArgs);\r\n } else if (this.options.defaultLifetime === ILifetime.PerDependency) {\r\n return this.providePerDependency(registration, creatorArgs);\r\n } else if (this.options.defaultLifetime === ILifetime.PerLifetimeScope) {\r\n return this.providePerLifetimeScope(registration, creatorArgs);\r\n } else if (this.options.defaultLifetime === ILifetime.Single) {\r\n return this.provideSingle(registration, creatorArgs);\r\n } else {\r\n // This branch never entered?\r\n return this.providePerDependency(registration, creatorArgs);\r\n }\r\n }\r\n\r\n resolveFromCreator(creator: (...args: any[]) => TInstance) {\r\n this.checkDisposed();\r\n pushCurrentContainer(this);\r\n try {\r\n const instance = creator();\r\n registerScope(instance, this);\r\n // this.transientInstances.push(instance);\r\n return instance;\r\n } finally {\r\n popCurrentContainer();\r\n }\r\n }\r\n\r\n newFromRegistration(registration: Registration, creatorArgs: any[]) {\r\n // console.log(\"NewFromRegistration\", this.scopeName, registration.typeSymbol);\r\n try {\r\n if (registration.regClass) {\r\n pushCreator(registration.regClass);\r\n return new registration.regClass(...creatorArgs);\r\n }\r\n if (registration.regCreator) {\r\n pushCreator(registration.regCreator);\r\n return registration.regCreator(...creatorArgs);\r\n }\r\n if (registration.regCreatorEx) {\r\n pushCreator(registration.regCreatorEx);\r\n return registration.regCreatorEx(this, ...creatorArgs);\r\n }\r\n debugger;\r\n throw new Error(\"Neither class nor creator registered.\");\r\n } finally {\r\n popCreator();\r\n }\r\n }\r\n\r\n providePerDependency(registration: Registration, creatorArgs: any[]) {\r\n let instance = this.newFromRegistration(registration, creatorArgs);\r\n registerScope(instance, this);\r\n if (registration.onRelease.length > 0) {\r\n this.disposeEvents.set(instance, registration.onRelease);\r\n }\r\n for (let h of registration.onActivating)\r\n h({\r\n container: this,\r\n instance,\r\n replaceInstance(newInstance) { // eslint-disable-line no-loop-func\r\n instance = newInstance;\r\n },\r\n });\r\n for (let h of registration.onActivated) {\r\n getBottomContainer().scheduledOnActivated.push(() => h({container: this, instance})); // eslint-disable-line no-loop-func\r\n }\r\n this.transientInstances.push(instance);\r\n\r\n return instance;\r\n }\r\n\r\n provideSingle(registration: Registration, creatorArgs: any[]) {\r\n const container = this.findRootContainer();\r\n return this.provideFromContainer(container, registration, creatorArgs);\r\n }\r\n\r\n providePerLifetimeScope(registration: Registration, creatorArgs: any[]) {\r\n const container = this;\r\n return this.provideFromContainer(container, registration, creatorArgs);\r\n }\r\n\r\n providePerSwitchedLifetimeScope(registration: Registration, creatorArgs: any[]) {\r\n const container = registration.instancePerSwitchedLifetimeScope!(this);\r\n if (container) {\r\n return this.provideFromContainer(container, registration, creatorArgs);\r\n } else {\r\n throw new Error(`Scope named ${registration.instancePerNamedLifetimeScope} not opened.`);\r\n }\r\n }\r\n\r\n providePerNamedLifetimeScope(registration: Registration, creatorArgs: any[]) {\r\n const container = this.findFirstNamedContainer(registration.instancePerNamedLifetimeScope!);\r\n if (container) {\r\n return this.provideFromContainer(container, registration, creatorArgs);\r\n } else {\r\n throw new Error(`Scope named ${registration.instancePerNamedLifetimeScope} not opened.`);\r\n }\r\n }\r\n\r\n provideFromContainer(\r\n container: Container,\r\n registration: Registration,\r\n creatorArgs: any[]\r\n ) {\r\n // console.log(\"ProvideFromContainer\", container.scopeName, registration.typeSymbol);\r\n if (container.instances.has(registration.typeSymbol!)) {\r\n return container.instances.get(registration.typeSymbol!)!;\r\n } else {\r\n let instance = this.newFromRegistration(registration, creatorArgs);\r\n registerScope(instance, this);\r\n if (registration.onRelease.length > 0) {\r\n this.disposeEvents.set(instance, registration.onRelease);\r\n }\r\n for (let h of registration.onActivating)\r\n h({\r\n container: this,\r\n instance,\r\n replaceInstance(newInstance) { // eslint-disable-line no-loop-func\r\n instance = newInstance;\r\n },\r\n });\r\n container.instances.set(registration.typeSymbol!, instance);\r\n for (let h of registration.onActivated) {\r\n getBottomContainer().scheduledOnActivated.push(() => h({container: this, instance})); // eslint-disable-line no-loop-func\r\n }\r\n return instance;\r\n }\r\n }\r\n\r\n beginLifetimeScope(scopeName?: string, detached?: boolean): Container {\r\n //console.log(\"Entering lifetime scope:\", scopeName);\r\n const container = new Container(this.options);\r\n container.scopeName = scopeName;\r\n container.parent = this;\r\n if (!detached) this.children.push(container);\r\n return container;\r\n }\r\n\r\n dispose() {\r\n // TODO: Dispose registered objects\r\n //console.log(\"Disposing lifetime scope:\", this.scopeName);\r\n // You might want to use TypeSymbol instance call to resolve something during disposal.\r\n this.triggerOnThisScopeWillDispose();\r\n pushCurrentContainer(this);\r\n // console.log(\"Disposing\", this);\r\n try {\r\n const parent = this.parent;\r\n for (let instance of this.instances.values()) {\r\n const disposeEvent = this.disposeEvents.get(instance);\r\n if (disposeEvent) {\r\n for (let h of disposeEvent) h({instance, container: this});\r\n }\r\n // console.log(\"Disposing cached\", instance);\r\n if (instance.dispose) instance.dispose();\r\n }\r\n this.instances.clear();\r\n for (let instance of this.transientInstances) {\r\n const disposeEvent = this.disposeEvents.get(instance);\r\n if (disposeEvent) {\r\n for (let h of disposeEvent) h({instance, container: this});\r\n }\r\n // console.log(\"Disposing transient\", instance);\r\n if (instance.dispose) instance.dispose();\r\n }\r\n this.transientInstances.length = 0;\r\n this.isDisposed = true;\r\n if (this.parent) {\r\n const idx = this.parent.children.findIndex((item) => item === this);\r\n if (idx > -1) this.parent.children.splice(idx, 1);\r\n this.parent = undefined;\r\n }\r\n return parent;\r\n } finally {\r\n popCurrentContainer();\r\n this.triggerOnThisScopeDisposed();\r\n }\r\n }\r\n\r\n disposeWithChildren() {\r\n for (let child of [...this.children]) {\r\n child.disposeWithChildren();\r\n }\r\n this.dispose();\r\n }\r\n\r\n findAllRegistrations(sym: ITypeSymbol): Array> {\r\n let registrations: Array> = [];\r\n if (this.parent) {\r\n registrations.push(...this.parent.findAllRegistrations(sym));\r\n }\r\n if (this.registrations.has(sym)) {\r\n registrations.push(...this.registrations.get(sym)!);\r\n }\r\n return registrations;\r\n }\r\n\r\n findRegistration(sym: ITypeSymbol): Registration | undefined {\r\n if (this.registrations.has(sym)) {\r\n return this.registrations.get(sym)!.slice(-1)[0];\r\n }\r\n if (this.parent) {\r\n return this.parent.findRegistration(sym);\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n findRootContainer(): Container {\r\n if (this.parent) return this.parent.findRootContainer();\r\n return this;\r\n }\r\n\r\n findFirstNamedContainer(name: string): Container | undefined {\r\n if (this.scopeName === name) return this;\r\n if (this.parent) return this.parent.findFirstNamedContainer(name);\r\n return;\r\n }\r\n\r\n findFirstContainer(pred: (cont: Container) => boolean): Container | undefined {\r\n if (pred(this)) return this;\r\n if (this.parent) return this.parent.findFirstContainer(pred);\r\n return;\r\n }\r\n\r\n resolveFlowFinished() {\r\n for (let h of this.scheduledOnActivated) h();\r\n this.scheduledOnActivated.length = 0;\r\n }\r\n\r\n _onThisScopeDisposed: Array<($cont: Container) => void> = [];\r\n\r\n onThisScopeDisposed(handler: ($cont: Container) => void) {\r\n this._onThisScopeDisposed.push(handler);\r\n }\r\n\r\n triggerOnThisScopeDisposed() {\r\n for (let h of this._onThisScopeDisposed) h(this);\r\n }\r\n\r\n _onThisScopeWillDispose: Array<($cont: Container) => void> = [];\r\n\r\n onThisScopeWillDispose(handler: ($cont: Container) => void) {\r\n this._onThisScopeWillDispose.push(handler);\r\n }\r\n\r\n triggerOnThisScopeWillDispose() {\r\n for (let h of this._onThisScopeWillDispose) h(this);\r\n }\r\n}\r\n\r\nexport interface IContainer {\r\n register(\r\n sym: ITypeSymbol,\r\n creator?: () => TInstance,\r\n creatorEx?: (container: Container) => TInstance\r\n ): IRegistrator;\r\n\r\n resolve(sym: ITypeSymbol): TInstance;\r\n\r\n resolveAll(sym: ITypeSymbol): TInstance[];\r\n\r\n resolveOptional(sym: ITypeSymbol): TInstance | undefined;\r\n\r\n resolveFromCreator(creator: (...args: any[]) => TInstance): TInstance;\r\n\r\n beginLifetimeScope(scopeName?: string): IContainer;\r\n\r\n dispose(): void;\r\n}\r\n\r\nexport interface IRegistrator {\r\n transientInstance(): IRegistrator;\r\n\r\n singleInstance(): IRegistrator;\r\n\r\n scopedInstance(\r\n name?: string | (($cont: Container) => Container | undefined)\r\n ): IRegistrator;\r\n\r\n onActivated(handler: (args: IOnActivatedArgs) => void): IRegistrator;\r\n\r\n onActivating(handler: (args: IOnActivatingArgs) => void): IRegistrator;\r\n\r\n onPreparing(handler: (args: IOnPreparingArgs) => void): IRegistrator;\r\n\r\n onRelease(handler: (args: IOnReleaseArgs) => void): IRegistrator;\r\n\r\n forward(\r\n fn: (registrator: IRegistrator) => IRegistrator\r\n ): IRegistrator;\r\n}\r\n\r\nexport interface IOnPreparingArgs {\r\n container: IContainer;\r\n}\r\n\r\nexport interface IOnReleaseArgs {\r\n container: IContainer;\r\n instance: TInstance;\r\n}\r\n\r\nexport interface IOnActivatingArgs {\r\n container: IContainer;\r\n instance: TInstance;\r\n\r\n replaceInstance(newInstance: TInstance): void;\r\n}\r\n\r\nexport interface IOnActivatedArgs {\r\n container: IContainer;\r\n instance: TInstance;\r\n}\r\n\r\nexport interface ITypeSymbol {\r\n (): TInstance;\r\n\r\n symName: string;\r\n injectAsGetter?: boolean;\r\n injectAsCreator?: boolean;\r\n usingContainer?: Container;\r\n injectEnumeration?: boolean;\r\n enumerationCacheKey: any;\r\n}\r\n\r\nlet _currentContainerStack: Container[] = new Array(10);\r\nlet _currentContainerStackTop = -1;\r\n\r\nexport function isContainerFlow() {\r\n return _currentContainerStackTop > -1;\r\n}\r\n\r\nexport function getTopContainer() {\r\n return _currentContainerStack[_currentContainerStackTop];\r\n}\r\n\r\nexport function getBottomContainer() {\r\n return _currentContainerStack[0];\r\n}\r\n\r\nexport function pushCurrentContainer(currentContainer: Container) {\r\n _currentContainerStackTop++;\r\n _currentContainerStack[_currentContainerStackTop] = currentContainer;\r\n}\r\n\r\nexport function popCurrentContainer() {\r\n const container = _currentContainerStack[_currentContainerStackTop];\r\n _currentContainerStack[_currentContainerStackTop] = undefined!;\r\n _currentContainerStackTop--;\r\n if (_currentContainerStackTop === -1) {\r\n container.resolveFlowFinished();\r\n }\r\n return container;\r\n}\r\n\r\nexport function getScopePath(container?: Container) {\r\n if (!container) container = getTopContainer();\r\n const result: Container[] = [];\r\n while (container) {\r\n result.push(container);\r\n container = (container as any).parent;\r\n }\r\n return result;\r\n}\r\n\r\nlet _creatorStack: any[] = new Array(10);\r\nlet _creatorStackTop = -1;\r\n\r\nfunction pushCreator(creator: any) {\r\n _creatorStackTop++;\r\n _creatorStack[_creatorStackTop] = creator;\r\n}\r\n\r\nfunction popCreator() {\r\n _creatorStack[_creatorStackTop] = undefined;\r\n _creatorStackTop--;\r\n}\r\n\r\nexport function getCreatorStack() {\r\n return _creatorStack.slice(0, _creatorStackTop + 1).reverse();\r\n}\r\n\r\nexport function TypeSymbol(symName: string): ITypeSymbol {\r\n const resolve = (): TInstance => {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n return container.resolve(resolve as any);\r\n };\r\n resolve.symName = symName;\r\n resolve.toString = () => `TypeSymbol <${symName}>`;\r\n resolve.enumerationCacheKey = {};\r\n return resolve;\r\n}\r\n\r\nexport function Func(tys: ITypeSymbol) {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n const resolve = (): ((...creatorArgs: any[]) => TInstance) => {\r\n return (...creatorArgs: any[]) => {\r\n const overrideContainer = getTopContainer();\r\n return (overrideContainer || container).resolve(tys as any, ...creatorArgs);\r\n };\r\n };\r\n resolve.symName = tys.symName;\r\n resolve.toString = () => `Func <${tys.toString()}>`;\r\n return resolve;\r\n}\r\n\r\nexport function Optional(tys: ITypeSymbol) {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n const resolve = (): TInstance | undefined => {\r\n const overrideContainer = getTopContainer();\r\n return (overrideContainer || container).resolveOptional(tys as any);\r\n };\r\n resolve.symName = tys.symName;\r\n resolve.toString = () => `Optional <${tys.toString()}>`;\r\n return resolve;\r\n}\r\n\r\nexport function Owned(tys: ITypeSymbol, scopeName?: string) {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n const resolve = (): ((creatorArgs?: any[]) => TInstance) => {\r\n let scope: Container | undefined;\r\n const creator = (creatorArgs?: any[]) => {\r\n scope = container.beginLifetimeScope(scopeName);\r\n return scope.resolve(tys as any, creatorArgs);\r\n };\r\n creator.dispose = () => {\r\n if (scope) {\r\n scope.dispose();\r\n }\r\n };\r\n return creator;\r\n };\r\n resolve.symName = tys.symName;\r\n resolve.toString = () => `Owned <${tys.toString()}>`;\r\n return resolve;\r\n}\r\n\r\n/*\r\nexport function Enumeration(tys: ITypeSymbol) {\r\n const resolve = (): TInstance[] => {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n return container.resolveAll(tys);\r\n };\r\n resolve.symName = tys.symName;\r\n resolve.toString = () => `Enumeration <${tys.toString()}>`;\r\n return resolve;\r\n}*/\r\n\r\nexport function Getter(tys: ITypeSymbol) {\r\n tys.injectAsGetter = true;\r\n return tys;\r\n}\r\n\r\nexport function InjectContainer() {\r\n const container = getTopContainer();\r\n if (!container) throw new Error(\"No resolution flow active.\");\r\n return container;\r\n}\r\n\r\nconst _registeredScopes = new Map();\r\n\r\nexport function registerScope(instance: any, scope: Container) {\r\n try {\r\n _registeredScopes.set(instance, scope);\r\n } catch (e) {\r\n // When resolving primitive value, it cannot be inserted into weakmap\r\n // Nor will we want to know, which scope it comes from.\r\n }\r\n}\r\n\r\nexport function scopeFor(instance: any): Container | undefined {\r\n return _registeredScopes.get(instance);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { IGrouper } from \"./types/IGrouper\";\r\nimport { comparer, flow, IReactionDisposer, observable, reaction } from \"mobx\";\r\nimport { ICellOffset, IGroupTreeNode } from \"gui/Components/ScreenElements/Table/TableRendering/types\";\r\nimport { ServerSideGroupItem } from \"gui/Components/ScreenElements/Table/TableRendering/GroupItem\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getOrderingConfiguration } from \"model/selectors/DataView/getOrderingConfiguration\";\r\nimport { joinWithAND } from \"./OrigamApiHelpers\";\r\nimport { parseAggregations } from \"./Aggregatioins\";\r\nimport { getUserFilters } from \"model/selectors/DataView/getUserFilters\";\r\nimport { getFilterConfiguration } from \"model/selectors/DataView/getFilterConfiguration\";\r\nimport { getCellOffset, getNextRowId, getPreviousRowId, getRowById, getRowIndex } from \"./GrouperCommon\";\r\nimport _ from \"lodash\";\r\nimport { IGroupingSettings } from \"./types/IGroupingConfiguration\";\r\nimport { DateGroupData, GenericGroupData, IGroupData } from \"./DateGroupData\";\r\nimport moment from \"moment\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\n\r\nexport class ServerSideGrouper implements IGrouper {\r\n @observable.shallow topLevelGroups: IGroupTreeNode[] = [];\r\n parent?: any = null;\r\n disposers: IReactionDisposer[] = [];\r\n groupDisposers: Map = new Map()\r\n @observable refreshTrigger = 0;\r\n\r\n start() {\r\n this.disposers.push(\r\n reaction(\r\n () => [\r\n Array.from(getGroupingConfiguration(this).groupingSettings.values()),\r\n Array.from(getGroupingConfiguration(this).groupingSettings.keys()),\r\n this.refreshTrigger],\r\n () => this.loadGroupsDebounced(),\r\n {fireImmediately: true, equals: comparer.structural, delay: 50})\r\n );\r\n }\r\n\r\n get allGroups() {\r\n return this.topLevelGroups.flatMap(group => [group, ...group.allChildGroups]);\r\n }\r\n\r\n loadGroupsDebounced = _.debounce(this.loadGroupsImm, 10);\r\n\r\n loadGroupsImm() {\r\n const self = this;\r\n runGeneratorInFlowWithHandler({ctx: this, generator: self.loadGroups()});\r\n }\r\n\r\n private*loadGroups(): any {\r\n const firstGroupingColumn = getGroupingConfiguration(this).firstGroupingColumn;\r\n if (!firstGroupingColumn) {\r\n this.topLevelGroups.length = 0;\r\n return;\r\n }\r\n const expandedGroupDisplayValues = this.allGroups\r\n .filter(group => group.isExpanded)\r\n .map(group => group.columnDisplayValue)\r\n const dataView = getDataView(this);\r\n const property = getDataTable(this).getPropertyById(firstGroupingColumn.columnId);\r\n const lookupId = property && property.lookup && property.lookup.lookupId;\r\n const aggregations = getTablePanelView(this).aggregations.aggregationList;\r\n const groupData = yield getFormScreenLifecycle(this).loadGroups(dataView, firstGroupingColumn, lookupId, aggregations)\r\n this.topLevelGroups = this.group(groupData, firstGroupingColumn.columnId, undefined);\r\n yield*this.loadAndExpandChildren(this.topLevelGroups, expandedGroupDisplayValues);\r\n }\r\n\r\n private*loadAndExpandChildren(childGroups: IGroupTreeNode[], expandedGroupDisplayValues: string[]): Generator {\r\n for (const group of childGroups) {\r\n if (expandedGroupDisplayValues.includes(group.columnDisplayValue)) {\r\n group.isExpanded = true;\r\n yield*this.loadChildren(group);\r\n yield*this.loadAndExpandChildren(group.childGroups, expandedGroupDisplayValues)\r\n }\r\n }\r\n }\r\n\r\n substituteRecord(row: any[]): void {\r\n this.allGroups.map(group => group.substituteRecord(row))\r\n }\r\n\r\n refresh() {\r\n this.refreshTrigger++;\r\n }\r\n\r\n getRowIndex(rowId: string): number | undefined {\r\n return getRowIndex(this, rowId);\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return getRowById(this, id);\r\n }\r\n\r\n getTotalRowCount(rowId: string): number | undefined {\r\n return this.allGroups\r\n .find(group => group.getRowById(rowId))?.rowCount;\r\n }\r\n\r\n getCellOffset(rowId: string): ICellOffset {\r\n return getCellOffset(this, rowId);\r\n }\r\n\r\n getNextRowId(rowId: string): string {\r\n return getNextRowId(this, rowId);\r\n }\r\n\r\n getPreviousRowId(rowId: string): string {\r\n return getPreviousRowId(this, rowId);\r\n }\r\n\r\n notifyGroupClosed(group: IGroupTreeNode) {\r\n if (this.groupDisposers.has(group)) {\r\n this.groupDisposers.get(group)!();\r\n this.groupDisposers.delete(group);\r\n }\r\n }\r\n\r\n *loadChildren(groupHeader: IGroupTreeNode) {\r\n if (this.groupDisposers.has(groupHeader)) {\r\n this.groupDisposers.get(groupHeader)!();\r\n }\r\n this.groupDisposers.set(\r\n groupHeader,\r\n reaction(\r\n () => [\r\n getGroupingConfiguration(this).nextColumnToGroupBy(groupHeader.columnId),\r\n this.composeFinalFilter(groupHeader),\r\n [...getFilterConfiguration(this).activeFilters],\r\n [...getTablePanelView(this).aggregations.aggregationList],\r\n getOrderingConfiguration(this).groupChildrenOrdering\r\n ],\r\n () => this.loadChildrenReactionDebounced(groupHeader),\r\n )\r\n );\r\n yield*this.reload(groupHeader);\r\n }\r\n\r\n loadChildrenReactionDebounced = _.debounce(this.loadChildrenReaction, 10);\r\n\r\n private loadChildrenReaction(group: IGroupTreeNode) {\r\n flow(() => this.reload(group))();\r\n }\r\n\r\n private*reload(group: IGroupTreeNode): any {\r\n const groupingConfiguration = getGroupingConfiguration(this);\r\n const nextColumnSettings = groupingConfiguration.nextColumnToGroupBy(group.columnId);\r\n const dataView = getDataView(this);\r\n const filter = this.composeFinalFilter(group);\r\n const lifeCycle = getFormScreenLifecycle(this);\r\n const aggregations = getTablePanelView(this).aggregations.aggregationList;\r\n const orderingConfiguration = getOrderingConfiguration(this);\r\n if (nextColumnSettings) {\r\n const property = getDataTable(this).getPropertyById(nextColumnSettings.columnId);\r\n const lookupId = property && property.lookup && property.lookup.lookupId;\r\n const groupData = yield lifeCycle.loadChildGroups(dataView, filter, nextColumnSettings, aggregations, lookupId)\r\n group.childGroups = this.group(groupData, nextColumnSettings.columnId, group);\r\n } else {\r\n const rows = yield lifeCycle.loadChildRows(dataView, filter, orderingConfiguration.groupChildrenOrdering)\r\n group.childRows = rows;\r\n }\r\n }\r\n\r\n composeFinalFilter(rowGroup: IGroupTreeNode) {\r\n const groupingFilter = rowGroup.composeGroupingFilter();\r\n const userFilters = getUserFilters({ctx: this, excludePropertyId: rowGroup.columnId});\r\n\r\n return userFilters\r\n ? joinWithAND([groupingFilter, userFilters])\r\n : groupingFilter;\r\n }\r\n\r\n\r\n group(groupData: any[], columnId: string, parent: IGroupTreeNode | undefined): IGroupTreeNode[] {\r\n const groupingConfiguration = getGroupingConfiguration(this);\r\n const groupingSettings = groupingConfiguration.groupingSettings.get(columnId);\r\n const level = groupingSettings?.groupIndex;\r\n\r\n if (!level || !groupingSettings) {\r\n throw new Error(\"Cannot find grouping index for column: \" + columnId);\r\n }\r\n\r\n let dataTable = getDataTable(this);\r\n const property = dataTable.getPropertyById(columnId);\r\n\r\n return groupData.map((groupDataItem) => {\r\n const groupData = this.getGroupData(groupDataItem, groupingSettings);\r\n return new ServerSideGroupItem({\r\n childGroups: [] as IGroupTreeNode[],\r\n childRows: [] as any[][],\r\n columnId: columnId,\r\n groupLabel: property!.name,\r\n rowCount: groupDataItem[\"groupCount\"] as number,\r\n parent: parent,\r\n columnValue: groupData.value,\r\n columnDisplayValue: groupData.label,\r\n aggregations: parseAggregations(groupDataItem[\"aggregations\"]),\r\n groupingUnit: groupingSettings.groupingUnit,\r\n grouper: this,\r\n });\r\n });\r\n }\r\n\r\n getGroupData(groupDataItem: any, groupingSettings: IGroupingSettings): IGroupData {\r\n if (!groupDataItem) {\r\n new DateGroupData(undefined, \"\");\r\n }\r\n if (groupingSettings.groupingUnit !== undefined) {\r\n\r\n const yearValue = groupDataItem[groupingSettings.columnId + \"_year\"];\r\n const monthValue = groupDataItem[groupingSettings.columnId + \"_month\"]\r\n ? groupDataItem[groupingSettings.columnId + \"_month\"] - 1\r\n : 0;\r\n const dayValue = groupDataItem[groupingSettings.columnId + \"_day\"] ?? 1\r\n const hourValue = groupDataItem[groupingSettings.columnId + \"_hour\"] ?? 0;\r\n const minuteValue = groupDataItem[groupingSettings.columnId + \"_minute\"] ?? 0;\r\n\r\n const value = moment({y: yearValue, M: monthValue, d: dayValue, h: hourValue, m: minuteValue, s: 0})\r\n return DateGroupData.create(value, groupingSettings.groupingUnit)\r\n } else {\r\n return new GenericGroupData(\r\n groupDataItem[groupingSettings.columnId],\r\n groupDataItem[\"groupCaption\"] ?? groupDataItem[groupingSettings.columnId]\r\n );\r\n }\r\n }\r\n\r\n dispose() {\r\n for (let disposer of this.disposers) {\r\n disposer();\r\n }\r\n this.allGroups.forEach(group => group.dispose())\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IGrouper } from \"./types/IGrouper\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { ICellOffset, IGroupTreeNode } from \"gui/Components/ScreenElements/Table/TableRendering/types\";\r\nimport { ClientSideGroupItem } from \"gui/Components/ScreenElements/Table/TableRendering/GroupItem\";\r\nimport { getTablePanelView } from \"../selectors/TablePanelView/getTablePanelView\";\r\nimport { IAggregationInfo } from \"./types/IAggregationInfo\";\r\nimport { computed } from \"mobx\";\r\nimport { AggregationType } from \"./types/AggregationType\";\r\nimport { getCellOffset, getNextRowId, getPreviousRowId, getRowById, getRowCount, getRowIndex } from \"./GrouperCommon\";\r\nimport { IGroupingSettings } from \"./types/IGroupingConfiguration\";\r\nimport { DateGroupData, GenericGroupData, IGroupData } from \"./DateGroupData\";\r\nimport moment from \"moment\";\r\nimport { getOrderingConfiguration } from \"model/selectors/DataView/getOrderingConfiguration\";\r\nimport { IOrderByDirection } from \"./types/IOrderingConfiguration\";\r\n\r\nexport class ClientSideGrouper implements IGrouper {\r\n parent?: any = null;\r\n expandedGroupDisplayValues: Set = new Set();\r\n\r\n @computed\r\n get topLevelGroups() {\r\n const firstGroupingColumn = getGroupingConfiguration(this).firstGroupingColumn;\r\n if (firstGroupingColumn === undefined) {\r\n return [];\r\n }\r\n const dataTable = getDataTable(this);\r\n const groups = this.makeGroups(undefined, dataTable.rows, firstGroupingColumn);\r\n this.loadRecursively(groups);\r\n return groups;\r\n }\r\n\r\n get allGroups() {\r\n return this.topLevelGroups.flatMap(group => [group, ...group.allChildGroups]);\r\n }\r\n\r\n substituteRecord(row: any[]): void {\r\n }\r\n\r\n getCellOffset(rowId: string): ICellOffset {\r\n return getCellOffset(this, rowId);\r\n }\r\n\r\n getRowIndex(rowId: string): number | undefined {\r\n return getRowIndex(this, rowId);\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return getRowById(this, id);\r\n }\r\n\r\n getTotalRowCount(rowId: string): number | undefined {\r\n return getRowCount(this, rowId);\r\n }\r\n\r\n getNextRowId(rowId: string): string {\r\n return getNextRowId(this, rowId);\r\n }\r\n\r\n getPreviousRowId(rowId: string): string {\r\n return getPreviousRowId(this, rowId);\r\n }\r\n\r\n loadRecursively(groups: IGroupTreeNode[]) {\r\n for (let group of groups) {\r\n if (this.expandedGroupDisplayValues.has(group.columnDisplayValue)) {\r\n group.isExpanded = true;\r\n this.loadChildrenInternal(group);\r\n this.loadRecursively(group.childGroups);\r\n }\r\n }\r\n }\r\n\r\n expansionListener(item: ClientSideGroupItem) {\r\n if (item.isExpanded) {\r\n this.expandedGroupDisplayValues.add(item.columnDisplayValue);\r\n } else {\r\n this.expandedGroupDisplayValues.delete(item.columnDisplayValue);\r\n }\r\n }\r\n\r\n makeGroups(parent: IGroupTreeNode | undefined, rows: any[][], groupingColumnSettings: IGroupingSettings): IGroupTreeNode[] {\r\n const dataTable = getDataTable(this);\r\n const property = dataTable.getPropertyById(groupingColumnSettings.columnId);\r\n const orderingConfig = getOrderingConfiguration(this);\r\n const orderingDirection = orderingConfig.orderings\r\n .find(ordering => ordering.columnId === groupingColumnSettings.columnId)\r\n ?.direction\r\n ?? IOrderByDirection.ASC;\r\n\r\n return this.groupToGroupDataList(groupingColumnSettings, rows)\r\n .sort((a, b) =>\r\n orderingDirection === IOrderByDirection.ASC\r\n ? a.compare(b)\r\n : -a.compare(b))\r\n .map((groupData) => {\r\n return new ClientSideGroupItem({\r\n childGroups: [] as IGroupTreeNode[],\r\n childRows: groupData.rows,\r\n columnId: groupingColumnSettings.columnId,\r\n groupLabel: property!.name,\r\n rowCount: groupData.rows.length,\r\n parent: parent,\r\n columnValue: groupData.label,\r\n columnDisplayValue: property ? dataTable.resolveCellText(property, groupData.label) : groupData.label,\r\n aggregations: this.calcAggregations(groupData.rows),\r\n grouper: this,\r\n expansionListener: this.expansionListener.bind(this)\r\n });\r\n });\r\n }\r\n\r\n private groupToGroupDataList(groupingSettings: IGroupingSettings | undefined, rows: any[][]) {\r\n if (!groupingSettings) {\r\n return [];\r\n }\r\n\r\n const index = this.findDataIndex(groupingSettings.columnId);\r\n const groupMap = new Map();\r\n for (let row of rows) {\r\n const groupData = groupingSettings.groupingUnit === undefined\r\n ? new GenericGroupData(row[index], row[index])\r\n : DateGroupData.create(moment(row[index]), groupingSettings.groupingUnit)\r\n if (!groupMap.has(groupData.label)) {\r\n groupMap.set(groupData.label, groupData);\r\n }\r\n groupMap.get(groupData.label)!.rows!.push(row);\r\n }\r\n\r\n return Array.from(groupMap.values());\r\n }\r\n\r\n calcAggregations(rows: any[][]) {\r\n return getTablePanelView(this).aggregations.aggregationList.map((aggregationInfo) => {\r\n return {\r\n columnId: aggregationInfo.ColumnName,\r\n type: aggregationInfo.AggregationType,\r\n value: this.calcAggregation(aggregationInfo, rows),\r\n };\r\n });\r\n }\r\n\r\n private calcAggregation(aggregationInfo: IAggregationInfo, rows: any[][]) {\r\n const index = this.findDataIndex(aggregationInfo.ColumnName);\r\n const valuesToAggregate = rows.map((row) => row[index]);\r\n\r\n switch (aggregationInfo.AggregationType) {\r\n case AggregationType.SUM:\r\n return valuesToAggregate.reduce((a, b) => a + b, 0);\r\n case AggregationType.AVG:\r\n return valuesToAggregate.reduce((a, b) => a + b, 0) / rows.length;\r\n case AggregationType.MIN:\r\n return Math.min(...valuesToAggregate);\r\n case AggregationType.MAX:\r\n return Math.max(...valuesToAggregate);\r\n default:\r\n throw new Error(\"Aggregation type not implemented: \" + aggregationInfo.AggregationType);\r\n }\r\n }\r\n\r\n findDataIndex(columnName: string) {\r\n const dataTable = getDataTable(this);\r\n const property = dataTable.getPropertyById(columnName);\r\n if (!property) {\r\n return 0;\r\n }\r\n return property.dataIndex;\r\n }\r\n\r\n *loadChildren(group: IGroupTreeNode) {\r\n this.loadChildrenInternal(group);\r\n }\r\n\r\n loadChildrenInternal(group: IGroupTreeNode) {\r\n const groupingConfiguration = getGroupingConfiguration(this);\r\n const nextColumnName = groupingConfiguration.nextColumnToGroupBy(group.columnId);\r\n\r\n if (nextColumnName) {\r\n group.childGroups = this.makeGroups(group, group.childRows, nextColumnName);\r\n }\r\n }\r\n\r\n\r\n notifyGroupClosed(group: IGroupTreeNode) {\r\n }\r\n\r\n start(): void {\r\n }\r\n}\r\n\r\n\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from 'react';\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { Observer } from \"mobx-react\";\r\nimport { IRenderable } from \"modules/CommonTypes\";\r\nimport { ContribArray } from \"utils/common\";\r\nimport { IDataViewToolbarContribItem } from \"./DataViewTypes\";\r\n\r\nexport class DataViewBodyUI {\r\n contrib = new ContribArray();\r\n\r\n render() {\r\n return {() => <>{this.contrib.asArray().map((item) => item.render())}};\r\n }\r\n}\r\n\r\nexport const IDataViewBodyUI = TypeSymbol(\"DataViewBodyUI\");\r\n\r\n\r\nexport class DataViewToolbarUI {\r\n contrib = new ContribArray();\r\n\r\n renderSection(section: string) {\r\n return (\r\n \r\n {() => (\r\n <>\r\n {this.contrib\r\n .asArray()\r\n .filter((item) => item.section === section)\r\n .map((item) => item.render())}\r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const IDataViewToolbarUI = TypeSymbol(\"DataViewToolbarUI\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IRenderable } from \"modules/CommonTypes\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { DataView } from 'model/entities/DataView';\r\n\r\nexport const SectionViewSwitchers = \"SectionViewSwitchers\";\r\n\r\nexport interface IDataViewToolbarContribItem extends IRenderable {\r\n section: string;\r\n}\r\n\r\nexport const IDataView = TypeSymbol(\"IDataView\");","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport Measure, { ContentRect } from \"react-measure\";\r\nimport S from \"./Dropdowner.module.scss\";\r\nimport { action, observable } from \"mobx\";\r\nimport { observer, Observer } from \"mobx-react\";\r\n\r\nclass DroppedBox extends React.Component<{\r\n triggerRect: ContentRect;\r\n dropdownRect: ContentRect;\r\n dropdownRef: any;\r\n openEvent?: MouseEvent;\r\n onCloseRequest?: (event: any) => void;\r\n onOutsideInteraction?: (event: any) => void;\r\n}> {\r\n elmDropdown: HTMLDivElement | null = null;\r\n refDropdown = (elm: HTMLDivElement | null) => {\r\n this.elmDropdown = elm;\r\n this.props.dropdownRef(elm);\r\n };\r\n\r\n isStillMounted = false;\r\n\r\n componentDidMount() {\r\n this.isStillMounted = true;\r\n setTimeout(() => {\r\n if (this.isStillMounted) {\r\n window.addEventListener(\"mousedown\", this.handleMaybeClose);\r\n window.addEventListener(\"mousewheel\", this.handleMaybeClose);\r\n }\r\n });\r\n }\r\n\r\n componentWillUnmount() {\r\n this.isStillMounted = false;\r\n window.removeEventListener(\"mousedown\", this.handleMaybeClose);\r\n window.removeEventListener(\"mousewheel\", this.handleMaybeClose);\r\n }\r\n\r\n @action.bound\r\n handleMaybeClose(event: any) {\r\n if (this.elmDropdown && !this.elmDropdown.contains(event.target)) {\r\n this.props.onOutsideInteraction?.(event);\r\n this.props.onCloseRequest && this.props.onCloseRequest(event);\r\n }\r\n }\r\n\r\n calcPosition() {\r\n let style: any = {};\r\n\r\n const viewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\r\n const viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\r\n\r\n const tBounds = this.props.triggerRect.bounds!;\r\n const dBounds = this.props.dropdownRect.bounds!;\r\n\r\n if (tBounds.top + tBounds.height + dBounds.height + 20 < viewportHeight) {\r\n style.top = tBounds.top + tBounds.height || 0;\r\n } else {\r\n style.top = tBounds.top - dBounds.height || 0;\r\n }\r\n\r\n if (tBounds!.left + dBounds.width + 20 < viewportWidth) {\r\n style.left = tBounds.left || 0;\r\n } else {\r\n style.left = tBounds.left + tBounds.width - dBounds.width || 0;\r\n }\r\n return style;\r\n }\r\n\r\n render() {\r\n const style: any = this.props.openEvent\r\n ? {left: this.props.openEvent.clientX, top: this.props.openEvent.clientY}\r\n : this.calcPosition();\r\n\r\n return ReactDOM.createPortal(\r\n
\r\n {this.props.children}\r\n
,\r\n document.getElementById(\"dropdown-portal\")!\r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class Dropdowner extends React.Component<{\r\n className?: string;\r\n style?: any;\r\n trigger: (args: {\r\n refTrigger: any;\r\n measure: () => void;\r\n setDropped: (state: boolean, event?: any) => void;\r\n isDropped: boolean;\r\n }) => React.ReactNode;\r\n content: (args: { setDropped: (state: boolean) => void }) => React.ReactNode;\r\n onDroppedDown?: () => void;\r\n onDroppedUp?: () => void;\r\n onContainerMouseDown?(event: any): void;\r\n onOutsideInteraction?(event: any): void;\r\n}> {\r\n refMeasTrigger = (elm: any) => (this.elmMeasTrigger = elm);\r\n elmMeasTrigger: any | null = null;\r\n\r\n refMeasDropdown = (elm: any) => (this.elmMeasDropdown = elm);\r\n elmMeasDropdown: any | null = null;\r\n\r\n @observable _isDropped = false;\r\n openEvent: any;\r\n\r\n get isDropped() {\r\n return this._isDropped;\r\n }\r\n\r\n set isDropped(value: boolean) {\r\n if (window.localStorage.getItem(\"debugKeepDropdownOpen\") && !value) return;\r\n this._isDropped = value;\r\n }\r\n\r\n @action.bound\r\n setDropped(state: boolean, event?: any) {\r\n event?.persist();\r\n this.openEvent = event;\r\n if (!this.isDropped && state) {\r\n this.isDropped = state;\r\n this.reMeasure();\r\n this.props.onDroppedDown && this.props.onDroppedDown();\r\n } else if (this.isDropped && !state) {\r\n this.isDropped = state;\r\n this.props.onDroppedUp && this.props.onDroppedUp();\r\n }\r\n }\r\n\r\n @action.bound\r\n windowMouseWheel(event: any) {\r\n this.setDropped(false);\r\n }\r\n\r\n @action.bound\r\n reMeasure() {\r\n this.elmMeasTrigger && this.elmMeasTrigger.measure();\r\n }\r\n\r\n componentDidUpdate() {\r\n if (this.isDropped) {\r\n this.elmMeasDropdown && this.elmMeasDropdown.measure();\r\n }\r\n }\r\n\r\n render() {\r\n (() => this.isDropped)();\r\n return (\r\n \r\n {({measureRef: mRefTrigger, contentRect: cRectTrigger, measure: measureTrigger}) => (\r\n \r\n {({\r\n measureRef: mRefDropdown,\r\n contentRect: cRectDropdown,\r\n measure: measureDropdown,\r\n }) => (\r\n \r\n {() => (\r\n \r\n {this.props.trigger({\r\n refTrigger: mRefTrigger,\r\n measure: this.reMeasure,\r\n setDropped: this.setDropped,\r\n isDropped: this.isDropped,\r\n })}\r\n {this.isDropped && (\r\n {\r\n this.setDropped(false);\r\n this.props.onDroppedUp?.();\r\n }}\r\n onOutsideInteraction={this.props.onOutsideInteraction}\r\n >\r\n {this.props.content({setDropped: this.setDropped})}\r\n \r\n )}\r\n \r\n )}\r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/DataViewHeader/DataViewHeader.module.scss\";\r\nimport cx from 'classnames';\r\n\r\nexport const DataViewHeader: React.FC<{ domRef?: any, isVisible: boolean }> = props => (\r\n
\r\n
\r\n {props.children}\r\n
\r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/DataViewHeader/DataViewHeaderButton.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport const DataViewHeaderButton: React.FC<{\r\n domRef?: any;\r\n isHidden?: boolean;\r\n disabled?: boolean;\r\n title?: string;\r\n onClick?(event: any): void;\r\n}> = (props) => (\r\n \r\n {props.children}\r\n \r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\nimport S from \"gui/Components/DataViewHeader/DataViewHeaderButtonGroup.module.scss\";\r\n\r\nexport const DataViewHeaderButtonGroup: React.FC<{\r\n isHidden?: boolean;\r\n domRef?: any;\r\n}> = props => (\r\n
\r\n {props.children}\r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\n\r\nexport const DataViewHeaderDropDownItem: React.FC<{\r\n onClick?(event: any): void;\r\n}> = (props) => (\r\n
\r\n {props.children}\r\n
\r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\nimport S from \"gui/Components/DataViewHeader/DataViewHeaderGroup.module.scss\";\r\n\r\nexport const DataViewHeaderGroup: React.FC<{\r\n isHidden?: boolean;\r\n noShrink?: boolean;\r\n className?: string;\r\n noDivider?: boolean;\r\n domRef?: any;\r\n grovable?: boolean;\r\n}> = (props) => (\r\n \r\n {props.children}\r\n \r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Dropdown/Dropdown.module.scss\";\r\n\r\nexport const Dropdown: React.FC = props => (\r\n
{props.children}
\r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Dropdown/DropdownItem.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport const DropdownItem: React.FC<{\r\n className?: string;\r\n onClick?(event: any): void;\r\n isDisabled?: boolean;\r\n isSelected?: boolean;\r\n id?: string;\r\n}> = props => {\r\n function getStyle() {\r\n if (props.isDisabled) {\r\n return \"isDisabled\"\r\n }\r\n return props.isSelected ? S.isSelected : \"\"\r\n }\r\n\r\n return \r\n {props.children}\r\n \r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\nimport CS from \"gui/Components/Dialogs/DialogsCommon.module.css\";\r\nimport S from \"gui/Components/Dialogs/SaveFilterDialog.module.css\";\r\nimport { observable } from \"mobx\";\r\n\r\n@observer\r\nexport class SaveFilterDialog extends React.Component<{\r\n onCancelClick: (event: any) => void;\r\n onOkClick: (name: string, isGlobal: boolean) => void;\r\n}> {\r\n @observable\r\n filterName: string = \"\";\r\n\r\n @observable\r\n isGlobal: boolean = false;\r\n\r\n refInput = React.createRef();\r\n\r\n onNameChanged(event: any) {\r\n this.filterName = event.target.value;\r\n }\r\n\r\n onIsGlobalClicked(event: any) {\r\n this.isGlobal = event.target.checked;\r\n }\r\n\r\n componentDidMount() {\r\n this.refInput.current?.focus();\r\n }\r\n\r\n onKeydown(event: React.KeyboardEvent) {\r\n if (event.key === \"Enter\") {\r\n this.props.onOkClick(this.filterName, this.isGlobal);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n this.props.onOkClick(this.filterName, this.isGlobal)}\r\n >\r\n {T(\"Ok\", \"button_ok\")}\r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n
\r\n
\r\n
{T(\"Name:\", \"new_filter_name\")}
\r\n this.onNameChanged(event)}\r\n onKeyDown={(event: React.KeyboardEvent) => this.onKeydown(event)}\r\n />\r\n
\r\n
\r\n
{T(\"Global:\", \"new_filter_global\")}
\r\n this.onIsGlobalClicked(event)}\r\n />\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { IFilterGroup } from \"model/entities/types/IFilterGroup\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { DataViewHeaderAction } from \"gui/Components/DataViewHeader/DataViewHeaderAction\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { T } from \"utils/translation\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { SaveFilterDialog } from \"gui/Components/Dialogs/SaveFilterDialog\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getFilterGroupManager } from \"model/selectors/DataView/getFilterGroupManager\";\r\nimport { FilterGroupManager } from \"model/entities/FilterGroupManager\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\n@observer\r\nexport class FilterDropDown extends React.Component<{ ctx: any }> {\r\n filterManager: FilterGroupManager;\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.filterManager = getFilterGroupManager(props.ctx)\r\n }\r\n\r\n onDropItemClick(filterGroup: IFilterGroup) {\r\n this.filterManager.setFilterGroup(filterGroup);\r\n }\r\n\r\n onSaveFilterClick() {\r\n const formScreenLifecycle = getFormScreenLifecycle(this.props.ctx);\r\n const closeDialog = getDialogStack(formScreenLifecycle).pushDialog(\r\n \"\",\r\n {\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.saveActiveFiltersAsNewFilterGroup(name, isGlobal)\r\n });\r\n closeDialog();\r\n }}\r\n onCancelClick={() => {\r\n closeDialog();\r\n }}\r\n />\r\n );\r\n }\r\n\r\n render() {\r\n const filterGroups = this.filterManager.filterGroups ?? []\r\n\r\n return (\r\n (\r\n setDropped(true)}\r\n isActive={false}\r\n >\r\n \r\n \r\n )}\r\n content={({setDropped}) => (\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.clearFiltersAndClose(event)\r\n });\r\n }}\r\n >\r\n {T(\"Cancel and Hide Filter\", \"filter_menu_filter_off\")}\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.setSelectedFilterGroupAsDefault()\r\n });\r\n }}\r\n >\r\n {T(\"Remember The Current Filter\", \"filter_menu_set_default_filter\")}\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.resetDefaultFilterGroup()\r\n });\r\n }}\r\n >\r\n {T(\"Cancel Default Filter\", \"filter_menu_cancel_default_filter\")}\r\n \r\n {\r\n setDropped(false);\r\n this.onSaveFilterClick();\r\n }}\r\n >\r\n {T(\"Save Current Filter\", \"filter_menu_save_filter\")}\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.deleteFilterGroup()\r\n });\r\n }}\r\n >\r\n {T(\"Delete\", \"filter_menu_delete\")}\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.filterManager.cancelSelectedFilter()\r\n });\r\n }}\r\n >\r\n {T(\"Cancel Filter\", \"filter_menu_cancel\")}\r\n \r\n {filterGroups.map((filterGroup) => (\r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.filterManager,\r\n action: () => this.onDropItemClick(filterGroup)\r\n });\r\n }}\r\n >\r\n {filterGroup.name}\r\n \r\n ))}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function getFilterGroupManager(ctx: any) {\r\n return getTablePanelView(ctx).filterGroupManager;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"./TablePanelView/getTablePanelView\";\r\n\r\nexport function getColumnConfigurationDialog(ctx: any) {\r\n return getTablePanelView(ctx).columnConfigurationDialog;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { handleUserInputOnChangingRow } from \"model/entities/FormScreenLifecycle/questionSaveDataAfterRecordChange\";\r\n\r\nexport async function shouldProceedToChangeRow(dataView: IDataView) {\r\n const isDirty = getFormScreen(dataView).isDirty;\r\n if (!isDirty) {\r\n return true\r\n }\r\n return await handleUserInputOnChangingRow(dataView);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from 'model/selectors/DataView/getDataView';\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function selectNextRow(ctx: any) {\r\n return function*selectNextRow() {\r\n getDataView(ctx).selectNextRow();\r\n getTablePanelView(ctx).scrollToCurrentRow();\r\n if (!isLazyLoading(ctx)) {\r\n setTimeout(() => {\r\n getGridFocusManager(ctx).focusTableIfNeeded();\r\n });\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function selectPrevRow(ctx: any) {\r\n return function*selectPrevRow() {\r\n getDataView(ctx).selectPrevRow();\r\n getTablePanelView(ctx).scrollToCurrentRow();\r\n if (!isLazyLoading(ctx)) {\r\n setTimeout(() => {\r\n getGridFocusManager(ctx).focusTableIfNeeded();\r\n });\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getAction } from \"./getAction\";\r\n\r\nexport function getIsEnabledAction(ctx: any) {\r\n return getAction(ctx).isEnabled;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\n\r\nexport class ViewConfiguration {\r\n constructor(\r\n public saveConfiguration: (activePerspectiveTag: string) => Generator,\r\n public getActivePerspectiveTag: () => IPanelViewType\r\n ) {\r\n }\r\n\r\n *anounceActivePerspective(tag: string) {\r\n yield*this.saveConfiguration(tag);\r\n }\r\n\r\n get activePerspective(): IPanelViewType {\r\n return this.getActivePerspectiveTag();\r\n }\r\n}\r\n\r\nexport const IViewConfiguration = TypeSymbol(\"IViewConfiguration\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { scopeFor } from \"dic/Container\";\r\nimport { IViewConfiguration } from \"modules/DataView/ViewConfiguration\";\r\n\r\nexport function getActivePerspective(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n const $cont = scopeFor(dataView);\r\n const viewConfiguration = $cont && $cont.resolve(IViewConfiguration);\r\n return viewConfiguration?.activePerspective\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRelationState as getRelationRowState } from \"../RowState/getRelationState\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\nimport { getActivePerspective } from \"model/selectors/DataView/getActivePerspective\";\r\n\r\nexport function getIsAddButtonVisible(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n if (getActivePerspective(ctx) === IPanelViewType.Map) {\r\n return false;\r\n }\r\n const relationRowState = getRelationRowState(ctx);\r\n if (relationRowState?.allowCreate !== undefined) {\r\n return dataView.showAddButton && relationRowState.allowCreate;\r\n }\r\n return dataView.showAddButton\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"../DataView/getDataView\";\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRelationState(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n const bindingParent = dataView.bindingParent;\r\n if (bindingParent?.selectedRowId) {\r\n return getRowStateById(bindingParent, bindingParent!.selectedRowId!)\r\n ?.relations\r\n .find(relation => relation.name === dataView.entity);\r\n }\r\n return undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function selectFirstRow(ctx: any) {\r\n return function*selectFirstRow() {\r\n let dataView = getDataView(ctx);\r\n if (dataView.infiniteScrollLoader) yield*dataView.infiniteScrollLoader!.loadFirstPage();\r\n dataView.selectFirstRow();\r\n getTablePanelView(ctx).scrollToCurrentRow();\r\n if (!isLazyLoading(ctx)) {\r\n setTimeout(() => {\r\n getGridFocusManager(ctx).focusTableIfNeeded();\r\n });\r\n }\r\n };\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function selectLastRow(ctx: any) {\r\n return function*selectLastRow() {\r\n let dataView = getDataView(ctx);\r\n if (dataView.infiniteScrollLoader){\r\n yield*dataView.infiniteScrollLoader.loadLastPage();\r\n }\r\n dataView.selectLastRow();\r\n getTablePanelView(ctx).scrollToCurrentRow();\r\n if (!isLazyLoading(ctx)) {\r\n setTimeout(() => {\r\n getGridFocusManager(ctx).focusTableIfNeeded();\r\n });\r\n }\r\n };\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from './DropdownDivider.module.scss';\r\n\r\nexport function DropdownDivider() {\r\n return
;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { scopeFor } from \"dic/Container\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { CtxDataViewHeaderExtension, DataViewHeaderExtension, } from \"gui/Components/ScreenElements/DataView\";\r\nimport { DataViewHeader } from \"gui/Components/DataViewHeader/DataViewHeader\";\r\nimport { DataViewHeaderAction } from \"gui/Components/DataViewHeader/DataViewHeaderAction\";\r\nimport { DataViewHeaderButton } from \"gui/Components/DataViewHeader/DataViewHeaderButton\";\r\nimport { DataViewHeaderButtonGroup } from \"gui/Components/DataViewHeader/DataViewHeaderButtonGroup\";\r\nimport { DataViewHeaderDropDownItem } from \"gui/Components/DataViewHeader/DataViewHeaderDropDownItem\";\r\nimport { DataViewHeaderGroup } from \"gui/Components/DataViewHeader/DataViewHeaderGroup\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { FilterDropDown } from \"gui/connections/FilterDropDown\";\r\nimport { MobXProviderContext, Observer, observer } from \"mobx-react\";\r\nimport uiActions from \"model/actions-ui-tree\";\r\nimport { getIsRowMovingDisabled } from \"model/actions-ui/DataView/getIsRowMovingDisabled\";\r\nimport { onColumnConfigurationClick } from \"model/actions-ui/DataView/onColumnConfigurationClick\";\r\nimport { onCopyRowClick } from \"model/actions-ui/DataView/onCopyRowClick\";\r\nimport { onCreateRowClick } from \"model/actions-ui/DataView/onCreateRowClick\";\r\nimport { onDeleteRowClick } from \"model/actions-ui/DataView/onDeleteRowClick\";\r\nimport { onExportToExcelClick } from \"model/actions-ui/DataView/onExportToExcelClick\";\r\nimport { onFilterButtonClick } from \"model/actions-ui/DataView/onFilterButtonClick\";\r\nimport { onMoveRowDownClick } from \"model/actions-ui/DataView/onMoveRowDownClick\";\r\nimport { onMoveRowUpClick } from \"model/actions-ui/DataView/onMoveRowUpClick\";\r\nimport { onNextRowClick } from \"model/actions-ui/DataView/onNextRowClick\";\r\nimport { onPrevRowClick } from \"model/actions-ui/DataView/onPrevRowClick\";\r\nimport { onRecordInfoClick } from \"model/actions-ui/RecordInfo/onRecordInfoClick\";\r\nimport { IAction, IActionMode, IActionPlacement, IActionType } from \"model/entities/types/IAction\";\r\nimport { getIsEnabledAction } from \"model/selectors/Actions/getIsEnabledAction\";\r\nimport { getDataViewLabel } from \"model/selectors/DataView/getDataViewLabel\";\r\nimport { getExpandedGroupRowCount } from \"model/selectors/DataView/getExpandedGroupRowCount\";\r\nimport { getIsAddButtonVisible } from \"model/selectors/DataView/getIsAddButtonVisible\";\r\nimport { getIsCopyButtonVisible } from \"model/selectors/DataView/getIsCopyButtonVisible\";\r\nimport { getIsDelButtonVisible } from \"model/selectors/DataView/getIsDelButtonVisible\";\r\nimport { getIsMoveRowMenuVisible } from \"model/selectors/DataView/getIsMoveRowMenuVisible\";\r\nimport { getPanelViewActions } from \"model/selectors/DataView/getPanelViewActions\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getTotalRowCount } from \"model/selectors/DataView/getTotalGroupRowCount\";\r\nimport { getOpenedScreen } from \"model/selectors/getOpenedScreen\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getIsFilterControlsDisplayed } from \"model/selectors/TablePanelView/getIsFilterControlsDisplayed\";\r\nimport { SectionViewSwitchers } from \"modules/DataView/DataViewTypes\";\r\nimport { IDataViewToolbarUI } from \"modules/DataView/DataViewUI\";\r\nimport React, { useContext } from \"react\";\r\nimport Measure from \"react-measure\";\r\nimport { onFirstRowClick } from \"model/actions-ui/DataView/onFirstRowClick\";\r\nimport { onLastRowClick } from \"model/actions-ui/DataView/onLastRowClick\";\r\nimport { T } from \"utils/translation\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\nimport { computed } from \"mobx\";\r\nimport { getPanelMenuActions } from \"model/selectors/DataView/getPanelMenuActions\";\r\nimport { DropdownDivider } from \"gui/Components/Dropdown/DropdownDivider\";\r\nimport { getTrueSelectedRowIndex } from \"../../model/selectors/DataView/getTrueSelectedRowIndex\";\r\nimport { getAreCrudButtonsEnabled } from \"../../model/selectors/DataView/getAreCrudButtonsEnabled\";\r\n\r\nfunction isAddRecordShortcut(event: any) {\r\n return (\r\n ((event.ctrlKey || event.metaKey) && !event.shiftKey && event.key === \"i\") ||\r\n ((event.ctrlKey || event.metaKey) && event.shiftKey && event.key === \"j\")\r\n );\r\n}\r\n\r\nfunction isDeleteRecordShortcut(event: any) {\r\n return (event.ctrlKey || event.metaKey) && !event.shiftKey && event.key === \"Delete\";\r\n}\r\n\r\nfunction isDuplicateRecordShortcut(event: any) {\r\n return (\r\n (event.ctrlKey || event.metaKey) && !event.shiftKey && (event.key === \"d\" || event.key === \"k\")\r\n );\r\n}\r\n\r\nfunction isFilterRecordShortcut(event: any) {\r\n return (event.ctrlKey || event.metaKey) && event.key === \"f\";\r\n}\r\n\r\n@observer\r\nexport class CDataViewHeaderInner extends React.Component<{\r\n isVisible: boolean;\r\n extension: DataViewHeaderExtension;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n\r\n get dataView() {\r\n return this.context.dataView;\r\n }\r\n\r\n state = {\r\n hiddenActionIds: new Set(),\r\n };\r\n\r\n shouldBeShown(action: IAction) {\r\n return getIsEnabledAction(action) || action.mode !== IActionMode.ActiveRecord;\r\n }\r\n\r\n @computed\r\n get relevantActions() {\r\n return this.allActions\r\n .filter((action) => !action.groupId)\r\n .filter((action) => this.shouldBeShown(action));\r\n }\r\n\r\n @computed\r\n get relevantMenuActions() {\r\n return this.allMenuActions\r\n .filter((action) => !action.groupId)\r\n .filter((action) => this.shouldBeShown(action));\r\n }\r\n\r\n renderMenuActions(args: { setMenuDropped(state: boolean): void }) {\r\n return this.relevantMenuActions.map((action) => {\r\n return (\r\n {\r\n args.setMenuDropped(false);\r\n uiActions.actions.onActionClick(action)(event, action);\r\n }}\r\n >\r\n {action.caption}\r\n \r\n );\r\n });\r\n }\r\n\r\n renderActions() {\r\n return this.relevantActions.map((action, idx) =>\r\n this.renderAction(action, this.relevantActions)\r\n );\r\n }\r\n\r\n renderAction(action: IAction, actionsToRender: IAction[]) {\r\n if (action.type === IActionType.Dropdown) {\r\n const childActions = actionsToRender.filter(\r\n (otherAction) => otherAction.groupId === action.id\r\n );\r\n return (\r\n (\r\n \r\n {() => (\r\n setDropped(true)}\r\n domRef={refTrigger}\r\n >\r\n {action.caption}\r\n \r\n )}\r\n \r\n )}\r\n content={() => (\r\n \r\n {childActions.map((action) => (\r\n \r\n {() => (\r\n \r\n uiActions.actions.onActionClick(action)(event, action)}\r\n >\r\n {action.caption}\r\n \r\n \r\n )}\r\n \r\n ))}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n return (\r\n \r\n {() => (\r\n uiActions.actions.onActionClick(action)(event, action)}\r\n disabled={!getIsEnabledAction(action)}\r\n >\r\n {action.caption}\r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n renderRowCount() {\r\n const selectedRowIndex = getTrueSelectedRowIndex(this.dataView);\r\n const totalRowCount = getTotalRowCount(this.dataView);\r\n const groupRowCount = getExpandedGroupRowCount(this.dataView);\r\n if (groupRowCount) {\r\n return (\r\n <>\r\n {selectedRowIndex !== undefined ? selectedRowIndex + 1 : \" - \"}\r\n  / \r\n {groupRowCount}\r\n {totalRowCount ? \" (\" + totalRowCount + \")\" : \"\"}\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n {selectedRowIndex !== undefined ? selectedRowIndex + 1 : \" - \"}\r\n  / \r\n {totalRowCount}\r\n \r\n );\r\n }\r\n }\r\n\r\n @computed\r\n get isBarVisible() {\r\n return this.props.isVisible || this.hasSomeRelevantActions;\r\n }\r\n\r\n @computed\r\n get isActionsOnly() {\r\n return !this.props.isVisible && this.hasSomeRelevantActions;\r\n }\r\n\r\n @computed\r\n get hasSomeRelevantActions() {\r\n return (\r\n this.relevantActions.filter((action) => action.placement !== IActionPlacement.PanelMenu)\r\n .length > 0\r\n );\r\n }\r\n\r\n @computed\r\n get allActions() {\r\n return getPanelViewActions(this.dataView);\r\n }\r\n\r\n @computed\r\n get allMenuActions() {\r\n return getPanelMenuActions(this.dataView);\r\n }\r\n\r\n render() {\r\n const {dataView} = this;\r\n const label = getDataViewLabel(dataView);\r\n const isFilterSettingsVisible = getIsFilterControlsDisplayed(dataView);\r\n const onColumnConfigurationClickEvt = onColumnConfigurationClick(dataView);\r\n const onExportToExcelClickEvt = onExportToExcelClick(dataView);\r\n const onDeleteRowClickEvt = onDeleteRowClick(dataView);\r\n const onCreateRowClickEvt = onCreateRowClick(dataView);\r\n const onMoveRowUpClickEvt = onMoveRowUpClick(dataView);\r\n const isRowMovingDisabled = getIsRowMovingDisabled(dataView);\r\n const onMoveRowDownClickEvt = onMoveRowDownClick(dataView);\r\n const onCopyRowClickEvt = onCopyRowClick(dataView);\r\n const onFilterButtonClickEvt = onFilterButtonClick(dataView);\r\n const onFirstRowClickEvt = onFirstRowClick(dataView);\r\n const onPrevRowClickEvt = onPrevRowClick(dataView);\r\n const onNextRowClickEvt = onNextRowClick(dataView);\r\n const onLastRowClickEvt = onLastRowClick(dataView);\r\n\r\n const isMoveRowMenuVisible = getIsMoveRowMenuVisible(dataView);\r\n\r\n const isAddButton = getIsAddButtonVisible(dataView);\r\n const isDelButton = getIsDelButtonVisible(dataView);\r\n const isCopyButton = getIsCopyButtonVisible(dataView);\r\n const crudButtonsEnabled = getAreCrudButtonsEnabled(dataView);\r\n\r\n const $cont = scopeFor(dataView);\r\n const uiToolbar = $cont && $cont.resolve(IDataViewToolbarUI);\r\n const selectedRow = getSelectedRow(dataView);\r\n const isDialog = !!getOpenedScreen(dataView).dialogInfo;\r\n\r\n const goToFirstRowDisabled =\r\n getGroupingConfiguration(dataView).isGrouping; // || isInfiniteScrollingActive(dataView);\r\n const goToLastRowDisabled =\r\n getGroupingConfiguration(dataView).isGrouping; // || isInfiniteScrollingActive(dataView);\r\n\r\n const configurationManager = getConfigurationManager(dataView);\r\n const customTableConfigsExist = configurationManager.customTableConfigurations.length > 0;\r\n return (\r\n \r\n {({measureRef, contentRect}) => {\r\n const containerWidth = contentRect.bounds?.width || 0;\r\n const isBreak640 = containerWidth < 640;\r\n return (\r\n \r\n {() => (\r\n \r\n {this.isBarVisible &&\r\n (this.isActionsOnly ? (\r\n \r\n {this.props.extension.render(\"actions\")}\r\n \r\n {this.renderActions()}\r\n \r\n \r\n ) : (\r\n <>\r\n

{label}

\r\n\r\n
\r\n {isMoveRowMenuVisible ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n\r\n \r\n {isAddButton && (\r\n \r\n \r\n \r\n )}\r\n\r\n {isDelButton && !!selectedRow && (\r\n \r\n \r\n \r\n )}\r\n\r\n {isCopyButton && !!selectedRow && (\r\n \r\n \r\n \r\n )}\r\n \r\n\r\n \r\n {this.props.extension.render(\"actions\")}\r\n \r\n {this.renderActions()}\r\n \r\n \r\n\r\n {!isBreak640 && (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n {this.renderRowCount()}\r\n \r\n \r\n )}\r\n\r\n \r\n {uiToolbar && uiToolbar.renderSection(SectionViewSwitchers)}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n (\r\n setDropped(true)}\r\n isActive={false}\r\n >\r\n \r\n \r\n )}\r\n content={({ setDropped }) => (\r\n \r\n {\r\n setDropped(false);\r\n onExportToExcelClickEvt(event);\r\n }}\r\n >\r\n {T(\"Export to Excel\", \"excel_tool_tip\")}\r\n \r\n {\r\n setDropped(false);\r\n onColumnConfigurationClickEvt(event);\r\n }}\r\n >\r\n {T(\"Column configuration\", \"column_config_tool_tip\")}\r\n \r\n {!isDialog && (\r\n {\r\n setDropped(false);\r\n onRecordInfoClick(dataView)(event);\r\n }}\r\n >\r\n {T(\"Show record information\", \"info_button_tool_tip\")}\r\n \r\n )}\r\n {customTableConfigsExist && [\r\n {\r\n setDropped(false);\r\n configurationManager.activeTableConfiguration =\r\n configurationManager.defaultTableConfiguration;\r\n await configurationManager.saveTableConfigurations();\r\n }}\r\n >\r\n {T(\"Default View\", \"default_grid_view_view\")}\r\n ,\r\n ...configurationManager.customTableConfigurations.map(\r\n (tableConfig) => (\r\n {\r\n setDropped(false);\r\n configurationManager.activeTableConfiguration = tableConfig;\r\n await configurationManager.saveTableConfigurations();\r\n }}\r\n >\r\n {tableConfig.name}\r\n \r\n )\r\n ),\r\n {\r\n setDropped(false);\r\n await configurationManager.saveTableConfigurations();\r\n }}\r\n >\r\n {T(\"Save View\", \"save_current_column_config\")}\r\n ,\r\n {\r\n setDropped(false);\r\n await configurationManager.deleteActiveTableConfiguration();\r\n }}\r\n >\r\n {T(\"Delete View\", \"delete_current_column_config\")}\r\n ,\r\n ]}\r\n {this.relevantMenuActions.length > 0 && }\r\n {this.renderMenuActions({ setMenuDropped: setDropped })}\r\n \r\n )}\r\n />\r\n \r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n );\r\n }}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport function CDataViewHeader(props: { isVisible: boolean }) {\r\n const extension = useContext(CtxDataViewHeaderExtension);\r\n return ;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getTrueSelectedRowIndex(ctx: any) {\r\n return getDataView(ctx).trueSelectedRowIndex;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isInfiniteScrollingActive } from \"../isInfiniteScrollingActive\";\r\nimport { getGroupingConfiguration } from \"../TablePanelView/getGroupingConfiguration\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getGrouper } from \"./getGrouper\";\r\n\r\n\r\nexport function getTotalRowCount(ctx: any) {\r\n if (!getGroupingConfiguration(ctx).isGrouping) {\r\n if (isInfiniteScrollingActive(ctx)) {\r\n return getDataView(ctx).totalRowCount;\r\n } else {\r\n return getDataView(ctx).dataTable.rows.length;\r\n }\r\n } else {\r\n return getGrouper(ctx).topLevelGroups\r\n .reduce((count, group) => count + group.rowCount, 0);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getGroupingConfiguration } from \"../TablePanelView/getGroupingConfiguration\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getGrouper } from \"./getGrouper\";\r\n\r\n\r\nexport function getExpandedGroupRowCount(ctx: any) {\r\n if (!getGroupingConfiguration(ctx).isGrouping) {\r\n return undefined;\r\n }\r\n\r\n if (getGrouper(ctx).allGroups.some((group) => group.isExpanded)) {\r\n const dataView = getDataView(ctx);\r\n return getGrouper(ctx).getTotalRowCount(dataView.selectedRowId!);\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getPanelViewActions(ctx: any) {\r\n return getDataView(ctx).panelViewActions;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getPanelMenuActions(ctx: any) {\r\n return getDataView(ctx).panelMenuActions;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\n\r\nexport function getDataViewLabel(ctx: any) {\r\n const activeConfigName = getConfigurationManager(ctx).activeTableConfiguration.name;\r\n return activeConfigName\r\n ? `${getDataView(ctx).name} [${activeConfigName}]`\r\n : getDataView(ctx).name\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFilterConfiguration } from \"../DataView/getFilterConfiguration\";\r\n\r\nexport function getIsFilterControlsDisplayed(ctx: any) {\r\n return getFilterConfiguration(ctx).isFilterControlsDisplayed;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getColumnConfigurationDialog } from \"model/selectors/getColumnConfigurationDialog\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { shouldProceedToChangeRow } from \"./TableView/shouldProceedToChangeRow\";\r\n\r\nexport function onColumnConfigurationClick(ctx: any) {\r\n return flow(function*onColumnConfigurationClick(event: any) {\r\n try {\r\n if (yield shouldProceedToChangeRow(ctx)) {\r\n getColumnConfigurationDialog(ctx).onColumnConfClick(event);\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function onExportToExcelClick(ctx: any) {\r\n return flow(function*onExportToExcelClick(event: any) {\r\n try {\r\n getDataView(ctx).exportToExcel();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getTablePanelView } from \"../../selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function onDeleteRowClick(ctx: any) {\r\n return flow(function*onDeleteRowClick(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n const selectedRow = getSelectedRow(ctx);\r\n if (selectedRow) {\r\n const dataTable = getDataTable(ctx);\r\n const entity = dataView.entity;\r\n const formScreenLifecycle = getFormScreenLifecycle(ctx);\r\n yield*formScreenLifecycle.onDeleteRow(\r\n entity,\r\n dataTable.getRowId(selectedRow),\r\n dataView\r\n );\r\n getTablePanelView(ctx)?.triggerOnFocusTable();\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getGridId } from \"model/selectors/DataView/getGridId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { shouldProceedToChangeRow } from \"./TableView/shouldProceedToChangeRow\";\r\n\r\nexport function onCreateRowClick(ctx: any) {\r\n return flow(function*onCreateRowClick(event: any) {\r\n try {\r\n const gridId = getGridId(ctx);\r\n const entity = getEntity(ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(ctx);\r\n const dataView = getDataView(ctx);\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n yield*formScreenLifecycle.onCreateRow(entity, gridId);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getDataView } from \"../../selectors/DataView/getDataView\";\r\nimport { handleError } from \"../../actions/handleError\";\r\nimport { getFormScreenLifecycle } from \"../../selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport function onMoveRowUpClick(ctx: any) {\r\n return flow(function*onMoveRowUpClick(event: any) {\r\n try {\r\n getDataView(ctx).moveSelectedRowUp();\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function getIsRowMovingDisabled(ctx: any) {\r\n return getDataView(ctx).dataTable.addedRowPositionLocked;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"../../actions/handleError\";\r\nimport { getDataView } from \"../../selectors/DataView/getDataView\";\r\nimport { getFormScreenLifecycle } from \"../../selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport function onMoveRowDownClick(ctx: any) {\r\n return flow(function*onMoveRowDownClick(event: any) {\r\n try {\r\n getDataView(ctx).moveSelectedRowDown();\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getDataView } from \"../../selectors/DataView/getDataView\";\r\nimport { getGridId } from \"../../selectors/DataView/getGridId\";\r\nimport { getEntity } from \"../../selectors/DataView/getEntity\";\r\nimport { getFormScreenLifecycle } from \"../../selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { handleError } from \"../../actions/handleError\";\r\nimport { shouldProceedToChangeRow } from \"./TableView/shouldProceedToChangeRow\";\r\n\r\nexport function onCopyRowClick(ctx: any) {\r\n return flow(function*onCopyRowClick(event: any) {\r\n try {\r\n const selectedRowId = getDataView(ctx).selectedRowId;\r\n if (!selectedRowId) {\r\n return;\r\n }\r\n const gridId = getGridId(ctx);\r\n const entity = getEntity(ctx);\r\n const formScreenLifecycle = getFormScreenLifecycle(ctx);\r\n const dataView = getDataView(ctx);\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n yield*formScreenLifecycle.onCopyRow(entity, gridId, selectedRowId);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFilterConfiguration } from \"model/selectors/DataView/getFilterConfiguration\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function onFilterButtonClick(ctx: any) {\r\n return flow(function*onFilterButtonClick(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n if (dataView.isFormViewActive()) {\r\n dataView.activateTableView?.();\r\n }\r\n getFilterConfiguration(ctx).onFilterDisplayClick(event);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { selectFirstRow } from \"../../actions/DataView/selectFirstRow\";\r\nimport { handleError } from \"../../actions/handleError\";\r\n\r\nexport function onFirstRowClick(ctx: any) {\r\n return flow(function*onPrevRowClick(event: any) {\r\n try {\r\n yield*selectFirstRow(ctx)();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { selectPrevRow } from \"model/actions/DataView/selectPrevRow\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { shouldProceedToChangeRow } from \"./TableView/shouldProceedToChangeRow\";\r\n\r\nexport function onPrevRowClick(ctx: any) {\r\n return flow(function*onPrevRowClick(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n yield*selectPrevRow(ctx)();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { selectNextRow } from \"model/actions/DataView/selectNextRow\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { shouldProceedToChangeRow } from \"./TableView/shouldProceedToChangeRow\";\r\n\r\nexport function onNextRowClick(ctx: any) {\r\n return flow(function*onNextRowClick(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n yield*selectNextRow(ctx)();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { selectLastRow } from \"../../actions/DataView/selectLastRow\";\r\nimport { handleError } from \"../../actions/handleError\";\r\n\r\nexport function onLastRowClick(ctx: any) {\r\n return flow(function*onLastRowClick(event: any) {\r\n try {\r\n yield*selectLastRow(ctx)();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getRowStateAllowUpdate } from \"../RowState/getRowStateAllowUpdate\";\r\nimport { getSelectedRowId } from \"../TablePanelView/getSelectedRowId\";\r\n\r\nexport function getIsMoveRowMenuVisible(ctx: any) {\r\n const {orderProperty} = getDataView(ctx);\r\n const currentRowId = getSelectedRowId(ctx);\r\n return (\r\n !!orderProperty &&\r\n !orderProperty?.readOnly &&\r\n currentRowId &&\r\n getRowStateAllowUpdate(ctx, currentRowId, orderProperty?.id)\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"../RowState/getRowStateById\";\r\nimport { getDataView } from \"./getDataView\";\r\nimport { getActivePerspective } from \"model/selectors/DataView/getActivePerspective\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\n\r\nexport function getIsDelButtonVisible(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n if (getActivePerspective(ctx) === IPanelViewType.Map) {\r\n return false;\r\n }\r\n if (dataView.selectedRowId) {\r\n const rowState = getRowStateById(ctx, dataView.selectedRowId);\r\n if (rowState?.allowDelete !== undefined) {\r\n return dataView.showDeleteButton && rowState.allowDelete;\r\n }\r\n }\r\n return dataView.showDeleteButton\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getIsAddButtonVisible } from \"./getIsAddButtonVisible\";\r\n\r\nexport function getIsCopyButtonVisible(ctx: any) {\r\n return getIsAddButtonVisible(ctx);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getAreCrudButtonsEnabled(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n if (dataView.parentBindings.length === 0) {\r\n return true;\r\n }\r\n return dataView.parentBindings.some(binding => binding.parentDataView.selectedRowId)\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getRecordInfo } from \"model/selectors/RecordInfo/getRecordInfo\";\r\n\r\nexport function onRecordInfoClick(ctx: any) {\r\n return flow(function*onRecordInfoClick(event: any) {\r\n const menuId = getMenuItemId(ctx);\r\n const dataStructureEntityId = getDataStructureEntityId(ctx);\r\n const rowId = getSelectedRowId(ctx);\r\n if (rowId) {\r\n yield*getRecordInfo(ctx).onOpenRecordInfoClick(\r\n event,\r\n menuId,\r\n dataStructureEntityId,\r\n rowId\r\n );\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getIsDataViewWorking(ctx: any) {\r\n return getDataView(ctx).isWorking;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"./getFormScreenLifecycle\";\r\n\r\nexport function getIsFormScreenWorkingDelayed(ctx: any) {\r\n return getFormScreenLifecycle(ctx).isWorkingDelayed;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"../../entities/types/IDataView\";\r\nimport { getOpenedScreen } from \"../getOpenedScreen\";\r\n\r\nexport function getDataViewById(ctx: any, id: string): IDataView | undefined {\r\n return getOpenedScreen(ctx).content.formScreen!.dataViews.find(\r\n item => item.id === id\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"./DataViewLoading.module.css\";\r\n\r\nexport class DataViewLoading extends React.Component {\r\n render() {\r\n return (\r\n
\r\n {/*
Loading
*/}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataTable } from \"./types/IDataTable\";\r\nimport { IProperty } from \"./types/IProperty\";\r\nimport { IRowsContainer } from \"./types/IRowsContainer\";\r\nimport { IAdditionalRowData } from \"./types/IAdditionalRecordData\";\r\nimport { IDataSourceField } from \"./types/IDataSourceField\";\r\nimport { computed, observable } from \"mobx\";\r\nimport { getDataSource } from \"../selectors/DataSources/getDataSource\";\r\n\r\nexport class TreeDataTable implements IDataTable {\r\n $type_IDataTable: 1 = 1;\r\n $type_TreeDataTable: 1 = 1;\r\n properties: IProperty[] = [];\r\n rowsContainer: IRowsContainer = null as any;\r\n rowsAddedSinceSave = 0;\r\n @observable.shallow rows: any[] = [];\r\n\r\n get allRows(): any[][] {\r\n return this.rows;\r\n }\r\n\r\n start() {\r\n\r\n }\r\n\r\n stop() {\r\n\r\n }\r\n\r\n @computed get identifierProperty() {\r\n return this.properties.find((prop) => prop.id === this.dataSource.identifier);\r\n }\r\n\r\n get identifierDataIndex() {\r\n return this.identifierProperty!.dataIndex;\r\n }\r\n\r\n additionalRowData: Map = new Map();\r\n parentIdProperty: string;\r\n isEmpty: boolean = false;\r\n idProperty: string;\r\n\r\n constructor(idProperty: string, parentIdProperty: string) {\r\n this.parentIdProperty = parentIdProperty;\r\n this.idProperty = idProperty;\r\n }\r\n\r\n getTrueIndexById(id: string): number | undefined {\r\n const idx = this.rows.findIndex((row) => this.getRowId(row) === id);\r\n return idx > -1 ? idx : undefined;\r\n }\r\n\r\n deleteAdditionalCellData(row: any[], propertyId: string): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n rowRemovedListeners: (() => void)[] = [];\r\n\r\n getRowId(row: any[]): string {\r\n return row[this.dataSource.getFieldByName(this.idProperty)!.index];\r\n }\r\n\r\n getCellValue(row: any[], property: IProperty): any {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getOriginalCellValue(row: any[], property: IProperty): any {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getCellValueByDataSourceField(row: any[], dsField: IDataSourceField) {\r\n return row[dsField.index];\r\n }\r\n\r\n getCellText(row: any[], property: IProperty): any {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getOriginalCellText(row: any[], property: IProperty): any {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n resolveCellText(property: IProperty, value: any): any {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getRowByExistingIdx(idx: number): any[] {\r\n return this.rows[idx];\r\n }\r\n\r\n getRowById(id: string): any[] | undefined {\r\n return this.rows.find((row) => this.getRowId(row) === id);\r\n }\r\n\r\n getExistingRowIdxById(id: string): number | undefined {\r\n for (let i = 0; i < this.rows.length; i++) {\r\n if (this.getRowId(this.rows[i]) === id) {\r\n return i;\r\n }\r\n }\r\n }\r\n\r\n getPropertyById(id: string): IProperty | undefined {\r\n return undefined;\r\n }\r\n\r\n getFirstRow(): any[] | undefined {\r\n if (this.rows.length > 0) {\r\n return this.rows[0];\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n getNearestRow(row: any[]): any[] | undefined {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getNextExistingRowId(id: string): string | undefined {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getPrevExistingRowId(id: string): string | undefined {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getDirtyValues(row: any[]): Map {\r\n return new Map();\r\n }\r\n\r\n getDirtyValueRows(): any[][] {\r\n return [];\r\n }\r\n\r\n getAllValuesOfProp(property: IProperty): Set {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n async setRecords(rows: any[][]): Promise {\r\n this.rows = [...this.sortTreeRows(rows, null)];\r\n }\r\n\r\n appendRecords(rows: any[][]): void {\r\n this.rows = [...this.rows, ...this.sortTreeRows(rows, null)];\r\n }\r\n\r\n private*sortTreeRows(rows: any[], parent: any[] | null): Generator {\r\n const children = this.getChildren(rows, parent);\r\n if (parent) {\r\n yield parent;\r\n }\r\n for (let child of children) {\r\n yield*this.sortTreeRows(rows, child);\r\n }\r\n }\r\n\r\n private getChildren(rows: any[], parent: any[] | null) {\r\n const parentId = parent ? this.getRowId(parent) : null;\r\n return rows\r\n .filter((row) => parentId === this.getParentId(row))\r\n .sort((row1, row2) => this.compareLabels(row1, row2));\r\n }\r\n\r\n setFormDirtyValue(row: any[], propertyId: string, value: any): void {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n setDirtyValue(row: any[], columnId: string, value: any): void {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n flushFormToTable(row: any[]): void {\r\n }\r\n\r\n deleteAdditionalRowData(row: any[]): void {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n deleteRow(row: any[]): void {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n clear(): void {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n clearRecordDirtyValues(id: string): void {\r\n\r\n }\r\n\r\n substituteRecord(row: any[]): void {\r\n const idx = this.allRows.findIndex((r) => this.getRowId(r) === this.getRowId(row));\r\n if (idx > -1) {\r\n this.allRows.splice(idx, 1, row);\r\n }\r\n }\r\n\r\n insertRecord(index: number, row: any[], shouldLockNewRowAtTop?: boolean): Promise {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n @computed get dataSource() {\r\n return getDataSource(this);\r\n }\r\n\r\n parent?: any;\r\n\r\n getLastRow(): any[] | undefined {\r\n return undefined;\r\n }\r\n\r\n getParentId(row: any) {\r\n const dataSourceField = this.dataSource.getFieldByName(this.parentIdProperty)!;\r\n return this.getCellValueByDataSourceField(row, dataSourceField);\r\n }\r\n\r\n getLabel(row: any[]) {\r\n const dataSourceField = this.dataSource.getFieldByName(\"Name\")!;\r\n return this.getCellValueByDataSourceField(row, dataSourceField);\r\n }\r\n\r\n compareLabels(row1: any[], row2: any[]) {\r\n return this.getLabel(row1).localeCompare(this.getLabel(row2));\r\n }\r\n\r\n isCellTextResolving(property: IProperty, value: any): boolean {\r\n return false;\r\n }\r\n\r\n unlockAddedRowPosition(): void {\r\n }\r\n\r\n async updateSortAndFilter(data?: { retainPreviousSelection?: true }) {\r\n }\r\n\r\n addedRowPositionLocked: boolean = false;\r\n}\r\n\r\nexport const isTreeDataTable = (o: any): o is TreeDataTable => o.$type_TreeDataTable;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { IDataView } from \"../../../model/entities/types/IDataView\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport S from \"./TreeView.module.css\";\r\nimport cx from \"classnames\";\r\nimport { isTreeDataTable, TreeDataTable } from \"../../../model/entities/TreeDataTable\";\r\n\r\n@observer\r\nexport class TreeView extends React.Component<{ dataView: IDataView }> {\r\n constructor(props: Readonly<{ dataView: IDataView }>) {\r\n super(props);\r\n\r\n if (!isTreeDataTable(this.props.dataView.dataTable)) {\r\n throw new Error(\"TreeView requires TreeDataTable to work properly\");\r\n }\r\n }\r\n\r\n @computed\r\n get nodes() {\r\n const nodes = this.props.dataView.dataTable.rows.map(\r\n (row) => new Node({\r\n id: this.getRowId(row),\r\n label: this.getLabel(row),\r\n row: row,\r\n expansionGetter: (id: string) => this.expanded.includes(id)\r\n })\r\n );\r\n\r\n for (let node of nodes) {\r\n const parentId = this.getParentId(node.row);\r\n if (parentId) {\r\n node.parent = nodes.find((otherNode) => otherNode.id === parentId);\r\n }\r\n }\r\n return nodes;\r\n }\r\n\r\n getRowId(row: any) {\r\n return this.props.dataView.dataTable.getRowId(row);\r\n }\r\n\r\n getParentId(row: any) {\r\n return (this.props.dataView.dataTable as TreeDataTable).getParentId(row);\r\n }\r\n\r\n private getLabel(row: any[]) {\r\n return (this.props.dataView.dataTable as TreeDataTable).getLabel(row);\r\n }\r\n\r\n @observable\r\n expanded: string[] = []\r\n\r\n onRowClick(node: Node) {\r\n this.props.dataView.setSelectedRowId(node.id);\r\n }\r\n\r\n onCaretClick(node: Node) {\r\n if (this.expanded.includes(node.id)) {\r\n this.expanded.remove(node.id);\r\n } else {\r\n this.expanded.push(node.id);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n {this.nodes\r\n .filter((node) => node.isVisible)\r\n .map((node) => (\r\n this.onRowClick(node)}\r\n onCaretClick={() => this.onCaretClick(node)}\r\n />\r\n ))}\r\n
\r\n );\r\n }\r\n}\r\n\r\nclass Node {\r\n id: string;\r\n label: string;\r\n _parent: Node | undefined;\r\n row: any[];\r\n isFolder: boolean = false;\r\n expansionGetter: (nodeId: string) => boolean;\r\n\r\n get isExpanded() {\r\n return this.expansionGetter(this.id);\r\n }\r\n\r\n constructor(args: { id: string, label: string, row: any[], expansionGetter: (nodeId: string) => boolean }) {\r\n this.id = args.id;\r\n this.label = args.label;\r\n this.row = args.row;\r\n this.expansionGetter = args.expansionGetter;\r\n }\r\n\r\n get level() {\r\n return this.countParents(this, 0);\r\n }\r\n\r\n get parent(): Node | undefined {\r\n return this._parent;\r\n }\r\n\r\n set parent(value: Node | undefined) {\r\n this._parent = value;\r\n if (this._parent) {\r\n this._parent.isFolder = true;\r\n }\r\n }\r\n\r\n @computed\r\n get isVisible() {\r\n if (!this.parent) {\r\n return true;\r\n }\r\n return this.parent.isExpanded;\r\n }\r\n\r\n private countParents(node: Node, parentCount: number): number {\r\n if (!node.parent) {\r\n return parentCount;\r\n }\r\n parentCount++;\r\n return this.countParents(node.parent, parentCount);\r\n }\r\n}\r\n\r\nclass Row extends React.Component<{\r\n node: Node;\r\n isSelected: boolean;\r\n onRowClick: () => void;\r\n onCaretClick: () => void;\r\n}> {\r\n getIndent() {\r\n return this.props.node.level * 20 + \"px\";\r\n }\r\n\r\n @action.bound\r\n handleRowClick(event: any) {\r\n this.props.onRowClick?.();\r\n if (!this.props.node?.isExpanded) {\r\n event.stopPropagation();\r\n this.props.onCaretClick?.();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleCaretClick(event: any) {\r\n this.props.onCaretClick?.();\r\n event.stopPropagation();\r\n }\r\n\r\n render() {\r\n const {isExpanded} = this.props.node;\r\n return (\r\n \r\n
\r\n {this.props.node.label}\r\n
\r\n {this.props.node.isFolder ? (\r\n
\r\n \r\n
\r\n ) : (\r\n \"\"\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport type IPSSubscriber = (arg?: T) => void;\r\n\r\nexport class PubSub {\r\n newId = 0;\r\n subscribers = new Map();\r\n\r\n subscribe(subscriber: IPSSubscriber) {\r\n const myId = this.newId++;\r\n this.subscribers.set(myId, subscriber);\r\n return () => {\r\n this.subscribers.delete(myId);\r\n };\r\n }\r\n\r\n trigger(arg?: T) {\r\n for (let subscriber of this.subscribers.values()) {\r\n subscriber(arg);\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { CDataViewHeader } from \"gui/connections/CDataViewHeader\";\r\nimport { inject, Observer, observer, Provider } from \"mobx-react\";\r\nimport { getIsDataViewOrFormScreenWorkingDelayed } from \"model/selectors/DataView/getIsDataViewOrFormScreenWorking\";\r\nimport React, { createContext, ReactNode, useState } from \"react\";\r\nimport { IDataView } from \"../../../model/entities/types/IDataView\";\r\nimport { getDataViewById } from \"../../../model/selectors/DataView/getDataViewById\";\r\nimport S from \"./DataView.module.css\";\r\nimport { DataViewLoading } from \"./DataViewLoading\";\r\nimport { scopeFor } from \"dic/Container\";\r\nimport { IDataViewBodyUI } from \"modules/DataView/DataViewUI\";\r\nimport { TreeView } from \"./TreeView\";\r\nimport { observable } from \"mobx\";\r\nimport { getIsDataViewOrFormScreenWorking } from \"model/selectors/DataView/getIsDataViewOrFormScreenWorking.1\";\r\nimport { PubSub } from \"utils/events\";\r\n\r\nexport interface IDataViewHeaderExtensionItem {\r\n $iid: number;\r\n group: string;\r\n\r\n render(): ReactNode;\r\n}\r\n\r\nexport class DataViewHeaderExtension {\r\n @observable items = new Map();\r\n\r\n put(item: IDataViewHeaderExtensionItem) {\r\n this.items.set(item.$iid, item);\r\n }\r\n\r\n del(item: { $iid: number }) {\r\n this.items.delete(item.$iid);\r\n }\r\n\r\n render(group: string) {\r\n return (\r\n \r\n {() => (\r\n <>\r\n {Array.from(this.items)\r\n .filter(([iid, item]) => item.group === group)\r\n .map(([iid, item]) => (\r\n {() => <>{item.render()}}\r\n ))}\r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const CtxDataViewHeaderExtension = createContext(\r\n new DataViewHeaderExtension()\r\n);\r\n\r\ninterface IDataViewProps {\r\n id: string;\r\n modelInstanceId: string;\r\n height?: number;\r\n width?: number;\r\n isHeadless: boolean;\r\n dataView?: IDataView;\r\n}\r\n\r\n@inject(({formScreen}, {id}) => {\r\n const dataView = getDataViewById(formScreen, id);\r\n return {\r\n dataView,\r\n };\r\n})\r\n@observer\r\nexport class DataViewInner extends React.Component {\r\n dataViewHeaderExtension = new DataViewHeaderExtension();\r\n\r\n getDataViewStyle() {\r\n if (this.props.height !== undefined || this.props.width !== undefined) {\r\n return {\r\n flexGrow: 0,\r\n minHeight: this.props.height,\r\n minWidth: this.props.width,\r\n };\r\n } else {\r\n return {\r\n flexGrow: 1,\r\n flexShrink: 0,\r\n // width: \"100%\",\r\n // height: \"100%\"\r\n };\r\n }\r\n }\r\n\r\n renderUiBodyWithHeader() {\r\n const $cont = scopeFor(this.props.dataView);\r\n const uiBody = $cont && $cont.resolve(IDataViewBodyUI);\r\n const isWorking = getIsDataViewOrFormScreenWorking(this.props.dataView);\r\n return (\r\n <>\r\n
\r\n \r\n {isWorking && }\r\n
\r\n
{uiBody && uiBody.render()}
\r\n \r\n );\r\n }\r\n\r\n render() {\r\n // TODO: Move styling to stylesheet\r\n const isWorkingDelayed = getIsDataViewOrFormScreenWorkingDelayed(this.props.dataView);\r\n\r\n return (\r\n \r\n \r\n
\r\n {this.props.dataView?.type === \"TreePanel\" ? (\r\n \r\n ) : (\r\n this.renderUiBodyWithHeader()\r\n )}\r\n\r\n {isWorkingDelayed && }\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport class DataViewContext {\r\n private tableKeyDownChannel = new PubSub();\r\n\r\n subscribeTableKeyDownHandler(fn: (event: any) => void) {\r\n return this.tableKeyDownChannel.subscribe(fn);\r\n }\r\n\r\n handleTableKeyDown(event: any) {\r\n this.tableKeyDownChannel.trigger(event);\r\n }\r\n}\r\n\r\nexport const CtxDataView = createContext(undefined);\r\n\r\nexport function DataView(props: IDataViewProps) {\r\n const [context] = useState(() => new DataViewContext());\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getIsDataViewWorking } from \"./getIsDataViewWorking\";\r\nimport { getFormScreenLifecycle } from \"../FormScreen/getFormScreenLifecycle\";\r\n\r\n\r\nexport function getIsDataViewOrFormScreenWorking(ctx: any) {\r\n return getIsDataViewWorking(ctx) || getFormScreenLifecycle(ctx).isWorking;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getIsDataViewWorking } from \"./getIsDataViewWorking\";\r\nimport { getIsFormScreenWorkingDelayed } from \"../FormScreen/getIsFormScreenWorking\";\r\n\r\nexport function getIsDataViewOrFormScreenWorkingDelayed(ctx: any) {\r\n return getIsDataViewWorking(ctx) || getIsFormScreenWorkingDelayed(ctx);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { PropsWithChildren, useContext } from \"react\";\r\nimport S from \"gui/Components/DataViewHeader/DataViewHeaderAction.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { action } from \"mobx\";\r\nimport { CtxDataView, DataViewContext } from \"../ScreenElements/DataView\";\r\n\r\ninterface IDataViewHeaderActionProps {\r\n onMouseDown?(event: any): void;\r\n\r\n onClick?(event: any): void;\r\n\r\n className?: string;\r\n isActive?: boolean;\r\n isDisabled?: boolean;\r\n refDom?: any;\r\n\r\n onShortcut?(event: any): void;\r\n\r\n shortcutPredicate?(event: any): boolean;\r\n}\r\n\r\nexport class DataViewHeaderActionInner extends React.Component {\r\n @action.bound\r\n handleMouseDown(event: any) {\r\n if (!this.props.isDisabled && this.props.onMouseDown) {\r\n this.props.onMouseDown(event);\r\n }\r\n }\r\n\r\n @action.bound\r\n handleClick(event: any) {\r\n if (!this.props.isDisabled && this.props.onClick) {\r\n this.props.onClick(event);\r\n }\r\n }\r\n\r\n @action.bound\r\n handleTriggerAreaKeyDown(event: any) {\r\n if (this.props.shortcutPredicate?.(event)) {\r\n event.preventDefault();\r\n this.props.onShortcut?.(event);\r\n }\r\n }\r\n\r\n _disposer: any;\r\n\r\n kbdHandlerUp() {\r\n this._disposer?.();\r\n if (this.props.dataViewContext) {\r\n this._disposer = this.props.dataViewContext.subscribeTableKeyDownHandler(\r\n this.handleTriggerAreaKeyDown\r\n );\r\n }\r\n }\r\n\r\n kbdHandlerDown() {\r\n this._disposer?.();\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onShortcut && this.props.shortcutPredicate) {\r\n this.kbdHandlerUp();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: any) {\r\n if (\r\n (!prevProps.onShortcut || !prevProps.shortcutPredicate) &&\r\n this.props.onShortcut &&\r\n this.props.shortcutPredicate\r\n ) {\r\n this.kbdHandlerUp();\r\n } else if (\r\n prevProps.onShortcut &&\r\n prevProps.shortcutPredicate &&\r\n (!this.props.onShortcut || !this.props.shortcutPredicate)\r\n ) {\r\n this.kbdHandlerDown();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.kbdHandlerDown();\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport function DataViewHeaderAction(props: PropsWithChildren) {\r\n const dataViewContext = useContext(CtxDataView);\r\n return ;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { ContribArray } from \"utils/common\";\r\nimport bind from \"bind-decorator\";\r\n\r\nexport interface IPerspectiveContrib {\r\n deactivate(): Generator;\r\n\r\n activateDefault(): Generator;\r\n}\r\n\r\nexport class Perspective {\r\n contrib = new ContribArray();\r\n\r\n @bind\r\n *deactivate() {\r\n for (let c of this.contrib) {\r\n yield*c.deactivate();\r\n }\r\n }\r\n\r\n @bind\r\n *activateDefault() {\r\n for (let c of this.contrib) {\r\n yield*c.activateDefault();\r\n }\r\n }\r\n\r\n}\r\n\r\nexport const IPerspective = TypeSymbol(\"IPerspective\");","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, flow, reaction } from \"mobx\";\r\nimport { parse as wktParse, stringify as wktStringify } from \"wkt\";\r\nimport { getDataSourceFieldIndexByName } from \"model/selectors/DataSources/getDataSourceFieldIndexByName\";\r\nimport { MapRootStore } from \"./MapRootStore\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { onFieldChangeG } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport _ from \"lodash\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\n\r\nexport class MapObjectsStore {\r\n constructor(private root: MapRootStore) {\r\n }\r\n\r\n get dataView() {\r\n return this.root.dataView;\r\n }\r\n\r\n get setup() {\r\n return this.root.mapSetupStore;\r\n }\r\n\r\n get search() {\r\n return this.root.mapSearchStore;\r\n }\r\n\r\n get navigationStore() {\r\n return this.root.mapNavigationStore;\r\n }\r\n\r\n @computed get fldLocationIndex() {\r\n return this.setup.mapLocationMember\r\n ? getDataSourceFieldIndexByName(this.dataView, this.setup.mapLocationMember)\r\n : undefined;\r\n }\r\n\r\n @computed get fldNameIndex() {\r\n return this.setup.mapTextMember\r\n ? getDataSourceFieldIndexByName(this.dataView, this.setup.mapTextMember)\r\n : undefined;\r\n }\r\n\r\n @computed get fldIconIndex() {\r\n return this.setup.mapIconMember\r\n ? getDataSourceFieldIndexByName(this.dataView, this.setup.mapIconMember)\r\n : undefined;\r\n }\r\n\r\n @computed get fldIconAzimuth() {\r\n return this.setup.mapAzimuthMember\r\n ? getDataSourceFieldIndexByName(this.dataView, this.setup.mapAzimuthMember)\r\n : undefined;\r\n }\r\n\r\n @computed get fldColorIndex() {\r\n return this.setup.mapColorMember\r\n ? getDataSourceFieldIndexByName(this.dataView, this.setup.mapColorMember)\r\n : undefined;\r\n }\r\n\r\n @computed get fldIdentifier() {\r\n return getDataSourceFieldIndexByName(this.dataView, \"Id\");\r\n }\r\n\r\n @computed\r\n get mapObjects() {\r\n if (this.fldIdentifier === undefined) {\r\n return [];\r\n }\r\n const result: IMapObject[] = [];\r\n if (this.setup.isReadOnlyView) {\r\n const tableRows = this.dataView.tableRows;\r\n\r\n for (let row of tableRows) {\r\n if (_.isArray(row) && this.fldLocationIndex !== undefined && row[this.fldLocationIndex]) {\r\n const objectGeoJson = wktParse(row[this.fldLocationIndex]);\r\n if (objectGeoJson)\r\n result.push({\r\n ...objectGeoJson,\r\n id: row[this.fldIdentifier],\r\n name: this.fldNameIndex !== undefined ? row[this.fldNameIndex] : \"\",\r\n icon: this.fldIconIndex !== undefined ? row[this.fldIconIndex] : undefined,\r\n color: this.fldColorIndex !== undefined ? row[this.fldColorIndex] : undefined,\r\n azimuth: this.fldIconAzimuth !== undefined ? row[this.fldIconAzimuth] : undefined,\r\n });\r\n }\r\n }\r\n } else {\r\n let selectedRow = getSelectedRow(this.dataView);\r\n if (selectedRow) {\r\n const row = selectedRow;\r\n if (_.isArray(row) && this.fldLocationIndex && row[this.fldLocationIndex]) {\r\n let objectGeoJson: any;\r\n try {\r\n objectGeoJson = wktParse(row[this.fldLocationIndex]);\r\n } catch (e) {\r\n // TODO: Erorr dialog?\r\n console.error(e); // eslint-disable-line no-console\r\n }\r\n if (objectGeoJson) {\r\n result.push({\r\n ...objectGeoJson,\r\n id: row[this.fldIdentifier],\r\n name: this.fldNameIndex !== undefined ? row[this.fldNameIndex] : \"\",\r\n icon: this.fldIconIndex && row[this.fldIconIndex],\r\n color: this.fldColorIndex !== undefined ? row[this.fldColorIndex] : undefined,\r\n azimuth: this.fldIconAzimuth && row[this.fldIconAzimuth],\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n @action.bound\r\n handleGeometryChange(geoJson: any) {\r\n const self = this;\r\n return flow(function*() {\r\n const property = getDataViewPropertyById(self.dataView, self.setup.mapLocationMember);\r\n const selectedRow = getSelectedRow(self.dataView);\r\n if (property && selectedRow) {\r\n yield*onFieldChangeG(self.dataView)({\r\n event: undefined,\r\n row: selectedRow,\r\n property: property,\r\n value: geoJson ? wktStringify(geoJson) : null,\r\n });\r\n getDataTable(self.dataView).flushFormToTable(selectedRow);\r\n yield*getFormScreenLifecycle(self.dataView).onFlushData();\r\n }\r\n })();\r\n }\r\n\r\n @action.bound\r\n handleLayerClick(id: string) {\r\n if (this.setup.isReadOnlyView) {\r\n getDataView(this.dataView).setSelectedRowId(id);\r\n this.search.selectSearchResultById(id);\r\n this.navigationStore.highlightSelectedSearchResult();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleMapMounted() {\r\n return reaction(\r\n () => getSelectedRowId(this.dataView),\r\n (rowId: string | undefined) => {\r\n if (this.setup.isReadOnlyView && rowId) {\r\n this.search.selectSearchResultById(rowId);\r\n this.navigationStore.highlightSelectedSearchResult();\r\n }\r\n },\r\n {fireImmediately: true}\r\n );\r\n }\r\n}\r\n\r\nexport enum IMapObjectType {\r\n POINT = \"Point\",\r\n POLYGON = \"Polygon\",\r\n LINESTRING = \"LineString\",\r\n}\r\n\r\nexport interface IMapObjectBase {\r\n id: string;\r\n name: string;\r\n icon: string;\r\n color: number | undefined;\r\n azimuth: number;\r\n}\r\n\r\nexport interface IMapPoint extends IMapObjectBase {\r\n type: IMapObjectType.POINT;\r\n coordinates: [number, number];\r\n}\r\n\r\nexport interface IMapPolygon extends IMapObjectBase {\r\n type: IMapObjectType.POLYGON;\r\n coordinates: [number, number][][];\r\n}\r\n\r\nexport interface IMapPolyline extends IMapObjectBase {\r\n type: IMapObjectType.LINESTRING;\r\n coordinates: [number, number][][];\r\n}\r\n\r\nexport type IMapObject = IMapPoint | IMapPolygon | IMapPolyline;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { observable } from \"mobx\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { IPerspective, IPerspectiveContrib } from \"../Perspective\";\r\nimport bind from \"bind-decorator\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\nimport { IViewConfiguration } from \"modules/DataView/ViewConfiguration\";\r\n\r\nexport class MapPerspective implements IIId, IPerspectiveContrib {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public perspective = IPerspective(),\r\n public viewConfiguration = IViewConfiguration()\r\n ) {\r\n }\r\n\r\n @observable isActive = false;\r\n\r\n @bind\r\n *handleToolbarBtnClick() {\r\n if (this.isActive) return;\r\n yield*this.perspective.deactivate();\r\n this.isActive = true;\r\n yield*this.viewConfiguration.anounceActivePerspective(IPanelViewType.Map);\r\n }\r\n\r\n @bind\r\n *deactivate() {\r\n this.isActive = false;\r\n }\r\n\r\n @bind\r\n *activateDefault() {\r\n if (this.viewConfiguration.activePerspective === IPanelViewType.Map) this.isActive = true;\r\n }\r\n}\r\n\r\nexport const IMapPerspective = TypeSymbol(\"IMapPerspective\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport cx from \"classnames\";\r\nimport L from \"leaflet\";\r\nimport \"leaflet-draw/dist/leaflet.draw-src.js\";\r\nimport \"leaflet-draw/dist/leaflet.draw-src.css\";\r\nimport \"leaflet/dist/leaflet.css\";\r\nimport { action, autorun, computed, observable, reaction, runInAction } from \"mobx\";\r\nimport qs from \"querystring\";\r\nimport React from \"react\";\r\nimport S from \"./MapPerspectiveUI.module.scss\";\r\nimport { IMapObject, IMapObjectType } from \"./stores/MapObjectsStore\";\r\nimport { MapLayer } from \"./stores/MapSetupStore\";\r\nimport Measure, { ContentRect } from \"react-measure\";\r\nimport { flashColor2htmlColor } from \"utils/flashColorFormat\";\r\nimport { ring as area } from \"@mapbox/geojson-area\";\r\n\r\ndelete (L.Icon.Default.prototype as any)._getIconUrl;\r\n\r\nL.Icon.Default.mergeOptions({\r\n iconRetinaUrl: require(\"leaflet/dist/images/marker-icon-2x.png\"),\r\n iconUrl: require(\"leaflet/dist/images/marker-icon.png\"),\r\n shadowUrl: require(\"leaflet/dist/images/marker-shadow.png\"),\r\n});\r\n\r\ninterface IMapPerspectiveComProps {\r\n mapCenter: { type: \"Point\"; coordinates: [number, number] } | undefined;\r\n initialZoom: number | undefined;\r\n getMapObjects: () => IMapObject[];\r\n getRoutefinderRoute: () => any[];\r\n getRoutefinderEditables: () => any[];\r\n lastDetailedObject?: IMapObject;\r\n mapLayers: MapLayer[];\r\n isReadOnly: boolean;\r\n isActive: boolean;\r\n\r\n onChange?(geoJson: any): void;\r\n\r\n onLayerClick?(id: string): void;\r\n\r\n onRoutefinderGeometryChange?(obj: any): void;\r\n\r\n onRoutefinderGeometryEditStart?(): void;\r\n\r\n onRoutefinderGeometryEditSave?(): void;\r\n\r\n onRoutefinderGeometryEditCancel?(): void;\r\n}\r\n\r\nconst MAP_ANIMATE_SETTING = {\r\n animate: true,\r\n duration: 1.1,\r\n};\r\n\r\nfunction getOptionsEPSG(options: any) {\r\n switch (options.crs?.toUpperCase()) {\r\n case \"EPSG4326\":\r\n return L.CRS.EPSG4326;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport class MapPerspectiveCom extends React.Component {\r\n elmMapDiv: HTMLDivElement | null = null;\r\n refMapDiv = (elm: any) => (this.elmMapDiv = elm);\r\n\r\n leafletMap?: L.DrawMap;\r\n\r\n leafletMapObjects = new L.FeatureGroup();\r\n leafletMapRoute = new L.FeatureGroup();\r\n\r\n editingObjectsRepaintDisabled = false;\r\n\r\n _disposers: any[] = [];\r\n\r\n panToCenter() {\r\n if (this.props.mapCenter) {\r\n this.leafletMap?.panTo(\r\n [this.props.mapCenter.coordinates[1], this.props.mapCenter.coordinates[0]],\r\n {...MAP_ANIMATE_SETTING}\r\n );\r\n } else {\r\n this.leafletMap?.panTo([0, 0], {...MAP_ANIMATE_SETTING});\r\n }\r\n }\r\n\r\n panToLoc(loc: [number, number]) {\r\n this.leafletMap?.panTo(loc, {...MAP_ANIMATE_SETTING});\r\n }\r\n\r\n panToSelectedObject() {\r\n for (let [obj, lLayer] of this.mapDrawnObjectLayers) {\r\n if (obj.id === this.props.lastDetailedObject?.id) {\r\n this.panToLayer(lLayer);\r\n return;\r\n }\r\n }\r\n }\r\n\r\n panToLayer(lLayer: L.Layer) {\r\n if ((lLayer as any).getBounds) {\r\n const bounds = (lLayer as any).getBounds() as L.LatLngBounds;\r\n this.leafletMap?.fitBounds(bounds.pad(0.1), {...MAP_ANIMATE_SETTING});\r\n } else if ((lLayer as any).getLatLng) {\r\n const latLng = (lLayer as any).getLatLng();\r\n this.leafletMap?.panTo(latLng, {...MAP_ANIMATE_SETTING});\r\n }\r\n }\r\n\r\n panToFirstObject() {\r\n if (this.mapDrawnObjectLayers.length > 0) {\r\n this.panToLayer(this.mapDrawnObjectLayers[0][1]);\r\n }\r\n }\r\n\r\n isPropMapCenterDifferent(prevProps: IMapPerspectiveComProps) {\r\n return (\r\n this.props.mapCenter?.coordinates[0] !== prevProps.mapCenter?.coordinates[0] ||\r\n this.props.mapCenter?.coordinates[1] !== prevProps.mapCenter?.coordinates[1]\r\n );\r\n }\r\n\r\n isPropActiveDifferent(prevProps: IMapPerspectiveComProps) {\r\n return this.props.isActive !== prevProps.isActive;\r\n }\r\n\r\n componentDidUpdate(prevProps: IMapPerspectiveComProps) {\r\n runInAction(() => {\r\n if (this.isPropActiveDifferent(prevProps)) {\r\n if (this.props.isActive) {\r\n this.mountLeaflet();\r\n } else {\r\n //this.unmountLeaflet();\r\n }\r\n }\r\n if (this.isPropMapCenterDifferent(prevProps)) {\r\n this.panToCenter();\r\n }\r\n /*const { lastDetailedObject } = this.props;\r\n if (\r\n lastDetailedObject &&\r\n (!prevProps.lastDetailedObject ||\r\n !_.isEqual(lastDetailedObject, prevProps.lastDetailedObject))\r\n ) {\r\n this.panToSelectedObject();\r\n this.highlightSelectedLayer();\r\n }\r\n if (!lastDetailedObject && prevProps.lastDetailedObject) {\r\n this.highlightSelectedLayer();\r\n }*/\r\n });\r\n }\r\n\r\n highlightLayer(obj: IMapObject, lLayer: L.Layer) {\r\n if ((lLayer as any).setStyle) {\r\n (lLayer as any).setStyle({color: \"yellow\"});\r\n }\r\n if ((lLayer as any).setIcon) {\r\n (lLayer as any).setIcon(\r\n L.divIcon({\r\n ...(lLayer as any).getIcon().options,\r\n className: \"markerHighlighted\",\r\n })\r\n );\r\n }\r\n }\r\n\r\n unHighlightLayer(obj: IMapObject, lLayer: L.Layer) {\r\n if ((lLayer as any).setStyle) {\r\n (lLayer as any).setStyle({\r\n color:\r\n obj.color !== undefined && obj.color !== 0 && obj.color !== null\r\n ? flashColor2htmlColor(obj.color)\r\n : \"blue\",\r\n });\r\n }\r\n if ((lLayer as any).setIcon) {\r\n (lLayer as any).setIcon(\r\n L.divIcon({\r\n ...(lLayer as any).getIcon().options,\r\n className: \"\",\r\n })\r\n );\r\n }\r\n }\r\n\r\n highlightSelectedLayer() {\r\n for (let [obj, lLayer] of this.mapDrawnObjectLayers) {\r\n if (obj.id === this.props.lastDetailedObject?.id) {\r\n this.highlightLayer(obj, lLayer);\r\n } else {\r\n this.unHighlightLayer(obj, lLayer);\r\n }\r\n }\r\n }\r\n\r\n @computed get layerList() {\r\n return this.props.mapLayers\r\n .map((rawLayer, index) => {\r\n if (rawLayer.type === \"OSM\") {\r\n return [\r\n rawLayer,\r\n L.tileLayer(rawLayer.getUrl(), {...rawLayer.getOptions(), zIndex: index}),\r\n ];\r\n } else if (rawLayer.type === \"WMS\") {\r\n return [\r\n rawLayer,\r\n L.tileLayer.wms(rawLayer.getUrl(), {\r\n ...rawLayer.getOptions(),\r\n zIndex: index,\r\n crs: getOptionsEPSG(rawLayer.getOptions()),\r\n }),\r\n ];\r\n }\r\n return undefined;\r\n })\r\n .filter((layer) => layer) as [MapLayer, L.TileLayer][];\r\n }\r\n\r\n @computed get leafletlayersDescriptor() {\r\n return Object.fromEntries(\r\n this.layerList.map((layer) => {\r\n return [layer[0].getTitle(), layer[1]];\r\n })\r\n );\r\n }\r\n\r\n @computed get mapDrawnObjectLayers() {\r\n return this.props\r\n .getMapObjects()\r\n .map((obj) => {\r\n let result: [IMapObject, L.Layer];\r\n switch (obj.type) {\r\n case IMapObjectType.POINT: {\r\n const iconUrl = obj.icon || \"img/map/marker-icon.png#anchor=[12,41]\";\r\n const pq = iconUrl ? qs.parse(iconUrl.split(\"#\")[1] || \"\") : null;\r\n const anchor = pq?.anchor ? JSON.parse(pq.anchor as string) : [0, 0];\r\n const iconAnchor: [number, number] = anchor;\r\n const iconRotation = obj.azimuth || 0;\r\n const myIcon = L.divIcon({\r\n html: ``,\r\n // iconSize: [38, 95],\r\n iconAnchor,\r\n className: \"\",\r\n //popupAnchor: [-3, -76],\r\n });\r\n result = [\r\n obj,\r\n L.marker([obj.coordinates[1], obj.coordinates[0]], {\r\n icon: myIcon,\r\n }).bindTooltip(obj.name),\r\n ];\r\n }\r\n break;\r\n case IMapObjectType.POLYGON:\r\n result = [\r\n obj,\r\n L.polygon(\r\n obj.coordinates[0].map((coords) => [coords[1], coords[0]]),\r\n {\r\n color:\r\n obj.color !== undefined && obj.color !== 0 && obj.color !== null\r\n ? flashColor2htmlColor(obj.color)\r\n : \"blue\",\r\n }\r\n ).bindTooltip(obj.name),\r\n ];\r\n break;\r\n case IMapObjectType.LINESTRING:\r\n result = [\r\n obj,\r\n L.polyline(\r\n obj.coordinates.map((coords) => [coords[1], coords[0]]),\r\n {\r\n color:\r\n obj.color !== undefined && obj.color !== 0 && obj.color !== null\r\n ? flashColor2htmlColor(obj.color)\r\n : \"blue\",\r\n }\r\n ).bindTooltip(obj.name),\r\n ];\r\n break;\r\n }\r\n return result;\r\n })\r\n .filter((layer) => layer) as [IMapObject, L.Layer][];\r\n }\r\n\r\n @computed get mapRoutefinderRoute() {\r\n return this.props\r\n .getRoutefinderRoute()\r\n .map((obj) => {\r\n switch (obj.type) {\r\n case \"LineString\":\r\n return L.polyline(\r\n obj.coordinates.map((coords: any) => [coords[1], coords[0]]),\r\n {color: \"blue\"}\r\n );\r\n }\r\n return undefined;\r\n })\r\n .filter((obj) => obj);\r\n }\r\n\r\n @computed get mapRoutefinderEditables() {\r\n return this.props\r\n .getRoutefinderEditables()\r\n .map((obj) => {\r\n switch (obj.type) {\r\n case \"LineString\":\r\n return L.polyline(\r\n obj.coordinates.map((coords: any) => [coords[1], coords[0]]),\r\n {color: \"green\", dashArray: \"10 5 3 5\", opacity: 1.0, weight: 1.5}\r\n );\r\n }\r\n return undefined;\r\n })\r\n .filter((obj) => obj);\r\n }\r\n\r\n @action.bound handleOjectCreated(event: any) {\r\n const layer = event.layer;\r\n this.leafletMapObjects.clearLayers();\r\n this.leafletMapObjects.addLayer(layer);\r\n const geoJSON = layer.toGeoJSON();\r\n const geometry = geoJSON.geometry.type === \"Polygon\"\r\n ? this.getCounterClockWisePolygonPoints(geoJSON.geometry)\r\n : geoJSON.geometry;\r\n this.props.onChange?.(geometry);\r\n }\r\n\r\n getCounterClockWisePolygonPoints(polygonGeometry: any){\r\n if(!polygonGeometry || polygonGeometry.coordinates?.length !== 1){\r\n // eslint-disable-next-line no-console\r\n console.warn(`Failed to check polygonGeometry:`);\r\n // eslint-disable-next-line no-console\r\n console.warn(polygonGeometry);\r\n return polygonGeometry;\r\n }\r\n const polygonArea = area(polygonGeometry.coordinates[0]);\r\n if(polygonArea > 0) {\r\n return {\r\n type: \"Polygon\",\r\n coordinates: [polygonGeometry.coordinates[0].reverse()]\r\n };\r\n }\r\n return polygonGeometry\r\n }\r\n\r\n @action.bound handleObjectEdited(event: any) {\r\n const layers = (event as any).layers;\r\n const obj = layers.toGeoJSON().features?.[0]?.geometry;\r\n if (obj) {\r\n this.props.onChange?.(obj);\r\n }\r\n }\r\n\r\n @action.bound handleObjectDeleted(event: any) {\r\n this.props.onChange?.(undefined);\r\n }\r\n\r\n @action.bound handleRoutefinderOjectCreated(event: any) {\r\n const layer = event.layer;\r\n this.leafletMapObjects.clearLayers();\r\n this.leafletMapObjects.addLayer(layer);\r\n const obj = (this.leafletMapObjects as any).toGeoJSON().features?.[0]?.geometry;\r\n this.routefinderUpdate(obj);\r\n }\r\n\r\n @action.bound handleRoutefinderObjectEdited(event: any) {\r\n const obj = (this.leafletMapObjects as any).toGeoJSON().features?.[0]?.geometry;\r\n this.routefinderUpdate(obj);\r\n }\r\n\r\n @action.bound handleRoutefinderObjectDeleted(event: any) {\r\n this.routefinderUpdate(undefined);\r\n }\r\n\r\n @action.bound handleRoutefinderVertexDrawn(event: any) {\r\n const obj = {\r\n type: \"LineString\",\r\n coordinates: event.layers\r\n .getLayers()\r\n .map((layer: any) => [layer.getLatLng().lng, layer.getLatLng().lat]),\r\n };\r\n this.routefinderUpdate(obj);\r\n }\r\n\r\n @action.bound handleRoutefinderVertexEdited(event: any) {\r\n const obj = (this.leafletMapObjects as any).toGeoJSON().features?.[0]?.geometry;\r\n this.routefinderUpdate(obj);\r\n }\r\n\r\n @action.bound routefinderUpdate(obj: any) {\r\n this.props.onRoutefinderGeometryChange?.(obj);\r\n }\r\n\r\n @action.bound handleRoutefinderEditStart() {\r\n this.editingObjectsRepaintDisabled = true;\r\n this.props.onRoutefinderGeometryEditStart?.();\r\n }\r\n\r\n @action.bound handleRoutefinderDrawStart() {\r\n this.handleRoutefinderEditStart();\r\n }\r\n\r\n _isCancelAction = false;\r\n\r\n @action.bound handleRoutefinderEditStop() {\r\n this.editingObjectsRepaintDisabled = false;\r\n if (this._isCancelAction) {\r\n this.props.onRoutefinderGeometryEditCancel?.();\r\n } else {\r\n this.props.onRoutefinderGeometryEditSave?.();\r\n }\r\n }\r\n\r\n @action.bound handleRoutefinderDrawStop() {\r\n this.handleRoutefinderEditStop();\r\n }\r\n\r\n setMapControlCancelHack() {\r\n /*\r\n This is need to distinguish between Finish and Cancel button click.\r\n */\r\n const self = this;\r\n\r\n const edit = (this.mapControl! as any)._toolbars.edit;\r\n const oldEditDisable = edit.disable;\r\n (this.mapControl! as any)._toolbars.edit.disable = function () {\r\n self._isCancelAction = true;\r\n oldEditDisable.apply(edit, arguments);\r\n self._isCancelAction = false;\r\n };\r\n\r\n const draw = (this.mapControl! as any)._toolbars.draw;\r\n const oldDrawDisable = draw.disable;\r\n (this.mapControl! as any)._toolbars.draw.disable = function () {\r\n self._isCancelAction = true;\r\n oldDrawDisable.apply(draw, arguments);\r\n self._isCancelAction = false;\r\n };\r\n }\r\n\r\n initLeafletDrawControls() {\r\n this.activateNormalControls();\r\n }\r\n\r\n mapControl: L.Control.Draw | undefined;\r\n mapControlDisposers: Array<() => void> = [];\r\n\r\n activateRoutingControls() {\r\n for (let h of this.mapControlDisposers) h();\r\n this.mapControlDisposers = [];\r\n this.leafletMapObjects.clearLayers();\r\n this.leafletMapRoute.clearLayers();\r\n this.leafletMap?.addControl(\r\n (this.mapControl = new L.Control.Draw({\r\n edit: {\r\n featureGroup: this.leafletMapObjects,\r\n poly: {\r\n allowIntersection: true,\r\n },\r\n circle: false,\r\n circlemarker: false,\r\n },\r\n draw: {\r\n polygon: false,\r\n point: false,\r\n marker: false,\r\n circle: false,\r\n circlemarker: false,\r\n rectangle: false,\r\n },\r\n } as any)) // 🦄\r\n );\r\n\r\n this.setMapControlCancelHack();\r\n\r\n this.leafletMap?.on(L.Draw.Event.CREATED, this.handleRoutefinderOjectCreated);\r\n this.leafletMap?.on(L.Draw.Event.EDITED, this.handleRoutefinderObjectEdited);\r\n this.leafletMap?.on(L.Draw.Event.DELETED, this.handleRoutefinderObjectDeleted);\r\n this.leafletMap?.on(L.Draw.Event.DRAWVERTEX, this.handleRoutefinderVertexDrawn);\r\n this.leafletMap?.on(L.Draw.Event.EDITVERTEX, this.handleRoutefinderVertexEdited);\r\n\r\n this.leafletMap?.on(L.Draw.Event.EDITSTART, this.handleRoutefinderEditStart);\r\n this.leafletMap?.on(L.Draw.Event.EDITSTOP, this.handleRoutefinderEditStop);\r\n this.leafletMap?.on(L.Draw.Event.DRAWSTART, this.handleRoutefinderDrawStart);\r\n this.leafletMap?.on(L.Draw.Event.DRAWSTOP, this.handleRoutefinderDrawStop);\r\n\r\n this.mapControlDisposers.push(() => {\r\n this.leafletMap?.off(L.Draw.Event.CREATED, this.handleRoutefinderOjectCreated);\r\n this.leafletMap?.off(L.Draw.Event.EDITED, this.handleRoutefinderObjectEdited);\r\n this.leafletMap?.off(L.Draw.Event.DELETED, this.handleRoutefinderObjectDeleted);\r\n this.leafletMap?.off(L.Draw.Event.DRAWVERTEX, this.handleRoutefinderVertexDrawn);\r\n this.leafletMap?.off(L.Draw.Event.EDITVERTEX, this.handleRoutefinderVertexEdited);\r\n\r\n this.leafletMap?.off(L.Draw.Event.EDITSTART, this.handleRoutefinderEditStart);\r\n this.leafletMap?.off(L.Draw.Event.EDITSTOP, this.handleRoutefinderEditStop);\r\n this.leafletMap?.off(L.Draw.Event.DRAWSTART, this.handleRoutefinderDrawStart);\r\n this.leafletMap?.off(L.Draw.Event.DRAWSTOP, this.handleRoutefinderDrawStop);\r\n\r\n if (this.mapControl) this.leafletMap?.removeControl(this.mapControl);\r\n this.mapControl = undefined;\r\n });\r\n }\r\n\r\n activateNormalControls() {\r\n for (let h of this.mapControlDisposers) h();\r\n this.mapControlDisposers = [];\r\n this.leafletMapObjects.clearLayers();\r\n this.leafletMapRoute.clearLayers();\r\n this.leafletMap?.addControl(\r\n (this.mapControl = new L.Control.Draw({\r\n edit: {\r\n featureGroup: this.leafletMapObjects,\r\n poly: {\r\n allowIntersection: true,\r\n },\r\n circle: false,\r\n circlemarker: false,\r\n },\r\n draw: {\r\n polygon: {\r\n allowIntersection: false,\r\n showArea: true,\r\n },\r\n circle: false,\r\n circlemarker: false,\r\n },\r\n } as any)) // 🦄\r\n );\r\n this.leafletMap?.on(L.Draw.Event.CREATED, this.handleOjectCreated);\r\n this.leafletMap?.on(L.Draw.Event.EDITED, this.handleObjectEdited);\r\n this.leafletMap?.on(L.Draw.Event.DELETED, this.handleObjectDeleted);\r\n this.mapControlDisposers.push(() => {\r\n this.leafletMap?.off(L.Draw.Event.CREATED, this.handleOjectCreated);\r\n this.leafletMap?.off(L.Draw.Event.EDITED, this.handleObjectEdited);\r\n this.leafletMap?.off(L.Draw.Event.DELETED, this.handleObjectDeleted);\r\n if (this.mapControl) this.leafletMap?.removeControl(this.mapControl);\r\n this.mapControl = undefined;\r\n });\r\n }\r\n\r\n mapFittedToLayers = false;\r\n\r\n lmap: L.DrawMap | undefined;\r\n\r\n initLeaflet() {\r\n this.lmap = L.map(this.elmMapDiv!, {\r\n layers: this.layerList\r\n .filter(([rawLayer, leaLayer]) => rawLayer.defaultEnabled)\r\n .map(([rawLayer, leaLayer]) => leaLayer),\r\n });\r\n this.leafletMap = this.lmap;\r\n this.lmap.setZoom(this.props.initialZoom || 0);\r\n this.panToCenter();\r\n L.control\r\n .layers({}, this.leafletlayersDescriptor, {position: \"topleft\", collapsed: true})\r\n .addTo(this.lmap);\r\n L.control.scale().addTo(this.lmap);\r\n\r\n this.lmap.addLayer(this.leafletMapObjects);\r\n this.lmap.addLayer(this.leafletMapRoute);\r\n\r\n this._disposers.push(\r\n reaction(\r\n () => this.mapDrawnObjectLayers,\r\n (layers) => {\r\n this.leafletMapObjects.clearLayers();\r\n let allLayerBounds = L.latLngBounds([]);\r\n for (let layer of layers) {\r\n this.leafletMapObjects.addLayer(layer[1]);\r\n if ((layer[1] as any).getBounds) {\r\n allLayerBounds.extend((layer[1] as any).getBounds());\r\n } else if ((layer[1] as any).getLatLng) {\r\n allLayerBounds.extend((layer[1] as any).getLatLng());\r\n }\r\n layer[1].on(\"click\", () => this.props.onLayerClick?.(layer[0].id));\r\n }\r\n if (!this.props.mapCenter && allLayerBounds.isValid() && !this.mapFittedToLayers) {\r\n allLayerBounds = allLayerBounds.pad(0.1);\r\n const mapCenter = allLayerBounds.getCenter();\r\n this.lmap!.panTo(mapCenter);\r\n this.mapFittedToLayers = true;\r\n }\r\n this.highlightSelectedLayer();\r\n if(layers.length === 1){\r\n this.panToFirstObject();\r\n }\r\n },\r\n {\r\n delay: 100,\r\n fireImmediately: true,\r\n }\r\n ),\r\n reaction(\r\n () => this.mapRoutefinderRoute,\r\n (layers) => {\r\n this.leafletMapRoute.clearLayers();\r\n for (let layer of layers) {\r\n this.leafletMapRoute.addLayer(layer!);\r\n }\r\n }\r\n ),\r\n reaction(\r\n () => this.mapRoutefinderEditables,\r\n (layers) => {\r\n if (this.editingObjectsRepaintDisabled) return;\r\n this.leafletMapObjects.clearLayers();\r\n for (let layer of layers) {\r\n this.leafletMapObjects.addLayer(layer!);\r\n }\r\n }\r\n )\r\n );\r\n }\r\n\r\n _isMounted = false;\r\n\r\n mountLeaflet() {\r\n if (!this._isMounted) {\r\n this.initLeaflet();\r\n if (!this.props.isReadOnly) {\r\n this.initLeafletDrawControls();\r\n }\r\n this._isMounted = true;\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n autorun(\r\n () => {\r\n if (\r\n (this.contentRect?.bounds?.width || 0) > 40 &&\r\n (this.contentRect?.bounds?.height || 0) > 40 &&\r\n this.props.isActive\r\n ) {\r\n this.mountLeaflet();\r\n }\r\n },\r\n {delay: 500}\r\n );\r\n }\r\n\r\n componentWillUnmount() {\r\n this._disposers.forEach((d) => d());\r\n }\r\n\r\n @observable.ref contentRect?: ContentRect;\r\n\r\n @action.bound\r\n handleResize(rect: ContentRect) {\r\n this.contentRect = rect;\r\n this.lmap?.invalidateSize();\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {({measureRef}) => (\r\n
\r\n {\r\n this.refMapDiv(elm);\r\n }}\r\n >
\r\n \r\n )}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport { MapRootStore } from \"./MapRootStore\";\r\n\r\nexport class MapNavigationStore {\r\n constructor(private root: MapRootStore) {\r\n }\r\n\r\n refMapComponent = (elm: any) => (this.elmMapComponent = elm);\r\n elmMapComponent: {\r\n panToCenter(): void;\r\n panToSelectedObject(): void;\r\n panToFirstObject(): void;\r\n highlightSelectedLayer(): void;\r\n activateRoutingControls(): void;\r\n activateNormalControls(): void;\r\n } | null = null;\r\n\r\n get setupStore() {\r\n return this.root.mapSetupStore;\r\n }\r\n\r\n get searchStore() {\r\n return this.root.mapSearchStore;\r\n }\r\n\r\n @action.bound\r\n highlightSelectedSearchResult() {\r\n // We might select some result right before this point in the same action.\r\n // Wait for React to propagate props.\r\n setTimeout(() => this.elmMapComponent?.highlightSelectedLayer(), 100);\r\n }\r\n\r\n @action.bound\r\n fitToSelectedSearchResult() {\r\n // We might select some result right before this point in the same action.\r\n // Wait for React to propagate props.\r\n setTimeout(() => this.elmMapComponent?.panToSelectedObject(), 100);\r\n }\r\n\r\n @action.bound\r\n handleCenterMapClick(event: any) {\r\n this.elmMapComponent?.panToCenter();\r\n }\r\n\r\n @action.bound\r\n activateRoutingControls() {\r\n this.elmMapComponent?.activateRoutingControls();\r\n }\r\n\r\n @action.bound\r\n activateNormalControls() {\r\n this.elmMapComponent?.activateNormalControls();\r\n }\r\n\r\n @action.bound\r\n handleLookupObjectClick(event: any) {\r\n if (this.setupStore.isReadOnlyView) {\r\n if (this.searchStore.selectedSearchResult) {\r\n this.elmMapComponent?.panToSelectedObject();\r\n }\r\n } else {\r\n this.elmMapComponent?.panToFirstObject();\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { MapRootStore } from \"./MapRootStore\";\r\n\r\nexport class MapRoutefinderStore {\r\n constructor(private root: MapRootStore) {\r\n }\r\n\r\n get navigation() {\r\n return this.root.mapNavigationStore;\r\n }\r\n\r\n get objects() {\r\n return this.root.mapObjectsStore;\r\n }\r\n\r\n @observable isActive = false;\r\n\r\n @observable.shallow routeLatLngs: any[] = [];\r\n @observable.shallow driveThruPointsEditing: any[] = [];\r\n @observable.shallow driveThruPoints: any[] = [];\r\n\r\n @computed get mapObjectsRoute() {\r\n return [{type: \"LineString\", coordinates: this.routeLatLngs.map((latLng) => latLng)}];\r\n }\r\n\r\n @computed get mapObjectsEditable() {\r\n return [\r\n {\r\n type: \"LineString\",\r\n coordinates: this.driveThruPoints.map((latLng) => latLng),\r\n },\r\n ];\r\n }\r\n\r\n @action.bound\r\n handleRoutefinderButtonClick(event: any) {\r\n if (!this.isActive) {\r\n this.isActive = true;\r\n this.navigation.activateRoutingControls();\r\n } else {\r\n this.isActive = false;\r\n this.navigation.activateNormalControls();\r\n }\r\n }\r\n\r\n @action.bound handleResultsReceived(results: any) {\r\n this.routeLatLngs = results.geometry.map((coord: any) => [coord.x, coord.y]);\r\n }\r\n\r\n @action.bound handleEditingFinished() {\r\n this.driveThruPoints = this.driveThruPointsEditing;\r\n if (this.routeLatLngs.length > 0) {\r\n this.objects.handleGeometryChange(this.mapObjectsRoute[0]);\r\n }\r\n }\r\n\r\n @action.bound handleEditingCancelled() {\r\n this.driveThruPointsEditing = [];\r\n if (this.driveThruPoints.length > 1) {\r\n this.calculateRoute(this.driveThruPoints);\r\n } else {\r\n this.routeLatLngs = [];\r\n }\r\n }\r\n\r\n @action.bound handleEditingStarted() {\r\n this.driveThruPointsEditing = this.driveThruPoints;\r\n }\r\n\r\n @action.bound handleResultsError() {\r\n console.error(\"Route lookup failed.\"); // eslint-disable-line no-console\r\n }\r\n\r\n @action.bound\r\n handleGeometryChange(obj: any) {\r\n if (obj) {\r\n const gjsCoords = obj.coordinates;\r\n this.driveThruPointsEditing = gjsCoords;\r\n this.calculateRoute(gjsCoords);\r\n }\r\n }\r\n\r\n @action.bound calculateRoute(gjsCoords: any) {\r\n if (gjsCoords.length > 1) {\r\n const smapCoords = gjsCoords.map((ll: any) =>\r\n (window as any).SMap.Coords.fromWGS84(ll[0], ll[1])\r\n );\r\n new (window as any).SMap.Route(smapCoords, (route: any) => {\r\n const results = route.getResults();\r\n if (results.error) {\r\n this.handleResultsError();\r\n } else {\r\n this.handleResultsReceived(results);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { IMapObject } from \"./MapObjectsStore\";\r\nimport { MapRootStore } from \"./MapRootStore\";\r\n\r\nexport class SearchStore {\r\n constructor(private root: MapRootStore) {\r\n }\r\n\r\n get navigationStore() {\r\n return this.root.mapNavigationStore;\r\n }\r\n\r\n get allMapObjects() {\r\n return this.root.mapObjectsStore.mapObjects;\r\n }\r\n\r\n @computed get searchResults(): IMapObject[] {\r\n if (!this.searchPhrase) return this.allMapObjects;\r\n return this.allMapObjects.filter((obj) =>\r\n obj.name.toLocaleLowerCase().includes(this.searchPhrase.toLocaleLowerCase())\r\n );\r\n }\r\n\r\n @observable selectedSearchResult?: IMapObject;\r\n\r\n @observable isDropped = false;\r\n\r\n refSearchField = (elm: any) => (this.elmSearchField = elm);\r\n elmSearchField: any = null;\r\n\r\n refDropdown = (elm: any) => (this.elmDropdown = elm);\r\n elmDropdown: any = null;\r\n\r\n @observable searchPhrase = \"\";\r\n\r\n @observable rect: any = {top: 0, left: 0, right: 0, bottom: 0, height: 0, width: 0};\r\n\r\n @action.bound\r\n measureSearchField() {\r\n if (this.elmSearchField) {\r\n this.rect = this.elmSearchField.getBoundingClientRect();\r\n }\r\n }\r\n\r\n @action.bound\r\n dropDown() {\r\n this.measureSearchField();\r\n this.isDropped = true;\r\n window.addEventListener(\"mousedown\", this.handleWindowMouseDown);\r\n }\r\n\r\n @action.bound\r\n dropUp() {\r\n this.isDropped = false;\r\n window.removeEventListener(\"mousedown\", this.handleWindowMouseDown);\r\n }\r\n\r\n @action.bound\r\n handleSearchInputChange(event: any) {\r\n this.searchPhrase = event.target.value;\r\n if (!this.isDropped) {\r\n this.dropDown();\r\n }\r\n }\r\n\r\n @action.bound handleSearchInputFocus(event: any) {\r\n event.target.select?.();\r\n }\r\n\r\n @action.bound handleSearchInputBlur(event: any) {\r\n if (!this.searchPhrase) {\r\n this.selectedSearchResult = undefined;\r\n this.navigationStore.fitToSelectedSearchResult();\r\n this.navigationStore.highlightSelectedSearchResult();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleSearchInputKeyDown(event: any) {\r\n switch (event.key) {\r\n case \"Escape\":\r\n if (this.isDropped) {\r\n this.dropUp();\r\n }\r\n break;\r\n case \"Enter\":\r\n if (!this.searchPhrase) {\r\n this.selectedSearchResult = undefined;\r\n this.navigationStore.fitToSelectedSearchResult();\r\n this.navigationStore.highlightSelectedSearchResult();\r\n }\r\n break;\r\n }\r\n }\r\n\r\n get searchInputValue() {\r\n return this.searchPhrase;\r\n }\r\n\r\n @action.bound\r\n handleCaretMouseDown(event: any) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n if (this.isDropped) {\r\n this.dropUp();\r\n } else {\r\n this.searchPhrase = \"\";\r\n this.dropDown();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleClearClick(event: any) {\r\n this.searchPhrase = \"\";\r\n this.selectedSearchResult = undefined;\r\n this.navigationStore.fitToSelectedSearchResult();\r\n this.navigationStore.highlightSelectedSearchResult();\r\n }\r\n\r\n @action.bound\r\n handleClearMouseDown(event: any) {\r\n }\r\n\r\n @action.bound\r\n selectSearchResultById(resultId: string) {\r\n this.selectedSearchResult = this.allMapObjects.find((item) => item.id === resultId);\r\n this.searchPhrase = this.selectedSearchResult?.name || \"\";\r\n }\r\n\r\n @action.bound\r\n handleSearchResultClick(event: any, resultId: string) {\r\n this.selectSearchResultById(resultId);\r\n this.navigationStore.fitToSelectedSearchResult();\r\n this.navigationStore.highlightSelectedSearchResult();\r\n this.dropUp();\r\n }\r\n\r\n @action.bound\r\n handleWindowMouseDown(event: any) {\r\n if (!this.elmDropdown?.contains(event.target) && !this.elmSearchField?.contains(event.target)) {\r\n this.dropUp();\r\n }\r\n }\r\n\r\n get dropdownTop() {\r\n return this.rect.bottom;\r\n }\r\n\r\n get dropdownLeft() {\r\n return this.rect.left;\r\n }\r\n\r\n get dropdownWidth() {\r\n return this.rect.width;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { computed } from \"mobx\";\r\nimport { parse as wktParse } from \"wkt\";\r\nimport { MapRootStore } from \"./MapRootStore\";\r\n\r\nexport class MapLayer {\r\n id: string = \"\";\r\n title: string = \"\";\r\n defaultEnabled: boolean = false;\r\n type: string = \"\";\r\n mapLayerParameters = new Map();\r\n\r\n getUrl() {\r\n return this.mapLayerParameters.get(\"url\");\r\n }\r\n\r\n getTitle() {\r\n return this.title;\r\n }\r\n\r\n getOptions() {\r\n const rawOptions = Object.fromEntries(this.mapLayerParameters);\r\n delete rawOptions.url;\r\n delete rawOptions.title;\r\n return {\r\n ...rawOptions,\r\n id: this.id,\r\n minZoom: rawOptions.minZoom !== undefined ? parseInt(rawOptions.minZoom) : undefined,\r\n maxZoom: rawOptions.maxZoom !== undefined ? parseInt(rawOptions.maxZoom) : undefined,\r\n };\r\n }\r\n}\r\n\r\nexport class MapSetupStore {\r\n constructor(private rootStore: MapRootStore) {\r\n }\r\n\r\n mapLocationMember: string = \"\";\r\n mapAzimuthMember: string = \"\";\r\n mapColorMember: string = \"\";\r\n mapIconMember: string = \"\";\r\n mapTextMember: string = \"\";\r\n mapResolutionRaw: string = \"\";\r\n textColorMember: string = \"\";\r\n textLocationMember: string = \"\";\r\n textRotationMember: string = \"\";\r\n mapCenterRaw: string = \"\";\r\n isReadOnlyView: boolean = false;\r\n\r\n layers: MapLayer[] = [];\r\n\r\n get mapZoom() {\r\n let zoom = this.mapResolutionRaw ? parseInt(this.mapResolutionRaw) : 0;\r\n if (zoom < 0 || zoom > 15) {\r\n throw new Error(\"Map zoom must be between 0 and 15. The value is: \" + zoom);\r\n }\r\n return zoom;\r\n }\r\n\r\n @computed\r\n get mapCenter() {\r\n try {\r\n return this.mapCenterRaw ? wktParse(this.mapCenterRaw) : undefined;\r\n } catch (e) {\r\n console.error(e); // eslint-disable-line no-console\r\n return undefined;\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { createContext } from \"react\";\r\nimport { MapNavigationStore } from \"./MapNavigationStore\";\r\nimport { MapObjectsStore } from \"./MapObjectsStore\";\r\nimport { MapRoutefinderStore } from \"./MapRoutefinderStore\";\r\nimport { SearchStore } from \"./MapSearchStore\";\r\nimport { MapSetupStore } from \"./MapSetupStore\";\r\n\r\nexport class MapRootStore {\r\n constructor(public dataView: IDataView) {\r\n }\r\n\r\n mapSearchStore = new SearchStore(this);\r\n mapObjectsStore = new MapObjectsStore(this);\r\n mapSetupStore = new MapSetupStore(this);\r\n mapNavigationStore = new MapNavigationStore(this);\r\n mapRoutefinderStore = new MapRoutefinderStore(this);\r\n}\r\n\r\nexport const CtxMapRootStore = createContext(null!);\r\n\r\n\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Observer } from \"mobx-react\";\r\nimport React, { useContext } from \"react\";\r\nimport { createPortal } from \"react-dom\";\r\nimport { Grid } from \"react-virtualized\";\r\nimport Highlighter from \"react-highlight-words\";\r\nimport cx from \"classnames\";\r\nimport S from \"./MapPerspectiveUI.module.scss\";\r\nimport { CtxMapRootStore } from \"./stores/MapRootStore\";\r\n\r\nexport function MapPerspectiveSearch() {\r\n const {mapSearchStore, mapSetupStore} = useContext(CtxMapRootStore);\r\n return (\r\n \r\n {() => (\r\n <>\r\n {mapSetupStore.isReadOnlyView ? (\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n {mapSearchStore.isDropped &&\r\n createPortal(\r\n ,\r\n document.getElementById(\"dropdown-portal\")!\r\n )}\r\n
\r\n ) : null}\r\n \r\n )}\r\n
\r\n );\r\n}\r\n\r\nexport function MapPerspectiveSearchDropdown(props: {\r\n top: number;\r\n left: number;\r\n width: number;\r\n domRef: any;\r\n}) {\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nconst ROW_HEIGHT = 25;\r\n\r\nexport function SearchResults(props: { width: number }) {\r\n const {mapSearchStore} = useContext(CtxMapRootStore);\r\n const rowCount = mapSearchStore.searchResults.length;\r\n return (\r\n \r\n {() => (\r\n {\r\n const searchResult = mapSearchStore.searchResults[rowIndex];\r\n return (\r\n \r\n {() => (\r\n mapSearchStore.handleSearchResultClick(e, searchResult.id)}\r\n >\r\n \r\n \r\n )}\r\n \r\n );\r\n }}\r\n />\r\n )}\r\n \r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { PropsWithChildren, useContext, useEffect } from \"react\";\r\nimport cx from \"classnames\";\r\nimport { action, flow } from \"mobx\";\r\nimport { IDataViewBodyUI, IDataViewToolbarUI } from \"modules/DataView/DataViewUI\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { SectionViewSwitchers } from \"modules/DataView/DataViewTypes\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { DataViewHeaderAction } from \"gui/Components/DataViewHeader/DataViewHeaderAction\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { IMapPerspective, MapPerspective } from \"./MapPerspective\";\r\nimport { Observer } from \"mobx-react\";\r\nimport { IPerspective } from \"../Perspective\";\r\nimport { MapPerspectiveCom } from \"./MapPerspectiveUI\";\r\nimport { CtxDataViewHeaderExtension, IDataViewHeaderExtensionItem, } from \"gui/Components/ScreenElements/DataView\";\r\nimport { MapPerspectiveSearch } from \"./MapPerspectiveSearch\";\r\nimport { CtxMapRootStore, MapRootStore } from \"./stores/MapRootStore\";\r\nimport S from \"./MapPerspectiveUI.module.scss\";\r\n\r\nexport class MapPerspectiveDirector implements IIId {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public dataViewToolbarUI = IDataViewToolbarUI(),\r\n public dataViewBodyUI = IDataViewBodyUI(),\r\n public mapPerspective = IMapPerspective(),\r\n public perspective = IPerspective()\r\n ) {\r\n }\r\n\r\n rootStore: MapRootStore = null!;\r\n\r\n toolbarActionsExtension = new ToolbarActionsExtension(this.mapPerspective, () => this.rootStore);\r\n\r\n @action.bound\r\n setup() {\r\n this.dataViewBodyUI.contrib.put({\r\n $iid: this.$iid,\r\n render: () => (\r\n \r\n \r\n \r\n ),\r\n });\r\n\r\n this.dataViewToolbarUI.contrib.put({\r\n $iid: this.$iid,\r\n section: SectionViewSwitchers,\r\n render: () => (\r\n \r\n {() => (\r\n \r\n \r\n \r\n )}\r\n \r\n ),\r\n });\r\n\r\n this.perspective.contrib.put(this.mapPerspective);\r\n }\r\n\r\n @action.bound\r\n teardown() {\r\n this.dataViewBodyUI.contrib.del(this);\r\n this.dataViewToolbarUI.contrib.del(this);\r\n this.perspective.contrib.del(this.mapPerspective);\r\n }\r\n\r\n dispose() {\r\n this.teardown();\r\n }\r\n}\r\n\r\nexport const IMapPerspectiveDirector = TypeSymbol(\r\n \"IMapPerspectiveDirector\"\r\n);\r\n\r\nexport function MapPerspectiveComContainer(\r\n props: PropsWithChildren<{ toolbarActionsExtension: ToolbarActionsExtension }>\r\n) {\r\n const toolbarExtension = useContext(CtxDataViewHeaderExtension);\r\n useEffect(() => {\r\n toolbarExtension.put(props.toolbarActionsExtension);\r\n return () => toolbarExtension.del(props.toolbarActionsExtension);\r\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\r\n return <>{props.children};\r\n}\r\n\r\nclass ToolbarActionsExtension implements IDataViewHeaderExtensionItem {\r\n constructor(public mapPerspective: MapPerspective, public getRootStore: () => MapRootStore) {\r\n }\r\n\r\n get rootStore() {\r\n return this.getRootStore();\r\n }\r\n\r\n $iid = getIdent();\r\n group = \"actions\";\r\n\r\n render(): React.ReactNode {\r\n return this.mapPerspective.isActive ? (\r\n \r\n \r\n \r\n {/**/}\r\n \r\n ) : null;\r\n }\r\n}\r\n\r\nfunction MapContentUI(props: {\r\n toolbarActionsExtension: ToolbarActionsExtension;\r\n mapPerspective: MapPerspective;\r\n}) {\r\n const {\r\n mapSetupStore,\r\n mapObjectsStore,\r\n mapSearchStore,\r\n mapNavigationStore,\r\n mapRoutefinderStore,\r\n } = useContext(CtxMapRootStore);\r\n return (\r\n \r\n {() => (\r\n \r\n (mapRoutefinderStore.isActive ? [] : mapObjectsStore.mapObjects)}\r\n getRoutefinderRoute={() => mapRoutefinderStore.mapObjectsRoute}\r\n getRoutefinderEditables={() => mapRoutefinderStore.mapObjectsEditable}\r\n mapLayers={mapSetupStore.layers}\r\n isReadOnly={mapSetupStore.isReadOnlyView}\r\n isActive={props.mapPerspective.isActive}\r\n onChange={(geoJson) => {\r\n mapObjectsStore.handleGeometryChange(geoJson);\r\n }}\r\n onRoutefinderGeometryChange={mapRoutefinderStore.handleGeometryChange}\r\n onRoutefinderGeometryEditStart={mapRoutefinderStore.handleEditingStarted}\r\n onRoutefinderGeometryEditSave={mapRoutefinderStore.handleEditingFinished}\r\n onRoutefinderGeometryEditCancel={mapRoutefinderStore.handleEditingCancelled}\r\n onLayerClick={mapObjectsStore.handleLayerClick}\r\n />\r\n \r\n )}\r\n \r\n );\r\n}\r\n\r\nfunction MapPerspectiveNavigation() {\r\n const {mapObjectsStore, mapNavigationStore} = useContext(CtxMapRootStore);\r\n useEffect(() => mapObjectsStore.handleMapMounted(), []); // eslint-disable-line react-hooks/exhaustive-deps\r\n return (\r\n \r\n {() => (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport { IMapPerspectiveDirector, MapPerspectiveDirector } from \"./MapPerspectiveDirector\";\r\nimport { IMapPerspective, MapPerspective } from \"./MapPerspective\";\r\n\r\nexport const SCOPE_MapPerspective = \"MapPerspective\";\r\n\r\nexport function register($cont: Container) {\r\n $cont\r\n .registerClass(IMapPerspectiveDirector, MapPerspectiveDirector)\r\n .scopedInstance(SCOPE_MapPerspective);\r\n\r\n $cont.registerClass(IMapPerspective, MapPerspective).scopedInstance(SCOPE_MapPerspective);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { flow, observable } from \"mobx\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { IPerspective, IPerspectiveContrib } from \"../Perspective\";\r\nimport bind from \"bind-decorator\";\r\nimport { IViewConfiguration } from \"modules/DataView/ViewConfiguration\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\n\r\nexport class FormPerspective implements IIId, IPerspectiveContrib {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public perspective = IPerspective(),\r\n public viewConfiguration = IViewConfiguration()\r\n ) {\r\n }\r\n\r\n @observable isActive = false;\r\n\r\n @bind\r\n handleClick(args: { saveNewState: boolean }) {\r\n const self = this;\r\n return flow(function*() {\r\n if (self.isActive) return;\r\n yield*self.perspective.deactivate();\r\n self.isActive = true;\r\n if (args.saveNewState) {\r\n yield*self.viewConfiguration.anounceActivePerspective(IPanelViewType.Form);\r\n }\r\n })();\r\n }\r\n\r\n @bind\r\n *deactivate() {\r\n this.isActive = false;\r\n }\r\n\r\n @bind\r\n *activateDefault() {\r\n if (this.viewConfiguration.activePerspective === IPanelViewType.Form) this.isActive = true;\r\n }\r\n}\r\n\r\nexport const IFormPerspective = TypeSymbol(\"IFormPerspective\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"./FormView.module.scss\";\r\nimport { inject, observer, Provider } from \"mobx-react\";\r\nimport { IFormPanelView } from \"model/entities/FormPanelView/types/IFormPanelView\";\r\nimport cx from \"classnames\";\r\n\r\n@inject(({dataView}) => {\r\n return {\r\n formPanelView: dataView.formPanelView,\r\n };\r\n})\r\n@observer\r\nexport class FormView extends React.Component<{\r\n formPanelView?: IFormPanelView;\r\n}> {\r\n render() {\r\n return (\r\n \r\n
\r\n
event.preventDefault()}>\r\n {this.props.children}\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"./FormRoot.module.scss\";\r\nimport React from \"react\";\r\nimport { observer } from \"mobx-react\";\r\nimport { action } from \"mobx\";\r\n\r\n@observer\r\nexport class FormRoot extends React.Component<{ style?: any }> {\r\n componentDidMount() {\r\n window.addEventListener(\"click\", this.handleWindowClick);\r\n }\r\n\r\n componentWillUnmount() {\r\n window.removeEventListener(\"click\", this.handleWindowClick);\r\n }\r\n\r\n @action.bound handleWindowClick(event: any) {\r\n if (this.elmFormRoot && !this.elmFormRoot.contains(event.target)) {\r\n }\r\n }\r\n\r\n elmFormRoot: HTMLDivElement | null = null;\r\n refFormRoot = (elm: HTMLDivElement | null) => (this.elmFormRoot = elm);\r\n\r\n render() {\r\n return (\r\n
\r\n {this.props.children}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"gui/Components/ScreenElements/Table/Table.module.scss\";\r\nimport * as React from \"react\";\r\n\r\nexport function formatTooltipText(content: string | string[] | undefined) {\r\n if (!content) {\r\n return \"\";\r\n }\r\n const lines = Array.isArray(content)\r\n ? content.flatMap((line) => splitToLines(line))\r\n : splitToLines(content);\r\n return formatToolTipLines(lines);\r\n}\r\n\r\nfunction splitToLines(value: string) {\r\n if (!value) {\r\n return [];\r\n }\r\n if (typeof value.split !== 'function') {\r\n return [value.toString()];\r\n }\r\n return value.split(/\\\\r\\\\n|\\\\n||/);\r\n}\r\n\r\nfunction formatToolTipLines(content: string[]) {\r\n const equalLengthLines = content;\r\n const linesToShow =\r\n equalLengthLines.length > 10 ? equalLengthLines.slice(0, 9).concat([\"...\"]) : equalLengthLines;\r\n return (\r\n
\r\n {linesToShow.map((line) => (\r\n
{line}
\r\n ))}\r\n
\r\n );\r\n}\r\n\r\nexport function formatTooltipPlaintext(content: string | string[] | undefined) {\r\n if (!content) return;\r\n const lines = Array.isArray(content)\r\n ? content.flatMap((line) => splitToLines(line))\r\n : splitToLines(content);\r\n return formatToolTipLinesPlaintext(lines);\r\n}\r\n\r\nfunction formatToolTipLinesPlaintext(content: string[]) {\r\n const equalLengthLines = content;\r\n const linesToShow =\r\n equalLengthLines.length > 10 ? equalLengthLines.slice(0, 9).concat([\"...\"]) : equalLengthLines;\r\n return linesToShow.join(\"\\n\");\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { inject, observer } from \"mobx-react\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { IApi } from \"model/entities/types/IApi\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { action, flow, observable } from \"mobx\";\r\nimport S from \"./BlobEditor.module.scss\";\r\nimport { IProcessCRUDResult } from \"model/actions/Actions/processActionResult\";\r\nimport { processCRUDResult } from \"model/actions/DataLoading/processCRUDResult\";\r\nimport { getDialogStack } from \"model/selectors/DialogStack/getDialogStack\";\r\nimport { IDialogStack } from \"model/entities/types/IDialogStack\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { changeManyFields } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { flushCurrentRowData } from \"model/actions/DataView/TableView/flushCurrentRowData\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { IFocusable } from \"model/entities/FormFocusManager\";\r\nimport cx from \"classnames\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { T } from \"utils/translation\";\r\nimport CS from \"@origam/components/src/components/Dropdown/Dropdown.module.scss\"\r\nimport { runGeneratorInFlowWithHandler, runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\n@inject(({property}: { property: IProperty }, {value}) => {\r\n return {\r\n api: getApi(property),\r\n processCRUDResult: (result: any) => processCRUDResult(property, result),\r\n changeManyFields: changeManyFields(property),\r\n flushCurrentRowData: flushCurrentRowData(property),\r\n handleError: handleError(property),\r\n dialogStack: getDialogStack(property),\r\n DataStructureEntityId: getDataStructureEntityId(property),\r\n Property: property.id,\r\n RowId: getSelectedRowId(property),\r\n menuItemId: getMenuItemId(property),\r\n Entity: getEntity(property),\r\n SessionFormIdentifier: getSessionId(property),\r\n parameters: property.parameters,\r\n };\r\n})\r\n@observer\r\nexport class BlobEditor extends React.Component<{\r\n value: string;\r\n api?: IApi;\r\n isReadOnly: boolean;\r\n processCRUDResult?: IProcessCRUDResult;\r\n changeManyFields?: (values: Array<{ fieldId: string; value: any }>) => Generator;\r\n flushCurrentRowData?: () => Generator;\r\n handleError?: (error: any) => Generator;\r\n dialogStack?: IDialogStack;\r\n DataStructureEntityId?: string;\r\n Property?: string;\r\n RowId?: string;\r\n menuItemId?: string;\r\n Entity?: string;\r\n SessionFormIdentifier?: string;\r\n parameters?: any;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n isInvalid: boolean;\r\n canUpload: boolean;\r\n invalidMessage?: string;\r\n onKeyDown?(event: any): void;\r\n onChange?(event: any, value: string): void;\r\n onEditorBlur?(event: any): void;\r\n}> {\r\n elmInput: HTMLInputElement | null = null;\r\n refInput = (elm: HTMLInputElement | any) => {\r\n this.elmInput = elm;\r\n };\r\n\r\n @observable\r\n focused = false;\r\n\r\n componentDidMount() {\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n }\r\n\r\n handleFileChange(event: any) {\r\n this.fileList = event.target.files;\r\n flow(this.upload.bind(this))();\r\n }\r\n\r\n @observable.ref fileList: any = [];\r\n @observable progressValue = 0;\r\n @observable speedValue = 0;\r\n @observable isUploading = false;\r\n\r\n async download(args: { isPreview: boolean }) {\r\n const token = await this.props.api!.getDownloadToken({\r\n SessionFormIdentifier: this.props.SessionFormIdentifier!,\r\n MenuId: this.props.menuItemId!,\r\n DataStructureEntityId: this.props.DataStructureEntityId!,\r\n Entity: this.props.Entity!,\r\n RowId: this.props.RowId!,\r\n Property: this.props.Property!,\r\n FileName: this.props.value,\r\n parameters: this.props.parameters,\r\n isPreview: args.isPreview,\r\n });\r\n await this.props.api!.getBlob({downloadToken: token});\r\n }\r\n\r\n *upload(): any {\r\n this.progressValue = 0;\r\n this.speedValue = 0;\r\n this.isUploading = true;\r\n try {\r\n if (this.fileList && this.fileList.length > 0) {\r\n for (let file of this.fileList) {\r\n const token = yield this.props.api!.getUploadToken({\r\n SessionFormIdentifier: this.props.SessionFormIdentifier!,\r\n MenuId: this.props.menuItemId!,\r\n DataStructureEntityId: this.props.DataStructureEntityId!,\r\n Entity: this.props.Entity!,\r\n RowId: this.props.RowId!,\r\n Property: this.props.Property!,\r\n FileName: this.props.value,\r\n parameters: this.props.parameters,\r\n DateCreated: \"2010-01-01\",\r\n DateLastModified: \"2010-01-01\",\r\n });\r\n\r\n let lastTime: number | undefined;\r\n let lastSize: number = 0;\r\n yield this.props.api!.putBlob(\r\n {\r\n uploadToken: token,\r\n fileName: file.name,\r\n file,\r\n },\r\n action((event: any) => {\r\n this.progressValue = event.loaded / event.total;\r\n if (lastTime !== undefined) {\r\n this.speedValue = ((event.loaded - lastSize) / (event.timeStamp - lastTime)) * 1000;\r\n }\r\n lastTime = event.timeStamp;\r\n lastSize = event.loaded;\r\n })\r\n );\r\n const crudResult = yield this.props.api!.changes({\r\n SessionFormIdentifier: this.props.SessionFormIdentifier!,\r\n Entity: this.props.Entity!,\r\n RowId: this.props.RowId!,\r\n });\r\n yield*this.props.processCRUDResult!(crudResult);\r\n }\r\n }\r\n } catch (e) {\r\n yield*this.props.handleError!(e);\r\n } finally {\r\n this.isUploading = false;\r\n if (this.elmInput) this.elmInput.value = \"\";\r\n }\r\n }\r\n\r\n *delete(): any {\r\n if (\r\n yield new Promise(\r\n action((resolve: (value: boolean) => void) => {\r\n const closeDialog = this.props.dialogStack!.pushDialog(\r\n \"\",\r\n \r\n {\r\n closeDialog();\r\n resolve(true);\r\n }}\r\n >\r\n {T(\"Yes\", \"button_yes\")}\r\n \r\n {\r\n closeDialog();\r\n resolve(false);\r\n }}\r\n >\r\n {T(\"No\", \"button_no\")}\r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n {T(\"Do you wish to delete {0}?\", \"blob_delete_confirmation\", this.props.value)}\r\n
\r\n \r\n );\r\n })\r\n )\r\n ) {\r\n const {parameters} = this.props;\r\n const changeSet: Array<{ fieldId: string; value: any }> = [];\r\n changeSet.push({fieldId: this.props.Property!, value: null});\r\n if (parameters[\"AuthorMember\"]) {\r\n changeSet.push({fieldId: parameters[\"AuthorMember\"], value: null});\r\n }\r\n if (parameters[\"BlobMember\"]) {\r\n changeSet.push({fieldId: parameters[\"BlobMember\"], value: null});\r\n }\r\n if (parameters[\"CompressionStateMember\"]) {\r\n changeSet.push({fieldId: parameters[\"CompressionStateMember\"], value: null});\r\n }\r\n if (parameters[\"DateCreatedMember\"]) {\r\n changeSet.push({fieldId: parameters[\"DateCreatedMember\"], value: null});\r\n }\r\n if (parameters[\"DateLastModifiedMember\"]) {\r\n changeSet.push({fieldId: parameters[\"DateLastModifiedMember\"], value: null});\r\n }\r\n if (parameters[\"FileSizeMember\"]) {\r\n changeSet.push({fieldId: parameters[\"FileSizeMember\"], value: null});\r\n }\r\n if (parameters[\"OriginalPathMember\"]) {\r\n changeSet.push({fieldId: parameters[\"OriginalPathMember\"], value: null});\r\n }\r\n if (parameters[\"RemarkMember\"]) {\r\n changeSet.push({fieldId: parameters[\"RemarkMember\"], value: null});\r\n }\r\n if (parameters[\"ThumbnailMember\"]) {\r\n changeSet.push({fieldId: parameters[\"ThumbnailMember\"], value: null});\r\n }\r\n yield * this.props.changeManyFields!(changeSet);\r\n yield * this.props.flushCurrentRowData!();\r\n }\r\n }\r\n\r\n @observable displayImageEditor = false;\r\n imageObjectUrl: any;\r\n\r\n render() {\r\n return (\r\n
\r\n {this.renderInput()}\r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n\r\n private onFocus() {\r\n this.focused = true;\r\n }\r\n\r\n private onBlur() {\r\n this.focused = false;\r\n }\r\n\r\n private renderInput() {\r\n if (this.props.isReadOnly && !this.props.value) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n if (!this.props.value) {\r\n return (\r\n
\r\n \r\n {this.isUploading && (\r\n
\r\n
\r\n
\r\n {(this.progressValue * 100).toFixed(0)}%\r\n
\r\n
\r\n
\r\n )}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n \r\n !this.props.isReadOnly && this.props.onChange && this.props.onChange(event, event.target.value)\r\n }\r\n onBlur={event => !this.props.isReadOnly && this.props.onEditorBlur && this.props.onEditorBlur(event)}\r\n />\r\n
\r\n (\r\n
\r\n setDropped(true)}\r\n >\r\n {!isDropped ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n
\r\n )}\r\n content={({setDropped}) => (\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.props.Property!,\r\n action: async () => await this.download({isPreview: false}),\r\n });\r\n }}\r\n >\r\n {T(\"Download\", \"blob_download\")}\r\n \r\n {\r\n setDropped(false);\r\n runGeneratorInFlowWithHandler({\r\n ctx: this.props.Property!,\r\n generator: this.delete.bind(this)(),\r\n });\r\n }}\r\n >\r\n {T(\"Delete\", \"blob_delete\")}\r\n \r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.props.Property!,\r\n action: async () => await this.download({isPreview: true}),\r\n });\r\n }}\r\n >\r\n {T(\"Preview\", \"blob_preview\")}\r\n \r\n \r\n )}\r\n />\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { RefObject, useContext, useEffect, useRef, useState } from \"react\";\r\nimport S from \"./CheckList.module.scss\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { action, computed, flow, observable } from \"mobx\";\r\nimport { IApi } from \"model/entities/types/IApi\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { IFocusable } from \"../../../../model/entities/FormFocusManager\";\r\nimport CS from \"gui/Components/ScreenElements/Editors/CommonStyle.module.css\";\r\nimport cx from \"classnames\";\r\n\r\nexport interface IRawCheckListProps {\r\n api: IApi;\r\n value: string[];\r\n onClick: () => void;\r\n Entity: string;\r\n SessionFormIdentifier: string;\r\n DataStructureEntityId: string;\r\n Identifier: string;\r\n ColumnNames: string[];\r\n Property: string;\r\n RowId: string | undefined;\r\n LookupId: string;\r\n Parameters: any;\r\n menuItemId: string;\r\n isInvalid: boolean;\r\n isReadonly?: boolean;\r\n invalidMessage?: string;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n\r\n onChange?(newValue: string[]): void;\r\n\r\n onKeyDown(event: any): void;\r\n}\r\n\r\nexport class CheckListControler {\r\n @observable lookupList: string[][] = [];\r\n\r\n @computed get items() {\r\n return this.lookupList.map((llitem) => ({\r\n value: llitem[0],\r\n label: llitem[1],\r\n }));\r\n }\r\n\r\n @action.bound\r\n loadLookupList() {\r\n const self = this;\r\n flow(function*() {\r\n const lookupList = yield self.props.api.getLookupList({\r\n Entity: self.props.Entity,\r\n SessionFormIdentifier: self.props.SessionFormIdentifier,\r\n DataStructureEntityId: self.props.DataStructureEntityId, // Data view entity identifier\r\n ColumnNames: [self.props.Identifier || \"Id\", ...self.props.ColumnNames], // Columns to download\r\n Property: self.props.Property!, // Columnn Id\r\n Id: self.props.RowId!, // Id of the selected row\r\n LookupId: self.props.LookupId!, // Id of the lookup object\r\n Parameters: self.props.Parameters!,\r\n MenuId: self.props.menuItemId!,\r\n ShowUniqueValues: false,\r\n SearchText: \"\",\r\n PageSize: 10000,\r\n PageNumber: 1,\r\n });\r\n self.lookupList = lookupList;\r\n })();\r\n }\r\n\r\n @action.bound handleClick(event: any, item: { value: string; label: string }) {\r\n event.preventDefault();\r\n const currentIndex = this.props.value.findIndex((id) => item.value === id);\r\n if (currentIndex > -1) {\r\n const newValue = [...this.props.value];\r\n newValue.splice(currentIndex, 1);\r\n this.props.onChange && this.props.onChange(newValue);\r\n return;\r\n } else {\r\n const newValue = [...this.props.value, item.value];\r\n this.props.onChange && this.props.onChange(newValue);\r\n }\r\n }\r\n\r\n @observable.ref props: IRawCheckListProps = undefined as any;\r\n}\r\n\r\nexport const CheckList: React.FC<{\r\n value: string[];\r\n onChange?(newValue: string[]): void;\r\n isInvalid: boolean;\r\n isReadonly?: boolean;\r\n invalidMessage?: string;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onKeyDown(event: any): void;\r\n onClick: () => void;\r\n}> = observer((props) => {\r\n const {property} = useContext(MobXProviderContext);\r\n\r\n return (\r\n column.id)}\r\n Property={property.id}\r\n Parameters={property!.lookup.parameters}\r\n RowId={getSelectedRowId(property)}\r\n Identifier={property.identifier}\r\n LookupId={property!.lookup.lookupId}\r\n menuItemId={getMenuItemId(property)}\r\n Entity={getEntity(property)}\r\n SessionFormIdentifier={getSessionId(property)}\r\n isInvalid={props.isInvalid}\r\n isReadonly={props.isReadonly}\r\n invalidMessage={props.invalidMessage}\r\n subscribeToFocusManager={props.subscribeToFocusManager}\r\n onKeyDown={props.onKeyDown}\r\n onClick={props.onClick}\r\n />\r\n );\r\n});\r\n\r\nexport const CheckListRaw: React.FC = observer((props) => {\r\n const [controller] = useState(() => new CheckListControler());\r\n controller.props = props;\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n useEffect(controller.loadLookupList, [props.RowId]);\r\n\r\n const inputRefs: InputReference[] = [];\r\n\r\n function focusLeft(x: number, y: number) {\r\n const inputsOnTheLeft = inputRefs\r\n .filter((input) => input.hasYEqualTo(y) && input.isOnTheLeftOf(x))\r\n .sort((i1, i2) => i2.x - i1.x);\r\n\r\n if (inputsOnTheLeft.length > 0) {\r\n inputsOnTheLeft[0].focus();\r\n }\r\n }\r\n\r\n function focusRight(x: number, y: number) {\r\n const inputsOnTheRight = inputRefs\r\n .filter((input) => input.hasYEqualTo(y) && input.isOnTheRightOf(x))\r\n .sort((i1, i2) => i1.x - i2.x);\r\n\r\n if (inputsOnTheRight.length > 0) {\r\n inputsOnTheRight[0].focus();\r\n }\r\n }\r\n\r\n function focusUp(x: number, y: number) {\r\n const inputsAbove = inputRefs\r\n .filter((input) => input.hasXEqualTo(x) && input.isAbove(y))\r\n .sort((i1, i2) => i2.y - i1.y);\r\n\r\n if (inputsAbove.length > 0) {\r\n inputsAbove[0].focus();\r\n }\r\n }\r\n\r\n function focusDown(x: number, y: number) {\r\n const inputsBelow = inputRefs\r\n .filter((input) => input.hasXEqualTo(x) && input.isBelow(y))\r\n .sort((i1, i2) => i1.y - i2.y);\r\n\r\n if (inputsBelow.length > 0) {\r\n inputsBelow[0].focus();\r\n }\r\n }\r\n\r\n return (\r\n
\r\n
\r\n {controller.items.map((item, i) => (\r\n v === item.value)}\r\n onClick={(event) => {\r\n props.onClick();\r\n if (!props.isReadonly) {\r\n controller.handleClick(event, item);\r\n }\r\n }}\r\n // tabIndex={i === 0 ? props.tabIndex : -1}\r\n subscribeToFocusManager={i === 0 ? props.subscribeToFocusManager : undefined}\r\n inputSetter={(inputRef: InputReference) => inputRefs.push(inputRef)}\r\n focusLeft={focusLeft}\r\n focusRight={focusRight}\r\n focusUp={focusUp}\r\n focusDown={focusDown}\r\n onKeyDown={!props.isReadonly ? props.onKeyDown : undefined}\r\n label={item.label}\r\n />\r\n ))}\r\n
\r\n {props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n});\r\n\r\nexport const CheckListItem: React.FC<{\r\n checked: boolean;\r\n onClick?(event: any): void;\r\n tabIndex?: number;\r\n inputSetter: (inputRef: InputReference) => void;\r\n focusLeft: (x: number, y: number) => void;\r\n focusRight: (x: number, y: number) => void;\r\n focusUp: (x: number, y: number) => void;\r\n focusDown: (x: number, y: number) => void;\r\n label: string;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onKeyDown?(event: any): void;\r\n}> = (props) => {\r\n const [isFocused, setIsFocused] = useState(false);\r\n\r\n const refInput = useRef(null);\r\n props.inputSetter(new InputReference(refInput));\r\n\r\n useEffect(() => {\r\n if (props.subscribeToFocusManager && refInput.current) {\r\n props.subscribeToFocusManager(refInput.current);\r\n }\r\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\r\n\r\n function onKeyDown(event: any) {\r\n const boundingRect = refInput.current?.getBoundingClientRect()!;\r\n switch (event.key) {\r\n case \"Tab\":\r\n props.onKeyDown?.(event);\r\n break;\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n props.focusUp(boundingRect.x, boundingRect.y);\r\n break;\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n props.focusDown(boundingRect.x, boundingRect.y);\r\n break;\r\n case \"ArrowRight\":\r\n event.preventDefault();\r\n props.focusRight(boundingRect.x, boundingRect.y);\r\n break;\r\n case \"ArrowLeft\":\r\n event.preventDefault();\r\n props.focusLeft(boundingRect.x, boundingRect.y);\r\n break;\r\n }\r\n }\r\n\r\n function onInputFocus() {\r\n setIsFocused(true);\r\n }\r\n\r\n function onInputBlur() {\r\n setIsFocused(false);\r\n }\r\n\r\n function onLabelClick(event: any) {\r\n props.onClick && props.onClick(event);\r\n refInput.current?.click();\r\n event.stopPropagation();\r\n }\r\n\r\n return (\r\n
\r\n props.onClick && props.onClick(event)}\r\n />\r\n {\r\n refInput?.current?.focus();\r\n }}\r\n className={\"content \" + (isFocused ? S.focusedLabel : S.unFocusedLabel)}>\r\n {props.label}\r\n
\r\n \r\n );\r\n};\r\n\r\nclass InputReference {\r\n constructor(private inputRef: RefObject) {\r\n }\r\n\r\n get x() {\r\n return this.inputRef.current?.getBoundingClientRect()!.x || 0;\r\n }\r\n\r\n get y() {\r\n return this.inputRef.current?.getBoundingClientRect()!.y || 0;\r\n }\r\n\r\n hasXEqualTo(x: number) {\r\n return Math.abs(this.x - x) < 1;\r\n }\r\n\r\n hasYEqualTo(y: number) {\r\n return Math.abs(this.y - y) < 1;\r\n }\r\n\r\n isOnTheLeftOf(x: number) {\r\n return this.x < x;\r\n }\r\n\r\n isOnTheRightOf(x: number) {\r\n return this.x > x;\r\n }\r\n\r\n isAbove(y: number) {\r\n return this.y < y;\r\n }\r\n\r\n isBelow(y: number) {\r\n return this.y > y;\r\n }\r\n\r\n focus() {\r\n this.inputRef.current?.focus();\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { inject, observer } from \"mobx-react\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport S from \"./ImageEditor.module.scss\";\r\nimport { processedImageURL } from \"utils/image\";\r\n\r\n@inject(({property}: { property: IProperty }, {value}) => {\r\n return {\r\n api: getApi(property),\r\n DataStructureEntityId: getDataStructureEntityId(property),\r\n Property: property.id,\r\n RowId: getSelectedRowId(property),\r\n Identifier: property.identifier,\r\n MenuId: getMenuItemId(property),\r\n Entity: getEntity(property),\r\n SessionFormIdentifier: getSessionId(property),\r\n };\r\n})\r\n@observer\r\nexport class ImageEditor extends React.Component<{\r\n value: string;\r\n}> {\r\n render() {\r\n const preparedUrl = processedImageURL(this.props.value).value;\r\n return preparedUrl ? \"\"/ : null;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport * as React from \"react\";\r\nimport S from \"./NumberEditor.module.scss\";\r\nimport cx from \"classnames\";\r\nimport {\r\n formatNumber,\r\n getCurrentDecimalSeparator,\r\n getCurrentGroupSeparator,\r\n} from \"../../../../model/entities/NumberFormating\";\r\nimport { IFocusable } from \"../../../../model/entities/FormFocusManager\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\nexport class NumberEditor extends React.Component<{\r\n value: string | number | null;\r\n isReadOnly: boolean;\r\n isPassword?: boolean;\r\n isInvalid: boolean;\r\n invalidMessage?: string;\r\n property?: IProperty;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customNumberFormat?: string | undefined;\r\n maxLength?: number;\r\n customStyle?: any;\r\n onChange?(event: any, value: string | null): Promise;\r\n onKeyDown?(event: any): void;\r\n onClick?(event: any): void;\r\n onDoubleClick?(event: any): void;\r\n onEditorBlur?(event: any): void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onTextOverflowChanged?: (toolTip: string | null | undefined) => void;\r\n}> {\r\n state = { value: this.formatForDisplay(this.props.value), cursorPosition: 0};\r\n disposer: undefined | (()=> void);\r\n inputRef = React.createRef();\r\n\r\n formatForDisplay(value: string | number | null){\r\n if(value === null || value === \"\"){\r\n return \"\"\r\n }\r\n let rawValue = value;\r\n if(typeof value === \"string\"){\r\n rawValue = value\r\n .replaceAll(getCurrentGroupSeparator(), \"\")\r\n .replaceAll(getCurrentDecimalSeparator(), \".\")\r\n if(value.trim() === \"\" || value.trim() === \"-\"){\r\n rawValue = \"0\";\r\n }\r\n }\r\n return formatNumber(\r\n this.props.customNumberFormat,\r\n this.props.property?.entity ?? \"\",\r\n Number(rawValue)\r\n );\r\n }\r\n\r\n formatForOnChange(value: string | number | null){\r\n if(value === null || value === \"\"){\r\n return null;\r\n }\r\n return this.formatForDisplay(value)\r\n .replaceAll(getCurrentGroupSeparator(), \"\")\r\n .replaceAll(getCurrentDecimalSeparator(), \".\");\r\n }\r\n\r\n componentDidMount() {\r\n if (this.inputRef.current && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.inputRef.current);\r\n }\r\n this.updateTextOverflowState();\r\n }\r\n\r\n componentDidUpdate(prevProps: { value: any }) {\r\n if (this.props.value !== prevProps.value) {\r\n this.setState(\r\n { value: this.formatForDisplay(this.props.value)}\r\n );\r\n }\r\n this.updateTextOverflowState();\r\n }\r\n\r\n componentWillUnmount() {\r\n this.handleBlur(null);\r\n this.disposer?.();\r\n }\r\n\r\n @action.bound\r\n handleFocus(event: any) {\r\n if (this.inputRef.current) {\r\n this.inputRef.current.select();\r\n this.inputRef.current.scrollLeft = 0;\r\n }\r\n }\r\n\r\n updateTextOverflowState() {\r\n if (!this.inputRef.current) {\r\n return;\r\n }\r\n const textOverflow = this.inputRef.current.offsetWidth < this.inputRef.current.scrollWidth\r\n this.props.onTextOverflowChanged?.(textOverflow ? this.state.value : undefined);\r\n }\r\n\r\n @action.bound\r\n async handleBlur(event: any) {\r\n await runInFlowWithHandler({\r\n ctx: this.props.property,\r\n action: async () => {\r\n let value = this.formatForOnChange(this.state.value);\r\n if(this.formatForOnChange(this.props.value) !== value){\r\n this.props.onChange && await this.props.onChange(null, value);\r\n }\r\n this.props.onEditorBlur?.(event);\r\n this.setState(\r\n { value: this.formatForDisplay(this.state.value)}\r\n );\r\n }})\r\n }\r\n\r\n @action.bound handleChange(event: any) {\r\n const {cleanValue, invalidCharactersBeforeCursor} = getValidCharacters(event);\r\n\r\n const newState = isValidNumber(cleanValue)\r\n ? { value: cleanValue, cursorPosition: event.target.selectionStart - invalidCharactersBeforeCursor }\r\n : { value: this.state.value, cursorPosition: event.target.selectionStart - 1 };\r\n\r\n this.setState(\r\n newState,\r\n () => {\r\n if(this.inputRef.current){\r\n this.inputRef.current.selectionStart = this.state.cursorPosition;\r\n this.inputRef.current.selectionEnd = this.state.cursorPosition;\r\n }\r\n });\r\n\r\n this.updateTextOverflowState();\r\n }\r\n\r\n @action.bound\r\n async handleKeyDown(event: any) {\r\n await runInFlowWithHandler({\r\n ctx: this.props.property,\r\n action: async () => {\r\n if (event.key === \"Enter\" || event.key === \"Tab\"){\r\n let value = this.formatForOnChange(this.state.value);\r\n if(this.formatForOnChange(this.props.value) !== value){\r\n this.props.onChange && await this.props.onChange(null, value);\r\n }\r\n }\r\n this.props.onKeyDown && this.props.onKeyDown(event);\r\n }})\r\n }\r\n\r\n getStyle() {\r\n if (this.props.customStyle) {\r\n return this.props.customStyle;\r\n } else {\r\n return {\r\n color: this.props.foregroundColor,\r\n backgroundColor: this.props.backgroundColor,\r\n };\r\n }\r\n }\r\n\r\n render() {\r\n const maxLength = (this.props.maxLength === 0 ? undefined : this.props.maxLength) || undefined;\r\n return (\r\n
\r\n \r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nfunction getValidCharacters(event: any){\r\n const cleanChars = [];\r\n let invalidCharactersBeforeCursor = 0;\r\n for (let i = 0; i < event.target.value.length; i++) {\r\n const char = event.target.value[i];\r\n if(isValidCharacter(char)){\r\n cleanChars.push(char)\r\n }else{\r\n if(i < event.target.selectionStart){\r\n invalidCharactersBeforeCursor++;\r\n }\r\n }\r\n }\r\n return {\r\n cleanValue:cleanChars.join(\"\"),\r\n invalidCharactersBeforeCursor: invalidCharactersBeforeCursor\r\n };\r\n}\r\n\r\nfunction isValidNumber(value: string){\r\n let formattedValue = value\r\n .replaceAll(getCurrentGroupSeparator(), \"\")\r\n .replaceAll(getCurrentDecimalSeparator(), \".\");\r\n if(value.trim() === \"-\"){\r\n return true;\r\n }\r\n return !isNaN(Number(formattedValue))\r\n}\r\n\r\nfunction isValidCharacter(char: string){\r\n if(\r\n char === getCurrentDecimalSeparator() ||\r\n char === getCurrentGroupSeparator() ||\r\n char === \"-\"\r\n ) {\r\n return true;\r\n }\r\n return !isNaN(parseInt(char, 10))\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\n\r\nexport function bodyCellClass(rowIndex: number, selected: boolean, withCursor: boolean) {\r\n return cx(\"cell\", rowIndex % 2 ? \"ord2\" : \"ord1\", {withCursor, selected});\r\n}\r\n\r\nexport const CtxCell = React.createContext({visibleRowIndex: 0, visibleColumnIndex: 0});\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport cx from \"classnames\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport React from \"react\";\r\nimport { DropdownEditorBehavior } from \"../DropdownEditorBehavior\";\r\nimport { DropdownDataTable, IBodyCellDriver } from \"../DropdownTableModel\";\r\nimport S from \"./BooleanCell.module.scss\";\r\nimport { bodyCellClass } from \"./CellsCommon\";\r\n\r\nexport class BooleanCellDriver implements IBodyCellDriver {\r\n constructor(\r\n private dataIndex: number,\r\n private dataTable: DropdownDataTable,\r\n private behavior: DropdownEditorBehavior\r\n ) {\r\n }\r\n\r\n formattedText(rowIndex: number){\r\n if(this.dataTable.rowCount <= rowIndex){\r\n return \"\";\r\n }\r\n return this.dataTable.getValue(rowIndex, this.dataIndex) ?? \"\";\r\n }\r\n\r\n render(rowIndex: number) {\r\n const rowId = this.dataTable.getRowIdentifierByIndex(rowIndex);\r\n return (\r\n this.behavior.handleTableCellClicked(e, rowIndex)}\r\n >\r\n {this.formattedText(rowIndex) ? : }\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const IBooleanCellDriver = TypeSymbol(\"IBooleanCellDriver\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { IHeaderCellDriver } from \"../DropdownTableModel\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class DefaultHeaderCellDriver implements IHeaderCellDriver {\r\n constructor(private name: string) {\r\n }\r\n\r\n render() {\r\n return
{this.name}
;\r\n }\r\n}\r\n\r\nexport const IDefaultHeaderCellDriver = TypeSymbol(\r\n \"IDefaultHeaderCellDriver\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { bodyCellClass } from \"./CellsCommon\";\r\nimport { DropdownDataTable, IBodyCellDriver } from \"../DropdownTableModel\";\r\nimport cx from \"classnames\";\r\nimport S from \"./NumberCell.module.scss\";\r\nimport { DropdownEditorBehavior } from \"../DropdownEditorBehavior\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class NumberCellDriver implements IBodyCellDriver {\r\n constructor(\r\n private dataIndex: number,\r\n private dataTable: DropdownDataTable,\r\n private behavior: DropdownEditorBehavior\r\n ) {\r\n }\r\n\r\n formattedText(rowIndex: number){\r\n if(this.dataTable.rowCount <= rowIndex){\r\n return \"\";\r\n }\r\n return this.dataTable.getValue(rowIndex, this.dataIndex) ?? \"\";\r\n }\r\n\r\n render(rowIndex: number) {\r\n const rowId = this.dataTable.getRowIdentifierByIndex(rowIndex);\r\n return (\r\n this.behavior.handleTableCellClicked(e, rowIndex)}\r\n >\r\n {this.formattedText(rowIndex)}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const INumberCellDriver = TypeSymbol(\"INumberCellDriver\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { bodyCellClass } from \"./CellsCommon\";\r\nimport { DropdownDataTable, IBodyCellDriver } from \"../DropdownTableModel\";\r\nimport { DropdownEditorBehavior } from \"../DropdownEditorBehavior\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class TextCellDriver implements IBodyCellDriver {\r\n constructor(\r\n private dataIndex: number,\r\n private dataTable: DropdownDataTable,\r\n private behavior: DropdownEditorBehavior\r\n ) {\r\n }\r\n\r\n formattedText(rowIndex: number){\r\n if(this.dataTable.rowCount <= rowIndex){\r\n return \"\";\r\n }\r\n return this.dataTable.getValue(rowIndex, this.dataIndex) ?? \"\";\r\n }\r\n\r\n render(rowIndex: number) {\r\n const rowId = this.dataTable.getRowIdentifierByIndex(rowIndex);\r\n return (\r\n {\r\n this.behavior.handleTableCellClicked(e, rowIndex)\r\n }\r\n }\r\n >\r\n {this.formattedText(rowIndex)}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const ITextCellDriver = TypeSymbol(\"ITextCellDriver\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport type CancellablePromise = Promise & { cancel(): void };\r\n\r\nexport const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\r\n\r\nexport const EagerlyLoadedGrid = \"EagerlyLoadedGrid\";\r\nexport const LazilyLoadedTree = \"LazilyLoadedTree\";\r\nexport const EagerlyLoadedTree = \"EagerlyLoadedTree\";\r\nexport const LazilyLoadedGrid = \"LazilyLoadedGrid\";\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { bind } from \"@decorize/bind\";\r\nimport { DataViewAPI } from \"modules/DataView/DataViewAPI\";\r\nimport { RowCursor } from \"modules/DataView/TableCursor\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\nimport { DropdownEditorBehavior } from \"./DropdownEditorBehavior\";\r\nimport { EagerlyLoadedGrid } from \"./DropdownEditorCommon\";\r\n\r\nexport interface IDropdownEditorApi {\r\n getLookupList(searchTerm: string): Generator;\r\n}\r\n\r\n@bind\r\nexport class DropdownEditorApi implements IDropdownEditorApi {\r\n constructor(\r\n private setup: () => DropdownEditorSetup,\r\n private rowCursor: RowCursor,\r\n private api: DataViewAPI,\r\n private behavior: () => DropdownEditorBehavior,\r\n ) {\r\n }\r\n\r\n *getLookupList(searchTerm: string): Generator {\r\n const setup = this.setup();\r\n if (setup.dropdownType === EagerlyLoadedGrid) {\r\n return yield*this.api.getLookupList({\r\n ColumnNames: setup.columnNames,\r\n Property: setup.propertyId,\r\n Id: this.rowCursor.selectedId!,\r\n LookupId: setup.lookupId,\r\n Parameters: setup.parameters,\r\n ShowUniqueValues: setup.showUniqueValues,\r\n SearchText: searchTerm || \"\",\r\n PageSize: -1,\r\n PageNumber: 1,\r\n });\r\n } else {\r\n return yield*this.api.getLookupList({\r\n ColumnNames: setup.columnNames,\r\n Property: setup.propertyId,\r\n Id: this.rowCursor.selectedId!,\r\n LookupId: setup.lookupId,\r\n Parameters: setup.parameters,\r\n ShowUniqueValues: setup.showUniqueValues,\r\n SearchText: searchTerm || \"\",\r\n PageSize: this.behavior().pageSize,\r\n PageNumber: this.behavior().willLoadPage,\r\n });\r\n }\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport _ from \"lodash\";\r\nimport { action, computed, decorate, flow, observable, reaction } from \"mobx\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\nimport { IDropdownEditorApi } from \"./DropdownEditorApi\";\r\nimport { CancellablePromise, EagerlyLoadedGrid, LazilyLoadedGrid } from \"./DropdownEditorCommon\";\r\nimport { IDropdownEditorData } from \"./DropdownEditorData\";\r\nimport { DropdownEditorLookupListCache } from \"./DropdownEditorLookupListCache\";\r\nimport { DropdownDataTable } from \"./DropdownTableModel\";\r\nimport { IFocusable } from \"../../../model/entities/FormFocusManager\";\r\nimport { compareStrings } from \"../../../utils/string\";\r\n\r\nexport class DropdownEditorBehavior {\r\n constructor(\r\n private api: IDropdownEditorApi,\r\n private data: IDropdownEditorData,\r\n private dataTable: DropdownDataTable,\r\n private setup: () => DropdownEditorSetup,\r\n private cache: DropdownEditorLookupListCache,\r\n public isReadOnly: boolean,\r\n public onDoubleClick?: (event: any) => void,\r\n public onClick?: (event: any) => void,\r\n public subscribeToFocusManager?: (obj: IFocusable) => void,\r\n private onKeyDown?: (event: any) => void,\r\n private autoSort?: boolean,\r\n private onTextOverflowChanged?: (toolTip: string | null | undefined) => void\r\n ) {\r\n }\r\n\r\n @observable isDropped = false;\r\n @observable isWorking = false;\r\n @observable userEnteredValue = undefined;\r\n @observable scrollToRowIndex: number | undefined = undefined;\r\n dontClearScrollToRow = true;\r\n\r\n @observable cursorRowId = \"\";\r\n\r\n willLoadPage = 1;\r\n willLoadNextPage = true;\r\n pageSize = 100;\r\n\r\n @computed get isBodyDisplayed() {\r\n return this.isDropped && this.dataTable.rowCount > 0;\r\n }\r\n\r\n @computed get chosenRowId() {\r\n return this.data.value;\r\n }\r\n\r\n @computed get inputValue() {\r\n return this.userEnteredValue !== undefined ? this.userEnteredValue : this.data.text;\r\n }\r\n\r\n @action.bound dropUp() {\r\n if (this.isDropped) {\r\n this.ensureRequestCancelled();\r\n this.dataTable.clearData();\r\n this.userEnteredValue = undefined;\r\n this.isDropped = false;\r\n this.willLoadPage = 1;\r\n this.willLoadNextPage = true;\r\n this.scrollToRowIndex = 0;\r\n }\r\n }\r\n\r\n @action.bound dropDown() {\r\n const setup = this.setup();\r\n if (!this.isDropped) {\r\n if (setup.dropdownType === EagerlyLoadedGrid) {\r\n this.dataTable.setFilterPhrase(this.userEnteredValue || \"\");\r\n }\r\n if (\r\n setup.dropdownType === EagerlyLoadedGrid &&\r\n setup.cached &&\r\n this.cache.hasCachedListRows()\r\n ) {\r\n this.dataTable.setData(this.cache.getCachedListRows());\r\n } else {\r\n this.ensureRequestRunning();\r\n }\r\n if (this.chosenRowId !== null && !Array.isArray(this.chosenRowId)) {\r\n this.cursorRowId = this.chosenRowId;\r\n }\r\n }\r\n this.isDropped = true;\r\n this.scrollToChosenRowIfPossible();\r\n this.makeFocused();\r\n }\r\n\r\n makeFocused() {\r\n if (this.elmInputElement) {\r\n this.elmInputElement.focus();\r\n }\r\n }\r\n\r\n @action.bound\r\n scrollToChosenRowIfPossible() {\r\n if (this.chosenRowId && !_.isArray(this.chosenRowId)) {\r\n const index = this.dataTable.getRowIndexById(this.chosenRowId);\r\n if (index > -1) {\r\n this.dontClearScrollToRow = true;\r\n this.scrollToRowIndex = index + 1;\r\n }\r\n }\r\n }\r\n\r\n @action.bound\r\n scrollToCursoredRowIfNeeded() {\r\n const index = this.dataTable.getRowIndexById(this.cursorRowId);\r\n if (index > -1) {\r\n this.dontClearScrollToRow = true;\r\n this.scrollToRowIndex = index + 1;\r\n }\r\n }\r\n\r\n @action.bound handleInputFocus(event: any) {\r\n const {target} = event;\r\n if (target) {\r\n target.select();\r\n target.scrollLeft = 0;\r\n }\r\n }\r\n\r\n @action.bound handleInputBlur(event: any) {\r\n if (this.userEnteredValue && this.isDropped && !this.isWorking && this.cursorRowId) {\r\n this.data.chooseNewValue(this.cursorRowId);\r\n } else if (this.userEnteredValue === \"\") {\r\n this.data.chooseNewValue(null);\r\n }\r\n this.dropUp();\r\n }\r\n\r\n @action.bound\r\n handleInputBtnClick(event: any) {\r\n if (!this.isDropped) {\r\n this.dropDown();\r\n } else {\r\n this.dropUp();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleInputKeyDown(event: any) {\r\n switch (event.key) {\r\n case \"Escape\":\r\n this.dropUp();\r\n this.userEnteredValue = undefined;\r\n break;\r\n case \"Enter\":\r\n const wasDropped = this.isDropped;\r\n if (this.isDropped && !this.isWorking && this.cursorRowId) {\r\n this.data.chooseNewValue(this.cursorRowId);\r\n this.dropUp();\r\n }\r\n if (wasDropped) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n // Do not pass event to props.onKeyDown\r\n return;\r\n }\r\n break;\r\n case \"Tab\":\r\n if (this.isDropped) {\r\n if (this.cursorRowId) {\r\n this.data.chooseNewValue(this.cursorRowId);\r\n }\r\n }\r\n break;\r\n case \"Delete\":\r\n this.userEnteredValue = undefined;\r\n this.cursorRowId = \"\";\r\n this.data.chooseNewValue(null);\r\n break;\r\n case \"ArrowUp\":\r\n if (this.isDropped) {\r\n event.preventDefault();\r\n if (!this.dataTable.getRowById(this.cursorRowId)) {\r\n this.trySelectFirstRow();\r\n this.selectChosenRow();\r\n } else {\r\n const prevRowId = this.dataTable.getRowIdBeforeId(this.cursorRowId);\r\n if (prevRowId) {\r\n this.cursorRowId = prevRowId;\r\n }\r\n }\r\n this.scrollToCursoredRowIfNeeded();\r\n }\r\n break;\r\n case \"ArrowDown\":\r\n if (this.isDropped) {\r\n event.preventDefault();\r\n if (!this.dataTable.getRowById(this.cursorRowId)) {\r\n this.trySelectFirstRow();\r\n this.selectChosenRow();\r\n } else {\r\n const nextRowId = this.dataTable.getRowIdAfterId(this.cursorRowId);\r\n if (nextRowId) {\r\n this.cursorRowId = nextRowId;\r\n }\r\n }\r\n this.scrollToCursoredRowIfNeeded();\r\n } else if (event.ctrlKey || event.metaKey) {\r\n this.dropDown();\r\n this.trySelectFirstRow();\r\n }\r\n break;\r\n }\r\n this.onKeyDown && this.onKeyDown(event);\r\n }\r\n\r\n handleInputChangeDeb = _.debounce(this.handleInputChangeImm, 300);\r\n\r\n @action.bound\r\n handleInputChange(event: any) {\r\n this.userEnteredValue = event.target.value;\r\n this.isDropped = true;\r\n\r\n if (this.setup().dropdownType === EagerlyLoadedGrid) {\r\n this.dataTable.setFilterPhrase(this.userEnteredValue || \"\");\r\n if (this.setup().cached && this.cache.hasCachedListRows()) {\r\n this.dataTable.setData(this.cache.getCachedListRows());\r\n } else {\r\n this.ensureRequestRunning();\r\n }\r\n if (!this.dataTable.getRowById(this.cursorRowId) && this.userEnteredValue) {\r\n this.trySelectFirstRow();\r\n }\r\n } else if (this.setup().dropdownType === LazilyLoadedGrid) {\r\n this.handleInputChangeDeb();\r\n }\r\n this.updateTextOverflowState();\r\n }\r\n\r\n @action.bound handleInputChangeImm() {\r\n if (this.setup().dropdownType === LazilyLoadedGrid) {\r\n this.willLoadNextPage = true;\r\n this.willLoadPage = 1;\r\n this.dataTable.clearData();\r\n }\r\n this.ensureRequestCancelled();\r\n this.ensureRequestRunning();\r\n }\r\n\r\n @action.bound handleTableCellClicked(event: any, visibleRowIndex: any) {\r\n const id = this.dataTable.getRowIdentifierByIndex(visibleRowIndex);\r\n this.data.chooseNewValue(id);\r\n this.dropUp();\r\n }\r\n\r\n @action.bound\r\n handleTriggerContextMenu(event: any) {\r\n this.dropUp();\r\n }\r\n\r\n @action.bound\r\n handleControlMouseDown(event: any) {\r\n if (this.isDropped) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleBodyMouseDown(event: any) {\r\n if (this.isDropped) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleWindowMouseDown(event: any) {\r\n if (this.userEnteredValue === \"\") {\r\n this.data.chooseNewValue(null);\r\n }\r\n if (this.isDropped) {\r\n this.dropUp();\r\n }\r\n }\r\n\r\n @action.bound\r\n handleScroll(args: {\r\n clientHeight: number;\r\n clientWidth: number;\r\n scrollHeight: number;\r\n scrollLeft: number;\r\n scrollTop: number;\r\n scrollWidth: number;\r\n }) {\r\n const setup = this.setup();\r\n if (setup.dropdownType === LazilyLoadedGrid) {\r\n if (\r\n this.willLoadNextPage &&\r\n !this.isWorking &&\r\n args.scrollTop > args.scrollHeight - args.clientHeight - 500\r\n ) {\r\n this.willLoadPage++;\r\n this.ensureRequestRunning();\r\n }\r\n }\r\n if (this.dontClearScrollToRow) {\r\n this.dontClearScrollToRow = false;\r\n } else {\r\n this.scrollToRowIndex = undefined;\r\n }\r\n }\r\n\r\n @action.bound\r\n ensureRequestRunning() {\r\n if (!this.isWorking) {\r\n this.runGetLookupList(\r\n this.setup().dropdownType === EagerlyLoadedGrid ? \"\" : this.userEnteredValue || \"\"\r\n );\r\n }\r\n }\r\n\r\n @action.bound ensureRequestCancelled() {\r\n if (this.runningPromise) this.runningPromise.cancel();\r\n }\r\n\r\n runningPromise: CancellablePromise | undefined;\r\n\r\n @action.bound trySelectFirstRow() {\r\n if (this.dataTable.rows.length > 0) {\r\n this.cursorRowId = this.dataTable.getRowIdentifierByIndex(0);\r\n }\r\n }\r\n\r\n @action.bound selectChosenRow() {\r\n if (\r\n this.dataTable.rows.length > 0 &&\r\n this.chosenRowId &&\r\n !_.isArray(this.chosenRowId) &&\r\n this.dataTable.getRowById(this.chosenRowId)\r\n ) {\r\n this.cursorRowId = this.chosenRowId;\r\n }\r\n }\r\n\r\n updateTextOverflowState() {\r\n if (!this.elmInputElement) {\r\n return;\r\n }\r\n const textOverflow = this.elmInputElement.offsetWidth < this.elmInputElement.scrollWidth\r\n this.onTextOverflowChanged?.(textOverflow ? this.inputValue : undefined);\r\n }\r\n\r\n @action.bound runGetLookupList(searchTerm: string) {\r\n const self = this;\r\n this.runningPromise = flow(function*() {\r\n try {\r\n self.isWorking = true;\r\n const setup = self.setup();\r\n const items = yield*self.api.getLookupList(searchTerm);\r\n if (self.autoSort) {\r\n items.sort((i1: any[], i2: any[]) => compareLookUpItems(i1[1], i2[1]))\r\n }\r\n if (setup.dropdownType === EagerlyLoadedGrid) {\r\n self.dataTable.setData(items);\r\n if (setup.cached) {\r\n self.cache.setCachedListRows(items);\r\n }\r\n } else if (setup.dropdownType === LazilyLoadedGrid) {\r\n if (items.length < self.pageSize) {\r\n self.willLoadNextPage = false;\r\n }\r\n self.scrollToRowIndex = undefined;\r\n self.dataTable.appendData(items);\r\n }\r\n if (!self.dataTable.getRowById(self.cursorRowId) && self.userEnteredValue) {\r\n self.trySelectFirstRow();\r\n }\r\n self.scrollToChosenRowIfPossible();\r\n self.selectChosenRow();\r\n } finally {\r\n self.isWorking = false;\r\n self.runningPromise = undefined;\r\n }\r\n })();\r\n }\r\n\r\n @action.bound handleUseEffect() {\r\n return reaction(\r\n () => this.data.value,\r\n () => {\r\n this.userEnteredValue = undefined;\r\n }\r\n );\r\n }\r\n\r\n @action.bound\r\n clearCache() {\r\n this.cache.clean();\r\n }\r\n\r\n _refInputDisposer: any;\r\n refInputElement = (elm: any) => {\r\n this.elmInputElement = elm;\r\n };\r\n\r\n elmInputElement: any;\r\n refDropdownBody = (elm: any) => (this.elmDropdownBody = elm);\r\n elmDropdownBody: any;\r\n}\r\n\r\nfunction compareLookUpItems(item1: any, item2: any) {\r\n if (typeof item1 === 'number' && typeof item2 === 'number') {\r\n if (item1 > item2) return 1;\r\n if (item1 < item2) return -1;\r\n return 0;\r\n }\r\n return compareStrings(item1, item2)\r\n}\r\n\r\ndecorate(DropdownEditorBehavior, {\r\n isReadOnly: observable,\r\n});\r\n\r\nexport const IDropdownEditorBehavior = TypeSymbol(\r\n \"IDropdownEditorBehavior\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nlet dummyCanvas: HTMLCanvasElement | undefined;\r\n\r\nexport function getTextWidth(text: string, font : string) {\r\n const canvas = dummyCanvas || (dummyCanvas = document.createElement(\"canvas\"));\r\n const context = canvas.getContext(\"2d\");\r\n context!.font = font;\r\n const metrics = context!.measureText(text);\r\n return metrics.width;\r\n}\r\n\r\nfunction getCssStyle(element: HTMLElement, prop: string) {\r\n return window.getComputedStyle(element, null).getPropertyValue(prop);\r\n}\r\n\r\nexport function getCanvasFontSize(el = document.body) {\r\n const fontWeight = getCssStyle(el, 'font-weight') || 'normal';\r\n const fontSize = getCssStyle(el, 'font-size') || '16px';\r\n const fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';\r\n\r\n return `${fontWeight} ${fontSize} ${fontFamily}`;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer, Observer } from \"mobx-react\";\r\nimport React, { useContext, useEffect, useMemo, createRef } from \"react\";\r\nimport { GridCellProps, MultiGrid } from \"react-virtualized\";\r\nimport { CtxCell } from \"./Cells/CellsCommon\";\r\nimport S from \"@origam/components/src/components/Dropdown/Dropdown.module.scss\"\r\nimport { CtxDropdownCtrlRect, CtxDropdownRefBody } from \"@origam/components\";\r\nimport { CtxDropdownEditor } from \"./DropdownEditor\";\r\nimport { rowHeight } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon\";\r\nimport cx from \"classnames\";\r\nimport { getCanvasFontSize, getTextWidth } from \"utils/textMeasurement\";\r\nimport { DropdownColumnDrivers, DropdownDataTable } from \"modules/Editors/DropdownEditor/DropdownTableModel\";\r\nimport { BoundingRect } from \"react-measure\";\r\nimport { DropdownEditorBehavior } from \"modules/Editors/DropdownEditor/DropdownEditorBehavior\";\r\nimport { observable } from \"mobx\";\r\n\r\nexport function DropdownEditorBody() {\r\n const refCtxBody = useContext(CtxDropdownRefBody);\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n\r\n const ref = useMemo(\r\n () => (elm: any) => {\r\n refCtxBody(elm);\r\n beh.refDropdownBody(elm);\r\n },\r\n [beh, refCtxBody]\r\n );\r\n\r\n useEffect(() => {\r\n window.addEventListener(\"mousedown\", beh.handleWindowMouseDown);\r\n return () => window.removeEventListener(\"mousedown\", beh.handleWindowMouseDown);\r\n }, [beh]);\r\n\r\n const drivers = useContext(CtxDropdownEditor).columnDrivers;\r\n const dataTable = useContext(CtxDropdownEditor).editorDataTable;\r\n const rectCtrl = useContext(CtxDropdownCtrlRect);\r\n\r\n return (\r\n \r\n {() => (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n}\r\n\r\n@observer\r\nexport class DropdownEditorTable extends React.Component<{\r\n drivers: DropdownColumnDrivers,\r\n dataTable: DropdownDataTable,\r\n rectCtrl: BoundingRect,\r\n beh: DropdownEditorBehavior\r\n}> {\r\n refMultiGrid = createRef();\r\n @observable\r\n scrollbarSize = { horiz: 0, vert: 0 };\r\n hasHeader: boolean;\r\n hoveredRowIndex= - 1;\r\n columnCount = 0;\r\n readonly cellPadding = 20;\r\n readonly maxHeight = 150;\r\n\r\n get rowCount(){\r\n return this.props.dataTable.rowCount + (this.hasHeader ? 1 : 0);\r\n }\r\n\r\n get height(){\r\n let height = 0;\r\n for (let i = 0; i < this.rowCount; i++) {\r\n height = height + rowHeight;\r\n }\r\n return Math.min(height, this.maxHeight) + this.scrollbarSize.horiz;\r\n }\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.columnCount = this.props.drivers.driverCount;\r\n this.hasHeader = this.columnCount > 1;\r\n }\r\n\r\n handleScrollbarPresenceChange(args: {\r\n horizontal: boolean;\r\n size: number;\r\n vertical: boolean;\r\n }) {\r\n this.scrollbarSize = {\r\n horiz: args.horizontal ? args.size : 0,\r\n vert: args.vertical ? args.size : 0,\r\n };\r\n }\r\n\r\n\r\n renderTableCell({columnIndex, key, parent, rowIndex, style}: GridCellProps) {\r\n const Prov = CtxCell.Provider as any;\r\n return (\r\n \r\n {(this.hasHeader && rowIndex > 0) || !this.hasHeader ? (\r\n {\r\n this.hoveredRowIndex = rowIndex;\r\n }}\r\n onMouseOut={(evt) => {\r\n this.hoveredRowIndex= -1;\r\n }}\r\n >\r\n \r\n {() => (\r\n <>\r\n {this.props.drivers\r\n .getDriver(columnIndex)\r\n .bodyCellDriver.render(rowIndex - (this.hasHeader ? 1 : 0))}\r\n \r\n )}\r\n \r\n \r\n ) : (\r\n
\r\n \r\n {() => <>{this.props.drivers.getDriver(columnIndex).headerCellDriver.render()}}\r\n \r\n
\r\n )}\r\n \r\n );\r\n }\r\n\r\n render(){\r\n let columnWidthSum = 0;\r\n let width = 0;\r\n let widths: number[] = [];\r\n for (let columnIndex = 0; columnIndex < this.columnCount; columnIndex++) {\r\n let cellWidth = 100;\r\n for (let rowIndex = 0; rowIndex < this.rowCount - 1; rowIndex++) {\r\n const cellText = this.props.drivers.getDriver(columnIndex).bodyCellDriver.formattedText(rowIndex);\r\n const currentCellWidth = Math.round(getTextWidth(cellText, getCanvasFontSize())) + this.cellPadding;\r\n if(currentCellWidth > cellWidth){\r\n cellWidth = currentCellWidth;\r\n }\r\n }\r\n\r\n width = width + cellWidth;\r\n widths.push(cellWidth);\r\n columnWidthSum = columnWidthSum + cellWidth;\r\n if (width >= window.innerWidth - 100) {\r\n width = window.innerWidth - 100;\r\n break;\r\n }\r\n }\r\n\r\n width = Math.max(width + this.scrollbarSize.vert, this.props.rectCtrl.width!);\r\n let columnGrowFactor = 1;\r\n if (columnWidthSum > 0 && columnWidthSum < this.props.rectCtrl.width!) {\r\n columnGrowFactor = (width - this.scrollbarSize.vert) / columnWidthSum;\r\n }\r\n widths = widths.map((w) => w * columnGrowFactor);\r\n\r\n if(width === 0){\r\n return null;\r\n }\r\n\r\n return (\r\n this.handleScrollbarPresenceChange(args)}\r\n classNameTopRightGrid={S.table}\r\n classNameBottomRightGrid={S.table}\r\n columnCount={this.columnCount}\r\n rowCount={this.rowCount}\r\n columnWidth={({ index }) => widths[index]}\r\n rowHeight={rowHeight}\r\n fixedRowCount={this.hasHeader ? 1 : 0}\r\n height={this.height}\r\n width={width}\r\n cellRenderer={args => this.renderTableCell(args)}\r\n onScroll={this.props.beh.handleScroll}\r\n />\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Observer } from \"mobx-react\";\r\nimport React, { useContext, useEffect, useMemo } from \"react\";\r\nimport { CtxDropdownEditor } from \"./DropdownEditor\";\r\nimport cx from 'classnames';\r\nimport S from \"@origam/components/src/components/Dropdown/Dropdown.module.scss\"\r\n\r\nexport function DropdownEditorInput(props: {\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customStyle?: any;\r\n}) {\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n const data = useContext(CtxDropdownEditor).editorData;\r\n const setup = useContext(CtxDropdownEditor).setup;\r\n const refInput = useMemo(() => {\r\n return (elm: any) => {\r\n beh.refInputElement(elm);\r\n };\r\n }, [beh]);\r\n\r\n useEffect(() => {\r\n if (beh.subscribeToFocusManager && beh.elmInputElement) {\r\n beh.subscribeToFocusManager(beh.elmInputElement);\r\n }\r\n beh.updateTextOverflowState();\r\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\r\n\r\n useEffect(() => {\r\n beh.updateTextOverflowState();\r\n }); // eslint-disable-line react-hooks/exhaustive-deps\r\n function getStyle() {\r\n if (props.customStyle) {\r\n return props.customStyle;\r\n } else {\r\n return {\r\n color: props.foregroundColor,\r\n backgroundColor: props.backgroundColor,\r\n };\r\n }\r\n }\r\n\r\n\r\n return (\r\n \r\n {() => (\r\n \r\n )}\r\n \r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Observer } from \"mobx-react\";\r\nimport React, { useContext, useState } from \"react\";\r\nimport CS from \"@origam/components/src/components/Dropdown/Dropdown.module.scss\"\r\nimport cx from \"classnames\";\r\nimport { CtxDropdownRefCtrl } from \"@origam/components\";\r\nimport { CtxDropdownEditor } from \"./DropdownEditor\";\r\nimport { DropdownEditorInput } from \"./DropdownEditorInput\";\r\nimport { action, observable } from \"mobx\";\r\nimport { createPortal } from \"react-dom\";\r\nimport { DropdownEditorBehavior } from \"./DropdownEditorBehavior\";\r\n\r\nexport function TriggerContextMenu(props: { state: TriggerContextMenuState }) {\r\n return (\r\n \r\n {() => (\r\n <>\r\n {props.state.isDropped\r\n ? createPortal(\r\n \r\n
\r\n e.stopPropagation()}\r\n onClick={props.state.handleRefreshClick}\r\n >\r\n Refresh\r\n
\r\n \r\n ,\r\n document.getElementById(\"dropdown-portal\")!\r\n )\r\n : null}\r\n \r\n )}\r\n
\r\n );\r\n}\r\n\r\nclass TriggerContextMenuState {\r\n constructor(public behaviour: DropdownEditorBehavior) {\r\n }\r\n\r\n @observable isDropped = false;\r\n @observable top = 0;\r\n @observable left = 0;\r\n\r\n @action.bound\r\n handleTriggerContextMenu(event: any) {\r\n event.preventDefault();\r\n if (!this.isDropped) {\r\n this.top = event.clientY;\r\n this.left = event.clientX;\r\n this.isDropped = true;\r\n window.addEventListener(\"mousedown\", this.handleScreenMouseDown);\r\n } else {\r\n this.isDropped = false;\r\n window.removeEventListener(\"mousedown\", this.handleScreenMouseDown);\r\n }\r\n }\r\n\r\n @action.bound\r\n handleScreenContextMenu(event: any) {\r\n event.preventDefault();\r\n this.isDropped = false;\r\n }\r\n\r\n @action.bound\r\n handleScreenMouseDown(event: any) {\r\n event.preventDefault();\r\n this.isDropped = false;\r\n }\r\n\r\n @action.bound\r\n handleRefreshClick(event: any) {\r\n this.isDropped = false;\r\n this.behaviour.clearCache();\r\n }\r\n}\r\n\r\nexport function DropdownEditorControl(props: {\r\n isInvalid?: boolean;\r\n invalidMessage?: string;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customStyle?: any;\r\n}) {\r\n const ref = useContext(CtxDropdownRefCtrl);\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n const [triggerContextMenu] = useState(() => new TriggerContextMenuState(beh));\r\n\r\n return (\r\n \r\n {() => (\r\n
\r\n \r\n {/**/}\r\n\r\n {\r\n beh.handleTriggerContextMenu(event);\r\n triggerContextMenu.handleTriggerContextMenu(event);\r\n }}\r\n onMouseDown={!beh.isReadOnly ? beh.handleControlMouseDown : undefined}\r\n >\r\n {!beh.isWorking ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n\r\n \r\n\r\n {props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n )}\r\n
\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { bind } from \"@decorize/bind\";\r\nimport { action, computed } from \"mobx\";\r\nimport { DataViewData } from \"modules/DataView/DataViewData\";\r\nimport { RowCursor } from \"modules/DataView/TableCursor\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\n\r\nexport interface IDropdownEditorData {\r\n idsInEditor: string[];\r\n value: string | string[] | null;\r\n text: string;\r\n isResolving: boolean;\r\n\r\n chooseNewValue(value: any): void;\r\n\r\n remove(value: any): void;\r\n\r\n setValue(value: string[]): void;\r\n}\r\n\r\n@bind\r\nexport class DropdownEditorData implements IDropdownEditorData {\r\n constructor(\r\n private dataTable: DataViewData,\r\n private rowCursor: RowCursor,\r\n private setup: () => DropdownEditorSetup\r\n ) {\r\n }\r\n\r\n setValue(value: string[]) {\r\n }\r\n\r\n @computed get value(): string | string[] | null {\r\n if (this.rowCursor.selectedId) {\r\n return this.dataTable.getCellValue(this.rowCursor.selectedId, this.setup().propertyId);\r\n } else return null;\r\n }\r\n\r\n @computed get text(): string {\r\n if (!this.isResolving && this.value) {\r\n return this.dataTable.getCellText(this.setup().propertyId, this.value);\r\n } else return \"\";\r\n }\r\n\r\n get isResolving() {\r\n return this.dataTable.getIsCellTextLoading(this.setup().propertyId, this.value);\r\n }\r\n\r\n @action.bound chooseNewValue(value: any) {\r\n if (this.rowCursor.selectedId) {\r\n this.dataTable.setNewValue(this.rowCursor.selectedId, this.setup().propertyId, value);\r\n }\r\n }\r\n\r\n idsInEditor: string[] = [];\r\n\r\n remove(value: any): void {\r\n // not needed in DropdownEditorData\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { LookupListCacheMulti } from \"modules/Lookup/LookupListCacheMulti\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\n\r\nexport class DropdownEditorLookupListCache {\r\n constructor(private setup: () => DropdownEditorSetup, private cache: LookupListCacheMulti) {\r\n }\r\n\r\n get lookupId() {\r\n return this.setup().lookupId;\r\n }\r\n\r\n setCachedListRows(rows: any[][]) {\r\n this.cache.setLookupList(this.lookupId, rows);\r\n }\r\n\r\n getCachedListRows(): any[][] {\r\n return this.cache.getLookupList(this.lookupId)!;\r\n }\r\n\r\n hasCachedListRows(): boolean {\r\n return this.cache.hasLookupList(this.lookupId);\r\n }\r\n\r\n clean() {\r\n return this.cache.deleteLookup(this.lookupId);\r\n }\r\n}\r\n\r\nexport const IDropdownEditorLookupListCache = TypeSymbol(\r\n \"IDropdownEditorLookupListCache\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\nimport { EagerlyLoadedGrid, LazilyLoadedGrid } from \"./DropdownEditorCommon\";\r\nimport { IDropdownEditorData } from \"./DropdownEditorData\";\r\n\r\nexport class DropdownDataTable {\r\n constructor(\r\n private setup: () => DropdownEditorSetup,\r\n private dropdownEditorData: IDropdownEditorData\r\n ) {\r\n }\r\n\r\n @observable.shallow allRows: any[][] = [];\r\n @observable filterPhrase: string = \"\";\r\n\r\n @computed\r\n get index() {\r\n return new Index(this.allRows);\r\n }\r\n\r\n get rowsBeforeRedundancyFilter(): any[][] {\r\n const setup = this.setup();\r\n switch (setup.dropdownType) {\r\n case EagerlyLoadedGrid: {\r\n if (this.filterPhrase !== \"\") {\r\n return this.index.search(this.filterPhrase);\r\n }\r\n return this.allRows;\r\n }\r\n default:\r\n case LazilyLoadedGrid: {\r\n return this.allRows;\r\n }\r\n }\r\n }\r\n\r\n @computed get rows(): any[][] {\r\n return this.rowsBeforeRedundancyFilter.filter(\r\n (row) => !this.dropdownEditorData.idsInEditor.includes(this.getRowIdentifier(row))\r\n );\r\n }\r\n\r\n get rowCount() {\r\n return this.rows.length;\r\n }\r\n\r\n @computed\r\n get columnIdsWithNoData() {\r\n const result: string[] = [];\r\n outer: for (let column of this.setup().visibleColumnNames) {\r\n for (let i = 0; i < this.allRows.length; i++) {\r\n if (this.allRows[i][this.setup().columnNameToIndex.get(column)!] !== null) {\r\n continue outer;\r\n }\r\n }\r\n result.push(column);\r\n }\r\n return result;\r\n }\r\n\r\n getValue(dataRowIndex: number, dataColumnIndex: number) {\r\n return this.rows[dataRowIndex][dataColumnIndex];\r\n }\r\n\r\n getRowByIndex(rowIndex: number) {\r\n return this.rows[rowIndex];\r\n }\r\n\r\n getRowIdentifierByIndex(rowIndex: number) {\r\n return this.rows[rowIndex][this.setup().identifierIndex];\r\n }\r\n\r\n getRowIdentifier(row: any[]) {\r\n return row[this.setup().identifierIndex];\r\n }\r\n\r\n getRowById(id: string) {\r\n return this.rows.find((row) => this.getRowIdentifier(row) === id);\r\n }\r\n\r\n getRowIndexById(id: string) {\r\n return this.rows.findIndex((row) => this.getRowIdentifier(row) === id);\r\n }\r\n\r\n getRowAfterId(id: string) {\r\n const idx = this.getRowIndexById(id);\r\n if (idx > -1 && idx < this.rowCount - 1) {\r\n return this.getRowByIndex(idx + 1);\r\n } else return undefined;\r\n }\r\n\r\n getRowBeforeId(id: string) {\r\n const idx = this.getRowIndexById(id);\r\n if (idx > 0) {\r\n return this.getRowByIndex(idx - 1);\r\n } else return undefined;\r\n }\r\n\r\n getRowIdAfterId(id: string) {\r\n const row = this.getRowAfterId(id);\r\n if (row) return this.getRowIdentifier(row);\r\n }\r\n\r\n getRowIdBeforeId(id: string) {\r\n const row = this.getRowBeforeId(id);\r\n if (row) return this.getRowIdentifier(row);\r\n }\r\n\r\n @action.bound setData(rows: any[][]) {\r\n this.allRows = rows;\r\n }\r\n\r\n @action.bound appendData(rows: any[][]) {\r\n this.allRows.push(...rows);\r\n }\r\n\r\n @action.bound clearData() {\r\n this.allRows.length = 0;\r\n }\r\n\r\n @action.bound setFilterPhrase(phrase: string) {\r\n this.filterPhrase = phrase;\r\n }\r\n}\r\n\r\nexport const IDropdownDataTable = TypeSymbol(\"IDropdownDataTable\");\r\n\r\nexport interface IHeaderCellDriver {\r\n render(): React.ReactNode;\r\n}\r\n\r\nexport interface IBodyCellDriver {\r\n render(rowIndex: number): React.ReactNode;\r\n\r\n formattedText(i: number): string;\r\n}\r\n\r\nexport interface IDropdownColumnDriver {\r\n columnId: string;\r\n headerCellDriver: IHeaderCellDriver;\r\n bodyCellDriver: IBodyCellDriver;\r\n}\r\n\r\nexport class DropdownColumnDrivers {\r\n @observable\r\n allDrivers: IDropdownColumnDriver[] = [];\r\n\r\n driversFilter = (driver: IDropdownColumnDriver) => {\r\n return true;\r\n };\r\n\r\n @computed\r\n get drivers() {\r\n return this.allDrivers.filter((driver) => {\r\n return this.driversFilter(driver);\r\n });\r\n }\r\n\r\n get driverCount() {\r\n return this.drivers.length;\r\n }\r\n\r\n getDriver(columnIndex: number) {\r\n return this.drivers[columnIndex];\r\n }\r\n}\r\n\r\nexport const IDropdownColumnDrivers = TypeSymbol(\"IDropdownColumnDrivers\");\r\n\r\nclass Index {\r\n private items: IndexItem[] = [];\r\n\r\n constructor(rows: any[][]) {\r\n if (rows.length > 0) {\r\n this.items = rows.map((row) => new IndexItem(row));\r\n }\r\n }\r\n\r\n search(phrase: string) {\r\n const phraseLower = phrase.toLowerCase();\r\n return this.items.filter((item) => item.matches(phraseLower)).map((item) => item.row);\r\n }\r\n}\r\n\r\nclass IndexItem {\r\n private textInLower: string;\r\n public row: any[];\r\n\r\n constructor(row: any[]) {\r\n this.row = row;\r\n this.textInLower = row.slice(1).join(\"\").toLowerCase();\r\n }\r\n\r\n matches(phraseInLower: string) {\r\n return this.textInLower.includes(phraseInLower);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { bind } from \"@decorize/bind\";\r\nimport { DataViewData } from \"../../DataView/DataViewData\";\r\nimport { RowCursor } from \"../../DataView/TableCursor\";\r\nimport { DropdownEditorSetup } from \"./DropdownEditor\";\r\nimport { action, computed } from \"mobx\";\r\nimport { DropdownEditorData, IDropdownEditorData } from \"./DropdownEditorData\";\r\n\r\n@bind\r\nexport class TagInputEditorData implements IDropdownEditorData {\r\n dropdownEditorData: IDropdownEditorData;\r\n\r\n constructor(\r\n private dataTable: DataViewData,\r\n private rowCursor: RowCursor,\r\n private setup: () => DropdownEditorSetup\r\n ) {\r\n this.dropdownEditorData = new DropdownEditorData(dataTable, rowCursor, setup);\r\n }\r\n\r\n setValue(value: string[]) {\r\n }\r\n\r\n @computed get value(): string | string[] | null {\r\n return this.dropdownEditorData.value;\r\n }\r\n\r\n @computed get text(): string {\r\n return this.dropdownEditorData.text;\r\n }\r\n\r\n get isResolving() {\r\n return this.dropdownEditorData.isResolving;\r\n }\r\n\r\n @action.bound chooseNewValue(value: any) {\r\n if (this.value && this.value.includes(value)) {\r\n return;\r\n }\r\n const newArray = [...this.value ?? [], value];\r\n if (this.rowCursor.selectedId) {\r\n this.dataTable.setNewValue(this.rowCursor.selectedId, this.setup().propertyId, newArray);\r\n }\r\n }\r\n\r\n get idsInEditor() {\r\n return (this.value ? this.value : []) as string[];\r\n }\r\n\r\n remove(value: any): void {\r\n // not needed in TagInputEditorData\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { DropdownDataTable, IBodyCellDriver, } from \"modules/Editors/DropdownEditor/DropdownTableModel\";\r\nimport { DropdownEditorBehavior } from \"modules/Editors/DropdownEditor/DropdownEditorBehavior\";\r\nimport { bodyCellClass } from \"modules/Editors/DropdownEditor/Cells/CellsCommon\";\r\nimport React from \"react\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { TextCellDriver } from \"modules/Editors/DropdownEditor/Cells/TextCellDriver\";\r\nimport moment from \"moment\";\r\n\r\nexport class DateCellDriver implements IBodyCellDriver {\r\n constructor(\r\n private dataIndex: number,\r\n private dataTable: DropdownDataTable,\r\n private behavior: DropdownEditorBehavior,\r\n private formatterPattern: string\r\n ) {\r\n }\r\n\r\n formattedText(rowIndex: number){\r\n if(this.dataTable.rowCount <= rowIndex){\r\n return \"\";\r\n }\r\n const value = this.dataTable.getValue(rowIndex, this.dataIndex);\r\n let momentValue = moment(value);\r\n return momentValue.isValid() ? momentValue.format(this.formatterPattern) : \"\";\r\n }\r\n\r\n render(rowIndex: number) {\r\n const rowId = this.dataTable.getRowIdentifierByIndex(rowIndex);\r\n\r\n return (\r\n {\r\n this.behavior.handleTableCellClicked(e, rowIndex);\r\n }}\r\n >\r\n {this.formattedText(rowIndex)}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport const IDateCellDriver = TypeSymbol(\"ITextCellDriver\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { csToMomentFormat } from \"@origam/utils\";\r\nimport { T } from \"../utils/translation\";\r\nimport { getDefaultCsDateFormatDataFromCookie } from \"../utils/cookies\";\r\n\r\nexport function replaceDefaultDateFormats(formatFromServer: string) {\r\n if (formatFromServer === \"long\") {\r\n let defaultDateFormatData = getDefaultCsDateFormatDataFromCookie();\r\n return defaultDateFormatData.defaultLongDateFormat;\r\n }\r\n\r\n if (formatFromServer === \"short\") {\r\n let defaultDateFormatData = getDefaultCsDateFormatDataFromCookie();\r\n return defaultDateFormatData.defaultShortDateFormat;\r\n }\r\n\r\n if (formatFromServer === \"time\") {\r\n let defaultDateFormatData = getDefaultCsDateFormatDataFromCookie();\r\n return defaultDateFormatData.defaultTimeFormat;\r\n }\r\n return formatFromServer;\r\n}\r\n\r\n\r\nexport function getMomentFormat(propertyXmlNode: any) {\r\n const nodeAttributes = propertyXmlNode.attributes;\r\n const csFormat = replaceDefaultDateFormats(nodeAttributes.FormatterPattern);\r\n const momentFormat = csToMomentFormat(csFormat)\r\n if (!momentFormat) {\r\n throw new Error(T(\"CustomFormat \\\"{0}\\\" of the field named: \\\"{1}\\\", id: \\\"{2}\\\" is not valid\",\r\n \"invalid_field_format\",\r\n nodeAttributes.FormatterPattern, nodeAttributes.Name, nodeAttributes.ModelInstanceId));\r\n }\r\n return momentFormat;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { MobXProviderContext, Observer } from \"mobx-react\";\r\nimport React, { createContext, useContext, useEffect, useState } from \"react\";\r\nimport { findStopping } from \"xmlInterpreters/xmlUtils\";\r\nimport { BooleanCellDriver } from \"./Cells/BooleanCellDriver\";\r\nimport { DefaultHeaderCellDriver } from \"./Cells/HeaderCell\";\r\nimport { NumberCellDriver } from \"./Cells/NumberCellDriver\";\r\nimport { TextCellDriver } from \"./Cells/TextCellDriver\";\r\nimport { DropdownLayout, DropdownLayoutBody } from \"@origam/components\";\r\nimport { DropdownEditorApi } from \"./DropdownEditorApi\";\r\nimport { DropdownEditorBehavior } from \"./DropdownEditorBehavior\";\r\nimport { DropdownEditorBody } from \"./DropdownEditorBody\";\r\nimport { DropdownEditorControl } from \"./DropdownEditorControl\";\r\nimport { DropdownEditorData, IDropdownEditorData } from \"./DropdownEditorData\";\r\nimport { DropdownEditorLookupListCache } from \"./DropdownEditorLookupListCache\";\r\nimport { DropdownColumnDrivers, DropdownDataTable } from \"./DropdownTableModel\";\r\nimport { IDataView } from \"../../../model/entities/types/IDataView\";\r\nimport { TagInputEditorData } from \"./TagInputEditorData\";\r\nimport { IFocusable } from \"../../../model/entities/FormFocusManager\";\r\nimport { DateCellDriver } from \"./Cells/DateCellDriver\";\r\nimport { getMomentFormat } from \"../../../xmlInterpreters/getMomentFormat\";\r\n\r\nexport interface IDropdownEditorContext {\r\n behavior: DropdownEditorBehavior;\r\n editorData: IDropdownEditorData;\r\n editorDataTable: DropdownDataTable;\r\n columnDrivers: DropdownColumnDrivers;\r\n setup: DropdownEditorSetup;\r\n}\r\n\r\nexport const CtxDropdownEditor = createContext(null as any);\r\n\r\nexport class DropdownEditorSetup {\r\n constructor(\r\n public propertyId: string,\r\n public lookupId: string,\r\n public columnNames: string[],\r\n public visibleColumnNames: string[],\r\n public columnNameToIndex: Map,\r\n public showUniqueValues: boolean,\r\n public identifier: string,\r\n public identifierIndex: number,\r\n public parameters: { [key: string]: any },\r\n public dropdownType: string,\r\n public cached: boolean,\r\n public searchByFirstColumnOnly: boolean,\r\n public isLink?: boolean\r\n ) {\r\n }\r\n}\r\n\r\nexport const IGetDropdownEditorSetup = TypeSymbol<() => DropdownEditorSetup>(\r\n \"IGetDropdownEditorSetup\"\r\n);\r\n\r\nexport function DropdownEditor(props: {\r\n editor?: JSX.Element;\r\n isInvalid?: boolean;\r\n invalidMessage?: string;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customStyle?: any;\r\n}) {\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n return (\r\n \r\n {() => (\r\n \r\n props.editor ? (\r\n props.editor\r\n ) : (\r\n \r\n )\r\n }\r\n renderDropdown={() => } minSideMargin={50}/>}\r\n />\r\n )}\r\n \r\n );\r\n}\r\n\r\nexport function XmlBuildDropdownEditor(props: {\r\n xmlNode: any;\r\n isReadOnly: boolean;\r\n isInvalid?: boolean;\r\n invalidMessage?: string;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customStyle?: any;\r\n tagEditor?: JSX.Element;\r\n isLink?: boolean;\r\n autoSort?: boolean;\r\n onTextOverflowChanged?: (toolTip: string | null | undefined) => void;\r\n onDoubleClick?: (event: any) => void;\r\n onClick?: (event: any) => void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onKeyDown?(event: any): void;\r\n}) {\r\n const mobxContext = useContext(MobXProviderContext);\r\n const dataView = mobxContext.dataView as IDataView;\r\n const {dataViewRowCursor, dataViewApi, dataViewData} = dataView;\r\n const workbench = mobxContext.workbench;\r\n const {lookupListCache} = workbench;\r\n\r\n const [dropdownEditorInfrastructure] = useState(() => {\r\n const dropdownEditorApi: DropdownEditorApi = new DropdownEditorApi(\r\n () => dropdownEditorSetup,\r\n dataViewRowCursor,\r\n dataViewApi,\r\n () => dropdownEditorBehavior\r\n );\r\n const dropdownEditorData: IDropdownEditorData = props.tagEditor\r\n ? new TagInputEditorData(dataViewData, dataViewRowCursor, () => dropdownEditorSetup)\r\n : new DropdownEditorData(dataViewData, dataViewRowCursor, () => dropdownEditorSetup);\r\n const dropdownEditorDataTable = new DropdownDataTable(\r\n () => dropdownEditorSetup,\r\n dropdownEditorData\r\n );\r\n\r\n const dropdownEditorLookupListCache = new DropdownEditorLookupListCache(\r\n () => dropdownEditorSetup,\r\n lookupListCache\r\n );\r\n const dropdownEditorBehavior = new DropdownEditorBehavior(\r\n dropdownEditorApi,\r\n dropdownEditorData,\r\n dropdownEditorDataTable,\r\n () => dropdownEditorSetup,\r\n dropdownEditorLookupListCache,\r\n props.isReadOnly,\r\n props.onDoubleClick,\r\n props.onClick,\r\n props.subscribeToFocusManager,\r\n props.onKeyDown,\r\n props.autoSort,\r\n props.onTextOverflowChanged\r\n );\r\n\r\n const rat = props.xmlNode.attributes;\r\n const lookupId = rat.LookupId;\r\n const propertyId = rat.Id;\r\n const showUniqueValues = rat.DropDownShowUniqueValues === \"true\";\r\n const identifier = rat.Identifier;\r\n let identifierIndex = 0;\r\n const dropdownType = rat.DropDownType;\r\n const cached = rat.Cached === \"true\";\r\n const searchByFirstColumnOnly = rat.SearchByFirstColumnOnly === \"true\";\r\n\r\n const columnNames: string[] = [identifier];\r\n const visibleColumnNames: string[] = [];\r\n const columnNameToIndex = new Map([[identifier, identifierIndex]]);\r\n let index = 0;\r\n const drivers = new DropdownColumnDrivers();\r\n if (rat.SuppressEmptyColumns === \"true\") {\r\n drivers.driversFilter = (driver) => {\r\n return dropdownEditorDataTable.columnIdsWithNoData.indexOf(driver.columnId) < 0;\r\n };\r\n }\r\n for (let propertyXml of findStopping(props.xmlNode, (n) => n.name === \"Property\")) {\r\n index++;\r\n const attributes = propertyXml.attributes;\r\n const id = attributes.Id;\r\n columnNames.push(id);\r\n columnNameToIndex.set(id, index);\r\n\r\n const formatterPattern = attributes.FormatterPattern\r\n ? getMomentFormat(propertyXml)\r\n : \"\";\r\n visibleColumnNames.push(id);\r\n const name = attributes.Name;\r\n const column = attributes.Column;\r\n\r\n let bodyCellDriver;\r\n switch (column) {\r\n case \"Text\":\r\n bodyCellDriver = new TextCellDriver(\r\n index,\r\n dropdownEditorDataTable,\r\n dropdownEditorBehavior\r\n );\r\n break;\r\n case \"Number\":\r\n bodyCellDriver = new NumberCellDriver(\r\n index,\r\n dropdownEditorDataTable,\r\n dropdownEditorBehavior\r\n );\r\n break;\r\n case \"CheckBox\":\r\n bodyCellDriver = new BooleanCellDriver(\r\n index,\r\n dropdownEditorDataTable,\r\n dropdownEditorBehavior\r\n );\r\n break;\r\n case \"Date\":\r\n bodyCellDriver = new DateCellDriver(\r\n index,\r\n dropdownEditorDataTable,\r\n dropdownEditorBehavior,\r\n formatterPattern\r\n );\r\n break;\r\n default:\r\n throw new Error(\"Unknown column type \" + column);\r\n }\r\n\r\n drivers.allDrivers.push({\r\n columnId: id,\r\n headerCellDriver: new DefaultHeaderCellDriver(name),\r\n bodyCellDriver,\r\n });\r\n }\r\n\r\n const parameters: { [k: string]: any } = {};\r\n\r\n for (let ddp of findStopping(props.xmlNode, (n) => n.name === \"ComboBoxParameterMapping\")) {\r\n const pat = ddp.attributes;\r\n parameters[pat.ParameterName] = pat.FieldName;\r\n }\r\n\r\n const dropdownEditorSetup = new DropdownEditorSetup(\r\n propertyId,\r\n lookupId,\r\n columnNames,\r\n visibleColumnNames,\r\n columnNameToIndex,\r\n showUniqueValues,\r\n identifier,\r\n identifierIndex,\r\n parameters,\r\n dropdownType,\r\n cached,\r\n searchByFirstColumnOnly\r\n );\r\n\r\n return {\r\n behavior: dropdownEditorBehavior,\r\n editorData: dropdownEditorData,\r\n columnDrivers: drivers,\r\n editorDataTable: dropdownEditorDataTable,\r\n setup: dropdownEditorSetup,\r\n };\r\n });\r\n\r\n useEffect(() => {\r\n dropdownEditorInfrastructure.behavior.isReadOnly = props.isReadOnly;\r\n\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [props.isReadOnly, dropdownEditorInfrastructure.behavior.isReadOnly]\r\n );\r\n\r\n dropdownEditorInfrastructure.behavior.onClick = props.onClick;\r\n dropdownEditorInfrastructure.behavior.onDoubleClick = props.onDoubleClick;\r\n dropdownEditorInfrastructure.setup.isLink = props.isLink;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useContext } from \"react\";\r\nimport S from \"./TagInput.module.css\";\r\nimport { CtxDropdownEditor } from \"../../../modules/Editors/DropdownEditor/DropdownEditor\";\r\n\r\nexport const TagInput: React.FC<{ className?: string }> = (props) => {\r\n return (\r\n
\r\n {props.children}\r\n
\r\n );\r\n};\r\n\r\nexport const TagInputAdd: React.FC<{\r\n domRef?: any;\r\n className?: string;\r\n onClick: (event: any) => void;\r\n onMouseDown?: (event: any) => void;\r\n}> = (props) => {\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n\r\n function onClick(event: any) {\r\n beh.handleInputBtnClick(event);\r\n props.onClick(event);\r\n }\r\n\r\n return (\r\n onClick(event)}\r\n onMouseDown={props.onMouseDown}\r\n ref={props.domRef}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\nexport const TagInputItemDelete: React.FC<{\r\n onClick?: (event: any) => void;\r\n className?: string;\r\n}> = (props) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const TagInputItem: React.FC<{ className?: string }> = (props) => {\r\n return (\r\n
\r\n {props.children}\r\n
\r\n );\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useContext, useEffect, useMemo, useRef, useState } from \"react\";\r\n\r\nimport CS from \"./CommonStyle.module.css\";\r\nimport S from \"./TagInputEditor.module.css\";\r\n\r\nimport { TagInput, TagInputAdd, TagInputItem, TagInputItemDelete, } from \"gui/Components/TagInput/TagInput\";\r\nimport { inject, observer } from \"mobx-react\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { CtxDropdownEditor } from \"modules/Editors/DropdownEditor/DropdownEditor\";\r\nimport { CtxDropdownRefCtrl } from \"@origam/components\";\r\n\r\nexport const TagInputEditor = inject(({property}: { property: IProperty }, {value}) => {\r\n const dataTable = getDataTable(property);\r\n return {\r\n textualValues: value?.map((valueItem: any) => dataTable.resolveCellText(property, valueItem)),\r\n };\r\n})(\r\n observer(\r\n (props: {\r\n value: string[];\r\n textualValues?: string[];\r\n isReadOnly: boolean;\r\n isInvalid: boolean;\r\n invalidMessage?: string;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n customStyle?: any;\r\n onChange?(event: any, value: string[]): void;\r\n onKeyDown?(event: any): void;\r\n onClick?(event: any): void;\r\n onDoubleClick?(event: any): void;\r\n onEditorBlur?(event: any): void;\r\n customInputClass?: string;\r\n autoFocus?: boolean;\r\n id?: string;\r\n }) => {\r\n const beh = useContext(CtxDropdownEditor).behavior;\r\n const ref = useContext(CtxDropdownRefCtrl);\r\n const data = useContext(CtxDropdownEditor).editorData;\r\n\r\n const value = Array.isArray(props.value) ? [...props.value] : props.value;\r\n data.setValue(value);\r\n\r\n function getStyle() {\r\n if (props.customStyle) {\r\n return props.customStyle;\r\n } else {\r\n return {\r\n color: props.foregroundColor,\r\n backgroundColor: props.backgroundColor,\r\n };\r\n }\r\n }\r\n\r\n function removeItem(event: any, item: string) {\r\n if (props.isReadOnly) {\r\n return;\r\n }\r\n const index = value.indexOf(item);\r\n if (index > -1) {\r\n const removedItem = value.splice(index, 1)[0];\r\n if (props.onChange) {\r\n props.onChange(event, value);\r\n }\r\n if (props.onEditorBlur) {\r\n props.onEditorBlur(event);\r\n }\r\n data.remove(removedItem);\r\n }\r\n }\r\n\r\n const [inputElement, setInputElement] = useState(undefined);\r\n\r\n const refInput = useMemo(() => {\r\n return (elm: any) => {\r\n beh.refInputElement(elm);\r\n setInputElement(elm);\r\n };\r\n }, [beh]);\r\n\r\n useEffect(() => {\r\n if (beh.subscribeToFocusManager && beh.elmInputElement) {\r\n beh.subscribeToFocusManager(beh.elmInputElement);\r\n }\r\n if (props.autoFocus) {\r\n setTimeout(() => inputElement?.focus());\r\n }\r\n }, [beh, inputElement, props.autoFocus]);\r\n\r\n const previousValueRef = useRef();\r\n\r\n useEffect(() => {\r\n if (previousValueRef.current?.length !== value?.length) {\r\n beh.elmInputElement.value = \"\";\r\n }\r\n previousValueRef.current = value;\r\n }, [ // eslint-disable-line react-hooks/exhaustive-deps\r\n previousValueRef.current,\r\n previousValueRef.current?.length, // eslint-disable-line react-hooks/exhaustive-deps\r\n value,\r\n value?.length, // eslint-disable-line react-hooks/exhaustive-deps\r\n beh.elmInputElement?.value, // eslint-disable-line react-hooks/exhaustive-deps\r\n ]);\r\n\r\n function handleInputKeyDown(event: any) {\r\n if (event.key === \"Backspace\" && event.target.value === \"\" && value.length > 0) {\r\n removeItem(event, value[value.length - 1]);\r\n }\r\n beh.handleInputKeyDown(event);\r\n }\r\n\r\n return (\r\n
\r\n \r\n {value\r\n ? value.map((valueItem, idx) => (\r\n \r\n {\r\n removeItem(event, valueItem);\r\n }}\r\n />\r\n {props.textualValues![idx] || \"\"}\r\n \r\n ))\r\n : null}\r\n {props.isReadOnly ? null : (\r\n beh.elmInputElement.focus()}/>\r\n )}\r\n \r\n \r\n {props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n )\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport { useCallback, useEffect, useState } from \"react\";\r\nimport S from \"./TextEditor.module.scss\";\r\nimport { IFocusable } from \"../../../../model/entities/FormFocusManager\";\r\n\r\nimport { ContentState, convertToRaw, EditorState } from \"draft-js\";\r\nimport { Editor } from \"react-draft-wysiwyg\";\r\nimport draftToHtml from \"draftjs-to-html\";\r\nimport htmlToDraft from \"html-to-draftjs\";\r\n\r\nimport \"react-draft-wysiwyg/dist/react-draft-wysiwyg.css\";\r\n\r\nconst autoUpdateUntervalMs = 60_000;\r\n\r\n@observer\r\nexport class TextEditor extends React.Component<{\r\n id?: string;\r\n value: string | null;\r\n isMultiline?: boolean;\r\n isReadOnly: boolean;\r\n isPassword?: boolean;\r\n isInvalid: boolean;\r\n invalidMessage?: string;\r\n backgroundColor?: string;\r\n foregroundColor?: string;\r\n maxLength?: number;\r\n isRichText: boolean;\r\n customStyle?: any;\r\n wrapText: boolean;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onChange?(event: any, value: string): void;\r\n onKeyDown?(event: any): void;\r\n onClick?(event: any): void;\r\n onDoubleClick?(event: any): void;\r\n onEditorBlur?(event: any): void;\r\n onAutoUpdate?(value: string): void;\r\n onTextOverflowChanged?: (toolTip: string | null | undefined) => void;\r\n}> {\r\n disposers: any[] = [];\r\n currentValue = this.props.value;\r\n lastAutoUpdatedValue = this.props.value;\r\n updateInterval: NodeJS.Timeout | undefined;\r\n\r\n componentDidMount() {\r\n if (this.props.isMultiline) {\r\n this.disposers.push(this.startAutoUpdate());\r\n }\r\n this.updateTextOverflowState();\r\n }\r\n\r\n componentDidUpdate() {\r\n this.updateTextOverflowState();\r\n }\r\n\r\n private updateTextOverflowState() {\r\n if (this.props.isMultiline) {\r\n return;\r\n }\r\n const textOverflow = this.elmInput.offsetWidth < this.elmInput.scrollWidth\r\n this.props.onTextOverflowChanged?.(textOverflow ? this.props.value : undefined);\r\n }\r\n\r\n private startAutoUpdate() {\r\n this.updateInterval = setInterval(() => {\r\n if (this.lastAutoUpdatedValue !== this.currentValue) {\r\n this.props.onAutoUpdate?.(this.currentValue ?? \"\");\r\n this.lastAutoUpdatedValue = this.currentValue;\r\n }\r\n }, autoUpdateUntervalMs);\r\n return () => this.updateInterval && clearTimeout(this.updateInterval);\r\n }\r\n\r\n componentWillUnmount() {\r\n this.disposers.forEach((d) => d());\r\n }\r\n\r\n @action.bound\r\n handleFocus(event: any) {\r\n if (this.elmInput) {\r\n const isNotMemoField = this.props.maxLength && this.props.maxLength > 0;\r\n if (isNotMemoField) {\r\n this.elmInput.select();\r\n }\r\n this.elmInput.scrollLeft = 0;\r\n }\r\n }\r\n\r\n elmInput: any = null;\r\n refInput = (elm: any) => {\r\n this.elmInput = elm;\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n };\r\n\r\n getStyle() {\r\n if (this.props.customStyle) {\r\n return this.props.customStyle;\r\n } else {\r\n return {\r\n color: this.props.foregroundColor,\r\n backgroundColor: this.props.backgroundColor,\r\n };\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n {this.renderValueTag()}\r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n\r\n getMultilineDivClass() {\r\n if (this.props.wrapText) {\r\n return S.input + \" \" + S.wrapText;\r\n }\r\n return S.input + \" \" + (isMultiLine(this.props.value) ? S.scrollY : S.noScrollY);\r\n }\r\n\r\n private renderValueTag() {\r\n const maxLength = this.props.maxLength === 0 ? undefined : this.props.maxLength;\r\n if (this.props.isRichText) {\r\n if (this.props.isReadOnly) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n } else {\r\n return (\r\n {\r\n this.currentValue = newValue;\r\n this.props.onChange?.(undefined, newValue);\r\n }}\r\n refInput={this.refInput}\r\n onBlur={this.props.onEditorBlur}\r\n onFocus={this.handleFocus}\r\n />\r\n );\r\n }\r\n }\r\n if (!this.props.isMultiline) {\r\n return (\r\n {\r\n this.props.onChange && this.props.onChange(event, event.target.value)\r\n this.updateTextOverflowState();\r\n }\r\n }\r\n onKeyDown={this.props.onKeyDown}\r\n onClick={this.props.onClick}\r\n onDoubleClick={this.props.onDoubleClick}\r\n onBlur={this.props.onEditorBlur}\r\n onFocus={this.handleFocus}\r\n />\r\n );\r\n }\r\n if (this.props.isReadOnly) {\r\n return (\r\n \r\n \r\n {this.props.value || \"\"}\r\n \r\n \r\n );\r\n } else {\r\n return (\r\n {\r\n this.currentValue = event.target.value;\r\n this.props.onChange && this.props.onChange(event, event.target.value);\r\n }}\r\n onKeyDown={this.props.onKeyDown}\r\n onDoubleClick={this.props.onDoubleClick}\r\n onClick={this.props.onClick}\r\n onBlur={this.props.onEditorBlur}\r\n onFocus={this.handleFocus}\r\n />\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction isMultiLine(text: string | null) {\r\n if (text === null || text === undefined) {\r\n return false;\r\n }\r\n return text.includes(\"\\n\") || text.includes(\"\\r\");\r\n}\r\n\r\nfunction RichTextEditor(props: {\r\n value: any;\r\n onChange?: (newValue: any) => void;\r\n onBlur?: (event: any) => void;\r\n onFocus?: (event: any) => void;\r\n refInput?: (elm: any) => void;\r\n}) {\r\n const [internalEditorState, setInternalEditorState] = useState(() => EditorState.createEmpty());\r\n const [internalEditorStateHtml, setInternalEditorStateHtml] = useState(\"\");\r\n\r\n\r\n const onEditorStateChange = useCallback(\r\n (newEditorState: any) => {\r\n setInternalEditorState(newEditorState);\r\n const html = draftToHtml(convertToRaw(newEditorState.getCurrentContent()));\r\n setInternalEditorStateHtml(html);\r\n props.onChange?.(html);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [setInternalEditorState, setInternalEditorStateHtml, props.onChange]\r\n );\r\n\r\n useEffect(() => {\r\n if (props.refInput) {\r\n props.refInput(document.querySelector(\"[role='textbox']\"));\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (props.value !== internalEditorStateHtml) {\r\n const blocksFromHtml = htmlToDraft(props.value);\r\n const {contentBlocks, entityMap} = blocksFromHtml;\r\n const contentState = ContentState.createFromBlockArray(contentBlocks, entityMap);\r\n const editorState = EditorState.createWithContent(contentState);\r\n setInternalEditorStateHtml(props.value);\r\n setInternalEditorState(editorState);\r\n }\r\n }, [props.value, internalEditorStateHtml]);\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flushCurrentRowData } from \"../../../actions/DataView/TableView/flushCurrentRowData\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { crs_fieldBlur_ActionClick } from \"model/actions/actionSync\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function onFieldBlur(ctx: any) {\r\n return flow(function*onFieldBlur(event: any) {\r\n try {\r\n yield*crs_fieldBlur_ActionClick.runGenerator(function*() {\r\n yield*flushCurrentRowData(ctx)();\r\n getGridFocusManager(ctx).focusEditor();\r\n });\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport * as React from \"react\";\r\nimport { observer } from \"mobx-react\";\r\nimport S from \"./BoolEditor.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { IFocusable } from \"../../../../model/entities/FormFocusManager\";\r\nimport CS from \"gui/Components/ScreenElements/Editors/CommonStyle.module.css\";\r\n\r\n@observer\r\nexport class BoolEditor extends React.Component<{\r\n value: boolean;\r\n isReadOnly: boolean;\r\n readOnlyNoGrey?: boolean;\r\n onChange?(event: any, value: boolean): void;\r\n onKeyDown?(event: any): void;\r\n onClick?(event: any): void;\r\n onBlur?: () => void;\r\n onFocus?: () => void;\r\n isInvalid: boolean;\r\n invalidMessage?: string;\r\n id?: string;\r\n forceTakeFocus?: boolean;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n}> {\r\n elmInput: HTMLInputElement | null = null;\r\n refInput = (elm: HTMLInputElement | any) => {\r\n this.elmInput = elm;\r\n };\r\n\r\n componentDidMount() {\r\n if (this.props.forceTakeFocus) {\r\n this.elmInput?.focus();\r\n }\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n {\r\n this.props.onChange &&\r\n !this.props.isReadOnly &&\r\n this.props.onChange(event, event.target.checked);\r\n }}\r\n onKeyDown={this.props.onKeyDown}\r\n onClick={this.props.onClick}\r\n onBlur={this.props.onBlur}\r\n onFocus={this.props.onFocus}\r\n ref={this.refInput}\r\n tabIndex={0}\r\n />\r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport moment from \"moment\";\r\nimport { DateSequence } from \"../../../../utils/cookies\";\r\n\r\nexport default class DateCompleter {\r\n dateSequence: DateSequence;\r\n expectedFormat: string;\r\n dateSeparator: string;\r\n timeSeparator: string;\r\n dateTimeSeparator: string;\r\n expectedDateFormat: string;\r\n timeNowFunc: () => moment.Moment;\r\n\r\n constructor(\r\n dateSequence: DateSequence,\r\n expectedFormat: string,\r\n dateSeparator: string,\r\n timeSeparator: string,\r\n dateTimeSeparator: string,\r\n timeNowFunc: () => moment.Moment\r\n ) {\r\n this.expectedFormat = expectedFormat;\r\n this.dateSeparator = dateSeparator;\r\n this.timeSeparator = timeSeparator;\r\n this.dateTimeSeparator = dateTimeSeparator;\r\n this.expectedDateFormat = this.expectedFormat.split(this.dateTimeSeparator)[0];\r\n this.timeNowFunc = timeNowFunc;\r\n this.dateSequence = dateSequence;\r\n }\r\n\r\n isUSCompletionTriggered(datetimeTextIn: string) {\r\n const t = datetimeTextIn;\r\n return (\r\n t.match(/^\\d\\d?\\d?$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\s+\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d?\\s+\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d\\d\\d\\s+\\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d?\\/\\d\\d?$/) ||\r\n t.match(/^\\d\\d?\\/\\d\\d?\\s+\\d\\d?$/) ||\r\n t.match(/^\\d\\d?\\/\\d\\d?\\s+\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d?\\/\\d\\d?\\s+\\d\\d:\\d\\d$/) ||\r\n t.match(/^\\d\\d?\\/\\d\\d?\\/\\d\\d?$/)\r\n );\r\n }\r\n\r\n isEUCompletionTriggered(datetimeTextIn: string) {\r\n const t = datetimeTextIn;\r\n return (\r\n t.match(/^\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\s+\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\s+\\d\\d$/) ||\r\n t.match(/^\\d\\d\\d\\d\\d\\d\\d\\d \\d\\d\\d\\d\\d\\d$/) ||\r\n t.match(/^\\d\\d?$/)\r\n );\r\n }\r\n\r\n autoComplete(text: string | undefined): moment.Moment | undefined {\r\n if (!text) {\r\n return undefined;\r\n }\r\n const trimmedText = text.trim();\r\n if (this.dateSequence === DateSequence.MonthDayYear) {\r\n if (!this.isUSCompletionTriggered(trimmedText)) return;\r\n } else {\r\n if (!this.isEUCompletionTriggered(trimmedText)) return;\r\n }\r\n const dateAndTime = trimmedText.split(this.dateTimeSeparator);\r\n const dateText = dateAndTime[0];\r\n let completeDate = this.autoCompleteDate(dateText);\r\n\r\n if (dateAndTime.length === 2) {\r\n const timeText = dateAndTime[1];\r\n const completeTime = this.autoCompleteTime(timeText);\r\n completeDate += this.dateTimeSeparator + completeTime;\r\n }\r\n return moment(completeDate, this.expectedFormat);\r\n }\r\n\r\n reformat(completeDateTime: string) {\r\n const dateTime = moment(completeDateTime, this.expectedFormat);\r\n if (dateTime.hour() === 0 && dateTime.minute() === 0 && dateTime.second() === 0) {\r\n return dateTime.format(this.expectedDateFormat);\r\n }\r\n return dateTime.format(this.expectedFormat);\r\n }\r\n\r\n autoCompleteTime(incompleteTime: string): string {\r\n if (incompleteTime.includes(this.timeSeparator)) {\r\n return this.completeTimeWithSeparators(incompleteTime);\r\n }\r\n return this.completeTimeWithoutSeparators(incompleteTime);\r\n }\r\n\r\n completeTimeWithoutSeparators(incompleteTime: string): string {\r\n switch (incompleteTime.length) {\r\n case 1:\r\n case 2:\r\n return incompleteTime + this.timeSeparator + \"00\" + this.timeSeparator + \"00\";\r\n case 3:\r\n case 4:\r\n return (\r\n incompleteTime.substring(0, 2) +\r\n this.timeSeparator +\r\n incompleteTime.substring(2) +\r\n this.timeSeparator +\r\n \"00\"\r\n );\r\n default:\r\n return (\r\n incompleteTime.substring(0, 2) +\r\n this.timeSeparator +\r\n incompleteTime.substring(2, 4) +\r\n this.timeSeparator +\r\n incompleteTime.substring(4)\r\n );\r\n }\r\n }\r\n\r\n completeTimeWithSeparators(incompleteTime: string): string {\r\n const splitTime = incompleteTime.split(this.timeSeparator);\r\n if (splitTime.length === 2) {\r\n return moment([2010, 1, 1, splitTime[0], splitTime[1], 0, 0]).format(\"hh:mm:ss A\");\r\n }\r\n if (splitTime.length === 3) {\r\n return moment([2010, 1, 1, splitTime[0], splitTime[1], splitTime[2], 0]).format(\"hh:mm:ss A\");\r\n }\r\n return incompleteTime;\r\n }\r\n\r\n autoCompleteDate(incompleteDate: string): string {\r\n return incompleteDate.includes(this.dateSeparator)\r\n ? this.completeDateWithSeparators(incompleteDate)\r\n : this.completeDateWithoutSeparators(incompleteDate);\r\n }\r\n\r\n completeDateWithSeparators(incompleteDate: string): string {\r\n const splitDate = incompleteDate.split(this.dateSeparator);\r\n if (splitDate.length === 2) {\r\n return incompleteDate + this.dateSeparator + this.timeNowFunc().year();\r\n } else {\r\n return incompleteDate;\r\n }\r\n }\r\n\r\n completeDateWithoutSeparators(incompleteDate: string): string {\r\n switch (incompleteDate.length) {\r\n case 1:\r\n case 2: {\r\n // assuming input is always a day.\r\n return this.addMonthAndYear(incompleteDate);\r\n }\r\n case 3:\r\n case 4: {\r\n // assuming input is day and month in order specified by\r\n // current culture\r\n return this.addYear(incompleteDate);\r\n }\r\n case 6: {\r\n // assuming input is day and month in order specified by\r\n // current culture followed by incomplete year (yy)\r\n const incompleteWithSeparators = this.addSeparators(incompleteDate);\r\n return incompleteWithSeparators;\r\n }\r\n default:\r\n return this.addSeparators(incompleteDate);\r\n }\r\n }\r\n\r\n addMonthAndYear(day: string): string {\r\n const now = this.timeNowFunc();\r\n const usDateString = now.month() + 1 + \"/\" + day + \"/\" + now.year();\r\n\r\n const date = moment(usDateString, \"M/D/YYYY\");\r\n\r\n return date ? date.format(this.expectedDateFormat) : day;\r\n }\r\n\r\n addYear(dayAndMonth: string): string {\r\n return (\r\n dayAndMonth.substring(0, 2) +\r\n this.dateSeparator +\r\n dayAndMonth.substring(2) +\r\n this.dateSeparator +\r\n this.timeNowFunc().year()\r\n );\r\n }\r\n\r\n addSeparators(incompleteDate: string): string {\r\n const format = this.getDoubleDayAndMonthFormat();\r\n\r\n const firstIndex = format.indexOf(this.dateSeparator);\r\n const secondIndex = format.lastIndexOf(this.dateSeparator);\r\n const dateLength = incompleteDate.length;\r\n\r\n if (firstIndex < dateLength && secondIndex >= dateLength) {\r\n return (\r\n incompleteDate.substring(0, firstIndex) +\r\n this.dateSeparator +\r\n incompleteDate.substring(firstIndex)\r\n );\r\n }\r\n if (firstIndex < dateLength && secondIndex < dateLength) {\r\n return (\r\n incompleteDate.substring(0, firstIndex) +\r\n this.dateSeparator +\r\n incompleteDate.substring(firstIndex, firstIndex + 2) +\r\n this.dateSeparator +\r\n incompleteDate.substring(secondIndex - 1)\r\n );\r\n }\r\n return incompleteDate;\r\n }\r\n\r\n getDoubleDayAndMonthFormat(): string {\r\n // dateFormat might be d/m/yyyy, this,\r\n // method makes sure we get dd/mm/yyyy\r\n const formatHasSingleDigitDayAndMonth = this.expectedDateFormat.length === 8;\r\n let format;\r\n if (formatHasSingleDigitDayAndMonth) {\r\n format = this.expectedFormat.toLowerCase().replace(\"d\", \"dd\").replace(\"m\", \"mm\");\r\n } else {\r\n format = this.expectedFormat;\r\n }\r\n return format;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport cx from \"classnames\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { action, computed, observable, runInAction } from \"mobx\";\r\nimport { observer, Observer } from \"mobx-react\";\r\nimport moment, { Moment } from \"moment\";\r\nimport * as React from \"react\";\r\nimport { toOrigamServerString } from \"@origam/utils\";\r\nimport { IFocusable } from \"../../../../model/entities/FormFocusManager\";\r\nimport { getDefaultCsDateFormatDataFromCookie } from \"../../../../utils/cookies\";\r\nimport DateCompleter from \"./DateCompleter\";\r\nimport S from \"./DateTimeEditor.module.scss\";\r\nimport { createPortal } from \"react-dom\";\r\n\r\n@observer\r\nclass CalendarWidget extends React.Component<{\r\n initialDisplayDate?: moment.Moment;\r\n selectedDay?: moment.Moment;\r\n onDayClick?(event: any, day: moment.Moment): void;\r\n}> {\r\n @observable.ref displayedMonth = moment(this.props.initialDisplayDate).startOf(\"month\");\r\n\r\n getDayHeaders() {\r\n const result: any[] = [];\r\n for (\r\n let day = moment(this.displayedMonth).startOf(\"week\"), i = 0;\r\n i < 7;\r\n day.add({days: 1}), i++\r\n ) {\r\n result.push(\r\n \r\n {day.format(\"dd\")[0]}\r\n \r\n );\r\n }\r\n return result;\r\n }\r\n\r\n getDates(weekInc: number) {\r\n const result: any[] = [];\r\n const today = moment();\r\n for (\r\n let day = moment(this.displayedMonth).startOf(\"week\").add({weeks: weekInc}), i = 0;\r\n i < 7;\r\n day.add({days: 1}), i++\r\n ) {\r\n const isNeighbourMonth = day.month() !== this.displayedMonth.month();\r\n const isSelectedDay = day.isSame(this.props.selectedDay, \"day\");\r\n const isToday = day.isSame(today, \"days\");\r\n const dayCopy = moment(day);\r\n result.push(\r\n this.handleDayClick(event, dayCopy)}\r\n >\r\n {day.format(\"D\")}\r\n \r\n );\r\n }\r\n return result;\r\n }\r\n\r\n getDateRows() {\r\n const result: any[] = [];\r\n for (let i = 0; i < 6; i++) {\r\n result.push(
{this.getDates(i)}
);\r\n }\r\n return result;\r\n }\r\n\r\n @action.bound\r\n handleMonthDecClick(event: any) {\r\n this.displayedMonth = moment(this.displayedMonth).subtract({months: 1});\r\n }\r\n\r\n @action.bound\r\n handleMonthIncClick(event: any) {\r\n this.displayedMonth = moment(this.displayedMonth).add({months: 1});\r\n }\r\n\r\n @action.bound\r\n handleYearDecClick(event: any) {\r\n this.displayedMonth = moment(this.displayedMonth).subtract({years: 1});\r\n }\r\n\r\n @action.bound\r\n handleYearIncClick(event: any) {\r\n this.displayedMonth = moment(this.displayedMonth).add({years: 1});\r\n }\r\n\r\n @action.bound handleDayClick(event: any, day: moment.Moment) {\r\n this.props.onDayClick && this.props.onDayClick(event, day);\r\n }\r\n\r\n render() {\r\n return (\r\n {\r\n /* Prevent mousedown default action causong onblur being fired on the editors input\r\n which triggered data update\r\n */\r\n e.preventDefault();\r\n }}\r\n >\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n {this.displayedMonth.format(\"YYYY MMMM\")}\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
{this.getDayHeaders()}
\r\n {this.getDateRows()}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class DateTimeEditor extends React.Component<{\r\n id?: string;\r\n value: string | null;\r\n outputFormat: string;\r\n outputFormatToShow: string;\r\n isReadOnly?: boolean;\r\n isInvalid?: boolean;\r\n invalidMessage?: string;\r\n autoFocus?: boolean;\r\n foregroundColor?: string;\r\n backgroundColor?: string;\r\n onChange?: (event: any, isoDay: string | undefined | null) => void;\r\n onChangeByCalendar?: (event: any, isoDay: string) => void;\r\n onClick?: (event: any) => void;\r\n onDoubleClick?: (event: any) => void;\r\n onKeyDown?: (event: any) => void;\r\n onEditorBlur?: (event: any) => void;\r\n refocuser?: (cb: () => void) => () => void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n}> {\r\n @observable isDroppedDown = false;\r\n\r\n @observable isShowFormatHintTooltip = false;\r\n\r\n refDropdowner = (elm: Dropdowner | null) => (this.elmDropdowner = elm);\r\n elmDropdowner: Dropdowner | null = null;\r\n\r\n @action.bound handleDropperClick(event: any) {\r\n event.stopPropagation();\r\n this.makeDroppedDown();\r\n }\r\n\r\n @action.bound makeDroppedDown() {\r\n if (!this.isDroppedDown) {\r\n this.isDroppedDown = true;\r\n window.addEventListener(\"click\", this.handleWindowClick);\r\n }\r\n }\r\n\r\n @action.bound makeDroppedUp() {\r\n if (this.isDroppedDown) {\r\n this.isDroppedDown = false;\r\n window.removeEventListener(\"click\", this.handleWindowClick);\r\n }\r\n }\r\n\r\n @action.bound handleWindowClick(event: any) {\r\n if (this.elmContainer && !this.elmContainer.contains(event.target)) {\r\n this.makeDroppedUp();\r\n }\r\n }\r\n\r\n disposers: any[] = [];\r\n\r\n componentDidMount() {\r\n this.makeFocusedIfNeeded();\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.disposers.forEach((d) => d());\r\n }\r\n\r\n componentDidUpdate(prevProps: { value: string | null }) {\r\n runInAction(() => {\r\n if (prevProps.value !== null && this.props.value === null) {\r\n this.dirtyTextualValue = \"\";\r\n }\r\n });\r\n }\r\n\r\n @action.bound\r\n makeFocusedIfNeeded() {\r\n setTimeout(() => {\r\n if ((this.props.autoFocus) && this.elmInput) {\r\n this.elmInput.select();\r\n this.elmInput.focus();\r\n this.elmInput.scrollLeft = 0;\r\n }\r\n });\r\n }\r\n\r\n _hLocationInterval: any;\r\n\r\n @action.bound\r\n handleWindowMouseWheel(e: any) {\r\n this.setShowFormatHint(false);\r\n }\r\n\r\n @action.bound\r\n setShowFormatHint(state: boolean) {\r\n if (state && !this.isShowFormatHintTooltip) {\r\n this.measureInputElement();\r\n this._hLocationInterval = setInterval(() => this.measureInputElement(), 500);\r\n window.addEventListener(\"mousewheel\", this.handleWindowMouseWheel);\r\n } else if (!state && this.isShowFormatHintTooltip) {\r\n clearInterval(this._hLocationInterval);\r\n window.removeEventListener(\"mousewheel\", this.handleWindowMouseWheel);\r\n }\r\n this.isShowFormatHintTooltip = state;\r\n }\r\n\r\n @action.bound handleInputBlur(event: any) {\r\n this.setShowFormatHint(false);\r\n const dateCompleter = this.getDateCompleter();\r\n const completedMoment = dateCompleter.autoComplete(this.dirtyTextualValue);\r\n if (completedMoment) {\r\n this.props.onChange?.(event, toOrigamServerString(completedMoment));\r\n } else if (this.momentValue?.isValid()) {\r\n this.props.onChange?.(event, toOrigamServerString(this.momentValue));\r\n }\r\n\r\n this.dirtyTextualValue = undefined;\r\n this.props.onEditorBlur && this.props.onEditorBlur(event);\r\n }\r\n\r\n private get autoCompletedMoment() {\r\n const dateCompleter = this.getDateCompleter();\r\n return dateCompleter.autoComplete(this.dirtyTextualValue);\r\n }\r\n\r\n private get autocompletedText() {\r\n const completedMoment = this.autoCompletedMoment;\r\n if (completedMoment) {\r\n if (this.autoCompletedMoment?.isValid()) {\r\n return this.formatMomentValue(this.autoCompletedMoment);\r\n } else return \"?\";\r\n } else {\r\n if (this.momentValue?.isValid()) {\r\n return this.formatMomentValue(this.momentValue);\r\n } else return \"?\";\r\n }\r\n }\r\n\r\n @action.bound handleKeyDown(event: any) {\r\n if (event.key === \"Enter\" || event.key === \"Tab\") {\r\n const completedMoment = this.autoCompletedMoment;\r\n if (completedMoment) {\r\n this.props.onChange?.(event, toOrigamServerString(completedMoment));\r\n } else if (this.momentValue?.isValid()) {\r\n this.props.onChange?.(event, toOrigamServerString(this.momentValue));\r\n }\r\n this.dirtyTextualValue = undefined;\r\n } else if (event.key === \"Escape\") {\r\n this.setShowFormatHint(false);\r\n }\r\n this.props.onKeyDown?.(event);\r\n }\r\n\r\n @action.bound getDateCompleter() {\r\n const formatData = getDefaultCsDateFormatDataFromCookie();\r\n return new DateCompleter(\r\n formatData.defaultDateSequence,\r\n this.props.outputFormat,\r\n formatData.defaultDateSeparator,\r\n formatData.defaultTimeSeparator,\r\n formatData.defaultDateTimeSeparator,\r\n () => moment()\r\n );\r\n }\r\n\r\n @action.bound handleContainerMouseDown(event: any) {\r\n setTimeout(() => {\r\n this.elmInput?.focus();\r\n }, 30);\r\n }\r\n\r\n refContainer = (elm: HTMLDivElement | null) => (this.elmContainer = elm);\r\n elmContainer: HTMLDivElement | null = null;\r\n refInput = (elm: HTMLInputElement | null) => {\r\n this.elmInput = elm;\r\n };\r\n @observable inputRect: any;\r\n elmInput: HTMLInputElement | null = null;\r\n\r\n @action.bound\r\n measureInputElement() {\r\n if (this.elmInput) {\r\n this.inputRect = this.elmInput.getBoundingClientRect();\r\n } else {\r\n this.inputRect = undefined;\r\n }\r\n }\r\n\r\n @observable dirtyTextualValue: string | undefined;\r\n\r\n get momentValue() {\r\n if (this.dirtyTextualValue) {\r\n return moment(this.dirtyTextualValue, this.props.outputFormat);\r\n }\r\n return !!this.props.value ? moment(this.props.value) : null;\r\n }\r\n\r\n formatMomentValue(value: Moment | null | undefined) {\r\n if (!value) return \"\";\r\n // if (value.hour() === 0 && value.minute() === 0 && value.second() === 0) {\r\n // const expectedDateFormat = this.props.outputFormat.split(\" \")[0];\r\n // return value.format(expectedDateFormat);\r\n // }\r\n return value.format(this.props.outputFormat);\r\n }\r\n\r\n get formattedMomentValue() {\r\n return this.formatMomentValue(this.momentValue);\r\n }\r\n\r\n @computed get textfieldValue() {\r\n return this.dirtyTextualValue !== undefined && this.dirtyTextualValue !== \"\"\r\n ? this.dirtyTextualValue\r\n : this.formattedMomentValue;\r\n }\r\n\r\n @computed get isTooltipShown() {\r\n return (\r\n this.textfieldValue !== undefined &&\r\n (!moment(this.textfieldValue, this.props.outputFormat) ||\r\n this.formattedMomentValue !== this.textfieldValue)\r\n );\r\n }\r\n\r\n @action.bound handleTextfieldChange(event: any) {\r\n this.setShowFormatHint(true);\r\n this.dirtyTextualValue = event.target.value;\r\n if (this.dirtyTextualValue === \"\") {\r\n this.props.onChange && this.props.onChange(event, null);\r\n return;\r\n }\r\n }\r\n\r\n @action.bound handleDayClick(event: any, day: moment.Moment) {\r\n this.elmDropdowner && this.elmDropdowner.setDropped(false);\r\n this.dirtyTextualValue = undefined;\r\n this.props.onChangeByCalendar && this.props.onChangeByCalendar(event, day.toISOString(true));\r\n this.props.onChange && this.props.onChange(event, toOrigamServerString(day));\r\n }\r\n\r\n @action.bound\r\n handleFocus(event: any) {\r\n if (this.elmInput) {\r\n this.elmInput.select();\r\n this.elmInput.scrollLeft = 0;\r\n }\r\n }\r\n\r\n customFormatContainsDate() {\r\n return (\r\n this.props.outputFormat.includes(\"D\") ||\r\n this.props.outputFormat.includes(\"M\") ||\r\n this.props.outputFormat.includes(\"Y\")\r\n );\r\n }\r\n\r\n renderWithCalendarWidget() {\r\n return (\r\n (\r\n \r\n \r\n {() => (\r\n <>\r\n {this.isShowFormatHintTooltip && (\r\n \r\n )}\r\n {\r\n this.refInput(elm);\r\n }}\r\n value={this.textfieldValue}\r\n readOnly={this.props.isReadOnly}\r\n onChange={this.handleTextfieldChange}\r\n onClick={this.props.onClick}\r\n onDoubleClick={this.props.onDoubleClick}\r\n onKeyDown={this.handleKeyDown}\r\n />\r\n \r\n )}\r\n \r\n\r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n {!this.props.isReadOnly && (\r\n setDropped(true)}\r\n ref={refTrigger}\r\n >\r\n \r\n \r\n )}\r\n \r\n )}\r\n content={() => (\r\n
\r\n \r\n
\r\n )}\r\n />\r\n );\r\n }\r\n\r\n renderInputFieldOnly() {\r\n return (\r\n \r\n \r\n {this.props.isInvalid && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n );\r\n }\r\n\r\n render() {\r\n if (!this.props.outputFormat || this.customFormatContainsDate()) {\r\n return this.renderWithCalendarWidget();\r\n } else {\r\n return this.renderInputFieldOnly();\r\n }\r\n }\r\n}\r\n\r\nfunction FormatHintTooltip(props: { boundingRect?: any; line1?: string; line2?: string }) {\r\n const [tooltipHeight, setTooltipHeight] = React.useState(0);\r\n\r\n function refTooltip(elm: any) {\r\n if (elm) {\r\n setTooltipHeight(elm.getBoundingClientRect().height);\r\n }\r\n }\r\n\r\n if (!props.boundingRect || (!props.line1 && !props.line2)) return null;\r\n const bounds = props.boundingRect;\r\n\r\n return createPortal(\r\n \r\n {props.line1}\r\n {props.line2 &&
}\r\n {props.line2}\r\n ,\r\n document.getElementById(\"tooltip-portal\")!\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { action, observable, runInAction } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport S from \"./ColorEditor.module.scss\";\r\nimport { ColorResult, SketchPicker } from \"react-color\";\r\nimport { createMachine, interpret } from \"xstate\";\r\n\r\nimport { IFocusable } from \"model/entities/FormFocusManager\";\r\n\r\n@observer\r\nexport default class ColorEditor extends React.Component<{\r\n value: string | null;\r\n isReadOnly?: boolean;\r\n onChange?: (value: string | null) => void;\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n onKeyDown?(event: any): void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n}> {\r\n refContainer = (elm: any) => (this.elmContainer = elm);\r\n elmContainer: any;\r\n\r\n refDropdowner = (elm: any) => (this.elmDropdowner = elm);\r\n elmDropdowner: Dropdowner | null = null;\r\n refDroppedPanelContainer = (elm: any) => (this.elmDroppedPanelContainer = elm);\r\n elmDroppedPanelContainer: any;\r\n\r\n elmInput: any = null;\r\n refInput = (elm: any) => {\r\n this.elmInput = elm;\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n };\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.revertAppliedValue();\r\n }\r\n\r\n componentDidUpdate(prevProps: any) {\r\n runInAction(() => {\r\n if (prevProps.value !== this.props.value) {\r\n this.revertAppliedValue();\r\n }\r\n });\r\n }\r\n\r\n machine = interpret(\r\n createMachine(\r\n {\r\n id: \"colorEditor\",\r\n type: \"parallel\",\r\n states: {\r\n UI: {\r\n initial: \"CLOSED_INACTIVE\",\r\n states: {\r\n CLOSED_INACTIVE: {\r\n on: {\r\n DROPDOWN_SYMBOL_MOUSE_DOWN: {\r\n actions: \"setDroppedDown\",\r\n },\r\n PICKER_DROPPED_DOWN: \"OPEN\",\r\n INPUT_FIELD_FOCUS: \"CLOSED_ACTIVE\",\r\n },\r\n },\r\n CLOSED_ACTIVE: {\r\n on: {\r\n DROPDOWN_SYMBOL_MOUSE_DOWN: {\r\n actions: \"setDroppedDown\",\r\n },\r\n PICKER_DROPPED_DOWN: \"OPEN\",\r\n INPUT_FIELD_BLUR: {\r\n actions: [\"signalComponentBlur\", \"commitAppliedValue\"],\r\n target: \"CLOSED_INACTIVE\",\r\n },\r\n INPUT_FIELD_KEY_DOWN: [\r\n {\r\n actions: \"commitAppliedValue\",\r\n cond: \"eventKeyIsEnter\",\r\n },\r\n {\r\n actions: \"revertAppliedValue\",\r\n cond: \"eventKeyIsEscape\",\r\n },\r\n ],\r\n },\r\n /*after: {\r\n 100: {\r\n actions: \"focusInputField\",\r\n },\r\n },*/\r\n },\r\n OPEN: {\r\n entry: \"pickValueFromApplied\",\r\n on: {\r\n PICKER_KEY_DOWN: [\r\n {\r\n actions: [\"applyPickedValue\", \"commitAppliedValue\", \"setDroppedUp\"],\r\n cond: \"eventKeyIsEnter\",\r\n },\r\n {\r\n cond: \"eventKeyIsEscape\",\r\n actions: [\"setDroppedUp\"],\r\n },\r\n ],\r\n PICKER_OUTSIDE_INTERACTION: {\r\n target: \"CLOSED_INACTIVE\",\r\n actions: [\r\n \"applyPickedValue\",\r\n \"commitAppliedValue\",\r\n \"signalComponentBlur\",\r\n \"setDroppedUp\",\r\n ],\r\n },\r\n PICKER_DROPPED_UP: {\r\n target: \"CLOSED_ACTIVE\",\r\n },\r\n },\r\n after: {\r\n 100: {\r\n actions: \"focusPickerContainer\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n {\r\n actions: {\r\n applyPickedValue: (ctx, event) => {\r\n this.applyPickedValue();\r\n },\r\n commitAppliedValue: (ctx, event) => {\r\n this.commitAppliedValue();\r\n },\r\n revertAppliedValue: (ctx, event) => {\r\n this.revertAppliedValue();\r\n },\r\n pickValueFromApplied: (ctx, event) => {\r\n this.pickValueFromApplied();\r\n },\r\n setDroppedDown: (ctx, event) => {\r\n this.setDropped(true);\r\n },\r\n setDroppedUp: (ctx, event) => {\r\n this.setDropped(false);\r\n },\r\n focusPickerContainer: (ctx, event) => {\r\n this.elmDroppedPanelContainer?.focus();\r\n },\r\n focusInputField: (ctx, event) => {\r\n this.elmInput?.select();\r\n },\r\n signalComponentBlur: (ctx, event) => {\r\n this.props.onBlur?.();\r\n },\r\n },\r\n guards: {\r\n eventKeyIsEnter: (ctx, event) => {\r\n return event.payload.event.key === \"Enter\";\r\n },\r\n eventKeyIsEscape: (ctx, event) => {\r\n return event.payload.event.key === \"Escape\";\r\n },\r\n },\r\n }\r\n )\r\n )\r\n .onTransition((state, event) => {\r\n if (state.changed) {\r\n this.machineState = state;\r\n }\r\n })\r\n .start();\r\n\r\n @observable machineState = this.machine.state;\r\n\r\n @action.bound setDropped(state: boolean) {\r\n this.elmDropdowner?.setDropped(state);\r\n }\r\n\r\n get isDroppedDown() {\r\n return this.machineState.matches(\"UI.OPEN\");\r\n }\r\n\r\n @observable pickedColor: string | null = \"#000000\";\r\n @observable appliedValue: string | null = \"#000000\";\r\n\r\n @action.bound\r\n handleColorChange(colorResult: ColorResult, event: any) {\r\n this.pickedColor = colorResult.hex.toUpperCase();\r\n }\r\n\r\n @action.bound applyPickedValue() {\r\n this.appliedValue = this.pickedColor;\r\n }\r\n\r\n @action.bound commitAppliedValue() {\r\n if (this.appliedValue !== this.props.value) {\r\n this.props.onChange?.(this.appliedValue);\r\n }\r\n }\r\n\r\n @action.bound revertAppliedValue() {\r\n this.appliedValue = this.props.value;\r\n }\r\n\r\n @action.bound pickValueFromApplied() {\r\n this.pickedColor = this.appliedValue;\r\n }\r\n\r\n @action.bound send(evt: any) {\r\n this.machine.send(evt);\r\n }\r\n\r\n render() {\r\n return (\r\n this.send({type: \"PICKER_DROPPED_UP\"})}\r\n onDroppedDown={() => this.send({type: \"PICKER_DROPPED_DOWN\"})}\r\n onOutsideInteraction={() => this.send({type: \"PICKER_OUTSIDE_INTERACTION\"})}\r\n trigger={({refTrigger, setDropped}) => (\r\n \r\n {\r\n refTrigger(elm);\r\n this.refInput(elm);\r\n }}\r\n onMouseDown={() => this.send({type: \"DROPDOWN_SYMBOL_MOUSE_DOWN\"})}\r\n onFocus={() => this.send({type: \"INPUT_FIELD_FOCUS\"})}\r\n onBlur={() => this.send({type: \"INPUT_FIELD_BLUR\"})}\r\n onKeyDown={(event) => this.props.onKeyDown?.(event)}\r\n >\r\n \r\n \r\n {/* this.send({ type: \"INPUT_FIELD_BLUR\" })}\r\n onFocus={() => this.send({ type: \"INPUT_FIELD_FOCUS\" })}\r\n ref={this.refInput}\r\n />*/}\r\n \r\n )}\r\n content={({setDropped}) => (\r\n {\r\n this.send({type: \"PICKER_KEY_DOWN\", payload: {event}});\r\n }}\r\n >\r\n \r\n \r\n )}\r\n />\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { BlobEditor } from \"gui/Components/ScreenElements/Editors/BlobEditor\";\r\nimport { CheckList } from \"gui/Components/ScreenElements/Editors/CheckList\";\r\nimport { ImageEditor } from \"gui/Components/ScreenElements/Editors/ImageEditor\";\r\nimport { NumberEditor } from \"gui/Components/ScreenElements/Editors/NumberEditor\";\r\nimport { TagInputEditor } from \"gui/Components/ScreenElements/Editors/TagInputEditor\";\r\nimport { TextEditor } from \"gui/Components/ScreenElements/Editors/TextEditor\";\r\nimport { inject, observer } from \"mobx-react\";\r\nimport { onFieldBlur } from \"model/actions-ui/DataView/TableView/onFieldBlur\";\r\nimport { onFieldChange } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { getFieldErrorMessage } from \"model/selectors/DataView/getFieldErrorMessage\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getRowStateForegroundColor } from \"model/selectors/RowState/getRowStateForegroundColor\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport React from \"react\";\r\nimport uiActions from \"model/actions-ui-tree\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { isReadOnly } from \"model/selectors/RowState/isReadOnly\";\r\nimport { XmlBuildDropdownEditor } from \"modules/Editors/DropdownEditor/DropdownEditor\";\r\nimport { BoolEditor } from \"gui/Components/ScreenElements/Editors/BoolEditor\";\r\nimport { DateTimeEditor } from \"gui/Components/ScreenElements/Editors/DateTimeEditor\";\r\nimport { FormFocusManager } from \"model/entities/FormFocusManager\";\r\nimport { DomEvent } from \"leaflet\";\r\nimport { onDropdownEditorClick } from \"model/actions/DropdownEditor/onDropdownEditorClick\";\r\nimport { shadeHexColor } from \"utils/colorUtils\";\r\nimport { getIsFormScreenDirty } from \"model/selectors/FormScreen/getisFormScreenDirty\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport ColorEditor from \"gui/Components/ScreenElements/Editors/ColorEditor\";\r\nimport { flashColor2htmlColor, htmlColor2FlashColor } from \"utils/flashColorFormat\";\r\nimport { onTextFieldAutoUpdate } from \"model/actions-ui/DataView/OnTextFieldAutoUpdate\";\r\nimport { CellAlignment } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellAlignment\";\r\n\r\n\r\n@inject(({property, formPanelView}) => {\r\n const row = getSelectedRow(formPanelView)!;\r\n return {\r\n property,\r\n onEditorBlur: (event: any) => onFieldBlur(formPanelView)(event),\r\n onChange: async (event: any, value: any) => {\r\n if(row === undefined){\r\n return;\r\n }\r\n await onFieldChange(formPanelView)({\r\n event: event,\r\n row: row,\r\n property: property,\r\n value: value,\r\n });\r\n },\r\n };\r\n})\r\n@observer\r\nexport class FormViewEditor extends React.Component<{\r\n xmlNode?: any;\r\n value?: any;\r\n textualValue?: any;\r\n property?: IProperty;\r\n isRichText: boolean;\r\n onChange?: (event: any, value: any) => Promise;\r\n onEditorBlur?: (event: any) => Promise;\r\n backgroundColor?: string;\r\n onTextOverflowChanged?: (toolTip: string | null | undefined) => void;\r\n}> {\r\n focusManager: FormFocusManager;\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.focusManager = getDataView(this.props.property).formFocusManager;\r\n }\r\n\r\n getEditor() {\r\n const rowId = getSelectedRowId(this.props.property);\r\n const row = getSelectedRow(this.props.property);\r\n const foregroundColor = getRowStateForegroundColor(this.props.property, rowId || \"\");\r\n const readOnly = !row || isReadOnly(this.props.property!, rowId);\r\n const backgroundColor = readOnly\r\n ? shadeHexColor(this.props.backgroundColor, -0.1)\r\n : this.props.backgroundColor;\r\n let isInvalid = false;\r\n let invalidMessage: string | undefined = undefined;\r\n\r\n const errMsg = row\r\n ? getFieldErrorMessage(this.props.property!)(row, this.props.property!)\r\n : undefined;\r\n\r\n if (errMsg) {\r\n isInvalid = true;\r\n invalidMessage = errMsg;\r\n }\r\n\r\n switch (this.props.property!.column) {\r\n case \"Number\":\r\n return (\r\n \r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n />\r\n );\r\n case \"Text\":\r\n return (\r\n onTextFieldAutoUpdate(this.props.property!, value)}\r\n isRichText={this.props.isRichText}\r\n onTextOverflowChanged={this.props.onTextOverflowChanged}\r\n subscribeToFocusManager={(textEditor) =>\r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n />\r\n );\r\n case \"Date\":\r\n return (\r\n \r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n onKeyDown={this.makeOnKeyDownCallBack()}\r\n />\r\n );\r\n case \"CheckBox\":\r\n return (\r\n this.focusManager.stopAutoFocus()}\r\n isInvalid={isInvalid}\r\n invalidMessage={invalidMessage}\r\n onKeyDown={undefined}\r\n subscribeToFocusManager={(textEditor) =>\r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n />\r\n );\r\n case \"ComboBox\":\r\n return (\r\n \r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n autoSort={this.props.property?.autoSort}\r\n backgroundColor={backgroundColor}\r\n foregroundColor={foregroundColor}\r\n customStyle={this.props.property?.style}\r\n isInvalid={isInvalid}\r\n invalidMessage={invalidMessage}\r\n isLink={this.props.property?.isLink}\r\n onClick={(event) => {\r\n onDropdownEditorClick(this.props.property)(event, this.props.property, row);\r\n }}\r\n onKeyDown={this.makeOnKeyDownCallBack()}\r\n />\r\n );\r\n case \"TagInput\":\r\n return (\r\n \r\n this.focusManager.subscribe(\r\n firstCheckInput,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n autoSort={this.props.property?.autoSort}\r\n tagEditor={\r\n \r\n }\r\n />\r\n );\r\n case \"Checklist\":\r\n return (\r\n this.props.onChange && this.props.onChange({}, newValue)}\r\n isInvalid={isInvalid}\r\n isReadonly={readOnly}\r\n invalidMessage={invalidMessage}\r\n subscribeToFocusManager={(firstCheckInput) =>\r\n this.focusManager.subscribe(\r\n firstCheckInput,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n onKeyDown={this.makeOnKeyDownCallBack()}\r\n onClick={() => this.focusManager.stopAutoFocus()}\r\n />\r\n );\r\n case \"Color\":\r\n return (\r\n this.props.onChange?.(undefined, htmlColor2FlashColor(value))}\r\n onBlur={() => this.props.onEditorBlur?.(undefined)}\r\n onKeyDown={this.makeOnKeyDownCallBack()}\r\n isReadOnly={readOnly}\r\n subscribeToFocusManager={(textEditor) =>\r\n this.focusManager.subscribe(\r\n textEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n />\r\n );\r\n case \"Image\":\r\n return ;\r\n case \"Blob\":\r\n const isDirty = getIsFormScreenDirty(this.props.property);\r\n return (\r\n \r\n this.focusManager.subscribe(\r\n inputEditor,\r\n this.props.property?.id,\r\n this.props.property?.tabIndex\r\n )\r\n }\r\n onChange={this.props.onChange}\r\n onEditorBlur={this.props.onEditorBlur}\r\n />\r\n );\r\n case \"Polymorph\":\r\n console.warn(`Type of polymorphic column was not determined, no editor was rendered`); // eslint-disable-line no-console\r\n return \"\";\r\n default:\r\n console.warn(`Unknown column type \"${this.props.property!.column}\", no editor was rendered` // eslint-disable-line no-console\r\n );\r\n return \"\";\r\n }\r\n }\r\n\r\n private makeOnKeyDownCallBack() {\r\n const dataView = getDataView(this.props.property);\r\n\r\n return (event: any) => {\r\n runInFlowWithHandler({\r\n ctx: this.props.property,\r\n action: async () => {\r\n dataView.formFocusManager.stopAutoFocus();\r\n if (event.key === \"Tab\") {\r\n DomEvent.preventDefault(event);\r\n if (event.shiftKey) {\r\n this.focusManager.focusPrevious(document.activeElement);\r\n } else {\r\n this.focusManager.focusNext(document.activeElement);\r\n }\r\n return;\r\n }\r\n if (this.props.property!.multiline) {\r\n return;\r\n }\r\n if (event.key === \"Enter\") {\r\n await this.props.onEditorBlur?.(null);\r\n if (dataView.firstEnabledDefaultAction) {\r\n uiActions.actions.onActionClick(dataView.firstEnabledDefaultAction)(\r\n event,\r\n dataView.firstEnabledDefaultAction\r\n );\r\n }\r\n }\r\n },\r\n });\r\n };\r\n }\r\n\r\n render() {\r\n return this.getEditor();\r\n }\r\n}\r\n\r\nexport function resolveNumericCellAlignment(customStyle: { [p: string]: string } | undefined){\r\n let cellAlignment = new CellAlignment(false, \"Number\", customStyle);\r\n const style = customStyle ?Object.assign({}, customStyle) :{};\r\n style[\"paddingLeft\"] = cellAlignment.paddingLeft + \"px\";\r\n style[\"textAlign\"] = cellAlignment.alignment;\r\n return style;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"gui/Components/Form/FormField.module.scss\";\r\nimport { inject, observer } from \"mobx-react\";\r\nimport { IDockType, IProperty } from \"model/entities/types/IProperty\";\r\nimport { getRowStateDynamicLabel } from \"model/selectors/RowState/getRowStateNameOverride\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport React from \"react\";\r\nimport { formatTooltipPlaintext } from \"../ToolTip/FormatTooltipText\";\r\nimport { FormViewEditor } from \"gui/Workbench/ScreenArea/FormView/FormViewEditor\";\r\nimport { observable } from \"mobx\";\r\n\r\nexport enum ICaptionPosition {\r\n Left = \"Left\",\r\n Right = \"Right\",\r\n Top = \"Top\",\r\n None = \"None\",\r\n}\r\n\r\n@inject(({property}, {caption}) => {\r\n const rowId = getSelectedRowId(property);\r\n\r\n const ovrCaption = getRowStateDynamicLabel(property, rowId || \"\", property.id);\r\n\r\n return {\r\n caption: !!ovrCaption ? ovrCaption : caption,\r\n property: property\r\n };\r\n})\r\n@observer\r\nexport class FormField extends React.Component<{\r\n caption: React.ReactNode;\r\n captionPosition?: ICaptionPosition;\r\n captionLength: number;\r\n dock?: IDockType;\r\n left: number;\r\n top: number;\r\n width: number;\r\n height: number;\r\n isCheckbox?: boolean;\r\n isHidden?: boolean;\r\n hideCaption?: boolean;\r\n captionColor?: string;\r\n toolTip?: string;\r\n xmlNode?: any;\r\n value?: any;\r\n textualValue?: any;\r\n isRichText: boolean;\r\n backgroundColor?: string;\r\n property?: IProperty;\r\n}> {\r\n\r\n @observable\r\n toolTip: string | undefined | null;\r\n\r\n get captionStyle() {\r\n const style = {...(this.props.property?.style ?? {})};\r\n\r\n if (this.props.isHidden) {\r\n style[\"display\"] = \"none\";\r\n return style;\r\n }\r\n switch (this.props.captionPosition) {\r\n default:\r\n case ICaptionPosition.Left:\r\n style[\"top\"] = this.props.top;\r\n style[\"left\"] = this.props.left - this.props.captionLength;\r\n style[\"color\"] = this.props.captionColor;\r\n return style;\r\n case ICaptionPosition.Right:\r\n // 20 is expected checkbox width, might be needed to be set dynamically\r\n // if there is some difference in chekbox sizes between various platforms.\r\n style[\"top\"] = this.props.top;\r\n style[\"left\"] = this.props.isCheckbox ? this.props.left + 20 : this.props.left + this.props.width + 4;\r\n style[\"color\"] = this.props.captionColor;\r\n return style;\r\n case ICaptionPosition.Top:\r\n style[\"top\"] = this.props.top - 20; // TODO: Move this constant somewhere else...\r\n style[\"left\"] = this.props.left;\r\n style[\"color\"] = this.props.captionColor\r\n return style;\r\n }\r\n }\r\n\r\n get formFieldStyle() {\r\n if (this.props.isHidden) {\r\n return {\r\n display: \"none\",\r\n };\r\n }\r\n if (this.props.dock === IDockType.Fill) {\r\n return {\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n };\r\n }\r\n return {\r\n left: this.props.left,\r\n top: this.props.top,\r\n width: this.props.width,\r\n height: this.props.height,\r\n };\r\n }\r\n\r\n getToolTip() {\r\n let finalToolTip = this.props.toolTip ?? \"\";\r\n if (this.toolTip) {\r\n finalToolTip = this.toolTip + \"\\n\\n\" + finalToolTip;\r\n }\r\n return formatTooltipPlaintext(finalToolTip);\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n {this.props.captionPosition !== ICaptionPosition.None && !this.props.hideCaption &&\r\n \r\n {this.props.caption}\r\n \r\n }\r\n \r\n this.toolTip = toolTip}\r\n />\r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"../../entities/types/IProperty\";\r\nimport { getDataView } from \"../../selectors/DataView/getDataView\";\r\nimport { getSessionId } from \"../../selectors/getSessionId\";\r\nimport { getApi } from \"../../selectors/getApi\";\r\nimport { runInFlowWithHandler } from \"../../../utils/runInFlowWithHandler\";\r\n\r\nexport function onTextFieldAutoUpdate(property: IProperty, value: string) {\r\n\r\n const dataView = getDataView(property);\r\n if (!dataView.selectedRowId) {\r\n return;\r\n }\r\n const sessionId = getSessionId(dataView);\r\n let api = getApi(dataView);\r\n\r\n const valueObj = {} as any;\r\n valueObj[property.id] = value;\r\n\r\n const updateData = [\r\n {\r\n RowId: dataView.selectedRowId,\r\n Values: valueObj,\r\n }\r\n ];\r\n runInFlowWithHandler({\r\n ctx: dataView,\r\n action: async () => {\r\n await api.updateObject({\r\n SessionFormIdentifier: sessionId,\r\n Entity: dataView.entity,\r\n UpdateData: updateData,\r\n });\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\n\r\nexport function onDropdownEditorClick(ctx: any) {\r\n return flow(function*onDropdownEditorClick(\r\n event: any,\r\n property: IProperty | undefined,\r\n currentRow: any[] | undefined\r\n ) {\r\n if (currentRow && property?.isLink && (event.ctrlKey || event.metaKey)) {\r\n yield*getDataView(ctx).navigateLookupLink(property, currentRow);\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRowStateById } from \"./getRowStateById\";\r\n\r\nexport function getRowStateDynamicLabel(ctx: any, rowId: string, columnId: string) {\r\n const rowState = getRowStateById(ctx, rowId);\r\n const column = rowState ? rowState.columns.get(columnId) : undefined;\r\n const dynamicLabel = column ? column.dynamicLabel : undefined;\r\n return dynamicLabel;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Form/FormSectionHeader.module.scss\";\r\n\r\nexport const FormSectionHeader: React.FC<{\r\n foreGroundColor: string | undefined;\r\n tooltip?: string;\r\n}> = (props) => (\r\n

\r\n {props.children}\r\n

\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Form/FormSection.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { FormSectionHeader } from \"gui/Components/Form/FormSectionHeader\";\r\n\r\nexport const FormSection: React.FC<{\r\n top: number;\r\n left: number;\r\n width: number;\r\n height: number;\r\n title?: string;\r\n backgroundColor: string | undefined;\r\n foreGroundColor: string | undefined;\r\n}> = (props) => {\r\n const hasTitle = !!props.title;\r\n return (\r\n \r\n {hasTitle && (\r\n \r\n {props.title}\r\n \r\n )}\r\n {props.children}\r\n \r\n );\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Form/FormLabel.module.scss\";\r\n\r\nexport const FormLabel: React.FC<{\r\n title: string;\r\n top: number;\r\n left: number;\r\n width: number;\r\n height: number;\r\n foregroundColor: string | undefined;\r\n}> = props => (\r\n \r\n {props.title}\r\n \r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Form/RadioButton.module.scss\";\r\nimport { IFocusable } from \"model/entities/FormFocusManager\";\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\n\r\nexport class RadioButton extends React.Component<{\r\n caption: string;\r\n top: number\r\n left: number;\r\n width: number;\r\n height: number;\r\n name: string;\r\n value: string;\r\n onSelected: (value: any) => void;\r\n checked: boolean;\r\n onKeyDown: (event: any) => void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onClick: () => void;\r\n labelColor?: string;\r\n}> {\r\n inputId = uuidv4();\r\n elmInput: HTMLInputElement | null = null;\r\n refInput = (elm: HTMLInputElement | any) => {\r\n this.elmInput = elm;\r\n };\r\n\r\n componentDidMount() {\r\n if (this.elmInput && this.props.subscribeToFocusManager) {\r\n this.props.subscribeToFocusManager(this.elmInput);\r\n }\r\n }\r\n\r\n onChange(event: any) {\r\n if (event.target.value === this.props.value) {\r\n this.props.onSelected(this.props.value);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n this.props.onClick()}\r\n id={this.inputId}\r\n name={this.props.name}\r\n value={this.props.value}\r\n checked={this.props.checked}\r\n onKeyDown={event => this.props.onKeyDown(event)}\r\n onChange={event => this.onChange(event)}/>\r\n \r\n {this.props.caption}\r\n \r\n \r\n );\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useState } from \"react\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { BoolEditor } from \"gui/Components/ScreenElements/Editors/BoolEditor\";\r\nimport S from \"gui/Components/Form/CheckBox.module.scss\";\r\nimport { inject } from \"mobx-react\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { onFieldBlur } from \"model/actions-ui/DataView/TableView/onFieldBlur\";\r\nimport { onFieldChange } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { IFocusable } from \"model/entities/FormFocusManager\";\r\n\r\nexport const CheckBox: React.FC<{\r\n checked: boolean;\r\n readOnly: boolean;\r\n isHidden?: boolean;\r\n onChange?: (event: any, value: any) => void;\r\n property?: IProperty;\r\n onKeyDown: (event: any) => void;\r\n subscribeToFocusManager?: (obj: IFocusable) => void;\r\n onClick: () => void;\r\n labelColor?: string;\r\n}> = inject(({property, formPanelView}) => {\r\n const row = getSelectedRow(formPanelView)!;\r\n return {\r\n property,\r\n onEditorBlur: (event: any) => onFieldBlur(formPanelView)(event),\r\n onChange: (event: any, value: any) => onFieldChange(formPanelView)({\r\n event: event,\r\n row: row,\r\n property: property,\r\n value: value,\r\n }),\r\n };\r\n})((props) => {\r\n const [isFocused, setIsFocused] = useState(false);\r\n\r\n const label = props.property!.name;\r\n const height = props.property!.height;\r\n const width = props.property!.width;\r\n const left = props.property!.x;\r\n const top = props.property!.y;\r\n\r\n function captionStyle() {\r\n if (props.isHidden) {\r\n return {\r\n display: \"none\",\r\n };\r\n }\r\n // 20 is expected checkbox width, might be needed to be set dynamically\r\n // if there is some difference in chekbox sizes between various platforms.\r\n return {\r\n top: top,\r\n left: left + 20,\r\n color: props.labelColor\r\n };\r\n }\r\n\r\n function formFieldStyle() {\r\n if (props.isHidden) {\r\n return {\r\n display: \"none\",\r\n };\r\n }\r\n return {\r\n left: left,\r\n top: top,\r\n width: width,\r\n height: height,\r\n };\r\n }\r\n\r\n function onChange(event: any, state: boolean) {\r\n if (!props.readOnly) props.onChange?.(event, state);\r\n }\r\n\r\n function onInputFocus() {\r\n setIsFocused(true);\r\n }\r\n\r\n function onInputBlur() {\r\n setIsFocused(false);\r\n }\r\n\r\n return (\r\n
\r\n
\r\n props.onKeyDown(event)}\r\n subscribeToFocusManager={props.subscribeToFocusManager}\r\n onClick={props.onClick}\r\n />\r\n
\r\n \r\n {label}\r\n \r\n
\r\n );\r\n});\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\n\r\nexport const CtxPanelVisibility = React.createContext<{ isVisible: boolean }>({\r\n isVisible: false\r\n});\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { inject, observer, Observer, Provider } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { findStrings } from \"xmlInterpreters/screenXml\";\r\n\r\nimport { FormRoot } from \"./FormRoot\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { getRowStateRowBgColor } from \"model/selectors/RowState/getRowStateRowBgColor\";\r\nimport { FormField } from \"gui/Components/Form/FormField\";\r\nimport { FormSection } from \"gui/Components/Form/FormSection\";\r\nimport { FormLabel } from \"gui/Components/Form/FormLabel\";\r\nimport { RadioButton } from \"gui/Components/Form/RadioButton\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { CheckBox } from \"gui/Components/Form/CheckBox\";\r\nimport { isReadOnly } from \"model/selectors/RowState/isReadOnly\";\r\nimport { DomEvent } from \"leaflet\";\r\nimport { getRowStateAllowRead } from \"model/selectors/RowState/getRowStateAllowRead\";\r\nimport { getRowStateMayCauseFlicker } from \"model/selectors/RowState/getRowStateMayCauseFlicker\";\r\nimport { CtxPanelVisibility } from \"gui/contexts/GUIContexts\";\r\nimport { getRowStateForegroundColor } from \"model/selectors/RowState/getRowStateForegroundColor\";\r\n\r\n\r\n@inject(({dataView}) => {\r\n return {dataView, xmlFormRootObject: dataView.formViewUI};\r\n})\r\n@observer\r\nexport class FormBuilder extends React.Component<{\r\n xmlFormRootObject?: any;\r\n dataView?: IDataView;\r\n}> {\r\n static contextType = CtxPanelVisibility\r\n\r\n componentDidMount() {\r\n document.addEventListener(\"click\", event => this.notifyClick(event))\r\n }\r\n\r\n componentWillUnmount() {\r\n document.removeEventListener(\"click\", event => this.notifyClick(event));\r\n }\r\n\r\n notifyClick(event: any) {\r\n this.props.dataView!.formFocusManager.setLastFocused(event.target);\r\n }\r\n\r\n onKeyDown(event: any) {\r\n if (event.key === \"Tab\") {\r\n DomEvent.preventDefault(event);\r\n if (event.shiftKey) {\r\n this.props.dataView!.formFocusManager.focusPrevious(document.activeElement);\r\n } else {\r\n this.props.dataView!.formFocusManager.focusNext(document.activeElement);\r\n }\r\n return;\r\n }\r\n }\r\n\r\n buildForm() {\r\n const self = this;\r\n const row = getSelectedRow(this.props.dataView);\r\n const rowId = getSelectedRowId(this.props.dataView);\r\n const dataTable = getDataTable(this.props.dataView);\r\n let backgroundColor: string | undefined;\r\n let foreGroundColor: string | undefined;\r\n if (row && rowId) {\r\n backgroundColor = getRowStateRowBgColor(self.props.dataView, rowId);\r\n foreGroundColor = getRowStateForegroundColor(\r\n self.props.dataView,\r\n rowId || \"\"\r\n );\r\n }\r\n const focusManager = self.props.dataView!.formFocusManager;\r\n\r\n function recursive(xfo: any) {\r\n if (xfo.name === \"FormRoot\") {\r\n return (\r\n \r\n {xfo.elements.map((child: any) => recursive(child))}\r\n \r\n );\r\n } else if (xfo.name === \"FormElement\" && xfo.attributes.Type === \"FormSection\") {\r\n return (\r\n \r\n {xfo.elements.map((child: any) => recursive(child))}\r\n \r\n );\r\n } else if (xfo.name === \"FormElement\" && xfo.attributes.Type === \"Label\") {\r\n return (\r\n \r\n );\r\n } else if (xfo.name === \"Control\" && xfo.attributes.Column === \"RadioButton\") {\r\n const sourceField = getDataSourceFieldByName(self.props.dataView, xfo.attributes.Id);\r\n\r\n const checked = row\r\n ? String(dataTable.getCellValueByDataSourceField(row, sourceField!)) === xfo.attributes.Value\r\n : false;\r\n\r\n return (\r\n self.onKeyDown(event)}\r\n subscribeToFocusManager={(radioInput) =>\r\n focusManager.subscribe(radioInput, xfo.attributes.Id, xfo.attributes.TabIndex)\r\n }\r\n labelColor={foreGroundColor}\r\n onClick={() => self?.props?.dataView?.formFocusManager.stopAutoFocus()}\r\n onSelected={(value) => {\r\n const formScreenLifecycle = getFormScreenLifecycle(self.props.dataView);\r\n flow(function*() {\r\n yield*formScreenLifecycle.updateRadioButtonValue(\r\n self.props.dataView!,\r\n row,\r\n xfo.attributes.Id,\r\n value\r\n );\r\n })();\r\n }}\r\n />\r\n );\r\n } else if (xfo.name === \"PropertyNames\") {\r\n const propertyNames = findStrings(xfo);\r\n return propertyNames.map((propertyId) => {\r\n return (\r\n \r\n {() => {\r\n let property = getDataViewPropertyById(self.props.dataView, propertyId);\r\n if (row && property?.column === \"Polymorph\") {\r\n property = property.getPolymophicProperty(row);\r\n }\r\n let value;\r\n let textualValue = value;\r\n if (row && property) {\r\n value = dataTable.getCellValue(row, property);\r\n if (property.isLookup) {\r\n textualValue = dataTable.getCellText(row, property);\r\n }\r\n }\r\n if (!property) {\r\n return <>;\r\n }\r\n\r\n const isHidden =\r\n (!getRowStateAllowRead(property, rowId || \"\", property.id) ||\r\n getRowStateMayCauseFlicker(property)) && !!row;\r\n\r\n if (property.column === \"CheckBox\") {\r\n return (\r\n \r\n self.onKeyDown(event)}\r\n subscribeToFocusManager={(radioInput) =>\r\n focusManager.subscribe(radioInput, property!.id, property!.tabIndex)\r\n }\r\n onClick={() => self?.props?.dataView?.formFocusManager.stopAutoFocus()}\r\n labelColor={foreGroundColor}\r\n />\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n );\r\n });\r\n } else {\r\n return xfo.elements.map((child: any) => recursive(child));\r\n }\r\n }\r\n\r\n const form = recursive(this.props.xmlFormRootObject);\r\n if (this.props.dataView?.isFirst && this.context.isVisible) {\r\n focusManager.autoFocus();\r\n }\r\n return form;\r\n }\r\n\r\n render() {\r\n return this.buildForm();\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { action } from \"mobx\";\r\nimport { IDataViewBodyUI, IDataViewToolbarUI } from \"modules/DataView/DataViewUI\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { SectionViewSwitchers } from \"modules/DataView/DataViewTypes\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { DataViewHeaderAction } from \"gui/Components/DataViewHeader/DataViewHeaderAction\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\n\r\nimport { Observer } from \"mobx-react\";\r\nimport { IFormPerspective } from \"./FormPerspective\";\r\nimport { IPerspective } from \"../Perspective\";\r\nimport { FormView } from \"gui/Workbench/ScreenArea/FormView/FormView\";\r\nimport { FormBuilder } from \"gui/Workbench/ScreenArea/FormView/FormBuilder\";\r\nimport { T } from \"../../../../utils/translation\";\r\nimport S from \"./FormPerspectiveDirector.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport class FormPerspectiveDirector implements IIId {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public dataViewToolbarUI = IDataViewToolbarUI(),\r\n public dataViewBodyUI = IDataViewBodyUI(),\r\n public formPerspective = IFormPerspective(),\r\n public perspective = IPerspective()\r\n ) {\r\n }\r\n\r\n @action.bound\r\n setup() {\r\n this.dataViewBodyUI.contrib.put({\r\n $iid: this.$iid,\r\n render: () => (\r\n \r\n {() =>\r\n !this.formPerspective.isActive ? (\r\n <>\r\n ) : (\r\n
\r\n \r\n \r\n \r\n
\r\n )\r\n }\r\n
\r\n ),\r\n });\r\n\r\n this.dataViewToolbarUI.contrib.put({\r\n $iid: this.$iid,\r\n section: SectionViewSwitchers,\r\n render: () => (\r\n \r\n {() => (\r\n this.formPerspective.handleClick({saveNewState: true})}\r\n isActive={this.formPerspective.isActive}\r\n >\r\n \r\n \r\n )}\r\n \r\n ),\r\n });\r\n\r\n this.perspective.contrib.put(this.formPerspective);\r\n }\r\n\r\n @action.bound\r\n teardown() {\r\n this.dataViewBodyUI.contrib.del(this);\r\n this.dataViewToolbarUI.contrib.del(this);\r\n this.perspective.contrib.del(this.formPerspective);\r\n }\r\n\r\n dispose() {\r\n this.teardown();\r\n }\r\n}\r\n\r\nexport const IFormPerspectiveDirector = TypeSymbol(\r\n \"IFormPerspectiveDirector\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport { FormPerspectiveDirector, IFormPerspectiveDirector } from \"./FormPerspectiveDirector\";\r\nimport { FormPerspective, IFormPerspective } from \"./FormPerspective\";\r\n\r\nexport const SCOPE_FormPerspective = \"FormPerspective\";\r\n\r\nexport function register($cont: Container) {\r\n $cont\r\n .registerClass(IFormPerspectiveDirector, FormPerspectiveDirector)\r\n .scopedInstance(SCOPE_FormPerspective);\r\n\r\n $cont.registerClass(IFormPerspective, FormPerspective).scopedInstance(SCOPE_FormPerspective);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { observable } from \"mobx\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { IPerspective, IPerspectiveContrib } from \"../Perspective\";\r\nimport bind from \"bind-decorator\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\nimport { IViewConfiguration } from \"modules/DataView/ViewConfiguration\";\r\n\r\nexport class TablePerspective implements IIId, IPerspectiveContrib {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public perspective = IPerspective(),\r\n public viewConfiguration = IViewConfiguration()\r\n ) {\r\n }\r\n\r\n @observable isActive = false;\r\n\r\n @bind\r\n *handleToolbarBtnClick() {\r\n if (this.isActive) return;\r\n yield*this.perspective.deactivate();\r\n this.isActive = true;\r\n yield*this.viewConfiguration.anounceActivePerspective(IPanelViewType.Table);\r\n this.onTablePerspectiveShown?.();\r\n }\r\n\r\n onTablePerspectiveShown: (() => void) | undefined;\r\n\r\n @bind\r\n *deactivate() {\r\n this.isActive = false;\r\n }\r\n\r\n @bind\r\n *activateDefault() {\r\n if (this.viewConfiguration.activePerspective === IPanelViewType.Table) this.isActive = true;\r\n }\r\n}\r\n\r\nexport const ITablePerspective = TypeSymbol(\"ITablePerspective\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"../../../selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function selectPrevColumn(ctx: any) {\r\n return function selectPrevColumn(prevRowWhenStart?: boolean) {\r\n getTablePanelView(ctx).selectPrevColumn(prevRowWhenStart);\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function selectNextColumn(ctx: any) {\r\n return function selectNextColumn(nextRowWhenEnd?: boolean) {\r\n getTablePanelView(ctx).selectNextColumn(nextRowWhenEnd);\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOrderingConfiguration } from \"model/selectors/DataView/getOrderingConfiguration\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\n\r\nexport function onColumnHeaderClick(ctx: any) {\r\n return flow(function*onColumnHeaderClick(event: any, column: string) {\r\n try {\r\n const property = getProperties(ctx).find(prop => prop.id === column);\r\n if (property?.column === \"Blob\" || property?.column === \"TagInput\") {\r\n return;\r\n }\r\n if (event.ctrlKey || event.metaKey) {\r\n getOrderingConfiguration(ctx).addOrdering(column);\r\n } else {\r\n getOrderingConfiguration(ctx).setOrdering(column);\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\n\r\nimport S from \"./FilterSettingsComboBox.module.scss\";\r\nimport { Observer, observer } from \"mobx-react\";\r\nimport { action, observable } from \"mobx\";\r\nimport { createPortal } from \"react-dom\";\r\nimport Measure from \"react-measure\";\r\nimport _ from \"lodash\";\r\n\r\n@observer\r\nexport class FilterSettingsComboBox extends React.Component<{\r\n trigger: React.ReactNode;\r\n id: string;\r\n}> {\r\n @observable isDroppedDown = false;\r\n\r\n refDropdown = React.createRef();\r\n\r\n @action.bound setDroppedDown(state: boolean) {\r\n if (state && !this.isDroppedDown) {\r\n this.measureImm();\r\n this.isDroppedDown = true;\r\n window.addEventListener(\"click\", this.handleWindowClick);\r\n window.addEventListener(\"scroll\", this.handleWindowScroll, true);\r\n } else if (!state && this.isDroppedDown) {\r\n this.isDroppedDown = false;\r\n window.removeEventListener(\"click\", this.handleWindowClick);\r\n window.removeEventListener(\"scroll\", this.handleWindowScroll, true);\r\n }\r\n }\r\n\r\n @action.bound handleTriggerClick(event: any) {\r\n if (this.isDroppedDown) {\r\n this.setDroppedDown(false);\r\n } else {\r\n this.setDroppedDown(true);\r\n }\r\n }\r\n\r\n @action.bound handleWindowClick(event: any) {\r\n if (!this.refDropdown.current || !this.refDropdown.current.contains(event.target)) {\r\n this.setDroppedDown(false);\r\n }\r\n }\r\n\r\n @action.bound handleWindowScroll(event: any) {\r\n this.setDroppedDown(false);\r\n }\r\n\r\n @action.bound handleDropdownClick(event: any) {\r\n this.setDroppedDown(false);\r\n }\r\n\r\n @action.bound measureImm() {\r\n this.elmMeasure?.measure();\r\n }\r\n\r\n measureThrottled = _.throttle(this.measureImm, 100);\r\n\r\n refMeasure = (elm: any) => (this.elmMeasure = elm);\r\n elmMeasure: any;\r\n\r\n render() {\r\n return (\r\n \r\n {({measureRef: refTriggerMeasure, contentRect: triggerContentRect}) => (\r\n \r\n {() => (\r\n
\r\n \r\n {this.props.trigger}\r\n
\r\n \r\n
\r\n
\r\n {this.isDroppedDown &&\r\n createPortal(\r\n \r\n {this.props.children}\r\n ,\r\n document.getElementById(\"dropdown-portal\")!\r\n )}\r\n \r\n )}\r\n
\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport const FilterSettingsComboBoxItem: React.FC<{\r\n onClick?: (event: any) => void;\r\n}> = (props) => (\r\n
\r\n {props.children}\r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\n\r\nexport const Checkbox: React.FC<{\r\n checked?: boolean;\r\n indeterminate?: boolean;\r\n onChange?: (event: any) => void;\r\n onClick?: (event: any) => void;\r\n onClickCapture?: (event: any) => void;\r\n id: string;\r\n}> = props => (\r\n {\r\n if (el) {\r\n el.indeterminate = !!props.indeterminate;\r\n }\r\n }}\r\n />\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFilterSetting } from \"../../../../../../model/entities/types/IFilterSetting\";\r\n\r\nimport { observable } from \"mobx\";\r\n\r\nexport const EDITOR_DALEY_MS = 500;\r\n\r\nexport class FilterSetting implements IFilterSetting {\r\n @observable type: string;\r\n @observable val1?: any;\r\n @observable val2?: any;\r\n isComplete: boolean;\r\n lookupId: string | undefined;\r\n\r\n get filterValue1() {\r\n return this.val1;\r\n }\r\n\r\n get filterValue2() {\r\n return this.type === \"between\" || this.type === \"nbetween\"\r\n ? this.val2\r\n : undefined;\r\n }\r\n\r\n get val1ServerForm() {\r\n return this.val1;\r\n }\r\n\r\n get val2ServerForm() {\r\n return this.val2;\r\n }\r\n\r\n constructor(type: string, isComplete: boolean = false, val1?: any, val2?: any) {\r\n this.type = type;\r\n this.isComplete = isComplete;\r\n this.val1 = val1 ?? undefined;\r\n this.val2 = val2 ?? undefined;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { T } from \"utils/translation\";\r\n\r\nexport class Operator {\r\n static operators: Operator[] = []\r\n\r\n private captionGetter: () => JSX.Element;\r\n private _caption: JSX.Element | undefined;\r\n\r\n get caption() {\r\n if (this._caption === undefined) {\r\n this._caption = this.captionGetter();\r\n }\r\n return this._caption;\r\n }\r\n\r\n constructor(\r\n public type: string,\r\n public numberValue: number,\r\n captionGetter: () => JSX.Element) {\r\n this.captionGetter = captionGetter;\r\n Operator.operators.push(this);\r\n }\r\n\r\n static equals = new Operator(\"eq\", 1, () => <>=)\r\n static between = new Operator(\"between\", 2, () => <>{T(\"between\", \"filter_operator_between\")})\r\n static startsWith = new Operator(\"starts\", 3, () => <>{T(\"begins with\", \"filter_operator_begins_with\")})\r\n static endsWith = new Operator(\"ends\", 4, () => <>{T(\"ends with\", \"filter_operator_ends_with\")})\r\n static contains = new Operator(\"contains\", 5, () => <>{T(\"contains\", \"filter_operator_contains\")})\r\n static greaterThan = new Operator(\"gt\", 6, () => <>>)\r\n static lessThan = new Operator(\"lt\", 7, () => <><)\r\n static greaterThanOrEquals = new Operator(\"gte\", 8, () => <>≥)\r\n static lessThanOrEquals = new Operator(\"lte\", 9, () => <>≤)\r\n static notEquals = new Operator(\"neq\", 10, () => <>≠)\r\n static notBetween = new Operator(\"nbetween\", 11, () => <>{T(\"not between\", \"filter_operator_not_between\")})\r\n static notStartsWith = new Operator(\"nstarts\", 12, () => <>{T(\"not begins with\", \"filter_operator_not_begins_with\")})\r\n static notEndsWith = new Operator(\"nends\", 13, () => <>{T(\"not ends with\", \"filter_operator_not_ends_with\")})\r\n static notContains = new Operator(\"ncontains\", 14, () => <>{T(\"not contains\", \"filter_operator_not_contains\")})\r\n static isNull = new Operator(\"null\", 15, () => <>{T(\"is null\", \"filter_operator_is_null\")})\r\n static isNotNull = new Operator(\"nnull\", 16, () => <>{T(\"is not null\", \"filter_operator_not_is_null\")})\r\n\r\n static in = new Operator(\"in\", 1, () => <>=)\r\n static notIn = new Operator(\"nin\", 10, () => <>≠)\r\n\r\n static fromNumber(operatorNumber: number) {\r\n const operator = Operator.operators.find(operator => operator.numberValue === operatorNumber);\r\n if (!operator) {\r\n throw new Error(\"Cannot find string value for filter operator number: \" + operatorNumber);\r\n }\r\n return operator;\r\n }\r\n}\r\n\r\nconst filterMapComboBox = new Map([\r\n [1, \"in\"],\r\n [10, \"nin\"]\r\n]);\r\nconst filterMap = new Map([\r\n [0, \"none\"],\r\n [1, \"eq\"],\r\n [2, \"between\"],\r\n [3, \"starts\"],\r\n [4, \"ends\"],\r\n [5, \"contains\"],\r\n [6, \"gt\"],\r\n [7, \"lt\"],\r\n [8, \"gte\"],\r\n [9, \"lte\"],\r\n [10, \"neq\"],\r\n [11, \"nbetween\"],\r\n [12, \"nstarts\"],\r\n [13, \"nends\"],\r\n [14, \"ncontains\"],\r\n [15, \"null\"],\r\n [16, \"nnull\"],\r\n]);\r\n\r\nexport function filterTypeToNumber(filterType: string) {\r\n const typeNumber = Array.from(filterMap)\r\n .find(entry => entry[1] === filterType)?.[0]\r\n ?? Array.from(filterMapComboBox)\r\n .find(entry => entry[1] === filterType)?.[0]\r\n if (!typeNumber) {\r\n throw new Error(\"Cannot find filter operator number for filter type: \" + filterType)\r\n }\r\n return typeNumber;\r\n}\r\n\r\nexport function filterTypeFromNumber(filterOperatorNum: number, columnType: string) {\r\n const stringValue = columnType === \"ComboBox\"\r\n ? filterMapComboBox.get(filterOperatorNum) ?? filterMap.get(filterOperatorNum)\r\n : filterMap.get(filterOperatorNum);\r\n if (!stringValue) {\r\n throw new Error(\"Cannot find string value for filter operator number: \" + filterOperatorNum)\r\n }\r\n return stringValue;\r\n}\r\n\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n/* eslint-disable no-whitespace-before-property */\r\nimport React from \"react\";\r\nimport { FilterSettingsComboBox, FilterSettingsComboBoxItem } from \"../FilterSettingsComboBox\";\r\n\r\nimport { Checkbox } from \"gui/Components/CheckBox/Checkbox\";\r\nimport { observer } from \"mobx-react\";\r\nimport { action } from \"mobx\";\r\nimport { FilterSetting } from \"./FilterSetting\";\r\nimport { Operator } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\n\r\nconst OPERATORS: Operator[] = [Operator.equals];\r\n\r\n@observer\r\nexport class FilterSettingsBoolean extends React.Component<{\r\n setting?: any;\r\n id: string;\r\n}> {\r\n\r\n static get defaultSettings() {\r\n return new FilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n @action.bound handleValueClick(event: any) {\r\n const setting = this.props.setting;\r\n if (setting.val1 === undefined) {\r\n setting.val1 = false;\r\n setting.isComplete = true;\r\n } else if (setting.val1 === false) {\r\n setting.val1 = true;\r\n setting.isComplete = true;\r\n } else if (setting.val1 === true) {\r\n setting.val1 = undefined;\r\n setting.isComplete = false;\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n =}\r\n >\r\n =\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport {\r\n FilterSettingsComboBox,\r\n FilterSettingsComboBoxItem,\r\n} from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox\";\r\n\r\nimport CS from \"./FilterSettingsCommon.module.scss\";\r\nimport { action, observable, runInAction } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport { EDITOR_DALEY_MS, FilterSetting } from \"./FilterSetting\";\r\nimport { Operator } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\n\r\nconst OPERATORS = [\r\n Operator.contains,\r\n Operator.startsWith,\r\n Operator.notStartsWith,\r\n Operator.notContains,\r\n Operator.endsWith,\r\n Operator.notEndsWith,\r\n Operator.equals,\r\n Operator.notEquals,\r\n Operator.isNull,\r\n Operator.isNotNull,\r\n];\r\n\r\nconst OpCombo: React.FC<{\r\n setting: any;\r\n id: string;\r\n onChange: () => void;\r\n}> = observer((props) => {\r\n return (\r\n {(OPERATORS.find((op) => op.type === props.setting.type) || {}).caption}}\r\n >\r\n {OPERATORS.map((op) => (\r\n \r\n runInAction(() => {\r\n props.setting.type = op.type;\r\n props.onChange()\r\n }\r\n )}\r\n >\r\n {op.caption}\r\n \r\n ))}\r\n \r\n );\r\n});\r\n\r\n\r\n@observer\r\nclass OpEditors extends React.Component<{\r\n id: string;\r\n setting?: any;\r\n onCurrentValueChanged: (currentValue: string) => void;\r\n currentValue: string;\r\n onChange: () => void;\r\n autoFocus: boolean;\r\n}> {\r\n\r\n inputRef = (elm: any) => (this.inputTag = elm);\r\n inputTag: any;\r\n\r\n componentDidMount() {\r\n if (this.props.autoFocus) {\r\n setTimeout(() => {\r\n this.inputTag?.focus();\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n switch (this.props.setting.type) {\r\n case \"eq\":\r\n case \"neq\":\r\n case \"starts\":\r\n case \"nstarts\":\r\n case \"ends\":\r\n case \"nends\":\r\n case \"contains\":\r\n case \"ncontains\":\r\n return (\r\n this.props.onCurrentValueChanged(event.target.value)}\r\n onBlur={this.props.onChange}\r\n ref={this.inputRef}\r\n />\r\n );\r\n case \"null\":\r\n case \"nnull\":\r\n default:\r\n return null;\r\n }\r\n\r\n }\r\n}\r\n\r\n@observer\r\nexport class FilterSettingsString extends React.Component<{\r\n setting?: any;\r\n autoFocus: boolean;\r\n onChange: ()=>void;\r\n id:string;\r\n}> {\r\n\r\n static get defaultSettings() {\r\n return new FilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n @action.bound\r\n handleChange() {\r\n const setting = this.props.setting;\r\n setting.isComplete = setting.type === \"null\" || setting.type === \"nnull\" || setting.val1 !== undefined;\r\n setting.val2 = undefined;\r\n }\r\n\r\n @action.bound\r\n handleFilterTypeChange() {\r\n if (this.props.setting.type === \"null\" || this.props.setting.type === \"nnull\") {\r\n this.currentValue = \"\";\r\n this.props.setting.val1 = undefined;\r\n this.props.setting.val2 = undefined;\r\n }\r\n this.handleChange();\r\n }\r\n\r\n componentDidUpdate(prevProps: any) {\r\n if (prevProps.setting.val1 !== this.props.setting.val1) {\r\n this.currentValue = this.props.setting.val1;\r\n }\r\n }\r\n\r\n @observable\r\n currentValue = this.props.setting.val1;\r\n\r\n onCurrentValueChanged(newValue: string) {\r\n this.currentValue = newValue;\r\n\r\n const timeOutId = setTimeout(() => {\r\n runInAction(() => {\r\n this.props.setting.val1 = this.currentValue === \"\" ? undefined : this.currentValue;\r\n this.handleChange();\r\n this.props.onChange();\r\n })\r\n }, EDITOR_DALEY_MS);\r\n return () => {\r\n clearTimeout(timeOutId);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n \r\n this.onCurrentValueChanged(value)}\r\n autoFocus={this.props.autoFocus}/>\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { DateTimeEditor } from \"gui/Components/ScreenElements/Editors/DateTimeEditor\";\r\nimport { action, runInAction } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport {\r\n FilterSettingsComboBox,\r\n FilterSettingsComboBoxItem,\r\n} from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox\";\r\nimport { FilterSetting } from \"./FilterSetting\";\r\nimport { Operator } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\nimport { getDefaultCsDateFormatDataFromCookie } from \"utils/cookies\";\r\nimport { csToMomentFormat } from \"@origam/utils\";\r\n\r\nconst OPERATORS = [\r\n Operator.equals,\r\n Operator.notEquals,\r\n Operator.lessThanOrEquals,\r\n Operator.greaterThanOrEquals,\r\n Operator.lessThan,\r\n Operator.greaterThan,\r\n Operator.between,\r\n Operator.notBetween,\r\n Operator.isNull,\r\n Operator.isNotNull\r\n];\r\n\r\nconst OpCombo: React.FC<{\r\n setting: any;\r\n onChange: (newSetting: any) => void;\r\n id: string;\r\n}> = observer((props) => {\r\n return (\r\n {(OPERATORS.find((item) => item.type === props.setting.type) || {}).caption}}\r\n >\r\n {OPERATORS.map((op) => (\r\n {\r\n props.setting.type = op.type;\r\n props.onChange(props.setting);\r\n }\r\n }\r\n >\r\n {op.caption}\r\n \r\n ))}\r\n \r\n );\r\n});\r\n\r\nconst OpEditors: React.FC<{\r\n setting: any;\r\n onChange?: (newSetting: any) => void;\r\n onBlur?: (event: any) => void;\r\n onKeyDown?: (event: any) => void;\r\n autoFocus: boolean;\r\n id: string;\r\n}> = observer((props) => {\r\n const {setting} = props;\r\n const dateFormatCs = getDefaultCsDateFormatDataFromCookie().defaultLongDateFormat;\r\n const dateFormatMoment = csToMomentFormat(dateFormatCs)!;\r\n switch (setting.type) {\r\n case \"eq\":\r\n case \"neq\":\r\n case \"lt\":\r\n case \"gt\":\r\n case \"lte\":\r\n case \"gte\":\r\n return (\r\n {\r\n runInAction(() => {\r\n setting.val1 = isoDay === null ? undefined : removeTimeZone(isoDay);\r\n props.onChange && props.onChange(setting)\r\n })\r\n }}\r\n autoFocus={props.autoFocus}\r\n onEditorBlur={props.onBlur}\r\n onKeyDown={props.onKeyDown}\r\n />\r\n );\r\n\r\n case \"between\":\r\n case \"nbetween\":\r\n return (\r\n <>\r\n {\r\n runInAction(() => {\r\n setting.val1 = isoDay === null ? undefined : removeTimeZone(isoDay);\r\n props.onChange &&\r\n props.onChange(setting)\r\n })\r\n }}\r\n onEditorBlur={props.onBlur}\r\n onKeyDown={props.onKeyDown}\r\n />\r\n {\r\n runInAction(() => {\r\n setting.val2 = isoDay === null ? undefined : removeTimeZone(isoDay);\r\n props.onChange &&\r\n props.onChange(setting)\r\n })\r\n }}\r\n onEditorBlur={props.onBlur}\r\n onKeyDown={props.onKeyDown}\r\n />\r\n \r\n );\r\n case \"null\":\r\n case \"nnull\":\r\n default:\r\n return null;\r\n }\r\n});\r\n\r\n@observer\r\nexport class FilterSettingsDate extends React.Component<{\r\n setting?: any;\r\n autoFocus: boolean\r\n id: string;\r\n}> {\r\n\r\n static get defaultSettings() {\r\n return new FilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n @action.bound\r\n handleChange(newSetting: any) {\r\n this.handleSettingChange();\r\n }\r\n\r\n handleSettingChange() {\r\n const setting = this.props.setting;\r\n switch (setting.type) {\r\n case \"eq\":\r\n case \"neq\":\r\n case \"lt\":\r\n case \"gt\":\r\n case \"lte\":\r\n case \"gte\":\r\n setting.isComplete = setting.val1 !== undefined;\r\n setting.val2 = undefined;\r\n break;\r\n case \"between\":\r\n case \"nbetween\":\r\n setting.isComplete = setting.val1 !== undefined && setting.val2 !== undefined;\r\n break;\r\n default:\r\n setting.val1 = undefined;\r\n setting.val2 = undefined;\r\n setting.isComplete = setting.type === \"null\" || setting.type === \"nnull\";\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nfunction removeTimeZone(isoDateString: string | null | undefined) {\r\n if (!isoDateString) return isoDateString;\r\n return isoDateString.substring(0, 23);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport {\r\n FilterSettingsComboBox,\r\n FilterSettingsComboBoxItem,\r\n} from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox\";\r\n\r\nimport CS from \"./FilterSettingsCommon.module.scss\";\r\nimport { action, observable, runInAction } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport { EDITOR_DALEY_MS, FilterSetting } from \"./FilterSetting\";\r\nimport { Operator } from \"./Operator\";\r\nimport { getCurrentDecimalSeparator } from \"model/entities/NumberFormating\";\r\n\r\nconst OPERATORS =\r\n [\r\n Operator.equals,\r\n Operator.notEquals,\r\n Operator.lessThanOrEquals,\r\n Operator.greaterThanOrEquals,\r\n Operator.lessThan,\r\n Operator.greaterThan,\r\n Operator.between,\r\n Operator.notBetween,\r\n Operator.isNull,\r\n Operator.isNotNull\r\n ];\r\n\r\nconst OpCombo: React.FC<{\r\n setting: any;\r\n onChange: () => void;\r\n id: string;\r\n}> = observer((props) => {\r\n return (\r\n {(OPERATORS.find((item) => item.type === props.setting.type) || {}).caption}}\r\n >\r\n {OPERATORS.map((op) => (\r\n {\r\n props.setting.type = op.type;\r\n props.onChange();\r\n }\r\n }\r\n >\r\n {op.caption}\r\n \r\n ))}\r\n \r\n );\r\n});\r\n\r\n@observer\r\nclass OpEditors extends React.Component<{\r\n setting?: any;\r\n onBlur?: (event: any) => void;\r\n allowDecimalSeparator: boolean;\r\n currentValue1: any;\r\n currentValue2: any;\r\n onCurrentValue1Changed: ((value1: any) => void);\r\n onCurrentValue2Changed: ((value2: any) => void);\r\n autoFocus: boolean;\r\n id: string;\r\n}> {\r\n\r\n inputRef = (elm: any) => (this.inputTag = elm);\r\n inputTag: any;\r\n\r\n componentDidMount() {\r\n if (this.props.autoFocus) {\r\n setTimeout(() => {\r\n this.inputTag?.focus();\r\n });\r\n }\r\n }\r\n\r\n onChange(event: any){\r\n const value = this.removeInvalidCharacters(event);\r\n this.props.onCurrentValue1Changed(value)\r\n }\r\n\r\n private removeInvalidCharacters(event: any) {\r\n let separator = getCurrentDecimalSeparator();\r\n const invalidChars = new RegExp(\"[^\\\\d\\\\-\" + (this.props.allowDecimalSeparator ? separator : \"\") + \"]\", \"g\");\r\n let clearedValue = (event.target.value || \"\").replace(invalidChars, \"\");\r\n let firstSeparatorIndex = clearedValue.indexOf(separator);\r\n if(firstSeparatorIndex > -1){\r\n let lastSeparatorIndex = clearedValue.lastIndexOf(separator);\r\n for (let i = 0; i < 1000; i++) {\r\n if (firstSeparatorIndex === lastSeparatorIndex) break;\r\n clearedValue = clearedValue.slice(0, lastSeparatorIndex) + clearedValue.slice(lastSeparatorIndex + 1);\r\n }\r\n }\r\n if(clearedValue === separator){\r\n clearedValue = \"0\" + separator\r\n }\r\n return isNaN(parseFloat(clearedValue)) ? \"\" : clearedValue;\r\n }\r\n\r\n render() {\r\n switch (this.props.setting.type) {\r\n case \"eq\":\r\n case \"neq\":\r\n case \"lt\":\r\n case \"gt\":\r\n case \"lte\":\r\n case \"gte\":\r\n return (\r\n {\r\n const value = this.removeInvalidCharacters(event);\r\n this.props.onCurrentValue1Changed(value);\r\n }}\r\n onBlur={this.props.onBlur}\r\n ref={this.inputRef}\r\n />\r\n );\r\n\r\n case \"between\":\r\n case \"nbetween\":\r\n return (\r\n <>\r\n {\r\n const value = this.removeInvalidCharacters(event);\r\n this.props.onCurrentValue1Changed(value);\r\n }}\r\n onBlur={this.props.onBlur}\r\n ref={this.inputRef}\r\n />\r\n {\r\n const value = this.removeInvalidCharacters(event);\r\n this.props.onCurrentValue2Changed(value);\r\n }}\r\n onBlur={this.props.onBlur}\r\n />\r\n \r\n );\r\n case \"null\":\r\n case \"nnull\":\r\n default:\r\n return null;\r\n }\r\n }\r\n}\r\n\r\n@observer\r\nexport class FilterSettingsNumber extends React.Component<{\r\n setting?: any;\r\n allowDecimalSeparator: boolean;\r\n autoFocus: boolean;\r\n onChange: ()=>void;\r\n id: string;\r\n}> {\r\n\r\n static get defaultSettings() {\r\n return new FilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n @action.bound\r\n handleBlur() {\r\n this.handleSettingChange();\r\n }\r\n\r\n @action.bound\r\n handleFilterTypeChange() {\r\n if (this.props.setting.type === \"null\" || this.props.setting.type === \"nnull\") {\r\n this.currentValue1 = \"\";\r\n this.currentValue2 = \"\";\r\n this.props.setting.val1 = undefined;\r\n this.props.setting.val2 = undefined;\r\n }\r\n this.handleSettingChange();\r\n }\r\n\r\n componentDidUpdate(prevProps: any) {\r\n if (prevProps.setting.val1 !== this.props.setting.val1) {\r\n this.currentValue1 = this.props.setting.val1;\r\n }\r\n if (prevProps.setting.val2 !== this.props.setting.val2) {\r\n this.currentValue2 = this.props.setting.val2;\r\n }\r\n }\r\n\r\n @action.bound\r\n private handleSettingChange() {\r\n switch (this.props.setting.type) {\r\n case \"eq\":\r\n case \"neq\":\r\n case \"lt\":\r\n case \"gt\":\r\n case \"lte\":\r\n case \"gte\":\r\n this.props.setting.isComplete = this.props.setting.val1 !== undefined;\r\n this.props.setting.val2 = undefined;\r\n break;\r\n case \"between\":\r\n case \"nbetween\":\r\n this.props.setting.isComplete =\r\n this.props.setting.val1 !== undefined && this.props.setting.val2 !== undefined;\r\n break;\r\n default:\r\n this.props.setting.val1 = undefined;\r\n this.props.setting.val2 = undefined;\r\n this.props.setting.isComplete = this.props.setting.type === \"null\" || this.props.setting.type === \"nnull\";\r\n }\r\n }\r\n\r\n @observable\r\n currentValue1 = this.props.setting.val1;\r\n\r\n @observable\r\n currentValue2 = this.props.setting.val2;\r\n\r\n onCurrentValue1Changed(newValue: string) {\r\n this.currentValue1 = newValue;\r\n\r\n const timeOutId = setTimeout(() => {\r\n runInAction(() => {\r\n this.props.setting.val1 = this.currentValue1 === \"\"\r\n ? undefined\r\n : parseFloat(this.currentValue1.replace(getCurrentDecimalSeparator(), \".\"));\r\n this.handleSettingChange();\r\n this.props.onChange();\r\n })\r\n }, EDITOR_DALEY_MS);\r\n return () => {\r\n clearTimeout(timeOutId);\r\n }\r\n }\r\n\r\n onCurrentValue2Changed(newValue: string) {\r\n this.currentValue2 = newValue;\r\n\r\n const timeOutId = setTimeout(() => {\r\n runInAction(() => {\r\n this.props.setting.val2 = this.currentValue2 === \"\"\r\n ? undefined\r\n : parseFloat(this.currentValue2.replace(getCurrentDecimalSeparator(), \".\"));\r\n this.handleSettingChange();\r\n })\r\n }, EDITOR_DALEY_MS);\r\n return () => {\r\n clearTimeout(timeOutId);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n \r\n this.onCurrentValue1Changed(val1)}\r\n onCurrentValue2Changed={val2 => this.onCurrentValue2Changed(val2)}\r\n allowDecimalSeparator={this.props.allowDecimalSeparator}\r\n autoFocus={this.props.autoFocus}\r\n />\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {action, computed, observable, runInAction} from \"mobx\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { CancellablePromise } from \"mobx/lib/api/flow\";\r\nimport React, { useContext, useState } from \"react\";\r\nimport {\r\n FilterSettingsComboBox,\r\n FilterSettingsComboBoxItem,\r\n} from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox\";\r\nimport S from \"./FilterSettingsLookup.module.scss\";\r\nimport CS from \"./FilterSettingsCommon.module.scss\";\r\nimport { IFilterSetting } from \"model/entities/types/IFilterSetting\";\r\nimport {\r\n CtxDropdownEditor,\r\n DropdownEditor,\r\n DropdownEditorSetup,\r\n IDropdownEditorContext,\r\n} from \"modules/Editors/DropdownEditor/DropdownEditor\";\r\nimport { TagInputEditor } from \"gui/Components/ScreenElements/Editors/TagInputEditor\";\r\nimport { IDropdownEditorApi } from \"modules/Editors/DropdownEditor/DropdownEditorApi\";\r\nimport { IDropdownEditorData } from \"modules/Editors/DropdownEditor/DropdownEditorData\";\r\nimport { DropdownColumnDrivers, DropdownDataTable, } from \"modules/Editors/DropdownEditor/DropdownTableModel\";\r\nimport { DropdownEditorLookupListCache } from \"modules/Editors/DropdownEditor/DropdownEditorLookupListCache\";\r\nimport { DropdownEditorBehavior } from \"modules/Editors/DropdownEditor/DropdownEditorBehavior\";\r\nimport { TextCellDriver } from \"modules/Editors/DropdownEditor/Cells/TextCellDriver\";\r\nimport { DefaultHeaderCellDriver } from \"modules/Editors/DropdownEditor/Cells/HeaderCell\";\r\nimport { ILookup } from \"model/entities/types/ILookup\";\r\nimport { Operator } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\n\r\nconst OPERATORS = [\r\n Operator.in,\r\n Operator.notIn,\r\n Operator.startsWith,\r\n Operator.notStartsWith,\r\n Operator.contains,\r\n Operator.notContains,\r\n Operator.isNull,\r\n Operator.isNotNull\r\n];\r\n\r\nconst LOOKUP_TYPE_OPERATORS = [\r\n Operator.startsWith,\r\n Operator.notStartsWith,\r\n Operator.contains,\r\n Operator.notContains\r\n];\r\n\r\nfunction operatorGroupChanges(oldOperator: string, newOperator: string) {\r\n let lookupOperatorTypes = LOOKUP_TYPE_OPERATORS.map(operator => operator.type);\r\n return newOperator === \"null\" || newOperator === \"nnull\" ||\r\n lookupOperatorTypes.includes(newOperator) && !lookupOperatorTypes.includes(oldOperator);\r\n}\r\n\r\nconst OpCombo: React.FC<{\r\n setting: any;\r\n enableLookupTypeFilters: boolean\r\n id: string;\r\n}> = observer((props) => {\r\n return (\r\n {(OPERATORS.find((op) => op.type === props.setting.type) || {}).caption}}\r\n >\r\n {OPERATORS\r\n .filter(operator => props.enableLookupTypeFilters || !LOOKUP_TYPE_OPERATORS.includes(operator))\r\n .map((op) => (\r\n {\r\n runInAction(() => {\r\n if (operatorGroupChanges(props.setting.type, op.type)) {\r\n props.setting.val1 = undefined;\r\n props.setting.val2 = undefined;\r\n }\r\n props.setting.type = op.type;\r\n props.setting.isComplete = op.type === \"null\" || op.type === \"nnull\" ||\r\n props.setting.val1 !== undefined || props.setting.val2 !== undefined;\r\n });\r\n }}\r\n >\r\n {op.caption}\r\n \r\n ))}\r\n \r\n );\r\n});\r\n\r\nexport interface ITagEditorItem {\r\n text: string;\r\n value: string;\r\n}\r\n\r\n@observer\r\nclass OpEditors extends React.Component<{\r\n setting: IFilterSetting;\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n lookup: ILookup;\r\n property: IProperty;\r\n autoFocus: boolean;\r\n id: string;\r\n}> {\r\n\r\n @action.bound handleSelectedItemsChange(items: Array) {\r\n this.props.setting.val1 = [...items];\r\n this.props.setting.val2 = undefined;\r\n this.props.setting.isComplete = this.props.setting.val1 !== undefined && this.props.setting.val1.length > 0;\r\n }\r\n\r\n @action.bound handleTermChange(event: any) {\r\n this.props.setting.val1 = undefined;\r\n this.props.setting.val2 = event.target.value;\r\n this.props.setting.isComplete = !!this.props.setting.val2;\r\n }\r\n\r\n render() {\r\n const {setting} = this.props;\r\n switch (setting?.type) {\r\n case \"in\":\r\n case \"nin\":\r\n return (\r\n \r\n );\r\n case \"starts\":\r\n case \"nstarts\":\r\n case \"contains\":\r\n case \"ncontains\":\r\n return (\r\n \r\n );\r\n case \"null\":\r\n case \"nnull\":\r\n default:\r\n return null;\r\n }\r\n }\r\n}\r\n\r\n@observer\r\nexport class FilterSettingsLookup extends React.Component<{\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n lookup: ILookup;\r\n property: IProperty;\r\n setting: IFilterSetting;\r\n autoFocus: boolean;\r\n id: string;\r\n}> {\r\n static get defaultSettings() {\r\n return new LookupFilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n render() {\r\n const setting = this.props.setting;\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport class LookupFilterSetting implements IFilterSetting {\r\n @observable type: string;\r\n @observable val1?: any; // used for \"in\" operator ... string[]\r\n @observable val2?: any; // used for \"contains\" operator ... string\r\n isComplete: boolean;\r\n\r\n private _lookupId: string | undefined;\r\n\r\n public get lookupId(): string | undefined {\r\n if (LOOKUP_TYPE_OPERATORS.map(operator => operator.type).includes(this.type)) {\r\n return this._lookupId;\r\n }\r\n return undefined;\r\n }\r\n\r\n public set lookupId(value: string | undefined) {\r\n this._lookupId = value;\r\n }\r\n\r\n get filterValue1() {\r\n if (!this.val1) {\r\n return this.val1;\r\n }\r\n switch (this.type) {\r\n case \"contain\":\r\n case \"ncontain\":\r\n return this.val2;\r\n case \"in\":\r\n case \"nin\":\r\n return this.val1;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n get filterValue2() {\r\n return this.val2;\r\n }\r\n\r\n\r\n get val1ServerForm() {\r\n return this.val1 ? this.val1.join(\",\") : this.val1;\r\n }\r\n\r\n get val2ServerForm() {\r\n return this.val2;\r\n }\r\n\r\n constructor(type: string, isComplete = false, val1?: string, val2?: any) {\r\n this.type = type;\r\n this.isComplete = isComplete;\r\n if (Array.isArray(val1)) {\r\n this.val1 = [...new Set(val1)];\r\n } else if (val1 !== undefined && val1 !== null) {\r\n this.val1 = [...new Set(val1.split(\",\"))];\r\n }\r\n this.val2 = val2 ?? undefined;\r\n }\r\n}\r\n\r\nexport function FilterBuildDropdownEditor(props: {\r\n lookup: ILookup;\r\n property: IProperty;\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n onChange(selectedItems: Array): void;\r\n values: Array;\r\n autoFocus: boolean;\r\n id?: string;\r\n}) {\r\n const mobxContext = useContext(MobXProviderContext);\r\n\r\n\r\n const workbench = mobxContext.workbench;\r\n const {lookupListCache} = workbench;\r\n\r\n const [dropdownEditorInfrastructure] = useState(() => {\r\n const dropdownEditorApi: IDropdownEditorApi = new DropDownApi(props.getOptions);\r\n const dropdownEditorData: IDropdownEditorData = new FilterEditorData(props.onChange);\r\n\r\n const dropdownEditorDataTable = new DropdownDataTable(\r\n () => dropdownEditorSetup,\r\n dropdownEditorData\r\n );\r\n const dropdownEditorLookupListCache = new DropdownEditorLookupListCache(\r\n () => dropdownEditorSetup,\r\n lookupListCache\r\n );\r\n const dropdownEditorBehavior = new DropdownEditorBehavior(\r\n dropdownEditorApi,\r\n dropdownEditorData,\r\n dropdownEditorDataTable,\r\n () => dropdownEditorSetup,\r\n dropdownEditorLookupListCache,\r\n false,\r\n );\r\n\r\n\r\n const drivers = new DropdownColumnDrivers();\r\n\r\n let identifierIndex = 0;\r\n const columnNameToIndex = new Map([\r\n [props.property.identifier!, identifierIndex],\r\n ]);\r\n const visibleColumnNames: string[] = [];\r\n\r\n columnNameToIndex.set(props.property.name, 1);\r\n visibleColumnNames.push(props.property.name);\r\n\r\n drivers.allDrivers.push({\r\n columnId: props.property.id,\r\n headerCellDriver: new DefaultHeaderCellDriver(props.property.name),\r\n bodyCellDriver: new TextCellDriver(1, dropdownEditorDataTable, dropdownEditorBehavior),\r\n });\r\n\r\n const showUniqueValues = true;\r\n\r\n const cached = getGroupingConfiguration(props.property).isGrouping\r\n ? false\r\n : props.property.lookup?.cached!\r\n\r\n const dropdownEditorSetup = new DropdownEditorSetup(\r\n props.property.id,\r\n props.lookup.lookupId,\r\n [],\r\n visibleColumnNames,\r\n columnNameToIndex,\r\n showUniqueValues,\r\n props.property.identifier!,\r\n identifierIndex,\r\n props.property.parameters,\r\n props.property.lookup?.dropDownType!,\r\n cached,\r\n !props.property.lookup?.searchByFirstColumnOnly\r\n );\r\n\r\n return {\r\n behavior: dropdownEditorBehavior,\r\n editorData: dropdownEditorData,\r\n columnDrivers: drivers,\r\n editorDataTable: dropdownEditorDataTable,\r\n setup: dropdownEditorSetup\r\n };\r\n });\r\n\r\n function onItemRemoved(event: any, value: string[]) {\r\n props.onChange(value);\r\n }\r\n\r\n const value = props.values;\r\n return (\r\n \r\n \r\n }\r\n />\r\n \r\n );\r\n}\r\n\r\nexport class FilterEditorData implements IDropdownEditorData {\r\n constructor(private onChange: (selectedItems: Array) => void) {\r\n }\r\n\r\n setValue(value: string | string[] | null) {\r\n if (value) {\r\n this._value = Array.isArray(value) ? value : [value];\r\n }\r\n }\r\n\r\n @computed get value(): string | string[] | null {\r\n return this._value;\r\n }\r\n\r\n @observable\r\n _value: any[] = [];\r\n\r\n @computed get text(): string {\r\n return \"\";\r\n }\r\n\r\n get isResolving() {\r\n return false;\r\n }\r\n\r\n @action.bound chooseNewValue(value: any) {\r\n if (value !== null && !this._value.includes(value)) {\r\n this._value = [...this._value, value];\r\n this.onChange(this._value);\r\n }\r\n }\r\n\r\n get idsInEditor() {\r\n return this._value as string[];\r\n }\r\n\r\n remove(valueToRemove: any): void {\r\n const index = this._value.indexOf(valueToRemove)\r\n if (index > -1) {\r\n this._value.splice(index, 1);\r\n }\r\n }\r\n}\r\n\r\nclass DropDownApi implements IDropdownEditorApi {\r\n constructor(private getOptions: (searchTerm: string) => CancellablePromise>) {\r\n }\r\n\r\n *getLookupList(searchTerm: string): Generator {\r\n return yield this.getOptions(searchTerm);\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"./types/IProperty\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getUserFilters } from \"model/selectors/DataView/getUserFilters\";\r\nimport { getUserFilterLookups } from \"model/selectors/DataView/getUserFilterLookups\";\r\n\r\nexport function*getAllLookupIds(property: IProperty): Generator {\r\n const dataView = getDataView(property);\r\n if (dataView.isLazyLoading) {\r\n return yield getAllValuesOfProp(property);\r\n } else {\r\n const dataTable = getDataTable(property);\r\n return yield dataTable.getAllValuesOfProp(property);\r\n }\r\n}\r\n\r\nasync function getAllValuesOfProp(property: IProperty): Promise> {\r\n const api = getApi(property);\r\n const listValues = await api.getFilterListValues({\r\n MenuId: getMenuItemId(property),\r\n SessionFormIdentifier: getSessionId(property),\r\n DataStructureEntityId: getDataStructureEntityId(property),\r\n Property: property.id,\r\n Filter: property.column === \"TagInput\"\r\n ? \"\"\r\n : getUserFilters({ctx: property, excludePropertyId: property.id}),\r\n FilterLookups: getUserFilterLookups(property),\r\n });\r\n return new Set(\r\n listValues\r\n .map(listValue => listValue)\r\n .filter(listValue => listValue)\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, computed, observable, runInAction } from \"mobx\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { CancellablePromise } from \"mobx/lib/api/flow\";\r\nimport React, { useContext, useState } from \"react\";\r\nimport {\r\n FilterSettingsComboBox,\r\n FilterSettingsComboBoxItem,\r\n} from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettingsComboBox\";\r\nimport S from \"./FilterSettingsLookup.module.scss\";\r\nimport { IFilterSetting } from \"model/entities/types/IFilterSetting\";\r\nimport {\r\n CtxDropdownEditor,\r\n DropdownEditor,\r\n DropdownEditorSetup,\r\n IDropdownEditorContext,\r\n} from \"modules/Editors/DropdownEditor/DropdownEditor\";\r\nimport { TagInputEditor } from \"gui/Components/ScreenElements/Editors/TagInputEditor\";\r\nimport { IDropdownEditorApi } from \"modules/Editors/DropdownEditor/DropdownEditorApi\";\r\nimport { IDropdownEditorData } from \"modules/Editors/DropdownEditor/DropdownEditorData\";\r\nimport { DropdownColumnDrivers, DropdownDataTable, } from \"modules/Editors/DropdownEditor/DropdownTableModel\";\r\nimport { DropdownEditorLookupListCache } from \"modules/Editors/DropdownEditor/DropdownEditorLookupListCache\";\r\nimport { DropdownEditorBehavior } from \"modules/Editors/DropdownEditor/DropdownEditorBehavior\";\r\nimport { TextCellDriver } from \"modules/Editors/DropdownEditor/Cells/TextCellDriver\";\r\nimport { DefaultHeaderCellDriver } from \"modules/Editors/DropdownEditor/Cells/HeaderCell\";\r\nimport { ILookup } from \"model/entities/types/ILookup\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { Operator } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\nimport { prepareForFilter } from \"../../../../../../model/selectors/PortalSettings/getStringFilterConfig\";\r\n\r\nconst OPERATORS = [\r\n Operator.in,\r\n Operator.notIn,\r\n Operator.isNull,\r\n Operator.isNotNull\r\n];\r\n\r\nconst OpCombo: React.FC<{\r\n setting: IFilterSetting\r\n id: string;\r\n}> = observer((props) => {\r\n return (\r\n {(OPERATORS.find((op) => op.type === props.setting.type) || {}).caption}}\r\n >\r\n {OPERATORS.map((op) => (\r\n {\r\n runInAction(() => {\r\n props.setting.type = op.type;\r\n props.setting.isComplete = op.type === \"null\" || op.type === \"nnull\" || props.setting.val1 !== undefined;\r\n if (op.type === \"null\" || op.type === \"nnull\") {\r\n props.setting.val1 = undefined;\r\n props.setting.val2 = undefined;\r\n }\r\n });\r\n }}\r\n >\r\n {op.caption}\r\n \r\n ))}\r\n \r\n );\r\n});\r\n\r\nexport interface ITagEditorItem {\r\n text: string;\r\n value: string;\r\n}\r\n\r\n@observer\r\nclass OpEditors extends React.Component<{\r\n setting: IFilterSetting;\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n lookup: ILookup;\r\n property: IProperty;\r\n autoFocus: boolean;\r\n id: string;\r\n}> {\r\n\r\n render() {\r\n const {setting} = this.props;\r\n switch (setting?.type) {\r\n case \"in\":\r\n case \"nin\":\r\n return (\r\n \r\n );\r\n case \"null\":\r\n case \"nnull\":\r\n default:\r\n return null;\r\n }\r\n }\r\n}\r\n\r\n@observer\r\nexport class FilterSettingsTagInput extends React.Component<{\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n lookup: ILookup;\r\n property: IProperty;\r\n setting: IFilterSetting;\r\n autoFocus: boolean;\r\n id: string;\r\n}> {\r\n static get defaultSettings() {\r\n return new TagInputFilterSetting(OPERATORS[0].type)\r\n }\r\n\r\n render() {\r\n const setting = this.props.setting;\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport class TagInputFilterSetting implements IFilterSetting {\r\n @observable type: string;\r\n @observable val1?: any; // used for \"in\" operator ... string[]\r\n @observable val2?: any; // used for \"contains\" operator ... string\r\n isComplete: boolean;\r\n lookupId: string | undefined;\r\n\r\n get filterValue1() {\r\n if (!this.val1) {\r\n return this.val1;\r\n }\r\n switch (this.type) {\r\n case \"in\":\r\n case \"nin\":\r\n return this.val1;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n get filterValue2() {\r\n return this.type === \"between\" || this.type === \"nbetween\"\r\n ? this.val2\r\n : undefined;\r\n }\r\n\r\n\r\n get val1ServerForm() {\r\n return this.val1 ? this.val1.join(\",\") : this.val1;\r\n }\r\n\r\n get val2ServerForm() {\r\n return this.val2;\r\n }\r\n\r\n constructor(type: string, isComplete = false, val1?: string, val2?: any) {\r\n this.type = type;\r\n this.isComplete = isComplete;\r\n if (val1 !== undefined && val1 !== null) {\r\n this.val1 = [...new Set(val1.split(\",\"))];\r\n }\r\n this.val2 = val2 ?? undefined;\r\n }\r\n}\r\n\r\nexport function FilterBuildDropdownEditor(props: {\r\n lookup: ILookup;\r\n property: IProperty;\r\n getOptions: (searchTerm: string) => CancellablePromise>;\r\n values: Array;\r\n setting: IFilterSetting;\r\n autoFocus: boolean;\r\n id: string;\r\n}) {\r\n const mobxContext = useContext(MobXProviderContext);\r\n const workbench = mobxContext.workbench;\r\n const {lookupListCache} = workbench;\r\n\r\n const [dropdownEditorInfrastructure] = useState(() => {\r\n const dropdownEditorApi: IDropdownEditorApi = new DropDownApi(props.getOptions);\r\n const dropdownEditorData: IDropdownEditorData = new FilterEditorData(props.setting);\r\n\r\n const dropdownEditorDataTable = new DropdownDataTable(\r\n () => dropdownEditorSetup,\r\n dropdownEditorData\r\n );\r\n const dropdownEditorLookupListCache = new DropdownEditorLookupListCache(\r\n () => dropdownEditorSetup,\r\n lookupListCache\r\n );\r\n const dropdownEditorBehavior = new DropdownEditorBehavior(\r\n dropdownEditorApi,\r\n dropdownEditorData,\r\n dropdownEditorDataTable,\r\n () => dropdownEditorSetup,\r\n dropdownEditorLookupListCache,\r\n false,\r\n text => prepareForFilter(props.property, text)!\r\n );\r\n\r\n const drivers = new DropdownColumnDrivers();\r\n\r\n let identifierIndex = 0;\r\n const columnNameToIndex = new Map([\r\n [props.property.identifier!, identifierIndex],\r\n ]);\r\n const visibleColumnNames: string[] = [];\r\n\r\n columnNameToIndex.set(props.property.name, 1);\r\n visibleColumnNames.push(props.property.name);\r\n\r\n drivers.allDrivers.push({\r\n columnId: props.property.id,\r\n headerCellDriver: new DefaultHeaderCellDriver(props.property.name),\r\n bodyCellDriver: new TextCellDriver(1, dropdownEditorDataTable, dropdownEditorBehavior),\r\n });\r\n\r\n const showUniqueValues = true;\r\n\r\n const dropdownEditorSetup = new DropdownEditorSetup(\r\n props.property.id,\r\n props.lookup.lookupId,\r\n [],\r\n visibleColumnNames,\r\n columnNameToIndex,\r\n showUniqueValues,\r\n props.property.identifier!,\r\n identifierIndex,\r\n props.property.parameters,\r\n props.property.lookup?.dropDownType!,\r\n props.property.lookup?.cached!,\r\n !props.property.lookup?.searchByFirstColumnOnly\r\n );\r\n\r\n return {\r\n behavior: dropdownEditorBehavior,\r\n editorData: dropdownEditorData,\r\n columnDrivers: drivers,\r\n editorDataTable: dropdownEditorDataTable,\r\n setup: dropdownEditorSetup\r\n };\r\n });\r\n\r\n (dropdownEditorInfrastructure.editorData as FilterEditorData).setting = props.setting;\r\n\r\n const value = props.values;\r\n return (\r\n \r\n \r\n }\r\n />\r\n \r\n );\r\n}\r\n\r\nexport class FilterEditorData implements IDropdownEditorData {\r\n constructor(public setting: IFilterSetting) {\r\n }\r\n\r\n setValue(value: string[]) {\r\n }\r\n\r\n @computed get value(): string | string[] | null {\r\n return this.setting.val1;\r\n }\r\n\r\n @computed get text(): string {\r\n return \"\";\r\n }\r\n\r\n get isResolving() {\r\n return false;\r\n }\r\n\r\n onChange() {\r\n this.setting.val2 = undefined;\r\n this.setting.isComplete = this.setting.val1 !== undefined && this.setting.val1.length > 0;\r\n }\r\n\r\n @action.bound chooseNewValue(value: any) {\r\n if (value !== null && !this.setting.val1?.includes(value)) {\r\n if (this.setting.val1 === undefined) {\r\n this.setting.val1 = [value];\r\n } else {\r\n this.setting.val1 = [...this.setting.val1, value];\r\n }\r\n this.onChange();\r\n }\r\n }\r\n\r\n get idsInEditor() {\r\n return this.setting.val1 ?? [] as string[];\r\n }\r\n\r\n remove(valueToRemove: any): void {\r\n const index = this.setting.val1.indexOf(valueToRemove)\r\n if (index > -1) {\r\n this.setting.val1.splice(index, 1);\r\n }\r\n if (this.setting.val1?.length === 0) {\r\n this.setting.val1 = undefined;\r\n } else {\r\n this.setting.val1 = [...this.setting.val1];\r\n }\r\n this.onChange();\r\n }\r\n}\r\n\r\nclass DropDownApi implements IDropdownEditorApi {\r\n constructor(private getOptions: (searchTerm: string) => CancellablePromise>) {\r\n }\r\n\r\n *getLookupList(searchTerm: string): Generator {\r\n return yield this.getOptions(\"\");\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useContext } from \"react\";\r\nimport { FilterSettingsBoolean } from \"./HeaderControls/FilterSettingsBoolean\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { FilterSettingsString } from \"./HeaderControls/FilterSettingsString\";\r\nimport { FilterSettingsDate } from \"./HeaderControls/FilterSettingsDate\";\r\nimport { observer } from \"mobx-react-lite\";\r\nimport { FilterSettingsNumber } from \"./HeaderControls/FilterSettingsNumber\";\r\nimport { FilterSettingsLookup } from \"./HeaderControls/FilterSettingsLookup\";\r\nimport { flow } from \"mobx\";\r\nimport { MobXProviderContext } from \"mobx-react\";\r\nimport { onApplyFilterSetting } from \"model/actions-ui/DataView/TableView/onApplyFilterSetting\";\r\nimport { getFilterSettingByProperty } from \"model/selectors/DataView/getFilterSettingByProperty\";\r\nimport { IFilterSetting } from \"model/entities/types/IFilterSetting\";\r\nimport { getAllLookupIds } from \"model/entities/getAllLookupIds\";\r\nimport { FilterSettingsTagInput } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsTagInput\";\r\nimport { getGridFocusManager } from \"../../../../../model/entities/GridFocusManager\";\r\n\r\nexport const FilterSettings: React.FC<{ autoFocus: boolean, ctx: any }> = observer((props) => {\r\n const property = useContext(MobXProviderContext).property as IProperty;\r\n\r\n function getSettings(defaultValue: IFilterSetting) {\r\n let setting = getFilterSettingByProperty(property, property.id);\r\n if (!setting) {\r\n setting = defaultValue;\r\n onApplyFilterSetting(property)(setting);\r\n }\r\n return setting;\r\n }\r\n\r\n function onFilterValueChange() {\r\n getGridFocusManager(props.ctx).focusTableOnReload = false;\r\n }\r\n\r\n switch (property.column) {\r\n case \"Text\":\r\n return ;\r\n case \"CheckBox\":\r\n return ;\r\n case \"Date\":\r\n return ;\r\n case \"Number\":\r\n return ;\r\n case \"ComboBox\":\r\n const setting = getSettings(FilterSettingsLookup.defaultSettings);\r\n setting.lookupId = property.lookupId;\r\n return (\r\n [id, lookupMap.get(id)])\r\n .filter\r\n (\r\n (array) =>\r\n array[1] &&\r\n array[1].toLocaleLowerCase().includes((searchTerm || \"\").toLocaleLowerCase())\r\n )\r\n .sort((x, y) => x[1] > y[1] ? 1 : -1);\r\n })}\r\n />\r\n );\r\n case \"TagInput\":\r\n return (\r\n =\r\n yield property.lookupEngine?.lookupResolver.resolveList(allLookupIds);\r\n return Array.from(lookupMap.entries())\r\n .filter\r\n (\r\n (array) =>\r\n array[1] &&\r\n array[1].toLocaleLowerCase().includes((searchTerm || \"\").toLocaleLowerCase())\r\n )\r\n .sort((x, y) => x[1] > y[1] ? 1 : -1);\r\n })}\r\n />\r\n );\r\n default:\r\n return <>{property.column};\r\n }\r\n});\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFilterConfiguration } from \"./getFilterConfiguration\";\r\n\r\nexport function getFilterSettingByProperty(ctx: any, prop: string) {\r\n const filter = getFilterConfiguration(ctx).getSettingByPropertyId(prop);\r\n return filter ? filter.setting : undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getProperty } from \"model/selectors/DataView/getProperty\";\r\nimport { getFilterConfiguration } from \"../../../selectors/DataView/getFilterConfiguration\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { IFilterSetting } from \"../../../entities/types/IFilterSetting\";\r\n\r\nexport function onApplyFilterSetting(ctx: any) {\r\n const prop = getProperty(ctx);\r\n return flow(function*onApplyFilterSetting(setting: IFilterSetting) {\r\n try {\r\n getFilterConfiguration(ctx).setFilter(\r\n {propertyId: prop.id, dataType: prop.column, setting});\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { observer } from \"mobx-react\";\r\nimport S from \"./Header.module.scss\";\r\nimport { IOrderByDirection } from \"model/entities/types/IOrderingConfiguration\";\r\nimport { Draggable, DraggableProvided } from \"react-beautiful-dnd\";\r\nimport { action, observable } from \"mobx\";\r\n\r\nconst MIN_COLUMN_WIDTH = 30;\r\n\r\n@observer\r\nexport class Header extends React.Component<{\r\n id: string;\r\n width: number;\r\n label: string;\r\n isFixed: boolean;\r\n isFirst: boolean;\r\n isLast: boolean;\r\n columnIndex: number;\r\n orderingDirection: IOrderByDirection;\r\n orderingOrder: number;\r\n additionalHeaderContent?: () => React.ReactNode;\r\n onColumnWidthChange: (id: string, newWidth: number) => void;\r\n onColumnWidthChangeFinished: (id: string, newWidth: number) => void;\r\n onClick?: (event: any, id: string) => void;\r\n}> {\r\n width0: number = 0;\r\n mouseX0: number = 0;\r\n mouseY0: number = 0;\r\n @observable isMouseIn: boolean = false;\r\n width1: number = 0;\r\n\r\n @action.bound handleHeaderWidthHandleMouseDown(event: any) {\r\n event.preventDefault();\r\n this.width0 = this.props.width;\r\n this.width1 = this.props.width;\r\n this.mouseX0 = event.screenX;\r\n this.mouseY0 = event.screenY;\r\n window.addEventListener(\"mousemove\", this.handleWindowMouseMoveForColumnWidthChange);\r\n window.addEventListener(\"mouseup\", this.handleWindowMouseUpForColumnWidthChange);\r\n }\r\n\r\n @action.bound handleWindowMouseMoveForColumnWidthChange(event: any) {\r\n const shVecX = event.screenX - this.mouseX0;\r\n this.width1 = this.width0 + shVecX;\r\n if (this.width1 >= MIN_COLUMN_WIDTH) {\r\n this.props.onColumnWidthChange && this.props.onColumnWidthChange(this.props.id, this.width1);\r\n }\r\n }\r\n\r\n @action.bound handleWindowMouseUpForColumnWidthChange(event: any) {\r\n window.removeEventListener(\"mousemove\", this.handleWindowMouseMoveForColumnWidthChange);\r\n window.removeEventListener(\"mouseup\", this.handleWindowMouseUpForColumnWidthChange);\r\n this.props.onColumnWidthChangeFinished &&\r\n this.props.onColumnWidthChangeFinished(this.props.id, this.width1);\r\n }\r\n\r\n makeHeaderStyle() {\r\n const headerDividerWidth = this.props.isLast ? 3 : 5;\r\n const style = {\r\n minWidth: this.props.width - headerDividerWidth,\r\n maxWidth: this.props.width - headerDividerWidth,\r\n } as any;\r\n if (this.props.isFirst) {\r\n style[\"paddingLeft\"] = \"1.9em\";\r\n }\r\n return style;\r\n }\r\n\r\n render() {\r\n if (this.props.isFixed) {\r\n return this.renderHeader();\r\n }\r\n return (\r\n \r\n {(provided) => this.renderHeader(provided)}\r\n \r\n );\r\n }\r\n\r\n private renderHeader(provided?: DraggableProvided) {\r\n return
\r\n \r\n
\r\n this.props.onClick && this.props.onClick(event, this.props.id)}\r\n >\r\n {this.props.label}\r\n
\r\n {this.props.orderingDirection !== IOrderByDirection.NONE && (\r\n
\r\n {this.props.orderingOrder > 0 && {this.props.orderingOrder}}\r\n {this.props.orderingDirection === IOrderByDirection.ASC && (\r\n \r\n )}\r\n {this.props.orderingDirection === IOrderByDirection.DESC && (\r\n \r\n )}\r\n
\r\n )}\r\n
\r\n {this.props.additionalHeaderContent && (\r\n
{this.props.additionalHeaderContent()}
\r\n )}\r\n \r\n \r\n ;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"./Canvas.module.css\";\r\nimport { action, computed } from \"mobx\";\r\nimport { CPR } from \"utils/canvas\";\r\n\r\nexport class Canvas extends React.Component<{ width: number; height: number, refCanvasElement: any }> {\r\n firstVisibleRowIndex = 0;\r\n lastVisibleRowIndex = 0;\r\n\r\n ctxCanvas: CanvasRenderingContext2D | null = null;\r\n\r\n @action.bound\r\n refCanvas(elm: HTMLCanvasElement | null) {\r\n this.props.refCanvasElement(elm);\r\n if (elm) {\r\n this.ctxCanvas = elm.getContext(\"2d\");\r\n } else {\r\n this.ctxCanvas = null;\r\n }\r\n }\r\n\r\n @computed\r\n public get canvasWidthPX() {\r\n return Math.ceil(this.props.width * CPR()) || 0;\r\n }\r\n\r\n @computed\r\n public get canvasHeightPX() {\r\n return Math.ceil(this.props.height * CPR()) || 0;\r\n }\r\n\r\n @computed\r\n public get canvasWidthCSS() {\r\n return Math.ceil(this.props.width * CPR()) / CPR() || 0;\r\n }\r\n\r\n @computed\r\n public get canvasHeightCSS() {\r\n return Math.ceil(this.props.height * CPR()) / CPR() || 0;\r\n }\r\n\r\n @computed\r\n public get canvasProps() {\r\n return {\r\n width: this.canvasWidthPX,\r\n height: this.canvasHeightPX,\r\n style: {\r\n // +1 because added 1px border makes canvas resizing and blurry.\r\n // Has to by synchronized with stylesheet :/\r\n minWidth: this.canvasWidthCSS + 1,\r\n maxWidth: this.canvasWidthCSS + 1,\r\n minHeight: this.canvasHeightCSS,\r\n maxHeight: this.canvasHeightCSS,\r\n },\r\n };\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport * as React from \"react\";\r\nimport { IHeaderRowProps } from \"./types\";\r\nimport { observer } from \"mobx-react\";\r\nimport S from \"./HeaderRow.module.scss\";\r\n\r\n@observer\r\nexport class HeaderRow extends React.Component {\r\n render() {\r\n return
{this.props.headerElements}
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { IPositionedFieldProps } from \"./types\";\r\nimport { observer } from \"mobx-react\";\r\nimport S from \"./PositionedField.module.css\";\r\nimport cx from \"classnames\";\r\n\r\n@observer\r\nexport class PositionedField extends React.Component {\r\n render() {\r\n const {columnIndex, worldBounds, cellRectangle} = this.props;\r\n const columnLeft = cellRectangle.columnLeft;\r\n const columnWidth = cellRectangle.columnWidth;\r\n const rowTop = cellRectangle.rowTop;\r\n const rowHeight = 25; //cellRectangle.rowHeight;\r\n const {scrollTop, scrollLeft} = this.props.scrollOffsetSource;\r\n return ReactDOM.createPortal(\r\n event.stopPropagation()}\r\n onMouseEnter={this.props.onMouseEnter}\r\n style={{\r\n top: worldBounds.top + rowTop - scrollTop,\r\n left:\r\n columnIndex < this.props.fixedColumnsCount\r\n ? worldBounds.left + columnLeft\r\n : worldBounds.left + columnLeft - scrollLeft,\r\n width: columnWidth,\r\n height: rowHeight,\r\n }}\r\n >\r\n {this.props.children}\r\n ,\r\n document.getElementById(\"form-field-portal\")!\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport { IScrolleeProps } from \"./types\";\r\nimport S from \"./Scrollee.module.css\";\r\n\r\n/*\r\n Component translating its content according to scrollOffsetSource.\r\n*/\r\n\r\n// TODO: Maybe add hideOverflow property to disable content clipping? (or allow some custom class?)\r\n@observer\r\nexport default class Scrollee extends React.Component {\r\n public render() {\r\n return (\r\n \r\n \r\n {this.props.children}\r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, observable } from \"mobx\";\r\nimport * as React from \"react\";\r\nimport { IScrollerProps } from \"./types\";\r\nimport { observer } from \"mobx-react\";\r\nimport S from \"./Scroller.module.css\";\r\nimport { busyDelayMillis } from \"../../../../utils/flow\";\r\n\r\n/*\r\n Two divs broadcasting the outer one's scroll state to scrollOffsetTarget.\r\n*/\r\n@observer\r\nexport default class Scroller extends React.Component {\r\n @observable.ref private elmScrollerDiv: HTMLDivElement | null = null;\r\n private lastScrollLeft: number = 0;\r\n private lastScrollTop: number = 0;\r\n private clickHandler: SequentialSingleDoubleClickHandler = new SequentialSingleDoubleClickHandler(\r\n (event: any) => this.runOnclick(event)\r\n );\r\n\r\n @action.bound scrollTo(coords: { scrollLeft?: number; scrollTop?: number }) {\r\n if (this.elmScrollerDiv) {\r\n if (coords.scrollTop !== undefined) {\r\n this.elmScrollerDiv.scrollTop = coords.scrollTop;\r\n }\r\n if (coords.scrollLeft !== undefined) {\r\n this.forceScrollLeft(coords.scrollLeft); // will scroll even if this.props.scrollingDisabled is true\r\n this.elmScrollerDiv.scrollLeft = coords.scrollLeft;\r\n }\r\n }\r\n }\r\n\r\n @action.bound\r\n private handleScroll(event: any) {\r\n if (this.props.scrollingDisabled) {\r\n event.target.scrollLeft = this.lastScrollLeft;\r\n event.target.scrollTop = this.lastScrollTop;\r\n } else {\r\n this.lastScrollLeft = event.target.scrollLeft;\r\n this.lastScrollTop = event.target.scrollTop;\r\n }\r\n\r\n this.props.onScroll(event, event.target.scrollLeft, event.target.scrollTop);\r\n }\r\n\r\n forceScrollLeft(left: number) {\r\n this.lastScrollLeft = left;\r\n }\r\n\r\n set scrollTop(value: number) {\r\n if (this.elmScrollerDiv) {\r\n this.elmScrollerDiv.scrollTop = value;\r\n }\r\n }\r\n\r\n set scrollLeft(value: number) {\r\n if (this.elmScrollerDiv) {\r\n this.elmScrollerDiv.scrollLeft = value;\r\n }\r\n }\r\n\r\n get scrollTop() {\r\n return this.elmScrollerDiv ? this.elmScrollerDiv.scrollTop : 0;\r\n }\r\n\r\n get scrollLeft() {\r\n return this.elmScrollerDiv ? this.elmScrollerDiv.scrollLeft : 0;\r\n }\r\n\r\n public get horizontalScrollbarSize() {\r\n return this.elmScrollerDiv\r\n ? this.elmScrollerDiv.offsetHeight - this.elmScrollerDiv.clientHeight\r\n : 0;\r\n }\r\n\r\n public get verticalScrollbarSize() {\r\n return this.elmScrollerDiv\r\n ? this.elmScrollerDiv.offsetWidth - this.elmScrollerDiv.clientWidth\r\n : 0;\r\n }\r\n\r\n public focus() {\r\n this.elmScrollerDiv && this.elmScrollerDiv.focus();\r\n }\r\n\r\n @action.bound\r\n private refScrollerDiv(elm: HTMLDivElement) {\r\n this.elmScrollerDiv = elm;\r\n }\r\n\r\n private runOnclick(event: any) {\r\n const scrollerRect = this.elmScrollerDiv!.getBoundingClientRect();\r\n this.props.onClick &&\r\n this.props.onClick(\r\n event,\r\n event.clientX - scrollerRect.left,\r\n event.clientY - scrollerRect.top\r\n );\r\n }\r\n\r\n lastMouseX = 0;\r\n lastMouseY = 0;\r\n timeout: NodeJS.Timeout | undefined;\r\n\r\n @action.bound\r\n handleMouseMove(event: React.MouseEvent) {\r\n event.persist();\r\n const scrollerRect = this.elmScrollerDiv!.getBoundingClientRect();\r\n this.props.onMouseMove?.(\r\n event,\r\n event.clientX - scrollerRect.left,\r\n event.clientY - scrollerRect.top\r\n );\r\n const distanceSinceLastMove = Math.sqrt(\r\n (event.clientX - this.lastMouseX) ** 2 + (event.clientY - this.lastMouseY) ** 2\r\n );\r\n this.lastMouseX = event.clientX;\r\n this.lastMouseY = event.clientY;\r\n\r\n if (distanceSinceLastMove > 1) {\r\n if (this.timeout) {\r\n clearTimeout(this.timeout);\r\n }\r\n\r\n const boundingRectangle = this.elmScrollerDiv!.getBoundingClientRect();\r\n this.timeout = setTimeout(() => {\r\n this.props.onMouseOver(event, boundingRectangle);\r\n }, 500);\r\n }\r\n }\r\n\r\n handleMouseLeave(event: any) {\r\n if (this.timeout) {\r\n clearTimeout(this.timeout);\r\n }\r\n this.props.onMouseLeave(event);\r\n }\r\n\r\n @action.bound\r\n private handleWindowClick(event: any) {\r\n if (this.elmScrollerDiv && !this.elmScrollerDiv.contains(event.target)) {\r\n this.props.onOutsideClick && this.props.onOutsideClick(event);\r\n }\r\n }\r\n\r\n public componentDidMount() {\r\n window.addEventListener(\"click\", this.handleWindowClick);\r\n }\r\n\r\n public componentWillUnmount() {\r\n window.removeEventListener(\"click\", this.handleWindowClick);\r\n }\r\n\r\n public render() {\r\n return (\r\n this.clickHandler.handleClick(e)}\r\n onMouseMove={(event) => this.handleMouseMove(event)}\r\n onMouseLeave={(event) => this.handleMouseLeave(event)}\r\n onKeyDown={(event) => this.props.onKeyDown?.(event)}\r\n onFocus={() => this.props.onFocus()}\r\n ref={this.refScrollerDiv}\r\n >\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n// Ensures that single click is handled before double click and\r\n// that single click callback does not prevent double click from being registered\r\nclass SequentialSingleDoubleClickHandler {\r\n private timer: any = null;\r\n private readonly runOnclick: (event: any) => void;\r\n private singleClickIsRunning = false;\r\n firstEvent: any | undefined;\r\n private readonly doubleClickDelayMillis = busyDelayMillis;\r\n\r\n constructor(runOnclick: (event: any) => void) {\r\n this.runOnclick = runOnclick;\r\n }\r\n\r\n sleep(ms: number) {\r\n return new Promise((resolve) => (this.timer = setTimeout(resolve, ms)));\r\n }\r\n\r\n @action.bound\r\n async handleClick(event: any) {\r\n event.persist();\r\n event.preventDefault();\r\n\r\n if (!this.singleClickIsRunning) {\r\n this.singleClickIsRunning = true;\r\n this.singleClick(event);\r\n await this.sleep(this.doubleClickDelayMillis);\r\n this.singleClickIsRunning = false;\r\n } else {\r\n if (clickDistance(this.firstEvent, event) < 5) {\r\n this.doubleClick(event);\r\n }\r\n this.firstEvent = undefined;\r\n this.singleClickIsRunning = false;\r\n }\r\n }\r\n\r\n private singleClick(event: any) {\r\n this.firstEvent = event;\r\n event.isDouble = false;\r\n this.runOnclick(event);\r\n }\r\n\r\n private doubleClick(event: any) {\r\n event.isDouble = true;\r\n this.runOnclick(event);\r\n }\r\n}\r\n\r\nfunction clickDistance(event1: any, event2: any) {\r\n return Math.sqrt((event1.screenX - event2.screenX) ** 2 + (event1.screenY - event2.screenY) ** 2);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { rowHeight, viewportBottom, viewportTop } from \"./renderingValues\";\r\n\r\n\r\nexport function firstDrawableRowIndex() {\r\n return Math.floor(viewportTop() / rowHeight());\r\n}\r\n\r\nexport function lastDrawableRowIndex() {\r\n return Math.ceil(viewportBottom() / rowHeight());\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { currentRowCellsDimensions } from \"./currentRowCells\";\r\nimport { viewportLeft, viewportRight } from \"./renderingValues\";\r\n\r\nexport function firstDrawableColumnIndex() {\r\n const dimensions = currentRowCellsDimensions();\r\n const wpLeft = viewportLeft();\r\n for (let i = 0; i < dimensions.length; i++) {\r\n if (dimensions[i].right >= wpLeft) return i\r\n }\r\n}\r\n\r\nexport function lastDrawableColumnIndex() {\r\n const dimensions = currentRowCellsDimensions();\r\n const wpRight = viewportRight();\r\n for (let i = dimensions.length - 1; i >= 0; i--) {\r\n if (dimensions[i].left <= wpRight) return i\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport {\r\n clickSubscriptions,\r\n columnWidths,\r\n context,\r\n context2d,\r\n currentRow,\r\n drawingColumnIndex,\r\n fixedColumnCount,\r\n gridLeadCellDimensions,\r\n groupingColumnIds,\r\n isCheckBoxedTable,\r\n mouseMoveSubscriptions,\r\n mouseOverSubscriptions,\r\n propertyById,\r\n realFixedColumnCount,\r\n rowHeight,\r\n rowIndex,\r\n scRenderCell,\r\n scRenderRow,\r\n scRenderTable,\r\n scrollLeft,\r\n scrollTop,\r\n setCurrentRowRightBorderDrawn,\r\n tableColumnIds,\r\n tableRows,\r\n viewportHeight,\r\n viewportWidth,\r\n} from \"./renderingValues\";\r\nimport { firstDrawableRowIndex, lastDrawableRowIndex } from \"./drawableRowIndex\";\r\nimport { drawCurrentCell } from \"./currentCell\";\r\nimport { firstDrawableColumnIndex, lastDrawableColumnIndex } from \"./drawableColumnIndex\";\r\nimport { IClickSubsItem, IMouseOverSubsItem, ITableRow } from \"./types\";\r\nimport { CPR } from \"utils/canvas\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { currentRowCellsDimensions, currentRowCellsDraws, } from \"./currentRowCells\";\r\nimport { cellLayerCount, setLayerIndex } from \"./currentCellLayerIndex\";\r\nimport {\r\n clearTableDebugValues,\r\n setTableDebugRendered\r\n} from \"gui/Components/ScreenElements/Table/TableRendering/DebugTableMonitor\";\r\nimport { flow } from \"mobx\";\r\nimport selectors from \"model/selectors-tree\";\r\n\r\nexport function renderTable(\r\n aCtx: any,\r\n aCtx2d: CanvasRenderingContext2D,\r\n aTableRows: ITableRow[],\r\n aGroupedColumnIds: string[],\r\n aTableColumnIds: string[],\r\n aPropertyById: Map,\r\n aScrollLeft: number,\r\n aScrollTop: number,\r\n aViewportWidth: number,\r\n aViewportHeight: number,\r\n aIsCheckBoxedTable: boolean,\r\n aGridLeadCellDimensions: { left: number; width: number; right: number }[],\r\n aColumnWidths: Map,\r\n aFixedColumnCount: number,\r\n aClickSubscriptions: IClickSubsItem[],\r\n aMouseMoveSubscriptions: IClickSubsItem[],\r\n aMouseOverSubscriptions: IMouseOverSubsItem[],\r\n aRowHeight: number\r\n) {\r\n context.set(aCtx);\r\n context2d.set(aCtx2d);\r\n tableRows.set(aTableRows);\r\n groupingColumnIds.set(aGroupedColumnIds);\r\n tableColumnIds.set(aTableColumnIds);\r\n propertyById.set(aPropertyById);\r\n scrollLeft.set(aScrollLeft);\r\n scrollTop.set(aScrollTop);\r\n viewportWidth.set(aViewportWidth);\r\n viewportHeight.set(aViewportHeight);\r\n isCheckBoxedTable.set(aIsCheckBoxedTable);\r\n gridLeadCellDimensions.set(aGridLeadCellDimensions);\r\n rowHeight.set(aRowHeight);\r\n columnWidths.set(aColumnWidths);\r\n fixedColumnCount.set(aFixedColumnCount);\r\n clickSubscriptions.set(aClickSubscriptions);\r\n mouseMoveSubscriptions.set(aMouseMoveSubscriptions);\r\n mouseOverSubscriptions.set(aMouseOverSubscriptions);\r\n try {\r\n clearTableDebugValues(context());\r\n clickSubscriptions().length = 0;\r\n mouseOverSubscriptions().length = 0;\r\n mouseMoveSubscriptions().length = 0;\r\n const ctx2d = context2d();\r\n ctx2d.fillStyle = \"white\";\r\n ctx2d.fillRect(0, 0, CPR() * viewportWidth(), CPR() * viewportHeight());\r\n const i0 = firstDrawableRowIndex();\r\n const i1 = lastDrawableRowIndex();\r\n if (i0 === undefined || i1 === undefined) return;\r\n for (let i = i0; i <= i1; i++) {\r\n renderRow(i);\r\n }\r\n setTableDebugRendered(context())\r\n } \r\n catch(error){\r\n flow(() => selectors.error.getDialogController(aCtx).pushError(error))()\r\n }\r\n finally {\r\n for (let d of scRenderTable) d();\r\n }\r\n}\r\n\r\nfunction renderRowInternal() {\r\n if(rowIndex() === 0){\r\n clearTableDebugValues(context());\r\n }\r\n const fixColC = realFixedColumnCount();\r\n const firstDrCI = firstDrawableColumnIndex();\r\n const lastDrCI = lastDrawableColumnIndex();\r\n if (firstDrCI !== undefined && lastDrCI !== undefined) {\r\n const i0 = Math.max(fixColC, firstDrCI);\r\n const i1 = lastDrCI;\r\n for (let i = i1; i >= i0; i--) {\r\n renderCell(i);\r\n }\r\n }\r\n for (let i = 0; i < fixColC; i++) {\r\n renderCell(i);\r\n }\r\n}\r\n\r\nfunction renderSecondLayerCells() {\r\n setLayerIndex(1);\r\n currentRowCellsDimensions.clear();\r\n currentRowCellsDraws.clear()\r\n renderRowInternal();\r\n setLayerIndex(0);\r\n}\r\n\r\nexport function renderRow(rowIdx: number) {\r\n rowIndex.set(rowIdx);\r\n setCurrentRowRightBorderDrawn(false);\r\n try {\r\n if (!currentRow()) return;\r\n renderRowInternal();\r\n if (cellLayerCount() === 2) {\r\n renderSecondLayerCells();\r\n }\r\n } finally {\r\n for (let d of scRenderRow) d();\r\n }\r\n}\r\n\r\nexport function renderCell(columnIdx: number) {\r\n drawingColumnIndex.set(columnIdx);\r\n try {\r\n const ctx2d = context2d();\r\n ctx2d.save();\r\n drawCurrentCell();\r\n ctx2d.restore();\r\n } finally {\r\n for (let d of scRenderCell) d();\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\nexport function onColumnOrderChangeFinished(ctx: any, id1: string, id2: string) {\r\n runGeneratorInFlowWithHandler({\r\n ctx: ctx,\r\n generator: function*() {\r\n const tablePanelView = getTablePanelView(ctx);\r\n tablePanelView?.swapColumns(id1, id2);\r\n yield*getConfigurationManager(ctx).onColumnOrderChanged();\r\n }()\r\n })\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { CtxPanelVisibility } from \"gui/contexts/GUIContexts\";\r\nimport { action, autorun, comparer, computed, observable, runInAction } from \"mobx\";\r\nimport { MobXProviderContext, Observer, observer } from \"mobx-react\";\r\nimport { ITablePanelView } from \"model/entities/TablePanelView/types/ITablePanelView\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getIsSelectionCheckboxesShown } from \"model/selectors/DataView/getIsSelectionCheckboxesShown\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\nimport * as React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport Measure, { BoundingRect } from \"react-measure\";\r\nimport { Canvas } from \"./Canvas\";\r\nimport { HeaderRow } from \"./HeaderRow\";\r\nimport { PositionedField } from \"./PositionedField\";\r\nimport Scrollee from \"./Scrollee\";\r\nimport Scroller from \"./Scroller\";\r\nimport S from \"./Table.module.scss\";\r\nimport { getTooltip, handleTableClick, handleTableMouseMove } from \"./TableRendering/onClick\";\r\nimport { renderTable } from \"./TableRendering/renderTable\";\r\nimport { IClickSubsItem, IMouseOverSubsItem, ITableRow, IToolTipData } from \"./TableRendering/types\";\r\nimport { IGridDimensions, ITableProps } from \"./types\";\r\nimport { DragDropContext, Droppable } from \"react-beautiful-dnd\";\r\nimport { onColumnOrderChangeFinished } from \"model/actions-ui/DataView/TableView/onColumnOrderChangeFinished\";\r\n\r\nfunction createTableRenderer(ctx: any, gridDimensions: IGridDimensions) {\r\n const groupedColumnSettings = computed(\r\n () => getGroupingConfiguration(ctx).orderedGroupingColumnSettings\r\n );\r\n const properties = observable(getProperties(ctx));\r\n const propertyById = computed(\r\n () => new Map(properties.map((property) => [property.id, property]))\r\n );\r\n\r\n const tableColumnIds = computed(() => getTableViewProperties(ctx).map((prop) => prop.id));\r\n\r\n const scrollTopObs = observable.box(0);\r\n const scrollLeftObs = observable.box(0);\r\n const viewportWidthObs = observable.box(500);\r\n const viewportHeightObs = observable.box(300);\r\n\r\n const clickSubscriptions: IClickSubsItem[] = [];\r\n const mouseOverSubscriptions: IMouseOverSubsItem[] = [];\r\n const mouseMoveSubscriptions: IClickSubsItem[] = [];\r\n\r\n const isCheckBoxedTable = getIsSelectionCheckboxesShown(ctx);\r\n\r\n function drawTable(\r\n ctx2d: CanvasRenderingContext2D,\r\n fixedColumnCount: number,\r\n tableRows: ITableRow[]\r\n ) {\r\n renderTable(\r\n ctx,\r\n ctx2d,\r\n tableRows,\r\n groupedColumnSettings.get().map((settings) => settings.columnId),\r\n tableColumnIds.get(),\r\n propertyById.get(),\r\n scrollLeftObs.get(),\r\n scrollTopObs.get(),\r\n viewportWidthObs.get(),\r\n viewportHeightObs.get(),\r\n isCheckBoxedTable,\r\n gridDimensions.displayedColumnDimensionsCom,\r\n gridDimensions.columnWidths,\r\n fixedColumnCount,\r\n clickSubscriptions,\r\n mouseMoveSubscriptions,\r\n mouseOverSubscriptions,\r\n gridDimensions.rowHeight\r\n );\r\n }\r\n\r\n function setScroll(scrollLeft: number, scrollTop: number) {\r\n runInAction(() => {\r\n scrollTopObs.set(scrollTop);\r\n scrollLeftObs.set(scrollLeft);\r\n });\r\n }\r\n\r\n function handleClick(event: any) {\r\n const domRect = event.target.getBoundingClientRect();\r\n const handlingResult = handleTableClick(\r\n event,\r\n event.clientX - domRect.x,\r\n event.clientY - domRect.y,\r\n scrollLeftObs.get(),\r\n scrollTopObs.get(),\r\n clickSubscriptions\r\n );\r\n return handlingResult;\r\n }\r\n\r\n function handleMouseMove(event: any) {\r\n const domRect = event.target.getBoundingClientRect();\r\n const handlingResult = handleTableMouseMove(\r\n event,\r\n event.clientX - domRect.x,\r\n event.clientY - domRect.y,\r\n scrollLeftObs.get(),\r\n scrollTopObs.get(),\r\n mouseMoveSubscriptions\r\n );\r\n return handlingResult;\r\n }\r\n\r\n function setViewportSize(width: number, height: number) {\r\n runInAction(() => {\r\n viewportWidthObs.set(width);\r\n viewportHeightObs.set(height);\r\n });\r\n }\r\n\r\n function getToolTipContent(event: any, boundingRectangle: DOMRect) {\r\n return getTooltip(\r\n event.clientX - boundingRectangle.x + scrollLeftObs.get(),\r\n event.clientY - boundingRectangle.y + scrollTopObs.get(),\r\n mouseOverSubscriptions\r\n );\r\n }\r\n\r\n return {drawTable, setScroll, handleClick, handleMouseMove, setViewportSize, getToolTipContent};\r\n}\r\n\r\nexport const Table: React.FC = (props) => {\r\n const ctxPanelVisibility = React.useContext(CtxPanelVisibility);\r\n return ;\r\n};\r\n\r\n@observer\r\nexport class RawTable extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n tableRenderer = createTableRenderer(this.context.tablePanelView, this.props.gridDimensions);\r\n\r\n @observable _contentBounds: BoundingRect = {\r\n top: 0,\r\n left: 0,\r\n bottom: 0,\r\n right: 0,\r\n width: 0,\r\n height: 0,\r\n };\r\n @computed({equals: comparer.structural}) get contentBounds() {\r\n return this._contentBounds;\r\n }\r\n\r\n set contentBounds(value: BoundingRect) {\r\n this._contentBounds = value;\r\n }\r\n\r\n @observable.ref elmCanvasFixed: Canvas | null = null;\r\n @observable.ref elmCanvasMoving: Canvas | null = null;\r\n\r\n @observable.ref elmCanvasElement: HTMLCanvasElement | null = null;\r\n @observable.ref ctxCanvas: CanvasRenderingContext2D | null = null;\r\n\r\n @observable.ref elmScroller: Scroller | null = null;\r\n\r\n elmMeasure: Measure | null = null;\r\n\r\n @action.bound handleWindowClick(event: any) {\r\n const domNode = ReactDOM.findDOMNode(this.elmScroller);\r\n if (domNode && !domNode.contains(event.target)) {\r\n this.props.onOutsideTableClick && this.props.onOutsideTableClick(event);\r\n }\r\n }\r\n\r\n @action.bound refCanvasFixed(elm: Canvas | null) {\r\n this.elmCanvasFixed = elm;\r\n }\r\n\r\n @action.bound refCanvasMoving(elm: Canvas | null) {\r\n this.elmCanvasMoving = elm;\r\n this.props.refCanvasMovingComponent && this.props.refCanvasMovingComponent(elm);\r\n }\r\n\r\n @action.bound refCanvasElement(elm: HTMLCanvasElement | null) {\r\n this.elmCanvasElement = elm;\r\n if (elm) {\r\n this.ctxCanvas = elm.getContext(\"2d\");\r\n } else {\r\n this.ctxCanvas = null;\r\n }\r\n }\r\n\r\n @action.bound refMeasure(elm: Measure | null) {\r\n this.elmMeasure = elm;\r\n }\r\n\r\n @action.bound refScroller(elm: Scroller | null) {\r\n this.elmScroller = elm;\r\n if (elm) {\r\n this.props.scrollState.scrollToFunction = elm.scrollTo;\r\n window.addEventListener(\"click\", this.handleWindowClick);\r\n } else {\r\n window.removeEventListener(\"click\", this.handleWindowClick);\r\n }\r\n }\r\n\r\n disposers: Array<() => void> = [];\r\n\r\n componentDidMount() {\r\n this.disposers.push(\r\n autorun(\r\n () => {\r\n if (this.ctxCanvas) {\r\n this.tableRenderer.drawTable(\r\n this.ctxCanvas,\r\n this.props.fixedColumnCount,\r\n this.props.tableRows\r\n );\r\n }\r\n },\r\n {\r\n scheduler(fn) {\r\n requestAnimationFrame(fn);\r\n },\r\n }\r\n )\r\n );\r\n this.props.listenForScrollToCell &&\r\n this.disposers.push(\r\n this.props.listenForScrollToCell((rowIdx, colIdx) => {\r\n this.scrollToCellShortest(rowIdx, colIdx);\r\n })\r\n );\r\n }\r\n\r\n componentDidUpdate(prevProps: ITableProps & { isVisible: boolean }) {\r\n if (this.props.isVisible !== prevProps.isVisible) {\r\n this.remeasureCellArea();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.disposers.forEach((d) => d());\r\n }\r\n\r\n @action.bound remeasureCellArea() {\r\n if (this.elmMeasure && (this.elmMeasure as any).measure) {\r\n (this.elmMeasure as any).measure();\r\n }\r\n }\r\n\r\n @action.bound focusTable() {\r\n this.elmScroller && this.elmScroller.focus();\r\n }\r\n\r\n @action.bound scrollToCellShortest(rowIdx: number, dataColumnIndex: number) {\r\n // TODO: Refactor to take real scrollbar sizes\r\n //const freeColIndex = columnIdx + this.fixedColumnCount;\r\n const {gridDimensions} = this.props;\r\n const SCROLLBAR_SIZE = 20;\r\n if (this.elmScroller) {\r\n const top = gridDimensions.getRowTop(rowIdx);\r\n const bottom = gridDimensions.getRowBottom(rowIdx);\r\n const left = gridDimensions.getColumnLeft(dataColumnIndex);\r\n const right = gridDimensions.getColumnRight(dataColumnIndex);\r\n\r\n if (left - this.elmScroller.scrollLeft < this.fixedColumnsWidth) {\r\n this.elmScroller.scrollTo({\r\n scrollLeft: left - this.fixedColumnsWidth,\r\n });\r\n }\r\n if (right - this.elmScroller.scrollLeft > this.contentBounds.width - SCROLLBAR_SIZE) {\r\n this.elmScroller.scrollTo({\r\n scrollLeft: right - this.contentBounds.width + SCROLLBAR_SIZE,\r\n });\r\n }\r\n if (top - this.elmScroller.scrollTop < 0) {\r\n this.elmScroller.scrollTo({scrollTop: top});\r\n }\r\n if (bottom - this.elmScroller.scrollTop > this.contentBounds.height - SCROLLBAR_SIZE) {\r\n this.elmScroller.scrollTo({\r\n scrollTop: bottom - this.contentBounds.height + SCROLLBAR_SIZE,\r\n });\r\n }\r\n }\r\n }\r\n\r\n get fixedColumnCount() {\r\n return this.fixedHeaderContainers.length;\r\n }\r\n\r\n get hasFixedColumns() {\r\n return this.fixedHeaderContainers.length !== 0;\r\n }\r\n\r\n @computed get fixedColumnsWidth() {\r\n return this.fixedHeaderContainers\r\n .map((container) => container.width)\r\n .reduce((x, y) => x + y, 0);\r\n }\r\n\r\n @computed get freeHeaderContainers() {\r\n return this.props.headerContainers.filter((container) => !container.isFixed);\r\n }\r\n\r\n @computed get freeHeaders() {\r\n return this.freeHeaderContainers.map((container) => container.header);\r\n }\r\n\r\n @computed get fixedHeaderContainers() {\r\n return this.props.headerContainers.filter((container) => container.isFixed);\r\n }\r\n\r\n @computed get fixedHeaders() {\r\n return this.fixedHeaderContainers.map((container) => container.header);\r\n }\r\n\r\n get tablePanelView() {\r\n return this.context.tablePanelView as ITablePanelView;\r\n }\r\n\r\n @observable\r\n toolTipData: IToolTipData | undefined = undefined;\r\n\r\n @action.bound onMouseOver(event: any, boundingRectangle: DOMRect) {\r\n this.toolTipData = undefined;\r\n setTimeout(() => {\r\n runInAction(() => {\r\n //console.log(\"mouseOver\", boundingRectangle);\r\n this.mouseInToolTipEnabledArea = true;\r\n //this.toolTipData = this.tableRenderer.getToolTipContent(event, boundingRectangle);\r\n });\r\n });\r\n }\r\n\r\n @action.bound\r\n handleScrollerMouseMove(event: any) {\r\n this.tableRenderer.handleMouseMove(event);\r\n }\r\n\r\n @observable\r\n mouseInToolTipEnabledArea = true;\r\n\r\n @action.bound onMouseLeaveToolTipEnabledArea(event: any) {\r\n this.tablePanelView.currentTooltipText = undefined;\r\n this.mouseInToolTipEnabledArea = false;\r\n }\r\n\r\n @action.bound handleScrollerClick(event: any) {\r\n const {handled} = this.tableRenderer.handleClick(event);\r\n if (!handled) this.props.onOutsideTableClick?.(event);\r\n }\r\n\r\n @action.bound handleResize(contentRect: { bounds: BoundingRect }) {\r\n this.contentBounds = contentRect.bounds;\r\n this.props.onContentBoundsChanged(contentRect.bounds);\r\n this.tableRenderer.setViewportSize(this.contentBounds.width, this.contentBounds.height);\r\n }\r\n\r\n @action.bound handleScroll(event: any, scrollLeft: number, scrollTop: number) {\r\n this.context.tablePanelView.handleTableScroll(event, scrollTop, scrollLeft);\r\n this.props.scrollState.setScrollOffset(event, scrollTop, scrollLeft);\r\n this.tableRenderer.setScroll(scrollLeft, scrollTop);\r\n }\r\n\r\n onColumnDragEnd(result: any) {\r\n if (!result.destination) {\r\n return;\r\n }\r\n let destinationHeaderIndex = Math.floor(result.destination.index); // separators must also have indices (1.5, 2.5, 3.5...)\r\n onColumnOrderChangeFinished(\r\n this.context.tablePanelView,\r\n this.context.tablePanelView.tablePropertyIds[result.source.index],\r\n this.context.tablePanelView.tablePropertyIds[destinationHeaderIndex]\r\n );\r\n }\r\n\r\n render() {\r\n const editorCellRectangle =\r\n this.props.editingRowIndex !== undefined && this.props.editingColumnIndex !== undefined\r\n ? this.tablePanelView.getCellRectangle(\r\n this.props.editingRowIndex,\r\n this.props.editingColumnIndex\r\n )\r\n : undefined;\r\n\r\n return (\r\n
\r\n {this.props.isLoading && (\r\n
\r\n
\r\n \r\n
\r\n
\r\n )}\r\n \r\n {({measureRef, contentRect}) => (\r\n \r\n {() => (\r\n <>\r\n {this.props.headerContainers &&\r\n (contentRect.bounds!.width ? (\r\n
\r\n {this.hasFixedColumns ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n this.onColumnDragEnd(result)}>\r\n \r\n {(provided) => (\r\n // width:\"10000%\" - when the table was horizontally scrolled to the right the drag\r\n // and drop did not work on the headers that were outside of the originally visible area.\r\n // This div has to be at least as wide as ALL its children, not just the visible ones.\r\n
\r\n \r\n
\r\n )}\r\n
\r\n
\r\n \r\n
\r\n ) : null)}\r\n\r\n \r\n <>\r\n {contentRect.bounds!.height ? (\r\n
\r\n \r\n
\r\n ) : null}\r\n {this.props.isEditorMounted && editorCellRectangle && (\r\n this.onMouseLeaveToolTipEnabledArea(event)}\r\n >\r\n {this.props.renderEditor && this.props.renderEditor()}\r\n \r\n )}\r\n this.onMouseLeaveToolTipEnabledArea(event)}\r\n onKeyDown={this.props.onKeyDown}\r\n onFocus={this.props.onFocus}\r\n />\r\n \r\n
\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TagInputEditor } from \"gui/Components/ScreenElements/Editors/TagInputEditor\";\r\nimport { TextEditor } from \"gui/Components/ScreenElements/Editors/TextEditor\";\r\nimport { inject, observer, Provider } from \"mobx-react\";\r\nimport { onFieldChange } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\nimport { onFieldKeyDown } from \"model/actions-ui/DataView/TableView/onFieldKeyDown\";\r\nimport { getRowStateForegroundColor } from \"model/selectors/RowState/getRowStateForegroundColor\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport React from \"react\";\r\nimport { onFieldBlur } from \"model/actions-ui/DataView/TableView/onFieldBlur\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getSelectedRow } from \"model/selectors/DataView/getSelectedRow\";\r\nimport { getCellValue } from \"model/selectors/TablePanelView/getCellValue\";\r\nimport { getSelectedProperty } from \"model/selectors/TablePanelView/getSelectedProperty\";\r\nimport { BoolEditor } from \"gui/Components/ScreenElements/Editors/BoolEditor\";\r\nimport { DateTimeEditor } from \"gui/Components/ScreenElements/Editors/DateTimeEditor\";\r\nimport { NumberEditor } from \"gui/Components/ScreenElements/Editors/NumberEditor\";\r\nimport { BlobEditor } from \"gui/Components/ScreenElements/Editors/BlobEditor\";\r\nimport { XmlBuildDropdownEditor } from \"modules/Editors/DropdownEditor/DropdownEditor\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport uiActions from \"../../../../model/actions-ui-tree\";\r\nimport { isReadOnly } from \"model/selectors/RowState/isReadOnly\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { rowHeight } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellsCommon\";\r\nimport { shadeHexColor } from \"utils/colorUtils\";\r\nimport { getRowStateRowBgColor } from \"model/selectors/RowState/getRowStateRowBgColor\";\r\nimport ColorEditor from \"gui/Components/ScreenElements/Editors/ColorEditor\";\r\nimport { flashColor2htmlColor, htmlColor2FlashColor } from \"utils/flashColorFormat\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\nimport { CellAlignment } from \"gui/Components/ScreenElements/Table/TableRendering/cells/cellAlignment\";\r\n\r\n@inject(({tablePanelView}) => {\r\n const row = getSelectedRow(tablePanelView)!;\r\n const property = getSelectedProperty(tablePanelView)!;\r\n const actualProperty =\r\n property.column === \"Polymorph\" ? property.getPolymophicProperty(row) : property;\r\n return {\r\n property: actualProperty,\r\n getCellValue: () => getCellValue(tablePanelView, row, actualProperty),\r\n onChange: async (event: any, value: any) =>\r\n await onFieldChange(tablePanelView)({\r\n event: event,\r\n row: row,\r\n property: actualProperty,\r\n value: value,\r\n }),\r\n onEditorBlur: (event: any) => onFieldBlur(tablePanelView)(event),\r\n onEditorKeyDown: (event: any) => {\r\n event.persist();\r\n onFieldKeyDown(tablePanelView)(event);\r\n },\r\n };\r\n})\r\n@observer\r\nexport class TableViewEditor extends React.Component<{\r\n property?: IProperty;\r\n getCellValue?: () => any;\r\n onChange?: (event: any, value: any) => Promise;\r\n onEditorBlur?: (event: any) => void;\r\n onEditorKeyDown?: (event: any) => void;\r\n}> {\r\n\r\n componentDidMount() {\r\n const focusManager = getGridFocusManager(this.props.property);\r\n focusManager.focusEditor();\r\n }\r\n\r\n getEditor() {\r\n const rowId = getSelectedRowId(this.props.property);\r\n const foregroundColor = getRowStateForegroundColor(this.props.property, rowId || \"\");\r\n const dataView = getDataView(this.props.property);\r\n const readOnly =\r\n isReadOnly(this.props.property!, rowId) ||\r\n (dataView.orderProperty !== undefined &&\r\n this.props.property?.name === dataView.orderProperty.name);\r\n\r\n const customBackgroundColor = getRowStateRowBgColor(dataView, rowId);\r\n const backgroundColor = readOnly\r\n ? shadeHexColor(customBackgroundColor, -0.1)\r\n : customBackgroundColor;\r\n\r\n const isFirsColumn = getTablePanelView(dataView).firstColumn === this.props.property;\r\n const focusManager = getGridFocusManager(this.props.property);\r\n switch (this.props.property!.column) {\r\n case \"Number\":\r\n return (\r\n this.onDoubleClick(event)}\r\n onEditorBlur={this.props.onEditorBlur}\r\n customStyle={resolveCellAlignment(this.props.property?.style, isFirsColumn, \"Number\")}\r\n subscribeToFocusManager={(editor) =>\r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"Text\":\r\n return (\r\n this.onDoubleClick(event)}\r\n onEditorBlur={this.props.onEditorBlur}\r\n isRichText={false}\r\n isMultiline={this.props.property!.multiline}\r\n subscribeToFocusManager={(editor) =>\r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"Date\":\r\n return (\r\n this.onDoubleClick(event)}\r\n onEditorBlur={this.props.onEditorBlur}\r\n onKeyDown={this.props.onEditorKeyDown}\r\n subscribeToFocusManager={(editor) =>\r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"CheckBox\":\r\n return (\r\n \r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"ComboBox\":\r\n return (\r\n this.onDoubleClick(event)}\r\n isReadOnly={readOnly}\r\n foregroundColor={foregroundColor}\r\n backgroundColor={backgroundColor}\r\n autoSort={this.props.property!.autoSort}\r\n onKeyDown={this.props.onEditorKeyDown}\r\n // subscribeToFocusManager={(input) => input.focus()} // will cause the editor to take focus after opening\r\n subscribeToFocusManager={(editor) =>\r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"Checklist\":\r\n return \"\";\r\n case \"Color\":\r\n return (\r\n this.props.onChange?.(undefined, htmlColor2FlashColor(value))}\r\n onBlur={() => this.props.onEditorBlur?.(undefined)}\r\n onKeyDown={this.props.onEditorKeyDown}\r\n isReadOnly={readOnly}\r\n // subscribeToFocusManager={(input) => input.focus()}\r\n subscribeToFocusManager={(editor) =>\r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"TagInput\":\r\n return (\r\n
\r\n \r\n focusManager.activeEditor = editor\r\n }\r\n tagEditor={\r\n this.onDoubleClick(event)}\r\n onEditorBlur={this.props.onEditorBlur}\r\n />\r\n }\r\n />\r\n
\r\n );\r\n case \"Blob\":\r\n return (\r\n \r\n focusManager.activeEditor = editor\r\n }\r\n />\r\n );\r\n case \"Polymorph\":\r\n console.warn(`Type of polymorphic column was not determined, no editor was rendered`); // eslint-disable-line no-console\r\n return \"\";\r\n default:\r\n console.warn(`Unknown column type \"${this.props.property!.column}\", no editor was rendered`) // eslint-disable-line no-console\r\n return \"\";\r\n }\r\n }\r\n\r\n onDoubleClick(event: any) {\r\n getTablePanelView(this.props.property).setEditing(false);\r\n const dataView = getDataView(this.props.property);\r\n if (!dataView.firstEnabledDefaultAction) {\r\n return;\r\n }\r\n uiActions.actions.onActionClick(dataView.firstEnabledDefaultAction)(\r\n event,\r\n dataView.firstEnabledDefaultAction\r\n );\r\n }\r\n\r\n render() {\r\n return {this.getEditor()};\r\n }\r\n}\r\n\r\n// Makes sure the editor alignment will be the same as the table cell alignment.\r\n// Needed on columns where the alignment can be set in the model.\r\nfunction resolveCellAlignment(customStyle: { [p: string]: string } | undefined, isFirsColumn: boolean, type: string){\r\n let cellAlignment = new CellAlignment(isFirsColumn, type, customStyle);\r\n const style = customStyle ?Object.assign({},customStyle) :{};\r\n style[\"paddingRight\"] = cellAlignment.paddingRight - 1 + \"px\";\r\n style[\"paddingLeft\"] = cellAlignment.paddingLeft + \"px\";\r\n style[\"textAlign\"] = cellAlignment.alignment;\r\n return style;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"./getTablePanelView\";\r\n\r\nexport function getSelectedProperty(ctx: any) {\r\n return getTablePanelView(ctx).selectedProperty;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { selectNextColumn } from \"model/actions/DataView/TableView/selectNextColumn\";\r\nimport { selectPrevColumn } from \"model/actions/DataView/TableView/selectPrevColumn\";\r\nimport { selectPrevRow } from \"model/actions/DataView/selectPrevRow\";\r\nimport { selectNextRow } from \"model/actions/DataView/selectNextRow\";\r\nimport { flushCurrentRowData } from \"model/actions/DataView/TableView/flushCurrentRowData\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { shouldProceedToChangeRow } from \"model/actions-ui/DataView/TableView/shouldProceedToChangeRow\";\r\nimport { getGridFocusManager } from \"model/entities/GridFocusManager\";\r\n\r\nexport function onFieldKeyDown(ctx: any) {\r\n\r\n function isGoingToChangeRow(tabEvent: any) {\r\n return (getTablePanelView(ctx).isFirstColumnSelected() && tabEvent.shiftKey) ||\r\n (getTablePanelView(ctx).isLastColumnSelected() && !tabEvent.shiftKey)\r\n }\r\n\r\n return flow(function*onFieldKeyDown(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n const tablePanelView = getTablePanelView(ctx);\r\n switch (event.key) {\r\n case \"Tab\": {\r\n if (isGoingToChangeRow(event)) {\r\n tablePanelView.setEditing(false);\r\n yield*flushCurrentRowData(ctx)();\r\n\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n\r\n yield dataView.lifecycle.runRecordChangedReaction(function*() {\r\n if (event.shiftKey) {\r\n yield selectPrevColumn(ctx)(true);\r\n } else {\r\n yield selectNextColumn(ctx)(true);\r\n }\r\n });\r\n event.preventDefault();\r\n tablePanelView.dontHandleNextScroll();\r\n tablePanelView.scrollToCurrentCell();\r\n tablePanelView.setEditing(true);\r\n tablePanelView.triggerOnFocusTable();\r\n } else {\r\n if (event.shiftKey) {\r\n selectPrevColumn(ctx)(true);\r\n } else {\r\n selectNextColumn(ctx)(true);\r\n }\r\n event.preventDefault();\r\n\r\n tablePanelView.dontHandleNextScroll();\r\n tablePanelView.scrollToCurrentCell();\r\n yield*flushCurrentRowData(ctx)();\r\n getGridFocusManager(ctx).focusEditor();\r\n }\r\n break;\r\n }\r\n case \"Enter\": {\r\n tablePanelView.setEditing(false);\r\n event.persist?.();\r\n event.preventDefault();\r\n\r\n yield*flushCurrentRowData(ctx)();\r\n\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n return;\r\n }\r\n\r\n yield dataView.lifecycle.runRecordChangedReaction(function*() {\r\n if (event.shiftKey) {\r\n yield*selectPrevRow(ctx)();\r\n } else {\r\n yield*selectNextRow(ctx)();\r\n }\r\n });\r\n\r\n tablePanelView.setEditing(true);\r\n tablePanelView.triggerOnFocusTable();\r\n tablePanelView.scrollToCurrentCell();\r\n break;\r\n }\r\n case \"F2\": {\r\n tablePanelView.setEditing(false);\r\n tablePanelView.triggerOnFocusTable();\r\n break;\r\n }\r\n case \"Escape\": {\r\n tablePanelView.setEditing(false);\r\n tablePanelView.clearCurrentCellEditData();\r\n tablePanelView.triggerOnFocusTable();\r\n break;\r\n }\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onNoCellClick(ctx: any) {\r\n return flow(function*onNoCellClick(event: any) {\r\n try {\r\n yield*getTablePanelView(ctx).onNoCellClick();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onOutsideTableClick(ctx: any) {\r\n return flow(function*onOutsideTableClick(event: any) {\r\n try {\r\n yield*getTablePanelView(ctx).onOutsideTableClick();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getSelectionMember } from \"model/selectors/DataView/getSelectionMember\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { setSelectedStateRowId } from \"model/actions-tree/selectionCheckboxes\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getRowStates } from \"model/selectors/RowState/getRowStates\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function setAllSelectionStates(ctx: any, selectionState: boolean) {\r\n flow(function*() {\r\n try {\r\n yield updateRowStates(ctx);\r\n const dataTable = getDataTable(ctx);\r\n const selectionMember = getSelectionMember(ctx);\r\n if (!!selectionMember) {\r\n for (let row of dataTable.rows) {\r\n const dsField = getDataSourceFieldByName(ctx, selectionMember);\r\n if (dsField) {\r\n dataTable.setDirtyValue(row, selectionMember, selectionState);\r\n }\r\n }\r\n yield*getFormScreenLifecycle(ctx).onFlushData();\r\n for (let row of dataTable.rows) {\r\n const dataSourceField = getDataSourceFieldByName(ctx, selectionMember)!;\r\n const newSelectionState = dataTable.getCellValueByDataSourceField(row, dataSourceField);\r\n const rowId = dataTable.getRowId(row);\r\n yield*setSelectedStateRowId(ctx)(rowId, newSelectionState);\r\n }\r\n } else {\r\n for (let row of dataTable.rows) {\r\n const rowId = dataTable.getRowId(row);\r\n yield*setSelectedStateRowId(ctx)(rowId, selectionState);\r\n }\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n })();\r\n}\r\n\r\nasync function updateRowStates(ctx: any) {\r\n const dataView = getDataView(ctx);\r\n const rowIds = dataView.dataTable.rows.map(row => dataView.dataTable.getRowId(row));\r\n await getRowStates(ctx).loadValues(rowIds);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { setAllSelectionStates } from \"model/actions-tree/setAllSelectionStates\";\r\nimport S from \"./SelectionCheckboxHeader.module.scss\";\r\nimport { action } from \"mobx\";\r\n\r\n@observer\r\nexport class SelectionCheckBoxHeader extends React.Component<{\r\n width: number;\r\n dataView: any;\r\n}> {\r\n @action.bound\r\n onClick(event: any) {\r\n this.props.dataView.selectAllCheckboxChecked = !this.props.dataView.selectAllCheckboxChecked;\r\n setAllSelectionStates(this.props.dataView, this.props.dataView.selectAllCheckboxChecked);\r\n }\r\n\r\n render() {\r\n const isChecked = this.props.dataView.selectAllCheckboxChecked;\r\n return (\r\n
\r\n {isChecked ? : }\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport bind from \"bind-decorator\";\r\nimport { action, computed, observable } from \"mobx\";\r\nimport { inject, observer, Provider } from \"mobx-react\";\r\nimport { onTableKeyDown } from \"model/actions-ui/DataView/TableView/onTableKeyDown\";\r\nimport React, { useContext } from \"react\";\r\nimport { onColumnHeaderClick } from \"model/actions-ui/DataView/TableView/onColumnHeaderClick\";\r\nimport { ITablePanelView } from \"model/entities/TablePanelView/types/ITablePanelView\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { getColumnHeaders } from \"model/selectors/TablePanelView/getColumnHeaders\";\r\nimport { getSelectedColumnIndex } from \"model/selectors/TablePanelView/getSelectedColumnIndex\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\nimport { IColumnHeader } from \"model/selectors/TablePanelView/types\";\r\nimport { FilterSettings } from \"gui/Components/ScreenElements/Table/FilterSettings/FilterSettings\";\r\nimport { Header } from \"gui/Components/ScreenElements/Table/Header\";\r\nimport { RawTable, Table } from \"gui/Components/ScreenElements/Table/Table\";\r\nimport { IGridDimensions } from \"gui/Components/ScreenElements/Table/types\";\r\nimport { TableViewEditor } from \"./TableViewEditor\";\r\nimport { getSelectedRowIndex } from \"model/selectors/DataView/getSelectedRowIndex\";\r\nimport { onNoCellClick } from \"model/actions-ui/DataView/TableView/onNoCellClick\";\r\nimport { onOutsideTableClick } from \"model/actions-ui/DataView/TableView/onOutsideTableClick\";\r\nimport { getFixedColumnsCount } from \"model/selectors/TablePanelView/getFixedColumnsCount\";\r\nimport { getIsSelectionCheckboxesShown } from \"model/selectors/DataView/getIsSelectionCheckboxesShown\";\r\nimport { onColumnWidthChanged } from \"model/actions-ui/DataView/TableView/onColumnWidthChanged\";\r\nimport { onColumnWidthChangeFinished } from \"model/actions-ui/DataView/TableView/onColumnWidthChangeFinished\";\r\nimport { onColumnOrderChangeFinished } from \"model/actions-ui/DataView/TableView/onColumnOrderChangeFinished\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { getLeadingColumnCount } from \"model/selectors/TablePanelView/getLeadingColumnCount\";\r\nimport { getDataTable } from \"model/selectors/DataView/getDataTable\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { SelectionCheckBoxHeader } from \"gui/Components/ScreenElements/Table/SelectionCheckBoxHeader\";\r\nimport { aggregationToString } from \"model/entities/Aggregatioins\";\r\nimport { getOpenedScreen } from \"model/selectors/getOpenedScreen\";\r\nimport { getIsEditing } from \"model/selectors/TablePanelView/getIsEditing\";\r\nimport { ITableConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { CtxDataView, DataViewContext } from \"gui/Components/ScreenElements/DataView\";\r\nimport S from \"./TableView.module.scss\";\r\n\r\ninterface ITableViewProps {\r\n dataView?: IDataView;\r\n tablePanelView?: ITablePanelView;\r\n onColumnDialogCancel?: (event: any) => void;\r\n onColumnDialogOk?: (event: any, configuration: ITableConfiguration) => void;\r\n onTableKeyDown?: (event: any) => void;\r\n}\r\n\r\n@inject(({dataView}) => {\r\n return {\r\n dataView,\r\n tablePanelView: dataView.tablePanelView,\r\n onColumnDialogCancel: dataView.tablePanelView.onColumnConfCancel,\r\n onColumnDialogOk: dataView.tablePanelView.onColumnConfSubmit,\r\n\r\n onTableKeyDown: onTableKeyDown(dataView),\r\n };\r\n})\r\n@observer\r\nexport class TableViewInner extends React.Component {\r\n constructor(props: any) {\r\n super(props);\r\n\r\n this.props.dataView?.initializeNewScrollLoader();\r\n getGroupingConfiguration(this.props.dataView).registerGroupingOnOffHandler(() => {\r\n this.props.dataView?.initializeNewScrollLoader();\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n const openScreen = getOpenedScreen(this.props.dataView);\r\n const dataViews = openScreen.content.formScreen?.dataViews;\r\n const isMainDataView =\r\n (dataViews && dataViews.length > 0 && this.props.dataView?.isBindingRoot) ||\r\n dataViews?.length === 1;\r\n\r\n if (openScreen.isActive && isMainDataView) {\r\n if (!this.props.dataView?.isFormViewActive()) {\r\n const tablePanelView = getTablePanelView(this.props.dataView);\r\n tablePanelView.triggerOnFocusTable();\r\n }\r\n }\r\n }\r\n\r\n refTableDisposer: any;\r\n refTable = (elmTable: RawTable | null) => {\r\n this.elmTable = elmTable;\r\n if (elmTable) {\r\n const d1 = this.props.tablePanelView!.subOnFocusTable(elmTable.focusTable);\r\n const d2 = this.props.tablePanelView!.subOnScrollToCellShortest(\r\n elmTable.scrollToCellShortest\r\n );\r\n this.refTableDisposer = () => {\r\n d1();\r\n d2();\r\n };\r\n } else {\r\n this.refTableDisposer && this.refTableDisposer();\r\n }\r\n };\r\n\r\n elmTable: RawTable | null = null;\r\n\r\n headerRenderer = new HeaderRenderer({\r\n gridDimensions: this.props.dataView!.gridDimensions,\r\n tablePanelView: this.props.tablePanelView!,\r\n getFixedColumnCount: () => getFixedColumnsCount(this.props.tablePanelView),\r\n getIsSelectionCheckboxes: () => getIsSelectionCheckboxesShown(this.props.tablePanelView),\r\n dataView: this.props.dataView!,\r\n getColumnHeaders: () => getColumnHeaders(this.props.dataView),\r\n getTableViewProperties: () => getTableViewProperties(this.props.dataView),\r\n onColumnWidthChange: (propertyId, width) =>\r\n onColumnWidthChanged(this.props.tablePanelView, propertyId, width),\r\n onColumnOrderChange: (id1, id2) =>\r\n onColumnOrderChangeFinished(this.props.tablePanelView, id1, id2),\r\n onColumnOrderAttendantsChange: (idSource, idTarget) =>\r\n this.onColumnOrderAttendantsChange(idSource, idTarget),\r\n });\r\n\r\n onColumnOrderAttendantsChange(idSource: string | undefined, idTarget: string | undefined) {\r\n this.props.tablePanelView!.setColumnOrderChangeAttendants(idSource, idTarget);\r\n getDataTable(this.props.dataView).unlockAddedRowPosition();\r\n }\r\n\r\n @action.bound\r\n handleTableKeyDown(event: any) {\r\n this.props.onTableKeyDown?.(event);\r\n this.props.dataViewContext?.handleTableKeyDown(event);\r\n }\r\n\r\n render() {\r\n const self = this;\r\n const isSelectionCheckboxes = getIsSelectionCheckboxesShown(this.props.tablePanelView);\r\n const editingRowIndex = getSelectedRowIndex(this.props.tablePanelView);\r\n let editingColumnIndex = getSelectedColumnIndex(this.props.tablePanelView);\r\n if (editingColumnIndex !== undefined && isSelectionCheckboxes) {\r\n editingColumnIndex++;\r\n }\r\n const fixedColumnCount = this.props.tablePanelView\r\n ? this.props.tablePanelView.fixedColumnCount || 0\r\n : 0;\r\n\r\n return (\r\n \r\n <>\r\n (\r\n \r\n )}\r\n onNoCellClick={onNoCellClick(this.props.tablePanelView)}\r\n onOutsideTableClick={onOutsideTableClick(this.props.tablePanelView)}\r\n onContentBoundsChanged={(bounds) => (this.props.dataView!.contentBounds = bounds)}\r\n refCanvasMovingComponent={this.props.tablePanelView!.setTableCanvas}\r\n onKeyDown={this.handleTableKeyDown}\r\n refTable={this.refTable}\r\n onFocus={() =>\r\n (getFormScreenLifecycle(\r\n this.props.dataView\r\n ).focusedDataViewId = this.props.dataView?.id)\r\n }\r\n />\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport function TableView(props: ITableViewProps) {\r\n const dataViewContext = useContext(CtxDataView);\r\n return ;\r\n}\r\n\r\ninterface IHeaderRendererData {\r\n getTableViewProperties: () => IProperty[];\r\n\r\n tablePanelView: ITablePanelView;\r\n getColumnHeaders: () => IColumnHeader[];\r\n getIsSelectionCheckboxes: () => boolean;\r\n onColumnWidthChange: (id: string, newWidth: number) => void;\r\n onColumnOrderChange: (id: string, targetId: string) => void;\r\n onColumnOrderAttendantsChange: (\r\n idSource: string | undefined,\r\n idTarget: string | undefined\r\n ) => void;\r\n dataView: IDataView;\r\n gridDimensions: IGridDimensions;\r\n getFixedColumnCount: () => number;\r\n}\r\n\r\nclass HeaderRenderer implements IHeaderRendererData {\r\n constructor(data: IHeaderRendererData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n gridDimensions: IGridDimensions = null as any;\r\n getTableViewProperties: () => IProperty[] = null as any;\r\n getIsSelectionCheckboxes: () => boolean = null as any;\r\n dataView: IDataView = null as any;\r\n getFixedColumnCount = null as any;\r\n\r\n @computed get tableViewPropertiesOriginal() {\r\n return this.getTableViewProperties();\r\n }\r\n\r\n @computed get tableViewProperties() {\r\n return this.tableViewPropertiesOriginal;\r\n }\r\n\r\n getColumnHeaders: () => IColumnHeader[] = null as any;\r\n onColumnWidthChange: (id: string, newWidth: number) => void = null as any;\r\n onColumnOrderChange: (id: string, targetId: string) => void = null as any;\r\n onColumnOrderAttendantsChange: (\r\n idSource: string | undefined,\r\n idTarget: string | undefined\r\n ) => void = null as any;\r\n tablePanelView: ITablePanelView = null as any;\r\n\r\n columnOrderChangeSourceId: string | undefined;\r\n columnOrderChangeTargetId: string | undefined;\r\n\r\n @computed get columnHeaders() {\r\n return this.getColumnHeaders();\r\n }\r\n\r\n @computed get isSelectionCheckboxes() {\r\n return this.getIsSelectionCheckboxes();\r\n }\r\n\r\n @observable isColumnOrderChanging = false;\r\n\r\n @action.bound handleStartColumnOrderChanging(id: string) {\r\n this.isColumnOrderChanging = true;\r\n this.columnOrderChangeSourceId = id;\r\n this.onColumnOrderAttendantsChange(\r\n this.columnOrderChangeSourceId,\r\n this.columnOrderChangeTargetId\r\n );\r\n }\r\n\r\n @action.bound handleStopColumnOrderChanging(id: string) {\r\n this.isColumnOrderChanging = false;\r\n this.columnOrderChangeSourceId = undefined;\r\n this.columnOrderChangeTargetId = undefined;\r\n this.onColumnOrderAttendantsChange(\r\n this.columnOrderChangeSourceId,\r\n this.columnOrderChangeTargetId\r\n );\r\n }\r\n\r\n @action.bound handlePossibleColumnOrderChange(targetId: string | undefined) {\r\n this.columnOrderChangeTargetId = targetId;\r\n this.onColumnOrderAttendantsChange(\r\n this.columnOrderChangeSourceId,\r\n this.columnOrderChangeTargetId\r\n );\r\n }\r\n\r\n @action.bound handleColumnOrderDrop(targetId: string) {\r\n this.onColumnOrderChange(this.columnOrderChangeSourceId!, targetId);\r\n this.onColumnOrderAttendantsChange(\r\n this.columnOrderChangeSourceId,\r\n this.columnOrderChangeTargetId\r\n );\r\n }\r\n\r\n @computed get headerContainers() {\r\n const columnDimensions = this.gridDimensions.displayedColumnDimensionsCom;\r\n const leadingColumnCount = getLeadingColumnCount(this.dataView);\r\n const selectionCheckBoxesShown = getIsSelectionCheckboxesShown(this.dataView);\r\n const groupingColumnCount = leadingColumnCount - (selectionCheckBoxesShown ? 1 : 0);\r\n const dataColumnCount = columnDimensions.length - leadingColumnCount;\r\n const headerContainers = [];\r\n\r\n if (selectionCheckBoxesShown) {\r\n headerContainers.push(\r\n new HeaderContainer({\r\n header: this.renderSelectionCheckBoxHeader(columnDimensions[0].width),\r\n isFixed: true,\r\n width: columnDimensions[0].width,\r\n })\r\n );\r\n }\r\n\r\n let columnsToFix = this.getFixedColumnCount();\r\n for (let i = 0; i < groupingColumnCount; i++) {\r\n headerContainers.push(\r\n new HeaderContainer({\r\n header: this.renderDummyHeader(columnDimensions[i].width, i),\r\n isFixed: columnsToFix > i,\r\n width: columnDimensions[i].width,\r\n })\r\n );\r\n }\r\n\r\n columnsToFix -= groupingColumnCount;\r\n for (let i = 0; i < dataColumnCount; i++) {\r\n const columnWidth = columnDimensions[i + leadingColumnCount].width;\r\n headerContainers.push(\r\n new HeaderContainer({\r\n header: this.renderDataHeader({\r\n columnIndex: i,\r\n columnWidth: columnWidth,\r\n isFirst: headerContainers.length === 0,\r\n isLast: i === dataColumnCount - 1,\r\n isFixed: columnsToFix > i,\r\n }),\r\n isFixed: columnsToFix > i,\r\n width: columnWidth,\r\n })\r\n );\r\n }\r\n\r\n return headerContainers;\r\n }\r\n\r\n renderDummyHeader(columnWidth: number, columnIndex: number) {\r\n return (\r\n
\r\n );\r\n }\r\n\r\n renderSelectionCheckBoxHeader(columnWidth: number) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n @bind\r\n renderDataHeader(args: { columnIndex: number; columnWidth: number, isFirst: boolean, isLast: boolean, isFixed: boolean }) {\r\n const property = this.tableViewProperties[args.columnIndex];\r\n const header = this.columnHeaders[args.columnIndex];\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n makeAdditionalHeaderContent(columnId: string, property: IProperty, autoFocus: boolean) {\r\n const filterControlsDisplayed = this.tablePanelView.filterConfiguration\r\n .isFilterControlsDisplayed;\r\n if (!filterControlsDisplayed && this.dataView.aggregationData.length === 0) {\r\n return undefined;\r\n }\r\n const headerContent: JSX.Element[] = [];\r\n if (filterControlsDisplayed) {\r\n headerContent.push(
\r\n
);\r\n }\r\n if (this.dataView.aggregationData.length !== 0) {\r\n const aggregation = this.dataView.aggregationData.find((agg) => agg.columnId === columnId);\r\n if (aggregation) {\r\n headerContent.push(\r\n
\r\n {aggregationToString(aggregation, property)}\r\n
\r\n );\r\n }\r\n }\r\n return () => <>{headerContent};\r\n }\r\n}\r\n\r\nexport interface IHeaderContainer {\r\n header: JSX.Element;\r\n isFixed: boolean;\r\n width: number;\r\n}\r\n\r\nclass HeaderContainer implements IHeaderContainer {\r\n constructor(data: IHeaderContainer) {\r\n Object.assign(this, data);\r\n }\r\n\r\n header: JSX.Element = null as any;\r\n isFixed: boolean = null as any;\r\n width: number = null as any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { selectPrevRow } from \"model/actions/DataView/selectPrevRow\";\r\nimport { selectNextRow } from \"model/actions/DataView/selectNextRow\";\r\nimport { selectPrevColumn } from \"model/actions/DataView/TableView/selectPrevColumn\";\r\nimport { selectNextColumn } from \"model/actions/DataView/TableView/selectNextColumn\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { shouldProceedToChangeRow } from \"./shouldProceedToChangeRow\";\r\nimport uiActions from \"../../../actions-ui-tree\";\r\n\r\nexport function onTableKeyDown(ctx: any) {\r\n return flow(function*onTableKeyDown(event: any) {\r\n try {\r\n const dataView = getDataView(ctx);\r\n switch (event.key) {\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n break;\r\n }\r\n yield*selectPrevRow(ctx)();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n if (!(yield shouldProceedToChangeRow(dataView))) {\r\n break;\r\n }\r\n yield*selectNextRow(ctx)();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"ArrowLeft\":\r\n selectPrevColumn(ctx)();\r\n event.preventDefault();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"ArrowRight\":\r\n selectNextColumn(ctx)();\r\n event.preventDefault();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"F2\":\r\n getTablePanelView(ctx).setEditing(true);\r\n event.preventDefault();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"Tab\":\r\n if (event.shiftKey) {\r\n selectPrevColumn(ctx)(true);\r\n } else {\r\n selectNextColumn(ctx)(true);\r\n }\r\n event.preventDefault();\r\n getTablePanelView(ctx).scrollToCurrentCell();\r\n break;\r\n case \"Enter\":\r\n if (dataView.firstEnabledDefaultAction) {\r\n uiActions.actions.onActionClick(dataView.firstEnabledDefaultAction)(\r\n event,\r\n dataView.firstEnabledDefaultAction\r\n );\r\n }\r\n break;\r\n case \"Escape\": {\r\n getTablePanelView(ctx).setEditing(false);\r\n getTablePanelView(ctx).clearCurrentCellEditData();\r\n getTablePanelView(ctx).triggerOnFocusTable();\r\n break;\r\n }\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from \"./getTablePanelView\";\r\n\r\nexport function getFixedColumnsCount(ctx: any) {\r\n return getTablePanelView(ctx).fixedColumnCount;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTableViewProperties } from \"./getTableViewProperties\";\r\nimport { IColumnHeader } from './types';\r\nimport { getPropertyOrdering } from \"../DataView/getPropertyOrdering\";\r\n\r\n\r\nexport function getColumnHeaders(ctx: any): IColumnHeader[] {\r\n const tableViewProperties = getTableViewProperties(ctx);\r\n return tableViewProperties.map(prop => {\r\n const ordering = getPropertyOrdering(ctx, prop.id);\r\n return {\r\n label: prop.name,\r\n id: prop.id,\r\n ordering: ordering.ordering,\r\n order: ordering.order\r\n }\r\n })\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\n\r\nexport function onColumnWidthChanged(ctx: any, id: string, width: number) {\r\n runGeneratorInFlowWithHandler({\r\n ctx: ctx,\r\n generator: function*() {\r\n const prop = getDataViewPropertyById(ctx, id);\r\n if (prop) {\r\n prop.setColumnWidth(width);\r\n }\r\n }()\r\n })\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getTablePanelView } from './getTablePanelView';\r\n\r\nexport function getIsEditing(ctx: any) {\r\n return getTablePanelView(ctx).isEditing;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function onColumnWidthChangeFinished(ctx: any) {\r\n return flow(function*onColumnWidthChangeFinished(id: string, width: number) {\r\n // TODO: Error handling\r\n const prop = getDataViewPropertyById(ctx, id);\r\n if (prop) {\r\n yield*getTablePanelView(ctx).configurationManager.onColumnWidthChanged(id, width);\r\n\r\n // TODO: Error handling\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { action, flow } from \"mobx\";\r\nimport { IDataViewBodyUI, IDataViewToolbarUI } from \"modules/DataView/DataViewUI\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { SectionViewSwitchers } from \"modules/DataView/DataViewTypes\";\r\nimport { getIdent, IIId } from \"utils/common\";\r\nimport { DataViewHeaderAction } from \"gui/Components/DataViewHeader/DataViewHeaderAction\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { Observer } from \"mobx-react\";\r\nimport { ITablePerspective } from \"./TablePerspective\";\r\nimport { IPerspective } from \"../Perspective\";\r\nimport { TableView } from \"gui/Workbench/ScreenArea/TableView/TableView\";\r\nimport { T } from \"../../../../utils/translation\";\r\nimport S from \"./TablePerspectiveDirector.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport class TablePerspectiveDirector implements IIId {\r\n $iid = getIdent();\r\n\r\n constructor(\r\n public dataViewToolbarUI = IDataViewToolbarUI(),\r\n public dataViewBodyUI = IDataViewBodyUI(),\r\n public tablePerspective = ITablePerspective(),\r\n public perspective = IPerspective()\r\n ) {\r\n }\r\n\r\n @action.bound\r\n setup() {\r\n this.dataViewBodyUI.contrib.put({\r\n $iid: this.$iid,\r\n render: () => (\r\n \r\n {() => (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n ),\r\n });\r\n\r\n this.dataViewToolbarUI.contrib.put({\r\n $iid: this.$iid,\r\n section: SectionViewSwitchers,\r\n render: () => (\r\n \r\n {() => (\r\n \r\n \r\n \r\n )}\r\n \r\n ),\r\n });\r\n\r\n this.perspective.contrib.put(this.tablePerspective);\r\n }\r\n\r\n @action.bound\r\n teardown() {\r\n this.dataViewBodyUI.contrib.del(this);\r\n this.dataViewToolbarUI.contrib.del(this);\r\n this.perspective.contrib.del(this.tablePerspective);\r\n }\r\n\r\n dispose() {\r\n this.teardown();\r\n }\r\n}\r\n\r\nexport const ITablePerspectiveDirector = TypeSymbol(\r\n \"ITablePerspectiveDirector\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport { ITablePerspectiveDirector, TablePerspectiveDirector } from \"./TablePerspectiveDirector\";\r\nimport { ITablePerspective, TablePerspective } from \"./TablePerspective\";\r\n\r\nexport const SCOPE_TablePerspective = \"TablePerspective\";\r\n\r\nexport function register($cont: Container) {\r\n $cont\r\n .registerClass(ITablePerspectiveDirector, TablePerspectiveDirector)\r\n .scopedInstance(SCOPE_TablePerspective);\r\n\r\n $cont.registerClass(ITablePerspective, TablePerspective).scopedInstance(SCOPE_TablePerspective);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport { DataViewBodyUI, DataViewToolbarUI, IDataViewBodyUI, IDataViewToolbarUI, } from \"./DataViewUI\";\r\nimport * as PerspectiveModule from \"./Perspective/PerspectiveModule\";\r\n\r\nexport const SCOPE_DataView = \"DataView\";\r\n\r\nexport function register($cont: Container) {\r\n $cont.registerClass(IDataViewBodyUI, DataViewBodyUI).scopedInstance(SCOPE_DataView);\r\n $cont.registerClass(IDataViewToolbarUI, DataViewToolbarUI).scopedInstance(SCOPE_DataView);\r\n // $cont.registerClass(IViewConfiguration, ViewConfiguration);\r\n PerspectiveModule.register($cont);\r\n}\r\n\r\nexport function beginScope($cont: Container) {\r\n return $cont.beginLifetimeScope(SCOPE_DataView);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\n\r\nimport * as MapPerspectiveModule from './MapPerspective/MapPerspectiveModule';\r\nimport * as FormPerspectiveModule from './FormPerspective/FormPerspectiveModule';\r\nimport * as TablePerspectiveModule from './TablePerspective/TablePerspectiveModule';\r\nimport { IPerspective, Perspective } from \"./Perspective\";\r\nimport { SCOPE_DataView } from \"../DataViewModule\";\r\n\r\nexport function register($cont: Container) {\r\n $cont.registerClass(IPerspective, Perspective).scopedInstance(SCOPE_DataView);\r\n\r\n FormPerspectiveModule.register($cont);\r\n MapPerspectiveModule.register($cont);\r\n TablePerspectiveModule.register($cont);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport _ from \"lodash\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class Clock {\r\n debounce(fn: () => void, ms: number) {\r\n return _.debounce(fn, ms);\r\n }\r\n\r\n getTimeMs() {\r\n return new Date().getTime();\r\n }\r\n\r\n setInterval(fn: () => void, ms: number) {\r\n const handle = setInterval(fn, ms);\r\n return () => clearInterval(handle);\r\n }\r\n}\r\n\r\nexport const IClock = TypeSymbol(\"IClock\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { IApi } from \"model/entities/types/IApi\";\r\n\r\nexport class LookupApi {\r\n constructor(private api: () => IApi) {\r\n }\r\n\r\n async getLookupLabels(request: Map>) {\r\n const requestRaw: any[] = [];\r\n for (let [lookupId, v1] of request) {\r\n requestRaw.push({\r\n LookupId: lookupId,\r\n MenuId: undefined,\r\n LabelIds: Array.from(v1.keys()),\r\n });\r\n }\r\n\r\n const resultRaw: { [k: string]: any } = await this.api().getLookupLabelsEx(requestRaw);\r\n const result = new Map>();\r\n for (let [lookupId, lookupResolved] of Object.entries(resultRaw)) {\r\n if (!result.has(lookupId)) {\r\n result.set(lookupId, new Map());\r\n }\r\n const lookupMap = result.get(lookupId)!;\r\n for (let [labelId, labelValue] of Object.entries(lookupResolved)) {\r\n lookupMap.set(labelId, labelValue);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport const ILookupApi = TypeSymbol(\"ILookupApi\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\n\r\nexport class LookupCacheDependencies {\r\n // Mapping semantics: {LookupCacheKey: [LookupId]}\r\n items = new Map>();\r\n\r\n heldLookupIds = new Set();\r\n\r\n @action.bound putValues(values: { [key: string]: string[] }) {\r\n for (let [lookupId, newDeps] of Object.entries(values)) {\r\n for (let newDep of newDeps) {\r\n if (!this.items.has(newDep)) {\r\n this.items.set(newDep, new Set());\r\n }\r\n const lookupRecord = this.items.get(newDep)!;\r\n lookupRecord.add(lookupId);\r\n }\r\n this.heldLookupIds.add(lookupId);\r\n }\r\n }\r\n\r\n getUnhandledLookupIds(inputLookupIds: Set) {\r\n return new Set(Array.from(inputLookupIds).filter((id) => !this.heldLookupIds.has(id)));\r\n }\r\n\r\n getDependencyLookupIdsByCacheKeys(cacheKeys: string[]) {\r\n const collectedIds = new Set();\r\n for (let key of cacheKeys) {\r\n const ids = this.items.get(key) || [];\r\n for (let id of ids) collectedIds.add(id);\r\n }\r\n return collectedIds;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport { LookupCacheMulti } from \"./LookupCacheMulti\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class LookupCacheIndividual {\r\n constructor(private lookupId: string, private cache: LookupCacheMulti) {\r\n }\r\n\r\n getLookupLabels() {\r\n return this.cache.getLookupLabels(this.lookupId) || new Map();\r\n }\r\n\r\n addLookupLabels(labels: Map) {\r\n this.cache.addLookupLabels(this.lookupId, labels);\r\n }\r\n\r\n @action.bound\r\n clean() {\r\n this.cache.clean(this.lookupId);\r\n }\r\n}\r\n\r\nexport const ILookupCacheIndividual = TypeSymbol(\"ILookupCacheIndividual\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { Clock } from \"./Clock\";\r\nimport { LookupLabelsCleanerReloader, } from \"./LookupCleanerLoader\";\r\n\r\nexport class LookupCacheMulti {\r\n constructor(\r\n private clock: Clock,\r\n private cleanerReloader: (lookupId: string) => LookupLabelsCleanerReloader\r\n ) {\r\n }\r\n\r\n labels = new Map>();\r\n recordBirthdate = new Map();\r\n\r\n disposers: any[] = [];\r\n\r\n startup() {\r\n this.disposers.push(this.clock.setInterval(this.handleOutdatingTimerTick, 60 * 1000));\r\n }\r\n\r\n teardown() {\r\n for (let d of this.disposers) d();\r\n }\r\n\r\n @action.bound\r\n handleOutdatingTimerTick() {\r\n const now = this.clock.getTimeMs();\r\n const idsToClean: string[] = [];\r\n for (let lookupId of this.labels.keys()) {\r\n if (now - this.recordBirthdate.get(lookupId)! >= 10 * 60 * 1000) {\r\n idsToClean.push(lookupId);\r\n }\r\n }\r\n for (let id of idsToClean) {\r\n this.cleanerReloader(id).reloadLookupLabels();\r\n }\r\n }\r\n\r\n getLookupLabels(lookupId: string) {\r\n return this.labels.get(lookupId);\r\n }\r\n\r\n addLookupLabels(lookupId: string, labels: Map) {\r\n if (!this.labels.has(lookupId)) {\r\n this.labels.set(lookupId, new Map());\r\n this.recordBirthdate.set(lookupId, this.clock.getTimeMs());\r\n }\r\n const indivLabels = this.labels.get(lookupId)!;\r\n for (let [k, v] of labels.entries()) {\r\n indivLabels.set(k, v);\r\n }\r\n }\r\n\r\n @action.bound\r\n clean(lookupId: string) {\r\n this.labels.delete(lookupId);\r\n this.recordBirthdate.delete(lookupId);\r\n }\r\n}\r\n\r\nexport const ILookupCacheMulti = TypeSymbol(\"ILookupCacheMulti\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { LookupCacheIndividual } from \"./LookupCacheIndividual\";\r\nimport { LookupResolver } from \"./LookupResolver\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class LookupLabelsCleanerReloader {\r\n constructor(private cache: LookupCacheIndividual, private resolver: LookupResolver) {\r\n }\r\n\r\n reloadLookupLabels() {\r\n this.cache.clean();\r\n this.resolver.cleanAndReload();\r\n }\r\n}\r\n\r\nexport const ILookupLabelsCleanerReloader = TypeSymbol(\"ILookupLabelsCleanerReloader\");\r\nexport const IGetLookupLabelsCleanerReloader = TypeSymbol<(lookupId: string) => LookupLabelsCleanerReloader>(\r\n \"IGetLookupLabelsCleanerReloader\"\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport class PubSub {\r\n idGen = 1;\r\n handlers = new Map void>();\r\n\r\n subscribe(fn: (args: T) => void) {\r\n const myId = this.idGen++;\r\n this.handlers.set(myId, fn);\r\n return () => this.handlers.delete(myId);\r\n }\r\n\r\n trigger(args: T) {\r\n for (let h of this.handlers.values()) h(args);\r\n }\r\n}\r\n\r\nexport const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\r\n\r\nexport type InterfaceOf = {\r\n [K in keyof C]: C[K]\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action } from \"mobx\";\r\nimport { ILookupMultiResultListenerArgs, LookupLoaderMulti } from \"./LookupLoaderMulti\";\r\nimport { PubSub } from \"./common\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport interface ILookupIndividualResultListenerArgs {\r\n labels: Map;\r\n}\r\n\r\nexport class LookupLoaderIndividual {\r\n constructor(public lookupId: string, private loader: LookupLoaderMulti) {\r\n }\r\n\r\n @action.bound\r\n handleResultingLabels(args: ILookupMultiResultListenerArgs) {\r\n for (let [k, v] of args.labels.entries()) {\r\n if (k === this.lookupId) this.resultListeners.trigger({labels: v});\r\n }\r\n }\r\n\r\n resultListeners = new PubSub();\r\n\r\n setInterrest(key: any) {\r\n this.loader.setInterrest(this.lookupId, key);\r\n }\r\n\r\n resetInterrest(key: any) {\r\n this.loader.resetInterrest(this.lookupId, key);\r\n }\r\n\r\n async loadList(labelIds: Set) {\r\n return this.loader.loadList(this.lookupId, labelIds);\r\n }\r\n\r\n isWorking(key: any) {\r\n return this.loader.isWorking(this.lookupId, key);\r\n }\r\n}\r\n\r\nexport const ILookupLoaderIndividual = TypeSymbol(\"ILookupLoaderIndividual\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, createAtom, observable } from \"mobx\";\r\nimport { PubSub } from \"./common\";\r\nimport { LookupApi } from \"./LookupApi\";\r\nimport { Clock } from \"./Clock\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport interface ILookupMultiResultListenerArgs {\r\n labels: Map>;\r\n}\r\n\r\nexport class LookupLoaderMulti {\r\n constructor(private clock: Clock, private api: LookupApi) {\r\n this.triggerLoadDeb = clock.debounce(this.triggerLoadImm, 667);\r\n }\r\n\r\n // lookupId -> lookupKey -> something 🦄\r\n interrests = new Map>();\r\n loading = new Map>();\r\n loadingAtom = createAtom(\r\n \"LookupLoading\",\r\n () => {\r\n },\r\n () => {\r\n }\r\n );\r\n\r\n resultListeners = new PubSub();\r\n\r\n @observable isLoading = false;\r\n\r\n @action.bound\r\n async triggerLoadImm() {\r\n // TODO: Rewrite as a flow to preserve mobx transaction\r\n if (this.isLoading) return;\r\n try {\r\n do {\r\n this.isLoading = true;\r\n /*console.log(\"Will load:\");\r\n for (let [l1k, l1v] of this.interrests.entries()) {\r\n console.log(` ${l1k}:`);\r\n for (let [l2k, l2v] of l1v.entries()) {\r\n console.log(` ${l2k}`);\r\n }\r\n }*/\r\n\r\n for (let [k, v] of this.interrests.entries()) {\r\n this.loading.set(k, v);\r\n }\r\n this.interrests.clear();\r\n this.loadingAtom.reportChanged();\r\n\r\n const result = await this.api.getLookupLabels(this.loading);\r\n\r\n for (let [l1k, l1v] of result.entries()) {\r\n l1k = String(l1k).toLowerCase();\r\n if (!this.loading.has(l1k)) continue;\r\n for (let l2k of l1v.keys()) {\r\n l2k = String(l2k).toLowerCase();\r\n this.loading.get(l1k)!.delete(l2k);\r\n }\r\n if (this.loading.get(l1k)!.size === 0) {\r\n this.loading.delete(l1k);\r\n }\r\n }\r\n this.loadingAtom.reportChanged();\r\n\r\n this.resultListeners.trigger({labels: result});\r\n } while (this.interrests.size > 0);\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n triggerLoadDeb = () => {\r\n };\r\n\r\n setInterrest(lookupId: string, key: any) {\r\n // Maybe it is loading right now.\r\n if (this.loading.has(lookupId) && this.loading.get(lookupId)!.has(key)) return;\r\n\r\n // Not yet loading, record that someon is interrested.\r\n if (!this.interrests.has(lookupId)) {\r\n this.interrests.set(lookupId, new Map());\r\n }\r\n const lookupInterrests = this.interrests.get(lookupId)!;\r\n lookupInterrests.set(key, true);\r\n\r\n // Schedule actual loading.\r\n this.triggerLoadDeb();\r\n }\r\n\r\n resetInterrest(lookupId: string, key: any) {\r\n if (!this.interrests.has(lookupId)) {\r\n return;\r\n }\r\n const lookupInterrests = this.interrests.get(lookupId)!;\r\n lookupInterrests.delete(key);\r\n if (lookupInterrests.size === 0) {\r\n this.interrests.delete(lookupId);\r\n }\r\n }\r\n\r\n async loadList(lookupId: string, labelIds: Set) {\r\n return this.api.getLookupLabels(\r\n new Map([[lookupId, new Map(Array.from(labelIds.keys()).map((labelId) => [labelId, true]))]])\r\n );\r\n }\r\n\r\n isWorking(lookupId: string, key: any) {\r\n this.loadingAtom.reportObserved();\r\n return this.loading.get(lookupId)?.has(key) || false;\r\n }\r\n}\r\n\r\nexport const ILookupLoaderMulti = TypeSymbol(\"ILookupLoaderMulti\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { action, createAtom, IAtom } from \"mobx\";\r\nimport _ from \"lodash\";\r\nimport { LookupCacheIndividual } from \"./LookupCacheIndividual\";\r\nimport { ILookupIndividualResultListenerArgs, LookupLoaderIndividual, } from \"./LookupLoaderIndividual\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport class LookupResolver {\r\n constructor(private cache: LookupCacheIndividual, private loader: LookupLoaderIndividual) {\r\n }\r\n\r\n resolved = new Map();\r\n atoms = new Map();\r\n\r\n globalAtom = createAtom(\r\n \"LookupGlobal\",\r\n () => {\r\n },\r\n () => {\r\n }\r\n );\r\n\r\n handleAtomObserved(key: any, atom: IAtom) {\r\n this.atoms.set(key, atom);\r\n if (!this.resolved.has(key)) {\r\n this.loader.setInterrest(key);\r\n }\r\n }\r\n\r\n handleAtomUnobserved(key: any, atom: IAtom) {\r\n this.atoms.delete(key);\r\n this.loader.resetInterrest(key);\r\n }\r\n\r\n @action.bound\r\n cleanAndReload() {\r\n const keysToDelete: any[] = [];\r\n for (let k of this.resolved.keys()) {\r\n if (!this.atoms.has(k)) {\r\n keysToDelete.push(k);\r\n } else {\r\n this.loader.setInterrest(k);\r\n }\r\n }\r\n for (let k of keysToDelete) {\r\n this.resolved.delete(k);\r\n }\r\n // This one might not be needed?\r\n this.globalAtom.reportChanged();\r\n }\r\n\r\n @action.bound\r\n handleResultingLabels(args: ILookupIndividualResultListenerArgs) {\r\n for (let [k, v] of args.labels) {\r\n this.resolved.set(k, v);\r\n }\r\n this.cache.addLookupLabels(this.resolved);\r\n this.globalAtom.reportChanged();\r\n }\r\n\r\n resolveValue(key: any) {\r\n // This runs in COMPUTED scope\r\n //debugger\r\n if (_.isString(key)) key = String(key).toLowerCase();\r\n\r\n let value: any = null;\r\n\r\n this.globalAtom.reportObserved();\r\n\r\n if (this.resolved.has(key)) value = this.resolved.get(key)!;\r\n\r\n if (value === null) {\r\n const cachedLabels = this.cache.getLookupLabels();\r\n if (cachedLabels.has(key)) {\r\n this.resolved.set(key, cachedLabels.get(key!));\r\n value = this.resolved.get(key)!;\r\n }\r\n }\r\n\r\n if (!this.atoms.has(key)) {\r\n const atom = createAtom(\r\n `ALookup@${key}`,\r\n () => this.handleAtomObserved(key, atom),\r\n () => this.handleAtomUnobserved(key, atom)\r\n );\r\n atom.reportObserved();\r\n } else {\r\n const atom = this.atoms.get(key)!;\r\n atom.reportObserved();\r\n }\r\n\r\n\r\n return value;\r\n }\r\n\r\n async resolveList(keys: Set): Promise> {\r\n const missingKeys = new Set(keys);\r\n const cachedLabels = this.cache.getLookupLabels();\r\n const cachedResultMap = new Map();\r\n for (let labelId of Array.from(missingKeys.keys())) {\r\n if (this.resolved.has(labelId)) {\r\n missingKeys.delete(labelId);\r\n cachedResultMap.set(labelId, this.resolved.get(labelId));\r\n }\r\n if (cachedLabels.has(labelId)) {\r\n missingKeys.delete(labelId);\r\n cachedResultMap.set(labelId, cachedLabels.get(labelId));\r\n }\r\n }\r\n\r\n const loadedResultMap = await this.loader.loadList(missingKeys);\r\n const entryArray = Array.from(loadedResultMap);\r\n if (entryArray.length === 1) {\r\n this.cache.addLookupLabels(loadedResultMap);\r\n const innerLoadedMap = entryArray[0][1];\r\n this.resolved = new Map([...innerLoadedMap, ...this.resolved]);\r\n return new Map([...innerLoadedMap, ...cachedResultMap]);\r\n }\r\n if (entryArray.length === 0) {\r\n return cachedResultMap;\r\n }\r\n throw new Error(\"More that one lookup result maps\");\r\n }\r\n\r\n isEmptyAndLoading(key: any) {\r\n if (_.isString(key)) key = String(key).toLowerCase();\r\n\r\n if (!this.resolved.has(key)) {\r\n return this.loader.isWorking(key);\r\n } else return false;\r\n }\r\n}\r\n\r\nexport const ILookupResolver = TypeSymbol(\"ILookupResolver\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container, TypeSymbol } from \"dic/Container\";\r\nimport { ILookupId } from \"./LookupModule\";\r\n\r\n\r\nexport class LookupScopeRegistry {\r\n items = new Map();\r\n\r\n addScope($cont: Container) {\r\n this.items.set($cont.resolve(ILookupId), $cont);\r\n }\r\n\r\n removeScope($cont: Container) {\r\n this.items.delete($cont.resolve(ILookupId));\r\n }\r\n\r\n getScope(lookupId: string) {\r\n return this.items.get(lookupId)!;\r\n }\r\n\r\n hasScope(lookupId: string) {\r\n return this.items.has(lookupId);\r\n }\r\n}\r\n\r\nexport const ILookupScopeRegistry = TypeSymbol(\"ILookupScopeRegistry\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container, TypeSymbol } from \"dic/Container\";\r\nimport { ILookupIndividualEngine } from \"model/entities/Property\";\r\nimport { IApi } from \"model/entities/types/IApi\";\r\nimport { Clock } from \"./Clock\";\r\nimport { LookupApi } from \"./LookupApi\";\r\nimport { LookupCacheDependencies } from \"./LookupCacheDependencies\";\r\nimport { LookupCacheIndividual } from \"./LookupCacheIndividual\";\r\nimport { LookupCacheMulti } from \"./LookupCacheMulti\";\r\nimport { LookupLabelsCleanerReloader } from \"./LookupCleanerLoader\";\r\nimport { LookupLoaderIndividual } from \"./LookupLoaderIndividual\";\r\nimport { LookupLoaderMulti } from \"./LookupLoaderMulti\";\r\nimport { LookupResolver } from \"./LookupResolver\";\r\nimport { ILookupScopeRegistry } from \"./LookupScopeRegistry\";\r\n\r\nexport const SCOPE_Lookup = \"Lookup\";\r\n\r\nexport const ILookupId = TypeSymbol(\"ILookupId\");\r\n\r\nexport function register($cont: Container) {\r\n}\r\n\r\nexport function createMultiLookupEngine(origamApi: () => IApi): IMultiLookupEngine {\r\n const lookupCleanerReloaderById = new Map();\r\n const clock = new Clock();\r\n const api = new LookupApi(origamApi);\r\n const lookupCacheMulti = new LookupCacheMulti(\r\n clock,\r\n (lookupId) => lookupCleanerReloaderById.get(lookupId)!\r\n );\r\n const lookupLoaderMulti = new LookupLoaderMulti(clock, api);\r\n const lookupEngineById = new Map();\r\n\r\n const cacheDependencies = new LookupCacheDependencies();\r\n\r\n return {\r\n lookupCacheMulti,\r\n lookupLoaderMulti,\r\n lookupCleanerReloaderById,\r\n lookupEngineById,\r\n cacheDependencies,\r\n startup() {\r\n lookupCacheMulti.startup();\r\n },\r\n teardown() {\r\n lookupCacheMulti.teardown();\r\n },\r\n };\r\n}\r\n\r\nexport interface IMultiLookupEngine {\r\n lookupCacheMulti: LookupCacheMulti;\r\n lookupLoaderMulti: LookupLoaderMulti;\r\n lookupCleanerReloaderById: Map;\r\n lookupEngineById: Map;\r\n cacheDependencies: LookupCacheDependencies;\r\n\r\n startup(): void;\r\n\r\n teardown(): void;\r\n}\r\n\r\nexport function createIndividualLookupEngine(\r\n lookupId: string,\r\n multiLookupEngine: IMultiLookupEngine\r\n) {\r\n const {lookupCacheMulti, lookupLoaderMulti, lookupCleanerReloaderById} = multiLookupEngine;\r\n const lookupCacheIndividual = new LookupCacheIndividual(lookupId, lookupCacheMulti);\r\n const lookupLoaderIndividual = new LookupLoaderIndividual(lookupId, lookupLoaderMulti);\r\n const lookupResolver = new LookupResolver(lookupCacheIndividual, lookupLoaderIndividual);\r\n const lookupCleanerReloader = new LookupLabelsCleanerReloader(\r\n lookupCacheIndividual,\r\n lookupResolver\r\n );\r\n\r\n lookupLoaderIndividual.resultListeners.subscribe(lookupResolver.handleResultingLabels);\r\n const disposers: any[] = [];\r\n return {\r\n lookupResolver,\r\n lookupCleanerReloader,\r\n startup() {\r\n lookupCleanerReloaderById.set(lookupId, lookupCleanerReloader);\r\n disposers.push(\r\n multiLookupEngine.lookupLoaderMulti.resultListeners.subscribe(\r\n lookupLoaderIndividual.handleResultingLabels\r\n )\r\n );\r\n },\r\n teardown() {\r\n lookupCleanerReloaderById.delete(lookupId);\r\n for (let d of disposers) d();\r\n },\r\n cleanAndReload() {\r\n lookupCleanerReloader.reloadLookupLabels();\r\n },\r\n };\r\n}\r\n\r\nexport function beginLookupScope($parent: Container, lookupId: string) {\r\n const $cont = $parent.beginLifetimeScope(SCOPE_Lookup);\r\n $cont.register(ILookupId, () => lookupId).scopedInstance(SCOPE_Lookup);\r\n $cont.resolve(ILookupScopeRegistry).addScope($cont);\r\n $cont.onThisScopeWillDispose(($cont) => $cont.resolve(ILookupScopeRegistry).removeScope($cont));\r\n return $cont;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { PubSub } from \"utils/events\";\r\n\r\nexport class ScreenEvents {\r\n focusField = new PubSub<{ propertyId: string }>();\r\n}\r\n\r\nexport const IScreenEvents = TypeSymbol(\"IScreenEvents\");","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport { IScreenEvents, ScreenEvents } from \"./ScreenEvents\";\r\n\r\nexport const SCOPE_FormScreen = \"FormScreen\";\r\n\r\nexport function register($cont: Container) {\r\n $cont.registerClass(IScreenEvents, ScreenEvents).scopedInstance(SCOPE_FormScreen);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport * as FormScreenModule from './FormScreen/FormScreenModule';\r\nimport { Container } from 'dic/Container';\r\n\r\nexport const SCOPE_Screen = \"Screen\";\r\n\r\nexport function register($cont: Container) {\r\n FormScreenModule.register($cont);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container, ILifetime } from \"dic/Container\";\r\nimport { registerModules } from \"registerModules\";\r\n\r\nconst $root = new Container({defaultLifetime: ILifetime.PerLifetimeScope});\r\nregisterModules($root);\r\n\r\nexport default $root;","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Container } from \"dic/Container\";\r\nimport * as PerspectiveModule from \"modules/DataView/Perspective/PerspectiveModule\";\r\nimport * as DataViewModule from \"modules/DataView/DataViewModule\";\r\nimport * as LookupModule from \"modules/Lookup/LookupModule\";\r\nimport * as ScreenModule from \"modules/Screen/ScreenModule\";\r\n\r\nexport function registerModules($cont: Container) {\r\n DataViewModule.register($cont);\r\n PerspectiveModule.register($cont);\r\n LookupModule.register($cont);\r\n ScreenModule.register($cont);\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport xmlJs from \"xml-js\";\r\nimport axios, { AxiosInstance } from \"axios\";\r\n\r\nimport _ from \"lodash\";\r\nimport {\r\n IApi,\r\n IEntityExportField,\r\n ILazyLoadedEntityInput,\r\n IUIGridFilterCoreConfiguration,\r\n IUpdateData\r\n} from \"./types/IApi\";\r\nimport { IAggregationInfo } from \"./types/IAggregationInfo\";\r\nimport { IOrdering } from \"./types/IOrderingConfiguration\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { IAboutInfo } from \"./types/IAboutInfo\";\r\nimport { T } from \"utils/translation\";\r\nimport fileDownload from \"js-file-download\";\r\nimport { ITableConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { PubSub } from \"utils/events\";\r\n\r\n\r\nexport enum IAuditLogColumnIndices {\r\n Id = 0,\r\n DateTime = 1,\r\n UserName = 2,\r\n FieldName = 3,\r\n OldValue = 4,\r\n NewValue = 5,\r\n ActionType = 6,\r\n}\r\n\r\nexport class OrigamAPI implements IApi {\r\n constructor(errorHandler: (error: any) => void) {\r\n this.urlPrefix = \"/internalApi\";\r\n this.chatroomsUrlPrefix = \"/chatrooms\";\r\n this.axiosInstance = this.createAxiosInstance();\r\n this.errorHandler = errorHandler;\r\n }\r\n\r\n private createAxiosInstance() {\r\n const axiosInstance = axios.create({\r\n baseURL: this.urlPrefix,\r\n headers: this.httpAuthHeader,\r\n });\r\n\r\n axiosInstance.interceptors.response.use(\r\n (response) => {\r\n this.onApiResponse.trigger({});\r\n return response;\r\n },\r\n async (error) => {\r\n if (error.response?.data?.constructor?.name === 'Blob') {\r\n error.response.data = await error.response.data.text();\r\n }\r\n if (!axios.isCancel(error)) {\r\n this.errorHandler(error);\r\n }\r\n throw error;\r\n }\r\n );\r\n return axiosInstance;\r\n }\r\n\r\n onApiResponse = new PubSub<{}>();\r\n\r\n errorHandler: (error: any) => void;\r\n axiosInstance: AxiosInstance;\r\n urlPrefix: string;\r\n chatroomsUrlPrefix: string;\r\n accessToken = \"\";\r\n\r\n setAccessToken(token: string) {\r\n this.accessToken = token;\r\n this.axiosInstance = this.createAxiosInstance();\r\n }\r\n\r\n resetAccessToken(): void {\r\n this.accessToken = \"\";\r\n }\r\n\r\n get httpAuthHeader() {\r\n return {\r\n Authorization: `Bearer ${this.accessToken}`,\r\n };\r\n }\r\n\r\n createCanceller(): () => void {\r\n const tokenSource = axios.CancelToken.source();\r\n const token = tokenSource.token;\r\n const canceller = () => {\r\n tokenSource.cancel();\r\n };\r\n canceller.token = token;\r\n return canceller as any;\r\n }\r\n\r\n _getCancelToken(canceller: any) {\r\n return canceller.any;\r\n }\r\n\r\n async login(credentials: { UserName: string; Password: string }) {\r\n return (await this.axiosInstance.post(\"/User/Login\", credentials)).data;\r\n }\r\n\r\n async logout() {\r\n return await this.axiosInstance.post(\"/User/Logout\", {});\r\n }\r\n\r\n async getScreen(id: string) {\r\n return xmlJs.xml2js(\r\n (\r\n await this.axiosInstance.get(\"/UI/GetUI\", {\r\n params: {id},\r\n headers: this.httpAuthHeader,\r\n })\r\n ).data,\r\n {addParent: true, alwaysChildren: true}\r\n );\r\n }\r\n\r\n async initUI(data: {\r\n Type: string;\r\n FormSessionId: string | undefined;\r\n IsNewSession: boolean;\r\n RegisterSession: boolean;\r\n DataRequested: boolean;\r\n ObjectId: string;\r\n Caption: string;\r\n Parameters: { [key: string]: any };\r\n IsSingleRecordEdit?: boolean;\r\n RequestCurrentRecordId: boolean;\r\n }) {\r\n const result = (await this.axiosInstance.post(\"/UIService/InitUI\", data)).data;\r\n return {\r\n ...result,\r\n formDefinition: xmlJs.xml2js(result.formDefinition, {\r\n addParent: true,\r\n alwaysChildren: true,\r\n }),\r\n };\r\n }\r\n\r\n async destroyUI(data: { FormSessionId: string }) {\r\n return (await this.axiosInstance.get(`/UIService/DestroyUI/${data.FormSessionId}`)).data;\r\n }\r\n\r\n async getEntities(query: {\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n Ordering: Array<[string, string]>;\r\n ColumnNames: string[];\r\n Filter: string;\r\n RowLimit?: number;\r\n MasterRowId?: string;\r\n }) {\r\n const response = (await this.axiosInstance.post(\"/Data/GetRows\", query)).data;\r\n\r\n if (_.isString(response.data)) {\r\n return [];\r\n } else {\r\n return response.data;\r\n }\r\n }\r\n\r\n async getLookupLabels(query: {\r\n LookupId: string;\r\n MenuId: string | undefined;\r\n LabelIds: string[];\r\n }) {\r\n return (await this.axiosInstance.post(\"/UIService/GetLookupLabels\", query)).data;\r\n }\r\n\r\n async getLookupLabelsEx(\r\n query: {\r\n LookupId: string;\r\n MenuId: string | undefined;\r\n LabelIds: string[];\r\n }[]\r\n ) {\r\n if (query.length === 1 && query[0].LabelIds.length === 0) {\r\n return {LookupId: {}}\r\n }\r\n return (await this.axiosInstance.post(\"/UIService/GetLookupLabelsEx\", query)).data;\r\n }\r\n\r\n async newEntity(data: { DataStructureEntityId: string; MenuId: string }) {\r\n return (await this.axiosInstance.post(\"/Data/NewEmptyRow\", data)).data;\r\n }\r\n\r\n async putEntity(data: {\r\n DataStructureEntityId: string;\r\n RowId: string;\r\n NewValues: { [key: string]: any };\r\n MenuId: string;\r\n }) {\r\n return (await this.axiosInstance.put(\"/Data/Row\", data)).data;\r\n }\r\n\r\n async postEntity(data: {\r\n DataStructureEntityId: string;\r\n NewValues: { [key: string]: any };\r\n MenuId: string;\r\n }) {\r\n return (await this.axiosInstance.post(\"/Data/Row\", data)).data;\r\n }\r\n\r\n async deleteEntity(data: {\r\n DataStructureEntityId: string;\r\n RowIdToDelete: string;\r\n MenuId: string;\r\n }) {\r\n return (\r\n await this.axiosInstance.request({\r\n url: `${this.urlPrefix}/Data/Row`,\r\n method: \"DELETE\",\r\n data,\r\n headers: this.httpAuthHeader,\r\n })\r\n ).data;\r\n }\r\n\r\n async createEntity() {\r\n // TODO\r\n }\r\n\r\n async createSession(data: {\r\n MenuId: string;\r\n Parameters: { [key: string]: any };\r\n InitializeStructure: boolean;\r\n }) {\r\n return (await this.axiosInstance.post(\"/Session/CreateSession\", data)).data;\r\n }\r\n\r\n async deleteSession() {\r\n }\r\n\r\n async saveSession(sessionFormIdentifier: string) {\r\n return (await this.axiosInstance.get(`/UIService/SaveData/${sessionFormIdentifier}`)).data;\r\n }\r\n\r\n async saveSessionQuery(sessionFormIdentifier: string) {\r\n return (await this.axiosInstance.get(`/UIService/SaveDataQuery/${sessionFormIdentifier}`)).data;\r\n }\r\n\r\n async refreshSession(sessionFormIdentifier: string) {\r\n return (await this.axiosInstance.get(`/UIService/RefreshData/${sessionFormIdentifier}`)).data;\r\n }\r\n\r\n async revertChanges(data: { sessionFormIdentifier: string }) {\r\n await this.axiosInstance.post(\"/UIService/RevertChanges\", data);\r\n }\r\n\r\n async sessionChangeMasterRecord(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n RowId: string;\r\n }) {\r\n return (await this.axiosInstance.post(\"/Session/ChangeMasterRecord\", data)).data;\r\n }\r\n\r\n async sessionDeleteEntity(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n RowId: string;\r\n }) {\r\n return (await this.axiosInstance.post(\"/Session/DeleteRow\", data)).data;\r\n }\r\n\r\n async sessionCreateEntity(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Values: { [key: string]: any };\r\n Parameters: { [key: string]: any };\r\n RequestingGridId: string;\r\n }) {\r\n return (await this.axiosInstance.post(`/Session/CreateRow`, data)).data;\r\n }\r\n\r\n async sessionGetEntity(data: {\r\n sessionFormIdentifier: string;\r\n childEntity: string;\r\n parentRecordId: string;\r\n rootRecordId: string;\r\n }) {\r\n return (\r\n await this.axiosInstance.get(\"/Session/Rows\", {\r\n params: data,\r\n headers: this.httpAuthHeader,\r\n })\r\n ).data;\r\n }\r\n\r\n // TODO: Remove this method.\r\n async sessionUpdateEntity(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Id: string;\r\n Property: string;\r\n NewValue: any;\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/Session/UpdateRow\", data)).data;\r\n }\r\n\r\n async getLookupList(data: {\r\n DataStructureEntityId?: string;\r\n FormSessionIdentifier?: string;\r\n Entity?: string;\r\n ColumnNames: string[];\r\n Property: string;\r\n Id: string;\r\n LookupId: string;\r\n Parameters?: { [key: string]: any };\r\n ShowUniqueValues: boolean;\r\n SearchText: string;\r\n PageSize: number;\r\n PageNumber: number;\r\n MenuId: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/GetLookupList\", data)).data;\r\n }\r\n\r\n async getLookupCacheDependencies(data: { LookupIds: string[] }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/GetLookupCacheDependencies\", data)).data;\r\n }\r\n\r\n async getNotificationBoxContent(): Promise {\r\n return (await this.axiosInstance.get(\"/UIService/GetNotificationBoxContent\")).data;\r\n }\r\n\r\n async defaultLocalizationCookie(): Promise {\r\n return (await this.axiosInstance.get(\"/UIService/DefaultLocalizationCookie\")).data;\r\n }\r\n\r\n async initPortal(): Promise {\r\n const data = (await this.axiosInstance.get(\"/UIService/InitPortal\")).data;\r\n\r\n return {\r\n ...data,\r\n menu: xmlJs.xml2js(data.menu, {addParent: true, alwaysChildren: true}),\r\n };\r\n }\r\n\r\n async setMasterRecord(\r\n data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n RowId: string;\r\n },\r\n canceller?: any\r\n ) {\r\n return (\r\n (\r\n await this.axiosInstance.post(\"/UIService/MasterRecord\", data, {\r\n headers: this.httpAuthHeader,\r\n cancelToken: canceller && canceller.token,\r\n })\r\n )?.data ?? []\r\n );\r\n }\r\n\r\n async restoreData(data: { SessionFormIdentifier: string; ObjectId: string }) {\r\n return (await this.axiosInstance.post(\"/UIService/RestoreData\", data)).data;\r\n }\r\n\r\n async updateObject(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n UpdateData: IUpdateData[];\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/UpdateObject\", data)).data;\r\n }\r\n\r\n async createObject(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Values: { [key: string]: any };\r\n Parameters: { [key: string]: any };\r\n RequestingGridId: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/CreateObject\", data)).data;\r\n }\r\n\r\n async copyObject(data: {\r\n Entity: string;\r\n SessionFormIdentifier: string;\r\n ForcedValues: {};\r\n RequestingGridId: string;\r\n OriginalId: string;\r\n Entities: string[];\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/CopyObject\", data)).data;\r\n }\r\n\r\n async deleteObject(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Id: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/DeleteObject\", data)).data;\r\n }\r\n\r\n async deleteObjectInOrderedList(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Id: string;\r\n OrderProperty: string;\r\n UpdatedOrderValues: {};\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/DeleteObjectInOrderedList\", data)).data;\r\n }\r\n\r\n async executeActionQuery(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n ActionType: string;\r\n ActionId: string;\r\n ParameterMappings: { [key: string]: any };\r\n SelectedItems: string[];\r\n InputParameters: { [key: string]: any };\r\n }): Promise {\r\n return (await this.axiosInstance.post(\"/UIService/ExecuteActionQuery\", data)).data;\r\n }\r\n\r\n async executeAction(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n ActionType: string;\r\n ActionId: string;\r\n ParameterMappings: { [key: string]: any };\r\n SelectedItems: string[];\r\n InputParameters: { [key: string]: any };\r\n RequestingGrid: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/ExecuteAction`, data)).data;\r\n }\r\n\r\n async getFilterListValues(data: {\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n Property: string;\r\n SessionFormIdentifier: string | undefined;\r\n Filter: string;\r\n FilterLookups?: { [key: string]: string };\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetFilterListValues`, data)).data;\r\n }\r\n\r\n async getGroups(data: {\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n Filter: string | undefined;\r\n FilterLookups?: { [key: string]: string };\r\n Ordering: IOrdering[];\r\n RowLimit: number;\r\n GroupBy: string;\r\n GroupingUnit: string | undefined;\r\n MasterRowId: string | undefined;\r\n GroupByLookupId: string | undefined;\r\n SessionFormIdentifier: string | undefined;\r\n AggregatedColumns: IAggregationInfo[] | undefined;\r\n }): Promise {\r\n const resultData = (await this.axiosInstance.post(`/UIService/GetGroups`, data)).data;\r\n if (resultData.length > 50_000) {\r\n throw new Error(T(\"There are too many groups, choose different grouping options please.\", \"too_many_groups\"));\r\n }\r\n return resultData;\r\n }\r\n\r\n async getAggregations(data: {\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n Filter: string | undefined;\r\n FilterLookups?: { [key: string]: string };\r\n AggregatedColumns: IAggregationInfo[];\r\n SessionFormIdentifier: string | undefined;\r\n MasterRowId: string | undefined;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetAggregations`, data)).data;\r\n }\r\n\r\n async getRows(data: {\r\n MenuId: string;\r\n SessionFormIdentifier: string;\r\n DataStructureEntityId: string;\r\n Ordering: IOrdering[];\r\n RowLimit: number;\r\n RowOffset: number;\r\n Parameters: { [key: string]: string };\r\n ColumnNames: string[];\r\n MasterRowId: string | undefined;\r\n Filter: string;\r\n FilterLookups?: { [key: string]: string };\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetRows`, data)).data;\r\n }\r\n\r\n async getRow(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n RowId: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetRow`, data)).data;\r\n }\r\n\r\n async getData(data: {\r\n SessionFormIdentifier: string;\r\n ChildEntity: string;\r\n ParentRecordId: string;\r\n RootRecordId: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetData`, data)).data;\r\n }\r\n\r\n getReportFromMenu(data: { menuId: string }): Promise;\r\n\r\n async getReportFromMenu(data: { menuId: string }): Promise {\r\n return (await this.axiosInstance.get(`/UIService/ReportFromMenu/${data.menuId}`)).data;\r\n }\r\n\r\n async getRowStates(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n Ids: string[];\r\n }): Promise {\r\n let states = (await this.axiosInstance.post(`/UIService/RowStates`, data)).data;\r\n for (const state of states) {\r\n state.id = state.id.toString();\r\n }\r\n return states;\r\n }\r\n\r\n async saveFavorites(data: {\r\n ConfigXml: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/SaveFavorites`, data)).data;\r\n }\r\n\r\n async getWorkQueueList(): Promise {\r\n return (await this.axiosInstance.get(`/UIService/WorkQueueList`)).data;\r\n }\r\n\r\n async getChatroomList(): Promise {\r\n return (await axios.get(`${this.chatroomsUrlPrefix}/Chat`, {headers: this.httpAuthHeader}))\r\n .data;\r\n }\r\n\r\n async saveObjectConfiguration(data: {\r\n sessionFormIdentifier: string;\r\n instanceId: string;\r\n tableConfigurations: ITableConfiguration[];\r\n customConfigurations?: {[nodeName: string] : string};\r\n defaultView: string;\r\n }): Promise {\r\n let customConfigurationXml = \"\";\r\n if(data.customConfigurations){\r\n const customConfigurations = Object.entries(data.customConfigurations)\r\n .filter(entry => entry[0] && entry[1])\r\n .map(entry => {\r\n const encodedConfig = window.btoa(unescape(encodeURIComponent(entry[1])))\r\n return `<${entry[0]}Configuration>\\n${encodedConfig}\\n`\r\n });\r\n if(customConfigurations.length > 0) {\r\n customConfigurationXml = `\\n${customConfigurations.join(\"\\n\")}\\n`\r\n }\r\n }\r\n\r\n const tableConfigurationsXml = data.tableConfigurations.map(tableConfig => {\r\n return \"\" +\r\n tableConfig.columnConfigurations\r\n .map(columnConfig =>\r\n \" 0 ? ` groupingIndex=\"${columnConfig.groupingIndex}\"` : \"\") +\r\n ` isVisible=\"${columnConfig.isVisible}\"` +\r\n (columnConfig.aggregationType ? ` aggregationType=\"${columnConfig.aggregationType}\"` : \"\") +\r\n \"/>\")\r\n .join(\"\\n\")\r\n + \"\"\r\n })\r\n await this.axiosInstance.post(`/UIService/SaveObjectConfig`, {\r\n ObjectInstanceId: data.instanceId,\r\n SectionNameAndData: {\r\n tableConfigurations: tableConfigurationsXml.join(\"\\n\"),\r\n customConfigurations: customConfigurationXml,\r\n defaultView: ``,\r\n }\r\n });\r\n }\r\n\r\n async resetScreenColumnConfiguration(data: {\r\n instanceId: string;\r\n }): Promise {\r\n await this.axiosInstance.post(`/UIService/ResetScreenColumnConfiguration`, {\r\n ObjectInstanceId: data.instanceId,\r\n });\r\n }\r\n\r\n async saveSplitPanelConfiguration(data: { InstanceId: string; Position: number }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/SaveSplitPanelConfig`, data)).data;\r\n }\r\n\r\n async workflowAbort(data: { sessionFormIdentifier: string }): Promise {\r\n const result = (\r\n await this.axiosInstance.get(`/UIService/WorkflowAbort/${data.sessionFormIdentifier}`)\r\n ).data;\r\n\r\n return {\r\n ...result,\r\n formDefinition: xmlJs.xml2js(result.formDefinition, {\r\n addParent: true,\r\n alwaysChildren: true,\r\n }),\r\n };\r\n }\r\n\r\n async workflowRepeat(data: { sessionFormIdentifier: string }): Promise {\r\n const result = (\r\n await this.axiosInstance.get(`/UIService/WorkflowRepeat/${data.sessionFormIdentifier}`)\r\n ).data;\r\n\r\n return {\r\n ...result,\r\n formDefinition: xmlJs.xml2js(result.formDefinition, {\r\n addParent: true,\r\n alwaysChildren: true,\r\n }),\r\n };\r\n }\r\n\r\n async workflowNext(data: {\r\n sessionFormIdentifier: string;\r\n CachedFormIds: string[];\r\n }): Promise {\r\n const result = (\r\n await this.axiosInstance.post(`/UIService/WorkflowNext`, {\r\n SessionFormIdentifier: data.sessionFormIdentifier,\r\n CachedFormIds: data.CachedFormIds,\r\n })\r\n ).data;\r\n\r\n return {\r\n ...result,\r\n formDefinition: xmlJs.xml2js(result.formDefinition, {\r\n addParent: true,\r\n alwaysChildren: true,\r\n }),\r\n };\r\n }\r\n\r\n async workflowNextQuery(data: { sessionFormIdentifier: string }): Promise {\r\n return (\r\n await this.axiosInstance.get(`/UIService/WorkflowNextQuery/${data.sessionFormIdentifier}`)\r\n ).data;\r\n }\r\n\r\n async getRecordInfo(data: { MenuId: string; DataStructureEntityId: string; RowId: string }) {\r\n return (await this.axiosInstance.post(`/UIService/GetRecordTooltip`, data)).data.tooltip;\r\n }\r\n\r\n async getRecordAudit(data: { MenuId: string; DataStructureEntityId: string; RowId: string }) {\r\n return (await this.axiosInstance.post(`/UIService/GetAudit`, data)).data.data.map(\r\n (row: any[]) => ({\r\n id: row[IAuditLogColumnIndices.Id],\r\n dateTime: row[IAuditLogColumnIndices.DateTime],\r\n userName: row[IAuditLogColumnIndices.UserName],\r\n fieldName: row[IAuditLogColumnIndices.FieldName],\r\n oldValue: row[IAuditLogColumnIndices.OldValue],\r\n newValue: row[IAuditLogColumnIndices.NewValue],\r\n actionType: row[IAuditLogColumnIndices.ActionType],\r\n })\r\n );\r\n }\r\n\r\n async getReport(data: { reportUrl: string }): Promise {\r\n return (await this.axiosInstance.get(data.reportUrl)).data;\r\n }\r\n\r\n async getDownloadToken(data: {\r\n SessionFormIdentifier: string;\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n RowId: string;\r\n Property: string;\r\n FileName: string;\r\n Entity: string;\r\n parameters: any;\r\n isPreview: boolean;\r\n }): Promise {\r\n return (\r\n await this.axiosInstance.post(`/Blob/DownloadToken`, {\r\n SessionFormIdentifier: data.SessionFormIdentifier,\r\n MenuId: data.MenuId,\r\n DataStructureEntityId: data.DataStructureEntityId,\r\n Entity: data.Entity,\r\n RowId: data.RowId,\r\n Property: data.Property,\r\n IsPreview: data.isPreview,\r\n Parameters: data.parameters,\r\n })\r\n ).data;\r\n }\r\n\r\n async getBlob(data: { downloadToken: string }) {\r\n window.open(`${this.urlPrefix}/Blob/${data.downloadToken}`);\r\n /*return (\r\nawait axios.get(`${this.urlPrefix}/Blob/${data.downloadToken}`, {\r\n headers: this.httpAuthHeader,\r\n})\r\n).data;*/\r\n }\r\n\r\n async getUploadToken(data: {\r\n SessionFormIdentifier: string;\r\n MenuId: string;\r\n DataStructureEntityId: string;\r\n Entity: string;\r\n RowId: string;\r\n Property: string;\r\n FileName: string;\r\n DateCreated: string;\r\n DateLastModified: string;\r\n parameters: any;\r\n }): Promise {\r\n return (\r\n await this.axiosInstance.post(`/Blob/UploadToken`, {\r\n SessionFormIdentifier: data.SessionFormIdentifier,\r\n MenuId: data.MenuId,\r\n DataStructureEntityId: data.DataStructureEntityId,\r\n Entity: data.Entity,\r\n RowId: data.RowId,\r\n Property: data.Property,\r\n IsPreview: false,\r\n Parameters: data.parameters,\r\n SubmitImmediately: \"true\",\r\n })\r\n ).data;\r\n }\r\n\r\n async putBlob(\r\n data: { uploadToken: string; fileName: string; file: any },\r\n onUploadProgress?: (event: any) => void\r\n ): Promise {\r\n return (\r\n await this.axiosInstance.post(`/Blob/${data.uploadToken}/${data.fileName}`, data.file, {\r\n headers: {...this.httpAuthHeader, \"content-type\": \"application/octet-stream\"},\r\n onUploadProgress,\r\n })\r\n ).data;\r\n }\r\n\r\n async pendingChanges(data: { sessionFormIdentifier: string }): Promise {\r\n return (await this.axiosInstance.get(`/UIService/PendingChanges/${data.sessionFormIdentifier}`))\r\n .data;\r\n }\r\n\r\n async changes(data: {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n RowId: string;\r\n }): Promise {\r\n return (\r\n await this.axiosInstance.post(`/UIService/Changes`, {\r\n SessionFormIdentifier: data.SessionFormIdentifier,\r\n Entity: data.Entity,\r\n RowId: data.RowId,\r\n })\r\n ).data;\r\n }\r\n\r\n async saveFilter(data: {\r\n DataStructureEntityId: string;\r\n PanelId: string;\r\n Filter: IUIGridFilterCoreConfiguration;\r\n IsDefault: boolean;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/SaveFilter`, data)).data;\r\n }\r\n\r\n async deleteFilter(data: { filterId: string }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/DeleteFilter`, data)).data;\r\n }\r\n\r\n async resetDefaultFilter(data: {\r\n SessionFormIdentifier: string;\r\n PanelInstanceId: string;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/ResetDefaultFilter`, data)).data;\r\n }\r\n\r\n async setDefaultFilter(data: {\r\n SessionFormIdentifier: string;\r\n PanelInstanceId: string;\r\n DataStructureEntityId: string;\r\n PanelId: string;\r\n Filter: IUIGridFilterCoreConfiguration;\r\n IsDefault: boolean;\r\n }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/SetDefaultFilter`, data)).data;\r\n }\r\n\r\n async search(searchTerm: string) {\r\n return (await this.axiosInstance.get(`/Search/${encodeURIComponent(searchTerm)}`)).data;\r\n }\r\n\r\n async getAboutInfo() {\r\n return (await this.axiosInstance.get(\"/About\")).data as IAboutInfo;\r\n }\r\n\r\n async getMenuId(data: { LookupId: string; ReferenceId: string }): Promise {\r\n return (await this.axiosInstance.post(`/UIService/GetMenuId`, data)).data;\r\n }\r\n\r\n async getExcelFile(data: {\r\n Entity: string;\r\n Fields: IEntityExportField[];\r\n SessionFormIdentifier: string;\r\n RowIds: any[];\r\n LazyLoadedEntityInput: ILazyLoadedEntityInput | undefined;\r\n }): Promise {\r\n const response = await this.axiosInstance({\r\n url: `/ExcelExport/GetFile`,\r\n method: 'POST',\r\n data: data,\r\n responseType: 'blob',\r\n })\r\n\r\n const fieNameRegex = /filename=([^\\s;]*)/g\r\n\r\n let fileName = \"export.xls\";\r\n if (response.headers[\"content-disposition\"]) {\r\n const headerFileName = fieNameRegex.exec(response.headers[\"content-disposition\"])?.[1]\r\n if (headerFileName) {\r\n fileName = headerFileName;\r\n }\r\n }\r\n\r\n fileDownload(response.data, fileName);\r\n }\r\n\r\n async getMenuIdByReference(data: { Category: string; ReferenceId: any }): Promise {\r\n return (await this.axiosInstance.post(`/DeepLink/GetMenuId`, data)).data;\r\n }\r\n}\r\n\r\nexport const IOrigamAPI = TypeSymbol(\"IOrigamAPI\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { ScreenAPI } from \"modules/Screen/ScreenAPI\";\r\n\r\nexport class DataViewAPI {\r\n constructor(\r\n public getDataStructureEntityId: () => string,\r\n public getEntity: () => string,\r\n public api: () => ScreenAPI\r\n ) {\r\n }\r\n\r\n *getLookupList(args: {\r\n ColumnNames: string[];\r\n Property: string;\r\n Id: string;\r\n LookupId: string;\r\n Parameters?: { [key: string]: any };\r\n ShowUniqueValues: boolean;\r\n SearchText: string;\r\n PageSize: number;\r\n PageNumber: number;\r\n }): any {\r\n return yield*this.api().getLookupList({\r\n ...args,\r\n DataStructureEntityId: this.getDataStructureEntityId(),\r\n Entity: this.getEntity(),\r\n });\r\n }\r\n}\r\n\r\nexport const IDataViewAPI = TypeSymbol(\"IDataViewAPI\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { computed } from \"mobx\";\r\nimport { TypeSymbol } from \"dic/Container\";\r\n\r\nexport const IRowCursor = TypeSymbol(\"IRowCursor\");\r\n\r\nexport class RowCursor {\r\n constructor(private getSelectedRowId: () => string | undefined) {\r\n }\r\n\r\n @computed get selectedId(): string | undefined {\r\n return this.getSelectedRowId();\r\n }\r\n}\r\n\r\nexport const IColumnCursor = TypeSymbol(\"IColumnCursor\");\r\n\r\nexport class ColumnCursor {\r\n constructor(private getSelectedColumnId: () => string | undefined) {\r\n }\r\n\r\n @computed get selectedId(): string | undefined {\r\n return this.getSelectedColumnId();\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { IDataTable } from \"model/entities/types/IDataTable\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { onFieldChange } from \"model/actions-ui/DataView/TableView/onFieldChange\";\r\n\r\nexport class DataViewData {\r\n constructor(\r\n private dataTable: () => IDataTable,\r\n private propertyById: (id: string) => IProperty | undefined\r\n ) {\r\n }\r\n\r\n getCellValue(rowId: string, propertyId: string) {\r\n const dataTable = this.dataTable();\r\n const property = this.propertyById(propertyId);\r\n const row = dataTable.getRowById(rowId);\r\n //dataTable.resolveCellText(property, value)\r\n if (property && row) {\r\n return dataTable.getCellValue(row, property);\r\n } else return null;\r\n }\r\n\r\n getCellText(propertyId: string, value: any) {\r\n const property = this.propertyById(propertyId);\r\n if (property && value) {\r\n return this.dataTable().resolveCellText(property, value);\r\n } else return null;\r\n }\r\n\r\n getIsCellTextLoading(propertyId: string, value: any): boolean {\r\n const property = this.propertyById(propertyId);\r\n if (property && value) {\r\n return this.dataTable().isCellTextResolving(property, value);\r\n } else return false;\r\n }\r\n\r\n setNewValue(rowId: string, propertyId: string, value: any) {\r\n const dataTable = this.dataTable();\r\n const row = dataTable.getRowById(rowId);\r\n const property = this.propertyById(propertyId);\r\n if (property && row) {\r\n onFieldChange(property)({\r\n event: undefined,\r\n row: row,\r\n property: property,\r\n value: value,\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport const IDataViewData = TypeSymbol(\"IDataViewData\");\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TypeSymbol } from \"dic/Container\";\r\nimport { IApi } from \"model/entities/types/IApi\";\r\n\r\nexport class ScreenAPI {\r\n constructor(\r\n private getSessionId: () => string | undefined,\r\n private getMenuItemId: () => string,\r\n private api: () => IApi\r\n ) {\r\n }\r\n\r\n *getLookupList(args: {\r\n DataStructureEntityId?: string;\r\n Entity?: string;\r\n ColumnNames: string[];\r\n Property: string;\r\n Id: string;\r\n LookupId: string;\r\n Parameters?: { [key: string]: any };\r\n ShowUniqueValues: boolean;\r\n SearchText: string;\r\n PageSize: number;\r\n PageNumber: number;\r\n }): any {\r\n return yield this.api().getLookupList({\r\n ...args,\r\n SessionFormIdentifier: this.getSessionId(),\r\n MenuId: this.getMenuItemId(),\r\n });\r\n }\r\n}\r\n\r\nexport const IScreenAPI = TypeSymbol(\"IScreenAPI\");\r\n\r\n/*\r\nDataStructureEntityId?: string;\r\nFormSessionIdentifier?: string;\r\nEntity?: string;\r\nColumnNames: string[];\r\nProperty: string;\r\nId: string;\r\nLookupId: string;\r\nParameters?: { [key: string]: any };\r\nShowUniqueValues: boolean;\r\nSearchText: string;\r\nPageSize: number;\r\nPageNumber: number;\r\nMenuId: string;\r\n*/\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFilter } from \"model/entities/types/IFilter\";\r\nimport { FilterSetting } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSetting\";\r\nimport { filterTypeFromNumber } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { FilterGroupManager } from \"model/entities/FilterGroupManager\";\r\nimport { LookupFilterSetting } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/FilterSettingsLookup\";\r\nimport { IFilterGroup } from \"model/entities/types/IFilterGroup\";\r\n\r\nfunction filterJsonToFilterGroup(filterJson: any, properties: IProperty[]) {\r\n const filters: IFilter[] = filterJson.details.map((detail: any) => {\r\n const property = properties.find((prop) => prop.id === detail.property);\r\n if (!property) {\r\n return undefined;\r\n }\r\n const setting = property.column === \"ComboBox\"\r\n ? new LookupFilterSetting(\r\n filterTypeFromNumber(detail.operator, property.column),\r\n true,\r\n detail.value1,\r\n detail.value2)\r\n : new FilterSetting(\r\n filterTypeFromNumber(detail.operator, property.column),\r\n true,\r\n detail.value1,\r\n detail.value2)\r\n\r\n return {\r\n propertyId: detail.property,\r\n dataType: property.column,\r\n setting: setting,\r\n };\r\n });\r\n return {\r\n filters: filters,\r\n id: filterJson.id,\r\n isGlobal: filterJson.isGlobal,\r\n name: filterJson.name,\r\n };\r\n}\r\n\r\nexport function cloneFilterGroup(group: IFilterGroup | undefined) {\r\n if (!group) {\r\n return undefined;\r\n }\r\n const filters = group.filters.map(filter => {\r\n return {\r\n propertyId: filter.propertyId,\r\n dataType: filter.dataType,\r\n setting: filter.dataType === \"ComboBox\"\r\n ? new LookupFilterSetting(\r\n filter.setting.type,\r\n filter.setting.isComplete,\r\n filter.setting.val1,\r\n filter.setting.val2)\r\n : new FilterSetting(\r\n filter.setting.type,\r\n filter.setting.isComplete,\r\n filter.setting.val1,\r\n filter.setting.val2)\r\n }\r\n }\r\n );\r\n return {\r\n filters: filters,\r\n id: group.id,\r\n isGlobal: group.isGlobal,\r\n name: group.name,\r\n };\r\n}\r\n\r\nexport function addFilterGroups(\r\n filterGroupManager: FilterGroupManager,\r\n properties: IProperty[],\r\n panelConfigurationJson: any\r\n) {\r\n\r\n filterGroupManager.filterGroups = panelConfigurationJson.filters\r\n .map((filterJson: any) => filterJsonToFilterGroup(filterJson, properties))\r\n .filter((group: any) => group);\r\n\r\n if (panelConfigurationJson.initialFilter) {\r\n filterGroupManager.defaultFilter = filterJsonToFilterGroup(\r\n panelConfigurationJson.initialFilter,\r\n properties\r\n );\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IFilterGroup } from \"model/entities/types/IFilterGroup\";\r\nimport { IFilterConfiguration } from \"model/entities/types/IFilterConfiguration\";\r\nimport { action, observable } from \"mobx\";\r\nimport { IFilter } from \"model/entities/types/IFilter\";\r\nimport { IUIGridFilterFieldConfiguration, } from \"model/entities/types/IApi\";\r\nimport { filterTypeToNumber } from \"gui/Components/ScreenElements/Table/FilterSettings/HeaderControls/Operator\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { cloneFilterGroup } from \"xmlInterpreters/filterXml\";\r\n\r\nexport class FilterGroupManager {\r\n ctx: any;\r\n filterGroups: IFilterGroup[] = [];\r\n private _defaultFilter: IFilterGroup | undefined;\r\n @observable\r\n selectedFilterGroup: IFilterGroup | undefined;\r\n\r\n get isSelectedFilterGroupDefault() {\r\n if (!this.selectedFilterGroup) {\r\n return false;\r\n }\r\n return this.defaultFilter?.id === this.selectedFilterGroup?.id;\r\n }\r\n\r\n constructor(private filterConfiguration: IFilterConfiguration) {\r\n this.ctx = filterConfiguration;\r\n filterConfiguration.registerFilteringOnOffHandler(filteringOn => {\r\n if (!filteringOn) {\r\n this.selectedFilterGroup = undefined;\r\n }\r\n });\r\n }\r\n\r\n get filtersHidden() {\r\n return !this.filterConfiguration.isFilterControlsDisplayed;\r\n }\r\n\r\n get defaultFilter(): IFilterGroup | undefined {\r\n return this._defaultFilter;\r\n }\r\n\r\n set defaultFilter(value: IFilterGroup | undefined) {\r\n this._defaultFilter = value;\r\n this.setFilterGroup(this._defaultFilter);\r\n }\r\n\r\n get activeFilters() {\r\n return this.filterConfiguration.activeFilters;\r\n }\r\n\r\n get noFilterActive() {\r\n return this.activeFilters.length === 0 ||\r\n this.activeFilters.every(filter => !filter.setting.isComplete)\r\n }\r\n\r\n @action.bound\r\n setFilterGroup(filterGroup: IFilterGroup | undefined) {\r\n this.selectedFilterGroup = cloneFilterGroup(filterGroup);\r\n this.filterConfiguration.clearFilters();\r\n if (this.selectedFilterGroup?.filters) {\r\n this.filterConfiguration.setFilters(this.selectedFilterGroup.filters);\r\n }\r\n }\r\n\r\n filterToServerVersion(filter: IFilter): IUIGridFilterFieldConfiguration {\r\n return {\r\n operator: filterTypeToNumber(filter.setting.type),\r\n property: filter.propertyId,\r\n value1: filter.setting.val1ServerForm,\r\n value2: filter.setting.val2ServerForm,\r\n };\r\n }\r\n\r\n getFilterGroupServerVersion(name: string, isGlobal: boolean) {\r\n return {\r\n details: this.activeFilters\r\n .filter(filter => filter.setting.isComplete)\r\n .map((filter) => this.filterToServerVersion(filter)),\r\n id: undefined,\r\n isGlobal: isGlobal,\r\n name: name,\r\n }\r\n }\r\n\r\n @action.bound\r\n clearFiltersAndClose(event: any) {\r\n this.filterConfiguration.onFilterDisplayClick(event);\r\n }\r\n\r\n @action.bound\r\n async saveActiveFiltersAsNewFilterGroup(name: string, isGlobal: boolean) {\r\n const api = getApi(this.ctx);\r\n const filterGroupId = await api.saveFilter({\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n PanelId: getDataView(this.ctx).modelId,\r\n Filter: this.getFilterGroupServerVersion(name, isGlobal),\r\n IsDefault: false,\r\n });\r\n const filterGroup = {\r\n filters: this.activeFilters,\r\n id: filterGroupId,\r\n isGlobal: isGlobal,\r\n name: name\r\n }\r\n this.filterGroups.push(filterGroup);\r\n }\r\n\r\n @action.bound\r\n async deleteFilterGroup() {\r\n if (!this.selectedFilterGroup) {\r\n return;\r\n }\r\n const api = getApi(this.ctx);\r\n await api.deleteFilter({filterId: this.selectedFilterGroup.id});\r\n\r\n const index = this.filterGroups.findIndex((group) => group.id === this.selectedFilterGroup?.id);\r\n if (index > -1) {\r\n this.filterGroups.splice(index, 1);\r\n }\r\n this.filterConfiguration.clearFilters();\r\n this.selectedFilterGroup = undefined;\r\n }\r\n\r\n @action.bound\r\n async resetDefaultFilterGroup() {\r\n if (!this._defaultFilter) {\r\n return;\r\n }\r\n const api = getApi(this.ctx);\r\n await api.resetDefaultFilter({\r\n SessionFormIdentifier: getSessionId(this.ctx),\r\n PanelInstanceId: getDataView(this.ctx).modelInstanceId,\r\n });\r\n this._defaultFilter = undefined;\r\n }\r\n\r\n @action.bound\r\n cancelSelectedFilter() {\r\n this.filterConfiguration.clearFilters();\r\n this.selectedFilterGroup = undefined;\r\n }\r\n\r\n @action.bound\r\n async setSelectedFilterGroupAsDefault() {\r\n const api = getApi(this.ctx);\r\n await api.setDefaultFilter({\r\n SessionFormIdentifier: getSessionId(this.ctx),\r\n PanelInstanceId: getDataView(this.ctx).modelInstanceId,\r\n DataStructureEntityId: getDataStructureEntityId(this.ctx),\r\n PanelId: getDataView(this.ctx).modelId,\r\n Filter: this.getFilterGroupServerVersion(\"DEFAULT\", false),\r\n IsDefault: true\r\n });\r\n }\r\n\r\n parent?: any;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IColumnConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { observable } from \"mobx\";\r\nimport { AggregationType } from \"model/entities/types/AggregationType\";\r\nimport { GroupingUnit } from \"model/entities/types/GroupingUnit\";\r\n\r\nexport class TableColumnConfiguration implements IColumnConfiguration {\r\n\r\n constructor(\r\n public propertyId: string\r\n ) {\r\n }\r\n\r\n @observable\r\n aggregationType: AggregationType | undefined;\r\n @observable\r\n groupingIndex: number = 0;\r\n @observable\r\n isVisible: boolean = true;\r\n @observable\r\n timeGroupingUnit: GroupingUnit | undefined;\r\n width = 0;\r\n\r\n deepClone(): IColumnConfiguration {\r\n return Object.assign(Object.create(Object.getPrototypeOf(this)), this)\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IColumnConfiguration, ITableConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { ITablePanelView } from \"model/entities/TablePanelView/types/ITablePanelView\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { TableColumnConfiguration } from \"model/entities/TablePanelView/tableColumnConfiguration\";\r\nimport { IProperty } from \"../types/IProperty\";\r\nimport { observable } from \"mobx\";\r\n\r\nexport interface ICustomConfiguration{\r\n name: string;\r\n value: string\r\n}\r\n\r\nexport class TableConfiguration implements ITableConfiguration {\r\n\r\n public static DefaultConfigId = \"default\";\r\n public name: string | undefined;\r\n @observable\r\n public fixedColumnCount: number = 0;\r\n public columnConfigurations: IColumnConfiguration[] = [];\r\n @observable\r\n public isActive: boolean = false;\r\n id: string = \"\";\r\n\r\n private constructor() {\r\n }\r\n\r\n static create(\r\n args: {\r\n name: string | undefined,\r\n isActive: boolean,\r\n id: string,\r\n fixedColumnCount: number,\r\n columnConfigurations: IColumnConfiguration[]\r\n }\r\n ) {\r\n const newInstance = new TableConfiguration();\r\n newInstance.name = args.name;\r\n newInstance.id = args.id;\r\n newInstance.isActive = args.isActive;\r\n newInstance.fixedColumnCount = args.fixedColumnCount ?? 0;\r\n newInstance.columnConfigurations = args.columnConfigurations;\r\n return newInstance;\r\n }\r\n\r\n\r\n static createDefault(properties: IProperty[]) {\r\n const newInstance = new TableConfiguration();\r\n newInstance.id = this.DefaultConfigId\r\n newInstance.columnConfigurations = properties\r\n .map(property => new TableColumnConfiguration(property.id));\r\n return newInstance;\r\n }\r\n\r\n public get isGrouping() {\r\n return this.columnConfigurations.some(columnConfig => columnConfig.groupingIndex > 0);\r\n }\r\n\r\n deepClone() {\r\n const newinstance = new TableConfiguration();\r\n newinstance.name = this.name;\r\n newinstance.id = this.id;\r\n newinstance.fixedColumnCount = this.fixedColumnCount;\r\n newinstance.columnConfigurations = this.columnConfigurations\r\n .map(columnConfifuration => columnConfifuration.deepClone());\r\n return newinstance;\r\n }\r\n\r\n apply(tablePanelView: ITablePanelView) {\r\n const properties = getProperties(tablePanelView);\r\n\r\n tablePanelView.fixedColumnCount = this.fixedColumnCount;\r\n tablePanelView.hiddenPropertyIds.clear();\r\n tablePanelView.groupingConfiguration.clearGrouping();\r\n\r\n for (const columnConfiguration of this.columnConfigurations) {\r\n if (!columnConfiguration.isVisible) {\r\n tablePanelView.setPropertyHidden(columnConfiguration.propertyId, true);\r\n }\r\n tablePanelView.aggregations.setType(\r\n columnConfiguration.propertyId,\r\n columnConfiguration.aggregationType\r\n );\r\n if (columnConfiguration.groupingIndex > 0) {\r\n tablePanelView.groupingConfiguration.setGrouping(\r\n columnConfiguration.propertyId,\r\n columnConfiguration.timeGroupingUnit,\r\n columnConfiguration.groupingIndex\r\n );\r\n }\r\n const property = properties.find(prop => prop.id === columnConfiguration.propertyId)\r\n if (property && columnConfiguration.width > 0) {\r\n property.setColumnWidth(columnConfiguration.width);\r\n }\r\n tablePanelView.tablePropertyIds = tablePanelView.tablePropertyIds\r\n .slice()\r\n .sort((columnIdA, columnIdB) => {\r\n const columnIdxA = this.columnConfigurations.findIndex(config => config.propertyId === columnIdA);\r\n if (columnIdxA === -1) return 0;\r\n const columnIdxB = this.columnConfigurations.findIndex(config => config.propertyId === columnIdB);\r\n if (columnIdxB === -1) return 0;\r\n return columnIdxA - columnIdxB;\r\n });\r\n }\r\n }\r\n\r\n sortColumnConfiguartions(propertyIds: string[]) {\r\n this.columnConfigurations\r\n .sort((congigA, configB) => {\r\n const columnIdxA = propertyIds.findIndex(id => id === congigA.propertyId);\r\n if (columnIdxA === -1) return 0;\r\n const columnIdxB = propertyIds.findIndex(id => id === configB.propertyId);\r\n if (columnIdxB === -1) return 0;\r\n return columnIdxA - columnIdxB;\r\n });\r\n }\r\n\r\n updateColumnWidth(propertyId: string, width: number) {\r\n const columnConfiguration = this.columnConfigurations\r\n .find(configuration => configuration.propertyId === propertyId);\r\n if (columnConfiguration) {\r\n columnConfiguration.width = width;\r\n }\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IConfigurationManager, ITableConfiguration } from \"model/entities/TablePanelView/types/IConfigurationManager\";\r\nimport { ICustomConfiguration, TableConfiguration } from \"model/entities/TablePanelView/tableConfiguration\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { saveColumnConfigurations } from \"model/actions/DataView/TableView/saveColumnConfigurations\";\r\nimport { observable } from \"mobx\";\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport class ConfigurationManager implements IConfigurationManager {\r\n parent: any;\r\n\r\n @observable.shallow\r\n customTableConfigurations: TableConfiguration[];\r\n\r\n @observable.shallow\r\n defaultTableConfiguration: TableConfiguration;\r\n\r\n customConfigurationsMap: Map;\r\n\r\n constructor(\r\n customTableConfigurations: TableConfiguration[],\r\n defaultTableConfiguration: TableConfiguration,\r\n customConfigurations: ICustomConfiguration[]\r\n ) {\r\n this.defaultTableConfiguration = defaultTableConfiguration;\r\n this.customTableConfigurations = customTableConfigurations;\r\n this.customConfigurationsMap = new Map(customConfigurations.map(i => [i.name, i.value]));\r\n }\r\n\r\n get allTableConfigurations() {\r\n return this.defaultTableConfiguration\r\n ? [this.defaultTableConfiguration, ...this.customTableConfigurations]\r\n : this.customTableConfigurations;\r\n }\r\n\r\n get activeTableConfiguration() {\r\n const activeTableConfiguration = this.allTableConfigurations.find(config => config.isActive)\r\n if (activeTableConfiguration) {\r\n return activeTableConfiguration;\r\n } else {\r\n this.defaultTableConfiguration.isActive = true;\r\n return this.defaultTableConfiguration;\r\n }\r\n }\r\n\r\n set activeTableConfiguration(configToActivate: TableConfiguration) {\r\n const groupingWasActine = this.activeTableConfiguration.isGrouping;\r\n this.replace(configToActivate);\r\n\r\n for (const tableConfiguration of this.allTableConfigurations) {\r\n tableConfiguration.isActive = false;\r\n }\r\n configToActivate.isActive = true;\r\n const tablePanelView = getTablePanelView(this);\r\n configToActivate.apply(tablePanelView);\r\n if (groupingWasActine !== configToActivate.isGrouping) {\r\n getFormScreenLifecycle(this).loadInitialData();\r\n }\r\n }\r\n\r\n private replace(newConfiguration: TableConfiguration) {\r\n const index = this.customTableConfigurations\r\n .findIndex(config => config.id === newConfiguration.id);\r\n if (index > -1) {\r\n this.customTableConfigurations[index] = newConfiguration;\r\n } else {\r\n if (newConfiguration.id === TableConfiguration.DefaultConfigId) {\r\n this.defaultTableConfiguration = newConfiguration;\r\n } else {\r\n this.customTableConfigurations.push(newConfiguration);\r\n }\r\n }\r\n }\r\n\r\n cloneAndActivate(configuration: ITableConfiguration, newName: string): void {\r\n const newConfig = configuration.deepClone();\r\n newConfig.name = newName;\r\n newConfig.id = uuidv4();\r\n this.customTableConfigurations.push(newConfig);\r\n this.activeTableConfiguration = newConfig;\r\n }\r\n\r\n getCustomConfiguration(configName: string) {\r\n return this.customConfigurationsMap.get(configName);\r\n }\r\n\r\n setCustomConfiguration(configName: string, configuration: string){\r\n this.customConfigurationsMap.set(configName, configuration);\r\n }\r\n\r\n async deleteActiveTableConfiguration(): Promise {\r\n if (this.defaultTableConfiguration.isActive) {\r\n return;\r\n }\r\n this.customTableConfigurations.remove(this.activeTableConfiguration);\r\n this.activeTableConfiguration = this.defaultTableConfiguration;\r\n await this.saveTableConfigurations();\r\n }\r\n\r\n async saveTableConfigurations(): Promise {\r\n const self = this;\r\n await runGeneratorInFlowWithHandler({\r\n ctx: this,\r\n generator: function*() {\r\n yield*saveColumnConfigurations(self)();\r\n }()\r\n })\r\n }\r\n\r\n *onColumnWidthChanged(propertyId: string, width: number): Generator {\r\n if (!this.defaultTableConfiguration.isActive) {\r\n return;\r\n }\r\n this.activeTableConfiguration.updateColumnWidth(propertyId, width);\r\n yield*saveColumnConfigurations(this)();\r\n }\r\n\r\n *onColumnOrderChanged(): Generator {\r\n if (!this.defaultTableConfiguration.isActive) {\r\n return;\r\n }\r\n const tablePanelView = getTablePanelView(this);\r\n this.activeTableConfiguration.sortColumnConfiguartions(tablePanelView.tablePropertyIds);\r\n yield*saveColumnConfigurations(this)();\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { ConfigurationManager } from \"model/entities/TablePanelView/configurationManager\";\r\nimport { findStopping } from \"xmlInterpreters/xmlUtils\";\r\nimport { tryParseAggregationType } from \"model/entities/types/AggregationType\";\r\nimport { fixColumnWidth } from \"xmlInterpreters/screenXml\";\r\nimport { ICustomConfiguration, TableConfiguration } from \"model/entities/TablePanelView/tableConfiguration\";\r\nimport { TableColumnConfiguration } from \"model/entities/TablePanelView/tableColumnConfiguration\";\r\n\r\nfunction makeColumnConfigurations(properties: IProperty[], tableConfigNode: any, isLazyLoading: boolean) {\r\n const columnConfigurations: TableColumnConfiguration[] = tableConfigNode.elements\r\n .map((element: any) => {\r\n if (!element.attributes?.propertyId) {\r\n return undefined;\r\n }\r\n const property = properties.find(prop => prop.id === element.attributes?.propertyId);\r\n if (!property) {\r\n return undefined;\r\n }\r\n return parseColumnConfigurationNode(element, property, isLazyLoading)\r\n })\r\n .filter((columnConfig: any) => columnConfig);\r\n const parsedColumnConfigurationIds = columnConfigurations.map(columnConfig => columnConfig.propertyId);\r\n\r\n const newColumnConfigurations = properties\r\n .filter(property => !parsedColumnConfigurationIds.includes(property.id))\r\n .map(property => new TableColumnConfiguration(property.id));\r\n return columnConfigurations.concat(newColumnConfigurations);\r\n}\r\n\r\nexport function createConfigurationManager(configurationNodes: any, properties: IProperty[], isLazyLoading: boolean) {\r\n const defaultConfiguration = TableConfiguration.createDefault(properties);\r\n if (configurationNodes.length === 0) {\r\n return new ConfigurationManager(\r\n [], defaultConfiguration, []);\r\n } else if (configurationNodes.length > 1) {\r\n throw new Error(\"Can not process more than one configuration node\")\r\n }\r\n\r\n const tableConfigurationNodes = findStopping(configurationNodes[0], (n) => n.name === \"tableConfigurations\")?.[0]?.elements;\r\n const customConfigurations = parseCustomConfigurations(configurationNodes[0]);\r\n if (!tableConfigurationNodes) {\r\n return new ConfigurationManager(\r\n [], defaultConfiguration, customConfigurations);\r\n }\r\n const tableConfigurations: TableConfiguration[] = tableConfigurationNodes.map((tableConfigNode: any) => {\r\n return TableConfiguration.create(\r\n {\r\n name: tableConfigNode.attributes.name,\r\n id: tableConfigNode.attributes.id,\r\n isActive: tableConfigNode.attributes.isActive === \"true\",\r\n fixedColumnCount: parseIntOrZero(tableConfigNode.attributes.fixedColumnCount),\r\n columnConfigurations: makeColumnConfigurations(properties, tableConfigNode, isLazyLoading),\r\n }\r\n )\r\n }\r\n );\r\n\r\n const defaultTableConfiguration = tableConfigurations.find(tableConfig => tableConfig.name === \"\")\r\n ?? defaultConfiguration;\r\n\r\n const noConfigIsActive = tableConfigurations.every(tableConfig => !tableConfig.isActive);\r\n if (noConfigIsActive) {\r\n defaultTableConfiguration.isActive = true;\r\n }\r\n\r\n return new ConfigurationManager(\r\n tableConfigurations\r\n .filter((tableConfig: TableConfiguration) => tableConfig !== defaultTableConfiguration),\r\n defaultTableConfiguration,\r\n customConfigurations\r\n );\r\n}\r\n\r\nfunction parseColumnConfigurationNode(columnConfigNode: any, property: IProperty, isLazyLoading: boolean) {\r\n const tableConfiguration = new TableColumnConfiguration(property.id);\r\n tableConfiguration.width = fixColumnWidth(parseInt(columnConfigNode.attributes.width));\r\n\r\n if (columnConfigNode.attributes.isVisible === \"false\" || tableConfiguration.width < 0) {\r\n tableConfiguration.isVisible = false;\r\n }\r\n tableConfiguration.aggregationType = tryParseAggregationType(columnConfigNode.attributes.aggregationType);\r\n\r\n // It is possible that the configuration will contain grouping by detached field if the same screen is referenced by two\r\n // menu items. One opens it as lazy loaded the other as eager loaded.\r\n if (!isLazyLoading || property.fieldType !== \"DetachedField\") {\r\n tableConfiguration.groupingIndex = parseIntOrZero(columnConfigNode.attributes.groupingIndex);\r\n tableConfiguration.timeGroupingUnit = isNaN(parseInt(columnConfigNode.attributes.groupingUnit))\r\n ? undefined\r\n : parseInt(columnConfigNode.attributes.groupingUnit)\r\n }\r\n return tableConfiguration;\r\n}\r\n\r\nfunction parseIntOrZero(value: string): number {\r\n const intValue = parseInt(value, 10);\r\n return isNaN(intValue) ? 0 : intValue;\r\n}\r\n\r\nfunction parseCustomConfigurations(configurationNode: any): ICustomConfiguration[]{\r\n const customConfigurationNodes = findStopping(configurationNode, (n) => n.name === \"customConfigurations\")\r\n ?.[0]?.elements\r\n ?.[0]?.elements;\r\n if(!customConfigurationNodes) {\r\n return [];\r\n }\r\n return customConfigurationNodes\r\n .map((customConfigNode: any) => {\r\n const config = customConfigNode.elements[0]?.text ?? \"\";\r\n const decodedConfig = decodeURIComponent(escape(window.atob(config)))\r\n return{\r\n name: customConfigNode.name.replace(\"Configuration\", \"\"),\r\n value: decodedConfig\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { DataViewLifecycle } from \"model/entities/DataViewLifecycle/DataViewLifecycle\";\r\nimport { LookupLoader } from \"model/entities/LookupLoader\";\r\nimport { RowState } from \"model/entities/RowState\";\r\nimport { Action } from \"model/entities/Action\";\r\nimport { ActionParameter } from \"model/entities/ActionParameter\";\r\nimport { ComponentBinding, ComponentBindingPair } from \"model/entities/ComponentBinding\";\r\nimport { DataSource } from \"model/entities/DataSource\";\r\nimport { DataSourceField } from \"model/entities/DataSourceField\";\r\nimport { DataTable } from \"model/entities/DataTable\";\r\nimport { DataView } from \"model/entities/DataView\";\r\nimport { DropDownColumn } from \"model/entities/DropDownColumn\";\r\nimport { FilterConfiguration } from \"model/entities/FilterConfiguration\";\r\nimport { FormPanelView } from \"model/entities/FormPanelView/FormPanelView\";\r\nimport { FormScreen } from \"model/entities/FormScreen\";\r\nimport { Lookup } from \"model/entities/Lookup\";\r\nimport { OrderingConfiguration } from \"model/entities/OrderingConfiguration\";\r\nimport { Property } from \"model/entities/Property\";\r\nimport { ColumnConfigurationDialog } from \"model/entities/TablePanelView/ColumnConfigurationDialog\";\r\nimport { TablePanelView } from \"model/entities/TablePanelView/TablePanelView\";\r\nimport { IComponentBinding } from \"model/entities/types/IComponentBinding\";\r\nimport { IFormScreenLifecycle02 } from \"model/entities/types/IFormScreenLifecycle\";\r\nimport { IPanelViewType } from \"model/entities/types/IPanelViewType\";\r\nimport { findStopping } from \"./xmlUtils\";\r\nimport { GroupingConfiguration } from \"model/entities/GroupingConfiguration\";\r\nimport { ServerSideGrouper } from \"model/entities/ServerSideGrouper\";\r\nimport { ClientSideGrouper } from \"model/entities/ClientSideGrouper\";\r\nimport $root from \"rootContainer\";\r\nimport { SCOPE_Screen } from \"modules/Screen/ScreenModule\";\r\nimport { SCOPE_DataView } from \"modules/DataView/DataViewModule\";\r\nimport { scopeFor, TypeSymbol } from \"dic/Container\";\r\nimport { SCOPE_FormPerspective } from \"modules/DataView/Perspective/FormPerspective/FormPerspectiveModule\";\r\nimport { IFormPerspectiveDirector } from \"modules/DataView/Perspective/FormPerspective/FormPerspectiveDirector\";\r\nimport { SCOPE_TablePerspective } from \"modules/DataView/Perspective/TablePerspective/TablePerspectiveModule\";\r\nimport { ITablePerspectiveDirector } from \"modules/DataView/Perspective/TablePerspective/TablePerspectiveDirector\";\r\nimport { IPerspective } from \"modules/DataView/Perspective/Perspective\";\r\nimport { flow } from \"mobx\";\r\nimport { IViewConfiguration, ViewConfiguration } from \"modules/DataView/ViewConfiguration\";\r\nimport { saveColumnConfigurations } from \"model/actions/DataView/TableView/saveColumnConfigurations\";\r\nimport { IPanelConfiguration } from \"model/entities/types/IPanelConfiguration\";\r\nimport { parseToOrdering } from \"model/entities/types/IOrderingConfiguration\";\r\nimport { isInfiniteScrollingActive } from \"model/selectors/isInfiniteScrollingActive\";\r\nimport { cssString2Object } from \"utils/objects\";\r\nimport { TreeDataTable } from \"model/entities/TreeDataTable\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { DataViewAPI } from \"modules/DataView/DataViewAPI\";\r\nimport { getSelectedRowId } from \"model/selectors/TablePanelView/getSelectedRowId\";\r\nimport { IRowCursor, RowCursor } from \"modules/DataView/TableCursor\";\r\nimport { getDataViewPropertyById } from \"model/selectors/DataView/getDataViewPropertyById\";\r\nimport { DataViewData } from \"modules/DataView/DataViewData\";\r\nimport { ScreenAPI } from \"modules/Screen/ScreenAPI\";\r\nimport { getMenuItemId } from \"model/selectors/getMenuItemId\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\nimport { SCOPE_FormScreen } from \"modules/Screen/FormScreen/FormScreenModule\";\r\nimport { IOrigamAPI, OrigamAPI } from \"model/entities/OrigamAPI\";\r\nimport { IDataView as IDataViewTS } from \"modules/DataView/DataViewTypes\";\r\nimport { createIndividualLookupEngine } from \"modules/Lookup/LookupModule\";\r\nimport { IProperty } from \"model/entities/types/IProperty\";\r\nimport { SCOPE_MapPerspective } from \"modules/DataView/Perspective/MapPerspective/MapPerspectiveModule\";\r\nimport { IMapPerspectiveDirector } from \"modules/DataView/Perspective/MapPerspective/MapPerspectiveDirector\";\r\nimport {\r\n MapLayer as MapLayerSetup,\r\n MapSetupStore,\r\n} from \"modules/DataView/Perspective/MapPerspective/stores/MapSetupStore\";\r\nimport { MapRootStore } from \"modules/DataView/Perspective/MapPerspective/stores/MapRootStore\";\r\nimport { IFormPerspective } from \"modules/DataView/Perspective/FormPerspective/FormPerspective\";\r\nimport { addFilterGroups } from \"./filterXml\";\r\nimport { FilterGroupManager } from \"model/entities/FilterGroupManager\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { ITablePerspective } from \"modules/DataView/Perspective/TablePerspective/TablePerspective\";\r\nimport { runGeneratorInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { createConfigurationManager } from \"xmlInterpreters/createConfigurationManager\";\r\nimport { getMomentFormat, replaceDefaultDateFormats } from \"./getMomentFormat\";\r\nimport { getTablePanelView } from \"../model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport const findUIRoot = (node: any) => findStopping(node, (n) => n.name === \"UIRoot\")[0];\r\n\r\nexport const findUIChildren = (node: any) =>\r\n findStopping(node, (n) => n.parent.name === \"UIChildren\");\r\n\r\nexport const findBoxes = (node: any) =>\r\n findStopping(node, (n) => n.attributes && n.attributes.Type === \"Box\");\r\n\r\nexport const findChildren = (node: any) => findStopping(node, (n) => n.name === \"Children\")[0];\r\n\r\nexport const findActions = (node: any) =>\r\n findStopping(node, (n) => n.parent.name === \"Actions\" && n.name === \"Action\");\r\n\r\nexport const findParameters = (node: any) => findStopping(node, (n) => n.name === \"Parameter\");\r\n\r\nexport const findStrings = (node: any) =>\r\n findStopping(node, (n) => n.name === \"string\").map(\r\n (n) => findStopping(n, (n2) => n2.type === \"text\")[0].text\r\n );\r\n\r\nexport const findFormPropertyIds = (node: any) =>\r\n findStopping(node, (n) => n.name === \"string\" && n.parent.name === \"PropertyNames\").map(\r\n (n) => findStopping(n, (n2) => n2.type === \"text\")[0].text\r\n );\r\n\r\nexport const findFormRoot = (node: any) => findStopping(node, (n) => n.name === \"FormRoot\")[0];\r\n\r\nfunction getPropertyParameters(node: any) {\r\n const parameters = findParameters(node);\r\n const result: { [key: string]: any } = {};\r\n for (let p of parameters) {\r\n result[p.attributes.Name] = p.attributes.Value;\r\n }\r\n return result;\r\n}\r\n\r\nconst instance2XmlNode = new WeakMap();\r\n\r\nexport function fixColumnWidth(width: number) {\r\n // Sometimes they send us negative width, which destroys table rendering.\r\n if (isNaN(width)) {\r\n return 100;\r\n } else {\r\n return Math.abs(width);\r\n }\r\n}\r\n\r\nfunction parseProperty(property: any, idx: number): IProperty {\r\n const propertyObject = new Property({\r\n xmlNode: property,\r\n id: property.attributes.Id,\r\n tabIndex: property.attributes.TabIndex,\r\n controlPropertyId: property.attributes.ControlPropertyId,\r\n controlPropertyValue: property.attributes.ControlPropertyValue,\r\n modelInstanceId: property.attributes.ModelInstanceId || \"\",\r\n name: property.attributes.Name,\r\n readOnly: property.attributes.ReadOnly === \"true\",\r\n x: parseInt(property.attributes.X, 10),\r\n y: parseInt(property.attributes.Y, 10),\r\n width: parseInt(property.attributes.Width, 10),\r\n height: parseInt(property.attributes.Height, 10),\r\n captionLength: parseInt(property.attributes.CaptionLength, 10),\r\n captionPosition: property.attributes.CaptionPosition,\r\n entity: property.attributes.Entity,\r\n column: property.attributes.Column,\r\n parameters: getPropertyParameters(property),\r\n dock: property.attributes.Dock,\r\n multiline: property.attributes.Multiline === \"true\",\r\n isPassword: property.attributes.IsPassword === \"true\",\r\n isRichText: property.attributes.IsRichText === \"true\",\r\n autoSort: property.attributes.AutoSort === \"true\",\r\n maxLength: parseInt(property.attributes.MaxLength, 10),\r\n modelFormatterPattern: replaceDefaultDateFormats(property.attributes.FormatterPattern),\r\n formatterPattern: property.attributes.FormatterPattern\r\n ? getMomentFormat(property)\r\n : \"\",\r\n customNumericFormat: property.attributes.CustomNumericFormat,\r\n identifier: property.attributes.Identifier,\r\n gridColumnWidth: property.attributes.GridColumnWidth\r\n ? parseInt(property.attributes.GridColumnWidth)\r\n : 100,\r\n columnWidth: fixColumnWidth(\r\n property.attributes.GridColumnWidth ? parseInt(property.attributes.GridColumnWidth) : 100\r\n ),\r\n suppressEmptyColumns: property.attributes.SuppressEmptyColumns === \"true\",\r\n lookupId: property.attributes.LookupId,\r\n lookup: !property.attributes.LookupId\r\n ? undefined\r\n : new Lookup({\r\n dropDownShowUniqueValues: property.attributes.DropDownShowUniqueValues === \"true\",\r\n lookupId: property.attributes.LookupId,\r\n identifier: property.attributes.Identifier,\r\n identifierIndex: parseInt(property.attributes.IdentifierIndex, 10),\r\n dropDownType: property.attributes.DropDownType,\r\n cached: property.attributes.Cached === \"true\",\r\n searchByFirstColumnOnly: property.attributes.SearchByFirstColumnOnly === \"true\",\r\n dropDownColumns: findStopping(property, (n) => n.name === \"Property\").map(\r\n (ddProperty) => {\r\n return new DropDownColumn({\r\n id: ddProperty.attributes.Id,\r\n name: ddProperty.attributes.Name,\r\n column: ddProperty.attributes.Column,\r\n entity: ddProperty.attributes.Entity,\r\n index: parseInt(ddProperty.attributes.Index, 10),\r\n });\r\n }\r\n ),\r\n dropDownParameters: findStopping(\r\n property,\r\n (n) => n.name === \"ComboBoxParameterMapping\"\r\n ).map((ddParam) => {\r\n return {\r\n parameterName: ddParam.attributes.ParameterName,\r\n fieldName: ddParam.attributes.FieldName,\r\n };\r\n }),\r\n }),\r\n\r\n allowReturnToForm: property.attributes.AllowReturnToForm === \"true\",\r\n isTree: property.attributes.IsTree === \"true\",\r\n isAggregatedColumn: property.attributes.Aggregated || false,\r\n isLookupColumn: property.attributes.IsLookupColumn || false,\r\n style: cssString2Object(property.attributes.Style),\r\n toolTip: property.elements.find((child: any) => child.name === \"ToolTip\")?.elements?.[0]?.text,\r\n supportsServerSideSorting: property.attributes.SupportsServerSideSorting === \"true\",\r\n fieldType: property.attributes.FieldType\r\n });\r\n if (property.elements && property.elements.length > 0) {\r\n property.elements\r\n .filter((element: any) => element.name === \"Property\")\r\n .map((childProperty: any, idx: number) => parseProperty(childProperty, idx))\r\n .forEach((childProperty: IProperty) => {\r\n childProperty.parent = propertyObject;\r\n childProperty.x = childProperty.x + propertyObject.x;\r\n childProperty.y = propertyObject.y;\r\n propertyObject.childProperties.push(childProperty);\r\n });\r\n }\r\n return propertyObject;\r\n}\r\n\r\nexport function*interpretScreenXml(\r\n screenDoc: any,\r\n formScreenLifecycle: IFormScreenLifecycle02,\r\n panelConfigurationsRaw: any,\r\n lookupMenuMappings: any,\r\n sessionId: string,\r\n isLazyLoading: boolean\r\n) {\r\n const workbench = getWorkbench(formScreenLifecycle);\r\n const $workbench = scopeFor(workbench);\r\n const panelConfigurations = new Map(\r\n panelConfigurationsRaw.map((pcr: any) => [\r\n pcr.panel.instanceId,\r\n {\r\n position: pcr.position,\r\n defaultOrdering: parseToOrdering(pcr.defaultSort),\r\n },\r\n ])\r\n );\r\n\r\n const dataSourcesXml = findStopping(screenDoc, (n) => n.name === \"DataSources\")[0];\r\n\r\n const windowXml = findStopping(screenDoc, (n) => n.name === \"Window\")[0];\r\n\r\n const dataViews = findStopping(\r\n screenDoc,\r\n (n) =>\r\n (n.name === \"UIElement\" || n.name === \"UIRoot\") &&\r\n (n.attributes.Type === \"Grid\" ||\r\n n.attributes.Type === \"TreePanel\" ||\r\n n.attributes.Type === \"SectionLevelPlugin\")\r\n );\r\n\r\n checkInfiniteScrollWillWork(dataViews, formScreenLifecycle, panelConfigurations);\r\n\r\n function panelViewFromNumber(pvn: number) {\r\n switch (pvn) {\r\n case 1:\r\n default:\r\n return IPanelViewType.Table;\r\n case 0:\r\n return IPanelViewType.Form;\r\n case 5:\r\n return IPanelViewType.Map;\r\n }\r\n }\r\n\r\n const xmlComponentBindings = findStopping(\r\n screenDoc,\r\n (n) => n.name === \"Binding\" && n.parent.name === \"ComponentBindings\"\r\n );\r\n\r\n const screenAPI = new ScreenAPI(\r\n () => getSessionId(scr),\r\n () => getMenuItemId(scr),\r\n () => getApi(scr)\r\n );\r\n\r\n const componentBindings: IComponentBinding[] = [];\r\n\r\n for (let xmlBinding of xmlComponentBindings) {\r\n let existingBinding = componentBindings.find(\r\n (item) =>\r\n item.parentId === xmlBinding.attributes.ParentId &&\r\n item.childId === xmlBinding.attributes.ChildId\r\n );\r\n const componentBindingPair = new ComponentBindingPair({\r\n parentPropertyId: xmlBinding.attributes.ParentProperty,\r\n childPropertyId: xmlBinding.attributes.ChildProperty,\r\n });\r\n if (existingBinding) {\r\n existingBinding.bindingPairs.push(componentBindingPair);\r\n } else {\r\n componentBindings.push(\r\n new ComponentBinding({\r\n parentId: xmlBinding.attributes.ParentId,\r\n childId: xmlBinding.attributes.ChildId,\r\n parentEntity: xmlBinding.attributes.ParentEntity,\r\n childEntity: xmlBinding.attributes.ChildEntity,\r\n bindingPairs: [componentBindingPair],\r\n childPropertyType: xmlBinding.attributes.ChildPropertyType,\r\n })\r\n );\r\n }\r\n }\r\n\r\n const foundLookupIds = new Set();\r\n\r\n const scr = new FormScreen({\r\n title: windowXml.attributes.Title,\r\n menuId: windowXml.attributes.MenuId,\r\n dynamicTitleSource: screenDoc.elements[0].attributes.DynamicFormLabelSource,\r\n sessionId,\r\n autoWorkflowNext: screenDoc.elements[0].attributes.AutoWorkflowNext === \"true\",\r\n openingOrder: 0,\r\n suppressSave: windowXml.attributes.SuppressSave === \"true\",\r\n suppressRefresh: windowXml.attributes.SuppressRefresh === \"true\",\r\n showInfoPanel: windowXml.attributes.ShowInfoPanel === \"true\",\r\n showWorkflowNextButton: windowXml.attributes.ShowWorkflowNextButton === \"true\",\r\n showWorkflowCancelButton: windowXml.attributes.ShowWorkflowCancelButton === \"true\",\r\n autoRefreshInterval: parseInt(windowXml.attributes.AutoRefreshInterval, 10),\r\n refreshOnFocus: windowXml.attributes.RefreshOnFocus === \"true\",\r\n cacheOnClient: windowXml.attributes.CacheOnClient === \"true\",\r\n autoSaveOnListRecordChange: windowXml.attributes.AutoSaveOnListRecordChange === \"true\",\r\n requestSaveAfterUpdate: windowXml.attributes.RequestSaveAfterUpdate === \"true\",\r\n screenUI: screenDoc,\r\n panelConfigurations,\r\n formScreenLifecycle,\r\n // isSessioned: windowXml.attributes.UseSession,\r\n dataSources: dataSourcesXml.elements.map((dataSource: any) => {\r\n return new DataSource({\r\n rowState: new RowState({}),\r\n entity: dataSource.attributes.Entity,\r\n dataStructureEntityId: dataSource.attributes.DataStructureEntityId,\r\n identifier: dataSource.attributes.Identifier,\r\n lookupCacheKey: dataSource.attributes.LookupCacheKey,\r\n fields: findStopping(dataSource, (n) => n.name === \"Field\").map((field) => {\r\n return new DataSourceField({\r\n index: parseInt(field.attributes.Index, 10),\r\n name: field.attributes.Name,\r\n });\r\n }),\r\n });\r\n }),\r\n\r\n dataViews: dataViews.map((dataView, i) => {\r\n const configuration = findStopping(dataView, (n) => n.name === \"Configuration\");\r\n\r\n const properties = findStopping(dataView, (n) => n.name === \"Property\").map(parseProperty);\r\n\r\n const formPropertyIds = new Set(findFormPropertyIds(dataView));\r\n for (let prop of properties) {\r\n if (formPropertyIds.has(prop.id)) {\r\n prop.isFormField = true;\r\n }\r\n }\r\n\r\n const actions = findActions(dataView).map(\r\n (action) =>\r\n new Action({\r\n id: action.attributes.Id,\r\n caption: action.attributes.Caption,\r\n groupId: action.attributes.GroupId,\r\n type: action.attributes.Type,\r\n iconUrl: action.attributes.IconUrl,\r\n mode: action.attributes.Mode,\r\n isDefault: action.attributes.IsDefault === \"true\",\r\n placement: action.attributes.Placement,\r\n confirmationMessage: action.attributes.ConfirmationMessage,\r\n parameters: findParameters(action).map(\r\n (parameter) =>\r\n new ActionParameter({\r\n name: parameter.attributes.Name,\r\n fieldName: parameter.attributes.FieldName,\r\n })\r\n ),\r\n })\r\n );\r\n const defaultOrderings = panelConfigurations.get(dataView.attributes.ModelInstanceId)\r\n ?.defaultOrdering;\r\n if (defaultOrderings) {\r\n for (let ordering of defaultOrderings) {\r\n ordering.lookupId = properties.find((prop) => prop.id === ordering.columnId)?.lookupId;\r\n }\r\n }\r\n\r\n const orderingConfiguration = new OrderingConfiguration(defaultOrderings);\r\n const implicitFilters = getImplicitFilters(dataView);\r\n\r\n const filterConfiguration = new FilterConfiguration(implicitFilters);\r\n const filterGroupManager = new FilterGroupManager(filterConfiguration);\r\n panelConfigurationsRaw\r\n .filter((conf: any) => conf.panel.instanceId === dataView.attributes.ModelInstanceId)\r\n .forEach((conf: any) => addFilterGroups(filterGroupManager, properties, conf));\r\n\r\n const dataViewInstance: DataView = new DataView({\r\n isFirst: i === 0,\r\n id: dataView.attributes.Id,\r\n attributes: dataView.attributes,\r\n type: dataView.attributes.Type,\r\n modelInstanceId: dataView.attributes.ModelInstanceId,\r\n name: dataView.attributes.Name,\r\n modelId: dataView.attributes.ModelId,\r\n newRecordView: dataView.attributes.NewRecordView,\r\n defaultPanelView: panelViewFromNumber(parseInt(dataView.attributes.DefaultPanelView)),\r\n activePanelView: panelViewFromNumber(parseInt(dataView.attributes.DefaultPanelView)),\r\n isMapSupported: dataView.attributes.IsMapSupported === \"true\",\r\n isHeadless: dataView.attributes.IsHeadless === \"true\",\r\n disableActionButtons: dataView.attributes.DisableActionButtons === \"true\",\r\n showAddButton: dataView.attributes.ShowAddButton === \"true\",\r\n showDeleteButton: dataView.attributes.ShowDeleteButton === \"true\",\r\n showSelectionCheckboxesSetting: dataView.attributes.ShowSelectionCheckboxes === \"true\",\r\n isGridHeightDynamic: dataView.attributes.IsGridHeightDynamic === \"true\",\r\n selectionMember: dataView.attributes.SelectionMember,\r\n orderMember: dataView.attributes.OrderMember,\r\n isDraggingEnabled: dataView.attributes.IsDraggingEnabled === \"true\",\r\n entity: dataView.attributes.Entity,\r\n dataMember: dataView.attributes.DataMember,\r\n isRootGrid: dataView.attributes.IsRootGrid === \"true\",\r\n isRootEntity: dataView.attributes.IsRootEntity === \"true\",\r\n isPreloaded: dataView.attributes.IsPreloaded === \"true\",\r\n requestDataAfterSelectionChange:\r\n dataView.attributes.RequestDataAfterSelectionChange === \"true\",\r\n confirmSelectionChange: dataView.attributes.ConfirmSelectionChange === \"true\",\r\n formViewUI: findFormRoot(dataView),\r\n dataTable:\r\n dataView.attributes.Type === \"TreePanel\"\r\n ? new TreeDataTable(\r\n dataView.attributes.IdProperty,\r\n dataView.attributes.ParentIdProperty\r\n )\r\n : new DataTable({\r\n formScreenLifecycle: formScreenLifecycle,\r\n dataViewAttributes: dataView.attributes,\r\n orderingConfiguration: orderingConfiguration,\r\n filterConfiguration: filterConfiguration,\r\n }),\r\n serverSideGrouper: new ServerSideGrouper(),\r\n lifecycle: new DataViewLifecycle(),\r\n tablePanelView: new TablePanelView({\r\n tablePropertyIds: properties.slice(1).map((prop) => prop.id),\r\n columnConfigurationDialog: new ColumnConfigurationDialog(),\r\n filterConfiguration: filterConfiguration,\r\n filterGroupManager: filterGroupManager,\r\n orderingConfiguration: orderingConfiguration,\r\n groupingConfiguration: new GroupingConfiguration(),\r\n rowHeight: 25,\r\n }),\r\n formPanelView: new FormPanelView(),\r\n lookupLoader: new LookupLoader(),\r\n properties,\r\n actions,\r\n clientSideGrouper: new ClientSideGrouper(),\r\n dataViewData: new DataViewData(\r\n () => dataViewInstance.dataTable,\r\n (propId) => getDataViewPropertyById(dataViewInstance, propId)\r\n ),\r\n dataViewRowCursor: new RowCursor(() => getSelectedRowId(dataViewInstance)),\r\n dataViewApi: new DataViewAPI(\r\n () => getDataStructureEntityId(dataViewInstance),\r\n () => getEntity(dataViewInstance),\r\n () => screenAPI\r\n ),\r\n });\r\n\r\n instance2XmlNode.set(dataViewInstance, dataView);\r\n\r\n const gridConfigurationNodes = configuration.filter(\r\n (node) => node?.parent?.attributes?.Type === \"Grid\" || node?.parent?.attributes?.Type === \"SectionLevelPlugin\"\r\n );\r\n const configurationNode =\r\n gridConfigurationNodes.length === 1 ? gridConfigurationNodes[0] : undefined;\r\n if (configurationNode) {\r\n const defaultView = findStopping(\r\n configurationNode,\r\n (n) => n.name === \"view\" && n.parent.name === \"defaultView\"\r\n );\r\n defaultView.forEach((element) => {\r\n if (!dataViewInstance.isHeadless && element.attributes.id.length <= 2) {\r\n dataViewInstance.activePanelView = element.attributes.id;\r\n }\r\n });\r\n }\r\n const configurationManager = createConfigurationManager(\r\n gridConfigurationNodes,\r\n dataViewInstance.tablePanelView.tableProperties,\r\n isLazyLoading\r\n );\r\n configurationManager.activeTableConfiguration.apply(dataViewInstance.tablePanelView);\r\n dataViewInstance.tablePanelView.configurationManager = configurationManager;\r\n configurationManager.parent = dataViewInstance.tablePanelView;\r\n properties\r\n .filter((prop) => prop.gridColumnWidth < 0)\r\n .forEach((prop) => {\r\n prop.gridColumnWidth = Math.abs(prop.gridColumnWidth);\r\n prop.width = Math.abs(prop.width);\r\n dataViewInstance.tablePanelView.setPropertyHidden(prop.id, true);\r\n const conf = configurationManager.defaultTableConfiguration.columnConfigurations.find(\r\n (item) => item.propertyId === prop.id\r\n );\r\n if (conf) {\r\n conf.isVisible = false;\r\n }\r\n });\r\n\r\n\r\n lookupMenuMappings.forEach((mapping: any) => {\r\n if (mapping.lookupId && (mapping.menuId || mapping.dependsOnValue)) {\r\n properties.forEach((property) => {\r\n if (property.lookup && property.lookup.lookupId === mapping.lookupId) {\r\n property.linkToMenuId = mapping.menuId;\r\n property.linkDependsOnValue = mapping.dependsOnValue;\r\n }\r\n });\r\n }\r\n });\r\n\r\n // COLUMN ORDER\r\n\r\n return dataViewInstance;\r\n }),\r\n componentBindings: [],\r\n });\r\n\r\n for (let xmlBinding of xmlComponentBindings) {\r\n let existingBinding = scr.componentBindings.find(\r\n (item) =>\r\n item.parentId === xmlBinding.attributes.ParentId &&\r\n item.childId === xmlBinding.attributes.ChildId\r\n );\r\n const componentBindingPair = new ComponentBindingPair({\r\n parentPropertyId: xmlBinding.attributes.ParentProperty,\r\n childPropertyId: xmlBinding.attributes.ChildProperty,\r\n });\r\n if (existingBinding) {\r\n existingBinding.bindingPairs.push(componentBindingPair);\r\n } else {\r\n const cb = new ComponentBinding({\r\n parentId: xmlBinding.attributes.ParentId,\r\n childId: xmlBinding.attributes.ChildId,\r\n parentEntity: xmlBinding.attributes.ParentEntity,\r\n childEntity: xmlBinding.attributes.ChildEntity,\r\n bindingPairs: [componentBindingPair],\r\n childPropertyType: xmlBinding.attributes.ChildPropertyType,\r\n });\r\n scr.componentBindings.push(cb);\r\n cb.parent = scr;\r\n }\r\n }\r\n\r\n const $screen = $workbench!.beginLifetimeScope(SCOPE_Screen);\r\n const $formScreen = $screen.beginLifetimeScope(SCOPE_FormScreen);\r\n $root.register(IOrigamAPI, () => getApi(scr) as OrigamAPI).scopedInstance(SCOPE_Screen);\r\n\r\n const IFormScreen = TypeSymbol(\"IFormScreen\");\r\n\r\n $formScreen.register(IFormScreen, () => scr).scopedInstance(SCOPE_Screen);\r\n\r\n for (let dataView of scr.dataViews) {\r\n const $dataView = $formScreen.beginLifetimeScope(SCOPE_DataView);\r\n $dataView.register(IDataViewTS, () => dataView as DataView).scopedInstance(SCOPE_DataView);\r\n\r\n $dataView\r\n .register(IRowCursor, () => new RowCursor(() => getSelectedRowId(dataView)))\r\n .scopedInstance(SCOPE_DataView);\r\n $dataView\r\n .register(\r\n IViewConfiguration,\r\n () =>\r\n new ViewConfiguration(\r\n function*(perspectiveTag) {\r\n dataView.activePanelView = perspectiveTag as any;\r\n yield*saveColumnConfigurations(dataView)();\r\n },\r\n () => {\r\n if (\r\n dataView.activePanelView === IPanelViewType.Form &&\r\n getGroupingConfiguration(dataView).isGrouping &&\r\n isLazyLoading\r\n ) {\r\n return IPanelViewType.Table;\r\n }\r\n return dataView.activePanelView;\r\n }\r\n )\r\n )\r\n .scopedInstance(SCOPE_DataView);\r\n\r\n $dataView.resolve(IDataViewTS);\r\n\r\n const $tablePerspective = $dataView.beginLifetimeScope(SCOPE_TablePerspective);\r\n $tablePerspective.resolve(ITablePerspectiveDirector).setup();\r\n const tablePerspective = $tablePerspective.resolve(ITablePerspective);\r\n tablePerspective.onTablePerspectiveShown = () => getTablePanelView(dataView)?.triggerOnFocusTable();\r\n\r\n const $formPerspective = $dataView.beginLifetimeScope(SCOPE_FormPerspective);\r\n $formPerspective.resolve(IFormPerspectiveDirector).setup();\r\n const formPerspective = $formPerspective.resolve(IFormPerspective);\r\n dataView.activateFormView = formPerspective.handleClick.bind(formPerspective);\r\n dataView.activateTableView = () =>\r\n runGeneratorInFlowWithHandler({\r\n ctx: dataView,\r\n generator: tablePerspective.handleToolbarBtnClick.bind(formPerspective)(),\r\n });\r\n dataView.isFormViewActive = () => formPerspective.isActive;\r\n dataView.isTableViewActive = () => tablePerspective.isActive;\r\n if (dataView.isMapSupported) {\r\n const dataViewXmlNode = instance2XmlNode.get(dataView)!;\r\n const rootStore = new MapRootStore(dataView);\r\n populateMapViewSetup(rootStore.mapSetupStore, dataViewXmlNode);\r\n //const isReadonly = dataView.properties.some((prop) => prop.readOnly);\r\n const isReadonly = !!dataView.properties.find(\r\n (prop) => prop.id === rootStore.mapSetupStore.mapLocationMember\r\n )?.readOnly;\r\n rootStore.mapSetupStore.isReadOnlyView = isReadonly;\r\n const $mapPerspective = $dataView.beginLifetimeScope(SCOPE_MapPerspective);\r\n const mapPerspectiveDirector = $mapPerspective.resolve(IMapPerspectiveDirector);\r\n\r\n mapPerspectiveDirector.rootStore = rootStore;\r\n mapPerspectiveDirector.setup();\r\n }\r\n\r\n //***************** */\r\n\r\n const {lookupMultiEngine} = workbench;\r\n\r\n dataView.properties\r\n .flatMap((property) => [property, ...property.childProperties])\r\n .filter((property) => property.isLookup && property.lookupId)\r\n .forEach((property) => {\r\n const {lookupId} = property;\r\n foundLookupIds.add(lookupId!);\r\n if (!lookupMultiEngine.lookupEngineById.has(lookupId!)) {\r\n const lookupIndividualEngine = createIndividualLookupEngine(lookupId!, lookupMultiEngine);\r\n lookupMultiEngine.lookupCleanerReloaderById.set(\r\n lookupId!,\r\n lookupIndividualEngine.lookupCleanerReloader\r\n );\r\n lookupIndividualEngine.startup();\r\n lookupMultiEngine.lookupEngineById.set(lookupId!, lookupIndividualEngine);\r\n }\r\n const lookupIndividualEngine = lookupMultiEngine.lookupEngineById.get(lookupId!)!;\r\n property.lookupEngine = lookupIndividualEngine;\r\n });\r\n\r\n flow($dataView.resolve(IPerspective).activateDefault)();\r\n }\r\n\r\n $formScreen.resolve(IFormScreen); // Hack to associate FormScreen with its scope to dispose it later.\r\n\r\n return {formScreen: scr, foundLookupIds};\r\n}\r\n\r\nfunction getImplicitFilters(dataViewXml: any) {\r\n const filterNodes = findStopping(dataViewXml, (node) => node.name === \"Filter\");\r\n if (filterNodes.length === 0) {\r\n return [];\r\n }\r\n return filterNodes.flatMap((node) =>\r\n node.elements.map((element: any) => {\r\n return {\r\n propertyId: element.attributes.Property,\r\n operatorCode: element.attributes.Operator,\r\n value: element.attributes.RightSideValue,\r\n };\r\n })\r\n );\r\n}\r\n\r\nfunction checkInfiniteScrollWillWork(\r\n dataViews: any[],\r\n formScreenLifecycle: IFormScreenLifecycle02,\r\n panelConfigurations: Map\r\n) {\r\n for (let dataView of dataViews) {\r\n const id = dataView.attributes.ModelInstanceId;\r\n const panelConfig = panelConfigurations.get(id);\r\n if (isInfiniteScrollingActive(formScreenLifecycle, dataView.attributes) && !panelConfig) {\r\n throw new Error(\r\n `Table in: ${id} has undefined default ordering while infinite scrolling is on. Make sure the underlying DataStructure has a SortSet defined.`\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction populateMapViewSetup(mss: MapSetupStore, xmlNode: any) {\r\n const attr = xmlNode.attributes;\r\n mss.mapAzimuthMember = attr.MapAzimuthMember;\r\n mss.mapCenterRaw = attr.MapCenter;\r\n mss.mapColorMember = attr.MapColorMember;\r\n mss.mapIconMember = attr.MapIconMember;\r\n mss.mapLocationMember = attr.MapLocationMember;\r\n mss.mapTextMember = attr.MapTextMember;\r\n mss.textColorMember = attr.TextColorMember;\r\n mss.textLocationMember = attr.TextLocationMember;\r\n mss.textRotationMember = attr.TextRotationMember;\r\n mss.mapResolutionRaw = attr.MapResolution;\r\n\r\n const layerXmlNodes = findStopping(\r\n xmlNode,\r\n (node) => node.name === \"Layer\" && node.parent.name === \"MapViewLayers\"\r\n );\r\n for (let layerXmlNode of layerXmlNodes) {\r\n const layerAttr = layerXmlNode.attributes;\r\n const mls = new MapLayerSetup();\r\n mss.layers.push(mls);\r\n mls.defaultEnabled = layerAttr.defaultEnabled === \"true\";\r\n mls.id = layerAttr.id;\r\n mls.title = layerAttr.title;\r\n mls.type = layerAttr.type;\r\n const parameterXmlNodes = findStopping(layerXmlNode, (node) => node.name === \"Parameter\");\r\n for (let parameterXmlnode of parameterXmlNodes) {\r\n mls.mapLayerParameters.set(\r\n parameterXmlnode.attributes.name,\r\n parameterXmlnode.attributes.value\r\n );\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { getTableViewProperties } from \"model/selectors/TablePanelView/getTableViewProperties\";\r\n\r\nexport function startEditingFirstCell(ctx: any) {\r\n return function*startEditingFirstCell() {\r\n const orderingPropertyId = getDataView(ctx)?.orderProperty?.id;\r\n const firstProperty = getTableViewProperties(ctx)\r\n .filter(prop => prop.id !== \"Id\" && prop.id !== orderingPropertyId)?.[0];\r\n getTablePanelView(ctx).selectedColumnId = firstProperty?.id;\r\n if (getTablePanelView(ctx).selectedColumnId) {\r\n getTablePanelView(ctx).scrollToCurrentRow();\r\n setTimeout(() => getTablePanelView(ctx).setEditing(true));\r\n }\r\n };\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { FormFocusManager } from \"model/entities/FormFocusManager\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nexport function getFormFocusManager(ctx: any): FormFocusManager {\r\n return getDataView(ctx).formFocusManager;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { getBindingChildren } from \"./getBindingChildren\";\r\n\r\nexport function getAllBindingChildren(ctx: any) {\r\n const resultArray: IDataView[] = [];\r\n getChildrenRecursive(ctx, resultArray);\r\n return resultArray;\r\n}\r\n\r\nfunction getChildrenRecursive(ctx: any, resultArray: IDataView[]) {\r\n const childDatViews = getBindingChildren(ctx);\r\n for (const dataView of childDatViews) {\r\n resultArray.push(dataView);\r\n getChildrenRecursive(dataView, resultArray);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { createMachine, interpret } from \"xstate\";\r\nimport { IUpdateData } from \"../types/IApi\";\r\n\r\n\r\ninterface IUpdateObjectData {\r\n SessionFormIdentifier: string;\r\n Entity: string;\r\n UpdateData: IUpdateData[];\r\n}\r\n\r\ninterface IExtPromise extends Promise {\r\n resolve(result?: T): void;\r\n\r\n reject(error?: any): void;\r\n}\r\n\r\nfunction ExtPromise() {\r\n let resolveFn;\r\n let rejectFn;\r\n const promise = new Promise((resolve, reject) => {\r\n resolveFn = resolve;\r\n rejectFn = reject;\r\n });\r\n (promise as any).resolve = resolveFn;\r\n (promise as any).reject = rejectFn;\r\n return promise as IExtPromise;\r\n}\r\n\r\nexport class UpdateRequestAggregator {\r\n constructor(\r\n private api: { updateObject(data: IUpdateObjectData): Promise }\r\n ) {\r\n this.interpreter.start();\r\n }\r\n\r\n registeredRequests: Array; isRunning: boolean }> = [];\r\n\r\n itemJustEnqueued?: IUpdateObjectData & { promise: IExtPromise; isRunning: boolean };\r\n\r\n currentRequest?: IUpdateObjectData & { promise: IExtPromise };\r\n\r\n interpreter = interpret(\r\n createMachine(\r\n {\r\n id: \"updateObject\",\r\n initial: \"IDLE\",\r\n states: {\r\n IDLE: {\r\n on: {\r\n UPDATE_REQUESTED: {\r\n actions: [\"enqueueRequest\"],\r\n target: \"UPDATE_DEBOUNCING\",\r\n },\r\n },\r\n },\r\n UPDATE_DEBOUNCING: {\r\n on: {\r\n UPDATE_REQUESTED: {\r\n actions: [\"enqueueRequest\"],\r\n target: \"UPDATE_DEBOUNCING\",\r\n },\r\n },\r\n after: {\r\n 170: \"DEQUEUE\",\r\n },\r\n },\r\n DEQUEUE: {\r\n entry: \"dequeueToCurrentRequest\",\r\n always: \"UPDATING\",\r\n },\r\n UPDATING: {\r\n initial: \"API_RUNNING\",\r\n states: {\r\n API_RUNNING: {\r\n invoke: {\r\n src: \"apiUpdateObject\",\r\n onDone: \"API_RESOLVED\",\r\n onError: \"API_REJECTED\",\r\n },\r\n },\r\n API_RESOLVED: {\r\n entry: [\"resolveCurrentPromise\"],\r\n type: \"final\",\r\n },\r\n API_REJECTED: {\r\n entry: [\"rejectCurrentPromise\"],\r\n type: \"final\",\r\n },\r\n },\r\n on: {\r\n UPDATE_REQUESTED: {\r\n actions: [\"enqueueRequest\"],\r\n },\r\n },\r\n onDone: [\r\n {cond: \"hasMoreItems\", target: \"#updateObject.DEQUEUE\"},\r\n {target: \"#updateObject.IDLE\"},\r\n ],\r\n exit: [\"resetCurrentRequest\"],\r\n },\r\n },\r\n },\r\n {\r\n services: {\r\n apiUpdateObject: (ctx, event) => {\r\n return this.api.updateObject(this.currentRequest!);\r\n },\r\n },\r\n actions: {\r\n enqueueRequest: (ctx, event) => {\r\n const updateObjectItem = this.mergeToQueue(event.payload);\r\n this.itemJustEnqueued = updateObjectItem;\r\n },\r\n dequeueToCurrentRequest: (ctx, event) => {\r\n const item = this.registeredRequests.shift();\r\n this.currentRequest = item;\r\n },\r\n resolveCurrentPromise: (ctx, event) => {\r\n this.currentRequest?.promise.resolve(event.data);\r\n },\r\n rejectCurrentPromise: (ctx, event) => {\r\n this.currentRequest?.promise.reject(event.data);\r\n },\r\n resetCurrentRequest: (ctx, event) => {\r\n this.currentRequest = undefined;\r\n },\r\n },\r\n guards: {\r\n hasMoreItems: (ctx, event) => {\r\n return this.registeredRequests.length > 0;\r\n },\r\n },\r\n }\r\n ),\r\n {devTools: true}\r\n );\r\n\r\n enqueue(data: IUpdateObjectData): Promise {\r\n this.interpreter.send({\r\n type: \"UPDATE_REQUESTED\",\r\n payload: data,\r\n });\r\n const {itemJustEnqueued} = this;\r\n this.itemJustEnqueued = undefined;\r\n return itemJustEnqueued!.promise;\r\n }\r\n\r\n mergeToQueue(data: IUpdateObjectData) {\r\n let updateObjectItem = this.registeredRequests.find(\r\n (item) => item.Entity === data.Entity && !item.isRunning\r\n );\r\n if (!updateObjectItem) {\r\n updateObjectItem = {\r\n SessionFormIdentifier: data.SessionFormIdentifier,\r\n Entity: data.Entity,\r\n UpdateData: data.UpdateData,\r\n promise: ExtPromise(),\r\n isRunning: false,\r\n };\r\n this.registeredRequests.push(updateObjectItem);\r\n }\r\n\r\n for (let inputRow of data.UpdateData) {\r\n let existingRow = updateObjectItem.UpdateData.find(\r\n (item) => item.RowId === inputRow.RowId\r\n );\r\n if (!existingRow) {\r\n existingRow = {RowId: inputRow.RowId, Values: {}};\r\n updateObjectItem.UpdateData.push(existingRow);\r\n }\r\n existingRow.Values = {...existingRow.Values, ...inputRow.Values};\r\n }\r\n return updateObjectItem;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nimport { action } from \"mobx\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { YesNoQuestion } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\n\r\nexport function askYesNoQuestion(ctx: any, title: string, question: string) {\r\n return new Promise(\r\n action((resolve: (value: boolean) => void) => {\r\n const closeDialog = getDialogStack(ctx).pushDialog(\r\n \"\",\r\n {\r\n closeDialog();\r\n resolve(true);\r\n }}\r\n onNoClick={() => {\r\n closeDialog();\r\n resolve(false);\r\n }}\r\n />\r\n );\r\n }\r\n )\r\n );\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { IGuiHelper, IPluginData, IPluginDataView, IPluginProperty, IPluginTableRow, } from \"@origam/plugin-interfaces\";\r\nimport { getConfigurationManager } from \"model/selectors/TablePanelView/getConfigurationManager\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { getActivePanelView } from \"model/selectors/DataView/getActivePanelView\";\r\nimport { runGeneratorInFlowWithHandler, runInFlowWithHandler, wrapInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { askYesNoQuestion } from \"gui/Components/Dialog/DialogUtils\";\r\n\r\n\r\nexport function createPluginData(dataView: IDataView): IPluginData | undefined {\r\n if (!dataView) {\r\n return undefined;\r\n }\r\n return {\r\n dataView: new PluginDataView(dataView),\r\n guiHelper: new GuiHelper(dataView)\r\n }\r\n}\r\n\r\nclass GuiHelper implements IGuiHelper {\r\n\r\n constructor(private ctx: any) {\r\n }\r\n\r\n askYesNoQuestion(title: string, question: string){\r\n return askYesNoQuestion(this.ctx, title, question);\r\n }\r\n\r\n runGeneratorInFlowWithHandler(generator: Generator): Promise {\r\n return runGeneratorInFlowWithHandler({ctx: this.ctx, generator: generator});\r\n }\r\n\r\n runInFlowWithHandler(action: (() => Promise) | (() => void)) {\r\n return runInFlowWithHandler({ctx: this.ctx, action: action});\r\n }\r\n\r\n wrapInFlowWithHandler(action: (() => Promise) | (() => void)) {\r\n return wrapInFlowWithHandler({ctx:this.ctx, action: action});\r\n }\r\n}\r\n\r\nclass PluginDataView implements IPluginDataView {\r\n properties: IPluginProperty[];\r\n\r\n get tableRows(): IPluginTableRow[] {\r\n return this.dataView.tableRows;\r\n }\r\n\r\n constructor(\r\n private dataView: IDataView,\r\n ) {\r\n this.properties = getProperties(this.dataView)\r\n .map(property => {\r\n return{\r\n id: property.id,\r\n name: property.name,\r\n type: property.column,\r\n momentFormatterPattern: property.formatterPattern\r\n }\r\n });\r\n }\r\n\r\n async saveConfiguration(pluginName: string, configuration: string): Promise {\r\n const configurationManager = getConfigurationManager(this.dataView);\r\n configurationManager.setCustomConfiguration(pluginName, configuration);\r\n const customConfigurations: {[key:string]: string} = {};\r\n customConfigurations[pluginName] = configuration;\r\n\r\n await getApi(this.dataView).saveObjectConfiguration({\r\n sessionFormIdentifier: getSessionId(this.dataView),\r\n instanceId: this.dataView.modelInstanceId,\r\n tableConfigurations: configurationManager.allTableConfigurations,\r\n customConfigurations: customConfigurations,\r\n defaultView: getActivePanelView(this.dataView),\r\n });\r\n }\r\n\r\n getConfiguration(pluginName: string){\r\n const configurationManager = getConfigurationManager(this.dataView);\r\n return configurationManager.getCustomConfiguration(pluginName)\r\n }\r\n\r\n getCellText(row: any[], propertyId: string): any {\r\n const property = getProperties(this.dataView).find(prop => prop.id === propertyId);\r\n if (!property) {\r\n throw new Error(\"Property named \\\"\" + propertyId + \"\\\" was not found\");\r\n }\r\n return this.dataView.dataTable.getCellText(row, property);\r\n }\r\n\r\n getCellValue(row: any[], propertyId: string): any {\r\n const property = getProperties(this.dataView).find(prop => prop.id === propertyId);\r\n if (!property) {\r\n throw new Error(\"Property named \\\"\" + propertyId + \"\\\" was not found\");\r\n }\r\n return this.dataView.dataTable.getCellValue(row, property);\r\n }\r\n\r\n getRowId(row: IPluginTableRow) {\r\n return Array.isArray(row)\r\n ? this.dataView.dataTable.getRowId(row)\r\n : row.columnLabel + row.columnValue + row.groupLevel + row.isExpanded;\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getLocaleFromCookie } from \"utils/cookies\";\r\nimport MessageFormat from '@messageformat/core';\r\nimport {\r\n ILocalization,\r\n ILocalizer,\r\n} from \"@origam/plugin-interfaces\";\r\n\r\nexport class Localizer implements ILocalizer {\r\n\r\n private messageFormat: MessageFormat;\r\n private defaultMessageFormat: MessageFormat;\r\n private _activeLocalization: ILocalization | undefined;\r\n private _defaultLocalization: ILocalization | undefined;\r\n public locale;\r\n\r\n get defaultLocalization(){\r\n if(!this._defaultLocalization){\r\n this._defaultLocalization = this.getLocalization(this.defaultLocale);\r\n }\r\n return this._defaultLocalization;\r\n }\r\n get activeLocalization(){\r\n if(!this._activeLocalization){\r\n this._activeLocalization = this.getLocalization(this.locale);\r\n }\r\n return this._activeLocalization;\r\n }\r\n\r\n constructor(private localizations: ILocalization[], private defaultLocale: string) {\r\n this.locale = getLocaleFromCookie()\r\n this.messageFormat = new MessageFormat(this.locale);\r\n this.defaultMessageFormat = this.locale === defaultLocale\r\n ? this.messageFormat\r\n : new MessageFormat(this.locale);\r\n }\r\n\r\n private getLocalization(locale: string) {\r\n const localeLower = locale.toLowerCase();\r\n let localization = this.localizations.find(localization => localization.locale.toLowerCase() === localeLower);\r\n if (!localization) {\r\n localization = this.localizations.find(localization => localization.locale.toLowerCase() === localeLower.split(\"-\")[0]);\r\n }\r\n if (!localization) {\r\n throw new Error(`Plugin localization for locale: \"${locale}\" was not found`)\r\n }\r\n return localization\r\n }\r\n\r\n public translate(key: string, parameters?: { [key: string]: any }) {\r\n let translation = this.activeLocalization.translations[key]\r\n ?? this.defaultLocalization.translations[key];\r\n if (!translation) {\r\n throw new Error(`No translation was found for: \"${key}\" `)\r\n }\r\n\r\n const message = this.messageFormat.compile(translation);\r\n return parameters\r\n ? message(parameters)\r\n : message();\r\n }\r\n}\r\n\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\nimport { createPluginData } from \"./PluginData\";\r\nimport React, { Fragment } from \"react\";\r\nimport { registerPlugins } from \"plugins/tools/PluginRegistration\";\r\nimport { Localizer } from \"plugins/tools/Localizer\";\r\nimport {\r\n ILocalization,\r\n IPlugin\r\n} from \"@origam/plugin-interfaces\";\r\n\r\nconst pluginFactoryFunctions: Map IPlugin> = new Map IPlugin>();\r\n\r\nexport function registerPlugin(pluginName: string, factoryFunction: () => IPlugin){\r\n pluginFactoryFunctions.set(pluginName, factoryFunction)\r\n}\r\n\r\nregisterPlugins();\r\n\r\nexport class PluginLibrary {\r\n pluginInstances: Map = new Map();\r\n\r\n getComponent(args: { name: string, modelInstanceId: string, sessionId: string, ctx: any }): JSX.Element {\r\n const plugin = this.get({\r\n name: args.name,\r\n modelInstanceId: args.modelInstanceId,\r\n sessionId: args.sessionId\r\n });\r\n const dataView = getDataView(args.ctx);\r\n const pluginData = createPluginData(dataView)\r\n const createLocalizer = (localizations: ILocalization[]) => new Localizer(localizations, \"en-us\");\r\n return {plugin.getComponent(pluginData!, createLocalizer)};\r\n }\r\n\r\n get(args: { name: string, modelInstanceId: string, sessionId: string }): IPlugin {\r\n if (!args.modelInstanceId) {\r\n throw new Error(\"modelInstanceId must have a value\")\r\n }\r\n if (!args.sessionId) {\r\n throw new Error(\"sessionId must have a value\")\r\n }\r\n if (!args.name) {\r\n throw new Error(\"name must have a value\")\r\n }\r\n let pluginId = args.modelInstanceId + \"_\" + args.sessionId;\r\n if (this.pluginInstances.has(pluginId)) {\r\n return this.pluginInstances.get(pluginId)!;\r\n }\r\n const plugin = this.makePluginInstance(args.name);\r\n plugin.id = pluginId;\r\n this.pluginInstances.set(plugin.id, plugin);\r\n return plugin;\r\n }\r\n\r\n makePluginInstance(name: string) {\r\n if (!pluginFactoryFunctions.has(name)) {\r\n throw new Error(`Cannot find plugin class named: ${name}`)\r\n }\r\n return pluginFactoryFunctions.get(name)!();\r\n }\r\n}\r\n\r\nexport const pluginLibrary = new PluginLibrary();\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nimport { registerPlugin } from \"plugins/tools/PluginLibrary\";\r\nimport { AuditPlugin } from \"@origam/plugin-audit\";\r\nimport { FilterPlugin } from \"@origam/plugin-filter\";\r\nimport { RadarChartPlugin } from \"@origam/plugin-chart\";\r\n\r\nexport function registerPlugins() {\r\n registerPlugin(\"FilterPlugin\", () => new FilterPlugin());\r\n registerPlugin(\"AuditPlugin\", () => new AuditPlugin());\r\n registerPlugin(\"RadarChartPlugin\", () => new RadarChartPlugin());\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { QuestionSaveData } from \"gui/Components/Dialogs/QuestionSaveData\";\r\nimport { action, autorun, comparer, flow, observable, reaction, when } from \"mobx\";\r\nimport { new_ProcessActionResult } from \"model/actions/Actions/processActionResult\";\r\nimport { closeForm } from \"model/actions/closeForm\";\r\nimport { processCRUDResult } from \"model/actions/DataLoading/processCRUDResult\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { refreshWorkQueues } from \"model/actions/WorkQueues/refreshWorkQueues\";\r\nimport { IAction } from \"model/entities/types/IAction\";\r\nimport { getBindingParametersFromParent } from \"model/selectors/DataView/getBindingParametersFromParent\";\r\nimport { getColumnNamesToLoad } from \"model/selectors/DataView/getColumnNamesToLoad\";\r\nimport { getDataStructureEntityId } from \"model/selectors/DataView/getDataStructureEntityId\";\r\nimport { getDataViewByGridId } from \"model/selectors/DataView/getDataViewByGridId\";\r\nimport { getDataViewsByEntity } from \"model/selectors/DataView/getDataViewsByEntity\";\r\nimport { getAutorefreshPeriod as getAutoRefreshPeriod } from \"model/selectors/FormScreen/getAutorefreshPeriod\";\r\nimport { getDataViewList } from \"model/selectors/FormScreen/getDataViewList\";\r\nimport { getIsFormScreenDirty } from \"model/selectors/FormScreen/getisFormScreenDirty\";\r\nimport { getIsSuppressSave } from \"model/selectors/FormScreen/getIsSuppressSave\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { getIsActiveScreen } from \"model/selectors/getIsActiveScreen\";\r\nimport { map2obj } from \"utils/objects\";\r\nimport { interpretScreenXml } from \"xmlInterpreters/screenXml\";\r\nimport { getFormScreen } from \"../../selectors/FormScreen/getFormScreen\";\r\nimport { getApi } from \"../../selectors/getApi\";\r\nimport { getMenuItemId } from \"../../selectors/getMenuItemId\";\r\nimport { getOpenedScreen } from \"../../selectors/getOpenedScreen\";\r\nimport { getSessionId } from \"../../selectors/getSessionId\";\r\nimport { IFormScreenLifecycle02 } from \"../types/IFormScreenLifecycle\";\r\nimport { IDataView } from \"../types/IDataView\";\r\nimport { IAggregationInfo } from \"../types/IAggregationInfo\";\r\nimport { SCROLL_ROW_CHUNK } from \"gui/Workbench/ScreenArea/TableView/InfiniteScrollLoader\";\r\nimport { IQueryInfo, processActionQueryInfo } from \"model/actions/Actions/processActionQueryInfo\";\r\nimport { assignIIds, find } from \"xmlInterpreters/xmlUtils\";\r\nimport { IOrderByDirection, IOrdering } from \"../types/IOrderingConfiguration\";\r\nimport { getOrderingConfiguration } from \"../../selectors/DataView/getOrderingConfiguration\";\r\nimport { getFilterConfiguration } from \"../../selectors/DataView/getFilterConfiguration\";\r\nimport { getUserFilters } from \"../../selectors/DataView/getUserFilters\";\r\nimport { getUserOrdering } from \"../../selectors/DataView/getUserOrdering\";\r\nimport { FlowBusyMonitor } from \"utils/flow\";\r\nimport { IScreenEvents } from \"modules/Screen/FormScreen/ScreenEvents\";\r\nimport { scopeFor } from \"dic/Container\";\r\nimport { getUserFilterLookups } from \"../../selectors/DataView/getUserFilterLookups\";\r\nimport _, { isArray } from \"lodash\";\r\nimport { YesNoQuestion } from \"@origam/components\";\r\nimport { getProperties } from \"model/selectors/DataView/getProperties\";\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\nimport { shouldProceedToChangeRow } from \"model/actions-ui/DataView/TableView/shouldProceedToChangeRow\";\r\nimport { getGroupingConfiguration } from \"model/selectors/TablePanelView/getGroupingConfiguration\";\r\nimport { startEditingFirstCell } from \"model/actions/DataView/startEditingFirstCell\";\r\nimport { getFormFocusManager } from \"model/selectors/DataView/getFormFocusManager\";\r\nimport { getDataSourceFieldByName } from \"model/selectors/DataSources/getDataSourceFieldByName\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getAllBindingChildren } from \"model/selectors/DataView/getAllBindingChildren\";\r\nimport { getEntity } from \"model/selectors/DataView/getEntity\";\r\nimport { isInfiniteScrollingActive } from \"model/selectors/isInfiniteScrollingActive\";\r\nimport { AggregationType } from \"../types/AggregationType\";\r\nimport { calcAggregations, parseAggregations } from \"../Aggregatioins\";\r\nimport { UpdateRequestAggregator } from \"./UpdateRequestAggregator\";\r\nimport { IGroupingSettings } from \"../types/IGroupingConfiguration\";\r\nimport { groupingUnitToString } from \"../types/GroupingUnit\";\r\nimport { getTablePanelView } from \"../../selectors/TablePanelView/getTablePanelView\";\r\nimport { getFormScreenLifecycle } from \"../../selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { runGeneratorInFlowWithHandler, runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { onFieldBlur } from \"../../actions-ui/DataView/TableView/onFieldBlur\";\r\nimport { getRowStates } from \"../../selectors/RowState/getRowStates\";\r\nimport { getIsAddButtonVisible } from \"../../selectors/DataView/getIsAddButtonVisible\";\r\nimport { pluginLibrary } from \"plugins/tools/PluginLibrary\";\r\nimport { isIScreenPlugin, isISectionPlugin } from \"@origam/plugin-interfaces\";\r\nimport { refreshRowStates } from \"model/actions/RowStates/refreshRowStates\";\r\nimport {T} from \"utils/translation\";\r\nimport { askYesNoQuestion } from \"gui/Components/Dialog/DialogUtils\";\r\nimport { getDataView } from \"model/selectors/DataView/getDataView\";\r\n\r\nenum IQuestionSaveDataAnswer {\r\n Cancel = 0,\r\n NoSave = 1,\r\n Save = 2,\r\n}\r\n\r\nenum IQuestionDeleteDataAnswer {\r\n No = 0,\r\n Yes = 1,\r\n}\r\n\r\nexport const closingScreens = new WeakSet();\r\n\r\nexport class FormScreenLifecycle02 implements IFormScreenLifecycle02 {\r\n $type_IFormScreenLifecycle: 1 = 1;\r\n\r\n parameters: { [key: string]: string } = {};\r\n focusedDataViewId: string | undefined;\r\n _updateRequestAggregator: UpdateRequestAggregator | undefined;\r\n\r\n get updateRequestAggregator() {\r\n if (!this._updateRequestAggregator) {\r\n this._updateRequestAggregator = new UpdateRequestAggregator(getApi(this));\r\n }\r\n return this._updateRequestAggregator;\r\n }\r\n\r\n @observable allDataViewsSteady = true;\r\n\r\n monitor: FlowBusyMonitor = new FlowBusyMonitor();\r\n\r\n get isWorkingDelayed() {\r\n return this.monitor.isWorkingDelayed;\r\n }\r\n\r\n initialSelectedRowId: string | undefined;\r\n\r\n get isWorking() {\r\n return this.monitor.isWorking;\r\n }\r\n\r\n disposers: (() => void)[] = [];\r\n\r\n registerDisposer(disposer: () => void) {\r\n this.disposers.push(disposer);\r\n }\r\n\r\n *onFlushData(): Generator {\r\n yield*this.flushData();\r\n }\r\n\r\n *onCreateRow(entity: string, gridId: string): Generator {\r\n yield*this.createRow(entity, gridId);\r\n }\r\n\r\n *onCopyRow(entity: any, gridId: string, rowId: string): any {\r\n yield*this.copyRow(entity, gridId, rowId);\r\n }\r\n\r\n *onDeleteRow(\r\n entity: string,\r\n rowId: string,\r\n dataView: IDataView\r\n ): Generator {\r\n yield*this.onRequestDeleteRow(entity, rowId, dataView);\r\n }\r\n\r\n *onSaveSession(): Generator {\r\n yield*this.flushData();\r\n yield*this.saveSession();\r\n }\r\n\r\n *onExecuteAction(\r\n gridId: string,\r\n entity: string,\r\n action: IAction,\r\n selectedItems: string[]\r\n ): Generator {\r\n if (action.confirmationMessage && !(yield askYesNoQuestion(this, getOpenedScreen(this).tabTitle, action.confirmationMessage))) {\r\n return;\r\n }\r\n yield*this.executeAction(gridId, entity, action, selectedItems);\r\n }\r\n\r\n *onRequestDeleteRow(entity: string, rowId: string, dataView: IDataView): any {\r\n if ((yield this.questionDeleteData()) === IQuestionDeleteDataAnswer.Yes) {\r\n yield*this.deleteRow(entity, rowId, dataView);\r\n }\r\n }\r\n\r\n *onRequestScreenClose(isDueToError?: boolean): Generator {\r\n const formScreen = getFormScreen(this);\r\n for (let dataView of formScreen.dataViews) {\r\n yield onFieldBlur(dataView)(null);\r\n }\r\n\r\n // Just wait if there is some data manipulation in progress.\r\n yield formScreen.dataUpdateCRS.runAsync(() => Promise.resolve());\r\n if (isDueToError || !getIsFormScreenDirty(this) || getIsSuppressSave(this)) {\r\n yield*this.closeForm();\r\n return;\r\n }\r\n switch (yield this.questionSaveData()) {\r\n case IQuestionSaveDataAnswer.Cancel:\r\n return;\r\n case IQuestionSaveDataAnswer.Save:\r\n const saveSuccessful = yield*this.saveSession();\r\n if (saveSuccessful) {\r\n yield*this.closeForm();\r\n }\r\n return;\r\n case IQuestionSaveDataAnswer.NoSave:\r\n yield*this.closeForm();\r\n return;\r\n }\r\n }\r\n\r\n *onRequestScreenReload(): Generator {\r\n if (!getIsFormScreenDirty(this) || getIsSuppressSave(this)) {\r\n yield*this.refreshSession();\r\n return;\r\n }\r\n getFormScreen(this).dataViews.forEach((dataView) => dataView.onReload());\r\n switch (yield this.questionSaveData()) {\r\n case IQuestionSaveDataAnswer.Cancel:\r\n return;\r\n case IQuestionSaveDataAnswer.Save:\r\n yield*this.saveSession();\r\n yield*this.refreshSession();\r\n return;\r\n case IQuestionSaveDataAnswer.NoSave:\r\n if (!this.eagerLoading) {\r\n yield*this.revertChanges();\r\n }\r\n yield*this.refreshSession();\r\n return;\r\n }\r\n }\r\n\r\n *revertChanges(): Generator {\r\n const api = getApi(this);\r\n yield api.revertChanges({sessionFormIdentifier: getSessionId(this)});\r\n }\r\n\r\n *onWorkflowNextClick(event: any): Generator {\r\n this.monitor.inFlow++;\r\n try {\r\n const api = getApi(this);\r\n const sessionId = getSessionId(this);\r\n const actionQueryInfo = (yield api.workflowNextQuery({\r\n sessionFormIdentifier: sessionId,\r\n })) as IQueryInfo[];\r\n const formScreen = getFormScreen(this);\r\n const processQueryInfoResult = yield*processActionQueryInfo(this)(\r\n actionQueryInfo,\r\n formScreen.title\r\n );\r\n if (!processQueryInfoResult.canContinue) return;\r\n let uiResult;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n uiResult = yield api.workflowNext({\r\n sessionFormIdentifier: sessionId,\r\n CachedFormIds: [],\r\n });\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n this.killForm();\r\n yield*this.start(uiResult);\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *onWorkflowAbortClick(event: any): Generator {\r\n this.monitor.inFlow++;\r\n try {\r\n const api = getApi(this);\r\n let uiResult;\r\n const formScreen = getFormScreen(this);\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n uiResult = yield api.workflowAbort({sessionFormIdentifier: getSessionId(this)});\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n this.killForm();\r\n yield*this.start(uiResult);\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *onWorkflowRepeatClick(event: any): Generator {\r\n this.monitor.inFlow++;\r\n try {\r\n const api = getApi(this);\r\n const sessionId = getSessionId(this);\r\n let uiResult;\r\n const formScreen = getFormScreen(this);\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n uiResult = yield api.workflowRepeat({sessionFormIdentifier: sessionId});\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n this.killForm();\r\n yield*this.start(uiResult);\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *onWorkflowCloseClick(event: any): Generator {\r\n this.monitor.inFlow++;\r\n try {\r\n const formScreen = getFormScreen(this);\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n yield*this.onRequestScreenClose();\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n _autoRefreshTimerHandle: any;\r\n\r\n *startAutoRefreshIfNeeded() {\r\n const autoRefreshPeriod = getAutoRefreshPeriod(this);\r\n if (autoRefreshPeriod) {\r\n this.disposers.push(\r\n autorun(() => {\r\n if (\r\n !getIsSuppressSave(this) &&\r\n (getIsFormScreenDirty(this) || !getIsActiveScreen(this))\r\n ) {\r\n this.clearAutoRefreshInterval();\r\n } else {\r\n this._autoRefreshTimerHandle = setInterval(\r\n () => this.performAutoReload(),\r\n autoRefreshPeriod * 1000\r\n );\r\n }\r\n })\r\n );\r\n }\r\n }\r\n\r\n clearAutoRefreshInterval() {\r\n if (this._autoRefreshTimerHandle) {\r\n clearInterval(this._autoRefreshTimerHandle);\r\n this._autoRefreshTimerHandle = undefined;\r\n }\r\n }\r\n\r\n performAutoReload() {\r\n const self = this;\r\n flow(function*() {\r\n try {\r\n const formScreen = getFormScreen(self);\r\n formScreen.dataViews.forEach((dataView) => getRowStates(dataView).suppressWorkingStatus = true);\r\n yield*self.refreshSession();\r\n } catch (e) {\r\n yield*handleError(self)(e);\r\n throw e;\r\n } finally {\r\n const formScreen = getFormScreen(self);\r\n formScreen.dataViews.forEach((dataView) => getRowStates(dataView).suppressWorkingStatus = false);\r\n }\r\n })();\r\n }\r\n\r\n *start(initUIResult: any): Generator {\r\n let _steadyDebounceTimeout: any;\r\n this.disposers.push(\r\n reaction(\r\n () => getFormScreen(this).dataViews.every((dv) => !dv.isWorking) && !this.isWorkingDelayed,\r\n (allDataViewsSteady) => {\r\n if (allDataViewsSteady) {\r\n _steadyDebounceTimeout = setTimeout(() => {\r\n _steadyDebounceTimeout = undefined;\r\n this.allDataViewsSteady = true;\r\n }, 100);\r\n } else {\r\n this.allDataViewsSteady = false;\r\n if (_steadyDebounceTimeout) {\r\n clearTimeout(_steadyDebounceTimeout);\r\n _steadyDebounceTimeout = undefined;\r\n }\r\n }\r\n }\r\n ),\r\n () => {\r\n clearTimeout(_steadyDebounceTimeout);\r\n _steadyDebounceTimeout = undefined;\r\n }\r\n );\r\n try {\r\n const openedScreen = getOpenedScreen(this);\r\n if(!openedScreen){\r\n return;\r\n }\r\n this.initialSelectedRowId = initUIResult.currentRecordId;\r\n yield*this.applyInitUIResult({initUIResult});\r\n this.initializePlugins(initUIResult);\r\n if (!this.eagerLoading) {\r\n yield*this.clearTotalCounts();\r\n yield*this.loadData({keepCurrentData: false});\r\n yield*this.updateTotalRowCounts();\r\n const formScreen = getFormScreen(this);\r\n for (let rootDataView of formScreen.rootDataViews) {\r\n const orderingConfiguration = getOrderingConfiguration(rootDataView);\r\n const filterConfiguration = getFilterConfiguration(rootDataView);\r\n this.disposers.push(\r\n reaction(\r\n () => {\r\n const filters = filterConfiguration.activeFilters\r\n .map((x) => [\r\n x.propertyId,\r\n x.setting.type,\r\n isArray(x.setting.val1) ? [...x.setting.val1] : x.setting.val1,\r\n x.setting.val2,\r\n ])\r\n .filter((item) => {\r\n if (\r\n item[1] === \"in\" ||\r\n item[1] === \"eq\" ||\r\n item[1] === \"neq\" ||\r\n item[1] === \"nin\" ||\r\n item[1] === \"neq\" ||\r\n item[1] === \"contains\" ||\r\n item[1] === \"ncontains\" ||\r\n item[1] === \"lt\" ||\r\n item[1] === \"lte\" ||\r\n item[1] === \"gt\" ||\r\n item[1] === \"gte\" ||\r\n item[1] === \"between\" ||\r\n item[1] === \"nbetween\" ||\r\n item[1] === \"starts\" ||\r\n item[1] === \"nstarts\" ||\r\n item[1] === \"ends\" ||\r\n item[1] === \"nends\"\r\n ) {\r\n return item[2] !== undefined || item[3] !== undefined;\r\n } else {\r\n return true;\r\n }\r\n });\r\n return {\r\n filters,\r\n } as any;\r\n },\r\n () =>\r\n this.sortAndFilterReaction({dataView: rootDataView, updateTotalRowCount: true}),\r\n {\r\n equals: comparer.structural,\r\n delay: 100,\r\n }\r\n )\r\n );\r\n this.disposers.push(\r\n reaction(\r\n () => orderingConfiguration.userOrderings.map((x) => [x.columnId, x.direction]),\r\n () =>\r\n this.sortAndFilterReaction({dataView: rootDataView, updateTotalRowCount: false}),\r\n {\r\n equals: comparer.structural,\r\n delay: 100,\r\n }\r\n )\r\n );\r\n }\r\n }\r\n } finally {\r\n this.initialSelectedRowId = undefined;\r\n }\r\n yield*this.startAutoRefreshIfNeeded();\r\n }\r\n\r\n private initializePlugins(initUIResult: any) {\r\n let screenLevelPlugins = find(initUIResult.formDefinition, (node: any) => node.attributes?.Type === \"ScreenLevelPlugin\");\r\n let sessionId = getSessionId(this);\r\n screenLevelPlugins\r\n .forEach(node => {\r\n const plugin = pluginLibrary.get(\r\n {\r\n name: node.attributes.Name,\r\n modelInstanceId: node.attributes.ModelInstanceId,\r\n sessionId: sessionId\r\n });\r\n if (!isIScreenPlugin(plugin)) {\r\n throw new Error(`Plugin ${node.attributes.Name} is not ScreenLevelPlugin`)\r\n }\r\n plugin.requestSessionRefresh = () => runGeneratorInFlowWithHandler(\r\n {ctx: this, generator: this.refreshSession()}\r\n );\r\n plugin.setScreenParameters = (parameters: { [key: string]: string }) =>\r\n Object.keys(parameters)\r\n .forEach(key => this.parameters[key] = parameters[key]);\r\n plugin.initialize(node.attributes);\r\n })\r\n\r\n find(initUIResult.formDefinition, (node: any) => node.attributes?.Type === \"SectionLevelPlugin\")\r\n .forEach(node => {\r\n const plugin = pluginLibrary.get(\r\n {\r\n name: node.attributes.Name,\r\n modelInstanceId: node.attributes.ModelInstanceId,\r\n sessionId: sessionId\r\n })\r\n if (!isISectionPlugin(plugin)) {\r\n throw new Error(`Plugin ${node.attributes.Name} is not SectionLevelPlugin`)\r\n }\r\n plugin.getScreenParameters = () => _.cloneDeep(this.parameters);\r\n plugin.initialize(node.attributes)\r\n });\r\n }\r\n\r\n sortAndFilterReaction(args: { dataView: IDataView; updateTotalRowCount: boolean }) {\r\n const self = this;\r\n flow(function*() {\r\n if (!(yield shouldProceedToChangeRow(args.dataView))) {\r\n return;\r\n }\r\n yield args.dataView.lifecycle.runRecordChangedReaction(function*() {\r\n const groupingConfig = getGroupingConfiguration(args.dataView);\r\n if (groupingConfig.isGrouping) {\r\n args.dataView.serverSideGrouper.refresh();\r\n } else {\r\n args.dataView.setRowCount(undefined);\r\n yield self.readFirstChunkOfRowsWithGateDebounced(args.dataView);\r\n yield self.updateTotalRowCount(args.dataView);\r\n }\r\n });\r\n })();\r\n }\r\n\r\n *applyInitUIResult(args: { initUIResult: any }): any {\r\n const openedScreen = getOpenedScreen(this);\r\n\r\n assignIIds(args.initUIResult.formDefinition);\r\n\r\n const {formScreen: screen, foundLookupIds} = yield*interpretScreenXml(\r\n args.initUIResult.formDefinition,\r\n this,\r\n args.initUIResult.panelConfigurations,\r\n args.initUIResult.lookupMenuMappings,\r\n args.initUIResult.sessionId,\r\n openedScreen.lazyLoading\r\n );\r\n const api = getApi(openedScreen);\r\n const cacheDependencies = getWorkbench(openedScreen).lookupMultiEngine.cacheDependencies;\r\n const lookupIdsToQuery = cacheDependencies.getUnhandledLookupIds(foundLookupIds);\r\n\r\n if (lookupIdsToQuery.size > 0) {\r\n const dependencies = yield api.getLookupCacheDependencies({\r\n LookupIds: Array.from(lookupIdsToQuery),\r\n });\r\n cacheDependencies.putValues(dependencies);\r\n }\r\n\r\n openedScreen.content.setFormScreen(screen);\r\n // screen.printMasterDetailTree();\r\n yield*this.applyData(args.initUIResult.data);\r\n\r\n setTimeout(() => {\r\n const fieldToSelect = getFormScreen(this).getFirstFormPropertyId();\r\n if (fieldToSelect) {\r\n const formScreen = getFormScreen(this);\r\n const $formScreen = scopeFor(formScreen);\r\n $formScreen?.resolve(IScreenEvents).focusField.trigger({propertyId: fieldToSelect});\r\n }\r\n }, 100);\r\n }\r\n\r\n async loadChildRows(dataView: IDataView, filter: string, ordering: IOrdering | undefined) {\r\n try {\r\n this.monitor.inFlow++;\r\n const masterRowId =\r\n !this.eagerLoading && !dataView.isRootGrid && dataView.bindingParent\r\n ? dataView.bindingParent.selectedRowId\r\n : undefined;\r\n const api = getApi(this);\r\n return await api.getRows({\r\n MenuId: getMenuItemId(dataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(dataView),\r\n Filter: filter,\r\n FilterLookups: getUserFilterLookups(dataView),\r\n Ordering: ordering ? [ordering] : [],\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n Parameters: this.parameters,\r\n MasterRowId: masterRowId,\r\n RowOffset: 0,\r\n ColumnNames: getColumnNamesToLoad(dataView),\r\n });\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n async loadChildGroups(\r\n rootDataView: IDataView,\r\n filter: string,\r\n groupingSettings: IGroupingSettings,\r\n aggregations: IAggregationInfo[] | undefined,\r\n lookupId: string | undefined\r\n ) {\r\n const ordering = {\r\n columnId: groupingSettings.columnId,\r\n direction: IOrderByDirection.ASC,\r\n lookupId: lookupId,\r\n };\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n return await api.getGroups({\r\n MenuId: getMenuItemId(rootDataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(rootDataView),\r\n Filter: filter,\r\n FilterLookups: getUserFilterLookups(rootDataView),\r\n Ordering: [ordering],\r\n RowLimit: 999999,\r\n GroupBy: groupingSettings.columnId,\r\n GroupingUnit: groupingUnitToString(groupingSettings.groupingUnit),\r\n GroupByLookupId: lookupId,\r\n MasterRowId: undefined,\r\n AggregatedColumns: aggregations,\r\n });\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n async loadGroups(\r\n dataView: IDataView,\r\n columnSettings: IGroupingSettings,\r\n groupByLookupId: string | undefined,\r\n aggregations: IAggregationInfo[] | undefined\r\n ) {\r\n const orderingConfig = getOrderingConfiguration(dataView);\r\n const orderingDirection =\r\n orderingConfig.orderings.find((ordering) => ordering.columnId === columnSettings.columnId)\r\n ?.direction ?? IOrderByDirection.ASC;\r\n\r\n const api = getApi(this);\r\n const ordering = {\r\n columnId: columnSettings.columnId,\r\n direction: orderingDirection,\r\n lookupId: groupByLookupId,\r\n };\r\n\r\n const masterRowId =\r\n !this.eagerLoading && !dataView.isRootGrid && dataView.bindingParent\r\n ? dataView.bindingParent.selectedRowId\r\n : undefined;\r\n\r\n try {\r\n this.monitor.inFlow++;\r\n return await api.getGroups({\r\n MenuId: getMenuItemId(dataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(dataView),\r\n Filter: getUserFilters({ctx: dataView}),\r\n FilterLookups: getUserFilterLookups(dataView),\r\n Ordering: [ordering],\r\n RowLimit: 999999,\r\n GroupBy: columnSettings.columnId,\r\n GroupingUnit: groupingUnitToString(columnSettings.groupingUnit),\r\n GroupByLookupId: groupByLookupId,\r\n MasterRowId: masterRowId,\r\n AggregatedColumns: aggregations,\r\n });\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n loadAggregations(rootDataView: IDataView, aggregations: IAggregationInfo[]) {\r\n const api = getApi(this);\r\n return api.getAggregations({\r\n MenuId: getMenuItemId(rootDataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(rootDataView),\r\n Filter: getUserFilters({ctx: rootDataView}),\r\n FilterLookups: getUserFilterLookups(rootDataView),\r\n MasterRowId: undefined,\r\n AggregatedColumns: aggregations,\r\n });\r\n }\r\n\r\n *loadData(args: { keepCurrentData: boolean }) {\r\n const formScreen = getFormScreen(this);\r\n try {\r\n this.monitor.inFlow++;\r\n for (let dataView of formScreen.nonRootDataViews) {\r\n dataView.dataTable.clear();\r\n dataView.lifecycle.stopSelectedRowReaction();\r\n }\r\n for (let rootDataView of formScreen.rootDataViews) {\r\n rootDataView.saveViewState();\r\n const groupingConfiguration = getGroupingConfiguration(rootDataView);\r\n if (groupingConfiguration.isGrouping) {\r\n rootDataView.serverSideGrouper.refresh();\r\n } else {\r\n yield this.updateTotalRowCount(rootDataView);\r\n yield*this.readFirstChunkOfRows({\r\n rootDataView: rootDataView,\r\n keepCurrentData: args.keepCurrentData,\r\n });\r\n }\r\n }\r\n } finally {\r\n for (let dataView of formScreen.nonRootDataViews) {\r\n dataView.lifecycle.startSelectedRowReaction();\r\n }\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *throwChangesAway(dataView: IDataView): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n const updateObjectResult = yield api.restoreData({\r\n SessionFormIdentifier: getSessionId(this),\r\n ObjectId: dataView.selectedRowId!,\r\n });\r\n yield*processCRUDResult(dataView, updateObjectResult, false, dataView);\r\n const formScreen = getFormScreen(this);\r\n if (formScreen.requestSaveAfterUpdate) {\r\n yield*this.saveSession();\r\n }\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *flushData() {\r\n try {\r\n this.monitor.inFlow++;\r\n let updateObjectDidRun = false;\r\n const formScreen = getFormScreen(this);\r\n const dataViews = formScreen.dataViews;\r\n for (let dataView of dataViews) {\r\n updateObjectDidRun = updateObjectDidRun || (yield*this.runUpdateObject(dataView));\r\n }\r\n if (formScreen.requestSaveAfterUpdate && updateObjectDidRun) {\r\n yield*this.saveSession();\r\n }\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n _processedUpdateObjectResults = new WeakSet();\r\n\r\n private*runUpdateObject(dataView: IDataView): any {\r\n const updateData = dataView.dataTable.getDirtyValueRows().map((row) => {\r\n return {\r\n RowId: dataView.dataTable.getRowId(row),\r\n Values: map2obj(dataView.dataTable.getDirtyValues(row)),\r\n };\r\n });\r\n if (!updateData || updateData.length === 0) {\r\n return false;\r\n }\r\n const updateObjectResult = yield this.updateRequestAggregator.enqueue({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: dataView.entity,\r\n UpdateData: updateData,\r\n });\r\n\r\n dataView.formFocusManager.stopAutoFocus();\r\n\r\n // This might run more times in parallel, but we want to apply the result just once.\r\n // Parallel promises will be resolved all by the same result of merged update request.\r\n if (!this._processedUpdateObjectResults.has(updateObjectResult)) {\r\n this._processedUpdateObjectResults.add(updateObjectResult);\r\n yield*processCRUDResult(dataView, updateObjectResult, false, dataView);\r\n }\r\n dataView.formFocusManager.refocusLast();\r\n\r\n return true;\r\n }\r\n\r\n *updateRadioButtonValue(dataView: IDataView, row: any, fieldName: string, newValue: string): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const changes: any = {};\r\n changes[fieldName] = newValue;\r\n const formScreen = getFormScreen(this);\r\n const self = this;\r\n const updateObjectResult = yield self.updateRequestAggregator.enqueue({\r\n SessionFormIdentifier: getSessionId(self),\r\n Entity: dataView.entity,\r\n UpdateData: [\r\n {\r\n RowId: dataView.dataTable.getRowId(row),\r\n Values: changes,\r\n },\r\n ],\r\n });\r\n\r\n yield*processCRUDResult(dataView, updateObjectResult, false, dataView);\r\n\r\n if (formScreen.requestSaveAfterUpdate) {\r\n yield*this.saveSession();\r\n }\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n rowSelectedReactionsDisabled(dataView: IDataView) {\r\n if (this.initialSelectedRowId && dataView.isBindingRoot && !this.eagerLoading) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n *readFirstChunkOfRows(args: { keepCurrentData: boolean; rootDataView: IDataView }): any {\r\n const rootDataView = args.rootDataView;\r\n const api = getApi(this);\r\n rootDataView.setSelectedRowId(undefined);\r\n rootDataView.lifecycle.stopSelectedRowReaction();\r\n try {\r\n this.monitor.inFlow++;\r\n const loadedData = yield api.getRows({\r\n MenuId: getMenuItemId(rootDataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(rootDataView),\r\n Filter: getUserFilters({ctx: rootDataView}),\r\n FilterLookups: getUserFilterLookups(rootDataView),\r\n Ordering: getUserOrdering(rootDataView),\r\n RowLimit: SCROLL_ROW_CHUNK,\r\n MasterRowId: undefined,\r\n Parameters: this.parameters,\r\n RowOffset: 0,\r\n ColumnNames: getColumnNamesToLoad(rootDataView),\r\n });\r\n if (args.keepCurrentData) {\r\n rootDataView.appendRecords(loadedData);\r\n } else {\r\n yield rootDataView.setRecords(loadedData);\r\n }\r\n if (this.initialSelectedRowId) {\r\n rootDataView.setSelectedRowId(this.initialSelectedRowId);\r\n } else {\r\n rootDataView.reselectOrSelectFirst();\r\n }\r\n rootDataView.restoreViewState();\r\n } finally {\r\n rootDataView.lifecycle.startSelectedRowReaction(true);\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n _readFirstChunkOfRowsRunning = false;\r\n _readFirstChunkOfRowsScheduled = false;\r\n\r\n *readFirstChunkOfRowsWithGate(rootDataView: IDataView) {\r\n try {\r\n if (this._readFirstChunkOfRowsRunning) {\r\n this._readFirstChunkOfRowsScheduled = true;\r\n return;\r\n }\r\n this._readFirstChunkOfRowsRunning = true;\r\n do {\r\n this._readFirstChunkOfRowsScheduled = false;\r\n yield*this.readFirstChunkOfRows({\r\n rootDataView: rootDataView,\r\n keepCurrentData: false,\r\n });\r\n } while (this._readFirstChunkOfRowsScheduled);\r\n } finally {\r\n this._readFirstChunkOfRowsRunning = false;\r\n this._readFirstChunkOfRowsScheduled = false;\r\n }\r\n }\r\n\r\n readFirstChunkOfRowsWithGateDebounced = _.debounce(\r\n flow(this.readFirstChunkOfRowsWithGate.bind(this)),\r\n 500\r\n );\r\n\r\n private getNewRowValues(targetDataView: IDataView) {\r\n if (!targetDataView.orderMember) {\r\n return;\r\n }\r\n const orderMember = targetDataView.orderMember;\r\n const dataSourceField = getDataSourceFieldByName(targetDataView, orderMember);\r\n const orderValues = targetDataView.tableRows\r\n .map((row) => (row as any[])[dataSourceField!.index] as number);\r\n const nextOrderValue = orderValues.length > 0 ? Math.max(...orderValues) + 1 : 1;\r\n const values = {} as any;\r\n values[orderMember] = nextOrderValue;\r\n return values;\r\n }\r\n\r\n *createRow(entity: string, gridId: string): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n const targetDataView = getDataViewByGridId(this, gridId)!;\r\n const formScreen = getFormScreen(this);\r\n let createObjectResult;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n createObjectResult = yield api.createObject({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: entity,\r\n RequestingGridId: gridId,\r\n Values: this.getNewRowValues(targetDataView),\r\n Parameters: {...getBindingParametersFromParent(targetDataView)},\r\n });\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n yield*processCRUDResult(targetDataView, createObjectResult, false, targetDataView);\r\n if (targetDataView.newRecordView === \"0\" && targetDataView.activateFormView) {\r\n yield targetDataView.activateFormView({saveNewState: true});\r\n } else {\r\n if (targetDataView.isTableViewActive()) {\r\n yield*startEditingFirstCell(targetDataView)();\r\n } else if (targetDataView.isFormViewActive()) {\r\n getFormFocusManager(targetDataView).forceAutoFocus();\r\n }\r\n }\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *copyRow(entity: string, gridId: string, rowId: string): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const targetDataView = getDataViewByGridId(this, gridId)!;\r\n const childEntities = getAllBindingChildren(targetDataView)\r\n .filter(dataView => getIsAddButtonVisible(dataView))\r\n .map((dataView) => getEntity(dataView)\r\n );\r\n\r\n const api = getApi(this);\r\n const formScreen = getFormScreen(this);\r\n let createObjectResult;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n createObjectResult = yield api.copyObject({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: entity,\r\n OriginalId: rowId,\r\n RequestingGridId: gridId,\r\n Entities: [entity, ...childEntities],\r\n ForcedValues: this.getNewRowValues(targetDataView),\r\n });\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n for (let dataView of getAllBindingChildren(targetDataView)) {\r\n dataView.clear();\r\n }\r\n yield*processCRUDResult(targetDataView, createObjectResult, false, targetDataView);\r\n getTablePanelView(targetDataView).scrollToCurrentRow();\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n *deleteRow(entity: string, rowId: string, targetDataView: IDataView): any {\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n const formScreen = getFormScreen(this);\r\n let deleteObjectResult;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n\r\n if (targetDataView.orderMember) {\r\n deleteObjectResult = yield*this.deleteObjectInOrderedList(rowId, entity, targetDataView);\r\n } else {\r\n deleteObjectResult = yield api.deleteObject({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: entity,\r\n Id: rowId,\r\n });\r\n }\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n yield*processCRUDResult(this, deleteObjectResult);\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n private*deleteObjectInOrderedList(rowId: string, entity: string, targetDataView: IDataView): any {\r\n const api = getApi(this);\r\n const rowToDelete = targetDataView.dataTable.getRowById(rowId)!;\r\n const orderMember = targetDataView.orderMember;\r\n const newRowOrderMap = {} as any;\r\n if (orderMember) {\r\n const dataSourceField = getDataSourceFieldByName(targetDataView, orderMember)!;\r\n targetDataView.dataTable.allRows\r\n .filter((row) => row[dataSourceField.index] > rowToDelete[dataSourceField.index])\r\n .forEach((row) => {\r\n const rowId = targetDataView.dataTable.getRowId(row);\r\n const newOrder = row[dataSourceField.index] - 1;\r\n newRowOrderMap[rowId] = newOrder;\r\n });\r\n\r\n return yield api.deleteObjectInOrderedList({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: entity,\r\n Id: rowId,\r\n OrderProperty: orderMember,\r\n UpdatedOrderValues: newRowOrderMap,\r\n });\r\n }\r\n }\r\n\r\n *saveSession(): any {\r\n if (getIsSuppressSave(this)) {\r\n return true;\r\n }\r\n try {\r\n this.monitor.inFlow++;\r\n const api = getApi(this);\r\n let result;\r\n const formScreen = getFormScreen(this);\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n const queryResult = yield api.saveSessionQuery(getSessionId(this));\r\n\r\n const processQueryInfoResult = yield*processActionQueryInfo(this)(\r\n queryResult,\r\n formScreen.title\r\n );\r\n if (!processQueryInfoResult.canContinue) {\r\n return false;\r\n }\r\n result = yield api.saveSession(getSessionId(this));\r\n getFormScreen(this).dataViews.forEach((dataView) =>\r\n dataView.dataTable.unlockAddedRowPosition()\r\n );\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n yield*refreshWorkQueues(this)();\r\n yield*processCRUDResult(this, result);\r\n getFormScreen(this).dataViews.forEach((dataView) =>\r\n dataView.dataTable.updateSortAndFilter({retainPreviousSelection: true})\r\n );\r\n yield*this.updateTotalRowCounts();\r\n // getFormScreen(this).dataViews.forEach((dataView) =>\r\n // yield dataView.reloadAggregations()\r\n // );\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n return true;\r\n }\r\n\r\n *refreshLookups() {\r\n const dataViews = getDataViewList(this);\r\n const properties = dataViews.flatMap((dv) => getProperties(dv)).filter((prop) => prop.isLookup);\r\n const cleaned = new Set();\r\n for (let prop of properties) {\r\n if (prop.lookupEngine && !cleaned.has(prop.lookupId)) {\r\n prop.lookupEngine.cleanAndReload();\r\n getWorkbench(this).lookupListCache.deleteLookup(prop.lookupId!);\r\n cleaned.add(prop.lookupId);\r\n }\r\n }\r\n }\r\n\r\n *refreshSession(): any {\r\n // TODO: Refresh lookups and rowStates !!!\r\n try {\r\n this.monitor.inFlow++;\r\n if (this.eagerLoading) {\r\n const formScreen = getFormScreen(this);\r\n formScreen.dataViews.forEach((dv) => dv.saveViewState());\r\n const api = getApi(this);\r\n let result;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n result = yield api.refreshSession(getSessionId(this));\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n yield*this.applyData(result);\r\n getFormScreen(this).setDirty(false);\r\n getFormScreen(this).dataViews.forEach((dv) => dv.restoreViewState());\r\n } else {\r\n yield*this.loadData({keepCurrentData: false});\r\n }\r\n getFormScreen(this).setDirty(false);\r\n yield*this.refreshLookups();\r\n getFormScreen(this).clearDataCache();\r\n } finally {\r\n this.monitor.inFlow--;\r\n setTimeout(async () => {\r\n await when(() => this.allDataViewsSteady);\r\n }, 10);\r\n }\r\n yield*refreshRowStates(this)();\r\n yield*refreshWorkQueues(this)();\r\n }\r\n\r\n loadInitialData() {\r\n if (!this.eagerLoading) {\r\n const self = this;\r\n flow(function*() {\r\n yield*self.clearTotalCounts();\r\n yield*self.loadData({keepCurrentData: false});\r\n yield*self.updateTotalRowCounts();\r\n })();\r\n }\r\n }\r\n\r\n *clearTotalCounts() {\r\n const formScreen = getFormScreen(this);\r\n for (const dataView of formScreen.rootDataViews) {\r\n if (isInfiniteScrollingActive(dataView) && !getGroupingConfiguration(dataView).isGrouping) {\r\n dataView.setRowCount(undefined);\r\n }\r\n }\r\n }\r\n\r\n *updateTotalRowCounts() {\r\n const formScreen = getFormScreen(this);\r\n for (const dataView of formScreen.rootDataViews) {\r\n if (isInfiniteScrollingActive(dataView) && !getGroupingConfiguration(dataView).isGrouping) {\r\n yield this.updateTotalRowCount(dataView);\r\n yield this.reloadAggregations(dataView);\r\n }\r\n }\r\n }\r\n\r\n async reloadAggregations(dataView: IDataView) {\r\n const aggregations = getTablePanelView(dataView).aggregations.aggregationList;\r\n if (aggregations.length === 0) {\r\n dataView.aggregationData.length = 0;\r\n return;\r\n }\r\n if (isInfiniteScrollingActive(dataView)) {\r\n const data = await getFormScreenLifecycle(dataView).loadAggregations(dataView, aggregations);\r\n dataView.aggregationData = parseAggregations(data) || [];\r\n } else {\r\n dataView.aggregationData = calcAggregations(dataView, aggregations);\r\n }\r\n }\r\n\r\n async updateTotalRowCount(dataView: IDataView) {\r\n const api = getApi(this);\r\n const aggregationResult = await api.getAggregations({\r\n MenuId: getMenuItemId(dataView),\r\n SessionFormIdentifier: getSessionId(this),\r\n DataStructureEntityId: getDataStructureEntityId(dataView),\r\n Filter: getUserFilters({ctx: dataView}),\r\n FilterLookups: getUserFilterLookups(dataView),\r\n MasterRowId: undefined,\r\n AggregatedColumns: [\r\n {\r\n ColumnName: \"Id\",\r\n AggregationType: AggregationType.COUNT,\r\n },\r\n ],\r\n });\r\n\r\n const aggregationData = parseAggregations(aggregationResult);\r\n if (aggregationData && aggregationData.length > 0) {\r\n dataView.setRowCount(aggregationData[0].value);\r\n }\r\n }\r\n\r\n private actionRunning = false;\r\n\r\n *executeAction(gridId: string, entity: string, action: IAction, selectedItems: string[]): any {\r\n if (this.actionRunning) {\r\n return;\r\n }\r\n this.actionRunning = true;\r\n try {\r\n this.monitor.inFlow++;\r\n const parameters: { [key: string]: any } = {};\r\n for (let parameter of action.parameters) {\r\n parameters[parameter.name] = parameter.fieldName;\r\n }\r\n const api = getApi(this);\r\n const formScreen = getFormScreen(this);\r\n let result;\r\n try {\r\n yield*formScreen.dataUpdateCRS.enterGenerator();\r\n const queryResult = (yield api.executeActionQuery({\r\n SessionFormIdentifier: getSessionId(this),\r\n Entity: entity,\r\n ActionType: action.type,\r\n ActionId: action.id,\r\n ParameterMappings: parameters,\r\n SelectedItems: selectedItems,\r\n InputParameters: {},\r\n })) as IQueryInfo[];\r\n const processQueryInfoResult = yield*processActionQueryInfo(this)(\r\n queryResult,\r\n formScreen.title\r\n );\r\n if (!processQueryInfoResult.canContinue) return;\r\n\r\n const self = this;\r\n result = yield api.executeAction({\r\n SessionFormIdentifier: getSessionId(self),\r\n Entity: entity,\r\n ActionType: action.type,\r\n ActionId: action.id,\r\n ParameterMappings: parameters,\r\n SelectedItems: selectedItems,\r\n InputParameters: {},\r\n RequestingGrid: gridId,\r\n });\r\n } finally {\r\n formScreen.dataUpdateCRS.leave();\r\n }\r\n\r\n yield * new_ProcessActionResult(action)(result);\r\n const dataView = getDataView(action);\r\n dataView?.formFocusManager?.refocusLast();\r\n } finally {\r\n this.monitor.inFlow--;\r\n this.actionRunning = false;\r\n }\r\n }\r\n\r\n @action.bound\r\n killForm() {\r\n this.clearAutoRefreshInterval();\r\n this.disposers.forEach((disposer) => disposer());\r\n getDataViewList(this).forEach((dv) => dv.stop());\r\n const openedScreen = getOpenedScreen(this);\r\n openedScreen.content.setFormScreen(undefined);\r\n }\r\n\r\n *closeForm() {\r\n try {\r\n this.monitor.inFlow++;\r\n yield*closeForm(this)();\r\n this.killForm();\r\n } finally {\r\n this.monitor.inFlow--;\r\n }\r\n }\r\n\r\n questionSaveData() {\r\n return new Promise(\r\n action((resolve: (value: IQuestionSaveDataAnswer) => void) => {\r\n const closeDialog = getDialogStack(this).pushDialog(\r\n \"\",\r\n {\r\n closeDialog();\r\n resolve(IQuestionSaveDataAnswer.Save);\r\n }}\r\n onDontSaveClick={() => {\r\n closeDialog();\r\n resolve(IQuestionSaveDataAnswer.NoSave);\r\n }}\r\n onCancelClick={() => {\r\n closeDialog();\r\n resolve(IQuestionSaveDataAnswer.Cancel);\r\n }}\r\n />\r\n );\r\n })\r\n );\r\n }\r\n\r\n questionDeleteData() {\r\n return new Promise(\r\n action((resolve: (value: IQuestionDeleteDataAnswer) => void) => {\r\n const closeDialog = getDialogStack(this).pushDialog(\r\n \"\",\r\n {\r\n closeDialog();\r\n resolve(IQuestionDeleteDataAnswer.No);\r\n }}\r\n onYesClick={() => {\r\n closeDialog();\r\n resolve(IQuestionDeleteDataAnswer.Yes);\r\n }}\r\n />\r\n );\r\n })\r\n );\r\n }\r\n\r\n *applyData(data: any): Generator {\r\n for (let [entityKey, entityValue] of Object.entries(data || {})) {\r\n const dataViews = getDataViewsByEntity(this, entityKey);\r\n // debugger;\r\n for (let dataView of dataViews) {\r\n yield dataView.setRecords((entityValue as any).data);\r\n dataView.setRowCount(dataView.dataTable.rows.length);\r\n yield dataView.start();\r\n\r\n const reloadAggregationsDebounced = _.debounce(() => {\r\n const self = this;\r\n runInFlowWithHandler({\r\n ctx: dataView,\r\n action: () => self.reloadAggregations(dataView),\r\n });\r\n }, 10);\r\n\r\n this.registerDisposer(\r\n reaction(\r\n () => {\r\n const tablePanelView = getTablePanelView(dataView);\r\n if (!tablePanelView) return [];\r\n return [\r\n [...tablePanelView.aggregations.aggregationList],\r\n getFilterConfiguration(dataView).activeFilters.map((x) => [\r\n x.propertyId,\r\n x.setting.type,\r\n x.setting.val1,\r\n x.setting.val2,\r\n ]),\r\n isInfiniteScrollingActive(dataView) ? true : dataView.dataTable.rows.length === 0,\r\n ];\r\n },\r\n () => reloadAggregationsDebounced(),\r\n {fireImmediately: true}\r\n )\r\n );\r\n }\r\n }\r\n }\r\n\r\n get eagerLoading() {\r\n return !isLazyLoading(this);\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\nThis file is part of ORIGAM (http://www.origam.org).\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\nimport {getRowStates} from \"model/selectors/RowState/getRowStates\";\r\nimport {getDataSources} from \"model/selectors/DataSources/getDataSources\";\r\n\r\nexport function refreshRowStates(ctx: any) {\r\n return function* refreshRowStates() {\r\n for (let dataSource of getDataSources(ctx)) {\r\n getRowStates(dataSource).reload();\r\n }\r\n };\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"./getFormScreen\";\r\n\r\nexport function getAutorefreshPeriod(ctx: any) {\r\n return getFormScreen(ctx).autoRefreshInterval;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataView } from \"./getDataView\";\r\n\r\nexport function getBindingParametersFromParent(ctx: any) {\r\n // debugger\r\n return getDataView(ctx).bindingParametersFromParent;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { FormScreenLifecycle02 } from \"../entities/FormScreenLifecycle/FormScreenLifecycle\";\r\nimport { FormScreenEnvelope } from \"model/entities/FormScreen\";\r\nimport { IRefreshOnReturnType } from \"model/entities/WorkbenchLifecycle/WorkbenchLifecycle\";\r\n\r\nexport function createFormScreenEnvelope(\r\n preloadedSessionId?: string,\r\n refreshOnReturnType?: IRefreshOnReturnType\r\n) {\r\n return new FormScreenEnvelope({\r\n formScreenLifecycle: new FormScreenLifecycle02(),\r\n preloadedSessionId,\r\n refreshOnReturnType\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IDialogInfo } from \"../entities/types/IOpenedScreen\";\r\nimport { OpenedScreen } from \"../entities/OpenedScreen\";\r\nimport { IFormScreenEnvelope } from \"../entities/types/IFormScreen\";\r\nimport { IMainMenuItemType } from \"../entities/types/IMainMenu\";\r\n\r\nexport function*createOpenedScreen(\r\n ctx: any,\r\n menuItemId: string,\r\n menuItemType: IMainMenuItemType,\r\n order: number,\r\n title: string,\r\n content: IFormScreenEnvelope,\r\n lazyLoading: boolean,\r\n dialogInfo: IDialogInfo | undefined,\r\n parameters: { [key: string]: any },\r\n isSleeping?: boolean,\r\n isSleepingDirty?: boolean\r\n): Generator {\r\n return new OpenedScreen({\r\n menuItemId,\r\n menuItemType,\r\n order,\r\n tabTitle: title,\r\n content,\r\n dialogInfo,\r\n lazyLoading,\r\n parameters,\r\n isSleeping,\r\n isSleepingDirty\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IOpenedScreens } from '../entities/types/IOpenedScreens';\r\nimport { getWorkbench } from './getWorkbench';\r\n\r\nexport function getOpenedScreens(ctx: any): IOpenedScreens {\r\n return getWorkbench(ctx).openedScreens;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { findStopping } from \"./xmlUtils\";\r\n\r\nexport const findMenu = (node: any) =>\r\n findStopping(node, n => n.name === \"Menu\")[0];\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IMainMenu, IMainMenuContent, IMainMenuData, IMainMenuEnvelope } from \"./types/IMainMenu\";\r\nimport { action, observable } from \"mobx\";\r\nimport { proxyEnrich } from \"utils/esproxy\";\r\n\r\nexport class MainMenuContent implements IMainMenuContent {\r\n $type_IMainMenuContent: 1 = 1;\r\n\r\n constructor(data: IMainMenuData) {\r\n Object.assign(this, data);\r\n }\r\n\r\n getItemById(id: string) {\r\n function recursive(node: any) {\r\n if (node.attributes.id === id) {\r\n return node;\r\n }\r\n for (let ch of node.elements || []) {\r\n const result: any = recursive(ch);\r\n if (result) return result;\r\n }\r\n }\r\n\r\n return recursive(this.menuUI);\r\n }\r\n\r\n menuUI: any;\r\n parent?: any;\r\n}\r\n\r\nexport class MainMenuEnvelope implements IMainMenuEnvelope {\r\n $type_IMainMenuEnvelope: 1 = 1;\r\n\r\n @observable mainMenu?: IMainMenu | undefined;\r\n @observable isLoading: boolean = false;\r\n\r\n @action.bound\r\n setMainMenu(mainMenu: IMainMenuContent | undefined): void {\r\n if (mainMenu) {\r\n mainMenu.parent = this;\r\n this.mainMenu = proxyEnrich(\r\n mainMenu\r\n );\r\n } else {\r\n this.mainMenu = undefined;\r\n }\r\n }\r\n\r\n @action.bound setLoading(state: boolean) {\r\n this.isLoading = state;\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport bind from \"bind-decorator\";\r\nimport { reloadScreen } from \"model/actions/FormScreen/reloadScreen\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { createFormScreenEnvelope } from \"model/factories/createFormScreenEnvelope\";\r\nimport { createOpenedScreen } from \"model/factories/createOpenedScreen\";\r\nimport { getIsFormScreenDirty } from \"model/selectors/FormScreen/getisFormScreenDirty\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getSearcher } from \"model/selectors/getSearcher\";\r\nimport { getOpenedScreens } from \"model/selectors/getOpenedScreens\";\r\nimport { getMainMenuEnvelope } from \"model/selectors/MainMenu/getMainMenuEnvelope\";\r\nimport { getMainMenuItemById } from \"model/selectors/MainMenu/getMainMenuItemById\";\r\nimport { getWorkQueues } from \"model/selectors/WorkQueues/getWorkQueues\";\r\nimport { findMenu } from \"xmlInterpreters/menuXml\";\r\nimport { MainMenuContent } from \"../MainMenu\";\r\nimport { DialogInfo } from \"../OpenedScreen\";\r\nimport { IMainMenuItemType } from \"../types/IMainMenu\";\r\nimport { IDialogInfo, IOpenedScreen } from \"../types/IOpenedScreen\";\r\nimport { IWorkbenchLifecycle } from \"../types/IWorkbenchLifecycle\";\r\nimport { WebScreen } from \"../WebScreen\";\r\nimport { getSessionId } from \"model/selectors/getSessionId\";\r\nimport { scopeFor } from \"dic/Container\";\r\nimport { assignIIds } from \"xmlInterpreters/xmlUtils\";\r\nimport { DEBUG_CLOSE_ALL_FORMS } from \"utils/debugHelpers\";\r\nimport { getOpenedScreen } from \"../../selectors/getOpenedScreen\";\r\nimport { onWorkflowNextClick } from \"model/actions-ui/ScreenHeader/onWorkflowNextClick\";\r\nimport { observable } from \"mobx\";\r\nimport { IUserInfo } from \"model/entities/types/IUserInfo\";\r\nimport { getChatrooms } from \"model/selectors/Chatrooms/getChatrooms\";\r\nimport { openNewUrl } from \"model/actions/Workbench/openNewUrl\";\r\nimport { IUrlUpenMethod } from \"../types/IUrlOpenMethod\";\r\nimport { IPortalSettings } from \"../types/IPortalSettings\";\r\nimport { getNotifications } from \"model/selectors/Chatrooms/getNotifications\";\r\nimport selectors from \"model/selectors-tree\";\r\nimport { onMainMenuItemClick } from \"model/actions-ui/MainMenu/onMainMenuItemClick\";\r\nimport { getFavorites } from \"model/selectors/MainMenu/getFavorites\";\r\nimport produce from \"immer\";\r\nimport { IDataView } from \"../types/IDataView\";\r\nimport { FormScreenEnvelope } from \"model/entities/FormScreen\";\r\n\r\nexport enum IRefreshOnReturnType {\r\n None = \"None\",\r\n ReloadActualRecord = \"ReloadActualRecord\",\r\n RefreshCompleteForm = \"RefreshCompleteForm\",\r\n MergeModalDialogChanges = \"MergeModalDialogChanges\",\r\n}\r\n\r\nexport class WorkbenchLifecycle implements IWorkbenchLifecycle {\r\n $type_IWorkbenchLifecycle: 1 = 1;\r\n\r\n @observable\r\n portalSettings: IPortalSettings | undefined;\r\n @observable\r\n userInfo: IUserInfo | undefined;\r\n @observable\r\n logoUrl: string | undefined;\r\n @observable\r\n customAssetsRoute: string | undefined;\r\n\r\n *onMainMenuItemClick(args: {\r\n event: any;\r\n item: any;\r\n idParameter: string | undefined;\r\n isSingleRecordEdit?: boolean;\r\n forceOpenNew?: boolean;\r\n }): Generator {\r\n const {\r\n type,\r\n id,\r\n label,\r\n dialogWidth,\r\n dialogHeight,\r\n lazyLoading,\r\n urlOpenMethod,\r\n } = args.item.attributes;\r\n const {event} = args;\r\n const alwaysOpenNew = args.item.attributes.alwaysOpenNew === \"true\" || args.forceOpenNew;\r\n\r\n if (urlOpenMethod === \"LaunchBrowserWindow\") {\r\n const url = (yield this.getReportTabUrl(id)) as string;\r\n window.open(url);\r\n return;\r\n }\r\n\r\n const openedScreens = getOpenedScreens(this);\r\n\r\n let dialogInfo: IDialogInfo | undefined;\r\n if (type === IMainMenuItemType.FormRefWithSelection || type === IMainMenuItemType.ReportRefWithSelection) {\r\n dialogInfo = new DialogInfo(parseInt(dialogWidth, 10), parseInt(dialogHeight, 10));\r\n }\r\n if (event && !(event.ctrlKey || event.metaKey)) {\r\n const existingItem = openedScreens.findLastExistingTabItem(id);\r\n if (\r\n existingItem &&\r\n type !== IMainMenuItemType.FormRefWithSelection &&\r\n type !== IMainMenuItemType.ReportReferenceMenuItem &&\r\n type !== IMainMenuItemType.ReportRefWithSelection &&\r\n !alwaysOpenNew\r\n ) {\r\n openedScreens.activateItem(id, existingItem.order);\r\n const openedScreen = existingItem;\r\n if (openedScreen.isSleeping) {\r\n openedScreen.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(\r\n openedScreen,\r\n false,\r\n undefined,\r\n args.isSingleRecordEdit\r\n );\r\n yield*openedScreen.content!.start(initUIResult, openedScreen.isSleepingDirty);\r\n } else if (\r\n openedScreen.content &&\r\n openedScreen.content.formScreen &&\r\n openedScreen.content.formScreen.refreshOnFocus &&\r\n !openedScreen.content.isLoading\r\n ) {\r\n if (!getIsFormScreenDirty(openedScreen.content.formScreen)) {\r\n yield*reloadScreen(openedScreen.content.formScreen)();\r\n }\r\n }\r\n } else {\r\n if (type === IMainMenuItemType.ReportReferenceMenuItem) {\r\n const url = (yield this.getReportTabUrl(id)) as string;\r\n yield*this.openNewUrl(url, args.item.attributes[\"label\"]);\r\n return;\r\n } else {\r\n yield*this.openNewForm(\r\n id,\r\n type,\r\n label,\r\n lazyLoading === \"true\",\r\n dialogInfo,\r\n args.idParameter ? {id: args.idParameter} : {},\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n args.isSingleRecordEdit\r\n );\r\n }\r\n }\r\n } else {\r\n yield*this.openNewForm(\r\n id,\r\n type,\r\n label,\r\n lazyLoading === \"true\",\r\n dialogInfo,\r\n args.idParameter ? {id: args.idParameter} : {},\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n args.isSingleRecordEdit\r\n );\r\n }\r\n }\r\n\r\n *onMainMenuItemIdClick(args: {\r\n event: any;\r\n itemId: any;\r\n idParameter: string | undefined;\r\n isSingleRecordEdit?: boolean;\r\n }) {\r\n let menuItem = args.itemId && selectors.mainMenu.getItemById(this, args.itemId);\r\n if (args.isSingleRecordEdit) {\r\n // Temporary hack o allow filtered screens to work unless single record edit is\r\n // implemented for paginated screens on server side. There is no need to paginate\r\n // when we have just one record, hence it is ok to execute the screen in without\r\n // pagination\r\n menuItem = {...menuItem};\r\n delete menuItem.parent;\r\n delete menuItem.elements;\r\n menuItem = produce(menuItem, (draft: any) => {\r\n draft.attributes.isLazyLoading = \"false\";\r\n });\r\n }\r\n if (menuItem) {\r\n yield onMainMenuItemClick(this)({\r\n event: undefined,\r\n item: menuItem,\r\n idParameter: args.idParameter,\r\n isSingleRecordEdit: args.isSingleRecordEdit,\r\n });\r\n }\r\n }\r\n\r\n async getReportTabUrl(menuId: string) {\r\n const api = getApi(this);\r\n const url = await api.getReportFromMenu({menuId: menuId});\r\n return url;\r\n }\r\n\r\n *onWorkQueueListItemClick(event: any, item: any) {\r\n const openedScreens = getOpenedScreens(this);\r\n\r\n const id = item.id;\r\n const type = IMainMenuItemType.WorkQueue;\r\n const label = item.name;\r\n\r\n let dialogInfo: IDialogInfo | undefined;\r\n if (!event || !(event.ctrlKey || event.metaKey)) {\r\n const existingItem = openedScreens.findLastExistingTabItem(id);\r\n if (existingItem) {\r\n openedScreens.activateItem(id, existingItem.order);\r\n const openedScreen = existingItem;\r\n if (openedScreen.isSleeping) {\r\n openedScreen.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(openedScreen, false, undefined);\r\n yield*openedScreen.content!.start(initUIResult, openedScreen.isSleepingDirty);\r\n } else if (\r\n openedScreen.content &&\r\n openedScreen.content.formScreen &&\r\n openedScreen.content.formScreen.refreshOnFocus &&\r\n !openedScreen.content.isLoading\r\n ) {\r\n if (!getIsFormScreenDirty(openedScreen.content.formScreen)) {\r\n yield*reloadScreen(openedScreen.content.formScreen)();\r\n }\r\n }\r\n } else {\r\n yield*this.openNewForm(id, type, label, false, dialogInfo, {});\r\n }\r\n } else {\r\n yield*this.openNewForm(id, type, label, false, dialogInfo, {});\r\n }\r\n }\r\n\r\n *onChatroomsListItemClick(event: any, item: any) {\r\n\r\n const openedScreens = getOpenedScreens(this);\r\n const url = `/chatrooms/index.html#/chatroom?chatroomId=${item.id}`;\r\n const id = url;\r\n\r\n const existingItem = openedScreens.findLastExistingTabItem(id);\r\n if (existingItem) {\r\n openedScreens.activateItem(id, existingItem.order);\r\n const openedScreen = existingItem;\r\n if (openedScreen.isSleeping) {\r\n openedScreen.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(openedScreen, false);\r\n yield*openedScreen.content!.start(initUIResult, openedScreen.isSleepingDirty);\r\n } else if (\r\n openedScreen.content &&\r\n openedScreen.content.formScreen &&\r\n openedScreen.content.formScreen.refreshOnFocus &&\r\n !openedScreen.content.isLoading\r\n ) {\r\n if (!getIsFormScreenDirty(openedScreen.content.formScreen)) {\r\n yield*reloadScreen(openedScreen.content.formScreen)();\r\n }\r\n }\r\n } else {\r\n yield*openNewUrl(this)(url, IUrlUpenMethod.OrigamTab, item.topic);\r\n }\r\n }\r\n\r\n *onScreenTabHandleClick(event: any, openedScreen: IOpenedScreen): Generator {\r\n const openedScreens = getOpenedScreens(this);\r\n openedScreens.activateItem(openedScreen.menuItemId, openedScreen.order);\r\n\r\n if (openedScreen.isSleeping) {\r\n openedScreen.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(openedScreen, false);\r\n yield*openedScreen.content!.start(initUIResult, openedScreen.isSleepingDirty);\r\n } else if (\r\n openedScreen.content &&\r\n openedScreen.content.formScreen &&\r\n openedScreen.content.formScreen.refreshOnFocus &&\r\n !openedScreen.content.isLoading\r\n ) {\r\n if (!getIsFormScreenDirty(openedScreen.content.formScreen)) {\r\n yield*reloadScreen(openedScreen.content.formScreen)();\r\n }\r\n }\r\n }\r\n\r\n *closeForm(openedScreen: IOpenedScreen): Generator {\r\n // TODO: Refactor to get rid of code duplication\r\n const openedScreens = getOpenedScreens(openedScreen);\r\n\r\n const parentScreen = openedScreen.parentContext\r\n ? getOpenedScreen(openedScreen.parentContext)\r\n : undefined;\r\n\r\n const screenToActivate = parentScreen && !parentScreen.isClosed\r\n ? parentScreen\r\n : openedScreens.findTopmostItemExcept(openedScreen.menuItemId, openedScreen.order);\r\n\r\n openedScreens.deleteItem(openedScreen.menuItemId, openedScreen.order);\r\n if (openedScreen.dialogInfo) {\r\n if (openedScreen.isActive) {\r\n if (screenToActivate) {\r\n openedScreens.activateItem(screenToActivate.menuItemId, screenToActivate.order);\r\n if (screenToActivate.isSleeping) {\r\n screenToActivate.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(screenToActivate, false);\r\n yield*screenToActivate.content!.start(initUIResult, screenToActivate.isSleepingDirty);\r\n }\r\n }\r\n }\r\n } else {\r\n if (openedScreen.isActive) {\r\n if (screenToActivate) {\r\n openedScreens.activateItem(screenToActivate.menuItemId, screenToActivate.order);\r\n\r\n if (screenToActivate.isSleeping) {\r\n screenToActivate.isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(screenToActivate, false);\r\n yield*screenToActivate.content!.start(initUIResult, screenToActivate.isSleepingDirty);\r\n } else if (\r\n screenToActivate.content &&\r\n screenToActivate.content.formScreen &&\r\n screenToActivate.content.formScreen.refreshOnFocus &&\r\n !screenToActivate.content.isLoading\r\n ) {\r\n if (!getIsFormScreenDirty(screenToActivate.content.formScreen)) {\r\n yield*reloadScreen(screenToActivate.content.formScreen)();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n yield*this.destroyUI(openedScreen);\r\n\r\n if (openedScreen.content && openedScreen.content.formScreen) {\r\n const scope = scopeFor(openedScreen.content.formScreen);\r\n if (scope) scope.disposeWithChildren();\r\n }\r\n openedScreen.isClosed = true;\r\n }\r\n\r\n *destroyUI(openedScreen: IOpenedScreen) {\r\n const api = getApi(this);\r\n if (openedScreen.content) {\r\n if (openedScreen.content.formScreen) {\r\n yield api.destroyUI({FormSessionId: getSessionId(openedScreen.content.formScreen)});\r\n } else if (openedScreen.content.preloadedSessionId) {\r\n yield api.destroyUI({FormSessionId: openedScreen.content.preloadedSessionId});\r\n }\r\n }\r\n }\r\n\r\n @bind\r\n *openNewForm(\r\n id: string,\r\n type: IMainMenuItemType,\r\n label: string,\r\n isLazyLoading: boolean,\r\n dialogInfo: IDialogInfo | undefined,\r\n parameters: { [key: string]: any },\r\n parentContext?: any,\r\n requestParameters?: object | undefined,\r\n formSessionId?: string,\r\n isSessionRebirth?: boolean,\r\n isSleepingDirty?: boolean,\r\n refreshOnReturnType?: IRefreshOnReturnType,\r\n isSingleRecordEdit?: boolean\r\n ) {\r\n const openedScreens = getOpenedScreens(this);\r\n const existingItem = openedScreens.findLastExistingTabItem(id);\r\n const newFormScreen = createFormScreenEnvelope(formSessionId, refreshOnReturnType);\r\n const newScreen = yield*createOpenedScreen(\r\n this,\r\n id,\r\n type,\r\n existingItem ? existingItem.order + 1 : 0,\r\n label,\r\n newFormScreen,\r\n isLazyLoading,\r\n dialogInfo,\r\n parameters,\r\n isSessionRebirth,\r\n isSleepingDirty\r\n );\r\n try {\r\n openedScreens.pushItem(newScreen);\r\n if (!isSessionRebirth) {\r\n newScreen.parentContext = parentContext;\r\n openedScreens.activateItem(newScreen.menuItemId, newScreen.order);\r\n }\r\n\r\n if (isSessionRebirth) {\r\n return;\r\n }\r\n\r\n const initUIResult = yield*this.initUIForScreen(\r\n newScreen,\r\n !isSessionRebirth,\r\n requestParameters,\r\n isSingleRecordEdit\r\n );\r\n yield*newFormScreen.start(initUIResult);\r\n const rowIdToSelect = parameters[\"id\"];\r\n yield*this.selectAndOpenRowById(rowIdToSelect, newFormScreen);\r\n const formScreen = newScreen.content.formScreen;\r\n if (formScreen?.autoWorkflowNext) {\r\n yield onWorkflowNextClick(formScreen!)(undefined);\r\n }\r\n } catch (e) {\r\n yield*handleError(this)(e);\r\n yield*this.closeForm(newScreen);\r\n throw e;\r\n }\r\n }\r\n\r\n private*selectAndOpenRowById(rowIdToSelect: string, newFormScreen: FormScreenEnvelope) {\r\n if (rowIdToSelect && newFormScreen.formScreen) {\r\n for (const dataView of newFormScreen.formScreen.dataViews) {\r\n const hasTheRow = (dataView as IDataView).dataTable.rows\r\n .find(row => dataView.dataTable.getRowId(row) === rowIdToSelect) !== undefined;\r\n if (hasTheRow && dataView.activateFormView && !dataView.isHeadless) {\r\n dataView.setSelectedRowId(rowIdToSelect);\r\n yield dataView.activateFormView({saveNewState: false});\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n *initUIForScreen(\r\n screen: IOpenedScreen,\r\n isNewSession: boolean,\r\n requestParameters?: object | undefined,\r\n isSingleRecordEdit?: boolean\r\n ): any {\r\n const api = getApi(this);\r\n if (requestParameters) {\r\n return yield api.initUI(requestParameters as any);\r\n }\r\n return yield api.initUI({\r\n Type: screen.menuItemType,\r\n Caption: screen.tabTitle,\r\n ObjectId: screen.menuItemId,\r\n FormSessionId: screen.content!.preloadedSessionId,\r\n IsNewSession: isNewSession,\r\n RegisterSession: true,\r\n DataRequested: !screen.lazyLoading,\r\n Parameters: screen.parameters,\r\n IsSingleRecordEdit: isSingleRecordEdit,\r\n RequestCurrentRecordId: true\r\n });\r\n }\r\n\r\n *openNewUrl(url: string, title: string) {\r\n const openedScreens = getOpenedScreens(this);\r\n const newScreen = new WebScreen(title, url, url, 0);\r\n openedScreens.pushItem(newScreen);\r\n openedScreens.activateItem(newScreen.menuItemId, newScreen.order);\r\n }\r\n\r\n *initPortal(): any {\r\n const api = getApi(this);\r\n const portalInfo = yield api.initPortal();\r\n\r\n if (portalInfo.title) {\r\n document.title = portalInfo.title;\r\n }\r\n this.userInfo = {\r\n userName: portalInfo.userName,\r\n avatarLink: portalInfo.avatarLink,\r\n };\r\n this.logoUrl = portalInfo.logoUrl;\r\n this.customAssetsRoute = portalInfo.customAssetsRoute;\r\n this.portalSettings = {\r\n showChat: portalInfo.chatRefreshInterval > 0,\r\n showWorkQueues: portalInfo.workQueueListRefreshInterval > 0,\r\n helpUrl: portalInfo.helpUrl,\r\n showToolTipsForMemoFieldsOnly: portalInfo.showToolTipsForMemoFieldsOnly,\r\n filterConfig: {\r\n caseSensitive: portalInfo.filteringConfig.caseSensitive,\r\n accentSensitive: portalInfo.filteringConfig.accentSensitive\r\n }\r\n };\r\n const menuUI = findMenu(portalInfo.menu);\r\n assignIIds(menuUI);\r\n getFavorites(this).setXml(portalInfo.favorites);\r\n getMainMenuEnvelope(this).setMainMenu(new MainMenuContent({menuUI}));\r\n getSearcher(this).indexMainMenu(menuUI);\r\n\r\n if (!DEBUG_CLOSE_ALL_FORMS()) {\r\n for (let session of portalInfo.sessions) {\r\n const menuItem = getMainMenuItemById(this, session.objectId);\r\n const lazyLoading = menuItem\r\n ? menuItem?.attributes?.lazyLoading === \"true\"\r\n : false;\r\n yield*this.openNewForm(\r\n session.objectId,\r\n session.type,\r\n session.caption, // TODO: Find in menu\r\n lazyLoading,\r\n undefined, // TODO: Find in... menu?\r\n {},\r\n undefined,\r\n undefined,\r\n session.formSessionId,\r\n true,\r\n session.isDirty\r\n );\r\n }\r\n } else {\r\n for (let session of portalInfo.sessions) {\r\n yield api.destroyUI({FormSessionId: session.formSessionId});\r\n }\r\n }\r\n\r\n const openedScreens = getOpenedScreens(this);\r\n if (openedScreens.items.length > 0) {\r\n openedScreens.activateItem(openedScreens.items[0].menuItemId, openedScreens.items[0].order);\r\n openedScreens.items[0].isSleeping = false;\r\n const initUIResult = yield*this.initUIForScreen(openedScreens.items[0], false);\r\n if (openedScreens.items[0].content) {\r\n yield*openedScreens.items[0].content.start(\r\n initUIResult,\r\n openedScreens.items[0].isSleepingDirty\r\n );\r\n }\r\n }\r\n\r\n if (this.portalSettings?.showWorkQueues) {\r\n yield*getWorkQueues(this).startTimer(portalInfo.workQueueListRefreshInterval);\r\n }\r\n\r\n if (this.portalSettings?.showChat) {\r\n yield*getChatrooms(this).startTimer(portalInfo.chatRefreshInterval);\r\n }\r\n\r\n if (portalInfo.notificationBoxRefreshInterval > 0) {\r\n yield*getNotifications(this).startTimer(portalInfo.notificationBoxRefreshInterval);\r\n }\r\n }\r\n\r\n *run(): Generator {\r\n yield*this.initPortal();\r\n }\r\n\r\n parent?: any;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport interface IParented {\r\n parent?: TParent;\r\n}\r\n\r\nexport function proxyEnrich>(\r\n target: TTarget\r\n) {\r\n return new Proxy(target, {\r\n get(obj, prop) {\r\n return prop in obj ? (obj as any)[prop] : (obj.parent as any)[prop];\r\n },\r\n set(obj, prop, newVal) {\r\n if (prop in obj) {\r\n (obj as any)[prop] = newVal;\r\n } else {\r\n (obj.parent as any)[prop] = newVal;\r\n }\r\n return true;\r\n }\r\n }) as TTarget & TAdd;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IReloader, IWebScreen } from \"./types/IWebScreen\";\r\nimport { IOpenedScreen } from \"./types/IOpenedScreen\";\r\nimport { action, observable } from \"mobx\";\r\nimport { IFormScreenEnvelope } from \"./types/IFormScreen\";\r\nimport { IMainMenuItemType } from \"./types/IMainMenu\";\r\n\r\nexport class WebScreen implements IWebScreen, IOpenedScreen {\r\n $type_IOpenedScreen: 1 = 1;\r\n $type_IWebScreen: 1 = 1;\r\n parentSessionId: string | undefined;\r\n\r\n isBeingClosed = false;\r\n\r\n constructor(\r\n title: string,\r\n public screenUrl: string,\r\n public menuItemId: string,\r\n public order: number\r\n ) {\r\n this.tabTitle = title;\r\n this.formTitle = title;\r\n }\r\n\r\n reloader: IReloader | null = null;\r\n @observable stackPosition: number = 0;\r\n @observable tabTitle = \"\";\r\n @observable formTitle = \"\";\r\n @observable isActive = false;\r\n isDialog = false;\r\n isClosed = false;\r\n\r\n @action.bound\r\n setActive(state: boolean): void {\r\n this.isActive = state;\r\n }\r\n\r\n setContent(screen: IFormScreenEnvelope): void {\r\n }\r\n\r\n setTitle(title: string): void {\r\n this.tabTitle = title;\r\n }\r\n\r\n setReloader(reloader: IReloader | null): void {\r\n this.reloader = reloader;\r\n }\r\n\r\n reload() {\r\n this.reloader && this.reloader.reload();\r\n }\r\n\r\n parent?: any;\r\n\r\n menuItemType: IMainMenuItemType = null as any;\r\n\r\n lazyLoading = false;\r\n dialogInfo = undefined;\r\n content: IFormScreenEnvelope = null as any;\r\n parameters: { [key: string]: any } = {};\r\n hasDynamicTitle: boolean = false;\r\n parentContext: IOpenedScreen | undefined;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport function onWorkflowNextClick(ctx: any) {\r\n return flow(function*onWorkflowNextClick(event: any) {\r\n try {\r\n const lifecycle = getFormScreenLifecycle(ctx);\r\n yield*lifecycle.onFlushData();\r\n yield*lifecycle.onWorkflowNextClick(event);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\nexport function getChatrooms(ctx: any) {\r\n return getWorkbench(ctx).chatrooms;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\n\r\nexport function getNotifications(ctx: any) {\r\n return getWorkbench(ctx).notifications;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\n\r\nexport function getFavorites(ctx: any) {\r\n return getWorkbench(ctx).favorites;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport function DEBUG_CLOSE_ALL_FORMS() {\r\n return window.localStorage.getItem('debugCloseAllForms')\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\n// TODO: Move to ui actions\r\nexport function onRefreshSessionClick(ctx: any) {\r\n return flow(function*onRefreshSessionClick() {\r\n try {\r\n yield*getFormScreenLifecycle(ctx).onRequestScreenReload();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\nimport { getOpenedScreen } from \"model/selectors/getOpenedScreen\";\r\nimport { IRefreshOnReturnType } from \"../entities/WorkbenchLifecycle/WorkbenchLifecycle\";\r\nimport { getApi } from \"../selectors/getApi\";\r\nimport { ICRUDResult, processCRUDResult } from \"./DataLoading/processCRUDResult\";\r\nimport { isLazyLoading } from \"model/selectors/isLazyLoading\";\r\nimport { getDataViewLifecycle } from \"model/selectors/DataView/getDataViewLifecycle\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { onRefreshSessionClick } from \"model/actions-ui/ScreenToolbar/onRefreshSessionClick\";\r\n\r\nexport function closeForm(ctx: any) {\r\n return function*closeForm(): Generator {\r\n const lifecycle = getWorkbenchLifecycle(ctx);\r\n const openedScreen = getOpenedScreen(ctx);\r\n yield*lifecycle.closeForm(openedScreen);\r\n if (openedScreen.content?.refreshOnReturnType) {\r\n const refreshOnReturnType = openedScreen.content.refreshOnReturnType;\r\n const parentScreen = getOpenedScreen(openedScreen.parentContext);\r\n const parentFormScreen = getFormScreen(openedScreen.parentContext);\r\n switch (refreshOnReturnType) {\r\n case IRefreshOnReturnType.ReloadActualRecord:\r\n if (isLazyLoading(ctx)) {\r\n break;\r\n }\r\n for (let dataView of parentFormScreen.dataViews) {\r\n const dataViewLifecycle = getDataViewLifecycle(dataView);\r\n yield dataViewLifecycle.runRecordChangedReaction();\r\n }\r\n break;\r\n case IRefreshOnReturnType.RefreshCompleteForm:\r\n yield onRefreshSessionClick(parentFormScreen)();\r\n break;\r\n case IRefreshOnReturnType.MergeModalDialogChanges:\r\n const api = getApi(ctx);\r\n const parentScreenSessionId = parentScreen!.content!.formScreen!.sessionId;\r\n const changes = (yield api.pendingChanges({sessionFormIdentifier: parentScreenSessionId})) as ICRUDResult[];\r\n for (let change of changes) {\r\n yield*processCRUDResult(openedScreen.parentContext, change);\r\n }\r\n const dataViews = parentScreen?.content?.formScreen?.dataViews ?? [];\r\n for (const dataView of dataViews) {\r\n dataView.dataTable.unlockAddedRowPosition();\r\n yield dataView.dataTable.updateSortAndFilter();\r\n }\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { closeForm } from \"model/actions/closeForm\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { getOpenedScreen } from \"model/selectors/getOpenedScreen\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { closingScreens } from \"model/entities/FormScreenLifecycle/FormScreenLifecycle\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\n\r\nexport function onScreenTabCloseMouseDown(ctx: any) {\r\n return function (event: any) {\r\n // OMG, how ugly is this...\r\n const openedScreen = getOpenedScreen(ctx);\r\n if (openedScreen) {\r\n openedScreen.isBeingClosed = true;\r\n }\r\n };\r\n}\r\n\r\n\r\nexport function onScreenTabCloseClick(ctx: any) {\r\n return flow(function*onFormTabCloseClick(event: any, isDueToError?: boolean) {\r\n const openedScreen = getOpenedScreen(ctx);\r\n let dataViews = openedScreen.content?.formScreen?.dataViews ?? [];\r\n for (const dataView of dataViews) {\r\n getTablePanelView(dataView)?.setEditing(false);\r\n }\r\n try {\r\n event?.stopPropagation?.();\r\n // TODO: Wait for other async operation to finish?\r\n if (closingScreens.has(openedScreen)) return;\r\n closingScreens.add(openedScreen);\r\n // TODO: Better lifecycle handling\r\n if (openedScreen.content && !openedScreen.content.isLoading) {\r\n const lifecycle = getFormScreenLifecycle(openedScreen.content.formScreen!);\r\n yield*lifecycle.onRequestScreenClose(isDueToError);\r\n } else {\r\n yield*closeForm(ctx)();\r\n }\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n } finally {\r\n closingScreens.delete(openedScreen);\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { onScreenTabCloseClick } from \"model/actions-ui/ScreenTabHandleRow/onScreenTabCloseClick\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport React, { PropsWithChildren } from \"react\";\r\n\r\nexport class ErrorBoundary extends React.Component<{\r\n onErrorCaught?: (error: any, errorInfo: any) => void;\r\n}> {\r\n componentDidCatch(error: any, errorInfo: any) {\r\n console.log(\"CAUGHT ERROR:\", error, errorInfo); // eslint-disable-line no-console\r\n this.props.onErrorCaught?.(error, errorInfo);\r\n }\r\n\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport class ErrorBoundaryEncapsulated extends React.Component> {\r\n handleScreenError(error: any) {\r\n const self = this;\r\n flow(function*() {\r\n try {\r\n yield*handleError(self.props.ctx)(error);\r\n } catch (e) {\r\n } finally {\r\n yield onScreenTabCloseClick(self.props.ctx)(undefined, true);\r\n }\r\n })();\r\n }\r\n\r\n render() {\r\n return (\r\n this.handleScreenError(error)}>\r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreens } from \"./getOpenedScreens\";\r\n\r\nexport function getOpenedNonDialogScreenItems(ctx: any) {\r\n return getOpenedScreens(ctx).items.filter(item => !item.isDialog);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { TabbedViewHandle } from \"gui/Components/TabbedView/TabbedViewHandle\";\r\nimport { TabbedViewHandleRow } from \"gui/Components/TabbedView/TabbedViewHandleRow\";\r\nimport { ErrorBoundaryEncapsulated } from \"gui/Components/Utilities/ErrorBoundary\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport {\r\n onScreenTabCloseClick,\r\n onScreenTabCloseMouseDown\r\n} from \"model/actions-ui/ScreenTabHandleRow/onScreenTabCloseClick\";\r\nimport { onScreenTabHandleClick } from \"model/actions-ui/ScreenTabHandleRow/onScreenTabHandleClick\";\r\nimport { IOpenedScreen } from \"model/entities/types/IOpenedScreen\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { getIsFormScreenDirty } from \"model/selectors/FormScreen/getisFormScreenDirty\";\r\nimport { getOpenedNonDialogScreenItems } from \"model/selectors/getOpenedNonDialogScreenItems\";\r\nimport React from \"react\";\r\n\r\n@observer\r\nexport class CScreenTabbedViewHandleRow extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n render() {\r\n const openedScreenItems = getOpenedNonDialogScreenItems(this.workbench);\r\n\r\n return (\r\n \r\n {openedScreenItems.map((item) => (\r\n \r\n \r\n \r\n ))}\r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nclass CScreenTabbedViewHandle extends React.Component<{ item: IOpenedScreen }> {\r\n getLabel(item: IOpenedScreen) {\r\n const text = item.tabTitle;\r\n const order = item.order > 0 && !item.hasDynamicTitle ? `[${item.order}]` : \"\";\r\n return [text, order].join(\" \");\r\n }\r\n\r\n render() {\r\n const {item} = this.props;\r\n const label = this.getLabel(item);\r\n return (\r\n onScreenTabHandleClick(item)(event)}\r\n onCloseClick={(event: any) => onScreenTabCloseClick(item)(event)}\r\n onCloseMouseDown={(event: any) => onScreenTabCloseMouseDown(item)(event)}\r\n >\r\n {label}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\nimport { getOpenedScreen } from \"model/selectors/getOpenedScreen\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onScreenTabHandleClick(ctx: any) {\r\n return flow(function*onScreenTabHandleClick(event: any) {\r\n try {\r\n const screen = getOpenedScreen(ctx);\r\n yield*getWorkbenchLifecycle(ctx).onScreenTabHandleClick(event, screen);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from 'gui/Components/ScreenToolbar/ScreenToolbar.module.scss';\r\n\r\n\r\nexport class ScreenToolbar extends React.Component {\r\n render() {\r\n return
{this.props.children}
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"gui/Components/ScreenToolbar/ScreenToolbarAction.module.scss\";\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\nimport { action } from \"mobx\";\r\n\r\nexport class ScreenToolbarAction extends React.Component<{\r\n icon?: React.ReactNode;\r\n label?: string;\r\n isHidden?: boolean;\r\n rootRef?: any;\r\n className?: string;\r\n onMouseDown?(event: any): void;\r\n onClick?(event: any): void;\r\n onShortcut?(event: any): void;\r\n shortcutPredicate?(event: any): boolean;\r\n id?: string;\r\n}> {\r\n @action.bound\r\n handleWindowKeyDown(event: any) {\r\n if (this.props.shortcutPredicate?.(event)) {\r\n event.preventDefault();\r\n this.props.onShortcut?.(event);\r\n }\r\n }\r\n\r\n kbdHandlerUp() {\r\n window.addEventListener(\"keydown\", this.handleWindowKeyDown);\r\n }\r\n\r\n kbdHandlerDown() {\r\n window.removeEventListener(\"keydown\", this.handleWindowKeyDown);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onShortcut && this.props.shortcutPredicate) {\r\n this.kbdHandlerUp();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: any) {\r\n if (\r\n (!prevProps.onShortcut || !prevProps.shortcutPredicate) &&\r\n this.props.onShortcut &&\r\n this.props.shortcutPredicate\r\n ) {\r\n this.kbdHandlerUp();\r\n } else if (\r\n prevProps.onShortcut &&\r\n prevProps.shortcutPredicate &&\r\n (!this.props.onShortcut || !this.props.shortcutPredicate)\r\n ) {\r\n this.kbdHandlerDown();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.kbdHandlerDown();\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n {this.props.icon &&
{this.props.icon}
}\r\n {this.props.label &&
{this.props.label}
}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenToolbar/ScreenToolbarPusher.module.scss\";\r\n\r\nexport class ScreenToolbarPusher extends React.Component {\r\n render() {\r\n return
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenToolbar/ScreenToolbarActionGroup.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport class ScreenToolbarActionGroup extends React.Component<{\r\n domRef?: any;\r\n grovable?: boolean;\r\n}> {\r\n render() {\r\n return (\r\n
\r\n {this.props.children}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreens } from \"./getOpenedScreens\";\r\n\r\nexport function getActiveScreen(ctx: any) {\r\n return getOpenedScreens(ctx).activeItem\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\n// TODO: Move to ui actions\r\nexport function onSaveSessionClick(ctx: any) {\r\n return flow(function*onSaveSessionClick() {\r\n try {\r\n yield*getFormScreenLifecycle(ctx).onSaveSession();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/UserMenuDropdown/UserMenuDropdown.module.scss\";\r\n\r\nexport const UserMenuBlock: React.FC<{\r\n userName: string;\r\n avatarLink: string | undefined;\r\n actionItems: React.ReactNode;\r\n}> = props => (\r\n
\r\n
\r\n
\r\n
\r\n \"\"/\r\n
\r\n
\r\n
{props.userName}
\r\n
\r\n
\r\n
\r\n {props.actionItems}\r\n
\r\n
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\nimport CS from \"gui/Components/Dialogs/DialogsCommon.module.css\";\r\nimport S from \"gui/Components/Dialogs/AboutDialog.module.scss\";\r\nimport { IAboutInfo } from \"model/entities/types/IAboutInfo\";\r\n\r\n@observer\r\nexport class AboutDialog extends React.Component<{\r\n aboutInfo: IAboutInfo;\r\n onOkClick: () => void;\r\n}> {\r\n render() {\r\n const commitId = (window as any).ORIGAM_CLIENT_REVISION_HASH;\r\n const commitDate = (window as any).ORIGAM_CLIENT_REVISION_DATE;\r\n return (\r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
\r\n
Server version:
\r\n
{this.props.aboutInfo.serverVersion}
\r\n
\r\n
Client version:
\r\n
\r\n
{\"Commit ID: \"}\r\n {commitId}\r\n
\r\n
Commit Date: {commitDate}
\r\n
\r\n
\r\n \r\n
\r\n
Copyright 2020 Advantage Solutions, s. r. o.
\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { UserMenuBlock } from \"gui/Components/UserMenuDropdown/UserMenuBlock\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { T } from \"utils/translation\";\r\nimport S from \"gui/Components/UserMenuDropdown/UserMenuDropdown.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { AboutDialog } from \"gui/Components/Dialogs/AboutDialog\";\r\nimport { IAboutInfo } from \"model/entities/types/IAboutInfo\";\r\n\r\nexport const UserMenuDropdown: React.FC<{\r\n handleLogoutClick: (event: any) => void,\r\n avatarLink: string | undefined,\r\n userName: string | undefined,\r\n ctx: any,\r\n aboutInfo: IAboutInfo,\r\n helpUrl: string | undefined\r\n}> = (props) => {\r\n\r\n function onAboutClick() {\r\n const closeDialog = getDialogStack(props.ctx).pushDialog(\r\n \"\",\r\n {\r\n closeDialog();\r\n }}\r\n />\r\n );\r\n }\r\n\r\n function onHelpClick() {\r\n window.open(props.helpUrl);\r\n }\r\n\r\n return (\r\n (\r\n setDropped(true)}>\r\n
\r\n
\r\n
\r\n \"\"/\r\n
\r\n
\r\n
{props.userName}
\r\n
\r\n
\r\n )}\r\n content={({setDropped}) => (\r\n \r\n \r\n {/* \r\n {T(\"My profile\", \"my_profile\")}\r\n */}\r\n {props.helpUrl && props.helpUrl.trim() !== \"\" &&\r\n {\r\n setDropped(false);\r\n onHelpClick();\r\n }}>\r\n {T(\"Help\", \"help_button\")}\r\n }\r\n {\r\n setDropped(false);\r\n onAboutClick();\r\n }}>\r\n {T(\"About\", \"about_application\")}\r\n \r\n \r\n {T(\"Log out\", \"sign_out_tool_tip\")}\r\n \r\n \r\n }\r\n />\r\n \r\n )}\r\n />);\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getLoggedUserName(ctx: any): string | undefined {\r\n return getWorkbenchLifecycle(ctx).userInfo?.userName;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport interface IWebScreen {\r\n $type_IWebScreen: 1;\r\n\r\n reload(): void;\r\n\r\n setReloader(reloader: IReloader | null): void;\r\n\r\n setTitle(title: string): void;\r\n}\r\n\r\nexport interface IReloader {\r\n reload(): void;\r\n}\r\n\r\nexport const isIWebScreen = (o: any): o is IWebScreen => o.$type_IWebScreen;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { isIWebScreen } from \"model/entities/types/IWebScreen\";\r\n\r\nexport function getWebScreen(ctx: any) {\r\n let cn = ctx;\r\n while (true) {\r\n if (isIWebScreen(cn)) {\r\n return cn;\r\n }\r\n cn = cn.parent;\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getUserAvatarLink(ctx: any): string | undefined {\r\n return getWorkbenchLifecycle(ctx).userInfo?.avatarLink;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getCustomAssetsRoute(ctx: any): string | undefined {\r\n return getWorkbenchLifecycle(ctx).customAssetsRoute;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getFormScreen } from \"./getFormScreen\";\r\n\r\nexport function getIsSuppressRefresh(ctx: any) {\r\n return getFormScreen(ctx).suppressRefresh;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getHelpUrl(ctx: any): string | undefined {\r\n return getWorkbenchLifecycle(ctx).portalSettings?.helpUrl;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { ScreenToolbar } from \"gui/Components/ScreenToolbar/ScreenToolbar\";\r\nimport { ScreenToolbarAction } from \"gui/Components/ScreenToolbar/ScreenToolbarAction\";\r\nimport { ScreenToolbarPusher } from \"gui/Components/ScreenToolbar/ScreenToolbarPusher\";\r\nimport { MobXProviderContext, Observer, observer } from \"mobx-react\";\r\nimport { IApplication } from \"model/entities/types/IApplication\";\r\nimport React, { Fragment } from \"react\";\r\nimport { action, observable } from \"mobx\";\r\nimport { onScreenToolbarLogoutClick } from \"model/actions-ui/ScreenToolbar/onScreenToolbarLogoutClick\";\r\nimport { openSearchWindow } from \"model/actions-ui/ScreenToolbar/openSearchWindow\";\r\nimport { ScreenToolbarActionGroup } from \"gui/Components/ScreenToolbar/ScreenToolbarActionGroup\";\r\nimport { getActiveScreen } from \"model/selectors/getActiveScreen\";\r\nimport { onSaveSessionClick } from \"model/actions-ui/ScreenToolbar/onSaveSessionClick\";\r\nimport { onRefreshSessionClick } from \"model/actions-ui/ScreenToolbar/onRefreshSessionClick\";\r\nimport { getActiveScreenActions } from \"model/selectors/getActiveScreenActions\";\r\nimport { getIsEnabledAction } from \"model/selectors/Actions/getIsEnabledAction\";\r\n\r\nimport uiActions from \"model/actions-ui-tree\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { UserMenuDropdown } from \"gui/Components/UserMenuDropdown/UserMenuDropdown\";\r\nimport { getLoggedUserName } from \"model/selectors/User/getLoggedUserName\";\r\nimport { onReloadWebScreenClick } from \"model/actions-ui/ScreenToolbar/onReloadWebScreen\";\r\nimport { isIFormScreenEnvelope } from \"model/entities/types/IFormScreen\";\r\nimport { isIWebScreen } from \"model/entities/types/IWebScreen\";\r\nimport { getIsSuppressSave } from \"model/selectors/FormScreen/getIsSuppressSave\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { IAction, IActionType } from \"model/entities/types/IAction\";\r\n\r\nimport { T } from \"utils/translation\";\r\nimport { getUserAvatarLink } from \"model/selectors/User/getUserAvatarLink\";\r\nimport { getCustomAssetsRoute } from \"model/selectors/User/getCustomAssetsRoute\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { IAboutInfo } from \"model/entities/types/IAboutInfo\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { getApi } from \"model/selectors/getApi\";\r\nimport { getIsSuppressRefresh } from \"model/selectors/FormScreen/getIsSuppressRefresh\";\r\nimport { getHelpUrl } from \"model/selectors/User/getHelpUrl\";\r\n\r\nfunction isSaveShortcut(event: any) {\r\n return event.key === \"s\" && (event.ctrlKey || event.metaKey);\r\n}\r\n\r\nfunction isRefreshShortcut(event: any) {\r\n return event.key === \"r\" && (event.ctrlKey || event.metaKey);\r\n}\r\n\r\n@observer\r\nexport class CScreenToolbar extends React.Component<{}> {\r\n static contextType = MobXProviderContext;\r\n\r\n state = {\r\n hiddenActionIds: new Set(),\r\n };\r\n\r\n get application(): IApplication {\r\n return this.context.application;\r\n }\r\n\r\n @observable\r\n aboutInfo: IAboutInfo = {\r\n serverVersion: \"\",\r\n };\r\n\r\n componentDidMount() {\r\n runInFlowWithHandler({\r\n ctx: this.application,\r\n action: async () => {\r\n const api = getApi(this.application);\r\n this.aboutInfo = await api.getAboutInfo();\r\n },\r\n });\r\n }\r\n\r\n @action.bound\r\n handleLogoutClick(event: any) {\r\n onScreenToolbarLogoutClick(this.application)(event);\r\n }\r\n\r\n getOverfullActionsDropdownContent(\r\n toolbarActions: Array<{\r\n section: string;\r\n actions: IAction[];\r\n }>,\r\n actionFilter: ((action: IAction) => boolean) | undefined,\r\n setDropped: (state: boolean) => void\r\n ) {\r\n const customAssetsRoute = getCustomAssetsRoute(this.application);\r\n\r\n const iconsWillBeShown = toolbarActions\r\n .flatMap((toolbar) => toolbar.actions)\r\n .some((action) => action.iconUrl);\r\n\r\n function getIcon(action: IAction) {\r\n if (action.iconUrl) {\r\n return ;\r\n }\r\n return iconsWillBeShown ?
: null;\r\n }\r\n\r\n return toolbarActions\r\n .filter((actionGroup) => actionGroup.actions.length > 0)\r\n .map((actionGroup) => (\r\n \r\n {/*{this.renderActions(actionGroup.actions)}*/}\r\n {actionGroup.actions\r\n .filter(\r\n (action) => (actionFilter ? actionFilter(action) : true) && getIsEnabledAction(action)\r\n )\r\n .map((action, idx) => (\r\n \r\n \r\n {\r\n uiActions.actions.onActionClick(action)(event, action);\r\n setDropped(false)\r\n }\r\n }\r\n />\r\n \r\n ))}\r\n \r\n ));\r\n }\r\n\r\n renderActions(actions: IAction[]) {\r\n const actionsToRender = actions.filter((action) => getIsEnabledAction(action));\r\n return actionsToRender\r\n .filter((action) => !action.groupId)\r\n .map((action, idx) => this.renderAction(action, actionsToRender, idx));\r\n }\r\n\r\n renderAction(action: IAction, actionsToRender: IAction[], order: number) {\r\n const customAssetsRoute = getCustomAssetsRoute(this.application);\r\n if (action.type === IActionType.Dropdown) {\r\n const childActions = actionsToRender.filter(\r\n (otherAction) => otherAction.groupId === action.id\r\n );\r\n return (\r\n (\r\n \r\n {() => (\r\n setDropped(true)}\r\n className={isDropped ? \"isActiveDropDownAction\" : \"\"}\r\n icon={\r\n action.iconUrl ? (\r\n \r\n ) : undefined\r\n }\r\n label={action.caption}\r\n />\r\n )}\r\n \r\n )}\r\n content={args => (\r\n \r\n {this.getOverfullActionsDropdownContent(\r\n [{section: \"\", actions: childActions}],\r\n undefined,\r\n args.setDropped\r\n )}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n return (\r\n \r\n {() => (\r\n : undefined\r\n }\r\n label={action.caption}\r\n onClick={(event) => {\r\n uiActions.actions.onActionClick(action)(event, action);\r\n }\r\n }\r\n />\r\n )}\r\n \r\n );\r\n }\r\n\r\n renderForFormScreen() {\r\n const activeScreen = getActiveScreen(this.application);\r\n if (activeScreen && !activeScreen.content) return null;\r\n const formScreen =\r\n activeScreen && !activeScreen.content.isLoading ? activeScreen.content.formScreen : undefined;\r\n const isDirty = formScreen && formScreen.isDirty;\r\n const toolbarActions = getActiveScreenActions(this.application);\r\n const userName = getLoggedUserName(this.application);\r\n const avatarLink = getUserAvatarLink(this.application);\r\n return (\r\n \r\n {formScreen ? (\r\n <>\r\n \r\n {!getIsSuppressSave(formScreen) && (\r\n \r\n }\r\n label={T(\"Save\", \"save_tool_tip\")}\r\n />\r\n )}\r\n {!getIsSuppressRefresh(formScreen) && (\r\n \r\n }\r\n label={T(\"Refresh\", \"refresh_tool_tip\")}\r\n />\r\n )}\r\n \r\n \r\n {() => (\r\n \r\n {toolbarActions\r\n .filter((actionGroup) => actionGroup.actions.length > 0)\r\n .map((actionGroup) => (\r\n \r\n {this.renderActions(actionGroup.actions)}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n \r\n ) : null}\r\n {this.state.hiddenActionIds.size > 0 && (\r\n (\r\n setDropped(true)}\r\n icon={}\r\n />\r\n )}\r\n content={(args) => (\r\n \r\n {this.getOverfullActionsDropdownContent(\r\n toolbarActions,\r\n action => this.state.hiddenActionIds.has(action.id),\r\n args.setDropped\r\n )}\r\n \r\n )}\r\n />\r\n )}\r\n openSearchWindow(this.application)}\r\n icon={}\r\n />\r\n this.handleLogoutClick(event)}\r\n ctx={this.application}\r\n aboutInfo={this.aboutInfo}\r\n helpUrl={getHelpUrl(this.application)}\r\n />\r\n \r\n );\r\n }\r\n\r\n renderForWebScreen() {\r\n const activeScreen = getActiveScreen(this.application);\r\n const userName = getLoggedUserName(this.application);\r\n const avatarLink = getUserAvatarLink(this.application);\r\n return (\r\n \r\n <>\r\n \r\n }\r\n label={T(\"Refresh\", \"refresh_tool_tip\")}\r\n />\r\n \r\n \r\n \r\n openSearchWindow(this.application)}\r\n icon={}\r\n />\r\n this.handleLogoutClick(event)}\r\n ctx={this.application}\r\n aboutInfo={this.aboutInfo}\r\n helpUrl={getHelpUrl(this.application)}\r\n />\r\n \r\n );\r\n }\r\n\r\n renderDefault() {\r\n const userName = getLoggedUserName(this.application);\r\n const avatarLink = getUserAvatarLink(this.application);\r\n return (\r\n \r\n \r\n {/*}\r\n label=\"Search\"\r\n />*/}\r\n openSearchWindow(this.application)}\r\n icon={}\r\n />\r\n this.handleLogoutClick(event)}\r\n ctx={this.application}\r\n aboutInfo={this.aboutInfo}\r\n helpUrl={getHelpUrl(this.application)}\r\n />\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const activeScreen = getActiveScreen(this.application);\r\n if (!activeScreen) {\r\n return this.renderDefault();\r\n }\r\n if (activeScreen.content && isIFormScreenEnvelope(activeScreen.content)) {\r\n return this.renderForFormScreen();\r\n }\r\n if (isIWebScreen(activeScreen)) {\r\n return this.renderForWebScreen();\r\n }\r\n return null;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { getApplicationLifecycle } from \"model/selectors/getApplicationLifecycle\";\r\nimport { handleError } from \"model/actions/handleError\";\r\n\r\nexport function onScreenToolbarLogoutClick(ctx: any) {\r\n return flow(function*onScreenToolbarLogoutClick(event: any) {\r\n try {\r\n yield*getApplicationLifecycle(ctx).onSignOutClick({event});\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreens } from \"./getOpenedScreens\";\r\n\r\nexport function getActiveScreenActions(ctx: any) {\r\n return getOpenedScreens(ctx).activeScreenActions;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getWebScreen } from \"model/selectors/WebScreen/getWebScreen\";\r\n\r\n// TODO: Move to ui actions\r\nexport function onReloadWebScreenClick(ctx: any) {\r\n return flow(function*onReloadWebScreenClick() {\r\n try {\r\n getWebScreen(ctx).reload();\r\n //yield* getFormScreenLifecycle(ctx).onRequestScreenReload();\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Sidebar/AlertCounter.module.scss\";\r\n\r\nexport class SidebarAlertCounter extends React.Component {\r\n render() {\r\n return
{this.props.children}
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Sidebar/LogoSection.module.scss\";\r\n\r\nexport class LogoSection extends React.Component {\r\n render() {\r\n return
{this.props.children}
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport S from \"gui/Components/Sidebar/Sidebar.module.scss\";\r\nimport React from \"react\";\r\n\r\nexport const Sidebar: React.FC = props => (\r\n
{props.children}
\r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\nimport S from \"gui/Components/Sidebar/SidebarSection.module.scss\";\r\n\r\nexport class SidebarSection extends React.Component<{ isActive: boolean }> {\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n
\r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from 'gui/Components/Sidebar/SidebarSectionDivider.module.scss';\r\n\r\nexport class SidebarSectionDivider extends React.Component {\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport cx from \"classnames\";\r\nimport S from \"gui/Components/Sidebar/SidebarSectionHeader.module.scss\";\r\n\r\nexport class SidebarSectionHeader extends React.Component<{\r\n icon: React.ReactNode;\r\n label: React.ReactNode;\r\n isActive: boolean;\r\n onClick?(event: any): void;\r\n refDom?: any;\r\n onContextMenu?: (event: any) => void;\r\n id?: string;\r\n}> {\r\n render() {\r\n return (\r\n \r\n
{this.props.icon}
\r\n
{this.props.label}
\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/MainMenu/MainMenuUL.module.scss\";\r\n\r\nexport class MainMenuUL extends React.Component {\r\n render() {\r\n return
    {this.props.children}
;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/MainMenu/MainMenuLI.module.scss\";\r\n\r\nexport class MainMenuLI extends React.Component {\r\n render() {\r\n return
  • {this.props.children}
  • ;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\n\r\nimport cx from \"classnames\";\r\n\r\nimport S from \"gui/Components/MainMenu/MainMenuItem.module.scss\";\r\n\r\nexport class MainMenuItem extends React.Component<{\r\n /** Content to render as an icon. */\r\n icon: React.ReactNode;\r\n /** Content to render as a label. */\r\n label: string;\r\n /** Level of nestedness for making tree structured menus. */\r\n level: number;\r\n /** Indicates that the item is currently active. */\r\n isActive: boolean;\r\n isHidden: boolean;\r\n isHighLighted?: boolean;\r\n id?: string;\r\n isOpenedScreen?: boolean;\r\n isActiveScreen?: boolean;\r\n\r\n onClick?(event: any): void;\r\n onContextMenu?(event: any): void;\r\n refDom?: any;\r\n}> {\r\n render() {\r\n return (\r\n
    \r\n \r\n
    {this.props.icon}
    \r\n
    {this.props.label}
    \r\n \r\n
    \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getMainMenuEnvelope } from \"./getMainMenuEnvelope\";\r\n\r\nexport function getIsMainMenuLoading(ctx: any) {\r\n return getMainMenuEnvelope(ctx).isLoading;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { observable } from \"mobx\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\nimport CS from \"gui/Components/Dialogs/DialogsCommon.module.css\";\r\nimport S from \"gui/Components/Dialogs/SaveFilterDialog.module.css\";\r\nimport { FavoriteFolder } from \"model/entities/Favorites\";\r\nimport { IOption, SimpleDropdown } from \"@origam/components\";\r\n\r\n@observer\r\nexport class ChooseFavoriteFolderDialog extends React.Component<{\r\n onCancelClick: (event: any) => void;\r\n onOkClick: (selectdFolderId: string) => void;\r\n favorites: FavoriteFolder[];\r\n}> {\r\n options: IOption[];\r\n\r\n @observable\r\n selectedOption: IOption;\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.options = this.props.favorites.map((favorite) => {\r\n return {value: favorite, label: favorite.name};\r\n });\r\n this.selectedOption = this.options[0];\r\n }\r\n\r\n onKeydown(event: React.KeyboardEvent) {\r\n if (event.key === \"Enter\") {\r\n this.props.onOkClick(this.selectedOption.value.id);\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n this.props.onOkClick(this.selectedOption.value.id)}\r\n >\r\n {T(\"Ok\", \"button_ok\")}\r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
    \r\n
    \r\n
    \r\n
    {T(\"Name:\", \"group_name\")}
    \r\n (this.selectedOption = option)}\r\n />\r\n
    \r\n
    \r\n
    \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IMenuItemIcon {\r\n Form = \"menu_form.png\",\r\n Folder = \"menu_folder.png\",\r\n Workflow = \"menu_workflow.png\",\r\n Parameter = \"menu_parameter.png\",\r\n WorkQueue = \"./icons/work-queue.svg\",\r\n Chat = \"./icons/chat.svg\"\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { IMenuItemIcon } from \"gui/Workbench/MainMenu/IMenuItemIcon\";\r\n\r\nexport function getIconUrl(iconName: string | IMenuItemIcon, iconPath?: string) {\r\n switch (iconName) {\r\n case IMenuItemIcon.Form:\r\n return \"./icons/document.svg\";\r\n case IMenuItemIcon.Workflow:\r\n return \"./icons/settings.svg\";\r\n case IMenuItemIcon.WorkQueue:\r\n return \"./icons/work-queue.svg\";\r\n case IMenuItemIcon.Chat:\r\n return \"./icons/chat.svg\";\r\n case IMenuItemIcon.Folder:\r\n return \"./icons/folder-closed.svg\";\r\n default:\r\n if (iconPath) {\r\n return iconPath;\r\n } else {\r\n return \"./icons/document.svg\";\r\n }\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"../../actions/handleError\";\r\nimport { getApi } from \"../../selectors/getApi\";\r\n\r\nexport function onResetColumnConfigClick(ctx: any) {\r\n return flow(function*onMainMenuItemClick(args: {\r\n item: any;\r\n }) {\r\n try {\r\n if (!args?.item?.attributes?.id) {\r\n return;\r\n }\r\n const api = getApi(ctx);\r\n yield api.resetScreenColumnConfiguration({instanceId: args.item.attributes.id});\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Sidebar/SidebarSectionBody.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport const SidebarSectionBody: React.FC<{ isActive?: boolean }> = props => (\r\n
    \r\n {props.children}\r\n
    \r\n);\r\n","import { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport S from \"gui/connections/MenuComponents/EditButton.module.scss\";\r\nimport CS from \"gui/connections/MenuComponents/HeaderButton.module.scss\";\r\n\r\n@observer\r\nexport class EditButton extends React.Component<{\r\n isEnabled: boolean;\r\n isVisible: boolean;\r\n onClick: () => void;\r\n tooltip: string;\r\n}> {\r\n\r\n getClass() {\r\n let className = `fas fa-edit ${CS.headerIcon} ${S.editIcon}`;\r\n if (!this.props.isVisible && !this.props.isEnabled) {\r\n className += \" \" + CS.headerIconHidden;\r\n }\r\n if (this.props.isEnabled) {\r\n className += \" \" + CS.headerIconActive\r\n }\r\n return className;\r\n }\r\n\r\n render() {\r\n return (\r\n this.props.onClick()}\r\n />\r\n )\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { RefObject } from \"react\";\r\nimport { MainMenuUL } from \"gui/Components/MainMenu/MainMenuUL\";\r\nimport { MainMenuLI } from \"gui/Components/MainMenu/MainMenuLI\";\r\nimport { MainMenuItem } from \"gui/Components/MainMenu/MainMenuItem\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { inject, MobXProviderContext, Observer, observer } from \"mobx-react\";\r\nimport { IApplication } from \"model/entities/types/IApplication\";\r\nimport { getIsMainMenuLoading } from \"model/selectors/MainMenu/getIsMainMenuLoading\";\r\nimport { getMainMenu } from \"model/selectors/MainMenu/getMainMenu\";\r\nimport { action, observable } from \"mobx\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { onMainMenuItemClick } from \"model/actions-ui/MainMenu/onMainMenuItemClick\";\r\nimport { getActiveScreen } from \"model/selectors/getActiveScreen\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { T } from \"utils/translation\";\r\nimport { getFavorites } from \"model/selectors/MainMenu/getFavorites\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { ChooseFavoriteFolderDialog } from \"gui/Components/Dialogs/ChooseFavoriteFolderDialog\";\r\nimport { getIconUrl } from \"gui/getIconUrl\";\r\nimport { getMainMenuState } from \"model/selectors/MainMenu/getMainMenuState\";\r\nimport { getCustomAssetsRoute } from \"model/selectors/User/getCustomAssetsRoute\";\r\nimport { IMenuItemIcon } from \"gui/Workbench/MainMenu/IMenuItemIcon\";\r\nimport { onResetColumnConfigClick } from \"model/actions-ui/MainMenu/onResetColumnConfigClick\";\r\nimport S from \"gui/connections/CMainMenu.module.scss\";\r\nimport { SidebarSectionDivider } from \"gui/Components/Sidebar/SidebarSectionDivider\";\r\nimport { SidebarSectionHeader } from \"gui/Components/Sidebar/SidebarSectionHeader\";\r\nimport { SidebarSectionBody } from \"gui/Components/Sidebar/SidebarSectionBody\";\r\nimport { EditButton } from \"gui/connections/MenuComponents/EditButton\";\r\nimport { IMainMenuState } from \"model/entities/types/IMainMenu\";\r\nimport cx from \"classnames\";\r\n\r\n@inject(mainMenuState => mainMenuState)\r\n@observer\r\nexport class CMainMenu extends React.Component<{\r\n isActive: boolean;\r\n onClick: () => void;\r\n mainMenuState?: IMainMenuState;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n\r\n @observable\r\n mouseInHeader = false;\r\n\r\n get application(): IApplication {\r\n return this.context.application;\r\n }\r\n\r\n @action\r\n onEditClick() {\r\n this.props.mainMenuState!.editing = !this.props.mainMenuState!.editing;\r\n const mainMenu = getMainMenu(this.application)!;\r\n if (this.props.mainMenuState!.editing) {\r\n this.props.onClick();\r\n if (!this.isAnyCommandVisible(mainMenu.menuUI)) {\r\n this.ensureAtLeastOneCommandVisible(mainMenu.menuUI);\r\n }\r\n }\r\n }\r\n\r\n isAnyCommandVisible(element: any) {\r\n const commandVisible = element.elements.some((child: any) => child.name === \"Command\")\r\n if (commandVisible) {\r\n return true;\r\n }\r\n for (const childElement of element.elements) {\r\n if (childElement.name === \"Submenu\" &&\r\n childElement.attributes.isHidden !== \"true\" &&\r\n this.props.mainMenuState!.isOpen(childElement.attributes.id)) {\r\n const commandsVisible = this.isAnyCommandVisible(childElement);\r\n if (commandsVisible) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n ensureAtLeastOneCommandVisible(element: any) {\r\n const commandVisible = element.elements.some((child: any) => child.name === \"Command\")\r\n if (commandVisible) {\r\n return true;\r\n }\r\n for (const childElement of element.elements) {\r\n if (childElement.name === \"Submenu\" && childElement.attributes.isHidden !== \"true\") {\r\n if (!this.props.mainMenuState!.isOpen(childElement.attributes.id)) {\r\n this.props.mainMenuState!.setIsOpen(childElement.attributes.id, true);\r\n }\r\n const commandsVisible = this.ensureAtLeastOneCommandVisible(childElement);\r\n if (commandsVisible) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n render() {\r\n const {application} = this;\r\n const isLoading = getIsMainMenuLoading(application);\r\n const mainMenu = getMainMenu(application);\r\n\r\n if (isLoading || !mainMenu) {\r\n return null; // TODO: More intelligent menu loading indicator...\r\n }\r\n return (\r\n <>\r\n \r\n this.mouseInHeader = true}\r\n onMouseLeave={() => this.mouseInHeader = false}\r\n >\r\n }\r\n label={T(\"Menu\", \"menu\")}\r\n onClick={() => this.props.onClick()}\r\n />\r\n \r\n {() =>\r\n this.onEditClick()}\r\n tooltip={T(\"Manage Favourites\", \"manage_favorites\")}\r\n />\r\n }\r\n \r\n
    \r\n \r\n {listFromNode(mainMenu.menuUI, 1, true)}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport function itemForNode(node: any, level: number, isOpen: boolean) {\r\n switch (node.name) {\r\n case \"Submenu\":\r\n return (\r\n \r\n \r\n \r\n );\r\n case \"Command\":\r\n return (\r\n \r\n \r\n \r\n );\r\n default:\r\n return <>;\r\n }\r\n}\r\n\r\nfunction listFromNode(node: any, level: number, isOpen: boolean) {\r\n return (\r\n \r\n {node.elements\r\n .filter((childNode: any) => childNode.attributes.isHidden !== \"true\")\r\n .map((node: any) => itemForNode(node, level, isOpen))}\r\n \r\n );\r\n}\r\n\r\n@inject(mainMenuState => mainMenuState)\r\n@observer\r\nclass CMainMenuCommandItem extends React.Component<{\r\n node: any;\r\n level: number;\r\n isOpen: boolean;\r\n mainMenuState?: IMainMenuState;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n get menuId() {\r\n return this.props.node.attributes[\"id\"];\r\n }\r\n\r\n get favorites() {\r\n return getFavorites(this.workbench);\r\n }\r\n\r\n render() {\r\n const {props} = this;\r\n const customAssetsRoute = getCustomAssetsRoute(this.workbench);\r\n const activeScreen = getActiveScreen(this.workbench);\r\n const activeMenuItemId = activeScreen ? activeScreen.menuItemId : undefined;\r\n const isOpenScreen = this.workbench.openedScreenIdSet.has(props.node.attributes.id);\r\n return (\r\n (\r\n \r\n \r\n }\r\n label={props.node.attributes.label}\r\n isHidden={!props.isOpen}\r\n // TODO: Implements selector for this idset\r\n isOpenedScreen={isOpenScreen}\r\n isActiveScreen={activeMenuItemId === props.node.attributes.id}\r\n onClick={(event) =>\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: props.node,\r\n idParameter: undefined,\r\n })\r\n }\r\n onContextMenu={(event) => {\r\n setDropped(true, event);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }}\r\n />\r\n {this.props.mainMenuState!.editing &&\r\n \r\n }\r\n \r\n )}\r\n content={({setDropped}) => (\r\n \r\n {\r\n setDropped(false);\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: props.node,\r\n idParameter: undefined,\r\n })\r\n }}\r\n >\r\n {T(\"Open\", \"open_form\")}\r\n \r\n {\r\n setDropped(false);\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: props.node,\r\n idParameter: undefined,\r\n forceOpenNew: true\r\n })\r\n }}\r\n >\r\n {T(\"Open in New Tab\", \"open_in_new_tab\")}\r\n \r\n {(props.node.attributes.type === \"FormReferenceMenuItem\" ||\r\n props.node.attributes.type === \"FormReferenceMenuItem_WithSelection\") &&\r\n {\r\n setDropped(false);\r\n onResetColumnConfigClick(this.workbench)({\r\n item: props.node\r\n })\r\n }}\r\n >\r\n {T(\"Reset Column Configuration\", \"reset_column_configuration\")}\r\n \r\n }\r\n {!this.favorites.isInAnyFavoriteFolder(this.menuId) && (\r\n {\r\n setDropped(false);\r\n onAddToFavoritesClicked(this.workbench, this.menuId);\r\n }}\r\n >\r\n {T(\"Put to favourites\", \"put_to_favourites\")}\r\n \r\n )}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class CFavoritesMenuItem extends React.Component<{\r\n node: any;\r\n level: number;\r\n isOpen: boolean;\r\n editingEnabled: boolean;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n get menuId() {\r\n return this.props.node.attributes[\"id\"];\r\n }\r\n\r\n get favorites() {\r\n return getFavorites(this.workbench);\r\n }\r\n\r\n getIconSrc() {\r\n if (this.props.editingEnabled) {\r\n return \"./icons/minus.svg\";\r\n }\r\n const customAssetsRoute = getCustomAssetsRoute(this.workbench);\r\n return getIconUrl(\r\n this.props.node.attributes.icon,\r\n customAssetsRoute + \"/\" + this.props.node.attributes.icon\r\n )\r\n }\r\n\r\n onIconClick(event: any) {\r\n if (this.props.editingEnabled) {\r\n onRemoveFromFavoritesClicked(this.workbench, this.menuId);\r\n } else {\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: this.props.node,\r\n idParameter: undefined,\r\n })\r\n }\r\n }\r\n\r\n onClick(event: any) {\r\n if (this.props.editingEnabled) {\r\n return;\r\n }\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: this.props.node,\r\n idParameter: undefined,\r\n })\r\n }\r\n\r\n render() {\r\n const {props} = this;\r\n const activeScreen = getActiveScreen(this.workbench);\r\n const activeMenuItemId = activeScreen ? activeScreen.menuItemId : undefined;\r\n const isOpenedScreen = this.workbench.openedScreenIdSet.has(props.node.attributes.id);\r\n return (\r\n (\r\n
    \r\n this.onIconClick(event)}>\r\n \r\n
    \r\n }\r\n label={props.node.attributes.label}\r\n isHidden={!props.isOpen}\r\n isOpenedScreen={isOpenedScreen}\r\n isActiveScreen={activeMenuItemId === props.node.attributes.id}\r\n onClick={(event) => {\r\n if (this.props.editingEnabled) return;\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: props.node,\r\n idParameter: undefined,\r\n })\r\n }\r\n }\r\n onContextMenu={(event) => {\r\n setDropped(true, event);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }}\r\n />\r\n {this.props.editingEnabled ? : null}\r\n \r\n )}\r\n content={({setDropped}) => (\r\n \r\n this.onClick(event)}>\r\n {T(\"Open\", \"open_form\")}\r\n \r\n {\r\n setDropped(false);\r\n onMainMenuItemClick(this.workbench)({\r\n event,\r\n item: props.node,\r\n idParameter: undefined,\r\n forceOpenNew: true\r\n })\r\n }}\r\n >\r\n {T(\"Open in New Tab\", \"open_in_new_tab\")}\r\n \r\n {(props.node.attributes.type === \"FormReferenceMenuItem\" ||\r\n props.node.attributes.type === \"FormReferenceMenuItem_WithSelection\") &&\r\n {\r\n setDropped(false);\r\n onResetColumnConfigClick(this.workbench)({\r\n item: props.node\r\n })\r\n }}\r\n >\r\n {T(\"Reset Column Configuration\", \"reset_column_configuration\")}\r\n \r\n }\r\n {this.favorites.isInAnyFavoriteFolder(this.menuId) && (\r\n {\r\n setDropped(false);\r\n onRemoveFromFavoritesClicked(this.workbench, this.menuId);\r\n }}\r\n >\r\n {T(\"Remove from Favourites\", \"remove_from_favourites\")}\r\n \r\n )}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n}\r\n\r\nfunction onRemoveFromFavoritesClicked(ctx: any, menuId: string) {\r\n const favorites = getFavorites(ctx);\r\n runInFlowWithHandler({\r\n ctx: ctx,\r\n action: () => favorites.remove(menuId),\r\n });\r\n}\r\n\r\nexport function onAddToFavoritesClicked(ctx: any, menuId: string) {\r\n const favorites = getFavorites(ctx);\r\n const closeDialog = getDialogStack(ctx).pushDialog(\r\n \"\",\r\n {\r\n runInFlowWithHandler({\r\n ctx: ctx,\r\n action: () => favorites.add(folderId, menuId),\r\n });\r\n closeDialog();\r\n }}\r\n onCancelClick={() => closeDialog()}\r\n favorites={favorites.favoriteFolders}\r\n />\r\n );\r\n}\r\n\r\n@observer\r\nclass FavoritesAddRemoveButton extends React.Component<{\r\n ctx: any;\r\n isVisible: boolean;\r\n menuId: string;\r\n}> {\r\n render() {\r\n const favorites = getFavorites(this.props.ctx);\r\n return (\r\n {\r\n if (favorites.isInAnyFavoriteFolder(this.props.menuId)) {\r\n onRemoveFromFavoritesClicked(this.props.ctx, this.props.menuId);\r\n } else {\r\n onAddToFavoritesClicked(this.props.ctx, this.props.menuId)\r\n }\r\n }}\r\n >\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nclass CMainMenuFolderItem extends React.Component<{\r\n node: any;\r\n level: number;\r\n isOpen: boolean;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n itemRef: RefObject = React.createRef();\r\n\r\n componentDidMount() {\r\n this.mainMenuState.setReference(this.id, this.itemRef);\r\n }\r\n\r\n get id() {\r\n return this.props.node.attributes.id;\r\n }\r\n\r\n get mainMenuState() {\r\n return getMainMenuState(this.context.application);\r\n }\r\n\r\n @action.bound handleClick(event: any) {\r\n this.mainMenuState.flipIsOpen(this.id);\r\n }\r\n\r\n get icon() {\r\n if (this.props.node.attributes.icon !== IMenuItemIcon.Folder) {\r\n const customAssetsRoute = getCustomAssetsRoute(this.context.application);\r\n return ;\r\n }\r\n if (this.mainMenuState.isOpen(this.id)) {\r\n return ;\r\n } else {\r\n return ;\r\n }\r\n }\r\n\r\n render() {\r\n const {props} = this;\r\n return (\r\n \r\n \r\n {listFromNode(\r\n props.node,\r\n props.level + 1,\r\n this.props.isOpen && this.mainMenuState.isOpen(this.id)\r\n )}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { RefObject } from \"react\";\r\nimport S from \"gui/Components/WorkQueues/WorkQueuesItem.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { MobXProviderContext } from \"mobx-react\";\r\nimport { getMainMenuState } from \"model/selectors/MainMenu/getMainMenuState\";\r\n\r\nexport class WorkQueuesItem extends React.Component<{\r\n isActiveScreen?: boolean;\r\n isOpenedScreen?: boolean;\r\n isHidden?: boolean;\r\n isEmphasized?: boolean;\r\n level?: number;\r\n icon?: React.ReactNode;\r\n label?: React.ReactNode;\r\n tooltip?: string;\r\n id?: string;\r\n onClick?(event: any): void;\r\n}> {\r\n static contextType = MobXProviderContext;\r\n itemRef: RefObject = React.createRef();\r\n\r\n componentDidMount() {\r\n if (this.props.id) {\r\n this.mainMenuState.setReference(this.props.id, this.itemRef);\r\n }\r\n }\r\n\r\n get mainMenuState() {\r\n return getMainMenuState(this.context.application);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n
    {this.props.icon}
    \r\n
    {this.props.label}
    \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function onWorkQueuesListItemClick(ctx: any) {\r\n return flow(function*onWorkQueuesListItemClick(event: any, item: any) {\r\n try {\r\n yield*getWorkbenchLifecycle(ctx).onWorkQueueListItemClick(event, item);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { getWorkQueuesItems } from \"model/selectors/WorkQueues/getWorkQueuesItems\";\r\nimport { WorkQueuesItem } from \"gui/Components/WorkQueues/WorkQueuesItem\";\r\nimport { computed } from \"mobx\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { onWorkQueuesListItemClick } from \"model/actions-ui/WorkQueues/onWorkQueuesListItemClick\";\r\nimport { getActiveScreen } from \"model/selectors/getActiveScreen\";\r\n\r\n@observer\r\nexport class CWorkQueues extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n @computed get sortedItems() {\r\n const workQueueItems = [...getWorkQueuesItems(this.workbench)];\r\n workQueueItems.sort((a, b) => (a.name || \"\").localeCompare(b.name || \"\"));\r\n return workQueueItems;\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n {this.sortedItems.map(item => {\r\n const activeScreen = getActiveScreen(this.workbench);\r\n const activeMenuItemId = activeScreen ? activeScreen.menuItemId : undefined;\r\n return (\r\n 0}\r\n isOpenedScreen={this.workbench.openedScreenIdSet.has(item.id)}\r\n isActiveScreen={activeMenuItemId === item.id}\r\n icon={}\r\n tooltip={item.name}\r\n label={\r\n <>\r\n {item.name}\r\n {item.countTotal > 0 && <> ({item.countTotal})}\r\n \r\n }\r\n id={item.id}\r\n onClick={event => onWorkQueuesListItemClick(this.workbench)(event, item)}\r\n />\r\n );\r\n })}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nexport enum IInfoSubsection {\r\n Info,\r\n Audit\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkQueues } from \"./getWorkQueues\";\r\n\r\nexport function getWorkQueuesItems(ctx: any) {\r\n return getWorkQueues(ctx).items;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/SidebarInfoSection/SidebarRecordInfo.module.scss\";\r\n\r\nexport const SidebarRecordInfo: React.FC<{ lines: string[] }> = props => (\r\n
    \r\n {props.lines.map((line, idx) => (\r\n

    \r\n ))}\r\n

    \r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/SidebarInfoSection/SidebarRecordAudit.module.scss\";\r\n\r\nexport const SidebarRecordAudit: React.FC = props => (\r\n
    {props.children}
    \r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useContext } from \"react\";\r\nimport { IInfoSubsection } from \"gui/connections/types\";\r\nimport { SidebarRecordInfo } from \"gui/Components/SidebarInfoSection/SidebarRecordInfo\";\r\nimport { SidebarRecordAudit } from \"gui/Components/SidebarInfoSection/SidebarRecordAudit\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { getRecordInfo } from \"model/selectors/RecordInfo/getRecordInfo\";\r\n\r\nexport const CSidebarInfoSection: React.FC<{\r\n activeSubsection: IInfoSubsection;\r\n}> = observer(props => {\r\n const workbench = useContext(MobXProviderContext).workbench;\r\n const recordInfo = getRecordInfo(workbench);\r\n\r\n return (\r\n <>\r\n {props.activeSubsection === IInfoSubsection.Info &&\r\n recordInfo.info.length > 0 && (\r\n \r\n )}\r\n {props.activeSubsection === IInfoSubsection.Audit && recordInfo.audit && (\r\n \r\n )}\r\n \r\n );\r\n});\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function onChatroomsListItemClick(ctx: any) {\r\n return flow(function*onChatroomsListItemClick(event: any, item: any) {\r\n try {\r\n yield*getWorkbenchLifecycle(ctx).onChatroomsListItemClick(event, item);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { WorkQueuesItem } from \"gui/Components/WorkQueues/WorkQueuesItem\";\r\nimport { flow } from \"mobx\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { getActiveScreen } from \"model/selectors/getActiveScreen\";\r\nimport { getChatrooms } from \"model/selectors/Chatrooms/getChatrooms\";\r\nimport { onChatroomsListItemClick } from \"model/actions/Chatrooms/onChatroomsListItemClick\";\r\nimport { openNewUrl } from \"model/actions/Workbench/openNewUrl\";\r\nimport { IUrlUpenMethod } from \"model/entities/types/IUrlOpenMethod\";\r\nimport { T } from \"utils/translation\";\r\n\r\n@observer\r\nexport class CChatSection extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n get sortedItems() {\r\n return getChatrooms(this.workbench).items;\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n }\r\n label={<>{T(\"New Chat\", \"new_chat\")}}\r\n onClick={(event) => {\r\n const self = this;\r\n flow(function*() {\r\n yield*openNewUrl(self.workbench)(\r\n `chatrooms/index.html#/chatroom`,\r\n IUrlUpenMethod.OrigamTab,\r\n \"New Chat\"\r\n );\r\n })();\r\n }}\r\n />\r\n {this.sortedItems.map((item) => {\r\n const activeScreen = getActiveScreen(this.workbench);\r\n const activeMenuItemId = activeScreen ? activeScreen.menuItemId : undefined;\r\n return (\r\n 0}\r\n isOpenedScreen={this.workbench.openedScreenIdSet.has(item.id)}\r\n isActiveScreen={activeMenuItemId === item.id}\r\n icon={}\r\n label={\r\n <>\r\n {item.topic}\r\n {item.unreadMessageCount > 0 && <> ({item.unreadMessageCount})}\r\n \r\n }\r\n onClick={(event) => onChatroomsListItemClick(this.workbench)(event, item)}\r\n id={item.id}\r\n />\r\n );\r\n })}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Search/SearchResults.module.scss\";\r\nimport { ISearchResult, isIMenuSearchResult } from \"model/entities/types/ISearchResult\";\r\nimport { observer } from \"mobx-react\";\r\nimport { ISearchResultGroup } from \"model/entities/types/ISearchResultGroup\";\r\nimport { observable } from \"mobx\";\r\nimport { Icon } from \"../Icon/Icon\";\r\nimport { Dropdown } from \"../Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"../Dropdown/DropdownItem\";\r\nimport { T } from \"../../../utils/translation\";\r\nimport { Dropdowner } from \"../Dropdowner/Dropdowner\";\r\nimport { getFavorites } from \"../../../model/selectors/MainMenu/getFavorites\";\r\nimport { onAddToFavoritesClicked } from \"../../connections/CMainMenu\";\r\n\r\nexport class SearchResults extends React.Component<{\r\n groups: ISearchResultGroup[];\r\n ctx: any;\r\n}> {\r\n\r\n render() {\r\n return (\r\n
    \r\n {this.props.groups.map(group =>\r\n )}\r\n
    \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nexport class ResultGroup extends React.Component<{\r\n name: string;\r\n ctx: any;\r\n results: ISearchResult[];\r\n}> {\r\n @observable\r\n isExpanded = true;\r\n\r\n onGroupClick() {\r\n this.isExpanded = !this.isExpanded;\r\n }\r\n\r\n get favorites() {\r\n return getFavorites(this.props.ctx);\r\n }\r\n\r\n render() {\r\n return (\r\n
    \r\n
    this.onGroupClick()}>\r\n {this.isExpanded ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
    \r\n {this.props.name}\r\n
    \r\n
    \r\n
    \r\n {this.isExpanded && this.props.results.map(result =>\r\n (\r\n {\r\n setDropped(true, event);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }}\r\n />\r\n )}\r\n content={({setDropped}) => (\r\n \r\n {isIMenuSearchResult(result) && !this.favorites.isInAnyFavoriteFolder(result.id) && (\r\n {\r\n setDropped(false);\r\n onAddToFavoritesClicked(this.props.ctx, result.id);\r\n }}\r\n >\r\n {T(\"Put to favourites\", \"put_to_favourites\")}\r\n \r\n )}\r\n \r\n\r\n )}\r\n />\r\n )}\r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nfunction SearchResultItem(props: {\r\n result: ISearchResult;\r\n onContextMenu?(event: any): void;\r\n refDom?: any;\r\n}) {\r\n return (\r\n
    props.result.onClick()}>\r\n \r\n
    \r\n
    {props.result.label}
    \r\n {props.result.description &&\r\n
    {props.result.description}
    \r\n }\r\n
    \r\n
    \r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nexport interface ISearchResult {\r\n id: string;\r\n label: string,\r\n description: string,\r\n iconUrl: string;\r\n onClick: () => void;\r\n}\r\n\r\nexport interface IServerSearchResult extends ISearchResult {\r\n group: string,\r\n dataSourceId: string,\r\n dataSourceLookupId: string,\r\n referenceId: string\r\n}\r\n\r\nexport interface IMenuSearchResult extends ISearchResult {\r\n type: string;\r\n}\r\n\r\nexport const isIMenuSearchResult = (o: any): o is IMenuSearchResult => \"type\" in o;\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { observable } from \"mobx\";\r\nimport { ModalWindow } from \"@origam/components\";\r\nimport { T } from \"utils/translation\";\r\nimport CS from \"gui/Components/Dialogs/DialogsCommon.module.css\";\r\nimport S from \"gui/Components/Dialogs/FavoriteFolderPropertiesDialog.module.scss\";\r\n\r\n@observer\r\nexport class FavoriteFolderPropertiesDialog extends React.Component<{\r\n title: string;\r\n name?: string;\r\n isPinned?: boolean;\r\n onCancelClick: (event: any) => void;\r\n onOkClick: (name: string, isPinned: boolean) => void;\r\n}> {\r\n @observable\r\n groupName: string = this.props.name ?? \"\";\r\n\r\n @observable\r\n isPinned: boolean = this.props.isPinned ?? false;\r\n\r\n get isInvalid() {\r\n return this.groupName === \"\";\r\n }\r\n\r\n refInput = React.createRef();\r\n\r\n onNameChanged(event: any) {\r\n this.groupName = event.target.value;\r\n }\r\n\r\n onIsPinnedClicked(event: any) {\r\n this.isPinned = event.target.checked;\r\n }\r\n\r\n componentDidMount() {\r\n this.refInput.current?.focus();\r\n }\r\n\r\n onKeydown(event: React.KeyboardEvent) {\r\n if (event.key === \"Enter\") {\r\n this.onOkClick();\r\n }\r\n }\r\n\r\n onOkClick() {\r\n if (this.isInvalid) {\r\n return;\r\n }\r\n this.props.onOkClick(this.groupName, this.isPinned);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n }\r\n buttonsLeft={null}\r\n buttonsRight={null}\r\n >\r\n
    \r\n
    \r\n
    \r\n
    {T(\"Name:\", \"group_name\")}
    \r\n this.onNameChanged(event)}\r\n onKeyDown={(event: React.KeyboardEvent) => this.onKeydown(event)}\r\n />\r\n {this.isInvalid && (\r\n
    \r\n \r\n \r\n
    \r\n
    \r\n )}\r\n
    \r\n
    \r\n
    {T(\"Pin to the Top:\", \"group_pinned\")}
    \r\n this.onIsPinnedClicked(event)}\r\n />\r\n
    \r\n
    \r\n \r\n \r\n );\r\n }\r\n}\r\n","import { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport CS from \"gui/connections/MenuComponents/HeaderButton.module.scss\";\r\nimport { T } from \"utils/translation\";\r\n\r\n@observer\r\nexport class PinButton extends React.Component<{\r\n isPinned: boolean\r\n isVisible: boolean;\r\n onClick: () => void;\r\n}> {\r\n\r\n getClass() {\r\n let className = \"fas fa-thumbtack \" + CS.headerIcon;\r\n if (!this.props.isVisible) {\r\n className += \" \" + CS.headerIconHidden;\r\n }\r\n if (this.props.isPinned) {\r\n className += \" \" + CS.headerIconActive\r\n }\r\n return className;\r\n }\r\n\r\n render() {\r\n return (\r\n this.props.onClick()}\r\n />\r\n )\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Observer, observer } from \"mobx-react\";\r\nimport React from \"react\";\r\nimport { getIsMainMenuLoading } from \"model/selectors/MainMenu/getIsMainMenuLoading\";\r\nimport { getMainMenu } from \"model/selectors/MainMenu/getMainMenu\";\r\nimport { CFavoritesMenuItem } from \"gui/connections/CMainMenu\";\r\nimport { getFavorites } from \"model/selectors/MainMenu/getFavorites\";\r\nimport { Dropdown } from \"gui/Components/Dropdown/Dropdown\";\r\nimport { DropdownItem } from \"gui/Components/Dropdown/DropdownItem\";\r\nimport { T } from \"utils/translation\";\r\nimport { Dropdowner } from \"gui/Components/Dropdowner/Dropdowner\";\r\nimport S from \"gui/connections/CFavorites.module.scss\";\r\nimport { getDialogStack } from \"model/selectors/getDialogStack\";\r\nimport { FavoriteFolderPropertiesDialog } from \"gui/Components/Dialogs/FavoriteFolderPropertiesDialog\";\r\nimport { runInFlowWithHandler } from \"utils/runInFlowWithHandler\";\r\nimport { SidebarSectionHeader } from \"gui/Components/Sidebar/SidebarSectionHeader\";\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { SidebarSection } from \"gui/Components/Sidebar/SidebarSection\";\r\nimport { SidebarSectionDivider } from \"gui/Components/Sidebar/SidebarSectionDivider\";\r\nimport { SidebarSectionBody } from \"gui/Components/Sidebar/SidebarSectionBody\";\r\nimport { FavoriteFolder, Favorites } from \"model/entities/Favorites\";\r\nimport { Draggable, Droppable } from \"react-beautiful-dnd\";\r\nimport { action, observable } from \"mobx\";\r\nimport { EditButton } from \"gui/connections/MenuComponents/EditButton\";\r\nimport { PinButton } from \"gui/connections/MenuComponents/PinButton\";\r\n\r\n@observer\r\nexport class CFavorites extends React.Component<{\r\n folder: FavoriteFolder;\r\n isActive: boolean;\r\n forceOpen?: boolean;\r\n onHeaderClick?: () => void;\r\n ctx: any;\r\n}> {\r\n favorites: Favorites;\r\n\r\n dragStateContainer = new DragStateContainer();\r\n\r\n @observable\r\n mouseInHeader = false;\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.favorites = getFavorites(this.props.ctx);\r\n }\r\n\r\n componentDidMount() {\r\n this.removeOutdatedMenuItemIds();\r\n }\r\n\r\n removeOutdatedMenuItemIds(){\r\n const mainMenu = getMainMenu(this.props.ctx);\r\n if(!mainMenu){\r\n return;\r\n }\r\n const allMenuNodes = getAllElements(mainMenu?.menuUI)\r\n\r\n const missingIds = this.props.folder.itemIds\r\n .filter(itemId => {\r\n const menuItem = allMenuNodes.find((childNode: any) => childNode.attributes[\"id\"] === itemId)\r\n return !menuItem;\r\n })\r\n\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.removeList(missingIds),\r\n });\r\n }\r\n\r\n get canBeDeleted() {\r\n return this.props.folder.id !== this.favorites.defaultFavoritesFolderId;\r\n }\r\n\r\n onCreateNewFolderClick() {\r\n const closeDialog = getDialogStack(this.props.ctx).pushDialog(\r\n \"\",\r\n {\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.createFolder(name, isPinned),\r\n });\r\n closeDialog();\r\n }}\r\n onCancelClick={() => closeDialog()}\r\n />\r\n );\r\n }\r\n\r\n onFolderPropertiesClick() {\r\n const closeDialog = getDialogStack(this.props.ctx).pushDialog(\r\n \"\",\r\n {\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.updateFolder(this.props.folder.id, name, isPinned),\r\n });\r\n closeDialog();\r\n }}\r\n onCancelClick={() => closeDialog()}\r\n />\r\n );\r\n }\r\n\r\n @action\r\n onEditClick() {\r\n this.dragStateContainer.flipEditEnabled();\r\n this.props.onHeaderClick?.();\r\n }\r\n\r\n listFromNode(node: any, level: number, isOpen: boolean) {\r\n const menuNodes = getAllElements(node)\r\n .filter(\r\n (childNode: any) =>\r\n childNode.attributes.isHidden !== \"true\" &&\r\n childNode.name !== \"Submenu\")\r\n return (\r\n (\r\n {\r\n setDropped(true, event);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }}\r\n >\r\n \r\n {(provided) => (\r\n \r\n {() => (\r\n
    \r\n {this.props.folder.itemIds\r\n .map(itemId => menuNodes.find((childNode: any) => childNode.attributes[\"id\"] === itemId))\r\n .filter(node => node)\r\n .map((node: any, index: number) =>\r\n \r\n {(provided) => (\r\n \r\n {() =>\r\n \r\n \r\n
    \r\n }\r\n
    \r\n )}\r\n \r\n )\r\n }\r\n {provided.placeholder}\r\n \r\n )}\r\n \r\n )}\r\n
    \r\n \r\n )}\r\n content={({setDropped}) => (\r\n \r\n {\r\n setDropped(false);\r\n this.onCreateNewFolderClick();\r\n }}\r\n >\r\n {T(\"Add Folder\", \"add_group\")}\r\n \r\n \r\n )}\r\n />\r\n );\r\n }\r\n\r\n renderHeader() {\r\n return (\r\n (\r\n \r\n {(provided) =>\r\n this.mouseInHeader = true}\r\n onMouseLeave={() => this.mouseInHeader = false}\r\n >\r\n }\r\n label={this.props.folder.name}\r\n onClick={() => this.props.onHeaderClick?.()}\r\n refDom={refTrigger}\r\n onContextMenu={(event) => {\r\n setDropped(true, event);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }}\r\n />\r\n \r\n {() =>\r\n
    \r\n this.favorites.setPinned(this.props.folder.id, !this.props.folder.isPinned)}\r\n />\r\n this.onEditClick()}\r\n tooltip={T(\"Edit Favourites\", \"edit_favorites\")}\r\n />\r\n
    \r\n }\r\n
    \r\n }\r\n
    \r\n )}\r\n content={({setDropped}) => (\r\n \r\n {this.canBeDeleted && (\r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.removeFolder(this.props.folder.id),\r\n });\r\n }}\r\n >\r\n {T(\"Remove Folder\", \"remove_group\")}\r\n \r\n )}\r\n {!this.props.folder.isPinned && (\r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.setPinned(this.props.folder.id, true),\r\n });\r\n }}\r\n >\r\n {T(\"Pin to the top\", \"group_pin\")}\r\n \r\n )}\r\n {this.props.folder.isPinned && (\r\n {\r\n setDropped(false);\r\n runInFlowWithHandler({\r\n ctx: this.props.ctx,\r\n action: () => this.favorites.setPinned(this.props.folder.id, false),\r\n });\r\n }}\r\n >\r\n {T(\"Unpin\", \"group_unpin\")}\r\n \r\n )}\r\n {\r\n setDropped(false);\r\n this.onCreateNewFolderClick();\r\n }}\r\n >\r\n {T(\"Put to favourites\", \"add_group\")}\r\n \r\n {\r\n setDropped(false);\r\n this.onFolderPropertiesClick();\r\n }}\r\n >\r\n {T(\"Properties\", \"group_properties\")}\r\n \r\n \r\n )}\r\n style={{height: \"auto\"}}\r\n />\r\n );\r\n }\r\n\r\n render() {\r\n const isLoading = getIsMainMenuLoading(this.props.ctx);\r\n const mainMenu = getMainMenu(this.props.ctx);\r\n\r\n if (isLoading || !mainMenu) {\r\n return null; // TODO: More intelligent menu loading indicator...\r\n }\r\n\r\n return this.props.forceOpen ? (\r\n
    \r\n \r\n {this.renderHeader()}\r\n \r\n {this.props.folder && <>{this.listFromNode(mainMenu.menuUI, 1, true)}}\r\n \r\n
    \r\n ) : (\r\n \r\n \r\n {this.renderHeader()}\r\n \r\n {this.props.folder && this.props.isActive && <>{this.listFromNode(mainMenu.menuUI, 1, true)}}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nclass DragStateContainer {\r\n\r\n private static instances: DragStateContainer[] = [];\r\n\r\n @observable\r\n editingEnabled = false;\r\n\r\n constructor() {\r\n DragStateContainer.instances.push(this);\r\n }\r\n\r\n flipEditEnabled() {\r\n if (!this.editingEnabled) {\r\n for (let instance of DragStateContainer.instances) {\r\n instance.editingEnabled = false;\r\n }\r\n }\r\n this.editingEnabled = !this.editingEnabled;\r\n }\r\n}\r\n\r\nfunction getAllElements(node: any): any {\r\n return Array.from(getAllElementsRecursive(node.elements));\r\n}\r\n\r\nfunction*getAllElementsRecursive(elements: any[]): any {\r\n for (let childNode of elements) {\r\n if (childNode.name === \"Submenu\") {\r\n yield*getAllElementsRecursive(childNode.elements);\r\n } else {\r\n yield childNode;\r\n }\r\n }\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { SidebarAlertCounter } from \"gui/Components/Sidebar/AlertCounter\";\r\nimport { LogoSection } from \"gui/Components/Sidebar/LogoSection\";\r\nimport { Sidebar } from \"gui/Components/Sidebar/Sidebar\";\r\nimport { SidebarSection } from \"gui/Components/Sidebar/SidebarSection\";\r\nimport { SidebarSectionDivider } from \"gui/Components/Sidebar/SidebarSectionDivider\";\r\nimport { SidebarSectionHeader } from \"gui/Components/Sidebar/SidebarSectionHeader\";\r\nimport React from \"react\";\r\nimport { CMainMenu } from \"gui/connections/CMainMenu\";\r\nimport { action, reaction } from \"mobx\";\r\nimport { SidebarSectionBody } from \"gui/Components/Sidebar/SidebarSectionBody\";\r\nimport { MobXProviderContext, observer, Provider } from \"mobx-react\";\r\nimport { getWorkQueuesTotalItemsCount } from \"model/selectors/WorkQueues/getWorkQueuesTotalItemCount\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { CWorkQueues } from \"gui/connections/CWorkQueues\";\r\nimport { IInfoSubsection } from \"gui/connections/types\";\r\nimport { CSidebarInfoSection } from \"gui/connections/CSidebarInfoSection\";\r\nimport { addRecordInfoExpandRequestHandler } from \"model/actions-ui/RecordInfo/addRecordInfoExpandRequestHandler\";\r\nimport { addRecordAuditExpandRequestHandler } from \"model/actions-ui/RecordInfo/addRecordAuditExpandRequestHandler\";\r\nimport { T } from \"utils/translation\";\r\nimport S from \"gui/connections/CSidebar.module.scss\";\r\nimport { getLogoUrl } from \"model/selectors/getLogoUrl\";\r\nimport { CChatSection } from \"gui/connections/CChatSection\";\r\nimport { getChatrooms } from \"model/selectors/Chatrooms/getChatrooms\";\r\nimport { getShowChat } from \"model/selectors/PortalSettings/getShowChat\";\r\nimport { getShowWorkQues } from \"model/selectors/PortalSettings/getShowWorkQues\";\r\nimport { getNotifications } from \"model/selectors/Chatrooms/getNotifications\";\r\nimport { SearchResults } from \"gui/Components/Search/SearchResults\";\r\nimport { CFavorites } from \"gui/connections/CFavorites\";\r\nimport { getFavorites } from \"model/selectors/MainMenu/getFavorites\";\r\nimport { DragDropContext } from 'react-beautiful-dnd';\r\n\r\n@observer\r\nexport class CSidebar extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n get sidebarState() {\r\n return this.workbench.sidebarState;\r\n }\r\n\r\n @action.bound handleExpandRecordAuditLog() {\r\n this.sidebarState.activeInfoSubsection = IInfoSubsection.Audit;\r\n this.sidebarState.activeSection = \"Info\";\r\n }\r\n\r\n @action.bound handleExpandRecordInfo() {\r\n this.sidebarState.activeInfoSubsection = IInfoSubsection.Info;\r\n this.sidebarState.activeSection = \"Info\";\r\n }\r\n\r\n disposers: any[] = [];\r\n\r\n componentDidMount() {\r\n this.disposers.push(\r\n addRecordInfoExpandRequestHandler(this.workbench)(this.handleExpandRecordInfo),\r\n addRecordAuditExpandRequestHandler(this.workbench)(this.handleExpandRecordAuditLog)\r\n );\r\n this.disposers.push(\r\n reaction(\r\n () => getFavorites(this.workbench).favoriteFolders,\r\n (favoriteFolders) => {\r\n const firstNonEmpty = favoriteFolders.find(\r\n (folder) => folder.itemIds.length > 0 && !folder.isPinned\r\n );\r\n if (firstNonEmpty) {\r\n this.sidebarState.activeSection = firstNonEmpty.id;\r\n }\r\n },\r\n {fireImmediately: true}\r\n )\r\n );\r\n }\r\n\r\n componentWillUnmount() {\r\n this.disposers.forEach((disposer) => disposer());\r\n }\r\n\r\n renderWorkQuesSection() {\r\n const workQueuesItemsCount = getWorkQueuesTotalItemsCount(this.workbench);\r\n return (\r\n \r\n \r\n \r\n \r\n {workQueuesItemsCount > 0 && (\r\n {workQueuesItemsCount}\r\n )}\r\n \r\n }\r\n label={<>{T(\"Work Queues\", \"work_queue_measure\")}}\r\n onClick={() => (this.sidebarState.activeSection = \"WorkQueues\")}\r\n />\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n renderChatSection(): React.ReactNode {\r\n const totalUnreadMessages = getChatrooms(this.workbench).totalItemCount;\r\n return (\r\n \r\n \r\n \r\n \r\n {totalUnreadMessages > 0 && (\r\n {totalUnreadMessages}\r\n )}\r\n \r\n }\r\n label={<>{T(\"Chat\", \"chat\")}}\r\n onClick={() => (this.sidebarState.activeSection = \"Chat\")}\r\n />\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n @action\r\n async onDragEnd(result: any) {\r\n if (!result.destination) return;\r\n\r\n let sourceFolderId = this.getIdFromDropIdentifier(result.source.droppableId);\r\n let destinationFolderId = this.getIdFromDropIdentifier(result.destination.droppableId);\r\n let itemId = this.getIdFromDropIdentifier(result.draggableId);\r\n\r\n const favorites = getFavorites(this.workbench);\r\n const destinationFolder = favorites.favoriteFolders\r\n .find(folder => folder.id === destinationFolderId)!;\r\n const sourceFolder = favorites.favoriteFolders\r\n .find(folder => folder.id === sourceFolderId)!;\r\n if (sourceFolderId === destinationFolderId) {\r\n if (result.source.index === result.destination.index) {\r\n return;\r\n }\r\n await favorites.moveItemInFolder(sourceFolder.itemIds, result.source.index, result.destination.index)\r\n return;\r\n }\r\n await favorites.moveItemBetweenFolders(itemId, sourceFolder, destinationFolder);\r\n }\r\n\r\n getIdFromDropIdentifier(droppableId: string) {\r\n let split = droppableId.split(\"_\");\r\n return split[split.length - 1]\r\n }\r\n\r\n render() {\r\n const showChat = getShowChat(this.workbench);\r\n const showWorkQues = getShowWorkQues(this.workbench);\r\n const notificationBox = getNotifications(this.workbench)?.notificationBox;\r\n const logoUrl = getLogoUrl(this.workbench);\r\n const favorites = getFavorites(this.workbench);\r\n\r\n return (\r\n \r\n \r\n
    \r\n {notificationBox ? (\r\n
    \r\n ) : (\r\n \"\"/\r\n )}\r\n
    \r\n \r\n this.onDragEnd(result)}>\r\n {favorites.favoriteFolders\r\n .filter((folder) => folder.isPinned)\r\n .map((folder) => (\r\n \r\n ))}\r\n\r\n {showWorkQues ? this.renderWorkQuesSection() : null}\r\n\r\n {showChat ? this.renderChatSection() : null}\r\n\r\n {favorites.favoriteFolders\r\n .filter((folder) => !folder.isPinned)\r\n .map((folder) => (\r\n (this.sidebarState.activeSection = folder.id)}\r\n />\r\n ))}\r\n \r\n \r\n this.sidebarState.activeSection = \"Menu\"}\r\n />\r\n \r\n \r\n \r\n \r\n }\r\n label={T(\"Info\", \"infopanel_title\")}\r\n onClick={() => (this.sidebarState.activeSection = \"Info\")}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n label={T(\"Search\", \"search_result\", this.sidebarState.resultCount)}\r\n onClick={() => (this.sidebarState.activeSection = \"Search\")}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRecordInfo } from \"model/selectors/RecordInfo/getRecordInfo\"\r\n\r\nexport function addRecordInfoExpandRequestHandler(ctx: any) {\r\n return function addRecordInfoExpandRequestHandler(handler: () => void) {\r\n return getRecordInfo(ctx).addInfoSectionExpandHandler(handler);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getRecordInfo } from \"model/selectors/RecordInfo/getRecordInfo\";\r\n\r\nexport function addRecordAuditExpandRequestHandler(ctx: any) {\r\n return function addRecordAuditExpandRequestHandler(handler: () => void) {\r\n return getRecordInfo(ctx).addAuditSectionExpandHandler(handler);\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkQueues } from \"./getWorkQueues\";\r\n\r\nexport function getWorkQueuesTotalItemsCount(ctx: any) {\r\n return getWorkQueues(ctx).totalItemCount;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getShowChat(ctx: any): boolean {\r\n return getWorkbenchLifecycle(ctx).portalSettings?.showChat ?? false;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getShowWorkQues(ctx: any): boolean {\r\n return getWorkbenchLifecycle(ctx).portalSettings?.showWorkQueues ?? false;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbenchLifecycle } from \"model/selectors/getWorkbenchLifecycle\";\r\n\r\nexport function getLogoUrl(ctx: any): string | undefined {\r\n return getWorkbenchLifecycle(ctx).logoUrl;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenHeader/ScreenHeader.module.scss\";\r\n\r\nexport class ScreenHeader extends React.Component<{\r\n isLoading?: boolean;\r\n}> {\r\n render() {\r\n return (\r\n
    \r\n {this.props.children}\r\n {(this.props.isLoading || window.localStorage.getItem(\"debugKeepProgressIndicatorsOn\")) && (\r\n
    \r\n
    \r\n
    \r\n )}\r\n
    \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenHeader/ScreenHeaderAction.module.scss\";\r\nimport cx from \"classnames\";\r\n\r\nexport class ScreenHeaderAction extends React.Component<{\r\n isActive?: boolean;\r\n className?: string;\r\n onClick?(event: any): void;\r\n}> {\r\n render() {\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenHeader/ScreenHeaderPusher.module.scss\";\r\n\r\nexport class ScreenHeaderPusher extends React.Component {\r\n render() {\r\n return
    ;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"../getWorkbench\";\r\n\r\nexport function getIsCurrentScreenFull(ctx: any) {\r\n return getWorkbench(ctx).isFullScreen;\r\n}\r\n\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getDataViewList } from \"./getDataViewList\";\r\nimport { getIsDataViewWorking } from \"../DataView/getIsDataViewWorking\";\r\nimport { getIsFormScreenWorkingDelayed } from \"./getIsFormScreenWorking\";\r\n\r\nexport function getIsScreenOrAnyDataViewWorking(ctx: any) {\r\n return (\r\n getIsFormScreenWorkingDelayed(ctx) ||\r\n Array.from(getDataViewList(ctx)).some(dataView =>\r\n getIsDataViewWorking(dataView)\r\n )\r\n );\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedScreen } from \"./getOpenedScreen\";\r\nimport { getTopmostOpenedNonDialogScreenItem } from \"./getTopmostNonDialogScreenItem\";\r\n\r\nexport function getIsTopmostNonDialogScreen(ctx: any) {\r\n const screen = getOpenedScreen(ctx);\r\n const topmostNonDialogScreen = getTopmostOpenedNonDialogScreenItem(ctx);\r\n if (screen && topmostNonDialogScreen) {\r\n return (\r\n screen.menuItemId === topmostNonDialogScreen.menuItemId &&\r\n screen.order === topmostNonDialogScreen.order\r\n );\r\n }\r\n return false;\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getOpenedNonDialogScreenItems } from \"./getOpenedNonDialogScreenItems\";\r\nimport { IOpenedScreen } from \"model/entities/types/IOpenedScreen\";\r\n\r\nexport function getTopmostOpenedNonDialogScreenItem(ctx: any): IOpenedScreen | undefined {\r\n const screens = [...getOpenedNonDialogScreenItems(ctx)];\r\n screens.sort((a, b) => b.stackPosition - a.stackPosition);\r\n return screens[0];\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/ScreenHeader/ScreenHeaderDivider.module.scss\";\r\n\r\nexport class ScreenheaderDivider extends React.Component {\r\n render() {\r\n return
    ;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { handleError } from \"model/actions/handleError\";\r\nimport { getFormScreenLifecycle } from \"model/selectors/FormScreen/getFormScreenLifecycle\";\r\n\r\nexport function onWorkflowAbortClick(ctx: any) {\r\n return flow(function*onWorkflowAbortClick(event: any) {\r\n try {\r\n const lifecycle = getFormScreenLifecycle(ctx);\r\n yield*lifecycle.onWorkflowAbortClick(event);\r\n } catch (e) {\r\n yield*handleError(ctx)(e);\r\n throw e;\r\n }\r\n });\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { Icon } from \"gui/Components/Icon/Icon\";\r\nimport { ScreenHeader } from \"gui/Components/ScreenHeader/ScreenHeader\";\r\nimport { ScreenHeaderAction } from \"gui/Components/ScreenHeader/ScreenHeaderAction\";\r\nimport { ScreenHeaderPusher } from \"gui/Components/ScreenHeader/ScreenHeaderPusher\";\r\nimport { MobXProviderContext, observer } from \"mobx-react\";\r\nimport { onFullscreenClick } from \"model/actions-ui/ScreenHeader/onFullscreenClick\";\r\nimport { IWorkbench } from \"model/entities/types/IWorkbench\";\r\nimport { getIsScreenOrAnyDataViewWorking } from \"model/selectors/FormScreen/getIsScreenOrAnyDataViewWorking\";\r\nimport { getOpenedNonDialogScreenItems } from \"model/selectors/getOpenedNonDialogScreenItems\";\r\nimport { getIsCurrentScreenFull } from \"model/selectors/Workbench/getIsCurrentScreenFull\";\r\nimport React from \"react\";\r\nimport { getIsTopmostNonDialogScreen } from \"model/selectors/getIsTopmostNonDialogScreen\";\r\nimport { ScreenheaderDivider } from \"gui/Components/ScreenHeader/ScreenHeaderDivider\";\r\nimport { onWorkflowAbortClick } from \"model/actions-ui/ScreenHeader/onWorkflowAbortClick\";\r\nimport { onWorkflowNextClick } from \"model/actions-ui/ScreenHeader/onWorkflowNextClick\";\r\n\r\nimport S from \"gui/Components/ScreenHeader/ScreenHeader.module.scss\";\r\nimport { T } from \"utils/translation\";\r\nimport { ErrorBoundaryEncapsulated } from \"gui/Components/Utilities/ErrorBoundary\";\r\nimport { IOpenedScreen } from \"model/entities/types/IOpenedScreen\";\r\n\r\n@observer\r\nexport class CScreenHeader extends React.Component {\r\n static contextType = MobXProviderContext;\r\n\r\n get workbench(): IWorkbench {\r\n return this.context.workbench;\r\n }\r\n\r\n render() {\r\n const openedScreenItems = getOpenedNonDialogScreenItems(this.workbench);\r\n const activeScreen = openedScreenItems.find((item) => getIsTopmostNonDialogScreen(item));\r\n if (!activeScreen) {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n@observer\r\nclass CScreenHeaderInner extends React.Component<{ activeScreen: IOpenedScreen }> {\r\n render() {\r\n const {activeScreen} = this.props;\r\n const {content} = activeScreen;\r\n const isFullscreen = getIsCurrentScreenFull(activeScreen);\r\n if (!content) return null;\r\n const isNextButton = content.formScreen && content.formScreen.showWorkflowNextButton;\r\n const isCancelButton = content.formScreen && content.formScreen.showWorkflowCancelButton;\r\n return (\r\n <>\r\n

    {activeScreen.formTitle}

    \r\n \r\n

    {activeScreen.formTitle}

    \r\n {(isCancelButton || isNextButton) && }\r\n {isCancelButton && (\r\n \r\n {T(\"Cancel\", \"button_cancel\")}\r\n \r\n )}\r\n {isNextButton && (\r\n \r\n {T(\"Next\", \"button_next\")}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getWorkbench } from \"model/selectors/getWorkbench\";\r\nimport { getIsCurrentScreenFull } from \"model/selectors/Workbench/getIsCurrentScreenFull\";\r\n\r\nexport function onFullscreenClick(ctx: any) {\r\n return function onFullscreenClick(event: any) {\r\n getWorkbench(ctx).setFullscreen(!getIsCurrentScreenFull(ctx));\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/Screen/ScreenContainer.module.scss\";\r\n\r\nexport const ScreenContainer: React.FC = props => (\r\n
    {props.children}
    \r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React, { useContext } from \"react\";\r\nimport S from \"gui/Components/TabbedView/TabbedViewPanel.module.scss\";\r\nimport cx from \"classnames\";\r\nimport { CtxPanelVisibility } from \"gui/contexts/GUIContexts\";\r\n\r\nexport const TabbedViewPanel: React.FC<{ isActive: boolean }> = props => {\r\n const ctxPanelVisibility = useContext(CtxPanelVisibility);\r\n return (\r\n \r\n
    \r\n {props.children}\r\n
    \r\n \r\n );\r\n};\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/TabbedView/TabbedView.module.scss\";\r\n\r\nexport const TabbedView: React.FC = props => (\r\n
    {props.children}
    \r\n);\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/TabbedView/TabbedViewPanelsContainer.module.scss\";\r\n\r\nexport const TabbedViewPanelsContainer: React.FC = props => (\r\n
    {props.children}
    \r\n);","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport { observer, Observer } from \"mobx-react\";\r\nimport { TabbedViewPanel } from \"gui/Components/TabbedView/TabbedViewPanel\";\r\nimport { TabbedViewHandleRow } from \"gui/Components/TabbedView/TabbedViewHandleRow\";\r\nimport { TabbedViewHandle } from \"gui/Components/TabbedView/TabbedViewHandle\";\r\nimport { action, observable } from \"mobx\";\r\nimport { TabbedView } from \"gui/Components/TabbedView/TabbedView\";\r\nimport { findUIChildren } from \"xmlInterpreters/screenXml\";\r\nimport { TabbedViewPanelsContainer } from \"gui/Components/TabbedView/TabbedViewPanelsContainer\";\r\nimport { IDataView } from \"model/entities/types/IDataView\";\r\nimport { getTablePanelView } from \"model/selectors/TablePanelView/getTablePanelView\";\r\nimport { findStopping } from \"xmlInterpreters/xmlUtils\";\r\n\r\n@observer\r\nexport class CScreenSectionTabbedView extends React.Component<{\r\n boxes: any[];\r\n nextNode: (node: any) => React.ReactNode;\r\n dataViewMap: Map\r\n}> {\r\n @observable activePanelId: string =\r\n this.props.boxes.length > 0 ? this.props.boxes[0].attributes.Id : \"\";\r\n\r\n @action.bound activateTab(tabId: string) {\r\n this.activePanelId = tabId;\r\n const activeBox = this.props.boxes.find(box => box.attributes[\"Id\"] === tabId);\r\n const firstGridId = this.getFirstGridId(activeBox)\r\n if (firstGridId) {\r\n const dataView = this.props.dataViewMap.get(firstGridId);\r\n const tablePanelView = getTablePanelView(dataView);\r\n tablePanelView.triggerOnFocusTable();\r\n }\r\n }\r\n\r\n getFirstGridId(box: any) {\r\n return findStopping(box, (node) => node?.attributes?.Type === \"Grid\")\r\n .map(element => element.attributes[\"Id\"])\r\n .find(element => element)\r\n }\r\n\r\n render() {\r\n const {boxes} = this.props;\r\n return (\r\n \r\n \r\n {boxes.map((box) => (\r\n \r\n {() => (\r\n this.activateTab(box.attributes.Id)}\r\n >\r\n {box.attributes.Name}\r\n \r\n )}\r\n \r\n ))}\r\n \r\n \r\n {boxes.map((box) => (\r\n \r\n {() => (\r\n \r\n {findUIChildren(box).map((child) => this.props.nextNode(child))}\r\n \r\n )}\r\n \r\n ))}\r\n \r\n \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { getApi } from \"model/selectors/getApi\";\r\n\r\nexport function saveSplitPanelConfiguration(ctx: any) {\r\n return function*saveSplitPanelConfiguration(\r\n modelInstanceId: string,\r\n position: number\r\n ) {\r\n yield getApi(ctx).saveSplitPanelConfiguration({\r\n InstanceId: modelInstanceId,\r\n Position: position\r\n });\r\n };\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\n\r\nexport function panelSizeRatioToServerValue(sizeRatio: number) {\r\n return Math.round(sizeRatio * 1000_000);\r\n}\r\n\r\nexport function serverValueToPanelSizeRatio(serverStoredSizeRatio: number | undefined) {\r\n\r\n const panelPositionRatio = serverStoredSizeRatio\r\n ? serverStoredSizeRatio / 1000_000\r\n : 0.5;\r\n\r\n if (panelPositionRatio < 0.1 || panelPositionRatio > 0.9) return 0.5; // this was either on old value representing the position in pixels or some error\r\n return panelPositionRatio;\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport { flow } from \"mobx\";\r\nimport { saveSplitPanelConfiguration } from \"model/actions/FormScreen/saveSplitPanelConfiguration\";\r\nimport { getFormScreen } from \"model/selectors/FormScreen/getFormScreen\";\r\nimport { panelSizeRatioToServerValue } from \"./splitterPositionToServerValue\";\r\n\r\nexport function onSplitterPositionChangeFinished(ctx: any) {\r\n return flow(function*onSplitterPositionChangeFinished(\r\n modelInstanceId: string,\r\n sizeRatio: number\r\n ) {\r\n let panelSizeRatioServerValue = panelSizeRatioToServerValue(sizeRatio);\r\n getFormScreen(ctx).setPanelSize(modelInstanceId, panelSizeRatioServerValue);\r\n yield*saveSplitPanelConfiguration(ctx)(modelInstanceId, panelSizeRatioServerValue);\r\n });\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"./Box.module.css\";\r\n\r\nexport class Box extends React.Component {\r\n render() {\r\n return
    {this.props.children}
    ;\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"./Label.module.css\";\r\n\r\nexport class Label extends React.Component<{ height?: number; text: string }> {\r\n render() {\r\n return (\r\n
    \r\n {this.props.text}\r\n
    \r\n );\r\n }\r\n}\r\n","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from './VBox.module.scss';\r\n\r\nexport class VBox extends React.Component<{\r\n height?: number\r\n}> {\r\n getVBoxStyle() {\r\n if (this.props.height !== undefined) {\r\n return {\r\n flexShrink: 0,\r\n height: this.props.height\r\n };\r\n } else {\r\n return {\r\n flexGrow: 1\r\n };\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n
    \r\n {this.props.children}\r\n
    \r\n );\r\n }\r\n}","/*\r\nCopyright 2005 - 2021 Advantage Solutions, s. r. o.\r\n\r\nThis file is part of ORIGAM (http://www.origam.org).\r\n\r\nORIGAM is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nORIGAM is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License\r\nalong with ORIGAM. If not, see .\r\n*/\r\n\r\nimport React from \"react\";\r\nimport S from \"gui/Components/WorkflowFinishedPanel/WorkflowFinishedPanel.module.scss\";\r\nimport { T } from \"utils/translation\";\r\n\r\nexport const WorkflowFinishedPanel: React.FC<{\r\n isCloseButton: boolean;\r\n isRepeatButton: boolean;\r\n onCloseClick?(event: any): void;\r\n onRepeatClick?(event: any): void;\r\n message: string;\r\n}> = (props) => (\r\n
    \r\n {props.isRepeatButton && }\r\n {props.isCloseButton && }\r\n {/*