expression field added in document editor. a few plans in plans folder
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user