@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.130
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/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +21 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +4 -2
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +2 -0
- package/lib/components/editors/TMMetadataValues.js +26 -8
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +576 -292
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +370 -252
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +57 -37
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +35 -7
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +6 -1
- package/lib/components/query/TMQueryEditor.js +105 -101
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +21 -3
- package/lib/helper/SDKUI_Localizator.js +196 -10
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +132 -4
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +2 -2
- package/lib/helper/queryHelper.js +80 -24
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +6 -5
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
|
+
import { UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { IconWarning, SDKUI_Localizator } from '../helper';
|
|
5
|
+
import { TMColors } from '../utils/theme';
|
|
6
|
+
import { TMUserIcon } from '../components';
|
|
7
|
+
export const useDataUserIdItem = () => {
|
|
8
|
+
const usersCacheRef = useRef(new Map());
|
|
9
|
+
/**
|
|
10
|
+
* Carica tutti gli utenti necessari in parallelo e popola la cache
|
|
11
|
+
* @param userIDs Set di ID degli utenti da caricare
|
|
12
|
+
* @returns Promise che si risolve quando tutti gli utenti sono stati caricati
|
|
13
|
+
*/
|
|
14
|
+
const loadUsersAsync = useCallback(async (userIDs) => {
|
|
15
|
+
if (userIDs.size === 0)
|
|
16
|
+
return;
|
|
17
|
+
try {
|
|
18
|
+
const results = await Promise.all(Array.from(userIDs).map(id => UserListCacheService.GetAsync(id).then(user => ({ id, user }))
|
|
19
|
+
.catch(() => ({ id, user: undefined }))));
|
|
20
|
+
const newCache = new Map();
|
|
21
|
+
results.forEach(({ id, user }) => {
|
|
22
|
+
if (user)
|
|
23
|
+
newCache.set(id, user);
|
|
24
|
+
});
|
|
25
|
+
usersCacheRef.current = newCache;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
console.error('Error loading Users:', err);
|
|
29
|
+
usersCacheRef.current = new Map();
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
/**
|
|
33
|
+
* Recupera un utente dalla cache
|
|
34
|
+
* @param userId ID dell'utente
|
|
35
|
+
* @returns UserDescriptor se trovato, undefined altrimenti
|
|
36
|
+
*/
|
|
37
|
+
const getUserItem = useCallback((userId) => {
|
|
38
|
+
return usersCacheRef.current.get(userId);
|
|
39
|
+
}, []);
|
|
40
|
+
/**
|
|
41
|
+
* Svuota completamente la cache
|
|
42
|
+
*/
|
|
43
|
+
const clearCache = useCallback(() => {
|
|
44
|
+
usersCacheRef.current = new Map();
|
|
45
|
+
}, []);
|
|
46
|
+
/**
|
|
47
|
+
* Verifica se un utente è presente nella cache
|
|
48
|
+
* @param userId ID dell'utente
|
|
49
|
+
* @returns true se l'utente è in cache, false altrimenti
|
|
50
|
+
*/
|
|
51
|
+
const hasUser = useCallback((userId) => {
|
|
52
|
+
return usersCacheRef.current.has(userId);
|
|
53
|
+
}, []);
|
|
54
|
+
/**
|
|
55
|
+
* Helper per ottenere il nome completo dell'utente
|
|
56
|
+
*/
|
|
57
|
+
const getCompleteUserName = useCallback((domain, name) => {
|
|
58
|
+
if (!name)
|
|
59
|
+
return undefined;
|
|
60
|
+
if (!domain)
|
|
61
|
+
return name;
|
|
62
|
+
return domain + "\\" + name;
|
|
63
|
+
}, []);
|
|
64
|
+
/**
|
|
65
|
+
* Renderizza un componente UserIdViewer
|
|
66
|
+
* @param userId ID dell'utente
|
|
67
|
+
* @param showIcon Se mostrare l'icona
|
|
68
|
+
* @param noneSelectionText Testo da mostrare quando non c'è selezione
|
|
69
|
+
* @param TMUserIcon Componente per l'icona utente
|
|
70
|
+
* @returns Elemento React per visualizzare l'utente
|
|
71
|
+
*/
|
|
72
|
+
const renderUserIdViewer = useCallback((userId, showIcon = false, showTitile = true) => {
|
|
73
|
+
const ud = userId && userId > 0 ? getUserItem(userId) : undefined;
|
|
74
|
+
const getIcon = () => {
|
|
75
|
+
if (!showIcon)
|
|
76
|
+
return null;
|
|
77
|
+
if (!userId)
|
|
78
|
+
return null;
|
|
79
|
+
return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("div", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
80
|
+
};
|
|
81
|
+
const getDescription = () => {
|
|
82
|
+
if (!userId)
|
|
83
|
+
return undefined;
|
|
84
|
+
return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? SDKUI_Localizator.NoneSelection;
|
|
85
|
+
};
|
|
86
|
+
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] }));
|
|
87
|
+
}, [getUserItem, getCompleteUserName]);
|
|
88
|
+
return {
|
|
89
|
+
loadUsersAsync,
|
|
90
|
+
getUserItem,
|
|
91
|
+
clearCache,
|
|
92
|
+
hasUser,
|
|
93
|
+
usersCache: usersCacheRef,
|
|
94
|
+
renderUserIdViewer
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface UseFloatingBarPinnedItemsOptions {
|
|
2
|
+
defaultPinnedIds?: string[];
|
|
3
|
+
}
|
|
4
|
+
interface UseFloatingBarPinnedItemsReturn {
|
|
5
|
+
pinnedItemIds: string[];
|
|
6
|
+
isPinned: (id: string) => boolean;
|
|
7
|
+
togglePin: (id: string) => void;
|
|
8
|
+
setPinnedItemIds: (ids: string[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useFloatingBarPinnedItems: (options?: UseFloatingBarPinnedItemsOptions) => UseFloatingBarPinnedItemsReturn;
|
|
11
|
+
export default useFloatingBarPinnedItems;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { SDKUI_Globals } from '../helper';
|
|
3
|
+
export const useFloatingBarPinnedItems = (options = {}) => {
|
|
4
|
+
const { defaultPinnedIds = [] } = options;
|
|
5
|
+
const loadPinnedIds = useCallback(() => {
|
|
6
|
+
try {
|
|
7
|
+
const settings = SDKUI_Globals.userSettings?.searchSettings?.floatingMenuBar || {};
|
|
8
|
+
if (settings.itemIds && Array.isArray(settings.itemIds) && settings.itemIds.length > 0) {
|
|
9
|
+
return settings.itemIds;
|
|
10
|
+
}
|
|
11
|
+
return defaultPinnedIds;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.error('Failed to load pinned items from localStorage:', error);
|
|
15
|
+
return defaultPinnedIds;
|
|
16
|
+
}
|
|
17
|
+
}, [defaultPinnedIds]);
|
|
18
|
+
const [internalPinnedItemIds, setInternalPinnedItemIds] = useState(loadPinnedIds);
|
|
19
|
+
const savePinnedIds = useCallback((ids) => {
|
|
20
|
+
try {
|
|
21
|
+
const currentSettings = SDKUI_Globals.userSettings?.searchSettings?.floatingMenuBar || {};
|
|
22
|
+
SDKUI_Globals.userSettings.searchSettings.floatingMenuBar = {
|
|
23
|
+
...currentSettings,
|
|
24
|
+
itemIds: ids,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Failed to save pinned items to localStorage:', error);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const setPinnedItemIds = useCallback((ids) => {
|
|
32
|
+
setInternalPinnedItemIds(ids);
|
|
33
|
+
savePinnedIds(ids);
|
|
34
|
+
}, [savePinnedIds]);
|
|
35
|
+
const isPinned = useCallback((id) => {
|
|
36
|
+
return internalPinnedItemIds.includes(id);
|
|
37
|
+
}, [internalPinnedItemIds]);
|
|
38
|
+
const togglePin = useCallback((id) => {
|
|
39
|
+
setInternalPinnedItemIds(prev => {
|
|
40
|
+
const newIds = prev.includes(id)
|
|
41
|
+
? prev.filter(pinnedId => pinnedId !== id)
|
|
42
|
+
: [...prev, id];
|
|
43
|
+
savePinnedIds(newIds);
|
|
44
|
+
return newIds;
|
|
45
|
+
});
|
|
46
|
+
}, [savePinnedIds]);
|
|
47
|
+
return {
|
|
48
|
+
pinnedItemIds: internalPinnedItemIds,
|
|
49
|
+
isPinned,
|
|
50
|
+
togglePin,
|
|
51
|
+
setPinnedItemIds,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export default useFloatingBarPinnedItems;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
export interface MetadataHelper {
|
|
3
|
+
Mid: number;
|
|
4
|
+
MetadataName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UseMetadataExpressionProps {
|
|
7
|
+
qd?: QueryDescriptor;
|
|
8
|
+
tid?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UseMetadataExpressionResult {
|
|
11
|
+
metadatas_Info_Source: MetadataHelper[];
|
|
12
|
+
Expression_IDs2Names: (expression: string | undefined) => string | undefined;
|
|
13
|
+
Expression_Names2IDs: (expression: string | undefined) => string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom hook per gestire le espressioni con metadati.
|
|
17
|
+
* Fornisce funzioni per convertire tra IDs e nomi dei metadati e gestisce il caricamento dei metadati.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useMetadataExpression: ({ qd, tid }: UseMetadataExpressionProps) => UseMetadataExpressionResult;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { TMExceptionBoxManager } from '../components/base/TMPopUp';
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook per gestire le espressioni con metadati.
|
|
6
|
+
* Fornisce funzioni per convertire tra IDs e nomi dei metadati e gestisce il caricamento dei metadati.
|
|
7
|
+
*/
|
|
8
|
+
export const useMetadataExpression = ({ qd, tid }) => {
|
|
9
|
+
const [metadatas_Info_Source, setMetadatas_Info_Source] = useState([]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
MetadataInfos_Source_Get_Async();
|
|
12
|
+
}, [qd]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
MetadataInfos_Source_GetByTID_Async();
|
|
15
|
+
}, [tid]);
|
|
16
|
+
async function MetadataInfos_Source_Get_Async() {
|
|
17
|
+
if (!qd?.select)
|
|
18
|
+
return;
|
|
19
|
+
let mhs_source = [];
|
|
20
|
+
try {
|
|
21
|
+
let dtd_source;
|
|
22
|
+
let md_source;
|
|
23
|
+
let tid_source = -1;
|
|
24
|
+
let si;
|
|
25
|
+
let sis = qd.select.slice();
|
|
26
|
+
sis = sis.slice().sort((a, b) => a.tid - b.tid);
|
|
27
|
+
for (si of sis) {
|
|
28
|
+
if (si.tid == undefined || si.mid == undefined)
|
|
29
|
+
continue;
|
|
30
|
+
if (tid_source != si.tid) {
|
|
31
|
+
dtd_source = await DcmtTypeListCacheService.GetAsync(si.tid, true);
|
|
32
|
+
if (dtd_source == undefined)
|
|
33
|
+
continue;
|
|
34
|
+
tid_source = si.tid;
|
|
35
|
+
}
|
|
36
|
+
if (dtd_source?.metadata == undefined)
|
|
37
|
+
continue;
|
|
38
|
+
md_source = dtd_source.metadata.find(o => o.id == si.mid);
|
|
39
|
+
if (md_source?.name == undefined)
|
|
40
|
+
continue;
|
|
41
|
+
if (tid_source == undefined)
|
|
42
|
+
continue;
|
|
43
|
+
mhs_source.push({ Mid: si.mid, MetadataName: md_source.name });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_Get_Async' });
|
|
48
|
+
}
|
|
49
|
+
setMetadatas_Info_Source(mhs_source);
|
|
50
|
+
}
|
|
51
|
+
async function MetadataInfos_Source_GetByTID_Async() {
|
|
52
|
+
if (!tid)
|
|
53
|
+
return;
|
|
54
|
+
let mhs_source = [];
|
|
55
|
+
try {
|
|
56
|
+
let dtd_source = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
57
|
+
if (dtd_source == undefined)
|
|
58
|
+
return;
|
|
59
|
+
if (dtd_source?.metadata == undefined)
|
|
60
|
+
return;
|
|
61
|
+
for (let md_source of dtd_source?.metadata) {
|
|
62
|
+
if (md_source?.name == undefined)
|
|
63
|
+
continue;
|
|
64
|
+
if (md_source?.id == undefined)
|
|
65
|
+
continue;
|
|
66
|
+
mhs_source.push({ Mid: md_source.id, MetadataName: md_source.name });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_GetByTID_Async' });
|
|
71
|
+
}
|
|
72
|
+
setMetadatas_Info_Source(mhs_source);
|
|
73
|
+
}
|
|
74
|
+
function Expression_IDs2Names(expression) {
|
|
75
|
+
if (expression == undefined)
|
|
76
|
+
return expression;
|
|
77
|
+
let temp = expression.slice();
|
|
78
|
+
for (const mh of metadatas_Info_Source) {
|
|
79
|
+
temp = temp.replaceAll(`{@${mh.Mid}}`, `{@${mh.MetadataName}}`);
|
|
80
|
+
}
|
|
81
|
+
temp = temp.replaceAll("{@1}", "{@DID}");
|
|
82
|
+
return temp;
|
|
83
|
+
}
|
|
84
|
+
function Expression_Names2IDs(expression) {
|
|
85
|
+
if (expression == undefined)
|
|
86
|
+
return expression;
|
|
87
|
+
let temp = expression.slice();
|
|
88
|
+
for (const mh of metadatas_Info_Source) {
|
|
89
|
+
temp = temp.replaceAll(`{@${mh.MetadataName}}`, `{@${mh.Mid}}`);
|
|
90
|
+
}
|
|
91
|
+
temp = temp.replaceAll("{@DID}", "{@1}");
|
|
92
|
+
return temp;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
metadatas_Info_Source,
|
|
96
|
+
Expression_IDs2Names,
|
|
97
|
+
Expression_Names2IDs
|
|
98
|
+
};
|
|
99
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SettingsFeedback {
|
|
2
|
+
showSavedBadge: boolean;
|
|
3
|
+
lastChanged: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
isWarning: boolean;
|
|
8
|
+
triggerUIUpdate: (label: string, value: any, warning?: boolean) => void;
|
|
9
|
+
closeBadge: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useSettingsFeedback: () => SettingsFeedback;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
export const useSettingsFeedback = () => {
|
|
3
|
+
const [, setForceUpdate] = useState(0);
|
|
4
|
+
const [showSavedBadge, setShowSavedBadge] = useState(false);
|
|
5
|
+
const [lastChanged, setLastChanged] = useState({
|
|
6
|
+
label: '',
|
|
7
|
+
value: ''
|
|
8
|
+
});
|
|
9
|
+
const [isWarning, setIsWarning] = useState(false);
|
|
10
|
+
const timeoutRef = useRef(null);
|
|
11
|
+
const triggerUIUpdate = (label, value, warning = false) => {
|
|
12
|
+
setForceUpdate((prev) => prev + 1);
|
|
13
|
+
setShowSavedBadge(true);
|
|
14
|
+
setLastChanged({ label, value: String(value) });
|
|
15
|
+
setIsWarning(warning);
|
|
16
|
+
if (timeoutRef.current) {
|
|
17
|
+
clearTimeout(timeoutRef.current);
|
|
18
|
+
}
|
|
19
|
+
timeoutRef.current = setTimeout(() => {
|
|
20
|
+
setShowSavedBadge(false);
|
|
21
|
+
timeoutRef.current = null;
|
|
22
|
+
}, 4000);
|
|
23
|
+
};
|
|
24
|
+
const closeBadge = () => {
|
|
25
|
+
setShowSavedBadge(false);
|
|
26
|
+
if (timeoutRef.current) {
|
|
27
|
+
clearTimeout(timeoutRef.current);
|
|
28
|
+
timeoutRef.current = null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
showSavedBadge,
|
|
33
|
+
lastChanged,
|
|
34
|
+
isWarning,
|
|
35
|
+
triggerUIUpdate,
|
|
36
|
+
closeBadge
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -14,6 +14,19 @@ export const useWorkflowApprove = () => {
|
|
|
14
14
|
const calculateTotalDcmtsFound = useCallback((data) => {
|
|
15
15
|
return data.reduce((sum, item) => sum + (item.dcmtsFound || 0), 0);
|
|
16
16
|
}, []);
|
|
17
|
+
/**
|
|
18
|
+
* Ottiene tutti i work items che corrispondono a un determinato DID.
|
|
19
|
+
* Restituisce un array di oggetti { tid, did }.
|
|
20
|
+
*/
|
|
21
|
+
const getWorkItemsByDID = useCallback((targetDID) => {
|
|
22
|
+
return workflowApproveData
|
|
23
|
+
.flatMap(workflow => workflow.dtdResult?.rows ?? [])
|
|
24
|
+
.filter(dataRow => Number(dataRow?.[1]) === targetDID)
|
|
25
|
+
.map(dataRow => ({
|
|
26
|
+
tid: Number(dataRow[0]),
|
|
27
|
+
did: targetDID
|
|
28
|
+
}));
|
|
29
|
+
}, [workflowApproveData]);
|
|
17
30
|
/**
|
|
18
31
|
* Esegue il fetch dei dati dal workflow, aggiorna lo stato globale
|
|
19
32
|
* e notifica gli altri componenti tramite un evento.
|
|
@@ -53,5 +66,5 @@ export const useWorkflowApprove = () => {
|
|
|
53
66
|
window.removeEventListener('onWorkflowApproveChange', handleUpdate);
|
|
54
67
|
};
|
|
55
68
|
}, [calculateTotalDcmtsFound]);
|
|
56
|
-
return { workflowApproveData, isLoading, refreshWorkflowApprove, totalDcmtsFound };
|
|
69
|
+
return { workflowApproveData, isLoading, refreshWorkflowApprove, totalDcmtsFound, getWorkItemsByDID };
|
|
57
70
|
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -9,7 +9,8 @@ export * from './hooks/useDcmtOperations';
|
|
|
9
9
|
export * from './hooks/useResizeObserver';
|
|
10
10
|
export * from './hooks/useWorkflowApprove';
|
|
11
11
|
export * from './hooks/useRelatedDocuments';
|
|
12
|
+
export * from './hooks/useSettingsFeedback';
|
|
12
13
|
export * from './services';
|
|
13
14
|
import config from 'devextreme/core/config';
|
|
14
|
-
// DevExtreme License Key (valid for v25.
|
|
15
|
-
config({ licenseKey: '
|
|
15
|
+
// DevExtreme License Key (valid for v25.2 and earlier versions)
|
|
16
|
+
config({ licenseKey: 'ewogICJmb3JtYXQiOiAxLAogICJjdXN0b21lcklkIjogIjE1ODg1NDc4LTNjNTItNGUzYy1hNDI1LTU5NjAzMzQ0ZDVjMyIsCiAgIm1heFZlcnNpb25BbGxvd2VkIjogMjUyCn0=.ClI5PeQ2vnl48q0hwdwPHM6oDArs6XTeZ9u4JfN6kxaHoKgszVywO996SluAQfPdFhtzWz6OZsyDdenKv28UU2dOF5wppP88hGEJ17PAg+N/OpUkL1L/CMFNXlOIsYd2517GWA==' });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { JobTypes, ObjectClasses, ProcessDescriptor, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
export declare class PlatformObjectService {
|
|
3
|
-
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").
|
|
4
|
-
static readonly retrieveAsync: (objClass: ObjectClasses, id: number) => Promise<import("@topconsultnpm/sdk-ts").
|
|
3
|
+
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").TaskDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").NotificationDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor[] | undefined>;
|
|
4
|
+
static readonly retrieveAsync: (objClass: ObjectClasses, id: number) => Promise<import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").NotificationDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | undefined>;
|
|
5
5
|
private static readonly retrieveAllAdminJobsAsync;
|
|
6
6
|
static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | DcmtTypeDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor[] | import("@topconsultnpm/sdk-ts").DataListDescriptor[] | import("@topconsultnpm/sdk-ts").DiskDescriptor[] | import("@topconsultnpm/sdk-ts").GroupDescriptor[] | import("@topconsultnpm/sdk-ts").LDAPDescriptor[] | import("@topconsultnpm/sdk-ts").NumeratorDescriptor[] | ProcessDescriptor[] | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor[] | import("@topconsultnpm/sdk-ts").SignCertDescriptor[] | import("@topconsultnpm/sdk-ts").SignServerDescriptor[] | import("@topconsultnpm/sdk-ts").TreeDescriptor[] | import("@topconsultnpm/sdk-ts").TSADescriptor[] | import("@topconsultnpm/sdk-ts").WFDescriptor[] | undefined>;
|
|
7
7
|
private static readonly loadCacheForJobAsync;
|
|
8
8
|
private static readonly retrieveAdminJobAsync;
|
|
9
|
-
static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | import("@topconsultnpm/sdk-ts").
|
|
9
|
+
static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").SavedQueryDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | import("@topconsultnpm/sdk-ts").BarcodeArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").BatchUpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganalePlusJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleQueryJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleSenderJobDescriptor | import("@topconsultnpm/sdk-ts").CheckSequenceJobDescriptor | import("@topconsultnpm/sdk-ts").COSCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtConverterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtDeleterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtNoteJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtPrinterJobDescriptor | import("@topconsultnpm/sdk-ts").FEAttacherJobDescriptor | import("@topconsultnpm/sdk-ts").FECreatorTxtJobDescriptor | import("@topconsultnpm/sdk-ts").FEDetacherJobDescriptor | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").FESenderWsJobDescriptor | import("@topconsultnpm/sdk-ts").FESplitterJobDescriptor | import("@topconsultnpm/sdk-ts").FEValidatorJobDescriptor | import("@topconsultnpm/sdk-ts").FileArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").FileCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").FileExecJobDescriptor | import("@topconsultnpm/sdk-ts").FileExportJobDescriptor | import("@topconsultnpm/sdk-ts").FileMoverJobDescriptor | import("@topconsultnpm/sdk-ts").LexJobDescriptor | import("@topconsultnpm/sdk-ts").LinkerJobDescriptor | import("@topconsultnpm/sdk-ts").MailArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").MailQueryJobDescriptor | import("@topconsultnpm/sdk-ts").MigrationJobDescriptor | import("@topconsultnpm/sdk-ts").PdDCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").PDFArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PdVSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PostelQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PostelSenderJobDescriptor | import("@topconsultnpm/sdk-ts").ReplicatorJobDescriptor | import("@topconsultnpm/sdk-ts").SAPAlignerJobDescriptor | import("@topconsultnpm/sdk-ts").SAPBarcodeJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataReaderJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataWriterJobDescriptor | import("@topconsultnpm/sdk-ts").SignerJobDescriptor | import("@topconsultnpm/sdk-ts").SpoolArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").UpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").DiskDescriptor | import("@topconsultnpm/sdk-ts").GroupDescriptor | import("@topconsultnpm/sdk-ts").LDAPDescriptor | import("@topconsultnpm/sdk-ts").NumeratorDescriptor | ProcessDescriptor | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor | import("@topconsultnpm/sdk-ts").SignCertDescriptor | import("@topconsultnpm/sdk-ts").SignServerDescriptor | import("@topconsultnpm/sdk-ts").TreeDescriptor | import("@topconsultnpm/sdk-ts").TSADescriptor | undefined>;
|
|
10
10
|
private static readonly updateJobAsync;
|
|
11
11
|
static readonly updateAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any, ...args: any[]) => Promise<number | undefined>;
|
|
12
12
|
private static readonly createJobAsync;
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { FileFormats, ITopMediaSession, MetadataDescriptor, MetadataValueDescriptor, UserDescriptor, ValidationItem } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { DataListItemDescriptor, FileFormats, ITopMediaSession, MetadataDescriptor, MetadataValueDescriptor, UserDescriptor, ValidationItem, WFDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { ITMEditorBase } from "../components/base/TMEditorBase";
|
|
4
4
|
import { IColumnProps } from "devextreme-react/data-grid";
|
|
5
5
|
export declare enum FormModes {
|
|
@@ -310,3 +310,63 @@ export declare enum buildTypes {
|
|
|
310
310
|
RTM = "RTM",
|
|
311
311
|
PATCH = "PATCH"
|
|
312
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Descrive un'istanza di workflow per il contesto WorkflowCtrl.
|
|
315
|
+
* Contiene tutte le informazioni necessarie per recuperare i work items associati.
|
|
316
|
+
*/
|
|
317
|
+
export interface WFInstanceDescriptor {
|
|
318
|
+
/** ID dell'istanza */
|
|
319
|
+
instanceId: string | undefined;
|
|
320
|
+
/** Indice della riga nel search result */
|
|
321
|
+
rowIndex: number;
|
|
322
|
+
/** Struttura metadati completa da searchResultToDataSource: { [key: string]: { md: MetadataDescriptor, value: any } } */
|
|
323
|
+
values: any;
|
|
324
|
+
/** TID del documento workflow */
|
|
325
|
+
tid?: number;
|
|
326
|
+
/** DID del documento workflow */
|
|
327
|
+
did?: number;
|
|
328
|
+
/** ID del workflow */
|
|
329
|
+
wfid?: number;
|
|
330
|
+
/** MID del metadato che contiene lo stato del workflow */
|
|
331
|
+
mStatusMID?: number;
|
|
332
|
+
/** DataList ID per visualizzare lo stato */
|
|
333
|
+
mStatusDLID?: number;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Dettaglio di un singolo work item
|
|
337
|
+
*/
|
|
338
|
+
export interface WorkItemDetail {
|
|
339
|
+
wid: string;
|
|
340
|
+
tid: number;
|
|
341
|
+
did: number;
|
|
342
|
+
wfid: number;
|
|
343
|
+
approvalVID: number;
|
|
344
|
+
status?: DataListItemDescriptor;
|
|
345
|
+
setID: string;
|
|
346
|
+
response?: string;
|
|
347
|
+
creationTime?: Date;
|
|
348
|
+
completionTime?: Date;
|
|
349
|
+
from?: number;
|
|
350
|
+
to?: number;
|
|
351
|
+
toUser?: UserDescriptor;
|
|
352
|
+
or?: number;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Raggruppamento di work items per setID (e creationTime se lo step si ripete)
|
|
356
|
+
*/
|
|
357
|
+
export interface IWorkItemData {
|
|
358
|
+
wid: string;
|
|
359
|
+
tid?: number;
|
|
360
|
+
did?: number;
|
|
361
|
+
category?: any;
|
|
362
|
+
type?: any;
|
|
363
|
+
name?: string;
|
|
364
|
+
description?: string;
|
|
365
|
+
setID: string | undefined;
|
|
366
|
+
creationTime?: Date;
|
|
367
|
+
setStatus?: DataListItemDescriptor;
|
|
368
|
+
setRule?: number;
|
|
369
|
+
details: WorkItemDetail[];
|
|
370
|
+
groupIndex?: number;
|
|
371
|
+
wf?: WFDescriptor;
|
|
372
|
+
}
|
package/lib/utils/theme.d.ts
CHANGED
package/lib/utils/theme.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.20.0-dev1.
|
|
3
|
+
"version": "6.20.0-dev1.130",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
10
|
"tm-watch": "tsc -w",
|
|
11
11
|
"tm-publish": "npm publish --tag latest",
|
|
12
|
+
"tm-publish_wl": "npm publish",
|
|
12
13
|
"storybook": "storybook dev -p 6006",
|
|
13
14
|
"build-storybook": "storybook build"
|
|
14
15
|
},
|
|
@@ -39,13 +40,13 @@
|
|
|
39
40
|
"lib"
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@topconsultnpm/sdk-ts": "6.20.0-dev1.
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.20.0-dev1.7",
|
|
43
44
|
"buffer": "^6.0.3",
|
|
44
|
-
"devextreme": "25.
|
|
45
|
-
"devextreme-react": "25.
|
|
45
|
+
"devextreme": "25.2.4",
|
|
46
|
+
"devextreme-react": "25.2.4",
|
|
46
47
|
"exceljs": "^4.4.0",
|
|
47
48
|
"htmlparser2": "^10.0.0",
|
|
48
|
-
"pdfjs-dist": "
|
|
49
|
+
"pdfjs-dist": "5.4.296",
|
|
49
50
|
"react-pdf": "^10.3.0",
|
|
50
51
|
"react-router-dom": "^6.15.0",
|
|
51
52
|
"styled-components": "^6.1.1"
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import * as S from './styles';
|
|
4
|
-
const Notification = ({ title, message, mode = 'info', position = 'top-right', duration = 3000, closable = false, stopOnMouseEnter = true, hasProgress = true, onClose, }) => {
|
|
5
|
-
const [state, setState] = useState({
|
|
6
|
-
visible: true,
|
|
7
|
-
isPaused: false,
|
|
8
|
-
progress: 100,
|
|
9
|
-
});
|
|
10
|
-
const timeoutRef = useRef(undefined);
|
|
11
|
-
const remainingTimeRef = useRef(duration);
|
|
12
|
-
const pauseTimeRef = useRef(0);
|
|
13
|
-
const closeNotification = () => {
|
|
14
|
-
setState(prev => ({ ...prev, visible: false }));
|
|
15
|
-
setTimeout(() => {
|
|
16
|
-
onClose?.();
|
|
17
|
-
}, 300);
|
|
18
|
-
};
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
// Set up auto-close timer
|
|
21
|
-
timeoutRef.current = setTimeout(() => {
|
|
22
|
-
closeNotification();
|
|
23
|
-
}, duration);
|
|
24
|
-
return () => {
|
|
25
|
-
if (timeoutRef.current) {
|
|
26
|
-
clearTimeout(timeoutRef.current);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}, [duration]);
|
|
30
|
-
const handleMouseEnter = () => {
|
|
31
|
-
if (!stopOnMouseEnter)
|
|
32
|
-
return;
|
|
33
|
-
// Pause the timer
|
|
34
|
-
if (timeoutRef.current) {
|
|
35
|
-
clearTimeout(timeoutRef.current);
|
|
36
|
-
pauseTimeRef.current = Date.now();
|
|
37
|
-
}
|
|
38
|
-
setState(prev => ({ ...prev, isPaused: true }));
|
|
39
|
-
};
|
|
40
|
-
const handleMouseLeave = () => {
|
|
41
|
-
if (!stopOnMouseEnter)
|
|
42
|
-
return;
|
|
43
|
-
// Resume the timer with remaining time
|
|
44
|
-
const pauseDuration = Date.now() - pauseTimeRef.current;
|
|
45
|
-
remainingTimeRef.current = Math.max(0, remainingTimeRef.current - pauseDuration);
|
|
46
|
-
timeoutRef.current = setTimeout(() => {
|
|
47
|
-
closeNotification();
|
|
48
|
-
}, remainingTimeRef.current);
|
|
49
|
-
setState(prev => ({ ...prev, isPaused: false }));
|
|
50
|
-
};
|
|
51
|
-
const handleClose = (e) => {
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
if (timeoutRef.current) {
|
|
54
|
-
clearTimeout(timeoutRef.current);
|
|
55
|
-
}
|
|
56
|
-
closeNotification();
|
|
57
|
-
};
|
|
58
|
-
return (_jsxs(S.NotificationContainer, { "$position": position, "$mode": mode, "$visible": state.visible, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "alert", "aria-live": "assertive", children: [_jsxs(S.NotificationContent, { children: [_jsx(S.NotificationTitle, { children: title }), _jsx(S.NotificationMessage, { children: message })] }), closable && (_jsx(S.CloseButton, { onClick: handleClose, "aria-label": "Close notification", children: "\u00D7" })), hasProgress && (_jsx(S.ProgressBar, { "$duration": duration, "$mode": mode, "$isPaused": state.isPaused }))] }));
|
|
59
|
-
};
|
|
60
|
-
export default Notification;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { NotificationPosition } from './types';
|
|
3
|
-
interface NotificationContainerProps {
|
|
4
|
-
position: NotificationPosition;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare const NotificationContainer: React.FC<NotificationContainerProps>;
|
|
8
|
-
export default NotificationContainer;
|