How to use inferno-extras - 10 common examples

To help you get started, we’ve selected a few inferno-extras 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 jhsware / inferno-formlib / src / widgets / AutoComplete.js View on Github external
didSelect (value) {
      const field = this.props.adapter.context
      this.setState({
          options: [],
          isOpen: false,
          markAtIndex: undefined
      })
      this.props.onChange(this.props.propName, field.fromString(value))
      
      // Blur focus to emphasize that selection has been done
      findDOMNode(this._inputNode).blur()
    }
github jhsware / inferno-formlib / src / widgets / ListField.js View on Github external
componentDidMount () {
    let domEl = findDOMNode(this)
    domEl.addEventListener('dragstart', this.handleDragStart, false)
    domEl.addEventListener('dragover', this.handleDragOver, false)
    domEl.addEventListener('dragenter', this.handleDragEnter, false)
    domEl.addEventListener('dragleave', this.handleDragLeave, false)
    domEl.addEventListener('dragend', this.handleDragEnd, false)
    domEl.addEventListener('drop', this.handleDrop, false)
    this.listenersAdded = true

    // Because this is a container we set isMounted here instead of getting it from parent
    this.isMounted = true
  }
github jhsware / inferno-bootstrap / src / TabContent.js View on Github external
function animateCrossFadeIn(component, currSize, animationName, callback) {
  const domEl = findDOMNode(component)

  const height = domEl.offsetHeight + 'px'
  const width = domEl.offsetWidth + 'px'

  domEl.style.height = currSize.height
  domEl.style.width = currSize.width

  domEl.classList.add(animationName + '-enter')
  // Trigger reflow
  const tmp = domEl.offsetHeight
  
  
  // 2. Set an animation listener, code at end
  var done = false
  var nrofTransitionsLeft
  const onTransitionEnd = (event) => {
github infernojs / inferno / packages / inferno-extras / __tests__ / extras.spec.jsx View on Github external
it('Should return true if that is the ndoe', () => {
      const vNode = <div>Ok</div>;

      render(
        <div>
          <span>Test</span>
          {vNode}
        </div>,
        container
      );

      expect(isDOMinsideVNode(container.querySelector('#target'), vNode)).toBe(true);
    });
  });
github infernojs / inferno / packages / inferno-extras / __tests__ / extras.spec.jsx View on Github external
}

        render() {
          return (
            <div>
              <span>
            </span></div>
          );
        }
      }

      render(, container);

      const target = container.querySelector('#target');

      expect(isDOMinsideComponent(target, instance)).toBe(true);
    });
github infernojs / inferno / packages / inferno-extras / __tests__ / extras.spec.jsx View on Github external
expect(isDOMinsideComponent(target, instances[0])).toBe(false);
      expect(isDOMinsideComponent(target, instances[1])).toBe(true);
      expect(isDOMinsideComponent(target, instances[2])).toBe(false);

      render(
        <div>
          
          
          
        </div>,
        container
      );

      expect(isDOMinsideComponent(target, instances[0])).toBe(false);
      expect(isDOMinsideComponent(target, instances[1])).toBe(false);
      expect(isDOMinsideComponent(target, instances[2])).toBe(false);
    });
  });
github jhsware / inferno-bootstrap / src / Dropdown.js View on Github external
getContainer() {
    return findDOMNode(this);
  }
github jhsware / inferno-animation / src / CrossFade.js View on Github external
componentWillUnmount () {
    const node = findDOMNode(this)
    this.props.onLeave(node)
    setTimeout(() => animateOnRemove(node, this.props.prefix))
  }
github jhsware / inferno-animation / src / CrossFade.js View on Github external
_animationCheck () {
    if (this.state.active && this.targetSize && this.sourceSize && findDOMNode(this)) {
      animateSizeChange(findDOMNode(this), this.props.prefix, this.sourceSize, this.targetSize)
      this.targetSize = this.sourceSize = undefined
    }
  }
github jhsware / inferno-bootstrap / src / TabContent.js View on Github external
function getContentSize() {
  const domEl = findDOMNode(this)
  return {
    width: domEl.offsetWidth + 'px',
    height: domEl.offsetHeight + 'px'
  }
}

inferno-extras

Collection of utilities for InfernoJS

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis