This commit is contained in:
2024-12-18 21:27:29 +01:00
parent 01bcdffaf8
commit 80f69bf09c
8 changed files with 592 additions and 40 deletions

56
demo-node.js Normal file
View 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);