@topconsultnpm/sdkui-react-beta 6.6.103 → 6.6.105
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.
|
@@ -12,9 +12,10 @@ interface ITMMetadataEditorProps {
|
|
|
12
12
|
containerElement: Element | undefined;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
validationItems?: ValidationItem[];
|
|
15
|
+
hasLabel?: boolean;
|
|
15
16
|
onValueChanged?: (value: any) => void;
|
|
16
17
|
onValueChange?: (value: any) => void;
|
|
17
18
|
onCascadeRefreshDynDataLists?: (dynDataListsToBeRefreshed: DynDataListsToBeRefreshed[]) => void;
|
|
18
19
|
}
|
|
19
|
-
declare const TMMetadataEditor: ({ tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems, disabled, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }: ITMMetadataEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
20
21
|
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 = ({ tid, mid, value, queryParamsDynDataList, containerElement, allowMultipleSelection, autoFocus, showAsText, showAsNumber, validationItems = [], disabled = false, onValueChanged, onValueChange, onCascadeRefreshDynDataLists }) => {
|
|
13
|
+
const TMMetadataEditor = ({ hasLabel = false, 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,36 +19,36 @@ const TMMetadataEditor = ({ tid, mid, value, queryParamsDynDataList, containerEl
|
|
|
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, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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) });
|
|
22
|
+
return _jsx(TMTextBox, { 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
|
-
return _jsx(TMDynDataListItemChooser, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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) => {
|
|
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)
|
|
26
26
|
onValueChanged?.(undefined);
|
|
27
27
|
else
|
|
28
28
|
onValueChanged?.(IDs[0]);
|
|
29
29
|
} });
|
|
30
30
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
31
|
-
return _jsx(TMDataListItemChooser, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), validationItems: validationItems, disabled: disabled, 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: true, buttons: [btnDistincValues], onValueChanged: (IDs) => {
|
|
31
|
+
return _jsx(TMDataListItemChooser, { label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, 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: true, buttons: [btnDistincValues], onValueChanged: (IDs) => {
|
|
32
32
|
if (!IDs || IDs.length <= 0)
|
|
33
33
|
onValueChanged?.(undefined);
|
|
34
34
|
else
|
|
35
35
|
onValueChanged?.(IDs.join(","));
|
|
36
36
|
} });
|
|
37
37
|
if (md?.dataDomain == MetadataDataDomains.UserID)
|
|
38
|
-
return _jsx(TMUserChooser, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: true, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: [btnDistincValues], onValueChanged: (IDs) => {
|
|
38
|
+
return _jsx(TMUserChooser, { label: hasLabel ? md?.nameLoc : undefined, icon: hasLabel ? _jsx(TMMetadataIcon, { md: md, tid: tid }) : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, placeHolder: " ", showClearButton: true, allowMultipleSelection: allowMultipleSelection, values: value?.split(',').map((item) => !item.startsWith("'") ? Number(item) : Number(item.slice(1, -1))) ?? [], buttons: [btnDistincValues], onValueChanged: (IDs) => {
|
|
39
39
|
if (!IDs || IDs.length <= 0)
|
|
40
40
|
onValueChanged?.(undefined);
|
|
41
41
|
else
|
|
42
42
|
onValueChanged?.(IDs.join(","));
|
|
43
43
|
} });
|
|
44
44
|
if (showAsText)
|
|
45
|
-
return _jsx(TMTextBox, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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) });
|
|
45
|
+
return _jsx(TMTextBox, { 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, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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) });
|
|
47
|
+
return _jsx(TMTextBox, { 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, { icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), label: md?.nameLoc, 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, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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, { label: md?.nameLoc, icon: _jsx(TMMetadataIcon, { md: md, tid: tid }), 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); } });
|
|
49
|
+
case MetadataDataTypes.DateTime: return _jsx(TMDateBox, { 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, { 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, { 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.6.
|
|
3
|
+
"version": "6.6.105",
|
|
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.6.
|
|
31
|
+
"@topconsultnpm/sdk-ts-beta": "^6.6.21",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
33
33
|
"devextreme": "24.1.6",
|
|
34
34
|
"devextreme-react": "24.1.6",
|