@topconsultnpm/sdkui-react-beta 6.13.67 → 6.13.68

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.
@@ -102,6 +102,20 @@ const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings
102
102
  }
103
103
  }
104
104
  };
105
+ useEffect(() => {
106
+ if (!qd)
107
+ return;
108
+ const handleKeyDown = async (e) => {
109
+ if (e.key === 'Enter') {
110
+ e.preventDefault();
111
+ await searchAsync(qd, showAdvancedSearch);
112
+ }
113
+ };
114
+ window.addEventListener('keydown', handleKeyDown);
115
+ return () => {
116
+ window.removeEventListener('keydown', handleKeyDown);
117
+ };
118
+ }, [qd, showAdvancedSearch]);
105
119
  const isMobile = deviceType === DeviceType.MOBILE;
106
120
  return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, allowMaximize: !isMobile, onMaximize: isMobile ? undefined : onMaximizePanel, onHeaderDoubleClick: isMobile ? undefined : onMaximizePanel, onBack: onBack, keepActiveState: keepStatePanelIsActive, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
107
121
  _jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false }), items: [
@@ -4,13 +4,12 @@ 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, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck } from '../../../helper';
7
+ import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck } 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';
11
11
  import { TMColors } from '../../../utils/theme';
12
12
  import { StyledModalContainer, StyledBadge, StyledMultiViewPanel } from '../../base/Styled';
13
- import ShowAlert from '../../base/TMAlert';
14
13
  import TMButton from '../../base/TMButton';
15
14
  import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
16
15
  import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
@@ -342,7 +341,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
342
341
  , {
343
342
  // allowMultipleSelection={allowMultipleSelection}
344
343
  inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
345
- _jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(TMButton, { btnStyle: 'icon', caption: 'Firma e marca', icon: _jsx(IconSignature, { color: 'white' }), onClick: () => { ShowAlert({ message: "TODO Firma e marca ", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
344
+ _jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
346
345
  setIsOpenBatchUpdate(false);
347
346
  }, onSavedCallbackAsync: async () => {
348
347
  setIsOpenBatchUpdate(false);
@@ -14,6 +14,7 @@ export declare class UserSettings {
14
14
  fullTextSettings: FullTextSettings;
15
15
  searchSettings: SearchSettings;
16
16
  themeSettings: ThemeSettings;
17
+ constructor(skipCssUpdate?: boolean);
17
18
  /** Load settings from local storage or other sources */
18
19
  static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
19
20
  /** Save settings to local storage or other sources */
@@ -29,7 +30,7 @@ export declare class ThemeSettings {
29
30
  fontSize: string;
30
31
  gridSettings: DataGridSettings;
31
32
  gutters: number;
32
- constructor();
33
+ constructor(skipCssUpdate?: boolean);
33
34
  }
34
35
  export declare class SearchSettings {
35
36
  invoiceRetrieveFormat: InvoiceRetrieveFormats;
@@ -8,7 +8,7 @@ export const clearDcmtsFileCache = () => { dcmtsFileCachePreview.clear(); dcmtsF
8
8
  export const removeDcmtsFileCache = (key) => { dcmtsFileCachePreview.delete(key); dcmtsFileCacheDownload.delete(key); };
9
9
  export const isDcmtFileInCache = (key) => dcmtsFileCachePreview.has(key);
10
10
  export class UserSettings {
11
- constructor() {
11
+ constructor(skipCssUpdate = false) {
12
12
  this.archiveID = undefined;
13
13
  this.landingPage = 'dashboard'; // TODO: se usiamo LandingPages errore sulle dipendenze.
14
14
  this.userID = undefined;
@@ -16,7 +16,8 @@ export class UserSettings {
16
16
  this.archivingSettings = new ArchivingSettings();
17
17
  this.fullTextSettings = new FullTextSettings();
18
18
  this.searchSettings = new SearchSettings();
19
- this.themeSettings = new ThemeSettings();
19
+ this.themeSettings = new ThemeSettings(true);
20
+ this.themeSettings = new ThemeSettings(skipCssUpdate);
20
21
  }
21
22
  /** Load settings from local storage or other sources */
22
23
  static LoadSettings(userID, archiveID) {
@@ -26,7 +27,7 @@ export class UserSettings {
26
27
  // Load settings from local storage
27
28
  const loadedSettings = LocalStorageService.getItem(`userSettings_${archiveID}_${userID}`);
28
29
  // Merge loaded settings with default settings
29
- const defaultSettings = new UserSettings();
30
+ const defaultSettings = new UserSettings(true);
30
31
  const settings = Object.assign(defaultSettings, loadedSettings);
31
32
  // Ensure userID and archiveID are set
32
33
  settings.userID = userID;
@@ -44,7 +45,7 @@ export class UserSettings {
44
45
  if (!settings.userID || !settings.archiveID) {
45
46
  throw new Error('User ID and Archive ID are required to save settings.');
46
47
  }
47
- const defaultSettings = new UserSettings();
48
+ const defaultSettings = new UserSettings(true);
48
49
  const filteredSettings = Object.fromEntries(Object.entries(settings).filter(([key, value]) => {
49
50
  const defaultValue = defaultSettings[key];
50
51
  return JSON.stringify(value) !== JSON.stringify(defaultValue);
@@ -61,12 +62,14 @@ export class DataGridSettings {
61
62
  }
62
63
  }
63
64
  export class ThemeSettings {
64
- constructor() {
65
+ constructor(skipCssUpdate = false) {
65
66
  this.fontSize = FontSize.defaultFontSizeInPixel;
66
67
  this.gridSettings = new DataGridSettings();
67
68
  this.gutters = Gutters.getGutters();
68
69
  // Automatically update the CSS variable for font size
69
- document.documentElement.style.setProperty('--base-font-size', this.fontSize);
70
+ if (!skipCssUpdate) {
71
+ document.documentElement.style.setProperty('--base-font-size', this.fontSize);
72
+ }
70
73
  }
71
74
  }
72
75
  export class SearchSettings {
@@ -113,7 +116,7 @@ export class AdvancedSettings {
113
116
  }
114
117
  export class SDKUI_Globals {
115
118
  }
116
- SDKUI_Globals.userSettings = new UserSettings();
119
+ SDKUI_Globals.userSettings = new UserSettings(true);
117
120
  function createProxy(obj, saveCallback, rootObj) {
118
121
  const root = rootObj || obj; // Use the provided root object or default to the current object
119
122
  return new Proxy(obj, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.13.67",
3
+ "version": "6.13.68",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -42,7 +42,7 @@
42
42
  "lib"
43
43
  ],
44
44
  "dependencies": {
45
- "@topconsultnpm/sdk-ts-beta": "^6.13.8",
45
+ "@topconsultnpm/sdk-ts-beta": "6.13.8",
46
46
  "buffer": "^6.0.3",
47
47
  "devextreme": "24.2.6",
48
48
  "devextreme-react": "24.2.6",