根据类型获取控件
@param {String} type
@param {object} element
763805
function getCompsByType(type, element) {
    var comps = this.getComps(element),
        targetComps = [];
    for (var i = 0; i < comps.length; i++) {
        var comp = comps[i];
        if (comp && comp.type == type) targetComps.push(comp);
    }
    return targetComps;
}
662092
function(parent, type){                                
        var element = qq.getByClass(parent, this._options.classes[type])[0];        
        if (!element){
            throw new Error('element not found ' + type);
        }
        
        return element;
    }
1081863
function findNext(type, element) {
  let tries = 5
  let next = element

  do {
    if (next.is(type)) {
      return next
    }

    next = next.next()
  }
  while (--tries)

  return next
}
891435
function (element, candidates, opts) {
    var typeAhead = this;
    opts = opts || {};

    typeAhead.element = element;

    typeAhead.candidates = candidates || [];

    typeAhead.list = new TypeAheadList(typeAhead);

    this.minLength = opts.hasOwnProperty('minLength') ? opts.minLength : 3;

    typeAhead.limit = opts.hasOwnProperty('limit') ? opts.limit : 5;

    typeAhead.onMouseDown = opts.hasOwnProperty('onMouseDown') ? opts.onMouseDown : function(){};

    typeAhead.onKeyDown = opts.hasOwnProperty('onKeyDown') ? opts.onKeyDown : function(){};

    typeAhead.fulltext = opts.hasOwnProperty('fulltext') ? opts.fulltext : false;

    typeAhead.scrollable = opts.hasOwnProperty('scrollable') ? opts.scrollable : false;

    typeAhead.callback = opts.hasOwnProperty('callback') ? opts.callback : function(){};

    typeAhead.query = '';

    typeAhead.selected = null;

    typeAhead.list.draw();

    typeAhead.element.addEventListener('keyup', function (event) {
        typeAhead.handleKeyUp.call(typeAhead, event.keyCode);
    }, false);

    typeAhead.element.addEventListener('keydown', function (event) {
        typeAhead.handleKeyDown.call(typeAhead, event.keyCode) && event.preventDefault();
    });

    typeAhead.element.addEventListener('focus', function () {
        typeAhead.handleFocus.call(typeAhead);
    });

    typeAhead.element.addEventListener('blur', function () {
        typeAhead.handleBlur.call(typeAhead);
    });

    typeAhead.update = function(candidates){
      this.candidates = candidates;
      typeAhead.handleKeyUp.call(typeAhead);
    }

    return typeAhead;
}
989770
function (type) {
      var that = this,
        texts = [],
        labels = [],
        values = [];
      this.$drop.find(sprintf('input[%s]:checked', this.selectItemName)).each(function () {
        texts.push($(this).parents('li').first().text());
        labels.push($(this).parents('li').attr('label') || '');
        values.push($(this).val());
      });

      if (type === 'text' && this.$selectGroups.length) {
        texts = [];
        this.$selectGroups.each(function () {
          var html = [],
            text = $.trim($(this).parent().text()),
            group = $(this).parent().data('group'),
            $children = that.$drop.find(sprintf('[%s][data-group="%s"]', that.selectItemName, group)),
            $selected = $children.filter(':checked');

          if (!$selected.length) {
            return;
          }

          html.push('[');
          html.push(text);
          if ($children.length > $selected.length) {
            var list = [];
            $selected.each(function () {
              list.push($(this).parent().text());
            });
            html.push(': ' + list.join(', '));
          }
          html.push(']');
          texts.push(html.join(''));
        });
      } else if (type === 'label' && this.$selectGroups.length) {
        labels = [];
        this.$selectGroups.each(function () {
          var html = [],
            label = $.trim($(this).attr('label') || ''),
            group = $(this).parent().data('group'),
            $children = that.$drop.find(sprintf('[%s][data-group="%s"]', that.selectItemName, group)),
            $selected = $children.filter(':checked');

          if (!$selected.length) {
            return;
          }

          html.push('[');
          html.push(label);
          if ($children.length > $selected.length) {
            var list = [];
            $selected.each(function () {
              list.push($(this).attr('label') || '');
            });
            html.push(': ' + list.join(', '));
          }
          html.push(']');
          labels.push(html.join(''));
        });
      }

      switch (type) {
        case 'text':
          return texts;
        case 'label':
          return labels;
        default:
          return values;
      }
    }
