@topconsultnpm/sdkui-react-beta 6.7.140 → 6.7.141
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.
|
@@ -554,7 +554,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
|
|
|
554
554
|
return (_jsxs(StyledDivHorizontal, { children: [_jsx("p", { children: title }), _jsx(TMTabItemBadge, { vil: vil })] }));
|
|
555
555
|
};
|
|
556
556
|
const getColorIndex = (tid) => {
|
|
557
|
-
let index = qdTIDs.findIndex(o => o.tid == tid.tid && o.alias == tid.alias);
|
|
557
|
+
let index = qdTIDs.findIndex(o => o.tid == tid.tid && (o.alias ?? '') == (tid.alias ?? ''));
|
|
558
558
|
switch (index) {
|
|
559
559
|
case 0: return color1;
|
|
560
560
|
case 1: return color2;
|
|
@@ -803,9 +803,17 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
|
|
|
803
803
|
export default TMQueryEditor;
|
|
804
804
|
const TMQdEditableItem = ({ value, placeHolder, width, backgroundColor, onValueChanged }) => {
|
|
805
805
|
const [isComponentVisible, setIsComponentVisible] = useState(false);
|
|
806
|
-
const
|
|
806
|
+
const [currentValue1, setCurrentValue1] = useState();
|
|
807
|
+
useEffect(() => { setCurrentValue1(value); }, [value]);
|
|
808
|
+
const ref = useOutsideClick((escPressed) => {
|
|
809
|
+
setIsComponentVisible(false);
|
|
810
|
+
if (escPressed)
|
|
811
|
+
return;
|
|
812
|
+
if (currentValue1 != value)
|
|
813
|
+
onValueChanged?.(currentValue1);
|
|
814
|
+
});
|
|
807
815
|
return (_jsx("div", { ref: ref, children: isComponentVisible ?
|
|
808
|
-
_jsx(TMTextBox, { elementStyle: { marginLeft: '5px', marginRight: '5px' }, width: width ?? '50px', autoFocus: true, value: value ?? '',
|
|
816
|
+
_jsx(TMTextBox, { elementStyle: { marginLeft: '5px', marginRight: '5px' }, width: width ?? '50px', autoFocus: true, value: value ?? '', onValueChanged: (e) => setCurrentValue1(e.target.value) })
|
|
809
817
|
:
|
|
810
818
|
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: { backgroundColor: backgroundColor, cursor: 'pointer' }, children: value ?? placeHolder }) }));
|
|
811
819
|
};
|
|
@@ -866,7 +874,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
|
|
|
866
874
|
setMd(mdOut);
|
|
867
875
|
switch (mdOut?.dataDomain) {
|
|
868
876
|
case MetadataDataDomains.DataList:
|
|
869
|
-
setEditingMode(EditingModes.Chooser);
|
|
877
|
+
setEditingMode(whereItem.operator == QueryOperators.Custom ? EditingModes.Editing : EditingModes.Chooser);
|
|
870
878
|
if (dataList != undefined)
|
|
871
879
|
return;
|
|
872
880
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
|
|
@@ -876,7 +884,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
|
|
|
876
884
|
});
|
|
877
885
|
break;
|
|
878
886
|
case MetadataDataDomains.DynamicDataList:
|
|
879
|
-
setEditingMode(EditingModes.Chooser);
|
|
887
|
+
setEditingMode(whereItem.operator == QueryOperators.Custom ? EditingModes.Editing : EditingModes.Chooser);
|
|
880
888
|
if (dynDl != undefined)
|
|
881
889
|
return;
|
|
882
890
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${"Lista dati dinamica"} ...` });
|
|
@@ -890,7 +898,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
|
|
|
890
898
|
}).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
|
|
891
899
|
break;
|
|
892
900
|
case MetadataDataDomains.UserID:
|
|
893
|
-
setEditingMode(EditingModes.Chooser);
|
|
901
|
+
setEditingMode(whereItem.operator == QueryOperators.Custom ? EditingModes.Editing : EditingModes.Chooser);
|
|
894
902
|
if (users !== undefined)
|
|
895
903
|
return;
|
|
896
904
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
@@ -953,7 +961,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
|
|
|
953
961
|
const mdValueEmptyDescr = `<${SDKUI_Localizator.Search_EnterValue}...>`;
|
|
954
962
|
return (_jsxs("div", { ref: ref, id: containerId, style: { width: isEditing && whereItem.operator == QueryOperators.Custom && !onlyEditing ? "100%" : undefined }, children: [(isEditing || onlyEditing) &&
|
|
955
963
|
_jsxs(StyledRowItem, { children: [showValue1 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue1(value), onValueChanged: (value) => { normalizeValue(value, true); } }), showValue2 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue2(value), onValueChanged: (value) => { normalizeValue(value, false); } })] }), !isEditing && !onlyEditing && (showValue1 || showValue2) &&
|
|
956
|
-
_jsxs(StyledDivHorizontal, { children: [editingMode == EditingModes.Chooser &&
|
|
964
|
+
_jsxs(StyledDivHorizontal, { children: [(editingMode == EditingModes.Chooser) &&
|
|
957
965
|
_jsxs(_Fragment, { children: [showDataListChooseForm &&
|
|
958
966
|
_jsx(TMDataListItemChooserForm, { height: '500px', width: '450px', allowMultipleSelection: whereItem.operator == QueryOperators.In || whereItem.operator == QueryOperators.NotIn, dataListId: md?.dataListID, selectedIDs: whereItem.value1?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], onClose: () => setShowDataListChooseForm(false), onChoose: (IDs) => { IDs && normalizeValue(IDs.length == 1 ? IDs[0] : IDs.map((item) => `${item}`).join(","), true); } }), showDynDataListChooseForm &&
|
|
959
967
|
_jsx(TMDynDataListItemChooserForm, { TID: whereItem.tid, MID: md?.id, height: '500px', width: '450px', dynDL: dynDl, allowMultipleSelection: false, searchResult: dataSource, selectedIDs: [whereItem.value1], onClose: () => setShowDynDataListChooseForm(false), onChoose: (IDs) => {
|
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.141",
|
|
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.40",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
33
33
|
"devextreme": "24.1.6",
|
|
34
34
|
"devextreme-react": "24.1.6",
|