@topconsultnpm/sdkui-react-beta 6.15.7 → 6.15.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
18
18
  // custom options
19
19
  dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel = false, showLoadPanel = true, showSearchPanel = true, searchPanelToolbarPosition = 'before', counterConfig = { show: false, items: new Map() },
20
20
  // events and callbacks
21
- onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, columnChooser, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
21
+ onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, onKeyDown, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, columnChooser, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
22
22
  // other properties
23
23
  disabled = false, autoNavigateToFocusedRow = true, columnResizingMode = 'widget', columnHidingEnabled = true, columnAutoWidth = true, allowColumnResizing = true, allowColumnReordering = true, showBorders = true, showRowLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines === 1, showColumnLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines === 1, showColumnHeaders = true, rowAlternationEnabled = false, wordWrapEnabled = false, noDataText,
24
24
  // styles
@@ -155,7 +155,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
155
155
  // main properties
156
156
  keyExpr: keyExpr, dataSource: dataSource, selectedRowKeys: selectedRowKeys, focusedRowEnabled: focusedRowEnabled, hoverStateEnabled: hoverStateEnabled,
157
157
  // events and callbacks
158
- onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onOptionChanged: onOptionChanged, onContentReady: onContentReady, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange,
158
+ onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onOptionChanged: onOptionChanged, onContentReady: onContentReady, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange, onKeyDown: onKeyDown,
159
159
  // other properties
160
160
  disabled: disabled, autoNavigateToFocusedRow: autoNavigateToFocusedRow, focusedRowKey: focusedRowKey, columnHidingEnabled: columnHidingEnabled, columnResizingMode: columnResizingMode, columnAutoWidth: columnAutoWidth, allowColumnResizing: allowColumnResizing, allowColumnReordering: allowColumnReordering, showBorders: showBorders, showRowLines: showRowLines, showColumnLines: showColumnLines, showColumnHeaders: showColumnHeaders, rowAlternationEnabled: rowAlternationEnabled, wordWrapEnabled: wordWrapEnabled, noDataText: noDataText,
161
161
  // styles
@@ -11,7 +11,7 @@ interface ITMSearchProps {
11
11
  focusedWorkingGroupId?: number;
12
12
  fetchTreeFileSystemForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
13
13
  fetchArchivedDocumentsForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
14
- onSearchCompleted?: (tid?: number, did?: number) => void;
14
+ onFocusedItemChanged?: (tid?: number, did?: number) => void;
15
15
  }
16
16
  declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
17
17
  export default TMSearch;
@@ -18,7 +18,7 @@ var TMSearchViews;
18
18
  TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
19
19
  TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
20
20
  })(TMSearchViews || (TMSearchViews = {}));
21
- const TMSearch = ({ onSearchCompleted = undefined, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup }) => {
21
+ const TMSearch = ({ onFocusedItemChanged = undefined, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup }) => {
22
22
  const [allSQDs, setAllSQDs] = useState([]);
23
23
  const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
24
24
  const [currentSQD, setCurrentSQD] = useState();
@@ -202,7 +202,7 @@ const TMSearch = ({ onSearchCompleted = undefined, inputTID, inputSqdID, isExper
202
202
  if (newResult.length <= 0) {
203
203
  setCurrentSearchView(TMSearchViews.Search);
204
204
  }
205
- }, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup, onSearchCompleted: onSearchCompleted })] }));
205
+ }, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup, onFocusedItemChanged: onFocusedItemChanged })] }));
206
206
  };
207
207
  export default TMSearch;
208
208
  const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
@@ -28,7 +28,7 @@ interface ITMSearchResultProps {
28
28
  focusedWorkingGroupId?: number;
29
29
  fetchTreeFileSystemForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
30
30
  fetchArchivedDocumentsForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
31
- onSearchCompleted?: (tid?: number, did?: number) => void;
31
+ onFocusedItemChanged?: (tid?: number, did?: number) => void;
32
32
  }
33
33
  declare const TMSearchResult: React.FC<ITMSearchResultProps>;
34
34
  export default TMSearchResult;
@@ -4,7 +4,7 @@ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, M
4
4
  import styled from 'styled-components';
5
5
  import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
6
6
  import { ContextMenu } from 'devextreme-react';
7
- import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck } from '../../../helper';
7
+ import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck, IconInfo } from '../../../helper';
8
8
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
9
9
  import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
10
10
  import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
@@ -59,7 +59,7 @@ const orderByName = (array) => {
59
59
  return 1;
60
60
  } return 0; });
61
61
  };
