wip
This commit is contained in:
56
demo-node.js
Normal file
56
demo-node.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2024 trading_peter
|
||||
This program is available under Apache License Version 2.0
|
||||
*/
|
||||
|
||||
import { html, css } from 'lit';
|
||||
import { TpFlowNode } from './tp-flow-node';
|
||||
|
||||
class DemoNode extends TpFlowNode {
|
||||
static get styles() {
|
||||
return [
|
||||
...super.styles,
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
`
|
||||
];
|
||||
}
|
||||
|
||||
renderNodeContent() {
|
||||
return html`
|
||||
<select @change="${this._handleOperationChange}">
|
||||
<option value="add">Add</option>
|
||||
<option value="subtract">Subtract</option>
|
||||
</select>
|
||||
`;
|
||||
}
|
||||
|
||||
static get properties() {
|
||||
return { };
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.flowNodeType = 'MathNode';
|
||||
this.inputs = [
|
||||
{ name: 'value1' },
|
||||
{ name: 'value2' }
|
||||
];
|
||||
this.outputs = [
|
||||
{ name: 'result' }
|
||||
];
|
||||
this.data = {
|
||||
operation: 'add'
|
||||
};
|
||||
}
|
||||
|
||||
_handleOperationChange(e) {
|
||||
this.data.operation = e.target.value;
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('demo-node', DemoNode);
|
||||
Reference in New Issue
Block a user