export function createNodeWithDropdown()

in integ/utils.ts [64:89]


export function createNodeWithDropdown(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 select = document.createElement('select');
  const option = document.createElement('option');
  const optionValue = document.createTextNode('test');
  option.appendChild(optionValue);
  select.appendChild(option);
  select.setAttribute('type', 'text');
  select.setAttribute('data-event-target', 'true');
  newDiv.appendChild(select);
  newDiv.classList.add('rectangle', 'example-node');
  if (node.diagramMakerData.selected) {
    newDiv.classList.add('selected');
  }
  container.appendChild(newDiv);
  return newDiv;
}