@topconsultnpm/sdkui-react 6.20.0-dev1.7 → 6.20.0-dev1.70
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.js +258 -17
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +2 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +17 -4
- 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 +5 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +59 -31
- package/lib/components/NewComponents/ContextMenu/types.d.ts +13 -0
- 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 +517 -100
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +19 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +206 -54
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +1 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +142 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +0 -5
- package/lib/components/choosers/TMUserChooser.js +25 -45
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
- package/lib/components/features/documents/TMDcmtForm.js +386 -194
- package/lib/components/features/documents/TMDcmtPreview.js +41 -105
- package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
- 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} +5 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.js +41 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
- package/lib/components/features/search/TMSearchResult.js +118 -242
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
- 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 +1 -1
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +62 -52
- package/lib/components/features/tasks/TMTasksView.js +6 -6
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +134 -24
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -3
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +2 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +21 -4
- 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 +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +55 -30
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +4 -0
- package/lib/components/settings/SettingsAppearance.js +92 -29
- 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 +19 -0
- package/lib/helper/SDKUI_Globals.js +11 -0
- package/lib/helper/SDKUI_Localizator.d.ts +15 -1
- package/lib/helper/SDKUI_Localizator.js +147 -1
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/checkinCheckoutManager.d.ts +32 -2
- package/lib/helper/checkinCheckoutManager.js +115 -38
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +14 -3
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- 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 +131 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -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 +1 -0
- package/lib/ts/types.d.ts +58 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +5 -2
- 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/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useIsIOS } from './hooks';
|
|
3
|
+
export function useLongPress({ containerRef, targetSelector, onLongPress, onTouchStart, duration = 500, moveThreshold = 10, hapticFeedback = true, enabled = true, }) {
|
|
4
|
+
const isIOS = useIsIOS();
|
|
5
|
+
const longPressTriggeredRef = useRef(false);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!isIOS || !enabled || !containerRef.current)
|
|
8
|
+
return;
|
|
9
|
+
const container = containerRef.current;
|
|
10
|
+
let longPressTimeout = null;
|
|
11
|
+
let touchStartPos = null;
|
|
12
|
+
let longPressTarget = null;
|
|
13
|
+
const matchesSelector = (element) => {
|
|
14
|
+
const selectors = Array.isArray(targetSelector) ? targetSelector : [targetSelector];
|
|
15
|
+
for (const selector of selectors) {
|
|
16
|
+
const match = element.closest(selector);
|
|
17
|
+
if (match)
|
|
18
|
+
return match;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
22
|
+
const handleTouchStart = (e) => {
|
|
23
|
+
const touch = e.touches[0];
|
|
24
|
+
const target = touch.target;
|
|
25
|
+
// Check if target matches any of the specified selectors
|
|
26
|
+
const matchedElement = matchesSelector(target);
|
|
27
|
+
if (!matchedElement)
|
|
28
|
+
return;
|
|
29
|
+
touchStartPos = { x: touch.clientX, y: touch.clientY };
|
|
30
|
+
longPressTriggeredRef.current = false;
|
|
31
|
+
longPressTarget = target;
|
|
32
|
+
// Call optional onTouchStart callback
|
|
33
|
+
if (onTouchStart) {
|
|
34
|
+
onTouchStart({
|
|
35
|
+
clientX: touch.clientX,
|
|
36
|
+
clientY: touch.clientY,
|
|
37
|
+
target,
|
|
38
|
+
rowElement: matchedElement,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (longPressTimeout)
|
|
42
|
+
clearTimeout(longPressTimeout);
|
|
43
|
+
longPressTimeout = setTimeout(() => {
|
|
44
|
+
longPressTriggeredRef.current = true;
|
|
45
|
+
// Haptic feedback
|
|
46
|
+
if (hapticFeedback && 'vibrate' in navigator) {
|
|
47
|
+
navigator.vibrate(50);
|
|
48
|
+
}
|
|
49
|
+
// Call onLongPress callback
|
|
50
|
+
onLongPress({
|
|
51
|
+
clientX: touch.clientX,
|
|
52
|
+
clientY: touch.clientY,
|
|
53
|
+
target: longPressTarget,
|
|
54
|
+
});
|
|
55
|
+
longPressTimeout = null;
|
|
56
|
+
}, duration);
|
|
57
|
+
};
|
|
58
|
+
const handleTouchMove = (e) => {
|
|
59
|
+
if (!touchStartPos || !longPressTimeout)
|
|
60
|
+
return;
|
|
61
|
+
const touch = e.touches[0];
|
|
62
|
+
const dx = Math.abs(touch.clientX - touchStartPos.x);
|
|
63
|
+
const dy = Math.abs(touch.clientY - touchStartPos.y);
|
|
64
|
+
// Cancel long-press if finger moved too much
|
|
65
|
+
if (dx > moveThreshold || dy > moveThreshold) {
|
|
66
|
+
clearTimeout(longPressTimeout);
|
|
67
|
+
longPressTimeout = null;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const handleTouchEnd = () => {
|
|
71
|
+
if (longPressTimeout) {
|
|
72
|
+
clearTimeout(longPressTimeout);
|
|
73
|
+
longPressTimeout = null;
|
|
74
|
+
}
|
|
75
|
+
touchStartPos = null;
|
|
76
|
+
longPressTarget = null;
|
|
77
|
+
};
|
|
78
|
+
// Prevent click after long-press to avoid unintended actions
|
|
79
|
+
const handleClick = (e) => {
|
|
80
|
+
if (longPressTriggeredRef.current) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
e.stopImmediatePropagation();
|
|
84
|
+
longPressTriggeredRef.current = false;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
container.addEventListener('touchstart', handleTouchStart, { passive: true });
|
|
88
|
+
container.addEventListener('touchmove', handleTouchMove, { passive: true });
|
|
89
|
+
container.addEventListener('touchend', handleTouchEnd);
|
|
90
|
+
container.addEventListener('touchcancel', handleTouchEnd);
|
|
91
|
+
container.addEventListener('click', handleClick, { capture: true });
|
|
92
|
+
return () => {
|
|
93
|
+
if (longPressTimeout)
|
|
94
|
+
clearTimeout(longPressTimeout);
|
|
95
|
+
container.removeEventListener('touchstart', handleTouchStart);
|
|
96
|
+
container.removeEventListener('touchmove', handleTouchMove);
|
|
97
|
+
container.removeEventListener('touchend', handleTouchEnd);
|
|
98
|
+
container.removeEventListener('touchcancel', handleTouchEnd);
|
|
99
|
+
container.removeEventListener('click', handleClick, { capture: true });
|
|
100
|
+
};
|
|
101
|
+
}, [isIOS, enabled, containerRef, targetSelector, onLongPress, onTouchStart, duration, moveThreshold, hapticFeedback]);
|
|
102
|
+
}
|
|
103
|
+
export function triggerContextMenuEvent(target, clientX, clientY) {
|
|
104
|
+
const contextMenuEvent = new MouseEvent('contextmenu', {
|
|
105
|
+
bubbles: true,
|
|
106
|
+
cancelable: true,
|
|
107
|
+
clientX,
|
|
108
|
+
clientY,
|
|
109
|
+
button: 2,
|
|
110
|
+
});
|
|
111
|
+
target.dispatchEvent(contextMenuEvent);
|
|
112
|
+
}
|