@topconsultnpm/sdkui-react-beta 6.7.5 → 6.7.7
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.
|
@@ -169,7 +169,7 @@ const StyledWorkFlowOperationButton = styled.div `
|
|
|
169
169
|
justify-content: flex-end;
|
|
170
170
|
width: ${props => props.$width};
|
|
171
171
|
height: ${props => props.$height};
|
|
172
|
-
font-weight:
|
|
172
|
+
font-weight: 600;
|
|
173
173
|
cursor: ${props => !props.$isDisabled ? 'pointer' : 'default'};
|
|
174
174
|
border-radius: 10px;
|
|
175
175
|
overflow: hidden;
|
|
@@ -13,9 +13,10 @@ interface ITMMetadataEditorProps {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
validationItems?: ValidationItem[];
|
|
15
15
|
hasLabel?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
16
17
|
onValueChanged?: (value: any) => void;
|
|
17
18
|
onValueChange?: (value: any) => void;
|
|
18
19
|
onCascadeRefreshDynDataLists?: (dynDataListsToBeRefreshed: DynDataListsToBeRefreshed[]) => void;
|
|
19
20
|
}
|
|
20
|
-
declare const TMMetadataEditor: ({ hasLabel, tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems, disabled, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }: ITMMetadataEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const TMMetadataEditor: ({ hasLabel, readOnly, tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems, disabled, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }: ITMMetadataEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export default TMMetadataEditor;
|
|
@@ -10,7 +10,7 @@ import TMUserChooser from '../choosers/TMUserChooser';
|
|
|
10
10
|
import TMDateBox from './TMDateBox';
|
|
11
11
|
import TMTextBox from './TMTextBox';
|
|
12
12
|
import { TMMetadataIcon } from '../viewers/TMMidViewer';
|
|
13
|
-
const TMMetadataEditor = ({ hasLabel = false, tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems = [], disabled = false, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }) => {
|
|
13
|
+
const TMMetadataEditor = ({ hasLabel = false, readOnly, tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems = [], disabled = false, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }) => {
|
|
14
14
|
const [md, setMd] = useState();
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
DcmtTypeListCacheService.GetAsync(tid).then((dtd) => {
|
|
@@ -19,7 +19,7 @@ const TMMetadataEditor = ({ hasLabel = false, tid, mid, value, queryParamsDynDat
|
|
|
19
19
|
}, [mid]);
|
|
20
20
|
let btnDistincValues = { text: 'Valori distinti', icon: _jsx(IconLayerGroup, { fontSize: 16 }), onClick: () => { ShowAlert({ message: "TODO Valori distinti", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } };
|
|
21
21
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}")
|
|
22
|
-
return _jsx(TMTextBox, { readOnly:
|
|
22
|
+
return _jsx(TMTextBox, { readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: md?.length, autoFocus: autoFocus, value: value || '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
23
23
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
24
24
|
return _jsx(TMDynDataListItemChooser, { label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, buttons: [btnDistincValues], queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton: true, onValueChanged: (IDs) => {
|
|
25
25
|
if (!IDs || IDs.length <= 0)
|
|
@@ -42,13 +42,13 @@ const TMMetadataEditor = ({ hasLabel = false, tid, mid, value, queryParamsDynDat
|
|
|
42
42
|
onValueChanged?.(IDs.join(","));
|
|
43
43
|
} });
|
|
44
44
|
if (showAsText)
|
|
45
|
-
return _jsx(TMTextBox, { readOnly:
|
|
45
|
+
return _jsx(TMTextBox, { readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', buttons: [btnDistincValues], showClearButton: true, maxLength: md?.length, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
46
46
|
if (showAsNumber)
|
|
47
|
-
return _jsx(TMTextBox, { readOnly:
|
|
47
|
+
return _jsx(TMTextBox, { readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', showClearButton: true, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
48
48
|
switch (md?.dataType) {
|
|
49
|
-
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly:
|
|
50
|
-
case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly:
|
|
51
|
-
default: return _jsx(TMTextBox, { readOnly:
|
|
49
|
+
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly: readOnly, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, label: hasLabel ? md?.nameLoc : undefined, validationItems: validationItems, disabled: disabled, width: '100%', value: value, buttons: [btnDistincValues], showClearButton: true, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
|
|
50
|
+
case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'number', buttons: [btnDistincValues], showClearButton: true, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
51
|
+
default: return _jsx(TMTextBox, { readOnly: readOnly, label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, disabled: disabled, validationItems: validationItems, type: 'text', elementStyle: { width: '100%' }, showClearButton: true, buttons: [btnDistincValues], autoFocus: autoFocus, maxLength: md?.length, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
export default TMMetadataEditor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lib"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@topconsultnpm/sdk-ts-beta": "^6.7.
|
|
31
|
+
"@topconsultnpm/sdk-ts-beta": "^6.7.6",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
33
33
|
"devextreme": "24.1.6",
|
|
34
34
|
"devextreme-react": "24.1.6",
|