Binds element's properties to state changes from the Redux store.

@example
const update = bind(el, props) // set bindings
update(state) // manual update

@private
@param {HTMLElement} element
@param {Object} properties
@return {Function} Update function.
163105
function bind(element, properties) {
    var bindings = Object.keys(properties).filter(function (name) {
      var property = properties[name];
      if (Object.prototype.hasOwnProperty.call(property, 'statePath')) {
        if (!property.readOnly && property.notify) {
          console.warn('PolymerRedux: <' + element.constructor.is + '>.' + name + ' has "notify" enabled, two-way bindings goes against Redux\'s paradigm');
        }
        return true;
      }
      return false;
    });

    /**
     * Updates an element's properties with the given state.
     *
     * @private
     * @param {Object} state
     */
    var update = function update(state) {
      var propertiesChanged = false;
      bindings.forEach(function (name) {
        // Perhaps .reduce() to a boolean?
        var statePath = properties[name].statePath;

        var value = typeof statePath === 'function' ? statePath.call(element, state) : (0, _path.get)(state, statePath);

        var changed = element._setPendingPropertyOrPath(name, value, true);
        propertiesChanged = propertiesChanged || changed;
      });
      if (propertiesChanged) {
        element._invalidateProperties();
      }
    };

    // Redux listener
    var unsubscribe = store.subscribe(function () {
      var detail = store.getState();
      update(detail);

      element.dispatchEvent(new window.CustomEvent('state-changed', { detail: detail }));
    });

    subscribers.set(element, unsubscribe);

    return update(store.getState());
  }
690027
function(element, options)
    {
        // Make sure the transform property is an object
        if(typeof element.transform != "object")
        {
            element.transform = {};
        }

        // If we have an object of options
        if(typeof options[0] == "object")
        {
            // Loop through object properties and save their values
            var keys = Object.keys(options[0]);

            keys.forEach(function(property)
            {
                element.transform[property] = options[0][property];
            });
        }
        
        // Otherwise, loop through all of the options to find values
        else
        {
            var property = options[0];
            var args = [];

            for(var i = 1, l = options.length; i < l; i++)
            {
                args.push(options[i]);
            }

            element.transform[property] = args;
        }
    }
893430
private static Object saveBindings(FacesContext context,
                                       Map<String, ValueExpression> bindings) {

        // Note: This code is copied from UIComponentBase.  In a future
        // version of the JSF spec, it would be useful to define a
        // attribute/property/bindings/state helper object that can be
        // shared across components/behaviors/validaters/converters.
        
        if (bindings == null) {
            return (null);
        }

        Object values[] = new Object[2];
        values[0] = bindings.keySet().toArray(new String[bindings.size()]);

        Object[] bindingValues = bindings.values().toArray();
        for (int i = 0; i < bindingValues.length; i++) {
            bindingValues[i] = UIComponentBase.saveAttachedState(context, bindingValues[i]);
        }

        values[1] = bindingValues;

        return (values);
    }
335162
function(obj_binding_setter) {
		return function(elements) {
			var vals,
				args = slice.call(arguments, 1);
			if(args.length === 0) { // need at least one argument
				return;
			} else if(args.length === 1) { // an object with keys and values was passed in
				vals = args[0];
			} else if(args.length > 1) { // the first argument was the key, the second was a value
				vals = {};
				vals[args[0]] = args[1];
			}

			var binding = new Binding({
				targets: elements,
				setter: function(element, value) {
					each(value, function(v, k) {
						obj_binding_setter(element, k, v);
					});
				},
				getter: function() {
					if(is_map(vals)) {
						return vals.toObject();
					} else {
						var rv = {};
						each(vals, function(v, k) {
							rv[k] = cjs.get(v);
						});
						return rv;
					}
				}
			});

			return binding;
		};
	}
