@topconsultnpm/sdkui-react 6.20.0-dev1.11 → 6.20.0-dev1.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/lib/assets/Toppy-help-center.png +0 -0
  2. package/lib/assets/headergradient.svg +87 -0
  3. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +285 -28
  4. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
  5. package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
  6. package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
  7. package/lib/components/NewComponents/ContextMenu/index.js +2 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
  9. package/lib/components/NewComponents/ContextMenu/styles.js +157 -37
  10. package/lib/components/NewComponents/ContextMenu/types.d.ts +14 -1
  11. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  12. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +563 -112
  14. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +21 -5
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.js +210 -58
  16. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +8 -2
  17. package/lib/components/base/TMAccordionNew.js +35 -14
  18. package/lib/components/base/TMCustomButton.js +61 -17
  19. package/lib/components/base/TMDataGrid.d.ts +7 -4
  20. package/lib/components/base/TMDataGrid.js +153 -11
  21. package/lib/components/base/TMDropDownMenu.js +19 -18
  22. package/lib/components/base/TMFileManager.d.ts +4 -3
  23. package/lib/components/base/TMFileManager.js +32 -24
  24. package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
  25. package/lib/components/base/TMFileManagerDataGridView.js +1 -11
  26. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
  27. package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
  28. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
  29. package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
  30. package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
  31. package/lib/components/base/TMListView.js +33 -15
  32. package/lib/components/base/TMPanel.d.ts +1 -1
  33. package/lib/components/base/TMPanel.js +1 -1
  34. package/lib/components/choosers/TMDistinctValues.js +2 -2
  35. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  36. package/lib/components/choosers/TMMetadataChooser.js +8 -1
  37. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  38. package/lib/components/choosers/TMUserChooser.d.ts +0 -5
  39. package/lib/components/choosers/TMUserChooser.js +25 -45
  40. package/lib/components/editors/TMDateBox.js +18 -9
  41. package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
  42. package/lib/components/editors/TMLocalizedTextBox.js +16 -14
  43. package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
  44. package/lib/components/editors/TMMetadataTextBox.js +92 -0
  45. package/lib/components/editors/TMMetadataValues.js +23 -5
  46. package/lib/components/editors/TMTextArea.js +18 -30
  47. package/lib/components/editors/TMTextBox.d.ts +1 -1
  48. package/lib/components/editors/TMTextBox.js +6 -3
  49. package/lib/components/editors/TMTextExpression.js +6 -91
  50. package/lib/components/features/archive/TMArchive.js +2 -2
  51. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  52. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
  53. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  54. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  55. package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
  56. package/lib/components/features/documents/TMDcmtForm.js +457 -206
  57. package/lib/components/features/documents/TMDcmtPreview.js +44 -110
  58. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  59. package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
  60. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  61. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  62. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  63. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  64. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  65. package/lib/components/features/search/TMSearch.d.ts +3 -0
  66. package/lib/components/features/search/TMSearch.js +50 -11
  67. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  68. package/lib/components/features/search/TMSearchQueryPanel.js +29 -21
  69. package/lib/components/features/search/TMSearchResult.d.ts +3 -0
  70. package/lib/components/features/search/TMSearchResult.js +208 -250
  71. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  72. package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
  73. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  74. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  75. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  76. package/lib/components/features/search/TMViewHistoryDcmt.js +2 -2
  77. package/lib/components/features/tasks/TMTaskForm.js +20 -1
  78. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  79. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  80. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  81. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  82. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  83. package/lib/components/features/tasks/TMTasksUtils.js +43 -36
  84. package/lib/components/features/tasks/TMTasksView.js +28 -19
  85. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  86. package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
  87. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
  88. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +12 -7
  89. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  90. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  91. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
  92. package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
  93. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  94. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  95. package/lib/components/forms/Login/TMLoginForm.js +34 -6
  96. package/lib/components/forms/TMChooserForm.js +1 -1
  97. package/lib/components/grids/TMBlogsPost.js +56 -31
  98. package/lib/components/grids/TMRecentsManager.js +20 -10
  99. package/lib/components/index.d.ts +6 -3
  100. package/lib/components/index.js +6 -3
  101. package/lib/components/query/TMQueryEditor.d.ts +2 -1
  102. package/lib/components/query/TMQueryEditor.js +92 -92
  103. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  104. package/lib/components/settings/SettingsAppearance.js +99 -30
  105. package/lib/components/sidebar/TMHeader.js +7 -7
  106. package/lib/components/sidebar/TMSidebar.d.ts +0 -1
  107. package/lib/components/sidebar/TMSidebar.js +16 -44
  108. package/lib/components/sidebar/TMSidebarItem.js +34 -17
  109. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  110. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  111. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  112. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  113. package/lib/css/tm-sdkui.css +1 -1
  114. package/lib/helper/SDKUI_Globals.d.ts +22 -0
  115. package/lib/helper/SDKUI_Globals.js +10 -1
  116. package/lib/helper/SDKUI_Localizator.d.ts +17 -1
  117. package/lib/helper/SDKUI_Localizator.js +167 -1
  118. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  119. package/lib/helper/TMCommandsContextMenu.js +15 -4
  120. package/lib/helper/TMIcons.d.ts +4 -0
  121. package/lib/helper/TMIcons.js +13 -3
  122. package/lib/helper/TMPdfViewer.d.ts +8 -0
  123. package/lib/helper/TMPdfViewer.js +373 -0
  124. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  125. package/lib/helper/checkinCheckoutManager.js +112 -30
  126. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  127. package/lib/helper/devextremeCustomMessages.js +30 -0
  128. package/lib/helper/helpers.d.ts +28 -1
  129. package/lib/helper/helpers.js +130 -3
  130. package/lib/helper/index.d.ts +2 -0
  131. package/lib/helper/index.js +2 -0
  132. package/lib/helper/queryHelper.d.ts +1 -1
  133. package/lib/helper/queryHelper.js +33 -3
  134. package/lib/helper/workItemsHelper.d.ts +6 -0
  135. package/lib/helper/workItemsHelper.js +230 -0
  136. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  137. package/lib/hooks/useCheckInOutOperations.js +223 -0
  138. package/lib/hooks/useDataListItem.d.ts +12 -0
  139. package/lib/hooks/useDataListItem.js +132 -0
  140. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  141. package/lib/hooks/useDataUserIdItem.js +96 -0
  142. package/lib/hooks/useMetadataExpression.d.ts +19 -0
  143. package/lib/hooks/useMetadataExpression.js +99 -0
  144. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  145. package/lib/hooks/useSettingsFeedback.js +38 -0
  146. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  147. package/lib/hooks/useWorkflowApprove.js +14 -1
  148. package/lib/index.d.ts +1 -0
  149. package/lib/index.js +3 -2
  150. package/lib/services/platform_services.d.ts +3 -3
  151. package/lib/ts/types.d.ts +61 -1
  152. package/lib/utils/theme.d.ts +1 -1
  153. package/lib/utils/theme.js +1 -1
  154. package/package.json +7 -4
  155. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  156. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  157. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  158. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  159. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  160. package/lib/components/NewComponents/Notification/index.js +0 -2
  161. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  162. package/lib/components/NewComponents/Notification/styles.js +0 -180
  163. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  164. package/lib/components/NewComponents/Notification/types.js +0 -1
  165. package/lib/components/base/TMContextMenu.d.ts +0 -25
  166. package/lib/components/base/TMContextMenu.js +0 -109
  167. package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
  168. package/lib/components/base/TMContextMenuOLD.js +0 -56
  169. package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
  170. package/lib/components/base/TMFloatingToolbar.js +0 -101
  171. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  172. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  173. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  174. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  175. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -10,6 +10,7 @@ export declare const FloatingContainer: import("styled-components/dist/types").I
