@topconsultnpm/sdkui-react 6.21.0-dev1.22 → 6.21.0-dev1.23
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.
|
@@ -242,6 +242,35 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
242
242
|
curJoinItem.on = onJoinCopy;
|
|
243
243
|
setFormData({ ...formData, join: joinCopy });
|
|
244
244
|
};
|
|
245
|
+
const onChange_OnJoinItem_Or = (or, index, indexOn) => {
|
|
246
|
+
const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
|
|
247
|
+
let curJoinItem = joinCopy[index];
|
|
248
|
+
const onJoinCopy = curJoinItem.on?.map((curItem, curIndex) => {
|
|
249
|
+
if (indexOn != curIndex)
|
|
250
|
+
return curItem;
|
|
251
|
+
let newOn = new OnJoinItem();
|
|
252
|
+
newOn.init({ ...curItem, or: or });
|
|
253
|
+
return newOn;
|
|
254
|
+
});
|
|
255
|
+
curJoinItem.on = onJoinCopy;
|
|
256
|
+
setFormData({ ...formData, join: joinCopy });
|
|
257
|
+
};
|
|
258
|
+
const onChange_OnJoinItem_Brackets = (value, isLeft, index, indexOn) => {
|
|
259
|
+
const joinCopy = formData?.join?.map((ji) => { return { ...ji }; }) ?? [];
|
|
260
|
+
let curJoinItem = joinCopy[index];
|
|
261
|
+
const onJoinCopy = curJoinItem.on?.map((curItem, curIndex) => {
|
|
262
|
+
if (indexOn != curIndex)
|
|
263
|
+
return curItem;
|
|
264
|
+
let newOn = new OnJoinItem();
|
|
265
|
+
if (isLeft)
|
|
266
|
+
newOn.init({ ...curItem, leftBrackets: value });
|
|
267
|
+
else
|
|
268
|
+
newOn.init({ ...curItem, rightBrackets: value });
|
|
269
|
+
return newOn;
|
|
270
|
+
});
|
|
271
|
+
curJoinItem.on = onJoinCopy;
|
|
272
|
+
setFormData({ ...formData, join: joinCopy });
|
|
273
|
+
};
|
|
245
274
|
const getJoinTypesMenuItems = (index) => {
|
|
246
275
|
let items = [
|
|
247
276
|
{ name: LocalizeQueryJoinTypes(JoinTypes.InnerJoin), onClick: () => onChange_JoinItem_JoinType(JoinTypes.InnerJoin, index) },
|
|
@@ -758,7 +787,10 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
758
787
|
setFormData({ ...formData, join: joinCopy });
|
|
759
788
|
}
|
|
760
789
|
}
|
|
761
|
-
] }), _jsx(
|
|
790
|
+
] }), _jsx(TMQdDropDownMenu, { disabled: indexOn == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: onItem.or ? 'OR' : 'AND' }), items: [
|
|
791
|
+
{ name: 'AND', onClick: () => onChange_OnJoinItem_Or(false, index, indexOn) },
|
|
792
|
+
{ name: 'OR', onClick: () => onChange_OnJoinItem_Or(true, index, indexOn) }
|
|
793
|
+
] }), _jsx(TMQdEditableItem, { value: onItem.leftBrackets, allowedPattern: /\(/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_OnJoinItem_Brackets(value, true, index, indexOn); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.leftTID, alias: onItem.leftAlias }), qd: formData, values: onItem.leftTID ? [{ tid: onItem.leftTID, mid: onItem.leftMID, aliasTID: onItem.leftAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoLeft(values[0], index, indexOn); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(onItem.operator) }), items: [] }), _jsx(TMMetadataChooser, { disabled: isReadOnly, showEditButton: false, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: onItem.rightTID, alias: onItem.rightAlias }), qd: formData, values: onItem.rightTID ? [{ tid: onItem.rightTID, mid: onItem.rightMID, aliasTID: onItem.rightAlias }] : [], onValueChanged: (values) => { values.length > 0 && onChange_OnJoinMetadatoRight(values[0], index, indexOn); }, updateIsModalOpen: updateIsModalOpen }), _jsx(TMQdEditableItem, { value: onItem.rightBrackets, allowedPattern: /\)/g, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_OnJoinItem_Brackets(value, false, index, indexOn); } })] }, indexOn));
|
|
762
794
|
})] }, `${ji.tid}_${index}`));
|
|
763
795
|
}), _jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.join) })] }) }) }), canShowSelect && _jsx(Item, { title: SDK_Localizator.QuerySelect, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, selectCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.select)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [_jsx(TMVilViewer, { vil: validationItems.filter((o) => o.PropertyName === TMPropertyNames.select) }), (!formData?.select || formData?.select.length <= 0) && !isReadOnly &&
|
|
764
796
|
_jsxs(StyledRowItem, { children: [_jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_SelectItem }), dcmtTypesList.length == 1
|
|
@@ -814,7 +846,11 @@ const TMQdEditableItem = ({ value, placeHolder, width, backgroundColor, allowedP
|
|
|
814
846
|
return (_jsx("div", { ref: ref, children: isComponentVisible ?
|
|
815
847
|
_jsx(TMTextBox, { elementStyle: { marginLeft: '5px', marginRight: '5px' }, width: width ?? '50px', autoFocus: true, value: value ?? '', onValueChanged: handleTextBoxValueChanged, allowedPattern: allowedPattern })
|
|
816
848
|
:
|
|
817
|
-
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: {
|
|
849
|
+
_jsx(StyledItemWrapper, { onClick: () => setIsComponentVisible(true), style: {
|
|
850
|
+
backgroundColor: backgroundColor,
|
|
851
|
+
cursor: 'pointer',
|
|
852
|
+
minHeight: '24px'
|
|
853
|
+
}, children: value ?? placeHolder }) }));
|
|
818
854
|
};
|
|
819
855
|
const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEditing = false, onValueChanged, onCascadeRefreshDynDataLists, updateIsModalOpen }) => {
|
|
820
856
|
let EditingModes;
|