dmn-js-literal-expression
Advanced tools
Comparing version 14.3.0 to 14.4.0
import { createVNode, createComponentVNode } from "inferno"; | ||
import { Component } from 'inferno'; | ||
import EditableComponent from 'dmn-js-shared/lib/components/EditableComponent'; | ||
import LiteralExpression from 'dmn-js-shared/lib/components/LiteralExpression'; | ||
export default class TextareaEditorComponent extends Component { | ||
@@ -9,2 +10,3 @@ constructor(props, context) { | ||
this._viewer = context.injector.get('viewer'); | ||
this._expressionLanguages = context.injector.get('expressionLanguages'); | ||
this.editLiteralExpressionText = this.editLiteralExpressionText.bind(this); | ||
@@ -27,2 +29,12 @@ this.onElementsChanged = this.onElementsChanged.bind(this); | ||
} | ||
getEditor() { | ||
return this.isFeel() ? FeelEditor : Editor; | ||
} | ||
isFeel() { | ||
return this.getExpressionLanguage() === 'feel'; | ||
} | ||
getExpressionLanguage() { | ||
const businessObject = this.getLiteralExpression(); | ||
return businessObject.expressionLanguage || this._expressionLanguages.getDefault().value; | ||
} | ||
render() { | ||
@@ -32,2 +44,3 @@ // there is only one single element | ||
text = _this$getLiteralExpre2.text; | ||
const Editor = this.getEditor(); | ||
return createComponentVNode(2, Editor, { | ||
@@ -40,2 +53,11 @@ "className": "textarea editor", | ||
} | ||
class FeelEditor extends Component { | ||
render() { | ||
return createComponentVNode(2, LiteralExpression, { | ||
"className": this.props.className, | ||
"value": this.props.value, | ||
"onChange": this.props.onChange | ||
}); | ||
} | ||
} | ||
class Editor extends EditableComponent { | ||
@@ -42,0 +64,0 @@ render() { |
{ | ||
"name": "dmn-js-literal-expression", | ||
"description": "A literal expression view for dmn-js", | ||
"version": "14.3.0", | ||
"version": "14.4.0", | ||
"files": [ | ||
@@ -41,3 +41,3 @@ "assets", | ||
}, | ||
"gitHead": "36563419eca902506c624b015581c04e20979e59" | ||
"gitHead": "a01301a11044eb31589158b9c86f0221667df71d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127512
1282