858644
function(elements, types, fn) {
    //if (!elements || !types || !fn || typeof types != "string")
    //  return;
    
    //var  elements = (!elation.utils.isNull(elements.nodeName) || elements == window) ? [ elements ] : elements;
    if (!elation.utils.isArray(elements)) {
      elements = [elements];
    }
    var types = types.split(',');
    
    for (var e=0; e<elements.length; e++) {
      var element = elements[e];
      
      if (typeof element != 'object')
        continue;
      
      for (var i=0; i<types.length; i++) {
        var type = types[i];
        
        elation.events._unregister(element, type, fn);

        if (element) {
          if (element.removeEventListener) {
            if (typeof fn == "object" && fn.handleEvent) {
              element.removeEventListener(type, element[type+fn], false);
              delete element[type + fn];
            } else {
              element.removeEventListener(type, fn, false);
            }
          } else if (element.detachEvent) {
            if (typeof element[type + fn] == "function")
              element.detachEvent("on" + type, element[type + fn]);
            
            element[type + fn] = null;
            element["e" + type + fn] = null;
          }
        }
      }
    }
    
    return this;
  }
205505
function getNearestTypeElement(element) {
		var $element = $(element),
			found = $element.is('[data-type]');

		while (!found && $element.length && !$element.is(MODULE_SELECTOR)) {
			$element = $element.parent();
			found = $element.is('[data-type]');
		}

		return found ? $element[0] : null;
	}
851309
function(elements, types, fn, options) {
    if (!types || !fn || typeof types != "string")
      return;

    var elements = elation.utils.isNull(elements) 
          ? [null] 
          : !elation.utils.isArray(elements) || elements == window
            ? [ elements ] 
            : elements,
        types = types.split(',');
    
    if (typeof fn == "string") {
      fn = (function(func) { return function(ev) { eval(func); }; })(fn);
    }

    for (var e=0; e<elements.length; e++) {
      var element = elements[e];
      
      if (typeof element != 'object')
        continue;
      
      for (var i=0; i<types.length; i++) {
        var type = types[i];
        
        elation.events._register(element, type, fn);
        
        if (!element)
          continue;

        if (type.toLowerCase() == 'transitionend') {
          if ('onwebkittransitionend' in window) type = 'webkitTransitionEnd';
          else if ('onotransitionend' in element || navigator.appName == 'Opera') type = 'oTransitionEnd';
        }
        
        if ("addEventListener" in element) {
          //if (type == 'mousewheel' && elation.browser.type != 'safari')
          //  type = 'DOMMouseScroll';
          if (typeof fn == "object" && fn.handleEvent) {
            element[type+fn] = function(e) { 
              fn.handleEvent(e); 
            }
            element.addEventListener(type, element[(type + fn)], options);
          } else {
            element.addEventListener(type, fn, options);
          }
        } else if (element.attachEvent) {
          if (typeof fn == "object" && fn.handleEvent) { 
            element[type+fn] = function() { 
              fn.handleEvent(elation.events.fix(window.event)); 
            }
          } else {
            element["e" + type + fn] = fn;
            element[type + fn] = function() { 
              if (typeof element["e" + type + fn] == 'function') 
                element["e" + type + fn](elation.events.fix(window.event)); 
            }
          }
          
          element.attachEvent("on" + type, element[type + fn]);
        }
      }
    }
    
    return this;
  }
390174
function ( type, data ) {
            var el = this.element();
    
            if ( typeof type === 'string' ) {
                $B.event.trigger( el, type, data );
            }
        }
1169290
function (el, type) {
		while (el && el.nodeName.toLowerCase() !== type.toLowerCase()) {
			el = el.parentNode;
		}
		return el;
	}
1114330
function (element) {
            var self = this;
            var $el = self.$el;    // 隐藏当然不包含了
            // 隐藏当然不包含了
            if (!self.get('visible') || !$el) {
                return false;
            }
            if ($el && ($el[0] === element || $el.contains(element))) {
                return true;
            }
            var children = self.get('children');
            for (var i = 0, count = children.length; i < count; i++) {
                var child = children[i];
                if (child.containsElement && child.containsElement(element)) {
                    return true;
                }
            }
            return false;
        }