10
10
  $isDragging: boolean;
11
11
  $isConfigMode: boolean;
12
12
  $isConstrained?: boolean;
13
+ $bgColor?: string;
13
14
  }>, {
14
15
  $x: number;
15
16
  $y: number;
@@ -17,22 +18,37 @@ export declare const FloatingContainer: import("styled-components/dist/types").I
17
18
  $isDragging: boolean;
18
19
  $isConfigMode: boolean;
19
20
  $isConstrained?: boolean;
21
+ $bgColor?: string;
20
22
  }>> & string;
21
23
  export declare const GripHandle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
22
24
  $orientation: "horizontal" | "vertical";
23
25
  }>> & string;
26
+ export declare const Separator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
27
+ $orientation: "horizontal" | "vertical";
28
+ }>> & string;
29
+ export declare const ItemSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
30
+ $orientation: "horizontal" | "vertical";
31
+ $isConfigMode: boolean;
32
+ }>> & string;
24
33
  export declare const MenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
25
34
  $isActive?: boolean;
26
35
  }>> & string;
27
- export declare const ConfigButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
36
+ export declare const ConfigButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
37
+ export declare const ApplyButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
38
+ export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
39
+ export declare const ContextMenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$isActive"> & {
28
40
  $isActive?: boolean;
