@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
|
@@ -15,44 +15,44 @@ const CULTUREIDs_DATASOURCE = [
|
|
|
15
15
|
{ value: CultureIDs.Es_ES, display: "Español", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.Es_ES), alt: "Lang", width: 16, height: 16 }) },
|
|
16
16
|
{ value: CultureIDs.De_DE, display: "Deutsch", icon: _jsx("img", { src: getCultureIDImg(CultureIDs.De_DE), alt: "Lang", width: 16, height: 16 }) },
|
|
17
17
|
];
|
|
18
|
-
const PickerContainer = styled.div `
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
gap: 10px;
|
|
22
|
-
padding: 20px;
|
|
18
|
+
const PickerContainer = styled.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
padding: 20px;
|
|
23
23
|
`;
|
|
24
|
-
const ItemsContainer = styled.div `
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-wrap: wrap;
|
|
27
|
-
gap: 15px;
|
|
28
|
-
justify-content: center;
|
|
24
|
+
const ItemsContainer = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
gap: 15px;
|
|
28
|
+
justify-content: center;
|
|
29
29
|
`;
|
|
30
|
-
const CultureItem = styled.div `
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
text-align: center;
|
|
37
|
-
font-size: 0.9em;
|
|
38
|
-
padding: 10px 15px;
|
|
39
|
-
border-radius: 8px;
|
|
40
|
-
border: 2px solid transparent;
|
|
41
|
-
transition: all 0.2s ease-in-out;
|
|
42
|
-
width: 120px;
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
background-color: #f0f0f0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
${props => props.$isSelected && `
|
|
49
|
-
border-color: #007bff;
|
|
50
|
-
background-color: #e6f2ff;
|
|
51
|
-
`}
|
|
30
|
+
const CultureItem = styled.div `
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
text-align: center;
|
|
37
|
+
font-size: 0.9em;
|
|
38
|
+
padding: 10px 15px;
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
border: 2px solid transparent;
|
|
41
|
+
transition: all 0.2s ease-in-out;
|
|
42
|
+
width: 120px;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
background-color: #f0f0f0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
${props => props.$isSelected && `
|
|
49
|
+
border-color: #007bff;
|
|
50
|
+
background-color: #e6f2ff;
|
|
51
|
+
`}
|
|
52
52
|
`;
|
|
53
|
-
const FlagIcon = styled.div `
|
|
54
|
-
margin-bottom: 5px;
|
|
55
|
-
font-size: 2em;
|
|
53
|
+
const FlagIcon = styled.div `
|
|
54
|
+
margin-bottom: 5px;
|
|
55
|
+
font-size: 2em;
|
|
56
56
|
`;
|
|
57
57
|
const TMCultureIDPicker = ({ selectedValue, onSelectCultureID, placeHolder, width = '100%', icon, backgroundColor, readOnly = false, openChooserBySingleClick = false, buttons = [], elementStyle, isModifiedWhen, label, showClearButton = false, validationItems = [], onValueChanged }) => {
|
|
58
58
|
const [showPicker, setShowPicker] = useState(false);
|
|
@@ -33,7 +33,7 @@ export const TMDataListItemChooserForm = (props) => {
|
|
|
33
33
|
if (!props.dataListId)
|
|
34
34
|
return [];
|
|
35
35
|
if (refreshCache)
|
|
36
|
-
DataListCacheService.
|
|
36
|
+
DataListCacheService.Remove();
|
|
37
37
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
|
|
38
38
|
let dataList = await DataListCacheService.GetAsync(props.dataListId);
|
|
39
39
|
TMSpinner.hide();
|
|
@@ -3,64 +3,64 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import styled, { keyframes } from 'styled-components';
|
|
4
4
|
import { DataListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
6
|
-
const PickerContainer = styled.div `
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
gap: 10px;
|
|
10
|
-
padding: 5px;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-radius: 4px;
|
|
6
|
+
const PickerContainer = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 10px;
|
|
10
|
+
padding: 5px;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-radius: 4px;
|
|
13
13
|
`;
|
|
14
|
-
const ItemsContainer = styled.div `
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
flex-wrap: nowrap;
|
|
18
|
-
gap: 3px;
|
|
19
|
-
align-items: center;
|
|
20
|
-
overflow-x: auto;
|
|
21
|
-
padding: 10px;
|
|
14
|
+
const ItemsContainer = styled.div `
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
flex-wrap: nowrap;
|
|
18
|
+
gap: 3px;
|
|
19
|
+
align-items: center;
|
|
20
|
+
overflow-x: auto;
|
|
21
|
+
padding: 10px;
|
|
22
22
|
`;
|
|
23
|
-
const slideIn = keyframes `
|
|
24
|
-
from {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
transform: translateX(-50px);
|
|
27
|
-
}
|
|
28
|
-
to {
|
|
29
|
-
opacity: 1;
|
|
30
|
-
transform: translateX(0);
|
|
31
|
-
}
|
|
23
|
+
const slideIn = keyframes `
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: translateX(-50px);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
transform: translateX(0);
|
|
31
|
+
}
|
|
32
32
|
`;
|
|
33
|
-
const StatusItem = styled.div `
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
text-align: center;
|
|
40
|
-
font-size: 0.8em;
|
|
41
|
-
padding: 5px 10px;
|
|
42
|
-
border-radius: 8px;
|
|
43
|
-
border: 2px solid transparent;
|
|
44
|
-
transition: all 0.2s ease-in-out;
|
|
45
|
-
flex-shrink: 0;
|
|
46
|
-
|
|
47
|
-
// Aggiungi l'animazione con un ritardo basato sull'indice
|
|
48
|
-
animation: ${slideIn} 0.5s ease-out forwards;
|
|
49
|
-
animation-delay: ${props => props.$index * 0.1}s;
|
|
50
|
-
opacity: 0; // Inizialmente l'elemento è invisibile
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
background-color: #f0f0f0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
${props => props.$isSelected && `
|
|
57
|
-
border-color: #007bff;
|
|
58
|
-
background-color: #e6f2ff;
|
|
59
|
-
`}
|
|
33
|
+
const StatusItem = styled.div `
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: 0.8em;
|
|
41
|
+
padding: 5px 10px;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
border: 2px solid transparent;
|
|
44
|
+
transition: all 0.2s ease-in-out;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
|
|
47
|
+
// Aggiungi l'animazione con un ritardo basato sull'indice
|
|
48
|
+
animation: ${slideIn} 0.5s ease-out forwards;
|
|
49
|
+
animation-delay: ${props => props.$index * 0.1}s;
|
|
50
|
+
opacity: 0; // Inizialmente l'elemento è invisibile
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: #f0f0f0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${props => props.$isSelected && `
|
|
57
|
+
border-color: #007bff;
|
|
58
|
+
background-color: #e6f2ff;
|
|
59
|
+
`}
|
|
60
60
|
`;
|
|
61
|
-
const Label = styled.div `
|
|
62
|
-
font-weight: bold;
|
|
63
|
-
margin-bottom: 5px;
|
|
61
|
+
const Label = styled.div `
|
|
62
|
+
font-weight: bold;
|
|
63
|
+
margin-bottom: 5px;
|
|
64
64
|
`;
|
|
65
65
|
const TMDataListItemPicker = ({ dataListID, selectedValue, onItemSelect }) => {
|
|
66
66
|
const [dataList, setDataList] = useState(undefined);
|
|
@@ -23,7 +23,7 @@ const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, f
|
|
|
23
23
|
export default TMDcmtTypeChooser;
|
|
24
24
|
const cellRenderIcon = (data) => _jsx(TMDcmtTypeIcon, { dtd: data.data });
|
|
25
25
|
const cellRenderNameAndDesc = (data) => _jsx("p", { style: { textAlign: 'left', color: data.data.isView ? 'red' : '' }, children: data.value });
|
|
26
|
-
export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width, height, selectedIDs, dataSource, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, accessFilter = 'all', filter, onClose, onChoose }) => {
|
|
26
|
+
export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width, height, selectedIDs, dataSource, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, accessFilter = 'all', startWithShowOnlySelectedItems = true, filter, onClose, onChoose }) => {
|
|
27
27
|
const isPermitted = (accessLevel) => accessLevel === AccessLevelsEx.Yes || accessLevel === AccessLevelsEx.Mixed;
|
|
28
28
|
const getItems = async (refreshCache) => {
|
|
29
29
|
let tms = tmSession ?? SDK_Globals.tmSession;
|
|
@@ -57,5 +57,5 @@ export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width
|
|
|
57
57
|
return false;
|
|
58
58
|
return true;
|
|
59
59
|
};
|
|
60
|
-
return (_jsx(TMChooserForm, { title: SDK_Localizator.ListDcmtTypeOrView, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, width: width, height: height, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
60
|
+
return (_jsx(TMChooserForm, { title: SDK_Localizator.ListDcmtTypeOrView, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, width: width, height: height, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
61
61
|
};
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { MetadataDescriptor, QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ITMChooserFormProps, ITMChooserProps, TID_MID } from '../../ts';
|
|
4
4
|
import { TID_Alias } from '../../helper/queryHelper';
|
|
5
|
+
type MetadataDescriptorWithKey = MetadataDescriptor & {
|
|
6
|
+
uniqueKey: string;
|
|
7
|
+
};
|
|
5
8
|
interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
6
9
|
/** Allows you to view system metadata */
|
|
7
10
|
allowSysMetadata?: boolean;
|
|
@@ -32,7 +35,7 @@ interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
|
32
35
|
}
|
|
33
36
|
declare const TMMetadataChooser: React.FunctionComponent<ITMMetadataChooserProps>;
|
|
34
37
|
export default TMMetadataChooser;
|
|
35
|
-
interface ITMMetadataChooserFormProps extends ITMChooserFormProps<
|
|
38
|
+
interface ITMMetadataChooserFormProps extends ITMChooserFormProps<MetadataDescriptorWithKey> {
|
|
36
39
|
/** Allows you to view system metadata */
|
|
37
40
|
allowSysMetadata?: boolean;
|
|
38
41
|
/** TIDs of document types to retrieve metadata from */
|
|
@@ -38,7 +38,18 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
38
38
|
if (checkProps)
|
|
39
39
|
throw Error('Le props qd | tids | dataSource devono essere in alternativa');
|
|
40
40
|
try {
|
|
41
|
-
if (
|
|
41
|
+
if (dataSource) {
|
|
42
|
+
// Se ho dataSource, aggiungo tutti i suoi metadati con uniqueKey
|
|
43
|
+
dataSource.forEach((md) => {
|
|
44
|
+
const mdWithKey = md;
|
|
45
|
+
mdWithKey.uniqueKey = `${mdWithKey.customData1 ?? 0}_${md.id}_${mdWithKey.customData2 ?? ''}`;
|
|
46
|
+
metadata.push(mdWithKey);
|
|
47
|
+
});
|
|
48
|
+
setDcmtTypes(dtdList);
|
|
49
|
+
setHasSysMetadata(allowSysMetadata && metadata.findIndex(md => md.isSystem == 1) >= 0);
|
|
50
|
+
return showSysMetadata ? metadata : metadata.filter(o => o.isSystem != 1);
|
|
51
|
+
}
|
|
52
|
+
else if (qd) {
|
|
42
53
|
let tids = getTIDsByQd(qd);
|
|
43
54
|
let inputTIDs = tids.map((item) => item.tid);
|
|
44
55
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DcmtType} ...` });
|
|
@@ -48,20 +59,26 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
48
59
|
dtd.init({ ...dtds[i] });
|
|
49
60
|
const alias = tids?.[i].alias ?? '';
|
|
50
61
|
dtd.customData2 = alias;
|
|
62
|
+
let mds;
|
|
51
63
|
if (!qdShowOnlySelectItems) {
|
|
52
64
|
dtd.metadata?.forEach((md) => {
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
const mdWithKey = md;
|
|
66
|
+
mdWithKey.customData1 = dtd.id;
|
|
67
|
+
mdWithKey.customData2 = alias;
|
|
68
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
|
|
55
69
|
});
|
|
70
|
+
mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
|
|
56
71
|
}
|
|
57
72
|
else {
|
|
58
73
|
let newMetadata = dtd.metadata?.filter(o => qd.select?.some(s => s.tid == dtd.id && s.mid == o.id && ((s.alias ?? '') == alias)));
|
|
59
74
|
newMetadata?.forEach((md) => {
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
const mdWithKey = md;
|
|
76
|
+
mdWithKey.customData1 = dtd.id;
|
|
77
|
+
mdWithKey.customData2 = alias;
|
|
78
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
|
|
62
79
|
});
|
|
80
|
+
mds = filterMetadata ? newMetadata?.filter(filterMetadata) : newMetadata;
|
|
63
81
|
}
|
|
64
|
-
let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
|
|
65
82
|
dtdList.push({ ...dtd, metadata: mds });
|
|
66
83
|
}
|
|
67
84
|
}
|
|
@@ -81,7 +98,11 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
81
98
|
continue;
|
|
82
99
|
}
|
|
83
100
|
let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
|
|
84
|
-
mds?.forEach((md) => {
|
|
101
|
+
mds?.forEach((md) => {
|
|
102
|
+
const mdWithKey = md;
|
|
103
|
+
mdWithKey.customData1 = dtd?.id;
|
|
104
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${md.customData2 ?? ''}`;
|
|
105
|
+
});
|
|
85
106
|
dtdList.push({ ...dtd, metadata: mds });
|
|
86
107
|
}
|
|
87
108
|
}
|
|
@@ -130,5 +151,7 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
130
151
|
const cellRenderNameAndDesc = useCallback((data) => {
|
|
131
152
|
return _jsx("p", { style: { textAlign: 'left', color: data.data.isRequired == 1 ? 'red' : '' }, children: data.value });
|
|
132
153
|
}, []);
|
|
133
|
-
return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, selectedIDs: selectedIDs?.map((item) => item.mid), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc,
|
|
154
|
+
return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, keyName: 'uniqueKey', selectedIDs: selectedIDs?.map((item) => `${item.tid}_${item.mid}_${item.aliasTID ?? ''}`), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc,
|
|
155
|
+
// dataSource={dataSource}
|
|
156
|
+
getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
|
|
134
157
|
};
|
|
@@ -14,6 +14,8 @@ interface ITMUserChooserProps extends ITMChooserProps {
|
|
|
14
14
|
hideShowId?: boolean;
|
|
15
15
|
/** Initial value for showChooser */
|
|
16
16
|
initialShowChooser?: boolean;
|
|
17
|
+
/** Allow showing all users with toggle button */
|
|
18
|
+
allowShowAllUsers?: boolean;
|
|
17
19
|
}
|
|
18
20
|
declare const TMUserChooser: React.FunctionComponent<ITMUserChooserProps>;
|
|
19
21
|
export default TMUserChooser;
|
|
@@ -24,6 +26,8 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
24
26
|
hideRefresh?: boolean;
|
|
25
27
|
/** Nascondi pulsante mostra ID */
|
|
26
28
|
hideShowId?: boolean;
|
|
29
|
+
/** Allow showing all users with toggle button */
|
|
30
|
+
allowShowAllUsers?: boolean;
|
|
27
31
|
}
|
|
28
32
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
29
33
|
export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels } from '../../helper';
|
|
4
|
+
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
|
|
5
5
|
import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipSeparatorItem } from '../base/Styled';
|
|
6
6
|
import TMSpinner from '../base/TMSpinner';
|
|
7
7
|
import TMTooltip from '../base/TMTooltip';
|
|
@@ -9,7 +9,8 @@ import TMSummary from '../editors/TMSummary';
|
|
|
9
9
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
10
|
import { TMColors } from '../../utils/theme';
|
|
11
11
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
12
|
-
|
|
12
|
+
import TMButton from '../base/TMButton';
|
|
13
|
+
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false }) => {
|
|
13
14
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
14
15
|
useEffect(() => {
|
|
15
16
|
setShowChooser(initialShowChooser);
|
|
@@ -20,13 +21,15 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
20
21
|
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true, noneSelectionText: '' }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
21
22
|
};
|
|
22
23
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, width: width, disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
23
|
-
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => {
|
|
24
|
+
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
24
25
|
setShowChooser(false);
|
|
25
26
|
summaryInputRef.current?.focus();
|
|
26
27
|
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
27
28
|
};
|
|
28
29
|
export default TMUserChooser;
|
|
29
|
-
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
|
|
30
|
+
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false }) => {
|
|
31
|
+
const [currentDataSource, setCurrentDataSource] = useState(dataSource);
|
|
32
|
+
const [showingAllUsers, setShowingAllUsers] = useState(false);
|
|
30
33
|
const dataColumns = useMemo(() => {
|
|
31
34
|
return [
|
|
32
35
|
{ dataField: 'domain', caption: SDKUI_Localizator.Domain, dataType: 'string' },
|
|
@@ -42,6 +45,18 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
42
45
|
TMSpinner.hide();
|
|
43
46
|
return users;
|
|
44
47
|
};
|
|
48
|
+
const handleToggleAllUsers = () => {
|
|
49
|
+
if (showingAllUsers) {
|
|
50
|
+
// Torna indietro: ripristina il dataSource originale
|
|
51
|
+
setCurrentDataSource(dataSource);
|
|
52
|
+
setShowingAllUsers(false);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Mostra tutti: rimuove il dataSource per usare getItems
|
|
56
|
+
setCurrentDataSource(undefined);
|
|
57
|
+
setShowingAllUsers(true);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
45
60
|
const getTitle = () => {
|
|
46
61
|
let title = SDK_Localizator.Users;
|
|
47
62
|
if (title)
|
|
@@ -49,7 +64,8 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
49
64
|
return title;
|
|
50
65
|
};
|
|
51
66
|
const cellRenderIcon = (data) => _jsx(TMUserIcon, { ud: data.data });
|
|
52
|
-
|
|
67
|
+
const customButton = (allowShowAllUsers && dataSource) ? (_jsx(TMButton, { btnStyle: 'toolbar', caption: showingAllUsers ? SDKUI_Localizator.HideAll : SDKUI_Localizator.ShowAll, onClick: handleToggleAllUsers, icon: showingAllUsers ? _jsx(IconShowAllUsersOff, {}) : _jsx(IconShowAllUsers, {}) })) : undefined;
|
|
68
|
+
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: currentDataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, customButtons: customButton, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
53
69
|
};
|
|
54
70
|
export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
55
71
|
const [ud, setUd] = useState();
|
|
@@ -2,32 +2,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
const StyledCheckBoxContainer = styled.div `
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: ${props => props.$labelPosition === 'right' ? 'row-reverse' : 'row'} ;
|
|
8
|
-
justify-content: flex-start;
|
|
9
|
-
align-items: center;
|
|
10
|
-
width: fit-content;
|
|
11
|
-
cursor: ${props => !props.$disabled && 'pointer'};
|
|
5
|
+
const StyledCheckBoxContainer = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: ${props => props.$labelPosition === 'right' ? 'row-reverse' : 'row'} ;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
align-items: center;
|
|
10
|
+
width: fit-content;
|
|
11
|
+
cursor: ${props => !props.$disabled && 'pointer'};
|
|
12
12
|
`;
|
|
13
|
-
const StyledCheckBoxLabel = styled.div `
|
|
14
|
-
margin-right: ${props => props.$labelPosition === 'left' ? '5px' : '0'};
|
|
15
|
-
margin-left: ${props => props.$labelPosition === 'right' ? '5px' : '0'};
|
|
16
|
-
color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : props.$labelColor ? props.$labelColor : TMColors.text_normal : TMColors.disabled};
|
|
17
|
-
font-size: ${props => props.$fontSize};
|
|
18
|
-
user-select: none;
|
|
19
|
-
&:focus{
|
|
20
|
-
outline: none;
|
|
21
|
-
background-image: linear-gradient(white, #E4E9F7);
|
|
22
|
-
border-bottom: 2px solid;
|
|
23
|
-
border-bottom-color: ${props => !props.$isModifiedWhen ? TMColors.primary : TMColors.isModified};
|
|
24
|
-
}
|
|
13
|
+
const StyledCheckBoxLabel = styled.div `
|
|
14
|
+
margin-right: ${props => props.$labelPosition === 'left' ? '5px' : '0'};
|
|
15
|
+
margin-left: ${props => props.$labelPosition === 'right' ? '5px' : '0'};
|
|
16
|
+
color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : props.$labelColor ? props.$labelColor : TMColors.text_normal : TMColors.disabled};
|
|
17
|
+
font-size: ${props => props.$fontSize};
|
|
18
|
+
user-select: none;
|
|
19
|
+
&:focus{
|
|
20
|
+
outline: none;
|
|
21
|
+
background-image: linear-gradient(white, #E4E9F7);
|
|
22
|
+
border-bottom: 2px solid;
|
|
23
|
+
border-bottom-color: ${props => !props.$isModifiedWhen ? TMColors.primary : TMColors.isModified};
|
|
24
|
+
}
|
|
25
25
|
`;
|
|
26
|
-
const StyledCheckbox = styled.input `
|
|
27
|
-
accent-color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : TMColors.primary : TMColors.disabled};
|
|
28
|
-
width: 14px;
|
|
29
|
-
height: 14px;
|
|
30
|
-
cursor: ${props => !props.$disabled && 'pointer'};
|
|
26
|
+
const StyledCheckbox = styled.input `
|
|
27
|
+
accent-color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : TMColors.primary : TMColors.disabled};
|
|
28
|
+
width: 14px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
cursor: ${props => !props.$disabled && 'pointer'};
|
|
31
31
|
`;
|
|
32
32
|
const TMCheckBox = ({ labelColor, isModifiedWhen, elementStyle, disabled = false, label, value, labelPosition = 'right', fontSize = FontSize.defaultFontSize, onValueChanged }) => {
|
|
33
33
|
const [initialValue, setInitialValue] = useState(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { IDateBoxOptions } from 'devextreme-react/
|
|
3
|
+
import { IDateBoxOptions } from 'devextreme-react/date-box';
|
|
4
4
|
import { DateDisplayTypes } from '../../helper';
|
|
5
5
|
interface ITMDateBoxProps extends IDateBoxOptions {
|
|
6
6
|
dateDisplayType?: DateDisplayTypes;
|
|
@@ -6,53 +6,53 @@ import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, TMEditorsDe
|
|
|
6
6
|
import TMLayoutContainer, { TMLayoutItem } from "../base/TMLayout";
|
|
7
7
|
import TMVilViewer from "../base/TMVilViewer";
|
|
8
8
|
import TMTooltip from "../base/TMTooltip";
|
|
9
|
-
const StyledDropDownWrapper = styled.div `
|
|
10
|
-
position: relative;
|
|
11
|
-
width: ${props => props.$width};
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
9
|
+
const StyledDropDownWrapper = styled.div `
|
|
10
|
+
position: relative;
|
|
11
|
+
width: ${props => props.$width};
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
14
|
`;
|
|
15
|
-
const StyledDropDown = styled.select `
|
|
16
|
-
width: 100%;
|
|
17
|
-
padding: 5px 35px 3px 9px; /* padding-right leaves space for buttons + custom arrow */
|
|
18
|
-
border: 1px solid;
|
|
19
|
-
border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
|
|
20
|
-
border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid;
|
|
21
|
-
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
|
|
22
|
-
color: ${props => !props.$disabled ? (props.$vil.length === 0 ? (!props.$isModified ? TMColors.text_normal : TMColors.isModified) : editorColorManager(props.$vil)) : TMColors.disabled};
|
|
23
|
-
border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
|
|
24
|
-
font-size: ${props => props.$fontSize};
|
|
25
|
-
appearance: none; /* remove native arrow */
|
|
26
|
-
background-color: white;
|
|
27
|
-
|
|
28
|
-
&:focus {
|
|
29
|
-
outline: none;
|
|
30
|
-
background-image: linear-gradient(white, #E4E9F7);
|
|
31
|
-
border: ${props => props.$isModified ? `1px solid ${TMColors.isModified}` : '1px solid rgb(180,180,180)'};
|
|
32
|
-
border-bottom: 2px solid;
|
|
33
|
-
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.primary : TMColors.isModified : editorColorManager(props.$vil)};
|
|
34
|
-
}
|
|
15
|
+
const StyledDropDown = styled.select `
|
|
16
|
+
width: 100%;
|
|
17
|
+
padding: 5px 35px 3px 9px; /* padding-right leaves space for buttons + custom arrow */
|
|
18
|
+
border: 1px solid;
|
|
19
|
+
border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
|
|
20
|
+
border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid;
|
|
21
|
+
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
|
|
22
|
+
color: ${props => !props.$disabled ? (props.$vil.length === 0 ? (!props.$isModified ? TMColors.text_normal : TMColors.isModified) : editorColorManager(props.$vil)) : TMColors.disabled};
|
|
23
|
+
border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
|
|
24
|
+
font-size: ${props => props.$fontSize};
|
|
25
|
+
appearance: none; /* remove native arrow */
|
|
26
|
+
background-color: white;
|
|
27
|
+
|
|
28
|
+
&:focus {
|
|
29
|
+
outline: none;
|
|
30
|
+
background-image: linear-gradient(white, #E4E9F7);
|
|
31
|
+
border: ${props => props.$isModified ? `1px solid ${TMColors.isModified}` : '1px solid rgb(180,180,180)'};
|
|
32
|
+
border-bottom: 2px solid;
|
|
33
|
+
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.primary : TMColors.isModified : editorColorManager(props.$vil)};
|
|
34
|
+
}
|
|
35
35
|
`;
|
|
36
|
-
const ButtonsContainer = styled.div `
|
|
37
|
-
position: absolute;
|
|
38
|
-
right: 20px; /* adjust depending on arrow size */
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
gap: 5px; /* spacing between buttons */
|
|
36
|
+
const ButtonsContainer = styled.div `
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: 20px; /* adjust depending on arrow size */
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 5px; /* spacing between buttons */
|
|
42
42
|
`;
|
|
43
|
-
const CustomArrow = styled.div `
|
|
44
|
-
position: absolute;
|
|
45
|
-
right: 5px;
|
|
46
|
-
pointer-events: none;
|
|
47
|
-
border-left: 5px solid transparent;
|
|
48
|
-
border-right: 5px solid transparent;
|
|
49
|
-
border-top: 5px solid ${TMColors.text_normal};
|
|
43
|
+
const CustomArrow = styled.div `
|
|
44
|
+
position: absolute;
|
|
45
|
+
right: 5px;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
border-left: 5px solid transparent;
|
|
48
|
+
border-right: 5px solid transparent;
|
|
49
|
+
border-top: 5px solid ${TMColors.text_normal};
|
|
50
50
|
`;
|
|
51
|
-
const StyledDropDownEditorButton = styled.div `
|
|
52
|
-
color: ${TMColors.button_icon};
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
cursor: pointer;
|
|
51
|
+
const StyledDropDownEditorButton = styled.div `
|
|
52
|
+
color: ${TMColors.button_icon};
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
cursor: pointer;
|
|
56
56
|
`;
|
|
57
57
|
const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, onValueChanged, buttons = [], }) => {
|
|
58
58
|
const [isFocused, setIsFocused] = useState(false);
|