szn-options.js
function addMissingItems(groupUi, options) {
    let nextItemUi = groupUi.firstElementChild
    let nextOption = options.firstElementChild
    while (nextOption) {
      if (!nextItemUi || nextItemUi._option !== nextOption) {
        const newItemUi = document.createElement('szn-')
        newItemUi._option = nextOption
        newItemUi.setAttribute('data-szn-options--' + (nextOption.tagName === 'OPTGROUP' ? 'optgroup' : 'option'), '')
        updateItem(newItemUi)
        groupUi.insertBefore(newItemUi, nextItemUi)
      } else {
        nextItemUi = nextItemUi && nextItemUi.nextElementSibling
      }

      nextOption = nextOption.nextElementSibling
    }
  }
function addMissingItems(groupUi, options) {
    let nextItemUi = groupUi.firstElementChild
    let nextOption = options.firstElementChild
    while (nextOption) {
      if (!nextItemUi || nextItemUi._option !== nextOption) {
        const newItemUi = document.createElement('szn-')
        newItemUi._option = nextOption
        newItemUi.setAttribute('data-szn-options--' + (nextOption.tagName === 'OPTGROUP' ? 'optgroup' : 'option'), '')
        updateItem(newItemUi)
        groupUi.insertBefore(newItemUi, nextItemUi)
      } else {
        nextItemUi = nextItemUi && nextItemUi.nextElementSibling
      }

      nextOption = nextOption.nextElementSibling
    }
  }
function addMissingItems ( groupUi , options ) { let nextItemUi = groupUi . firstElementChild let nextOption = options . firstElementChild while ( nextOption ) { if ( ! nextItemUi || nextItemUi . _option !== nextOption ) { const newItemUi = document . createElement ( 'szn-' ) newItemUi . _option = nextOption newItemUi . setAttribute ( 'data-szn-options--' + ( nextOption . tagName === 'OPTGROUP' ? 'optgroup' : 'option' ) , '' ) updateItem ( newItemUi ) groupUi . insertBefore ( newItemUi , nextItemUi ) } else { nextItemUi = nextItemUi && nextItemUi . nextElementSibling } nextOption = nextOption . nextElementSibling } }
Adds the options present in the options container missing the UI into the UI, while preserving the order of the
options. Option groups are added recursively.

@param {Element} groupUi The element containing the UIs of the options. The new options will be inserted into this
element's children.
@param {HTMLElement} options An element containing the <code>option</code> and <code>optgroup</code> elements that
the UI reflects.
Adds the options present in the options container missing the UI into the UI while preserving the order of the options . Option groups are added recursively .