29
- }>> & string;
41
+ }, "ref"> & {
42
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
43
+ }, never>> & string;
44
+ export declare const AddButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
30
45
  export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
31
- export declare const OrientationToggle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
32
- $orientation: "horizontal" | "vertical";
33
- }>> & string;
46
+ export declare const UndoButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
34
47
  export declare const DraggableItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
48
  $isDragging: boolean;
36
49
  $isDragOver: boolean;
37
50
  }>> & string;
38
51
  export declare const ContextMenuWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
52
+ export declare const ButtonGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
53
+ $orientation: "horizontal" | "vertical";
54
+ }>> & string;
@@ -37,38 +37,35 @@ export const FloatingContainer = styled.div.attrs(props => ({
37
37
  },
38
38
  })) `
39
39
  position: ${props => props.$isConstrained ? 'absolute' : 'fixed'};
40
- z-index: ${props => props.$isConfigMode ? 9999 : 10000};
40
+ z-index: ${props => props.$isConfigMode ? 9999 : 1500};
41
41
  display: flex;
42
42
  flex-direction: ${props => props.$orientation === 'horizontal' ? 'row' : 'column'};
43
43
  align-items: center;
44
- background: ${props => props.$isDragging || props.$isConfigMode
45
- ? 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
46
- : 'rgba(102, 126, 234, 0.9)'};
47
- border: 1px solid rgba(255, 255, 255, 0.2);
44
+ background: ${props => props.$bgColor || 'linear-gradient(135deg, #0071BC 0%, #1B1464 100%)'};
45
+ border: 1px solid #667eea;
48
46
  border-radius: 14px;
49
47
  padding: 6px;
50
48
  gap: 3px;
51
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
49
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
50
+ 0 6px 16px rgba(0, 0, 0, 0.2);
52
51
  cursor: ${props => props.$isDragging ? 'grabbing' : 'default'};
53
52
  user-select: none;
54
53
  animation: ${props => props.$isConfigMode && css `${shake} 0.3s ease-in-out`};
55
54
  transition: none;
56
55
 
57
56
  &:hover {
58
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
57
+ background: ${props => props.$bgColor || 'linear-gradient(135deg, #0071BC 0%, #1B1464 100%)'};
59
58
  border: 1px solid #667eea;
60
59
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
61
60
  0 6px 16px rgba(0, 0, 0, 0.2);
62
61
  }
63
62
 
64
63
  [data-theme='dark'] & {
65
- background: ${props => props.$isDragging || props.$isConfigMode
66
- ? 'linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)'
67
- : 'rgba(26, 26, 46, 0.9)'};
68
- border-color: rgba(255, 255, 255, 0.1);
64
+ background: ${props => props.$bgColor || 'linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)'};
65
+ border: 1px solid #1a1a2e;
69
66
 
70
67
  &:hover {
71
- background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
68
+ background: ${props => props.$bgColor || 'linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)'};
72
69
  border: 1px solid #1a1a2e;
73
70
  }
74
71
  }
@@ -77,7 +74,7 @@ export const GripHandle = styled.div `
77
74
  display: flex;
78
75
  align-items: center;
79
76
  justify-content: center;
80
- padding: ${props => props.$orientation === 'horizontal' ? '10px 6px' : '6px 10px'};
77
+ padding: ${props => props.$orientation === 'horizontal' ? '6px 4px' : '4px 6px'};
81
78
  cursor: grab;
82
79
  color: rgba(255, 255, 255, 0.7);
83
80
  transition: all 0.2s ease;
@@ -98,35 +95,79 @@ export const GripHandle = styled.div `
98
95
  height: 14px;
99
96
  }
100
97
  `;