740187
function(type, key, ref, owner, context, props) {
  // Built-in properties that belong on the element
  this.type = type;
  this.key = key;
  this.ref = ref;

  // Record the component responsible for creating this element.
  this._owner = owner;

  // TODO: Deprecate withContext, and then the context becomes accessible
  // through the owner.
  this._context = context;

  if ("production" !== process.env.NODE_ENV) {
    // The validation flag and props are currently mutative. We put them on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    this._store = {props: props, originalProps: assign({}, props)};

    // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.
    try {
      Object.defineProperty(this._store, 'validated', {
        configurable: false,
        enumerable: false,
        writable: true
      });
    } catch (x) {
    }
    this._store.validated = false;

    // We're not allowed to set props directly on the object so we early
    // return and rely on the prototype membrane to forward to the backing
    // store.
    if (useMutationMembrane) {
      Object.freeze(this);
      return;
    }
  }

  this.props = props;
}
786729
public void addBoth(BindingElement element) {
		if (element != null) {
			this.rtBindingElements.add(element);
			this.uiBindingElements.add(element);
		}
	}
588871
function Element(doc, name, content) {
    if (!doc) {
        throw new Error('document argument required');
    } else if (! (doc instanceof bindings.Document)) {
        throw new Error('document argument must be an ' +
                        'instance of Document');
    } else if (!name) {
        throw new Error('name argument required');
    }

    return new bindings.Element(doc, name, content);
}
570032
function bindableProperty(target, key) {
    // property value
    var _val = this[key];
    var keyName = "_" + key;
    this[keyName] = _val;
    // property getter
    var getter = function () {
        // console.log(`Get: ${key} => ${_val}`);
        return this[keyName];
    };
    // property setter
    var setter = function (newVal) {
        // console.log(`Set: ${key} => ${newVal}`);
        // debugger;
        var oldValue = this[keyName];
        // tslint:disable-next-line:triple-equals
        if (oldValue == newVal) {
            return;
        }
        this[keyName] = newVal;
        var c = this._$_supressRefresh;
        if (!(c && c[key])) {
            Atom.refresh(this, key);
        }
        if (this.onPropertyChanged) {
            this.onPropertyChanged(key);
        }
    };
    // delete property
    if (delete this[key]) {
        // create new property with getter and setter
        Object.defineProperty(target, key, {
            get: getter,
            set: setter,
            enumerable: true,
            configurable: true
        });
        // tslint:disable-next-line:no-string-literal
        if (target.constructor.prototype["get_atomParent"]) {
            target["get_" + key] = getter;
            target["set_" + key] = setter;
        }
    }
}
470381
protected void bind(Element element, CmsDomUtil.Style... attributes) {

        if (m_elem == null) {
            // create playground
            m_elem = DOM.createDiv();
            Style style = m_elem.getStyle();
            style.setVisibility(Style.Visibility.HIDDEN);
            style.setPosition(Style.Position.ABSOLUTE);
            style.setLeft(-5000, Style.Unit.PX);
            style.setTop(-5000, Style.Unit.PX);
        }
        // copy all relevant CSS properties
        Style style = m_elem.getStyle();
        for (CmsDomUtil.Style attr : attributes) {
            String attrName = attr.toString();
            style.setProperty(attrName, CmsDomUtil.getCurrentStyle(element, attr));
        }
        // append playground
        RootPanel.getBodyElement().appendChild(m_elem);
    }
342743
public void bind(final StringProperty property, String key) {
		String value = prefs.get(validateKey(key), null);
		if (value != null) {
			property.set(value);
		}
		property.addListener(o -> prefs.put(key, property.getValue()));
	}
242592
protected void parseProperties(Element element, Map<String, String> properties) {

    for (Element childElement : element.elements()) {
      if(PROPERTY.equals(childElement.getTagName())) {
        String resolved = PropertyHelper.resolveProperty(System.getProperties(), childElement.getText());
        properties.put(childElement.attribute(NAME), resolved);
      }
    }

  }
280879
function(index, item)
	{
		var length = this.length;
		
		var replaced = this.source[index];
		this.__updateBindings(replaced, false);
		
		this.source[index] = item;
		this.__updateBindings(item);
		
		if (this.length > length)
		{
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ADD));
			this.dispatchChange('length');
		}
		
		this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.CHANGE, {item:item}));
		
		return replaced;
	}
