fix: no literal statement and no merge
This commit is contained in:
parent
c793b70638
commit
d892ee88a5
|
@ -19,6 +19,7 @@ const decorate = compose(
|
|||
const Expression = (props) => {
|
||||
const {
|
||||
context,
|
||||
isStatement,
|
||||
onChange = () => {},
|
||||
type,
|
||||
value = {},
|
||||
|
@ -60,7 +61,7 @@ const Expression = (props) => {
|
|||
value={op.key}
|
||||
>
|
||||
{
|
||||
[...options, '<literal>']
|
||||
options.concat(!isStatement && 0 === i ? '<literal>' : [])
|
||||
.sort((l, r) => (l.toLowerCase() < r.toLowerCase() ? -1 : 1))
|
||||
.map((option) => <option key={option}>{option}</option>)
|
||||
}
|
||||
|
|
|
@ -27,19 +27,19 @@ const Expressions = ({
|
|||
<li key={i}>
|
||||
<Expression.Component
|
||||
context={context}
|
||||
onChange={(expressionValue, event) => (
|
||||
onChange({
|
||||
...value,
|
||||
expressions: [
|
||||
...expressions.slice(0, i),
|
||||
{
|
||||
...expressions[i],
|
||||
...expressionValue,
|
||||
},
|
||||
...expressions.slice(i + 1),
|
||||
],
|
||||
}, event)
|
||||
)}
|
||||
isStatement
|
||||
onChange={(expressionValue, event) => {
|
||||
return (
|
||||
onChange({
|
||||
...value,
|
||||
expressions: [
|
||||
...expressions.slice(0, i),
|
||||
expressionValue,
|
||||
...expressions.slice(i + 1),
|
||||
],
|
||||
}, event)
|
||||
);
|
||||
}}
|
||||
type="any"
|
||||
value={expression}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue
Block a user