98
+ export const Separator = styled.div `
99
+ background: rgba(255, 255, 255, 0.25);
100
+ width: ${props => props.$orientation === 'horizontal' ? '1px' : '100%'};
101
+ height: ${props => props.$orientation === 'horizontal' ? '20px' : '1px'};
102
+ margin: ${props => props.$orientation === 'horizontal' ? '0 4px' : '4px 0'};
103
+ flex-shrink: 0;
104
+ `;
105
+ export const ItemSeparator = styled.div `
106
+ flex-shrink: 0;
107
+ transition: all 0.2s ease;
108
+
109
+ ${props => props.$isConfigMode ? `
110
+ /* Edit mode: look exactly like MenuButton */
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ width: 30px;
115
+ height: 30px;
116
+ background: transparent;
117
+ border-radius: 8px;
118
+ cursor: grab;
119
+ position: relative;
120
+
121
+ &::before {
122
+ content: '';
123
+ background: rgba(255, 255, 255, 0.25);
124
+ width: ${props.$orientation === 'horizontal' ? '2px' : '100%'};
125
+ height: ${props.$orientation === 'horizontal' ? '18px' : '2px'};
126
+ border-radius: 1px;
127
+ }
128
+
129
+ &:hover {
130
+ background: rgba(255, 255, 255, 0.2);
131
+ }
132
+
133
+ &:active {
134
+ opacity: 0.8;
135
+ }
136
+ ` : `
137
+ /* Normal mode: simple line with tight spacing */
138
+ background: rgba(255, 255, 255, 0.25);
139
+ width: ${props.$orientation === 'horizontal' ? '1px' : '100%'};
140
+ height: ${props.$orientation === 'horizontal' ? '20px' : '1px'};
141
+ margin: ${props.$orientation === 'horizontal' ? '0 2px' : '2px 0'};
142
+ `}
143
+ `;
101
144
  export const MenuButton = styled.button `
102
145
  display: flex;
103
146
  align-items: center;
104
147
  justify-content: center;
105
- width: 34px;
106
- height: 34px;
107
- background: transparent;
148
+ width: 30px;
149
+ height: 30px;
150
+ background: ${props => props.$isActive ? 'rgba(102, 179, 255, 0.3)' : 'transparent'};
108
151
  border: none;
109
152
  border-radius: 8px;
110
153
  color: white;
111
154
  font-size: 16px;
112
155
  cursor: pointer;
113
- transition: all 0.2s ease;
156
+ transition: background 0.2s ease;
114
157
  position: relative;
115
158
 
116
159
  &:hover:not(:disabled) {
117
- background: rgba(255, 255, 255, 0.2);
118
- transform: scale(1.1);
160
+ background: ${props => props.$isActive ? 'rgba(102, 179, 255, 0.4)' : 'rgba(255, 255, 255, 0.2)'};
119
161
  }
120
162
 
121
163
  &:active:not(:disabled) {
122
- transform: scale(0.95);
164
+ opacity: 0.8;
123
165
  }
124
166
 
125
167
  &:disabled {
126
- opacity: 0.3;
127
- cursor: not-allowed;
128
- background: rgba(255, 255, 255, 0.05);
129
- color: rgba(255, 255, 255, 0.4);
168
+ opacity: 0.5;
169
+ cursor: default;
170
+ color: rgba(255, 255, 255, 0.6);
130
171
  }
131
172
 
132
173
  svg {
@@ -138,37 +179,137 @@ export const ConfigButton = styled.button `
138
179
  display: flex;
139
180
  align-items: center;
140
181
  justify-content: center;
