@topconsultnpm/sdkui-react-beta 6.16.37 → 6.16.39
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { MetadataDataDomains, MetadataDataTypes, DcmtTypeListCacheService, LayoutModes, AccessLevels, PlatformObjectValidator, QueryOperators, SDK_Globals, AppModules, MetadataFormats } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import { TMColors } from '../../utils/theme';
|
|
5
5
|
import TMDataListItemChooser from '../choosers/TMDataListItemChooser';
|
|
@@ -57,6 +57,15 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
|
|
|
57
57
|
};
|
|
58
58
|
const isModifiedWhenInternal = () => { return isModifiedWhen && !md?.isSystem; };
|
|
59
59
|
let operands = PlatformObjectValidator.GetNumberOfOperands(queryOperator);
|
|
60
|
+
const modulesWithLabelTop = useMemo(() => {
|
|
61
|
+
if (SDK_Globals.appModule === AppModules.SURFER
|
|
62
|
+
|| SDK_Globals.appModule === AppModules.EXCEL_CONNECTOR
|
|
63
|
+
|| SDK_Globals.appModule === AppModules.OUTLOOK_CONNECTOR
|
|
64
|
+
|| SDK_Globals.appModule === AppModules.POWERPOINT_CONNECTOR
|
|
65
|
+
|| SDK_Globals.appModule === AppModules.WORD_CONNECTOR)
|
|
66
|
+
return false;
|
|
67
|
+
return true;
|
|
68
|
+
}, [SDK_Globals.appModule]);
|
|
60
69
|
const showLabelTop = (layoutMode === LayoutModes.Update) || (layoutMode === LayoutModes.Ark);
|
|
61
70
|
const showByTextarea = showLabelTop && md && md?.dataType === MetadataDataTypes.Varchar && md.length && md.length > 80;
|
|
62
71
|
const showAsText = operands == 11 || operands == 99;
|
|
@@ -68,7 +77,7 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
|
|
|
68
77
|
let isReadOnlyResult = isReadOnly ?? isReadOnlyInternal();
|
|
69
78
|
let icon = renderMetadataIcon(tid, md, layoutMode, isSelected, showLabelTop);
|
|
70
79
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}" || queryOperator == QueryOperators.Custom || isEditable)
|
|
71
|
-
return _jsx(TMTextBox, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: (
|
|
80
|
+
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', maxLength: isEditable ? undefined : maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
72
81
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
73
82
|
return _jsx(TMDynDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, layoutMode: layoutMode, isModifiedWhen: isModifiedWhenInternal(), label: (SDK_Globals.appModule !== AppModules.SURFER || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, openChooserBySingleClick: openChooserBySingleClick, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ? [value] : [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
74
83
|
if (!IDs || IDs.length <= 0)
|