@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +21 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +4 -2
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +2 -0
- package/lib/components/editors/TMMetadataValues.js +26 -8
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +576 -292
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +370 -252
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +57 -37
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +35 -7
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +6 -1
- package/lib/components/query/TMQueryEditor.js +105 -101
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +21 -3
- package/lib/helper/SDKUI_Localizator.js +196 -10
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +132 -4
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +2 -2
- package/lib/helper/queryHelper.js +80 -24
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +6 -5
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -7,17 +7,23 @@ import TMSpinner from '../base/TMSpinner';
|
|
|
7
7
|
import TMSummary from '../editors/TMSummary';
|
|
8
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
9
|
import TMDataListItemViewer from '../viewers/TMDataListItemViewer';
|
|
10
|
-
const TMDataListItemChooser = ({ labelColor, width = '100%', dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged }) => {
|
|
10
|
+
const TMDataListItemChooser = ({ labelColor, width = '100%', dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
11
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
12
|
const renderTemplate = () => {
|
|
13
13
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
14
14
|
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataListItemViewer, { dataListId: dataListId, value: values?.[0] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
15
15
|
};
|
|
16
16
|
const summaryInputRef = useRef(null);
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () =>
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
18
|
+
if (!readOnly) {
|
|
19
|
+
setShowChooser(true);
|
|
20
|
+
updateIsModalOpen?.(true);
|
|
21
|
+
}
|
|
22
|
+
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
18
23
|
_jsx(TMDataListItemChooserForm, { allowMultipleSelection: allowMultipleSelection, title: titleForm, dataListId: dataListId, selectedIDs: values, onClose: () => {
|
|
19
24
|
setShowChooser(false);
|
|
20
25
|
summaryInputRef.current?.focus();
|
|
26
|
+
updateIsModalOpen?.(false);
|
|
21
27
|
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
22
28
|
};
|
|
23
29
|
export default TMDataListItemChooser;
|
|
@@ -11,6 +11,7 @@ interface ITMDcmtTypeChooser extends ITMChooserProps {
|
|
|
11
11
|
openEditorOnSummaryClick?: boolean;
|
|
12
12
|
accessFilter?: AccessFilter;
|
|
13
13
|
filter?: (value: DcmtTypeDescriptor, index: number, array: DcmtTypeDescriptor[]) => unknown;
|
|
14
|
+
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
14
15
|
}
|
|
15
16
|
declare const TMDcmtTypeChooser: React.FunctionComponent<ITMDcmtTypeChooser>;
|
|
16
17
|
export default TMDcmtTypeChooser;
|
|
@@ -7,7 +7,7 @@ import { StyledDivHorizontal } from '../base/Styled';
|
|
|
7
7
|
import TMTidViewer, { TMDcmtTypeIcon } from '../viewers/TMTidViewer';
|
|
8
8
|
import TMSummary from '../editors/TMSummary';
|
|
9
9
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
|
-
const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, filter, accessFilter = 'all', showEditButton = true, borderRadius = '4px', buttons = [], placeHolder = `<${SDKUI_Localizator.NoneSelection}>`, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, values, isModifiedWhen, label, width, height, showClearButton = false, validationItems = [], onValueChanged }) => {
|
|
10
|
+
const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, filter, accessFilter = 'all', showEditButton = true, borderRadius = '4px', buttons = [], placeHolder = `<${SDKUI_Localizator.NoneSelection}>`, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, values, isModifiedWhen, label, width, height, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
11
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.ListDcmtTypeOrView} ...` });
|
|
@@ -17,8 +17,16 @@ const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, f
|
|
|
17
17
|
const renderTemplate = () => {
|
|
18
18
|
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMTidViewer, { tmSession: tmSession, tid: values[0], showIcon: true, showId: showId, noneSelectionText: placeHolder }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
19
19
|
};
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () =>
|
|
21
|
-
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
21
|
+
if (!disabled) {
|
|
22
|
+
setShowChooser(true);
|
|
23
|
+
updateIsModalOpen?.(true);
|
|
24
|
+
}
|
|
25
|
+
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, width: width, height: height, template: renderTemplate(), openEditorOnSummaryClick: openEditorOnSummaryClick, onClearClick: showClearButton ? () => { !disabled && onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
26
|
+
_jsx(TMDcmtTypeChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, dataSource: dataSource, selectedIDs: values, ShowOnlyDcmtTypes: ShowOnlyDcmtTypes, ShowOnlySAP: ShowOnlySAP, accessFilter: accessFilter, filterTemplateTID: filterTemplateTID, filter: filter, onClose: () => {
|
|
27
|
+
setShowChooser(false);
|
|
28
|
+
updateIsModalOpen?.(false);
|
|
29
|
+
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
22
30
|
};
|
|
23
31
|
export default TMDcmtTypeChooser;
|
|
24
32
|
const cellRenderIcon = (data) => _jsx(TMDcmtTypeIcon, { dtd: data.data });
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { LayoutModes, MetadataDataDomains, AccessLevels, MetadataDataTypes, SDK_Globals, DcmtTypeListCacheService, DataColumnTypes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
6
|
-
import TMDataGrid from '../base/TMDataGrid';
|
|
6
|
+
import TMDataGrid, { TMDataGridPageSize } from '../base/TMDataGrid';
|
|
7
7
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
8
8
|
import TMSpinner from '../base/TMSpinner';
|
|
9
9
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
@@ -131,7 +131,7 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
131
131
|
return md.dataDomain === undefined || md.dataDomain === MetadataDataDomains.None;
|
|
132
132
|
};
|
|
133
133
|
const renderContent = () => {
|
|
134
|
-
return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary })] }));
|
|
134
|
+
return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary, onRowDblClick: () => !isAppendMode && onClosePanelCallback?.(), pageSize: TMDataGridPageSize.Medium })] }));
|
|
135
135
|
};
|
|
136
136
|
return (_jsx(_Fragment, { children: isModal
|
|
137
137
|
? _jsx(TMModal, { title: SDKUI_Localizator.DistinctValues + (md?.nameLoc ? ` (${md?.nameLoc})` : ''), height: '600px', width: '500px', resizable: true, onClose: onClosePanelCallback, children: renderContent() })
|
|
@@ -18,6 +18,8 @@ interface ITMDynDataListItemChooserProps extends ITMChooserProps {
|
|
|
18
18
|
onCascadeRefreshDynDataLists?: (dynDataListsToBeRefreshed: DynDataListsToBeRefreshed[]) => void;
|
|
19
19
|
/** Indica quali metadati aggiornare in cascata (valore) */
|
|
20
20
|
onCascadeUpdateMIDs?: (midsToBeUpdated: MIDsToBeUpdated[]) => void;
|
|
21
|
+
/** Funzione per aggiornare lo stato di apertura della modale */
|
|
22
|
+
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
21
23
|
}
|
|
22
24
|
export type DynDataListsToBeRefreshed = {
|
|
23
25
|
mid: number | undefined;
|
|
@@ -9,7 +9,7 @@ import TMChooserForm from '../forms/TMChooserForm';
|
|
|
9
9
|
import { TMColors } from '../../utils/theme';
|
|
10
10
|
import TMTooltip from '../base/TMTooltip';
|
|
11
11
|
import { FormulaHelper } from '../editors/TMFormulaEditor';
|
|
12
|
-
const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChooserBySingleClick, readOnly, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, showClearButton, onValueChanged, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs }) => {
|
|
12
|
+
const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChooserBySingleClick, readOnly, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, showClearButton, onValueChanged, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs, updateIsModalOpen }) => {
|
|
13
13
|
const [showChooser, setShowChooser] = useState(false);
|
|
14
14
|
const [dynDl, setDynDl] = useState();
|
|
15
15
|
const [dataSource, setDataSource] = useState();
|
|
@@ -80,9 +80,15 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
80
80
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
81
81
|
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [dataSource && _jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { marginLeft: '5px' }, children: getDescription() })] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
82
82
|
};
|
|
83
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, width: width, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () =>
|
|
83
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, width: width, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
84
|
+
if (!readOnly) {
|
|
85
|
+
setShowChooser(true);
|
|
86
|
+
updateIsModalOpen?.(true);
|
|
87
|
+
}
|
|
88
|
+
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
84
89
|
_jsx(TMDynDataListItemChooserForm, { TID: tid, MID: md?.id, dynDL: dynDl, title: titleForm, allowMultipleSelection: allowMultipleSelection, searchResult: dataSource, selectedIDs: values, onClose: () => {
|
|
85
90
|
setShowChooser(false);
|
|
91
|
+
updateIsModalOpen?.(false);
|
|
86
92
|
summaryInputRef.current?.focus();
|
|
87
93
|
}, onChoose: (IDs) => {
|
|
88
94
|
onValueChanged?.(IDs);
|
|
@@ -17,6 +17,6 @@ const TMInvoiceRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToEx
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, isModifiedWhen: value != valueOrig, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -32,6 +32,8 @@ interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
|
32
32
|
getColorIndex?: (tid: TID_Alias) => string;
|
|
33
33
|
/** Allows you to view system metadata directly */
|
|
34
34
|
showSysMetadataDirectly?: boolean;
|
|
35
|
+
/** Funzione per aggiornare lo stato di apertura della modale */
|
|
36
|
+
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
35
37
|
}
|
|
36
38
|
declare const TMMetadataChooser: React.FunctionComponent<ITMMetadataChooserProps>;
|
|
37
39
|
export default TMMetadataChooser;
|
|
@@ -11,13 +11,28 @@ import TMButton from '../base/TMButton';
|
|
|
11
11
|
import TMSummary from '../editors/TMSummary';
|
|
12
12
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
13
13
|
import TMSpinner from '../base/TMSpinner';
|
|
14
|
-
const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, showSysMetadataDirectly, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged }) => {
|
|
14
|
+
const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, showSysMetadataDirectly, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged, updateIsModalOpen }) => {
|
|
15
15
|
const [showChooser, setShowChooser] = useState(false);
|
|
16
|
+
const getinputMd = () => {
|
|
17
|
+
if (values && values.length > 0 && values[0].mid && values[0].mid < 0) {
|
|
18
|
+
let md = dataSource?.find((md) => md.id === values[0].mid);
|
|
19
|
+
return md;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
16
23
|
const renderTemplate = useMemo(() => {
|
|
17
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
24
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
18
25
|
}, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () =>
|
|
20
|
-
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => {
|
|
27
|
+
if (!disabled) {
|
|
28
|
+
setShowChooser(true);
|
|
29
|
+
updateIsModalOpen?.(true);
|
|
30
|
+
}
|
|
31
|
+
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, template: renderTemplate, onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined }), showChooser &&
|
|
32
|
+
_jsx(TMMetadataChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, height: '500px', width: '600px', allowSysMetadata: allowSysMetadata, showSysMetadataDirectly: showSysMetadataDirectly, getColorIndex: getColorIndex, dataSource: dataSource, tids: tids, qd: qd, qdShowOnlySelectItems: qdShowOnlySelectItems, filterMetadata: filterMetadata, selectedIDs: values, onClose: () => {
|
|
33
|
+
setShowChooser(false);
|
|
34
|
+
updateIsModalOpen?.(false);
|
|
35
|
+
}, onChoose: (tid_mids) => { onValueChanged?.(tid_mids); } })] }));
|
|
21
36
|
};
|
|
22
37
|
export default TMMetadataChooser;
|
|
23
38
|
export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdShowOnlySelectItems, selectedIDs, dataSource, allowMultipleSelection, allowSysMetadata = true, showSysMetadataDirectly, width, height, getColorIndex, onClose, onChoose }) => {
|
|
@@ -17,6 +17,6 @@ const TMOrderRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToExcl
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, isModifiedWhen: value != valueOrig, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMOrderRetrieveFormats;
|
|
@@ -16,6 +16,8 @@ interface ITMUserChooserProps extends ITMChooserProps {
|
|
|
16
16
|
initialShowChooser?: boolean;
|
|
17
17
|
/** Allow showing all users with toggle button */
|
|
18
18
|
allowShowAllUsers?: boolean;
|
|
19
|
+
/** Funzione per aggiornare lo stato di apertura della modale */
|
|
20
|
+
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
19
21
|
}
|
|
20
22
|
declare const TMUserChooser: React.FunctionComponent<ITMUserChooserProps>;
|
|
21
23
|
export default TMUserChooser;
|
|
@@ -30,11 +32,6 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
30
32
|
allowShowAllUsers?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
33
|
-
export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
|
|
34
|
-
userId?: number;
|
|
35
|
-
showIcon?: boolean;
|
|
36
|
-
noneSelectionText?: string;
|
|
37
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
38
35
|
export declare const TMUserIcon: ({ ud }: {
|
|
39
36
|
ud?: UserDescriptor;
|
|
40
37
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,16 +1,14 @@
|
|
|
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,
|
|
5
|
-
import { StyledDivHorizontal
|
|
4
|
+
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
|
|
5
|
+
import { StyledDivHorizontal } from '../base/Styled';
|
|
6
6
|
import TMSpinner from '../base/TMSpinner';
|
|
7
|
-
import TMTooltip from '../base/TMTooltip';
|
|
8
7
|
import TMSummary from '../editors/TMSummary';
|
|
9
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
|
-
import { TMColors } from '../../utils/theme';
|
|
11
|
-
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
12
9
|
import TMButton from '../base/TMButton';
|
|
13
|
-
|
|
10
|
+
import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
|
|
11
|
+
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, updateIsModalOpen }) => {
|
|
14
12
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
15
13
|
useEffect(() => {
|
|
16
14
|
setShowChooser(initialShowChooser);
|
|
@@ -18,12 +16,18 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
18
16
|
const summaryInputRef = useRef(null);
|
|
19
17
|
const renderTemplate = () => {
|
|
20
18
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
21
|
-
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(
|
|
19
|
+
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataUserIdItemViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
22
20
|
};
|
|
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: () =>
|
|
21
|
+
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: () => {
|
|
22
|
+
if (!readOnly) {
|
|
23
|
+
setShowChooser(true);
|
|
24
|
+
updateIsModalOpen?.(true);
|
|
25
|
+
}
|
|
26
|
+
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
24
27
|
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
25
28
|
setShowChooser(false);
|
|
26
29
|
summaryInputRef.current?.focus();
|
|
30
|
+
updateIsModalOpen?.(false);
|
|
27
31
|
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
28
32
|
};
|
|
29
33
|
export default TMUserChooser;
|
|
@@ -67,40 +71,6 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
67
71
|
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
72
|
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) }));
|
|
69
73
|
};
|
|
70
|
-
export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
71
|
-
const [ud, setUd] = useState();
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (!userId || userId <= 0) {
|
|
74
|
-
setUd(undefined);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
78
|
-
UserListCacheService.GetAsync(userId).then((ud) => { setUd(ud); TMSpinner.hide(); }).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
|
|
79
|
-
}, [userId]);
|
|
80
|
-
const getIcon = () => {
|
|
81
|
-
if (!showIcon)
|
|
82
|
-
return null;
|
|
83
|
-
if (!userId)
|
|
84
|
-
return null;
|
|
85
|
-
return ud ?
|
|
86
|
-
_jsx(TMUserIcon, { ud: ud })
|
|
87
|
-
:
|
|
88
|
-
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
89
|
-
};
|
|
90
|
-
const getDescription = () => {
|
|
91
|
-
if (!userId)
|
|
92
|
-
return undefined;
|
|
93
|
-
return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? noneSelectionText;
|
|
94
|
-
};
|
|
95
|
-
return (_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] })
|
|
96
|
-
// <StyledDivHorizontal>
|
|
97
|
-
// {getIcon()}
|
|
98
|
-
// <p style={{ textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: ud ? 1 : 0.5 }}>
|
|
99
|
-
// {getDescription()}
|
|
100
|
-
// </p>
|
|
101
|
-
// </StyledDivHorizontal>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
74
|
export const TMUserIcon = ({ ud }) => {
|
|
105
75
|
if (!ud)
|
|
106
76
|
return null;
|
|
@@ -109,12 +79,28 @@ export const TMUserIcon = ({ ud }) => {
|
|
|
109
79
|
return (_jsx(TMUserTooltip, { ud: ud, children: icon }));
|
|
110
80
|
};
|
|
111
81
|
export const TMUserTooltip = ({ ud, children }) => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
82
|
+
const buildTitle = (ud) => {
|
|
83
|
+
if (!ud)
|
|
84
|
+
return '';
|
|
85
|
+
const isExpired = User_IsExpired(ud);
|
|
86
|
+
return [
|
|
87
|
+
`ID: ${ud.id ?? ''}`,
|
|
88
|
+
`${SDKUI_Localizator.Name}: ${getCompleteUserName(ud.domain, ud.name) ?? ''}`,
|
|
89
|
+
ud.description && `${SDKUI_Localizator.Description}: ${ud.description}`,
|
|
90
|
+
ud.type && `${SDKUI_Localizator.Type}: ${ud.type}`,
|
|
91
|
+
ud.level && `${SDKUI_Localizator.UserLevel}: ${LocalizeUserLevels(ud.level) ?? ''}`,
|
|
92
|
+
`${SDKUI_Localizator.Valid}: ${isExpired ? SDKUI_Localizator.No : SDKUI_Localizator.Yes}`,
|
|
93
|
+
`${SDKUI_Localizator.Disabled}: ${ud.disabled ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}`,
|
|
94
|
+
`---`,
|
|
95
|
+
`${SDKUI_Localizator.OwnerName}: ${ud.ownerName ?? ''} (${ud.ownerID ?? ''})`,
|
|
96
|
+
`${SDKUI_Localizator.OwnershipLevel}: ${LocalizeOwnershipLevels(ud.ownershipLevel) ?? ''}`,
|
|
97
|
+
`${SDKUI_Localizator.CreationTime}: ${ud.creationTime?.toDateString() ?? ''}`,
|
|
98
|
+
`${SDKUI_Localizator.LastUpdateTime}: ${ud.lastUpdateTime?.toDateString() ?? ''}`
|
|
99
|
+
]
|
|
100
|
+
.filter(Boolean)
|
|
101
|
+
.join('\n');
|
|
116
102
|
};
|
|
117
|
-
return (_jsx(
|
|
103
|
+
return (_jsx("div", { title: buildTitle(ud), children: children }));
|
|
118
104
|
};
|
|
119
105
|
const getCompleteUserName = (domain, name) => {
|
|
120
106
|
if (!name)
|
|
@@ -16,6 +16,8 @@ const StyledCheckBoxLabel = styled.div `
|
|
|
16
16
|
color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : props.$labelColor ? props.$labelColor : TMColors.text_normal : TMColors.disabled};
|
|
17
17
|
font-size: ${props => props.$fontSize};
|
|
18
18
|
user-select: none;
|
|
19
|
+
-webkit-touch-callout: none;
|
|
20
|
+
-webkit-user-select: none;
|
|
19
21
|
&:focus{
|
|
20
22
|
outline: none;
|
|
21
23
|
background-image: linear-gradient(white, #E4E9F7);
|
|
@@ -10,27 +10,36 @@ const TMDateBox = (props) => {
|
|
|
10
10
|
let htmlElement = dateBoxRef?.current?.instance().element();
|
|
11
11
|
if (!htmlElement)
|
|
12
12
|
return;
|
|
13
|
-
let
|
|
13
|
+
let borderColor = props.isModifiedWhen ? TMColors.tertiary : TMColors.border_normal;
|
|
14
|
+
let textColor = props.isModifiedWhen ? TMColors.isModified : TMColors.text_normal;
|
|
14
15
|
let inputContainer = htmlElement.getElementsByClassName("dx-texteditor-input-container")[0];
|
|
15
16
|
if (inputContainer) {
|
|
16
17
|
inputContainer.style.background = props.readOnly ? 'linear-gradient(white 20%, #d6d6d6 80%)' : '';
|
|
17
|
-
inputContainer.style.color = props.readOnly ? '#525252' :
|
|
18
|
+
inputContainer.style.color = props.readOnly ? '#525252' : textColor;
|
|
19
|
+
}
|
|
20
|
+
let input = htmlElement.querySelector(".dx-texteditor-input");
|
|
21
|
+
if (input) {
|
|
22
|
+
if (!props.readOnly) {
|
|
23
|
+
input.style.color = textColor;
|
|
24
|
+
}
|
|
25
|
+
input.style.fontSize = 'var(--base-font-size)';
|
|
26
|
+
input.style.fontFamily = 'var(--base-font-family)';
|
|
18
27
|
}
|
|
19
28
|
let label = htmlElement.getElementsByClassName("dx-label")[0];
|
|
20
29
|
if (label) {
|
|
21
|
-
label.style.borderBottomColor =
|
|
30
|
+
label.style.borderBottomColor = borderColor;
|
|
22
31
|
}
|
|
23
32
|
let labelBefore = htmlElement.getElementsByClassName("dx-label-before")[0];
|
|
24
33
|
if (labelBefore) {
|
|
25
|
-
labelBefore.style.borderBottomColor =
|
|
26
|
-
labelBefore.style.borderTopColor =
|
|
27
|
-
labelBefore.style.borderInlineStartColor =
|
|
34
|
+
labelBefore.style.borderBottomColor = borderColor;
|
|
35
|
+
labelBefore.style.borderTopColor = borderColor;
|
|
36
|
+
labelBefore.style.borderInlineStartColor = borderColor;
|
|
28
37
|
}
|
|
29
38
|
let labelAfter = htmlElement.getElementsByClassName("dx-label-after")[0];
|
|
30
39
|
if (labelAfter) {
|
|
31
|
-
labelAfter.style.borderBottomColor =
|
|
32
|
-
labelAfter.style.borderTopColor =
|
|
33
|
-
labelAfter.style.borderInlineEndColor =
|
|
40
|
+
labelAfter.style.borderBottomColor = borderColor;
|
|
41
|
+
labelAfter.style.borderTopColor = borderColor;
|
|
42
|
+
labelAfter.style.borderInlineEndColor = borderColor;
|
|
34
43
|
}
|
|
35
44
|
}, [props.isModifiedWhen, props.readOnly]);
|
|
36
45
|
const dateBoxRef = useRef(null);
|
|
@@ -27,6 +27,9 @@ color: ${props => props.readOnly ? '#525252' : !props.$disabled ? (props.$vil.le
|
|
|
27
27
|
border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
|
|
28
28
|
min-width: ${props => props.$isMobile && '70px'};
|
|
29
29
|
background: ${props => props.readOnly ? 'linear-gradient(white 20%, #d6d6d6 80%)' : 'white'};
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
white-space: nowrap;
|
|
30
33
|
&:focus{
|
|
31
34
|
outline: none;
|
|
32
35
|
background-image: linear-gradient(white, #E4E9F7);
|
|
@@ -48,6 +51,8 @@ export const StyledEditorIcon = styled.div `
|
|
|
48
51
|
margin-right: 2px;
|
|
49
52
|
font-size: 18px;
|
|
50
53
|
user-select: none;
|
|
54
|
+
-webkit-touch-callout: none;
|
|
55
|
+
-webkit-user-select: none;
|
|
51
56
|
transform: translateY(18px);
|
|
52
57
|
`;
|
|
53
58
|
export const StyledEditorLabel = styled.div `
|
|
@@ -55,6 +60,8 @@ export const StyledEditorLabel = styled.div `
|
|
|
55
60
|
color:${props => !props.$disabled ? props.$isFocused ? TMColors.primary : props.$color ? props.$color : TMColors.label_normal : TMColors.disabled};
|
|
56
61
|
padding: 0 3px;
|
|
57
62
|
user-select: none;
|
|
63
|
+
-webkit-touch-callout: none;
|
|
64
|
+
-webkit-user-select: none;
|
|
58
65
|
transform: ${props => props.$labelPosition === 'left' && 'translateY(5px)'};
|
|
59
66
|
width: max-content;
|
|
60
67
|
transform: translate(10px, 6px);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CultureIDs } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { CultureIDs, QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
export declare const getCultureIDImg: (cultureID: CultureIDs) => any;
|
|
5
5
|
interface TMLocalizedTextBoxProps {
|
|
@@ -13,6 +13,8 @@ interface TMLocalizedTextBoxProps {
|
|
|
13
13
|
value_ES?: string;
|
|
14
14
|
value_DE?: string;
|
|
15
15
|
validationItems?: ValidationItem[];
|
|
16
|
+
qd?: QueryDescriptor;
|
|
17
|
+
tid?: number;
|
|
16
18
|
onValueChanged: (lang: CultureIDs, value: string) => void;
|
|
17
19
|
}
|
|
18
20
|
declare const TMLocalizedTextBox: React.FC<TMLocalizedTextBoxProps>;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import TMTextBox from './TMTextBox';
|
|
5
|
+
import TMMetadataTextBox from './TMMetadataTextBox';
|
|
5
6
|
import { IconLanguage, SDKUI_Localizator } from '../../helper';
|
|
6
7
|
import { CultureIDs } from '@topconsultnpm/sdk-ts';
|
|
7
8
|
import it from '../../assets/italy.svg';
|
|
@@ -13,11 +14,9 @@ import pt from '../../assets/portugal.svg';
|
|
|
13
14
|
import { createPortal } from 'react-dom';
|
|
14
15
|
const Portal = ({ children, popoverRef }) => {
|
|
15
16
|
const mount = document.body;
|
|
16
|
-
// Usa un ref per l'elemento del portale per evitare di ricrearlo ad ogni render
|
|
17
17
|
const elRef = useRef(document.createElement('div'));
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
const el = elRef.current;
|
|
20
|
-
// Assegna il ref al div del portale
|
|
21
20
|
el.ref = popoverRef;
|
|
22
21
|
mount.appendChild(el);
|
|
23
22
|
return () => {
|
|
@@ -33,7 +32,7 @@ const LocalizedContainer = styled.div `
|
|
|
33
32
|
const Popover = styled.div `
|
|
34
33
|
display: ${props => props.$isVisible ? 'flex' : 'none'};
|
|
35
34
|
flex-direction: column;
|
|
36
|
-
position: fixed;
|
|
35
|
+
position: fixed;
|
|
37
36
|
top: ${props => props.$top}px;
|
|
38
37
|
left: ${props => props.$left}px;
|
|
39
38
|
width: ${props => props.$width}px;
|
|
@@ -41,7 +40,7 @@ const Popover = styled.div `
|
|
|
41
40
|
border-radius: 4px;
|
|
42
41
|
background-color: #fff;
|
|
43
42
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
44
|
-
z-index:
|
|
43
|
+
z-index: 1502;
|
|
45
44
|
padding: 8px;
|
|
46
45
|
`;
|
|
47
46
|
const Badge = styled.span `
|
|
@@ -72,10 +71,10 @@ export const getCultureIDImg = (cultureID) => {
|
|
|
72
71
|
default: return it;
|
|
73
72
|
}
|
|
74
73
|
};
|
|
75
|
-
const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_PT, value_ES, value_DE, isModifiedWhen, validationItems, onValueChanged, }) => {
|
|
74
|
+
const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_PT, value_ES, value_DE, isModifiedWhen, validationItems, qd, tid, onValueChanged, }) => {
|
|
76
75
|
const [isPopoverVisible, setIsPopoverVisible] = useState(false);
|
|
77
|
-
const containerRef = useRef(null);
|
|
78
|
-
const popoverRef = useRef(null);
|
|
76
|
+
const containerRef = useRef(null);
|
|
77
|
+
const popoverRef = useRef(null);
|
|
79
78
|
const [popoverPosition, setPopoverPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
80
79
|
const languages = [
|
|
81
80
|
{ code: CultureIDs.It_IT, label: 'Italiano', value: value_IT },
|
|
@@ -85,13 +84,12 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
85
84
|
{ code: CultureIDs.Es_ES, label: 'Español', value: value_ES },
|
|
86
85
|
{ code: CultureIDs.De_DE, label: 'Deutsch', value: value_DE },
|
|
87
86
|
];
|
|
88
|
-
// Calcola il numero di lingue con valori non nulli o vuoti
|
|
89
87
|
const localizedCount = languages.filter(lang => lang.value && lang.value.trim() !== '').length;
|
|
90
88
|
const handleTogglePopover = () => {
|
|
91
89
|
if (containerRef.current) {
|
|
92
90
|
const rect = containerRef.current.getBoundingClientRect();
|
|
93
91
|
setPopoverPosition({
|
|
94
|
-
top: rect.bottom,
|
|
92
|
+
top: rect.bottom,
|
|
95
93
|
left: rect.left,
|
|
96
94
|
width: rect.width
|
|
97
95
|
});
|
|
@@ -99,19 +97,23 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
99
97
|
setIsPopoverVisible(prev => !prev);
|
|
100
98
|
};
|
|
101
99
|
const handleClosePopover = () => setIsPopoverVisible(false);
|
|
102
|
-
// Close popover when clicking outside
|
|
103
100
|
useEffect(() => {
|
|
101
|
+
if (!isPopoverVisible)
|
|
102
|
+
return;
|
|
104
103
|
const handleClickOutside = (event) => {
|
|
105
|
-
if (
|
|
106
|
-
containerRef.current &&
|
|
104
|
+
if (containerRef.current &&
|
|
107
105
|
!containerRef.current.contains(event.target) &&
|
|
108
106
|
popoverRef.current &&
|
|
109
107
|
!popoverRef.current.contains(event.target)) {
|
|
110
108
|
handleClosePopover();
|
|
111
109
|
}
|
|
112
110
|
};
|
|
113
|
-
|
|
111
|
+
// Ritarda l'aggiunta del listener per evitare che catturi il click di apertura
|
|
112
|
+
const timeoutId = setTimeout(() => {
|
|
113
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
114
|
+
}, 0);
|
|
114
115
|
return () => {
|
|
116
|
+
clearTimeout(timeoutId);
|
|
115
117
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
116
118
|
};
|
|
117
119
|
}, [isPopoverVisible]);
|
|
@@ -120,6 +122,6 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
120
122
|
icon: (_jsxs(IconContainer, { children: [_jsx(IconLanguage, {}), localizedCount > 0 && _jsx(Badge, { children: localizedCount })] })),
|
|
121
123
|
onClick: handleTogglePopover,
|
|
122
124
|
};
|
|
123
|
-
return (_jsxs(LocalizedContainer, { ref: containerRef, children: [_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) }), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, "$isVisible": isPopoverVisible, "$top": popoverPosition.top, "$left": popoverPosition.left, "$width": popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code))) }) }))] }));
|
|
125
|
+
return (_jsxs(LocalizedContainer, { ref: containerRef, children: [(qd || tid) ? (_jsx(TMMetadataTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, qd: qd, tid: tid, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })) : (_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, "$isVisible": isPopoverVisible, "$top": popoverPosition.top, "$left": popoverPosition.left, "$width": popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => ((qd || tid) ? (_jsx(TMMetadataTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', qd: qd, tid: tid, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)) : (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)))) }) }))] }));
|
|
124
126
|
};
|
|
125
127
|
export default TMLocalizedTextBox;
|
|
@@ -23,6 +23,7 @@ interface ITMMetadataEditorProps {
|
|
|
23
23
|
onValueChange?: (value: any) => void;
|
|
24
24
|
onCascadeRefreshDynDataLists?: (dynDataListsToBeRefreshed: DynDataListsToBeRefreshed[]) => void;
|
|
25
25
|
onCascadeUpdateMIDs?: (midsToBeUpdated: MIDsToBeUpdated[]) => void;
|
|
26
|
+
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
26
27
|
}
|
|
27
28
|
declare const TMMetadataEditor: React.FC<ITMMetadataEditorProps>;
|
|
28
29
|
export default TMMetadataEditor;
|
|
@@ -37,7 +37,7 @@ const getDateDisplayType = (format) => {
|
|
|
37
37
|
default: return DateDisplayTypes.Date;
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexProt, layoutMode, queryOperator, isEditable, isModifiedWhen = false, tid, mid, value, queryParamsDynDataList, containerElement, autoFocus, validationItems = [], disabled = false, openChooserBySingleClick = true, onValueChanged, onValueChange, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs }) => {
|
|
40
|
+
const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexProt, layoutMode, queryOperator, isEditable, isModifiedWhen = false, tid, mid, value, queryParamsDynDataList, containerElement, autoFocus, validationItems = [], disabled = false, openChooserBySingleClick = true, onValueChanged, onValueChange, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs, updateIsModalOpen }) => {
|
|
41
41
|
const [md, setMd] = useState();
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
// Passiamo did = undefined, perché è già in cache
|
|
@@ -84,21 +84,21 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
|
|
|
84
84
|
onValueChanged?.(undefined);
|
|
85
85
|
else
|
|
86
86
|
onValueChanged?.(IDs[0]);
|
|
87
|
-
} });
|
|
87
|
+
}, updateIsModalOpen: updateIsModalOpen });
|
|
88
88
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
89
89
|
return _jsx(TMDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, openChooserBySingleClick: openChooserBySingleClick, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
90
90
|
if (!IDs || IDs.length <= 0)
|
|
91
91
|
onValueChanged?.(undefined);
|
|
92
92
|
else
|
|
93
93
|
onValueChanged?.(IDs.join(","));
|
|
94
|
-
} });
|
|
94
|
+
}, updateIsModalOpen: updateIsModalOpen });
|
|
95
95
|
if (md?.dataDomain == MetadataDataDomains.UserID)
|
|
96
96
|
return _jsx(TMUserChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, openChooserBySingleClick: openChooserBySingleClick, backgroundColor: TMColors.default_background, showClearButton: !isReadOnlyResult, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], onValueChanged: (IDs) => {
|
|
97
97
|
if (!IDs || IDs.length <= 0)
|
|
98
98
|
onValueChanged?.(undefined);
|
|
99
99
|
else
|
|
100
100
|
onValueChanged?.(IDs.join(","));
|
|
101
|
-
} });
|
|
101
|
+
}, updateIsModalOpen: updateIsModalOpen });
|
|
102
102
|
if (showAsText)
|
|
103
103
|
return _jsx(TMTextBox, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', showClearButton: !isReadOnlyResult, maxLength: maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
104
104
|
if (showAsNumber)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import type { ITMTextBox } from './TMTextBox';
|
|
4
|
+
interface ITMMetadataTextBox extends ITMTextBox {
|
|
5
|
+
qd?: QueryDescriptor;
|
|
6
|
+
tid?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const TMMetadataTextBox: React.FC<ITMMetadataTextBox>;
|
|
9
|
+
export default TMMetadataTextBox;
|