export function createNodeWithInput()

in integ/utils.ts [40:62]


export function createNodeWithInput(node: DiagramMakerNode<any>, container: HTMLElement) {
  if (container.innerHTML !== '') {
    const childDiv = container.children[0];
    if (node.diagramMakerData.selected) {
      childDiv.classList.add('selected');
    } else {
      childDiv.classList.remove('selected');
    }
    return;
  }
  const newDiv = document.createElement('div');
  const input = document.createElement('input');
  input.setAttribute('type', 'text');
  input.setAttribute('data-event-target', 'true');
  input.setAttribute('data-draggable', 'true');
  newDiv.appendChild(input);
  newDiv.classList.add('rectangle', 'example-node');
  if (node.diagramMakerData.selected) {
    newDiv.classList.add('selected');
  }
  container.appendChild(newDiv);
  return newDiv;
}