@topconsultnpm/sdkui-react 6.21.0-dev2.16 → 6.21.0-dev2.18
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.
|
@@ -147,13 +147,13 @@ const TMFormulaEditor = (props) => {
|
|
|
147
147
|
return (_jsx(TMApplyForm, { isModal: props.isModal, formMode: props.formMode, isModified: formData.expression !== formDataOrig.expression, exception: exception, validationItems: validationItems, title: SDKUI_Localizator.Formula, hasNavigation: false, showBack: props.showBack, height: '600px', width: '800px', onApply: () => applyData(), onClose: props.onClose, onUndo: () => {
|
|
148
148
|
setFormData(formDataOrig);
|
|
149
149
|
setValidationItems([]);
|
|
150
|
-
}, customToolbarElements: _jsx(TMButton, { caption: SDKUI_Localizator.EvaluateResult, onClick: () => { formulaValidator_BackEnd(); }, btnStyle: 'toolbar', icon: _jsx(IconNotification, {}) }), children:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
}, customToolbarElements: _jsx(TMButton, { caption: SDKUI_Localizator.EvaluateResult, onClick: () => { formulaValidator_BackEnd(); }, btnStyle: 'toolbar', icon: _jsx(IconNotification, {}) }), children: _jsxs("div", { ref: ref, style: { width: '100%', height: '100%' }, children: [selectedItem?.description && (_jsx(TMLayoutItem, { height: "max-content", children: _jsxs("div", { style: { padding: '6px 10px', background: TMColors.default_background, borderTop: `1px solid ${TMColors.border_normal}`, fontSize: FontSize.defaultFontSize }, children: [_jsx("span", { style: { fontWeight: 'bold', color: TMColors.info, marginRight: '8px' }, children: FormulaHelper.translateDescInFormula(selectedItem.text) }), _jsx("span", { style: { color: TMColors.info }, children: selectedItem.description })] }) })), _jsxs(TMSplitterLayout, { direction: isVertical ? 'vertical' : 'horizontal', showSeparator: true, separatorSize: 5, start: isVertical ? ['50%', '50%'] : ['35%', '65%'], min: ['0px', '0px'], children: [_jsx(TMCard, { scrollX: true, children: _jsx(TreeView, { id: "treeview", items: props.inputData?.items, width: '100%', height: '100%', scrollDirection: 'vertical', itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick }) }), _jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx(TMLayoutItem, { children: _jsx(TMCard, { scrollX: true, children: _jsx("textarea", { ref: textAreaRef, spellCheck: false, value: formData?.expression ?? '', onChange: (e) => {
|
|
151
|
+
setFormData({ ...formData, expression: e.target.value });
|
|
152
|
+
if (e.target.value != formDataOrig?.expression)
|
|
153
|
+
insertValidationItem();
|
|
154
|
+
else
|
|
155
|
+
setValidationItems([]);
|
|
156
|
+
}, style: { border: 'none', resize: 'none', color: TMColors.text_normal, fontSize: FontSize.defaultFontSize, padding: '5px', width: '100%', height: 'calc(100% - 4px)' } }) }) }), _jsx(TMLayoutItem, { height: "max-content", children: _jsx(TMVilViewer, { vil: validationItems }) })] })] })] }) }));
|
|
157
157
|
};
|
|
158
158
|
export default TMFormulaEditor;
|
|
159
159
|
export class FormulaHelper {
|
|
@@ -545,12 +545,10 @@ export const useDocumentOperations = (props) => {
|
|
|
545
545
|
const firstDoc = selectedDcmtInfos?.[0];
|
|
546
546
|
// Check if the selected document is a PDF
|
|
547
547
|
const isPdf = firstDoc?.FILEEXT?.toLowerCase() === "pdf";
|
|
548
|
-
// Check if the document has been signed
|
|
549
|
-
const isSigned = firstDoc?.ISSIGNED === 1;
|
|
550
548
|
// Check if the user has permission to substitute files
|
|
551
549
|
const canSubstitute = dtd?.perm?.canSubstFile === AccessLevels.Yes;
|
|
552
550
|
// Determine whether the menu item should be disabled
|
|
553
|
-
const isDisabled = !canSubstitute || isDisabledForSingleRow() || !isPdf
|
|
551
|
+
const isDisabled = !canSubstitute || isDisabledForSingleRow() || !isPdf;
|
|
554
552
|
return {
|
|
555
553
|
id: 'pdf-ed',
|
|
556
554
|
icon: _jsx(IconEdit, {}),
|
package/lib/hooks/useForm.js
CHANGED
|
@@ -101,6 +101,9 @@ export function useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChang
|
|
|
101
101
|
newId = await saveCustomAsync();
|
|
102
102
|
else
|
|
103
103
|
newId = await setDataAsync?.(formMode, formData, ...args);
|
|
104
|
+
if (newId <= 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
104
107
|
let newData;
|
|
105
108
|
if (sfo.loadDataAfterSave)
|
|
106
109
|
newData = await loadDataAsync(newId, FormModes.Update);
|