@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.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +187 -0
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +11 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +48 -0
- package/lib/components/NewComponents/ContextMenu/index.d.ts +2 -0
- package/lib/components/NewComponents/ContextMenu/index.js +1 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +27 -0
- package/lib/components/NewComponents/ContextMenu/styles.js +308 -0
- package/lib/components/NewComponents/ContextMenu/types.d.ts +26 -0
- package/lib/components/NewComponents/ContextMenu/types.js +1 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +370 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +38 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +267 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +30 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
- package/lib/components/NewComponents/Notification/Notification.d.ts +4 -0
- package/lib/components/NewComponents/Notification/Notification.js +60 -0
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +8 -0
- package/lib/components/NewComponents/Notification/NotificationContainer.js +33 -0
- package/lib/components/NewComponents/Notification/index.d.ts +2 -0
- package/lib/components/NewComponents/Notification/index.js +2 -0
- package/lib/components/NewComponents/Notification/styles.d.ts +21 -0
- package/lib/components/NewComponents/Notification/styles.js +180 -0
- package/lib/components/NewComponents/Notification/types.d.ts +18 -0
- package/lib/components/NewComponents/Notification/types.js +1 -0
- package/lib/components/base/TMCustomButton.js +79 -26
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +28 -7
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +312 -56
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
- package/lib/components/features/search/TMSearchResult.js +91 -10
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
- package/lib/components/features/tasks/TMTaskForm.js +5 -4
- package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
- package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
- package/lib/components/features/tasks/TMTasksUtils.js +18 -3
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +12 -6
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +11 -6
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/grids/TMBlogsPost.d.ts +1 -0
- package/lib/components/grids/TMBlogsPost.js +20 -4
- package/lib/components/grids/TMBlogsPostUtils.js +5 -3
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +3 -3
- package/lib/components/settings/SettingsAppearance.js +5 -5
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Localizator.d.ts +34 -2
- package/lib/helper/SDKUI_Localizator.js +342 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +2 -1
- package/lib/helper/TMIcons.js +4 -1
- package/lib/helper/TMUtils.d.ts +1 -4
- package/lib/helper/TMUtils.js +18 -23
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +19 -13
- package/lib/helper/helpers.js +2 -1
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +1 -1
- 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 ?
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
]));
|
package/lib/helper/helpers.js
CHANGED
|
@@ -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
|
|
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) {
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED
|
@@ -195,9 +195,18 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
195
195
|
}
|
|
196
196
|
}, [selectedSearchResult?.fromTID]);
|
|
197
197
|
const getFocusedItem = useCallback(() => {
|
|
198
|
-
if (!focusedItem
|
|
198
|
+
if (!focusedItem)
|
|
199
199
|
return undefined;
|
|
200
|
-
|
|
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
|
-
?
|
|
226
|
-
:
|
|
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
|
-
?
|
|
236
|
-
:
|
|
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
|
-
?
|
|
258
|
-
:
|
|
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
|
-
?
|
|
369
|
-
:
|
|
377
|
+
? SDKUI_Localizator.NoDocumentSelectedForManyToManyMatching
|
|
378
|
+
: SDKUI_Localizator.NoDocumentSelectedForManyToManyUnmatching,
|
|
370
379
|
mode: 'warning',
|
|
371
|
-
title: isPairing ?
|
|
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
|
-
?
|
|
388
|
-
:
|
|
396
|
+
? SDKUI_Localizator.NoManyToManyMatchingRelationshipAssociatedWithRetrievalQuery
|
|
397
|
+
: SDKUI_Localizator.NoManyToManyUnmatchingRelationshipAssociatedWithRetrievalQuery,
|
|
389
398
|
mode: 'warning',
|
|
390
|
-
title: isPairing ?
|
|
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:
|
|
502
|
+
message: SDKUI_Localizator.NoDocumentMatchFound,
|
|
494
503
|
mode: 'warning',
|
|
495
|
-
title:
|
|
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:
|
|
526
|
+
message: SDKUI_Localizator.NoDcmtFound,
|
|
518
527
|
mode: 'warning',
|
|
519
|
-
title:
|
|
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:
|
|
551
|
+
message: SDKUI_Localizator.NoDocumentToMatch,
|
|
543
552
|
mode: 'warning',
|
|
544
|
-
title:
|
|
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
|
-
?
|
|
564
|
-
:
|
|
572
|
+
? SDKUI_Localizator.NoManyToManyMatchingRelationshipDefined
|
|
573
|
+
: SDKUI_Localizator.NoManyToManyUnmatchingRelationshipDefined,
|
|
565
574
|
mode: 'warning',
|
|
566
|
-
title: isPairing ?
|
|
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
|
-
?
|
|
576
|
-
:
|
|
584
|
+
? SDKUI_Localizator.NoManyToManyMatchingRelationshipDefinedForSelectedDocumentType
|
|
585
|
+
: SDKUI_Localizator.NoManyToManyUnmatchingRelationshipDefinedForSelectedDocumentType,
|
|
577
586
|
mode: 'warning',
|
|
578
|
-
title: isPairing ?
|
|
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/
|
|
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
|
+
"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.
|
|
25
|
-
"@types/react-dom": "^18.
|
|
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.
|
|
29
|
-
"react-dom": "^18.
|
|
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.
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.19.0-dev2.4",
|
|
43
43
|
"buffer": "^6.0.3",
|
|
44
|
-
"devextreme": "25.1.
|
|
45
|
-
"devextreme-react": "25.1.
|
|
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",
|