141
- width: 34px;
142
- height: 34px;
143
- background: ${props => props.$isActive
144
- ? 'rgba(0, 0, 0, 0.2)'
145
- : 'rgba(0, 0, 0, 0.1)'};
146
- border: 1px solid ${props => props.$isActive
147
- ? 'rgba(255, 255, 255, 0.3)'
148
- : 'rgba(255, 255, 255, 0.15)'};
182
+ width: 21px;
183
+ height: 21px;
184
+ background: transparent;
185
+ border: none;
186
+ border-radius: 4px;
187
+ color: rgba(255, 255, 255, 0.5);
188
+ font-size: 10px;
189
+ cursor: pointer;
190
+ transition: all 0.2s ease;
191
+ padding: 4px;
192
+
193
+ &:hover:not(:disabled) {
194
+ background: rgba(255, 255, 255, 0.1);
195
+ color: rgba(255, 255, 255, 0.8);
196
+ }
197
+
198
+ &:active:not(:disabled) {
199
+ transform: scale(0.9);
200
+ }
201
+
202
+ &:disabled {
203
+ opacity: 0.3;
204
+ cursor: not-allowed;
205
+ }
206
+
207
+ svg {
208
+ width: 16px;
209
+ height: 16px;
210
+ }
211
+ `;
212
+ export const ApplyButton = styled.button `
213
+ display: flex;
214
+ align-items: center;
215
+ justify-content: center;
216
+ width: 24px;
217
+ height: 24px;
218
+ background: transparent;
219
+ border: none;
220
+ border-radius: 4px;
221
+ color: rgba(34, 197, 94, 1);
222
+ font-size: 10px;
223
+ cursor: pointer;
224
+ transition: all 0.2s ease;
225
+ padding: 3px;
226
+
227
+ &:hover:not(:disabled) {
228
+ background: rgba(255, 255, 255, 0.1);
229
+ color: rgba(34, 197, 94, 1);
230
+ }
231
+
232
+ &:active:not(:disabled) {
233
+ transform: scale(0.9);
234
+ }
235
+
236
+ &:disabled {
237
+ opacity: 0.3;
238
+ cursor: default;
239
+ }
240
+
241
+ svg {
242
+ width: 20px;
243
+ height: 20px;
244
+ }
245
+ `;
246
+ export const CloseButton = styled.button `
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ width: 24px;
251
+ height: 24px;
252
+ background: transparent;
253
+ border: none;
254
+ border-radius: 4px;
255
+ color: rgba(239, 68, 68, 1);
256
+ font-size: 10px;
257
+ cursor: pointer;
258
+ transition: all 0.2s ease;
259
+ padding: 3px;
260
+
261
+ &:hover:not(:disabled) {
262
+ background: rgba(255, 255, 255, 0.1);
263
+ color: rgba(239, 68, 68, 1);
264
+ }
265
+
266
+ &:active:not(:disabled) {
267
+ transform: scale(0.9);
268
+ }
269
+
270
+ &:disabled {
271
+ opacity: 0.3;
272
+ cursor: default;
273
+ }
274
+
275
+ svg {
276
+ width: 20px;
277
+ height: 20px;
278
+ }
279
+ `;
280
+ export const ContextMenuButton = styled(MenuButton) `
281
+ svg {
282
+ transform: translateY(0);
283
+ }
284
+ `;
285
+ export const AddButton = styled.button `
286
+ display: flex;
287
+ align-items: center;
288
+ justify-content: center;
289
+ width: 26px;
290
+ height: 26px;
291
+ background: rgba(255, 255, 255, 0.15);
292
+ border: 1px dashed rgba(255, 255, 255, 0.4);
149
293
  border-radius: 8px;
150
294
  color: white;
151
- font-size: 16px;
295
+ font-size: 18px;
296
+ font-weight: bold;
297
+ line-height: 0;
152
298
  cursor: pointer;
153
299
  transition: all 0.2s ease;
154
300
  position: relative;
301
+ margin-right: 6px;
302
+ margin-left: 8px;
303
+ padding: 0;
155
304
 
156
305
  &:hover {
157
- background: ${props => props.$isActive
158
- ? 'rgba(0, 0, 0, 0.25)'
159
- : 'rgba(0, 0, 0, 0.15)'};
160
- border-color: rgba(255, 255, 255, 0.35);
161
- transform: scale(1.05);
306
+ background: rgba(255, 255, 255, 0.25);
307
+ border-color: rgba(255, 255, 255, 0.6);
162
308
  }
163
309
 
164
310
  &:active {
165
311
  transform: scale(0.95);
166
312
  }
167
-
168
- svg {
169
- width: 20px;
170
- height: 20px;
171
- }
172
313
  `;
173
314
  export const RemoveButton = styled.button `
174
315
  position: absolute;
