FloatEditor.js 485 B

123456789101112131415161718192021222324
  1. import { ObjectNode, NumberInput, LabelElement } from '../../libs/flow.module.js';
  2. import { FloatNode } from '../../renderers/nodes/Nodes.js';
  3. export class FloatEditor extends ObjectNode {
  4. constructor() {
  5. const node = new FloatNode();
  6. super( 'Float', 1, node, 250 );
  7. this.title.setIcon( 'ti ti-box-multiple-1' );
  8. const field = new NumberInput().onChange( () => {
  9. node.value = field.getValue();
  10. } );
  11. this.add( new LabelElement( 'Value' ).add( field ) );
  12. }
  13. }