@topconsultnpm/sdkui-react-beta 6.9.27 → 6.9.29

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.
@@ -9,7 +9,7 @@ import TMTooltip from '../base/TMTooltip';
9
9
  const StyledSummaryTemplateInput = styled.div `
10
10
  width: ${props => props.$width};
11
11
  height: ${props => props.$height};
12
- padding: ${props => !props.$showBorder ? '0px 5px' : '4.5px'};
12
+ padding: ${props => !props.$showBorder ? '0px 5px' : '5px'};
13
13
  border: ${props => !props.$showBorder ? '' : '1px solid'};
14
14
  background: ${props => props.$readOnly ? 'linear-gradient(white 20%, #d6d6d6 80%)' : props.$backgroundColor};
15
15
  border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
@@ -73,7 +73,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
73
73
  const [showCompleteMetadataName, setShowCompleteMetadataName] = useState(false);
74
74
  const [showResultSearch, setShowResultSearch] = useState(false);
75
75
  const [fromCount, setFromCount] = useState(0);
76
- const [dynDataListsToBeRefreshed, setDynDataListsToBeRefreshed] = useState([]);
76
+ // const [dynDataListsToBeRefreshed, setDynDataListsToBeRefreshed] = useState<DynDataListsToBeRefreshed[]>([]);
77
77
  useEffect(() => { setShowResultSearch(false); }, [inputData]);
78
78
  useEffect(() => {
79
79
  if (!formData)
@@ -738,25 +738,24 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, runQdImmediately = fa
738
738
  ] }), _jsx(TMQdDropDownMenu, { disabled: index == 0, color: 'green', content: _jsx("div", { style: { fontSize: '1rem' }, children: wi.or ? 'OR' : 'AND' }), items: [
739
739
  { text: 'AND', onClick: () => onChange_WhereItem_Or(false, index) },
740
740
  { text: 'OR', onClick: () => onChange_WhereItem_Or(true, index) }
741
- ] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == wi.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
742
- let newDynDataListsToBeRefreshed = [];
743
- for (const item of dynDataListsToBeRefreshed) {
744
- let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
745
- if (index >= 0)
746
- continue;
747
- newDynDataListsToBeRefreshed.push(item);
748
- }
749
- for (const item of ddlToBeRefreshed) {
750
- if (item.queryParams.length <= 0)
751
- continue;
752
- if (!item.mid)
753
- continue;
754
- if (item.mid <= 0)
755
- continue;
756
- newDynDataListsToBeRefreshed.push(item);
757
- }
758
- setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
759
- }, onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); } }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
741
+ ] }), _jsx(TMQdEditableItem, { value: wi.leftBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, true, index); } }), _jsx(TMMetadataChooser, { disabled: isReadOnly, getColorIndex: getColorIndex, showCompleteMetadataName: showCompleteMetadataName, openEditorOnSummaryClick: true, showBorder: false, borderRadius: borderRadius, showId: showId, backgroundColor: getColorIndex({ tid: wi.tid, alias: wi.alias }), qd: formData, values: [{ tid: wi.tid, mid: wi.mid, aliasTID: wi.alias }], onValueChanged: (values) => { values.length > 0 && onChange_WhereItem_Metadato(values[0], index); } }), _jsx(TMQdDropDownMenu, { backgroundColor: colorOperator, color: 'green', borderRadius: borderRadius, content: _jsx(StyledDivHorizontal, { children: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(wi.operator) }) }), items: getQueryOperatorsMenuItems(wi, index) }), _jsx(TMQdWhereItemValue, { whereItem: wi, index: index,
742
+ // queryParamsDynDataList={dynDataListsToBeRefreshed.find(o => o.mid == wi.mid)?.queryParams ?? []}
743
+ // onCascadeRefreshDynDataLists={(ddlToBeRefreshed) => {
744
+ // let newDynDataListsToBeRefreshed = [];
745
+ // for (const item of dynDataListsToBeRefreshed) {
746
+ // let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
747
+ // if (index >= 0) continue;
748
+ // newDynDataListsToBeRefreshed.push(item);
749
+ // }
750
+ // for (const item of ddlToBeRefreshed) {
751
+ // if (item.queryParams.length <= 0) continue;
752
+ // if (!item.mid) continue;
753
+ // if (item.mid <= 0) continue;
754
+ // newDynDataListsToBeRefreshed.push(item);
755
+ // }
756
+ // setDynDataListsToBeRefreshed(newDynDataListsToBeRefreshed);
757
+ // }}
758
+ onValueChanged: (values) => { onChange_WhereItem_Values(values[0], values[1], index); } }), _jsx(TMQdEditableItem, { value: wi.rightBrackets, backgroundColor: colorBrackets, onValueChanged: (value) => { onChange_WhereItem_Brackets(value, false, index); } })] }, `${wi.tid}_${wi.mid}_${index}`));
760
759
  })] }) }) }), fromCount > 0 && (!isReadOnly || orderByCount > 0) && _jsx(Item, { title: SDK_Localizator.QueryOrderBy, titleRender: (tabItemProps) => renderAccordionTitle(tabItemProps, orderByCount, validationItems.filter((o) => o.PropertyName == TMPropertyNames.orderBy)), children: _jsx(StyledAccordionItemContainer, { children: _jsxs(StyledAccordionItemContent, { "$disabled": isReadOnly, children: [(!formData?.orderBy || formData?.orderBy.length <= 0) && !isReadOnly &&
761
760
  _jsx(StyledRowItem, { children: _jsx(TMButton, { btnStyle: 'normal', disabled: !formData?.from?.tid, caption: SDKUI_Localizator.Add, onClick: onAdd_OrderByItem }) }), formData?.orderBy?.map((oi, index) => {
762
761
  return (_jsxs(StyledRowItem, { onDragEnd: dragEnd, onDragOver: dragOver, onDrop: (e) => dropOrderBy(e, oi), children: [!isReadOnly && _jsx(StyledDraggableDiv, { draggable: true, onDragStart: (e) => dragStart(e, oi), children: _jsx(IconDraggabledots, { fontSize: 15, color: TMColors.button_icon }) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconClear, { color: TMColors.button_icon }), caption: SDKUI_Localizator.Remove, onClick: () => onRemove_OrderByItem(index) }), !isReadOnly && _jsx(TMButton, { btnStyle: 'icon', padding: '3px 0px', icon: _jsx(IconAddCircleOutline, { color: TMColors.button_icon }), caption: SDKUI_Localizator.AddBelow, onClick: () => onAdd_OrderByItem(index + 1) }), !isReadOnly && _jsx(TMQdDropDownMenu, { content: _jsx(TMTooltip, { content: SDK_Localizator.toCaseWord(SDKUI_Localizator.OneMore), children: _jsx(IconDotsVerticalCircleOutline, { color: TMColors.button_icon }) }), items: [
@@ -799,6 +798,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
799
798
  const [numberOfOperands, setNumberOfOperands] = useState(0);
800
799
  const [md, setMd] = useState();
801
800
  const [editingMode, setEditingMode] = useState(EditingModes.Editing);
801
+ const [isEditableList, setIsEditableList] = useState(false);
802
802
  const [showDataListChooseForm, setShowDataListChooseForm] = useState(false);
803
803
  const [dataList, setDataList] = useState();
804
804
  const [showDynDataListChooseForm, setShowDynDataListChooseForm] = useState(false);
@@ -862,6 +862,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
862
862
  if (mdOut?.dynDL_IsMultiCfg == 1)
863
863
  d = mdOut?.dynDL_Cfgs?.[1];
864
864
  setDynDl(d);
865
+ setIsEditableList(d?.qd?.from?.tid == whereItem.tid);
865
866
  mdOut?.id && SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(whereItem.tid, mdOut?.id, LayoutModes.None, queryParamsDynDataList ?? []).then((result) => {
866
867
  TMSpinner.hide();
867
868
  setDataSource(result);
@@ -930,7 +931,7 @@ const TMQdWhereItemValue = ({ whereItem, index, queryParamsDynDataList, onlyEdit
930
931
  };
931
932
  const mdValueEmptyDescr = `<${SDKUI_Localizator.Search_EnterValue}...>`;
932
933
  return (_jsxs("div", { ref: ref, id: containerId, style: { width: isEditing && whereItem.operator == QueryOperators.Custom && !onlyEditing ? "100%" : undefined }, children: [(isEditing || onlyEditing) &&
933
- _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) &&
934
+ _jsxs(StyledRowItem, { children: [showValue1 && _jsx(TMMetadataEditor, { tid: whereItem.tid, mid: whereItem.mid, layoutMode: LayoutModes.None, isEditableList: isEditableList, 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, isEditableList: isEditableList, value: whereItem.value1, queryOperator: whereItem.operator, autoFocus: !onlyEditing, containerElement: containerElement, onValueChange: (value) => setCurrentValue2(value), onValueChanged: (value) => { normalizeValue(value, false); } })] }), !isEditing && !onlyEditing && (showValue1 || showValue2) &&
934
935
  _jsxs(StyledDivHorizontal, { children: [(editingMode == EditingModes.Chooser) &&
935
936
  _jsxs(_Fragment, { children: [showDataListChooseForm &&
936
937
  _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 &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.9.27",
3
+ "version": "6.9.29",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",