@topconsultnpm/sdkui-react-beta 6.6.56 → 6.6.58
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.
|
@@ -21,7 +21,7 @@ const TMUserChooser = ({ readOnly = false, dataSource, backgroundColor, buttons
|
|
|
21
21
|
? _jsx("p", { children: placeHolder })
|
|
22
22
|
: _jsxs(_Fragment, { children: [_jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }) }));
|
|
23
23
|
};
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled,
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled, 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, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
25
25
|
_jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, dataSource: dataSource, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
26
26
|
};
|
|
27
27
|
export default TMUserChooser;
|
|
@@ -20,34 +20,34 @@ const TMMetadataEditor = ({ tid, mid, value, queryParamsDynDataList, containerEl
|
|
|
20
20
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}")
|
|
21
21
|
return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', maxLength: md?.length, autoFocus: autoFocus, value: value || '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
22
22
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
23
|
-
return _jsx(TMDynDataListItemChooser, { readOnly: readOnly, md: md, tid: tid, buttons: [btnDistincValues], queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton:
|
|
23
|
+
return _jsx(TMDynDataListItemChooser, { readOnly: readOnly, md: md, tid: tid, buttons: !readOnly ? [btnDistincValues] : [], queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: allowMultipleSelection, values: value ? [value] : [], showClearButton: !readOnly, onValueChanged: (IDs) => {
|
|
24
24
|
if (!IDs || IDs.length <= 0)
|
|
25
25
|
onValueChanged?.(undefined);
|
|
26
26
|
else
|
|
27
27
|
onValueChanged?.(IDs[0]);
|
|
28
28
|
} });
|
|
29
29
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
30
|
-
return _jsx(TMDataListItemChooser, { readOnly: readOnly, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton:
|
|
30
|
+
return _jsx(TMDataListItemChooser, { readOnly: readOnly, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !readOnly, buttons: !readOnly ? [btnDistincValues] : [], onValueChanged: (IDs) => {
|
|
31
31
|
if (!IDs || IDs.length <= 0)
|
|
32
32
|
onValueChanged?.(undefined);
|
|
33
33
|
else
|
|
34
34
|
onValueChanged?.(IDs.join(","));
|
|
35
35
|
} });
|
|
36
36
|
if (md?.dataDomain == MetadataDataDomains.UserID)
|
|
37
|
-
return _jsx(TMUserChooser, { readOnly: readOnly, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton:
|
|
37
|
+
return _jsx(TMUserChooser, { disabled: readOnly, readOnly: readOnly, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: !readOnly, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: !readOnly ? [btnDistincValues] : [], onValueChanged: (IDs) => {
|
|
38
38
|
if (!IDs || IDs.length <= 0)
|
|
39
39
|
onValueChanged?.(undefined);
|
|
40
40
|
else
|
|
41
41
|
onValueChanged?.(IDs.join(","));
|
|
42
42
|
} });
|
|
43
43
|
if (showAsText)
|
|
44
|
-
return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', buttons: [btnDistincValues], showClearButton:
|
|
44
|
+
return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'text', buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, maxLength: md?.length, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
45
45
|
if (showAsNumber)
|
|
46
|
-
return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', showClearButton:
|
|
46
|
+
return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', showClearButton: !readOnly, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
47
47
|
switch (md?.dataType) {
|
|
48
|
-
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly: readOnly, width: '100%', value: value, buttons: [btnDistincValues], showClearButton:
|
|
49
|
-
case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', buttons: [btnDistincValues], showClearButton:
|
|
50
|
-
default: return _jsx(TMTextBox, { readOnly: readOnly, type: 'text', elementStyle: { width: '100%' }, showClearButton:
|
|
48
|
+
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { readOnly: readOnly, width: '100%', value: value, buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, useDateSerializationFormat: true, containerElement: containerElement, onValueChange: (newValue) => { onValueChange?.(newValue ? newValue.toString() : undefined); onValueChanged?.(newValue ? newValue.toString() : undefined); } });
|
|
49
|
+
case MetadataDataTypes.Number: return _jsx(TMTextBox, { readOnly: readOnly, elementStyle: { width: '100%' }, type: 'number', buttons: !readOnly ? [btnDistincValues] : [], showClearButton: !readOnly, precision: md?.length, scale: md?.scale, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
50
|
+
default: return _jsx(TMTextBox, { readOnly: readOnly, type: 'text', elementStyle: { width: '100%' }, showClearButton: !readOnly, buttons: !readOnly ? [btnDistincValues] : [], autoFocus: autoFocus, maxLength: md?.length, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => { onValueChanged?.(newValue); } });
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
export default TMMetadataEditor;
|