679066
function(type) {
			var result = [];
			var crawler = new gui.Crawler();
			if (type) {
				crawler.ascend(this.element, {
					handleSpirit: function(spirit) {
						if (spirit instanceof type) {
							result.push(spirit);
						}
					}
				});
			} else {
				crawler.ascend(this.element, {
					handleElement: function(el) {
						result.push(el);
					}
				});
			}
			return result;
		}
340098
@SuppressWarnings("unchecked")
    private Object parse(Element element) {
        List<Element> elements = element.elements();
        if (elements.size() == 0) {
            return element.getText();
        } else {
            Map<String, Object> map = new HashMap<>();
            for (Element ele : elements) {
                Object result = parse(ele);
                if (map.containsKey(ele.getName())) {
                    // 如果map中已经包含该key，说明该key有多个，是个list
                    Object obj = map.get(ele.getName());
                    List<String> list;
                    if (obj instanceof List) {
                        // 如果obj不等于null并且是list对象，说明map中存的已经是一个list
                        list = (List<String>) obj;
                    } else {
                        // 如果obj等于null或者不是list对象，那么新建一个list对象
                        list = new ArrayList<>();
                        list.add(obj == null ? null : String.valueOf(obj));
                    }
                    list.add(result == null ? null : String.valueOf(result));
                    map.put(ele.getName(), list);
                } else {
                    map.put(ele.getName(), result);
                }
            }
            return map;
        }
    }
880167
function( elem, types, handler, selector, mappedTypes ) {

		var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
			t, tns, type, origType, namespaces, origCount,
			j, events, special, handle, eventType, handleObj;

		if ( !elemData || !(events = elemData.events) ) {
			return;
		}

		// Once for each type.namespace in types; type may be omitted
		types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
		for ( t = 0; t < types.length; t++ ) {
			tns = rtypenamespace.exec( types[t] ) || [];
			type = origType = tns[1];
			namespaces = tns[2];

			// Unbind all events (on this namespace, if provided) for the element
			if ( !type ) {
				for ( type in events ) {
					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
				}
				continue;
			}

			special = jQuery.event.special[ type ] || {};
			type = ( selector? special.delegateType : special.bindType ) || type;
			eventType = events[ type ] || [];
			origCount = eventType.length;
			namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;

			// Remove matching events
			for ( j = 0; j < eventType.length; j++ ) {
				handleObj = eventType[ j ];

				if ( ( mappedTypes || origType === handleObj.origType ) &&
					 ( !handler || handler.guid === handleObj.guid ) &&
					 ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
					 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
					eventType.splice( j--, 1 );

					if ( handleObj.selector ) {
						eventType.delegateCount--;
					}
					if ( special.remove ) {
						special.remove.call( elem, handleObj );
					}
				}
			}

			// Remove generic event handler if we removed something and no more handlers exist
			// (avoids potential for endless recursion during removal of special event handlers)
			if ( eventType.length === 0 && origCount !== eventType.length ) {
				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
					jQuery.removeEvent( elem, type, elemData.handle );
				}

				delete events[ type ];
			}
		}

		// Remove the expando if it's no longer used
		if ( jQuery.isEmptyObject( events ) ) {
			handle = elemData.handle;
			if ( handle ) {
				handle.elem = null;
			}

			// removeData also checks for emptiness and clears the expando if empty
			// so use it instead of delete
			jQuery.removeData( elem, [ "events", "handle" ], true );
		}
	}
893959
public function add($element, $postion=null, $type=null) {
		parent::add($element, $postion, $type);
	}
1004457
public static Set<TypeElement>
            typesIn(Set<? extends Element> elements) {
        return setFilter(elements, TYPE_KINDS, TypeElement.class);
    }
1107676
function(type) {
			var result = null,
				spirit = null,
				el = this.spirit.element;
			if (type) {
				while ((el = el.previousElementSibling) !== null) {
					spirit = el.spirit;
					if (spirit !== null && spirit instanceof type) {
						result = spirit;
						break;
					}
				}
			} else {
				result = el.previousElementSibling;
			}
			return result;
		}