@topconsultnpm/sdkui-react 6.19.0-test.1 → 6.19.0-test2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/IconsS4t/add.svg +12 -12
- package/lib/assets/IconsS4t/aggiorna.svg +18 -18
- package/lib/assets/IconsS4t/bookmark.svg +42 -42
- package/lib/assets/IconsS4t/cancella.svg +15 -15
- package/lib/assets/IconsS4t/check-box.svg +19 -19
- package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/down.svg +28 -28
- package/lib/assets/IconsS4t/edit-file.svg +19 -19
- package/lib/assets/IconsS4t/edita.svg +32 -32
- package/lib/assets/IconsS4t/firma.svg +19 -19
- package/lib/assets/IconsS4t/icona_download.svg +16 -16
- package/lib/assets/IconsS4t/info.svg +51 -51
- package/lib/assets/IconsS4t/left.svg +20 -20
- package/lib/assets/IconsS4t/line.svg +40 -40
- package/lib/assets/IconsS4t/more.svg +19 -19
- package/lib/assets/IconsS4t/plus.svg +23 -23
- package/lib/assets/IconsS4t/printer.svg +49 -49
- package/lib/assets/IconsS4t/radio-on-button.svg +25 -25
- package/lib/assets/IconsS4t/rectangle.svg +41 -41
- package/lib/assets/IconsS4t/redo.svg +19 -19
- package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -40
- package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/right.svg +22 -22
- package/lib/assets/IconsS4t/searchbar.svg +21 -21
- package/lib/assets/IconsS4t/text-box.svg +36 -36
- package/lib/assets/IconsS4t/tick.svg +8 -8
- package/lib/assets/IconsS4t/trash-white.svg +10 -10
- package/lib/assets/IconsS4t/undo.svg +19 -19
- package/lib/assets/IconsS4t/up.svg +32 -32
- package/lib/assets/IconsS4t/video-streaming.svg +2 -2
- package/lib/assets/IconsS4t/zoom-in.svg +58 -58
- package/lib/assets/IconsS4t/zoom-out.svg +56 -56
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/six.svg +3 -3
- package/lib/assets/thumbnails/index.ts +39 -39
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/Styled.js +302 -302
- package/lib/components/base/TMAccordion.js +43 -43
- package/lib/components/base/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMAreaManager.js +23 -23
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +136 -136
- package/lib/components/base/TMClosableList.js +46 -46
- package/lib/components/base/TMConfirm.js +20 -20
- package/lib/components/base/TMContextMenu.js +4 -4
- package/lib/components/base/TMContextMenuOLD.js +25 -25
- package/lib/components/base/TMCounterBar.js +32 -32
- package/lib/components/base/TMCounterContainer.js +30 -30
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +90 -35
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMDropDownMenu.js +24 -24
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.js +19 -19
- package/lib/components/base/TMFloatingToolbar.js +34 -34
- package/lib/components/base/TMLayout.js +44 -44
- package/lib/components/base/TMList.js +34 -34
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +79 -34
- package/lib/components/base/TMPanel.js +57 -57
- package/lib/components/base/TMPopUp.js +186 -117
- package/lib/components/base/TMProgressBar.js +20 -20
- package/lib/components/base/TMResizableMenu.js +28 -28
- package/lib/components/base/TMRightSidebar.js +40 -40
- package/lib/components/base/TMSpinner.js +121 -121
- package/lib/components/base/TMTab.js +11 -11
- package/lib/components/base/TMToggleButton.js +36 -36
- package/lib/components/base/TMToolbarCard.js +35 -35
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/base/TMTreeView.js +16 -16
- package/lib/components/base/TMUserAvatar.js +7 -7
- package/lib/components/base/TMWaitPanel.js +30 -24
- package/lib/components/choosers/TMCultureIDPicker.js +35 -35
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +54 -54
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMCheckBox.js +24 -24
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/editors/TMDropDown.js +43 -43
- package/lib/components/editors/TMEditorStyled.js +71 -71
- package/lib/components/editors/TMHtmlContentDisplay.js +16 -16
- package/lib/components/editors/TMLocalizedTextBox.js +31 -31
- package/lib/components/editors/TMMetadataValues.js +62 -21
- package/lib/components/editors/TMRadioButton.js +39 -39
- package/lib/components/editors/TMSummary.js +39 -39
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +56 -22
- package/lib/components/editors/TMTextBox.js +53 -23
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +21 -9
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +321 -62
- package/lib/components/features/documents/TMDcmtIcon.js +17 -12
- package/lib/components/features/documents/TMDcmtPreview.js +75 -38
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +52 -52
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -14
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -58
- package/lib/components/features/search/TMSearchResult.js +160 -35
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +117 -60
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/search/TMTreeSelector.js +66 -66
- package/lib/components/features/tasks/TMTaskForm.js +42 -36
- package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
- package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
- package/lib/components/features/tasks/TMTasksUtils.js +18 -3
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +12 -6
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +9 -9
- package/lib/components/features/workflow/TMWorkflowPopup.js +44 -44
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +29 -29
- package/lib/components/features/workflow/diagram/ConnectionForm.js +10 -10
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +57 -57
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +40 -35
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +12 -12
- package/lib/components/features/workflow/diagram/RecipientList.js +39 -39
- package/lib/components/features/workflow/diagram/WFDiagram.js +317 -285
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +4 -4
- package/lib/components/forms/Login/Chooser.js +35 -35
- package/lib/components/forms/Login/Menu.js +22 -22
- package/lib/components/forms/Login/SelectBox.js +46 -46
- package/lib/components/forms/Login/TMLoginForm.js +14 -14
- package/lib/components/forms/Login/TextBox.js +57 -57
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/forms/TMSaveForm.js +3 -11
- package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
- package/lib/components/grids/TMBlogAttachments.js +10 -5
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +100 -39
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +32 -11
- package/lib/components/grids/TMRecentsManager.js +51 -51
- package/lib/components/grids/TMValidationItemsList.js +48 -48
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +14 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +36 -35
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryEditor.js +17 -17
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +15 -15
- package/lib/components/settings/SettingsAppearance.js +9 -1
- package/lib/components/sidebar/TMCommandsPanel.js +10 -10
- package/lib/components/sidebar/TMHeader.js +307 -307
- package/lib/components/sidebar/TMSidebar.js +24 -24
- package/lib/components/sidebar/TMSidebarItem.js +21 -21
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/components/wizard/TMStepIndicator.js +102 -102
- package/lib/components/wizard/TMWizard.js +29 -29
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Globals.js +9 -1
- package/lib/helper/SDKUI_Localizator.d.ts +50 -2
- package/lib/helper/SDKUI_Localizator.js +502 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +4 -1
- package/lib/helper/TMIcons.js +14 -2
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +33 -32
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +227 -60
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +12 -17
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +10 -6
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +3 -1
- package/package.json +54 -54
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
- package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
|
@@ -14,49 +14,49 @@ const TMAccordion = ({ title, titleSize = 'Medium', children, defaultOpen = true
|
|
|
14
14
|
};
|
|
15
15
|
export default TMAccordion;
|
|
16
16
|
//#region Styled Components
|
|
17
|
-
const StyledAccordionContainer = styled.div `
|
|
18
|
-
margin-bottom: 10px;
|
|
19
|
-
overflow: hidden;
|
|
17
|
+
const StyledAccordionContainer = styled.div `
|
|
18
|
+
margin-bottom: 10px;
|
|
19
|
+
overflow: hidden;
|
|
20
20
|
`;
|
|
21
|
-
const StyledGroupTemplate = styled.div `
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
background: none !important;
|
|
24
|
-
border: none !important;
|
|
25
|
-
box-shadow: none !important;
|
|
26
|
-
padding: 10px;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: row;
|
|
29
|
-
gap: 5px;
|
|
30
|
-
align-items: center;
|
|
31
|
-
font-size: 1rem;
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
color: ${() => TMColors.primaryColor};
|
|
34
|
-
position: relative;
|
|
35
|
-
|
|
36
|
-
.tm-accordion-title, .tm-accordion-title.small {
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
margin: 0;
|
|
39
|
-
}
|
|
40
|
-
.tm-accordion-title.small {
|
|
41
|
-
font-size: 1rem;
|
|
42
|
-
}
|
|
43
|
-
.tm-accordion-title {
|
|
44
|
-
font-size: 1.25rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&::after {
|
|
48
|
-
content: '';
|
|
49
|
-
display: block;
|
|
50
|
-
width: 90%;
|
|
51
|
-
margin: 0 auto;
|
|
52
|
-
border-bottom: 1px solid #00A99D;
|
|
53
|
-
margin-top: 8px;
|
|
54
|
-
position: absolute;
|
|
55
|
-
left: 5%;
|
|
56
|
-
bottom: 0;
|
|
57
|
-
}
|
|
21
|
+
const StyledGroupTemplate = styled.div `
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
background: none !important;
|
|
24
|
+
border: none !important;
|
|
25
|
+
box-shadow: none !important;
|
|
26
|
+
padding: 10px;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
gap: 5px;
|
|
30
|
+
align-items: center;
|
|
31
|
+
font-size: 1rem;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: ${() => TMColors.primaryColor};
|
|
34
|
+
position: relative;
|
|
35
|
+
|
|
36
|
+
.tm-accordion-title, .tm-accordion-title.small {
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
.tm-accordion-title.small {
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
}
|
|
43
|
+
.tm-accordion-title {
|
|
44
|
+
font-size: 1.25rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&::after {
|
|
48
|
+
content: '';
|
|
49
|
+
display: block;
|
|
50
|
+
width: 90%;
|
|
51
|
+
margin: 0 auto;
|
|
52
|
+
border-bottom: 1px solid #00A99D;
|
|
53
|
+
margin-top: 8px;
|
|
54
|
+
position: absolute;
|
|
55
|
+
left: 5%;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
}
|
|
58
58
|
`;
|
|
59
|
-
const StyledAccordionContent = styled.div `
|
|
60
|
-
padding: 10px;
|
|
61
|
-
background-color: #fff; /* White background for the content area */
|
|
59
|
+
const StyledAccordionContent = styled.div `
|
|
60
|
+
padding: 10px;
|
|
61
|
+
background-color: #fff; /* White background for the content area */
|
|
62
62
|
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TMAccordionBadge {
|
|
3
|
+
badge: number;
|
|
4
|
+
tooltip?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TMAccordionGroup {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
dataSource?: Array<any>;
|
|
10
|
+
color?: string;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
isExpanded?: boolean;
|
|
13
|
+
contextMenuItems?: Array<any> | ((item: any) => Array<any>);
|
|
14
|
+
onItemClick?: (item: any) => void;
|
|
15
|
+
onItemDoubleClick?: (item: any) => void;
|
|
16
|
+
renderItem?: (item: any, isSelected: boolean, isFocused: boolean, color: string) => React.ReactNode;
|
|
17
|
+
itemHeight?: number;
|
|
18
|
+
badges?: TMAccordionBadge[];
|
|
19
|
+
customComponent?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface TMAccordionProps {
|
|
22
|
+
groups?: Array<TMAccordionGroup>;
|
|
23
|
+
localStorageKey?: string;
|
|
24
|
+
selectedItem?: any;
|
|
25
|
+
onSelectedItemChange?: (item: any) => void;
|
|
26
|
+
}
|
|
27
|
+
declare const TMAccordion: React.FC<TMAccordionProps>;
|
|
28
|
+
export default TMAccordion;
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { ContextMenu, LoadIndicator } from 'devextreme-react';
|
|
5
|
+
import { LocalStorageService } from '@topconsultnpm/sdk-ts';
|
|
6
|
+
import TMTooltip from './TMTooltip';
|
|
7
|
+
const Container = styled.div `
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
overflow-x: hidden;
|
|
12
|
+
padding: 5px;
|
|
13
|
+
|
|
14
|
+
&::-webkit-scrollbar {
|
|
15
|
+
width: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&::-webkit-scrollbar-track {
|
|
19
|
+
background: #f1f3f5;
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&::-webkit-scrollbar-thumb {
|
|
24
|
+
background: #adb5bd;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
background: #868e96;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&::before {
|
|
33
|
+
content: '';
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
bottom: 0;
|
|
39
|
+
z-index: -1;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
const AccordionItem = styled.div `
|
|
43
|
+
margin-bottom: 16px;
|
|
44
|
+
border-radius: 5px;
|
|
45
|
+
background: white;
|
|
46
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
transition: box-shadow 0.3s ease;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const AccordionHeader = styled.div `
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
padding: 6px 12px;
|
|
59
|
+
background: ${props => `linear-gradient(135deg, ${props.$color}15 0%, ${props.$color}08 100%)`};
|
|
60
|
+
border-left: 4px solid ${props => props.$color};
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
transition: all 0.3s ease;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
background: ${props => `linear-gradient(135deg, ${props.$color}25 0%, ${props.$color}15 100%)`};
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
const AccordionTitle = styled.div `
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
flex: 1;
|
|
73
|
+
`;
|
|
74
|
+
const TitleText = styled.h3 `
|
|
75
|
+
margin: 0;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
color: #212529;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 6px;
|
|
82
|
+
`;
|
|
83
|
+
const BadgeContainer = styled.div `
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 6px;
|
|
87
|
+
`;
|
|
88
|
+
const Badge = styled.div `
|
|
89
|
+
min-width: 22px;
|
|
90
|
+
height: 22px;
|
|
91
|
+
padding: 0 8px;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
background: ${props => props.$color};
|
|
96
|
+
color: white;
|
|
97
|
+
border-radius: 11px;
|
|
98
|
+
font-size: 11px;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
box-shadow: 0 2px 6px ${props => props.$color}40;
|
|
101
|
+
`;
|
|
102
|
+
const CustomComponentContainer = styled.div `
|
|
103
|
+
padding: 8px;
|
|
104
|
+
`;
|
|
105
|
+
const ErrorMessage = styled.div `
|
|
106
|
+
padding: 20px;
|
|
107
|
+
text-align: center;
|
|
108
|
+
color: #fa5252;
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
`;
|
|
112
|
+
const ToggleIcon = styled.div `
|
|
113
|
+
width: 24px;
|
|
114
|
+
height: 24px;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
background: white;
|
|
119
|
+
border-radius: 6px;
|
|
120
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
121
|
+
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
122
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
123
|
+
`;
|
|
124
|
+
const AccordionContent = styled.div `
|
|
125
|
+
max-height: ${props => props.$isOpen ? `${props.$maxHeight}px` : '0'};
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
128
|
+
`;
|
|
129
|
+
const ItemsList = styled.div `
|
|
130
|
+
padding: 4px;
|
|
131
|
+
`;
|
|
132
|
+
const ListItem = styled.div `
|
|
133
|
+
padding: 2px;
|
|
134
|
+
margin: 2px 0;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
background: ${props => props.$isSelected ? `${props.$color}30` : 'transparent'};
|
|
137
|
+
border: none;
|
|
138
|
+
transition: background 0.2s ease;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
background: ${props => props.$isSelected ? `${props.$color}40` : `${props.$color}08`};
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
const LoadingContainer = styled.div `
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 100%;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
min-height: 200px;
|
|
152
|
+
`;
|
|
153
|
+
const DEFAULT_COLORS = ['#339af0', '#fa5252', '#40c057', '#f59f00', '#e64980', '#7950f2'];
|
|
154
|
+
const TMAccordion = ({ groups, localStorageKey, selectedItem, onSelectedItemChange }) => {
|
|
155
|
+
const [openAccordions, setOpenAccordions] = useState({});
|
|
156
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
157
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
158
|
+
const [contextMenuItems, setContextMenuItems] = useState([]);
|
|
159
|
+
const [focusedItem, setFocusedItem] = useState(undefined);
|
|
160
|
+
const [headerContextGroupId, setHeaderContextGroupId] = useState(null);
|
|
161
|
+
const [headerContextVisible, setHeaderContextVisible] = useState(false);
|
|
162
|
+
const [headerContextPosition, setHeaderContextPosition] = useState(null);
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
const initialState = {};
|
|
165
|
+
if (!groups || groups.length === 0) {
|
|
166
|
+
setIsInitialized(true);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (localStorageKey) {
|
|
170
|
+
const savedState = LocalStorageService.getItem(localStorageKey);
|
|
171
|
+
if (savedState && savedState.length === groups.length) {
|
|
172
|
+
groups.forEach((group, index) => {
|
|
173
|
+
initialState[group.id] = savedState[index] === '1';
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
groups.forEach(group => {
|
|
178
|
+
initialState[group.id] = group.isExpanded !== false;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
groups.forEach(group => {
|
|
184
|
+
initialState[group.id] = group.isExpanded !== false;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
setOpenAccordions(initialState);
|
|
188
|
+
setIsInitialized(true);
|
|
189
|
+
}, []);
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if (!isInitialized || !groups)
|
|
192
|
+
return;
|
|
193
|
+
setOpenAccordions(prev => {
|
|
194
|
+
const newState = { ...prev };
|
|
195
|
+
groups.forEach(group => {
|
|
196
|
+
if (!(group.id in newState)) {
|
|
197
|
+
newState[group.id] = group.isExpanded !== false;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
Object.keys(newState).forEach(groupId => {
|
|
201
|
+
if (!groups.some(g => g.id === groupId)) { //nosonar
|
|
202
|
+
delete newState[groupId];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
return newState;
|
|
206
|
+
});
|
|
207
|
+
}, [groups, isInitialized]);
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
if (!isInitialized || !groups)
|
|
210
|
+
return;
|
|
211
|
+
if (localStorageKey && Object.keys(openAccordions).length === groups.length) {
|
|
212
|
+
const stateString = groups.map(group => openAccordions[group.id] ? '1' : '0').join('');
|
|
213
|
+
LocalStorageService.setItem(localStorageKey, stateString);
|
|
214
|
+
}
|
|
215
|
+
}, [openAccordions, groups, localStorageKey, isInitialized]);
|
|
216
|
+
const toggleAccordion = (groupId) => {
|
|
217
|
+
setOpenAccordions(prev => ({ ...prev, [groupId]: !prev[groupId] }));
|
|
218
|
+
};
|
|
219
|
+
const handleItemClick = (item, group) => {
|
|
220
|
+
if (onSelectedItemChange) {
|
|
221
|
+
onSelectedItemChange(item);
|
|
222
|
+
}
|
|
223
|
+
if (group.onItemClick) {
|
|
224
|
+
group.onItemClick(item);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const handleItemDoubleClick = (item, group) => {
|
|
228
|
+
if (group.onItemDoubleClick) {
|
|
229
|
+
group.onItemDoubleClick(item);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
const handleContextMenu = (event, item, group) => {
|
|
233
|
+
event.preventDefault();
|
|
234
|
+
if (!group.contextMenuItems) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const menuItems = typeof group.contextMenuItems === 'function'
|
|
238
|
+
? group.contextMenuItems(item)
|
|
239
|
+
: group.contextMenuItems;
|
|
240
|
+
if (menuItems.length === 0) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
setAnchorEl(event.currentTarget);
|
|
244
|
+
setContextMenuItems(menuItems);
|
|
245
|
+
};
|
|
246
|
+
const closeContextMenu = useCallback(() => {
|
|
247
|
+
setAnchorEl(null);
|
|
248
|
+
}, []);
|
|
249
|
+
const handleHeaderContextMenu = (event, groupId) => {
|
|
250
|
+
event.preventDefault();
|
|
251
|
+
event.stopPropagation();
|
|
252
|
+
setHeaderContextPosition({ x: event.clientX, y: event.clientY });
|
|
253
|
+
setHeaderContextGroupId(groupId);
|
|
254
|
+
setHeaderContextVisible(true);
|
|
255
|
+
};
|
|
256
|
+
const handleHeaderClick = (event, groupId) => {
|
|
257
|
+
if (event.button !== 0)
|
|
258
|
+
return;
|
|
259
|
+
toggleAccordion(groupId);
|
|
260
|
+
};
|
|
261
|
+
const closeHeaderContextMenu = useCallback(() => {
|
|
262
|
+
setHeaderContextVisible(false);
|
|
263
|
+
setHeaderContextPosition(null);
|
|
264
|
+
setHeaderContextGroupId(null);
|
|
265
|
+
}, []);
|
|
266
|
+
const headerContextMenuItems = headerContextGroupId ? [
|
|
267
|
+
{
|
|
268
|
+
text: openAccordions[headerContextGroupId] ? 'Collassa' : 'Espandi',
|
|
269
|
+
onClick: () => {
|
|
270
|
+
toggleAccordion(headerContextGroupId);
|
|
271
|
+
closeHeaderContextMenu();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
] : [];
|
|
275
|
+
const getGroupColor = (group, index) => {
|
|
276
|
+
return group.color || DEFAULT_COLORS[index % DEFAULT_COLORS.length];
|
|
277
|
+
};
|
|
278
|
+
const renderBadges = (group, color) => {
|
|
279
|
+
if (group.badges && group.badges.length > 0) {
|
|
280
|
+
return (_jsx(BadgeContainer, { children: group.badges.map((badgeData, idx) => {
|
|
281
|
+
const badgeKey = `${group.id}-badge-${badgeData.badge}-${idx}`;
|
|
282
|
+
const badge = _jsx(Badge, { "$color": color, children: badgeData.badge });
|
|
283
|
+
if (badgeData.tooltip) {
|
|
284
|
+
return (_jsx(TMTooltip, { content: badgeData.tooltip, children: badge }, badgeKey));
|
|
285
|
+
}
|
|
286
|
+
return _jsx("span", { children: badge }, badgeKey);
|
|
287
|
+
}) }));
|
|
288
|
+
}
|
|
289
|
+
if (group.dataSource && group.dataSource.length > 0) {
|
|
290
|
+
return _jsx(Badge, { "$color": color, children: group.dataSource.length });
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
};
|
|
294
|
+
const renderAccordion = (group, index) => {
|
|
295
|
+
const color = getGroupColor(group, index);
|
|
296
|
+
const isOpen = openAccordions[group.id] ?? true;
|
|
297
|
+
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));
|
|
299
|
+
}
|
|
300
|
+
if (!group.dataSource || group.dataSource.length === 0)
|
|
301
|
+
return null;
|
|
302
|
+
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));
|
|
304
|
+
}
|
|
305
|
+
const itemHeight = group.itemHeight || 80;
|
|
306
|
+
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) => {
|
|
308
|
+
const isSelected = selectedItem === item;
|
|
309
|
+
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));
|
|
311
|
+
}) }) })] }, group.id));
|
|
312
|
+
};
|
|
313
|
+
if (!isInitialized) {
|
|
314
|
+
return (_jsx(LoadingContainer, { children: _jsx(LoadIndicator, { height: 40, width: 40 }) }));
|
|
315
|
+
}
|
|
316
|
+
if (!groups || groups.length === 0) {
|
|
317
|
+
return (_jsx(Container, { children: _jsx(ErrorMessage, { children: "\u26A0\uFE0F No accordion groups defined" }) }));
|
|
318
|
+
}
|
|
319
|
+
const handleContainerContextMenu = (event) => {
|
|
320
|
+
if (event.target === event.currentTarget) {
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
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 }))] }));
|
|
325
|
+
};
|
|
326
|
+
export default TMAccordion;
|
|
@@ -27,29 +27,29 @@ export class TMFileSystemItem {
|
|
|
27
27
|
let abortController = new AbortController();
|
|
28
28
|
const svgString = encodeURIComponent(renderToStaticMarkup(_jsx(IconFolderForCSS, { fill: "#9fc6e7" })));
|
|
29
29
|
const svgDataUrl = `data:image/svg+xml,${svgString}`;
|
|
30
|
-
const StyledFileManagerWrapper = styled.div `
|
|
31
|
-
.dx-filemanager .dx-treeview-item .dx-icon-folder {
|
|
32
|
-
display: none !important;
|
|
33
|
-
}
|
|
34
|
-
.dx-filemanager .dx-treeview-item .dx-treeview-item-content {
|
|
35
|
-
position: relative !important;
|
|
36
|
-
padding-left: 26px !important;
|
|
37
|
-
min-height: 22px !important;
|
|
38
|
-
}
|
|
39
|
-
.dx-filemanager .dx-treeview-item .dx-treeview-item-content::before {
|
|
40
|
-
content: '';
|
|
41
|
-
position: absolute;
|
|
42
|
-
left: 0;
|
|
43
|
-
top: 60%;
|
|
44
|
-
width: 20px;
|
|
45
|
-
height: 20px;
|
|
46
|
-
transform: translateY(-50%);
|
|
47
|
-
background-image: url("${svgDataUrl}");
|
|
48
|
-
background-size: contain;
|
|
49
|
-
background-repeat: no-repeat;
|
|
50
|
-
display: inline-block;
|
|
51
|
-
z-index: 1;
|
|
52
|
-
}
|
|
30
|
+
const StyledFileManagerWrapper = styled.div `
|
|
31
|
+
.dx-filemanager .dx-treeview-item .dx-icon-folder {
|
|
32
|
+
display: none !important;
|
|
33
|
+
}
|
|
34
|
+
.dx-filemanager .dx-treeview-item .dx-treeview-item-content {
|
|
35
|
+
position: relative !important;
|
|
36
|
+
padding-left: 26px !important;
|
|
37
|
+
min-height: 22px !important;
|
|
38
|
+
}
|
|
39
|
+
.dx-filemanager .dx-treeview-item .dx-treeview-item-content::before {
|
|
40
|
+
content: '';
|
|
41
|
+
position: absolute;
|
|
42
|
+
left: 0;
|
|
43
|
+
top: 60%;
|
|
44
|
+
width: 20px;
|
|
45
|
+
height: 20px;
|
|
46
|
+
transform: translateY(-50%);
|
|
47
|
+
background-image: url("${svgDataUrl}");
|
|
48
|
+
background-size: contain;
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
}
|
|
53
53
|
`;
|
|
54
54
|
const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false }) => {
|
|
55
55
|
// State to store the instance of CustomFileSystemProvider. It is initialized once and used for managing file system operations.
|
|
@@ -16,6 +16,7 @@ export interface ITMButton extends ITMEditorBase {
|
|
|
16
16
|
padding?: string;
|
|
17
17
|
showTooltip?: boolean;
|
|
18
18
|
onClick?: VoidFunction;
|
|
19
|
+
onMouseDown?: (e: any) => any;
|
|
19
20
|
}
|
|
20
21
|
declare const TMButton: React.ForwardRefExoticComponent<ITMButton & React.RefAttributes<HTMLButtonElement>>;
|
|
21
22
|
export default TMButton;
|