62
- const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onTaskCreateRequest, onFileOpened, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup, onSearchCompleted = undefined }) => {
62
+ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onTaskCreateRequest, onFileOpened, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup, onFocusedItemChanged = undefined }) => {
63
63
  const [id, setID] = useState('');
64
64
  const [showApprovePopup, setShowApprovePopup] = useState(false);
65
65
  const [showRejectPopup, setShowRejectPopup] = useState(false);
@@ -110,10 +110,10 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
110
110
  }, [searchResults]);
111
111
  //Added for connector
112
112
  useEffect(() => {
113
- if (!onSearchCompleted || !currentDcmt)
113
+ if (!onFocusedItemChanged || !currentDcmt)
114
114
  return;
115
- onSearchCompleted(currentDcmt.did, currentDcmt.tid);
116
- }, [currentDcmt, onSearchCompleted]);
115
+ onFocusedItemChanged(currentDcmt.did, currentDcmt.tid);
116
+ }, [currentDcmt, onFocusedItemChanged]);
117
117
  useEffect(() => {
118
118
  setFocusedItem(undefined);
119
119
  setSelectedItems([]);
@@ -487,6 +487,23 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
487
487
  return;
488
488
  setSelectedRowKeys(inputSelectedItemsRowIndex);
489
489
  }, [inputSelectedItems]);
490
+ const onKeyDown = useCallback((e) => {
491
+ if (e.event?.key === 'Delete') {
492
+ TMMessageBoxManager.show({
493
+ buttons: [ButtonNames.YES, ButtonNames.NO],
494
+ message: _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [SDKUI_Localizator.SaveQuestion, " (", selectedRowKeys.length, ")", _jsx(TMTooltip, { content: _jsxs("div", { style: { whiteSpace: 'nowrap' }, children: [_jsx("span", { children: SDKUI_Localizator.RemoveSelectedItemsTemporarily }), _jsx("br", {}), _jsx("span", { children: SDKUI_Localizator.UIOnlyEffectWarning })] }), children: _jsx(IconInfo, { color: TMColors.primary }) })] }),
495
+ onButtonClick(e) {
496
+ if (e !== ButtonNames.YES)
497
+ return;
498
+ if (selectedRowKeys.length === 0)
499
+ return;
500
+ setDataSource((prevDataSource = []) => prevDataSource.filter((data) => !selectedRowKeys.includes(data.rowIndex)));
501
+ setSelectedRowKeys([]);
502
+ setFocusedItem(undefined);
503
+ },
504
+ });
505
+ }
506
+ }, [selectedRowKeys]);
490
507
  const cellRender = useCallback((cellData, dataDomain, dataListID, dataListViewMode) => {
491
508
  if (!cellData || cellData.value === undefined)
492
509
  return null;
@@ -637,7 +654,7 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
637
654
  setShowFilterPanel(!!e.value);
638
655
  }
639
656
  }, []);
640
- return _jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: focusedItem?.rowIndex, showSearchPanel: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, counterConfig: { show: true } });
657
+ return _jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: focusedItem?.rowIndex, showSearchPanel: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } });
641
658
  };
642
659
  //#region TMSearchResultSelector
