@topconsultnpm/sdkui-react 6.19.0-test.1 → 6.19.0-test2
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/assets/IconsS4t/add.svg +12 -12
- package/lib/assets/IconsS4t/aggiorna.svg +18 -18
- package/lib/assets/IconsS4t/bookmark.svg +42 -42
- package/lib/assets/IconsS4t/cancella.svg +15 -15
- package/lib/assets/IconsS4t/check-box.svg +19 -19
- package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/down.svg +28 -28
- package/lib/assets/IconsS4t/edit-file.svg +19 -19
- package/lib/assets/IconsS4t/edita.svg +32 -32
- package/lib/assets/IconsS4t/firma.svg +19 -19
- package/lib/assets/IconsS4t/icona_download.svg +16 -16
- package/lib/assets/IconsS4t/info.svg +51 -51
- package/lib/assets/IconsS4t/left.svg +20 -20
- package/lib/assets/IconsS4t/line.svg +40 -40
- package/lib/assets/IconsS4t/more.svg +19 -19
- package/lib/assets/IconsS4t/plus.svg +23 -23
- package/lib/assets/IconsS4t/printer.svg +49 -49
- package/lib/assets/IconsS4t/radio-on-button.svg +25 -25
- package/lib/assets/IconsS4t/rectangle.svg +41 -41
- package/lib/assets/IconsS4t/redo.svg +19 -19
- package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -40
- package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/right.svg +22 -22
- package/lib/assets/IconsS4t/searchbar.svg +21 -21
- package/lib/assets/IconsS4t/text-box.svg +36 -36
- package/lib/assets/IconsS4t/tick.svg +8 -8
- package/lib/assets/IconsS4t/trash-white.svg +10 -10
- package/lib/assets/IconsS4t/undo.svg +19 -19
- package/lib/assets/IconsS4t/up.svg +32 -32
- package/lib/assets/IconsS4t/video-streaming.svg +2 -2
- package/lib/assets/IconsS4t/zoom-in.svg +58 -58
- package/lib/assets/IconsS4t/zoom-out.svg +56 -56
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/six.svg +3 -3
- package/lib/assets/thumbnails/index.ts +39 -39
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/Styled.js +302 -302
- package/lib/components/base/TMAccordion.js +43 -43
- package/lib/components/base/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMAreaManager.js +23 -23
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +136 -136
- package/lib/components/base/TMClosableList.js +46 -46
- package/lib/components/base/TMConfirm.js +20 -20
- package/lib/components/base/TMContextMenu.js +4 -4
- package/lib/components/base/TMContextMenuOLD.js +25 -25
- package/lib/components/base/TMCounterBar.js +32 -32
- package/lib/components/base/TMCounterContainer.js +30 -30
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +90 -35
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMDropDownMenu.js +24 -24
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- 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/TMFileManagerUtils.js +19 -19
- package/lib/components/base/TMFloatingToolbar.js +34 -34
- package/lib/components/base/TMLayout.js +44 -44
- package/lib/components/base/TMList.js +34 -34
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +79 -34
- package/lib/components/base/TMPanel.js +57 -57
- package/lib/components/base/TMPopUp.js +186 -117
- package/lib/components/base/TMProgressBar.js +20 -20
- package/lib/components/base/TMResizableMenu.js +28 -28
- package/lib/components/base/TMRightSidebar.js +40 -40
- package/lib/components/base/TMSpinner.js +121 -121
- package/lib/components/base/TMTab.js +11 -11
- package/lib/components/base/TMToggleButton.js +36 -36
- package/lib/components/base/TMToolbarCard.js +35 -35
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/base/TMTreeView.js +16 -16
- package/lib/components/base/TMUserAvatar.js +7 -7
- package/lib/components/base/TMWaitPanel.js +30 -24
- package/lib/components/choosers/TMCultureIDPicker.js +35 -35
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +54 -54
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMCheckBox.js +24 -24
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/editors/TMDropDown.js +43 -43
- package/lib/components/editors/TMEditorStyled.js +71 -71
- package/lib/components/editors/TMHtmlContentDisplay.js +16 -16
- package/lib/components/editors/TMLocalizedTextBox.js +31 -31
- package/lib/components/editors/TMMetadataValues.js +62 -21
- package/lib/components/editors/TMRadioButton.js +39 -39
- package/lib/components/editors/TMSummary.js +39 -39
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +56 -22
- package/lib/components/editors/TMTextBox.js +53 -23
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +21 -9
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +321 -62
- package/lib/components/features/documents/TMDcmtIcon.js +17 -12
- package/lib/components/features/documents/TMDcmtPreview.js +75 -38
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +52 -52
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -14
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -58
- package/lib/components/features/search/TMSearchResult.js +160 -35
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +117 -60
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/search/TMTreeSelector.js +66 -66
- package/lib/components/features/tasks/TMTaskForm.js +42 -36
- 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/wg/TMWGsCopyMoveForm.js +9 -9
- package/lib/components/features/workflow/TMWorkflowPopup.js +44 -44
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +29 -29
- package/lib/components/features/workflow/diagram/ConnectionForm.js +10 -10
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +57 -57
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +40 -35
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +12 -12
- package/lib/components/features/workflow/diagram/RecipientList.js +39 -39
- package/lib/components/features/workflow/diagram/WFDiagram.js +317 -285
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +4 -4
- package/lib/components/forms/Login/Chooser.js +35 -35
- package/lib/components/forms/Login/Menu.js +22 -22
- package/lib/components/forms/Login/SelectBox.js +46 -46
- package/lib/components/forms/Login/TMLoginForm.js +14 -14
- package/lib/components/forms/Login/TextBox.js +57 -57
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/forms/TMSaveForm.js +3 -11
- package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
- package/lib/components/grids/TMBlogAttachments.js +10 -5
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +100 -39
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +32 -11
- package/lib/components/grids/TMRecentsManager.js +51 -51
- package/lib/components/grids/TMValidationItemsList.js +48 -48
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +14 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +36 -35
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryEditor.js +17 -17
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +15 -15
- package/lib/components/settings/SettingsAppearance.js +9 -1
- package/lib/components/sidebar/TMCommandsPanel.js +10 -10
- package/lib/components/sidebar/TMHeader.js +307 -307
- package/lib/components/sidebar/TMSidebar.js +24 -24
- package/lib/components/sidebar/TMSidebarItem.js +21 -21
- 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/components/wizard/TMStepIndicator.js +102 -102
- package/lib/components/wizard/TMWizard.js +29 -29
- 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_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Globals.js +9 -1
- package/lib/helper/SDKUI_Localizator.d.ts +50 -2
- package/lib/helper/SDKUI_Localizator.js +502 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +4 -1
- package/lib/helper/TMIcons.js +14 -2
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +33 -32
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +227 -60
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +12 -17
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +10 -6
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +3 -1
- package/package.json +54 -54
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
- package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RelationCacheService, RelationTypes } from "@topconsultnpm/sdk-ts";
|
|
1
|
+
import { RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
/** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
|
|
3
3
|
export const hasDetailRelations = async (mTID) => {
|
|
4
4
|
let allRelations = await RelationCacheService.GetAllAsync();
|
|
@@ -24,20 +24,59 @@ export const isXMLFileExt = (fileExt) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
/*utility functions for TMCustomButton*/
|
|
27
|
-
export const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
export const getButtonAttributes = (args, formData, selectedItems) => args && formData ? formDataMap(formData, args, selectedItems) : undefined;
|
|
28
|
+
const getSelectedItems = (selectedItems) => selectedItems && selectedItems.map(item => item["DID"]) || [];
|
|
29
|
+
export const getSelectedItem = (args, formData, item) => {
|
|
30
|
+
//converto item in formData
|
|
31
|
+
const formDataConverted = [];
|
|
32
|
+
for (const key in item) {
|
|
33
|
+
const md = formData?.find(md => `${item["TID"]}_${md.mid}` === key);
|
|
34
|
+
if (md) { // aggiungo solo i metadati
|
|
35
|
+
const name = md.md?.name || "";
|
|
36
|
+
formDataConverted.push({ md: { name: name }, value: item[key] });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return args && formDataConverted ?
|
|
40
|
+
formDataMap(formDataConverted, args, []) : undefined;
|
|
41
|
+
};
|
|
42
|
+
const formDataMap = (data, args, selectedItems) => {
|
|
43
|
+
const session = SDK_Globals.tmSession;
|
|
44
|
+
const sessionDescr = session?.SessionDescr;
|
|
45
|
+
const result = {};
|
|
46
|
+
// Helper per estrarre il valore di un campo
|
|
47
|
+
const getParamValue = (fieldName) => {
|
|
48
|
+
const md = data.find(md => md.md?.name === fieldName);
|
|
49
|
+
switch (fieldName) {
|
|
50
|
+
case 'SelectedDIDs': return getSelectedItems(selectedItems);
|
|
51
|
+
case 'AuthenticationMode': return sessionDescr?.authenticationMode ?? null;
|
|
52
|
+
case 'ArchiveID': return sessionDescr?.archiveID ?? null;
|
|
53
|
+
case 'CultureID': return sessionDescr?.cultureID ?? null;
|
|
54
|
+
case 'Domain': return sessionDescr?.domain ?? null;
|
|
55
|
+
case 'UserID': return sessionDescr?.userID ?? null;
|
|
56
|
+
case 'UserName': return sessionDescr?.userName ?? null;
|
|
57
|
+
case 'Session': return session ?? null;
|
|
58
|
+
default: return md?.value;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Regex per catturare: chiave=[...] o chiave={...} o {@campo}
|
|
62
|
+
const keyValueRegex = /(\w+)=\[([^\]]+)\]|(\w+)=\{@?([^}]+)\}|\{@([^}]+)\}/g;
|
|
63
|
+
for (const match of args.matchAll(keyValueRegex)) {
|
|
64
|
+
if (match[1]) {
|
|
65
|
+
// Formato: chiave=[{@campo} testo {@campo} ...]
|
|
66
|
+
const key = match[1];
|
|
67
|
+
const content = match[2].replace(/\{@([^}]+)\}/g, (_, fieldName) => data.find(md => md.md?.name === fieldName)?.value ?? '');
|
|
68
|
+
result[key] = content;
|
|
69
|
+
}
|
|
70
|
+
else if (match[3]) {
|
|
71
|
+
// Formato: chiave={@campo} o chiave={valore}
|
|
72
|
+
const key = match[3];
|
|
73
|
+
const value = match[4];
|
|
74
|
+
result[key] = value.startsWith('@') ? getParamValue(value.substring(1)) : value;
|
|
75
|
+
}
|
|
76
|
+
else if (match[5]) {
|
|
77
|
+
// Formato: {@campo}
|
|
78
|
+
result[match[5]] = getParamValue(match[5]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
33
82
|
};
|
|
34
|
-
const formDataMap = (data) => data.reduce((acc, md) => {
|
|
35
|
-
const key = md.md?.name;
|
|
36
|
-
if (key && md.value)
|
|
37
|
-
acc[key] = md.value;
|
|
38
|
-
return acc;
|
|
39
|
-
}, {});
|
|
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.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const TABLET_WIDTH = 1024;
|
|
|
6
6
|
declare const MOBILE_WIDTH = 640;
|
|
7
7
|
declare const calcResponsiveDirection: (deviceType: DeviceType, desktopDir: "horizontal" | "vertical", tabletDir: "horizontal" | "vertical", mobileDir: "horizontal" | "vertical") => "horizontal" | "vertical";
|
|
8
8
|
declare const openApps: (appModule: AppModules, tmSession: ITopMediaSession, appRoutes?: any[]) => Promise<void>;
|
|
9
|
-
export declare const setSDK_GlobalsInfoAsync: (tms: ITopMediaSession | undefined) => Promise<ITopMediaSession>;
|
|
9
|
+
export declare const setSDK_GlobalsInfoAsync: (tms: ITopMediaSession | undefined) => Promise<ITopMediaSession | undefined>;
|
|
10
10
|
declare const calcResponsiveSizes: (deviceType: DeviceType | undefined, desktopSize: string, tabletSize: string, mobileSize: string) => string;
|
|
11
11
|
declare const getColor: (color: ColorsType) => string;
|
|
12
12
|
/**
|
package/lib/helper/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Colors } from "../utils/theme";
|
|
3
3
|
import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
|
4
|
-
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SystemMIDs, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SetGlobalsInfoAsync, SystemMIDs, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts";
|
|
5
5
|
import { Buffer } from 'buffer';
|
|
6
6
|
import { buildTypes, FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
7
7
|
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
@@ -37,22 +37,13 @@ const openApps = async (appModule, tmSession, appRoutes) => {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
export const setSDK_GlobalsInfoAsync = async (tms) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
SDK_Globals.tmSession.AutoRefresh = true;
|
|
47
|
-
if (SDK_Globals.license == undefined) {
|
|
48
|
-
try {
|
|
49
|
-
SDK_Globals.license = await tmSessionNew.NewLicenseEngine().RetrieveAsync();
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
TMExceptionBoxManager.show({ title: 'Errore caricamento licenza', exception: e });
|
|
53
|
-
}
|
|
40
|
+
try {
|
|
41
|
+
return await SetGlobalsInfoAsync(tms);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
TMExceptionBoxManager.show({ exception: e.message });
|
|
45
|
+
return undefined;
|
|
54
46
|
}
|
|
55
|
-
return tmSessionNew;
|
|
56
47
|
};
|
|
57
48
|
const calcResponsiveSizes = (deviceType, desktopSize, tabletSize, mobileSize) => {
|
|
58
49
|
if (deviceType === DeviceType.DESKTOP)
|
|
@@ -480,6 +471,9 @@ export const extensionHandler = (fileExt) => {
|
|
|
480
471
|
case 'xml.p7m.tsd': return FileExtensionHandler.READY_TO_SHOW;
|
|
481
472
|
case 'pdf': return FileExtensionHandler.READY_TO_SHOW;
|
|
482
473
|
case 'txt': return FileExtensionHandler.READY_TO_SHOW;
|
|
474
|
+
case 'config':
|
|
475
|
+
case 'cfg':
|
|
476
|
+
case 'json': return FileExtensionHandler.READY_TO_SHOW;
|
|
483
477
|
default: return FileExtensionHandler.NONE;
|
|
484
478
|
}
|
|
485
479
|
};
|
|
@@ -633,7 +627,8 @@ export const highlightText = (text, searchValue) => {
|
|
|
633
627
|
export const renderHighlightedText = (text, searchText, isSelected) => {
|
|
634
628
|
if (!searchText)
|
|
635
629
|
return text;
|
|
636
|
-
const
|
|
630
|
+
const escapedSearchText = searchText.trim().replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
631
|
+
const regex = new RegExp(`(${escapedSearchText})`, 'gi');
|
|
637
632
|
return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
|
|
638
633
|
};
|
|
639
634
|
export function versionAndBuildtypeInfo(module) {
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export declare function useDcmtOperations(): {
|
|
|
12
12
|
waitPanelTextSecondary: string;
|
|
13
13
|
waitPanelValueSecondary: number;
|
|
14
14
|
waitPanelMaxValueSecondary: number;
|
|
15
|
-
downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined
|
|
15
|
+
downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>;
|
|
16
16
|
getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
|
|
17
17
|
file: File | undefined;
|
|
18
18
|
isFromCache: boolean;
|
|
@@ -20,12 +20,15 @@ export function useDcmtOperations() {
|
|
|
20
20
|
const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
|
|
21
21
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
22
22
|
const { OpenFileDialog } = useFileDialog();
|
|
23
|
-
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded) => {
|
|
23
|
+
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false) => {
|
|
24
24
|
if (inputDcmts === undefined)
|
|
25
25
|
return;
|
|
26
26
|
if (inputDcmts.length <= 0)
|
|
27
27
|
return;
|
|
28
|
-
|
|
28
|
+
const fileExtLower = inputDcmts[0]?.FILEEXT?.toLowerCase();
|
|
29
|
+
const needsForceDownload = fileExtLower?.includes('p7m') || fileExtLower === 'msg';
|
|
30
|
+
const shouldShowConfirm = !skipConfirmation;
|
|
31
|
+
if (inputDcmts.length === 1 && shouldShowConfirm && (downloadMode === "openInNewWindow" || (downloadMode === "download" && needsForceDownload))) {
|
|
29
32
|
if (!inputDcmts[0].FILEEXT)
|
|
30
33
|
return;
|
|
31
34
|
let readyToShow = extensionHandler(inputDcmts[0].FILEEXT) === FileExtensionHandler.READY_TO_SHOW;
|
|
@@ -93,7 +96,8 @@ export function useDcmtOperations() {
|
|
|
93
96
|
else {
|
|
94
97
|
const alink2 = document.createElement('a');
|
|
95
98
|
alink2.href = fileURL;
|
|
96
|
-
|
|
99
|
+
const downloadFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
|
|
100
|
+
alink2.download = downloadFileName;
|
|
97
101
|
alink2.target = "_blank";
|
|
98
102
|
alink2.rel = "noreferrer";
|
|
99
103
|
alink2.click();
|
|
@@ -182,11 +186,11 @@ export function useDcmtOperations() {
|
|
|
182
186
|
TMExceptionBoxManager.show({ exception: err });
|
|
183
187
|
}
|
|
184
188
|
};
|
|
185
|
-
const downloadDcmtsAsync = async (inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments) => {
|
|
189
|
+
const downloadDcmtsAsync = async (inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments, skipConfirmation = false) => {
|
|
186
190
|
switch (downloadType) {
|
|
187
|
-
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded);
|
|
191
|
+
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation);
|
|
188
192
|
case DownloadTypes.Attachment: return await _downloadAttachmentsAsync(inputDcmts, confirmAttachments);
|
|
189
|
-
default: return await _downloadDcmtsAsync(inputDcmts);
|
|
193
|
+
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation);
|
|
190
194
|
}
|
|
191
195
|
};
|
|
192
196
|
const uploadDcmtsAsync = async (inputDcmts, operationTitle, operType, actionAfterOperationAsync) => {
|
|
@@ -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,
|
|
@@ -112,6 +112,7 @@ export type TaskContext = {
|
|
|
112
112
|
dossier?: {
|
|
113
113
|
id: number;
|
|
114
114
|
name: string;
|
|
115
|
+
origin?: string;
|
|
115
116
|
};
|
|
116
117
|
document?: {
|
|
117
118
|
tid: number;
|
|
@@ -172,6 +173,7 @@ export interface ITMSaveFormBaseProps {
|
|
|
172
173
|
customTooltipSaveButton?: string;
|
|
173
174
|
showBackButton?: boolean;
|
|
174
175
|
showUndoButton?: boolean;
|
|
176
|
+
showCloseButton?: boolean;
|
|
175
177
|
showWarningsCount?: boolean;
|
|
176
178
|
showErrorCount?: boolean;
|
|
177
179
|
hasNavigation?: boolean;
|
package/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.19.0-
|
|
4
|
-
"description": "",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"clean": "powershell Remove-Item lib/ -recurse",
|
|
8
|
-
"copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
|
|
9
|
-
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
|
-
"tm-watch": "tsc -w",
|
|
11
|
-
"tm-publish": "npm publish --tag latest",
|
|
12
|
-
"storybook": "storybook dev -p 6006",
|
|
13
|
-
"build-storybook": "storybook build"
|
|
14
|
-
},
|
|
15
|
-
"author": "TopConsult",
|
|
16
|
-
"license": "ISC",
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@chromatic-com/storybook": "^4.1.3",
|
|
19
|
-
"@storybook/addon-docs": "^10.1.0",
|
|
20
|
-
"@storybook/addon-onboarding": "^10.1.0",
|
|
21
|
-
"@storybook/react-vite": "^10.1.0",
|
|
22
|
-
"@types/htmlparser2": "^3.10.7",
|
|
23
|
-
"@types/node": "^20.2.5",
|
|
24
|
-
"@types/react": "^18.
|
|
25
|
-
"@types/react-dom": "^18.
|
|
26
|
-
"copyfiles": "^2.4.1",
|
|
27
|
-
"esbuild": "^0.25.0",
|
|
28
|
-
"react": "^18.
|
|
29
|
-
"react-dom": "^18.
|
|
30
|
-
"storybook": "^10.1.0",
|
|
31
|
-
"typescript": "^5.9.3",
|
|
32
|
-
"vite": "^6.1.1"
|
|
33
|
-
},
|
|
34
|
-
"main": "dist/cjs/index.js",
|
|
35
|
-
"types": "./index.d.ts",
|
|
36
|
-
"module": "lib/esm/index.js",
|
|
37
|
-
"files": [
|
|
38
|
-
"dist",
|
|
39
|
-
"lib"
|
|
40
|
-
],
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@topconsultnpm/sdk-ts": "6.19.0-
|
|
43
|
-
"buffer": "^6.0.3",
|
|
44
|
-
"devextreme": "25.1.
|
|
45
|
-
"devextreme-react": "25.1.
|
|
46
|
-
"exceljs": "^4.4.0",
|
|
47
|
-
"htmlparser2": "^10.0.0",
|
|
48
|
-
"react-router-dom": "^6.15.0",
|
|
49
|
-
"styled-components": "^6.1.1"
|
|
50
|
-
},
|
|
51
|
-
"overrides": {
|
|
52
|
-
"esbuild": "^0.25.0"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
+
"version": "6.19.0-test2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"clean": "powershell Remove-Item lib/ -recurse",
|
|
8
|
+
"copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
|
|
9
|
+
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
|
+
"tm-watch": "tsc -w",
|
|
11
|
+
"tm-publish": "npm publish --tag latest",
|
|
12
|
+
"storybook": "storybook dev -p 6006",
|
|
13
|
+
"build-storybook": "storybook build"
|
|
14
|
+
},
|
|
15
|
+
"author": "TopConsult",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
19
|
+
"@storybook/addon-docs": "^10.1.0",
|
|
20
|
+
"@storybook/addon-onboarding": "^10.1.0",
|
|
21
|
+
"@storybook/react-vite": "^10.1.0",
|
|
22
|
+
"@types/htmlparser2": "^3.10.7",
|
|
23
|
+
"@types/node": "^20.2.5",
|
|
24
|
+
"@types/react": "^18.3.3",
|
|
25
|
+
"@types/react-dom": "^18.3.3",
|
|
26
|
+
"copyfiles": "^2.4.1",
|
|
27
|
+
"esbuild": "^0.25.0",
|
|
28
|
+
"react": "^18.3.1",
|
|
29
|
+
"react-dom": "^18.3.1",
|
|
30
|
+
"storybook": "^10.1.0",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vite": "^6.1.1"
|
|
33
|
+
},
|
|
34
|
+
"main": "dist/cjs/index.js",
|
|
35
|
+
"types": "./index.d.ts",
|
|
36
|
+
"module": "lib/esm/index.js",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"lib"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.19.0-test2",
|
|
43
|
+
"buffer": "^6.0.3",
|
|
44
|
+
"devextreme": "25.1.7",
|
|
45
|
+
"devextreme-react": "25.1.7",
|
|
46
|
+
"exceljs": "^4.4.0",
|
|
47
|
+
"htmlparser2": "^10.0.0",
|
|
48
|
+
"react-router-dom": "^6.15.0",
|
|
49
|
+
"styled-components": "^6.1.1"
|
|
50
|
+
},
|
|
51
|
+
"overrides": {
|
|
52
|
+
"esbuild": "^0.25.0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DeviceType } from '../../base/TMDeviceProvider';
|
|
3
|
-
interface ToppyHelpCenterProps {
|
|
4
|
-
content?: React.ReactNode;
|
|
5
|
-
deviceType?: DeviceType;
|
|
6
|
-
usePortal?: boolean;
|
|
7
|
-
align?: 'right' | 'left';
|
|
8
|
-
initialIsCollapsed?: boolean;
|
|
9
|
-
onToppyImageClick?: () => void;
|
|
10
|
-
}
|
|
11
|
-
declare const ToppyHelpCenter: React.FC<ToppyHelpCenterProps>;
|
|
12
|
-
export default ToppyHelpCenter;
|