expression field added in document editor. a few plans in plans folder

This commit is contained in:
2026-02-24 11:38:56 +02:00
parent 74663229d8
commit ac6b1f48b4
16 changed files with 1316 additions and 3 deletions
@@ -1,6 +1,7 @@
import React, { useRef, useEffect, useMemo } from 'react';
import TextField from './TextField';
import DBTextField from './DBTextField';
import ExpressionField from './ExpressionField';
import FrameElement from './FrameElement';
import HorizontalLine from './HorizontalLine';
import VerticalLine from './VerticalLine';
@@ -123,6 +124,19 @@ function EditorCanvas({
fieldPath: ''
};
onAddElement(newElement);
} else if (toolMode === 'addExpr') {
const newElement = {
id: `expr-${Date.now()}`,
type: 'expr',
x: col,
y: row,
width: 10,
height: 1,
expression: '',
dataType: 'general',
alignment: 'left'
};
onAddElement(newElement);
} else if (toolMode === 'addFrame') {
if (!frameStart) {
// First click - set start position
@@ -451,6 +465,14 @@ function EditorCanvas({
parentBandId={parentBandId}
/>
);
} else if (element.type === 'expr') {
return (
<ExpressionField
{...commonProps}
previewMode={previewMode}
parentBandId={parentBandId}
/>
);
} else if (element.type === 'frame') {
return <FrameElement {...commonProps} />;
} else if (element.type === 'hline') {