@topconsultnpm/sdkui-react 6.19.0-dev2.3 → 6.19.0-dev2.30

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.
Files changed (100) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
  2. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +187 -0
  3. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +11 -0
  4. package/lib/components/NewComponents/ContextMenu/hooks.js +48 -0
  5. package/lib/components/NewComponents/ContextMenu/index.d.ts +2 -0
  6. package/lib/components/NewComponents/ContextMenu/index.js +1 -0
  7. package/lib/components/NewComponents/ContextMenu/styles.d.ts +27 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.js +308 -0
  9. package/lib/components/NewComponents/ContextMenu/types.d.ts +26 -0
  10. package/lib/components/NewComponents/ContextMenu/types.js +1 -0
  11. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
  12. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +370 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
  14. package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +38 -0
  16. package/lib/components/NewComponents/FloatingMenuBar/styles.js +267 -0
  17. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +30 -0
  18. package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
  19. package/lib/components/NewComponents/Notification/Notification.d.ts +4 -0
  20. package/lib/components/NewComponents/Notification/Notification.js +60 -0
  21. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +8 -0
  22. package/lib/components/NewComponents/Notification/NotificationContainer.js +33 -0
  23. package/lib/components/NewComponents/Notification/index.d.ts +2 -0
  24. package/lib/components/NewComponents/Notification/index.js +2 -0
  25. package/lib/components/NewComponents/Notification/styles.d.ts +21 -0
  26. package/lib/components/NewComponents/Notification/styles.js +180 -0
  27. package/lib/components/NewComponents/Notification/types.d.ts +18 -0
  28. package/lib/components/NewComponents/Notification/types.js +1 -0
  29. package/lib/components/base/TMCustomButton.js +79 -26
  30. package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
  31. package/lib/components/base/TMDataGridExportForm.js +9 -3
  32. package/lib/components/base/TMFileManager.js +12 -3
  33. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
  34. package/lib/components/base/TMFileManagerDataGridView.js +11 -2
  35. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
  36. package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
  37. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
  38. package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
  39. package/lib/components/base/TMTooltip.d.ts +1 -1
  40. package/lib/components/base/TMTooltip.js +1 -1
  41. package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
  42. package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
  43. package/lib/components/choosers/TMMetadataChooser.js +28 -7
  44. package/lib/components/editors/TMDateBox.d.ts +1 -1
  45. package/lib/components/features/documents/TMDcmtForm.js +312 -56
  46. package/lib/components/features/documents/TMRelationViewer.js +56 -23
  47. package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
  48. package/lib/components/features/search/TMSearch.js +2 -2
  49. package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
  50. package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
  51. package/lib/components/features/search/TMSearchResult.js +91 -10
  52. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
  53. package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
  54. package/lib/components/features/tasks/TMTaskForm.js +5 -4
  55. package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
  56. package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
  57. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  58. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
  59. package/lib/components/features/tasks/TMTasksUtils.js +18 -3
  60. package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
  61. package/lib/components/features/tasks/TMTasksView.js +12 -6
  62. package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
  63. package/lib/components/features/workflow/diagram/DiagramItemForm.js +11 -6
  64. package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
  65. package/lib/components/forms/TMResultDialog.js +8 -2
  66. package/lib/components/grids/TMBlogsPost.d.ts +1 -0
  67. package/lib/components/grids/TMBlogsPost.js +20 -4
  68. package/lib/components/grids/TMBlogsPostUtils.js +5 -3
  69. package/lib/components/grids/TMRecentsManager.js +1 -1
  70. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  71. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
  72. package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
  73. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
  74. package/lib/components/layout/panelManager/types.d.ts +1 -0
  75. package/lib/components/pages/TMPage.js +1 -1
  76. package/lib/components/query/TMQuerySummary.d.ts +1 -0
  77. package/lib/components/query/TMQuerySummary.js +3 -3
  78. package/lib/components/settings/SettingsAppearance.js +5 -5
  79. package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
  80. package/lib/components/viewers/TMMidViewer.d.ts +1 -1
  81. package/lib/components/viewers/TMTidViewer.d.ts +1 -1
  82. package/lib/helper/GlobalStyles.d.ts +2 -0
  83. package/lib/helper/GlobalStyles.js +10 -0
  84. package/lib/helper/Globalization.d.ts +1 -0
  85. package/lib/helper/Globalization.js +30 -0
  86. package/lib/helper/SDKUI_Localizator.d.ts +34 -2
  87. package/lib/helper/SDKUI_Localizator.js +342 -22
  88. package/lib/helper/TMCustomSearchBar.js +1 -1
  89. package/lib/helper/TMIcons.d.ts +2 -1
  90. package/lib/helper/TMIcons.js +4 -1
  91. package/lib/helper/TMUtils.d.ts +1 -4
  92. package/lib/helper/TMUtils.js +18 -23
  93. package/lib/helper/dcmtsHelper.d.ts +2 -1
  94. package/lib/helper/dcmtsHelper.js +19 -13
  95. package/lib/helper/helpers.js +2 -1
  96. package/lib/helper/index.d.ts +1 -0
  97. package/lib/helper/index.js +1 -0
  98. package/lib/hooks/useRelatedDocuments.js +35 -26
  99. package/lib/ts/types.d.ts +1 -1
  100. package/package.json +8 -8
@@ -24,20 +24,26 @@ export const isXMLFileExt = (fileExt) => {
24
24
  }
25
25
  };
26
26
  /*utility functions for TMCustomButton*/
27
- export const processButtonAttributes = (args, formData) => args && formData ? splitArguments(replaceCustomButtonAttributes(args, formDataMap(formData))) : undefined;
28
- const replaceCustomButtonAttributes = (input, attributes) => {
29
- const matches = Array.from(input.matchAll(/@\w+/g));
30
- return matches
31
- .map(([match]) => `${match}=${attributes[match.slice(1)] ?? ''}`)
32
- .join(';') + ';';
33
- };
34
- const formDataMap = (data) => data.reduce((acc, md) => {
35
- const key = md.md?.name;
27
+ export const processButtonAttributes = (args, formData) => args && formData ? formDataMap(formData, args) : undefined;
28
+ export const processSelectedItems = (selectedItems) => selectedItems?.map(item => {
29
+ const tid = item.TID;
30
+ if (!tid)
31
+ return item;
32
+ const prefix = `${tid}_`;
33
+ const prefixLength = prefix.length;
34
+ return Object.keys(item).reduce((acc, key) => {
35
+ acc[key.startsWith(prefix) ? key.substring(prefixLength) : key] = item[key];
36
+ return acc;
37
+ }, {});
38
+ });
39
+ const formDataMap = (data, args) => data.reduce((acc, md) => {
40
+ const matches = Array.from(args.matchAll(/@\w+/g));
41
+ const keys = matches.map(([match]) => match.slice(1));
42
+ if (!keys.includes(md.md?.name || ''))
43
+ return acc;
44
+ //const key = md.md?.name;
45
+ const key = md?.mid; // inserisco il mid come chiave
36
46
  if (key && md.value)
37
47
  acc[key] = md.value;
38
48
  return acc;
39
49
  }, {});
40
- const splitArguments = (input) => Object.fromEntries(Array.from(input.matchAll(/@?(\w+)=([^;]+)/g), ([, key, value]) => [
41
- key,
42
- isNaN(Number(value)) ? value : Number(value),
43
- ]));
@@ -633,7 +633,8 @@ export const highlightText = (text, searchValue) => {
633
633
  export const renderHighlightedText = (text, searchText, isSelected) => {
634
634
  if (!searchText)
635
635
  return text;
636
- const regex = new RegExp(`(${searchText})`, 'gi');
636
+ const escapedSearchText = searchText.trim().replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
637
+ const regex = new RegExp(`(${escapedSearchText})`, 'gi');
637
638
  return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
638
639
  };
639
640
  export function versionAndBuildtypeInfo(module) {
@@ -10,3 +10,4 @@ export * from './TMUtils';
10
10
  export * from './TMCommandsContextMenu';
11
11
  export * from './TMConditionalWrapper';
12
12
  export * from './TMToppyMessage';
13
+ export * from './GlobalStyles';
@@ -10,3 +10,4 @@ export * from './TMUtils';
10
10
  export * from './TMCommandsContextMenu';
11
11
  export * from './TMConditionalWrapper';
12
12
  export * from './TMToppyMessage';
13
+ export * from './GlobalStyles';
@@ -195,9 +195,18 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
195
195
  }
196
196
  }, [selectedSearchResult?.fromTID]);
197
197
  const getFocusedItem = useCallback(() => {
198
- if (!focusedItem || currentSearchResults.length !== 1)
198
+ if (!focusedItem)
199
199
  return undefined;
200
- return { mdList: currentSearchResults[0].dtdResult?.rows?.[focusedItem?.rowIndex ?? 0], mids: currentSearchResults[0].selectMIDs ?? [] };
200
+ if (currentSearchResults.length === 1) {
201
+ return { mdList: currentSearchResults[0].dtdResult?.rows?.[focusedItem?.rowIndex ?? 0], mids: currentSearchResults[0].selectMIDs ?? [] };
202
+ }
203
+ const matchingSearchResult = currentSearchResults.find(res => res.fromTID == focusedItem?.TID);
204
+ if (!matchingSearchResult)
205
+ return undefined;
206
+ return {
207
+ mdList: matchingSearchResult.dtdResult?.rows?.[focusedItem?.rowIndex ?? 0],
208
+ mids: matchingSearchResult.selectMIDs ?? []
209
+ };
201
210
  }, [focusedItem, currentSearchResults]);
202
211
  const fetchAssociatedValues = useCallback((mid) => {
203
212
  let mdList = getFocusedItem();
@@ -222,8 +231,8 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
222
231
  const showNoRelationsAlert = (type) => {
223
232
  ShowAlert({
224
233
  message: type === 'detail'
225
- ? "Nessun documento di dettaglio trovato per l'archiviazione."
226
- : "Nessun documento di master trovato per l'archiviazione.",
234
+ ? SDKUI_Localizator.NoDetailDocumentFoundForArchiving
235
+ : SDKUI_Localizator.NoMasterDocumentFoundForArchiving,
227
236
  mode: 'info',
228
237
  title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
229
238
  duration: 5000
@@ -232,8 +241,8 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
232
241
  const showNoAssociationsAlert = (type) => {
233
242
  ShowAlert({
234
243
  message: type === 'detail'
235
- ? "Nessuna associazione trovata per i documenti di dettaglio."
236
- : "Nessuna associazione trovata per i documenti di master.",
244
+ ? SDKUI_Localizator.NoMatchFoundForDetailDocuments
245
+ : SDKUI_Localizator.NoMatchFoundForMasterDocuments,
237
246
  mode: 'info',
238
247
  title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
239
248
  duration: 5000
@@ -254,8 +263,8 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
254
263
  if (dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed) {
255
264
  ShowAlert({
256
265
  message: type === 'detail'
257
- ? "Non hai i permessi per archiviare documenti di dettaglio di questo tipo."
258
- : "Non hai i permessi per archiviare documenti master di questo tipo.",
266
+ ? SDKUI_Localizator.YouDoNotHavePermissionsToArchiveDetailDocumentsOfThisType
267
+ : SDKUI_Localizator.YouDoNotHavePermissionsToArchiveMasterDocumentsOfThisType,
259
268
  mode: 'warning',
260
269
  title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
261
270
  duration: 5000
@@ -365,10 +374,10 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
365
374
  if (!focusedItem?.TID || !focusedItem?.DID) {
366
375
  ShowAlert({
367
376
  message: isPairing
368
- ? "Nessun documento selezionato per l'abbinamento molti a molti."
369
- : "Nessun documento selezionato per il disabbinamento molti a molti.",
377
+ ? SDKUI_Localizator.NoDocumentSelectedForManyToManyMatching
378
+ : SDKUI_Localizator.NoDocumentSelectedForManyToManyUnmatching,
370
379
  mode: 'warning',
371
- title: isPairing ? 'Abbina documenti molti a molti' : 'Disabbina documenti molti a molti',
380
+ title: isPairing ? SDKUI_Localizator.MatchManyDocumentsManyToMany : SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
372
381
  duration: 5000
373
382
  });
374
383
  return;
@@ -384,10 +393,10 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
384
393
  if (!qd) {
385
394
  ShowAlert({
386
395
  message: isPairing
387
- ? "Nessuna query di recupero associata alla relazione di abbinamento molti a molti."
388
- : "Nessuna query di recupero associata alla relazione di disabbinamento molti a molti.",
396
+ ? SDKUI_Localizator.NoManyToManyMatchingRelationshipAssociatedWithRetrievalQuery
397
+ : SDKUI_Localizator.NoManyToManyUnmatchingRelationshipAssociatedWithRetrievalQuery,
389
398
  mode: 'warning',
390
- title: isPairing ? 'Abbina documenti molti a molti' : 'Disabbina documenti molti a molti',
399
+ title: isPairing ? SDKUI_Localizator.MatchManyDocumentsManyToMany : SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
391
400
  duration: 5000
392
401
  });
393
402
  return;
@@ -490,9 +499,9 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
490
499
  if (!isPairing) {
491
500
  if (!pairedDocumentsResult?.dtdResult?.rows || pairedDocumentsResult.dtdResult.rows.length === 0) {
492
501
  ShowAlert({
493
- message: "Nessun documento abbinato trovato.",
502
+ message: SDKUI_Localizator.NoDocumentMatchFound,
494
503
  mode: 'warning',
495
- title: 'Disabbina documenti molti a molti',
504
+ title: SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
496
505
  duration: 5000
497
506
  });
498
507
  return;
@@ -514,9 +523,9 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
514
523
  const sq = await searchEngine.SearchByIDAsync(qd);
515
524
  if (!sq?.dtdResult?.rows || sq.dtdResult.rows.length === 0) {
516
525
  ShowAlert({
517
- message: "Nessun documento trovato.",
526
+ message: SDKUI_Localizator.NoDcmtFound,
518
527
  mode: 'warning',
519
- title: 'Abbina documenti molti a molti',
528
+ title: SDKUI_Localizator.MatchManyDocumentsManyToMany,
520
529
  duration: 5000
521
530
  });
522
531
  openPairSearchModal(relation, targetTID, qd);
@@ -539,9 +548,9 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
539
548
  };
540
549
  if (filteredRows.length === 0) {
541
550
  ShowAlert({
542
- message: "Nessun documento da abbinare. Tutti i documenti risultanti sono già abbinati.",
551
+ message: SDKUI_Localizator.NoDocumentToMatch,
543
552
  mode: 'warning',
544
- title: 'Abbina documenti molti a molti',
553
+ title: SDKUI_Localizator.MatchManyDocumentsManyToMany,
545
554
  duration: 5000
546
555
  });
547
556
  openPairSearchModal(relation, targetTID, qd);
@@ -560,10 +569,10 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
560
569
  if (!relations.some(r => r.relationType === RelationTypes.ManyToMany)) {
561
570
  ShowAlert({
562
571
  message: isPairing
563
- ? "Nessuna relazione di abbinamento molti a molti definita nel sistema."
564
- : "Nessuna relazione di disabbinamento molti a molti definita nel sistema.",
572
+ ? SDKUI_Localizator.NoManyToManyMatchingRelationshipDefined
573
+ : SDKUI_Localizator.NoManyToManyUnmatchingRelationshipDefined,
565
574
  mode: 'warning',
566
- title: isPairing ? 'Abbina documenti molti a molti' : 'Disabbina documenti molti a molti',
575
+ title: isPairing ? SDKUI_Localizator.MatchManyDocumentsManyToMany : SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
567
576
  duration: 5000
568
577
  });
569
578
  return;
@@ -572,10 +581,10 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
572
581
  if (!manyToManyRels.some(r => r.masterTID === selectedSearchResult?.fromTID || r.detailTID === selectedSearchResult?.fromTID)) {
573
582
  ShowAlert({
574
583
  message: isPairing
575
- ? "Nessuna relazione di abbinamento molti a molti definita per il tipo di documento selezionato."
576
- : "Nessuna relazione di disabbinamento molti a molti definita per il tipo di documento selezionato.",
584
+ ? SDKUI_Localizator.NoManyToManyMatchingRelationshipDefinedForSelectedDocumentType
585
+ : SDKUI_Localizator.NoManyToManyUnmatchingRelationshipDefinedForSelectedDocumentType,
577
586
  mode: 'warning',
578
- title: isPairing ? 'Abbina documenti molti a molti' : 'Disabbina documenti molti a molti',
587
+ title: isPairing ? SDKUI_Localizator.MatchManyDocumentsManyToMany : SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
579
588
  duration: 5000
580
589
  });
581
590
  return;
package/lib/ts/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
  import { FileFormats, ITopMediaSession, MetadataDescriptor, MetadataValueDescriptor, UserDescriptor, ValidationItem } from "@topconsultnpm/sdk-ts";
3
3
  import { ITMEditorBase } from "../components/base/TMEditorBase";
4
- import { IColumnProps } from "devextreme-react/cjs/data-grid";
4
+ import { IColumnProps } from "devextreme-react/data-grid";
5
5
  export declare enum FormModes {
6
6
  None = 0,
7
7
  Create = 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.19.0-dev2.3",
3
+ "version": "6.19.0-dev2.30",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -21,12 +21,12 @@
21
21
  "@storybook/react-vite": "^10.1.0",
22
22
  "@types/htmlparser2": "^3.10.7",
23
23
  "@types/node": "^20.2.5",
24
- "@types/react": "^18.2.7",
25
- "@types/react-dom": "^18.2.4",
24
+ "@types/react": "^18.3.3",
25
+ "@types/react-dom": "^18.3.3",
26
26
  "copyfiles": "^2.4.1",
27
27
  "esbuild": "^0.25.0",
28
- "react": "^18.2.0",
29
- "react-dom": "^18.2.0",
28
+ "react": "^18.3.1",
29
+ "react-dom": "^18.3.1",
30
30
  "storybook": "^10.1.0",
31
31
  "typescript": "^5.9.3",
32
32
  "vite": "^6.1.1"
@@ -39,10 +39,10 @@
39
39
  "lib"
40
40
  ],
41
41
  "dependencies": {
42
- "@topconsultnpm/sdk-ts": "6.19.0-dev2.2",
42
+ "@topconsultnpm/sdk-ts": "6.19.0-dev2.4",
43
43
  "buffer": "^6.0.3",
44
- "devextreme": "25.1.4",
45
- "devextreme-react": "25.1.4",
44
+ "devextreme": "25.1.7",
45
+ "devextreme-react": "25.1.7",
46
46
  "exceljs": "^4.4.0",
47
47
  "htmlparser2": "^10.0.0",
48
48
  "react-router-dom": "^6.15.0",