How to use the incremental-dom.elementOpenStart function in incremental-dom

To help you get started, we’ve selected a few incremental-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-organic / organic-oval / lib / incremental-create-element.js View on Github external
return function () {
      var createdElement
      if (tagName !== 'virtual' || originalTagName) {
        // console.log('element open ->', tagName, parsedAttrs.key)
        var TagClass = oval.getRegisteredTag(originalTagName || tagName)
        if (!TagClass) {
          IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key, parsedAttrs.staticAttrs)
          for (var key in parsedAttrs.attrs) {
            IncrementalDOM.attr(key, parsedAttrs.attrs[key])
          }
        } else {
          IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key)
        }
        createdElement = IncrementalDOM.elementOpenEnd()
        if (parsedAttrs.attrs['ref']) {
          tag.refs[parsedAttrs.attrs['ref']] = createdElement
        }
        if (parsedAttrs.attrs['freeze']) {
          IncrementalDOM.skip()
        }
        if (createdElement.tag) {
          if (!createdElement.tag.shouldRender) {
            IncrementalDOM.skip()
          } else {
            createdElement.tag.update(children, parsedAttrs.props, parsedAttrs.attrs)
          }
          IncrementalDOM.elementClose(tagName)
          tag.childTags.push(createdElement.tag)
github node-organic / organic-oval / lib / incremental-create-element.js View on Github external
return function () {
      var createdElement
      if (tagName !== 'virtual' || originalTagName) {
        // console.log('element open ->', tagName, parsedAttrs.key)
        var TagClass = oval.getRegisteredTag(originalTagName || tagName)
        if (!TagClass) {
          IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key, parsedAttrs.staticAttrs)
          for (var key in parsedAttrs.attrs) {
            IncrementalDOM.attr(key, parsedAttrs.attrs[key])
          }
        } else {
          IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key)
        }
        createdElement = IncrementalDOM.elementOpenEnd()
        if (parsedAttrs.attrs['ref']) {
          tag.refs[parsedAttrs.attrs['ref']] = createdElement
        }
        if (parsedAttrs.attrs['freeze']) {
          IncrementalDOM.skip()
        }
        if (createdElement.tag) {
          if (!createdElement.tag.shouldRender) {
            IncrementalDOM.skip()
github node-organic / organic-oval / engines / incremental-dom.js View on Github external
let slot = component.kids[props.name]
        tagName = slot.tagName
        props = slot.props
        kids = slot.kids
      }
      if (props.slot) {
        let cleanprops = {...props}
        delete cleanprops.slot
        IncrementalDOM.currentComponent.kids[props.slot] = {
          props: cleanprops,
          kids: kids,
          tagName: tagName
        }
        return
      }
      IncrementalDOM.elementOpenStart(tagName.toLowerCase(), parsedAttrs.oid)
      for (let key in parsedAttrs.attrs) {
        IncrementalDOM.attr(key, parsedAttrs.attrs[key])
      }
      if (!components[tagName]) {
        for (let key in parsedAttrs.props) {
          IncrementalDOM.attr(key, parsedAttrs.props[key])
        }
        for (let key in parsedAttrs.handlers) {
          IncrementalDOM.attr('on' + key, parsedAttrs.handlers[key])
        }
      }
      let createdElement = IncrementalDOM.elementOpenEnd()
      if (parsedAttrs.attrs['freeze']) {
        IncrementalDOM.skip()
      }
      if (components[tagName]) {