@@ -177,55 +318,60 @@ export const RemoveButton = styled.button `
177
318
  width: 20px;
178
319
  height: 20px;
179
320
  background: #ef4444;
180
- border: 2px solid white;
321
+ border: none;
181
322
  border-radius: 50%;
182
323
  color: white;
183
- font-size: 12px;
324
+ font-size: 14px;
184
325
  font-weight: bold;
326
+ line-height: 0;
185
327
  cursor: pointer;
186
328
  display: flex;
187
329
  align-items: center;
188
330
  justify-content: center;
331
+ padding: 0;
189
332
  transition: all 0.2s ease;
190
333
  z-index: 1;
191
334
 
192
335
  &:hover {
193
336
  background: #dc2626;
194
- transform: scale(1.15);
195
337
  }
196
338
 
197
339
  &:active {
198
- transform: scale(0.9);
340
+ background: #b91c1c;
199
341
  }
200
342
  `;
201
- export const OrientationToggle = styled.button `
343
+ export const UndoButton = styled.button `
202
344
  display: flex;
203
345
  align-items: center;
204
346
  justify-content: center;
205
- width: 20px;
206
- height: 20px;
347
+ width: 24px;
348
+ height: 24px;
207
349
  background: transparent;
208
350
  border: none;
209
351
  border-radius: 4px;
210
- color: rgba(255, 255, 255, 0.5);
352
+ color: rgba(249, 115, 22, 1);
211
353
  font-size: 10px;
212
354
  cursor: pointer;
213
355
  transition: all 0.2s ease;
214
356
  padding: 2px;
215
- transform: ${props => props.$orientation === 'vertical' ? 'rotate(90deg)' : 'rotate(0deg)'};
216
357
 