30796
function(element, property, value, unit){
		element.setStyle(property, this.serve(value, unit));
	}
861336
function init( element, value, bindings ) {
    var $el = $( element );
    var model = value();
    var allBindings = unwrap( bindings() );
    var options = ko.toJS( allBindings.froalaOptions );

    // initialize the editor
    $el.froalaEditor( options || {} );

    // provide froala editor instance for flexibility
    if( allBindings.froalaInstance && ko.isWriteableObservable( allBindings.froalaInstance ) ) {
      allBindings.froalaInstance( $el.data( 'froala.editor' ) );
    }

    // update underlying model whenever editor content changed
    var processUpdateEvent = function (e, editor) {
        if (ko.isWriteableObservable(model)) {
            var editorValue = editor.html.get();
            var current = model();
            if (current !== editorValue) {
                model(editorValue);
            }
        }
    }

    $el.on('froalaEditor.contentChanged', processUpdateEvent);
    $el.on('froalaEditor.paste.after', processUpdateEvent);

    // cleanup editor, when dom node is removed
    ko.utils.domNodeDisposal.addDisposeCallback( element, destroy( element ) );

    // do not handle child nodes
    return { controlsDescendantBindings: true };
  }
1280876
function bind()
        {
          bind.injectPrototypes(Node,'Node');
          bind.injectPrototypes(Element,'Element');
          bind.injectPrototypes(HTMLElement,'HTMLElement');
          bind.injectPrototypes(HTMLInputElement,'HTMLInputElement');
          bind.injectPrototypes(HTMLTextAreaElement,'HTMLTextAreaElement');
          bind.injectPrototypes(Document,'Document');

          var __set = _set,
              __update = _update;

          function hasInput(attrListeners)
          {
            var attrs = ['value','checked'],
                _localListeners = attrListeners,
                _localAttr = _localListeners._attrListeners,
                _localUpdateAttr = _localListeners._attrUpdateListeners,
                _localParentAttr = _localListeners._parentAttrListeners,
                _localParentUpdateAttr = _localListeners._parentAttrUpdateListeners,
                has = false;

            if(_attrListeners[_all] !== undefined || _attrUpdateListeners[_all] !== undefined)
            {
              has = true;
            }
            if(has !== true && _localAttr[_all] !== undefined ||
               _localUpdateAttr[_all] !== undefined ||
               _localParentAttr[_all] !== undefined ||
               _localParentUpdateAttr[_all] !== undefined)
            {
              has = true;
            }
            if(has !== true)
            {
              for(var x=0;x<attrs.length;x++)
              {
                if(_attrListeners[attrs[x]] !== undefined ||
                   _attrUpdateListeners[attrs[x]] !== undefined ||
                   _localAttr[attrs[x]] !== undefined ||
                   _localUpdateAttr[attrs[x]] !== undefined ||
                   _localParentAttr[attrs[x]] !== undefined ||
                   _localParentUpdateAttr[attrs[x]] !== undefined)
                  {
                    has = true;
                    break;
                  }
              }
            }
            return has;
          }

          function getStyles(arr,styles)
          {
            var x,
                _arr = arr,
                _styles = styles,
                len = styles.length;
            for(x=0;x<len;x++)
            {
              if(_arr.indexOf(_styles[x]) === -1)
              {
                _arr.push(_styles[x]);
              }
            }
            return _arr;
          }

          function hasStyle(attrListeners)
          {
            var _globalStyle = Object.keys(_styleListeners),
                _globalStyleUpdate = Object.keys(_styleUpdateListeners),
                _localListeners = attrListeners,
                _localStyle = Object.keys(_localListeners._styleListeners),
                _localUpdateStyle = Object.keys(_localListeners._styleUpdateListeners),
                _localParentStyle = Object.keys(_localListeners._parentStyleListeners),
                _localParentUpdateStyle = Object.keys(_localListeners._parentStyleUpdateListeners),
                has = [];

            if(_globalStyle.length !== 0 ||
               _globalStyleUpdate.length !== 0)
            {
              has = getStyles(has,_globalStyle);
              has = getStyles(has,_globalStyleUpdate);
            }
            if(has.length !== 0 && _localParentStyle.length !== 0 ||
               _localParentUpdateStyle.length !== 0)
            {
              has = getStyles(has,_localParentStyle);
              has = getStyles(has,_localParentUpdateStyle);
            }
            if(has.indexOf(_all) !== -1) has = _allStyles;
            return has;
          }

          function copyListeners(listeners,copyTo)
          {
            var listenerProps = Object.keys(listeners),
                _currProp,
                _currListener;
            for(var x=0,len=listenerProps.length;x<len;x++)
            {
              _currProp = listenerProps[x];
              if(copyTo[_currProp] === undefined)
              {
                copyTo[_currProp] = listeners[_currProp].slice();
              }
              else
              {
                for(var i=0,lenI=listeners[_currProp].length;i<lenI;i++)
                {
                  _currListener = listeners[_currProp][i];
                  copyTo[_currProp].push(_currListener);
                }
              }
            }
          }

          function reSync(e)
          {
            if(e.target.nodeType !== 3 && e.target.nodeType !== 8)
            {
              var attrListeners = e.target.attrListeners(),
                  _hasInput = hasInput(attrListeners),
                  _hasStyle = hasStyle(attrListeners),
                  _hasStyleLen = _hasStyle.length,
                  _parentAttr,
                  _parentAttrUpdate,
                  _parentStyle,
                  _parentStyleUpdate,
                  _listeners,
                  nodes = [],
                  len,
                  outer = ((e.attr === 'outerHTML' || e.attr === 'outerText') ? e.attr : undefined),
                  target = e.target

              if(outer !== undefined)
              {
                e.attr = 'appendChild',
                e.arguments = [e.target];
                e.target = e.target.parentElement;
              }

              if(_hasInput)
              {
                if(e.attr === 'appendChild' && e.arguments[0].nodeType !== 3 && e.arguments[0].nodeType !== 8)
                {
                  nodes = Array.prototype.slice.call(e.arguments[0].querySelectorAll('input,textarea'));
                  if(e.arguments[0].tagName === 'INPUT' || e.arguments[0].tagName === 'TEXTAREA')
                  {
                    nodes.unshift(e.arguments[0])
                  }
                }
                else
                {
                  nodes = Array.prototype.slice.call(e.target.querySelectorAll('input,textarea'));
                }
                len = nodes.length;
                for(var x=0;x<len;x++)
                {
                  if(nodes[x].addInputBinding !== undefined) nodes[x].addInputBinding();
                  if(nodes[x].addInputBoxBinding !== undefined) nodes[x].addInputBoxBinding();
                }
              }

              if(e.attr === 'appendChild' && e.arguments[0].nodeName !== '#text' && e.arguments[0].nodeName !== '#comment')
              {
                nodes = Array.prototype.slice.call(e.arguments[0].querySelectorAll('*'));
                nodes.unshift(e.arguments[0]);
                _parentAttr = e.target.__kb._parentAttrListeners;
                _parentAttrUpdate = e.target.__kb._parentAttrUpdateListeners;
                _parentStyle = e.target.__kb._parentStyleListeners;
                _parentStyleUpdate = e.target.__kb._parentStyleUpdateListeners;
              }
              else
              {
                nodes = Array.prototype.slice.call(e.target.querySelectorAll('*'));
                _parentAttr = e.target.__kb._parentAttrListeners;
                _parentAttrUpdate = e.target.__kb._parentAttrUpdateListeners;
                _parentStyle = e.target.__kb._parentStyleListeners;
                _parentStyleUpdate = e.target.__kb._parentStyleUpdateListeners;
              }
              len = nodes.length;

                for(var x=0;x<len;x++)
                {
                  if(_hasStyleLen !== 0)
                  {
                    for(var i=0;i<_hasStyleLen;i++)
                    {
                      bind.injectStyleProperty(nodes[x],_hasStyle[i]);
                    }
                  }
                  _listeners = nodes[x].attrListeners();

                  copyListeners(_parentAttr,_listeners._parentAttrListeners);
                  copyListeners(_parentAttrUpdate,_listeners._parentAttrUpdateListeners);
                  copyListeners(_parentStyle,_listeners._parentStyleListeners);
                  copyListeners(_parentStyleUpdate,_listeners._parentStyleUpdateListeners);
                }

              if(outer !== undefined)
              {
                e.attr = outer;
                e.target = target;
                e.arguments = [];
              }
            }
          }

          function checkAttr(e)
          {
            var oldAttr = e.target.attributes[e.arguments[0]],
                old = (oldAttr !== undefined ? oldAttr.value : ""),
                val = (e.attr === 'setAttribute' ? e.arguments[1] : "");
              if(!__set(e.target,e.arguments[0],val,old,[val])){
                e.preventDefault();
              }
          }

          function checkAttrUpdate(e)
          {
            var oldAttr = e.target.attributes[e.arguments[0]],
                old = (oldAttr !== undefined ? oldAttr.value : ""),
                val = (e.attr === 'setAttribute' ? e.arguments[1] : "");
                __update(e.target,e.arguments[0],val,old,[val]);
          }

          //for keeping binds with inputs
          bind.addAttrUpdateListener('appendChild',reSync);
          bind.addAttrUpdateListener('removeChild',reSync);
          bind.addAttrUpdateListener('innerHTML',reSync);
          bind.addAttrUpdateListener('outerHTML',reSync);
          bind.addAttrUpdateListener('innerText',reSync);
          bind.addAttrUpdateListener('outerText',reSync);
          bind.addAttrUpdateListener('textContent',reSync);

          //allows for html attribute changes to be listened to just like properties
          bind.addAttrListener('setAttribute',checkAttr);
          bind.addAttrListener('removeAttribute',checkAttr);

          bind.addAttrUpdateListener('setAttribute',checkAttrUpdate);
          bind.addAttrUpdateListener('removeAttribute',checkAttrUpdate);

          return bind;
        }