643
660
  const StyledItemTemplate = styled.div `
@@ -376,6 +376,7 @@ export declare class SDKUI_Localizator {
376
376
  static get RelationType(): "Art der Beziehung" | "Relation type" | "Tipo de relación" | "Type de relation" | "Tipo de relacionamento" | "Tipo di relazione";
377
377
  static get RemoveFromWorkgroup(): string;
378
378
  static get RemoveNamedPreferredCredentials(): "Möchten Sie die Anmeldedaten '{{0}}' entfernen, die als bevorzugt festgelegt wurden?" | "Do you want to remove the '{{0}}' credentials set as preferred?" | "¿Quieres eliminar las credenciales '{{0}}' configuradas como preferidas?" | "Voulez-vous supprimer les identifiants '{{0}}' définis comme préférés ?" | "Deseja remover as credenciais '{{0}}' definidas como preferidas?" | "Vuoi rimuovere le credenziali '{{0}}' impostate come preferite?";
379
+ static get RemoveSelectedItemsTemporarily(): string;
379
380
  static get RememberCredentials(): "Anmeldedaten merken" | "Remember credentials" | "Recordar credenciales" | "Se souvenir des identifiants" | "Lembrar credenciais" | "Ricorda credenziali";
380
381
  static get Request(): string;
381
382
  static get RequestTo(): string;
@@ -464,6 +465,7 @@ export declare class SDKUI_Localizator {
464
465
  static get UBLViewFormats_ER_PDF(): "ER Style Sheet (PDF)" | "Hoja de estilo ER (PDF)" | "Feuille de style ER (PDF)" | "Folha de estilo ER (PDF)" | "Foglio di stile ER (PDF)";
465
466
  static get UBLViewFormats_NSO_HTML(): "NSO Style Sheet (HTML)" | "Hoja de estilo NSO (HTML)" | "Feuille de style NSO (HTML)" | "Folha de estilo NSO (HTML)" | "Foglio di stile NSO (HTML)";
466
467
  static get UBLViewFormats_NSO_PDF(): "NSO Style Sheet (PDF)" | "Hoja de estilo NSO (PDF)" | "Feuille de style NSO (PDF)" | "Folha de estilo NSO (PDF)" | "Foglio di stile NSO (PDF)";
468
+ static get UIOnlyEffectWarning(): string;
467
469
  static get Undo(): "Änderungen rückgängig machen" | "Undo" | "Anular modificaciones" | "Annule les modifications" | "Anular alterações" | "Annulla modifiche";
468
470
  static get Update(): "Bearbeiten" | "Update" | "Modificar" | "Modifie" | "Modificação" | "Modifica";
469
471
  static get UpdateCompletedSuccessfully(): "Aktualisierung erfolgreich abgeschlossen" | "Update completed successfully" | "Actualización completada con éxito" | "Mise à jour terminée avec succès" | "Atualização concluída com sucesso" | "Aggiornamento completato con successo";
@@ -3718,6 +3718,16 @@ export class SDKUI_Localizator {
3718
3718
  return "Vuoi rimuovere le credenziali '{{0}}' impostate come preferite?";
3719
3719
  }
3720
3720
  }
3721
+ static get RemoveSelectedItemsTemporarily() {
3722
+ switch (this._cultureID) {
3723
+ case CultureIDs.De_DE: return "Ausgewählte Elemente vorübergehend entfernen?";
3724
+ case CultureIDs.En_US: return "Temporarily remove selected items?";
3725
+ case CultureIDs.Es_ES: return "¿Eliminar temporalmente los elementos seleccionados?";
3726
+ case CultureIDs.Fr_FR: return "Supprimer temporairement les éléments sélectionnés ?";
3727
+ case CultureIDs.Pt_PT: return "Remover temporariamente os itens selecionados?";
3728
+ default: return "Rimuovere temporaneamente gli elementi selezionati?";
3729
+ }
3730
+ }
3721
3731
  static get RememberCredentials() {
3722
3732
  switch (this._cultureID) {
3723
3733
  case CultureIDs.De_DE: return "Anmeldedaten merken";
@@ -4599,6 +4609,16 @@ export class SDKUI_Localizator {
4599
4609
  default: return "Foglio di stile NSO (PDF)";
4600
4610
  }
4601
4611
  }
4612
+ static get UIOnlyEffectWarning() {
4613
+ switch (this._cultureID) {
4614
+ case CultureIDs.De_DE: return "Diese Aktion wirkt sich nur auf die Benutzeroberfläche aus. Wenn Sie die Seite aktualisieren, werden die Daten wiederhergestellt.";
4615
+ case CultureIDs.En_US: return "This action only affects the user interface. If you refresh the page, the data will be restored.";
4616
+ case CultureIDs.Es_ES: return "Esta acción solo afecta a la interfaz de usuario. Si actualizas la página, los datos se restaurarán.";
4617
+ case CultureIDs.Fr_FR: return "Cette action affecte uniquement l'interface utilisateur. Si vous actualisez la page, les données seront restaurées.";
4618
+ case CultureIDs.Pt_PT: return "Esta ação afeta apenas a interface do usuário. Se você atualizar a página, os dados serão restaurados.";
4619
+ default: return "Questa azione ha effetto solo sull'interfaccia utente. Se aggiorni la pagina, i dati verranno ripristinati.";
4620
+ }
4621
+ }
4602
4622
  static get Undo() {
4603
4623
  switch (this._cultureID) {
4604
4624
  case CultureIDs.De_DE: return "Änderungen rückgängig machen";
@@ -194,7 +194,7 @@ export function useDcmtOperations() {
194
194
  return;
195
195
  if (inputDcmts.length <= 0)
196
196
  return;
197
- let file = await OpenFileDialog();
197
+ let file = inputDcmts[0].FILE ?? await OpenFileDialog();
198
198
  if (!file)
199
199
  return;
200
200
  setShowWaitPanel(true);
package/lib/ts/types.d.ts CHANGED
@@ -69,6 +69,7 @@ export type TID_MID = {
69
69
  export type DcmtInfo = {
70
70
  TID: number;
71
71
  DID: number;
72
+ FILE?: File;
72
73
  FILEEXT?: string;
73
74
  fileFormat?: FileFormats;
74
75
  metadataValues?: MetadataValueDescriptorEx[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.15.7",
3
+ "version": "6.15.9",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",