217
- &:hover {
358
+ &:hover:not(:disabled) {
218
359
  background: rgba(255, 255, 255, 0.1);
219
- color: rgba(255, 255, 255, 0.8);
360
+ color: rgba(249, 115, 22, 1);
220
361
  }
221
362
 
222
- &:active {
223
- transform: ${props => props.$orientation === 'vertical' ? 'rotate(90deg) scale(0.9)' : 'scale(0.9)'};
363
+ &:active:not(:disabled) {
364
+ transform: scale(0.9);
365
+ }
366
+
367
+ &:disabled {
368
+ opacity: 0.3;
369
+ cursor: default;
224
370
  }
225
371
 
226
372
  svg {
227
- width: 10px;
228
- height: 10px;
373
+ width: 16px;
374
+ height: 16px;
229
375
  }
230
376
  `;
231
377
  export const DraggableItem = styled.div `
@@ -265,3 +411,9 @@ export const ContextMenuWrapper = styled.div `
265
411
  position: static;
266
412
  display: contents;
267
413
  `;
414
+ export const ButtonGroup = styled.div `
415
+ display: flex;
416
+ flex-direction: ${props => props.$orientation === 'vertical' ? 'column' : 'row'};
417
+ align-items: center;
418
+ gap: 0;
419
+ `;
@@ -6,15 +6,21 @@ export interface TMFloatingMenuItem {
6
6
  onClick: () => void;
7
7
  disabled?: boolean;
8
8
  isPinned?: boolean;
9
- originalMenuItem?: TMContextMenuItemProps;
9
+ isSeparator?: boolean;
10
+ isToggle?: boolean;
11
+ staticItem?: React.ReactNode;
10
12
  }
11
13
  export interface TMFloatingMenuBarProps {
12
14
  containerRef: React.RefObject<HTMLElement | null>;
13
15
  contextMenuItems?: TMContextMenuItemProps[];
14
- storageKey?: string;
15
16
  isConstrained?: boolean;
16
17
  defaultPosition?: Position;
17
18
  maxItems?: number;
19
+ contextMenuDefaultPinnedIds?: string[];
20
+ defaultOrientation?: 'horizontal' | 'vertical';
21
+ defaultItems?: TMFloatingMenuItem[];
22
+ disbaleConfigMode?: boolean;
23
+ bgColor?: string;
18
24
  }
19
25
  export interface Position {
20
26
  x: number;
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import styled from 'styled-components';
4
- import { ContextMenu, LoadIndicator } from 'devextreme-react';
4
+ import { LoadIndicator } from 'devextreme-react';
5
5
  import { LocalStorageService } from '@topconsultnpm/sdk-ts';
6
6
  import TMTooltip from './TMTooltip';
7
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
7
8
  const Container = styled.div `
8
9
  width: 100%;
9
10
  height: 100%;
@@ -154,12 +155,15 @@ const DEFAULT_COLORS = ['#339af0', '#fa5252', '#40c057', '#f59f00', '#e64980', '
154
155
  const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChange }) => {
155
156
  const [openAccordions, setOpenAccordions] = useState({});
156
157
  const [isInitialized, setIsInitialized] = useState(false);
157
- const [anchorEl, setAnchorEl] = useState(null);
158
- const [contextMenuItems, setContextMenuItems] = useState([]);
159
158
  const [focusedItem, setFocusedItem] = useState(undefined);
159
+ // Item context menu state
160
+ const [itemContextMenuVisible, setItemContextMenuVisible] = useState(false);
161
+ const [itemContextMenuPosition, setItemContextMenuPosition] = useState({ x: 0, y: 0 });
162
+ const [itemContextMenuItems, setItemContextMenuItems] = useState([]);
163
+ // Header context menu state
160
164
  const [headerContextGroupId, setHeaderContextGroupId] = useState(null);
161
165
  const [headerContextVisible, setHeaderContextVisible] = useState(false);
162
- const [headerContextPosition, setHeaderContextPosition] = useState(null);
166
+ const [headerContextPosition, setHeaderContextPosition] = useState({ x: 0, y: 0 });
163
167
  useEffect(() => {
164
168
  const initialState = {};
165
169
  if (!groups || groups.length === 0) {
@@ -240,11 +244,21 @@ const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChan
240
244
  if (menuItems.length === 0) {
241
245
  return;
242
246
  }
243
- setAnchorEl(event.currentTarget);
244
- setContextMenuItems(menuItems);
247
+ // Convert to TMContextMenuItemProps format
248
+ const convertedItems = menuItems.map((mi) => ({
249
+ name: mi.text || mi.name || '',
250
+ // Only pass icon if it's a React element, not a string (DevExtreme used string icons)
251
+ icon: typeof mi.icon === 'string' ? undefined : mi.icon,
252
+ disabled: mi.disabled,
253
+ onClick: mi.onClick,
254
+ submenu: mi.items || mi.submenu,
255
+ }));
256
+ setItemContextMenuPosition({ x: event.clientX, y: event.clientY });
257
+ setItemContextMenuItems(convertedItems);
258
+ setItemContextMenuVisible(true);
245
259
  };
246
260
  const closeContextMenu = useCallback(() => {
247
- setAnchorEl(null);
261
+ setItemContextMenuVisible(false);
248
262
  }, []);
249
263
  const handleHeaderContextMenu = (event, groupId) => {
250
264
  event.preventDefault();
@@ -260,12 +274,11 @@ const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChan
260
274
  };
261
275
  const closeHeaderContextMenu = useCallback(() => {
262
276
  setHeaderContextVisible(false);
263
- setHeaderContextPosition(null);
264
277
  setHeaderContextGroupId(null);
265
278
  }, []);
266
279
  const headerContextMenuItems = headerContextGroupId ? [
267
280
  {
268
- text: openAccordions[headerContextGroupId] ? 'Collassa' : 'Espandi',
281
+ name: openAccordions[headerContextGroupId] ? 'Collassa' : 'Espandi',
269
282
  onClick: () => {
270
283
  toggleAccordion(headerContextGroupId);
271
284
  closeHeaderContextMenu();
@@ -295,19 +308,19 @@ const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChan
295
308
  const color = getGroupColor(group, index);
296
309
  const isOpen = openAccordions[group.id] ?? true;
297
310
  if (group.customComponent) {
298
- return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), isOpen && (_jsx(CustomComponentContainer, { children: group.customComponent }))] }, group.id));
311
+ return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { id: `accordion-header-${group.id}`, "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), isOpen && (_jsx(CustomComponentContainer, { children: group.customComponent }))] }, group.id));
299
312
  }
300
313
  if (!group.dataSource || group.dataSource.length === 0)
301
314
  return null;
302
315
  if (!group.renderItem) {
303
- return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), _jsx(AccordionContent, { "$isOpen": isOpen, "$maxHeight": 100, children: _jsxs(ErrorMessage, { children: ["\u26A0\uFE0F renderItem function is required for \"", group.title, "\" group"] }) })] }, group.id));
316
+ return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { id: `accordion-header-${group.id}`, "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), _jsx(AccordionContent, { "$isOpen": isOpen, "$maxHeight": 100, children: _jsxs(ErrorMessage, { children: ["\u26A0\uFE0F renderItem function is required for \"", group.title, "\" group"] }) })] }, group.id));
304
317
  }
305
318
  const itemHeight = group.itemHeight || 80;
306
319
  const maxHeight = group.dataSource.length * itemHeight + 20;
307
- return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), _jsx(AccordionContent, { "$isOpen": isOpen, "$maxHeight": maxHeight, children: _jsx(ItemsList, { children: group.dataSource.map((item, itemIndex) => {
320
+ return (_jsxs(AccordionItem, { children: [_jsxs(AccordionHeader, { id: `accordion-header-${group.id}`, "$color": color, "$isOpen": isOpen, onClick: (e) => handleHeaderClick(e, group.id), onContextMenu: (e) => handleHeaderContextMenu(e, group.id), children: [_jsxs(AccordionTitle, { children: [group.icon, _jsx(TitleText, { children: group.title })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [renderBadges(group, color), _jsx(ToggleIcon, { "$isOpen": isOpen, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M4 6L8 10L12 6", stroke: "#495057", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), _jsx(AccordionContent, { "$isOpen": isOpen, "$maxHeight": maxHeight, children: _jsx(ItemsList, { children: group.dataSource.map((item, itemIndex) => {
308
321
  const isSelected = selectedItem === item;
309
322
  const isFocused = focusedItem === item;
310
- return (_jsx(ListItem, { "$isSelected": isSelected, "$color": color, onClick: () => handleItemClick(item, group), onDoubleClick: () => handleItemDoubleClick(item, group), onMouseEnter: () => setFocusedItem(item), onMouseLeave: () => setFocusedItem(undefined), onContextMenu: (e) => handleContextMenu(e, item, group), children: group.renderItem(item, isSelected, isFocused, color) }, itemIndex * 2));
323
+ return (_jsx(ListItem, { id: `accordion-item-${group.id}-${itemIndex}`, className: "tm-accordion-list-item", "$isSelected": isSelected, "$color": color, onClick: () => handleItemClick(item, group), onDoubleClick: () => handleItemDoubleClick(item, group), onMouseEnter: () => setFocusedItem(item), onMouseLeave: () => setFocusedItem(undefined), onContextMenu: (e) => handleContextMenu(e, item, group), children: group.renderItem(item, isSelected, isFocused, color) }, itemIndex * 2));
311
324
  }) }) })] }, group.id));
312
325
  };
313
326
  if (!isInitialized) {
@@ -321,6 +334,14 @@ const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChan
321
334
  event.preventDefault();
322
335
  }
323
336
  };
324
- return (_jsxs(_Fragment, { children: [_jsx(Container, { onContextMenu: handleContainerContextMenu, children: groups.map((group, index) => renderAccordion(group, index)) }), anchorEl && contextMenuItems.length > 0 && (_jsx(ContextMenu, { dataSource: contextMenuItems, target: anchorEl, onHiding: closeContextMenu })), headerContextPosition && headerContextMenuItems.length > 0 && (_jsx(ContextMenu, { dataSource: headerContextMenuItems, visible: headerContextVisible, position: { my: 'left top', at: 'left top', offset: `${headerContextPosition.x} ${headerContextPosition.y}` }, onHiding: closeHeaderContextMenu }))] }));
337
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { onContextMenu: handleContainerContextMenu, children: groups.map((group, index) => renderAccordion(group, index)) }), _jsx(TMContextMenu, { items: itemContextMenuItems, target: ".tm-accordion-list-item", externalControl: {
338
+ visible: itemContextMenuVisible,
339
+ position: itemContextMenuPosition,
340
+ onClose: closeContextMenu
341
+ } }), _jsx(TMContextMenu, { items: headerContextMenuItems, target: "[id^='accordion-header-']", externalControl: {
342
+ visible: headerContextVisible,
343
+ position: headerContextPosition,
344
+ onClose: closeHeaderContextMenu
345
+ } })] }));
325
346
  };
326
347
  export default TMAccordion;