755315
public Binding toBinding(BindingElement element) {
		final TypeReference typeReference = typeRef(element.getBind());
		final String annotatedWith = element.getAnnotatedWith();
		final String annotatedWithName = element.getAnnotatedWithName();
		if (!Strings.isEmpty(annotatedWith)) {
			final TypeReference annotationType = typeRef(annotatedWith);
			if (element.isInstance()) {
				return bindAnnotatedWithToInstance(typeReference, annotationType, element.getTo(),
						element.getFunctionName());
			}
			final TypeReference typeReference2 = typeRef(element.getTo());
			return bindAnnotatedWith(typeReference, annotationType, typeReference2,
						element.getFunctionName());
		}
		if (!Strings.isEmpty(annotatedWithName)) {
			if (element.isInstance()) {
				return bindAnnotatedWithNameToInstance(typeReference, annotatedWithName,
						element.getTo(),
						element.getFunctionName());
			}
			final TypeReference typeReference2 = typeRef(element.getTo());
			return bindAnnotatedWithName(typeReference, annotatedWithName, typeReference2,
						element.getFunctionName());
		}
		if (element.isInstance()) {
			return bindToInstance(typeReference,
					element.getFunctionName(),
					element.getTo(),
					element.isSingleton(),
					element.isEager());
		}
		final TypeReference typeReference2 = typeRef(element.getTo());
		return bindToType(
					typeReference,
					element.getFunctionName(),
					typeReference2,
					element.isSingleton(),
					element.isEager(),
					element.isProvider());
	}
1354881
function bind(elements) {
      for (var i = 0; i < elements.length; i++) {
        Binder.on('click', elements[i], this.click);
        Binder.on('touchstart', elements[i], this.click, capture);
      }
    }