Process a component

@param {Object} component Component
489660
function processComponent(component) {
    let name = component.name;
    if (component.variant) {
        name += ` (${component.variant})`;
    }
    const pathName = component.path.slice(0);
    pathName.push(name);

    // If the component is invalid
    if (!component.valid) {
        console.log(`${chalk.bold.red('X')} ${pathName.join('/')}`);
        return;
    }

    console.log(`${chalk.green('√')} ${pathName.join('/')}`);
    registerComponent(component);
}
1133035
function collectComponent(component) {
    var name = component.constructor.name;
    (components[name] || (components[name] = [])).push(component);
  }
819476
def removeComponent(self, component):
        
        if isinstance(component, int):
            index = component
        else:
            index = self._getComponentIndex(component)
        index = normalizers.normalizeIndex(index)
        if index >= self._len__components():
            raise ValueError("No component located at index %d." % index)
        self._removeComponent(index)
735147
function genComponentProtoCode(component) {
    var code = ['{'];

    // members for call expr
    var ComponentProto = component.constructor.prototype;
    Object.keys(ComponentProto).forEach(function (protoMemberKey) {
        var protoMember = ComponentProto[protoMemberKey];
        if (COMPONENT_RESERVED_MEMBERS[protoMemberKey] || !protoMember) {
            return;
        }

        switch (typeof protoMember) {
            case 'function':
                code.push(protoMemberKey + ': ' + protoMember.toString() + ',');
                break;

            case 'object':
                code.push(protoMemberKey + ':');

                if (protoMember instanceof Array) {
                    code.push('[');
                    protoMember.forEach(function (item) {
                        code.push(typeof item === 'function' ? item.toString() : '' + ',');
                    });
                    code.push(']');
                }
                else {
                    code.push('{');
                    Object.keys(protoMember).forEach(function (itemKey) {
                        var item = protoMember[itemKey];
                        if (typeof item === 'function') {
                            code.push(itemKey + ':' + item.toString() + ',');
                        }
                    });
                    code.push('}');
                }

                code.push(',');
        }
    });

    // filters
    code.push('filters: {');
    var filterCode = [];
    for (var key in component.filters) {
        if (component.filters.hasOwnProperty(key)) {
            var filter = component.filters[key];

            if (typeof filter === 'function') {
                filterCode.push(key + ': ' + filter.toString());
            }
        }
    }
    code.push(filterCode.join(','));
    code.push('},');

    /* eslint-disable no-redeclare */
    // computed obj
    code.push('computed: {');
    var computedCode = [];
    var computedNamesCode = [];
    var computedNamesIndex = {};
    for (var key in component.computed) {
        if (component.computed.hasOwnProperty(key)) {
            var computed = component.computed[key];

            if (typeof computed === 'function') {
                if (!computedNamesIndex[key]) {
                    computedNamesIndex[key] = 1;
                    computedNamesCode.push('"' + key + '"');
                }

                computedCode.push(key + ': '
                    + computed.toString()
                        .replace(/^\s*function\s*\(/, 'function (componentCtx')
                        .replace(
                            /this.data.get\(([^\)]+)\)/g,
                            function (match, exprLiteral) {
                                var exprStr = (new Function('return ' + exprLiteral))();
                                var expr = parseExpr(exprStr);

                                var ident = expr.paths[0].value;
                                if (component.computed.hasOwnProperty(ident)
                                    && !computedNamesIndex[ident]
                                ) {
                                    computedNamesIndex[ident] = 1;
                                    computedNamesCode.unshift('"' + ident + '"');
                                }

                                return compileExprSource.expr(expr);
                            }
                        )
                );
            }
        }
    }
    code.push(computedCode.join(','));
    code.push('},');

    // computed names
    code.push('computedNames: [');
    code.push(computedNamesCode.join(','));
    code.push('],');
    /* eslint-enable no-redeclare */

    // tagName
    code.push('tagName: "' + component.tagName + '"');
    code.push('};');

    return code.join('\n');
}
812994
private void processLocalComponentClass(LocalComponents localComponents,
      TypeElement localComponentType) {

    String localComponentTagName;
    try {
      localComponentTagName = componentToTagName(localComponentType);
    } catch (MissingComponentAnnotationException e) {
      e.printStackTrace();
      messager.printMessage(Kind.ERROR,
          "Missing @Component or @JsComponent annotation on imported component: "
              + localComponentType.toString(), localComponentType);
      return;
    }

    if (localComponents.hasLocalComponent(localComponentTagName)) {
      return;
    }

    LocalComponent localComponent = localComponents
        .addLocalComponent(localComponentTagName, localComponentType.asType());

    ElementFilter.fieldsIn(localComponentType.getEnclosedElements()).forEach(field -> {
      Prop propAnnotation = field.getAnnotation(Prop.class);
      if (propAnnotation != null) {
        localComponent.addProp(field.getSimpleName().toString(),
            TypeName.get(field.asType()),
            propAnnotation.required());
      }
    });
  }
1076213
public void removeToolBarComponent(Component component) {
		validateComponentNonNull(component);

		getToolbar().remove(component);
		getToolbar().validate();
		getToolbar().repaint();
	}
91530
protected void onAfterRender(final Component component) {
		final Response response = component.getResponse();
		response.write(onWriteAfterRender());
	}
1291195
protected function removeComponent($component, $value)
    {
        $this->validateComponentExists($component);

        $this->components[$component] = array_diff($this->components[$component], [$value]);
    }
565426
function instantiateReactComponent(node, shouldHaveDebugID) {
	  var instance;

	  if (node === null || node === false) {
	    instance = ReactEmptyComponent.create(instantiateReactComponent);
	  } else if (typeof node === 'object') {
	    var element = node;
	    !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;

	    // Special case string values
	    if (typeof element.type === 'string') {
	      instance = ReactHostComponent.createInternalComponent(element);
	    } else if (isInternalComponentType(element.type)) {
	      // This is temporarily available for custom components that are not string
	      // representations. I.e. ART. Once those are updated to use the string
	      // representation, we can drop this code path.
	      instance = new element.type(element);

	      // We renamed this. Allow the old name for compat. :(
	      if (!instance.getHostNode) {
	        instance.getHostNode = instance.getNativeNode;
	      }
	    } else {
	      instance = new ReactCompositeComponentWrapper(element);
	    }
	  } else if (typeof node === 'string' || typeof node === 'number') {
	    instance = ReactHostComponent.createInstanceForText(node);
	  } else {
	    process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node);
	  }

	  if (process.env.NODE_ENV !== 'production') {
	    process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
	  }

	  // These two fields are used by the DOM and ART diffing algorithms
	  // respectively. Instead of using expandos on components, we should be
	  // storing the state needed by the diffing algorithms elsewhere.
	  instance._mountIndex = 0;
	  instance._mountImage = null;

	  if (process.env.NODE_ENV !== 'production') {
	    if (shouldHaveDebugID) {
	      var debugID = nextDebugID++;
	      instance._debugID = debugID;
	      var displayName = getDisplayName(instance);
	      ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
	      var owner = node && node._owner;
	      if (owner) {
	        ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
	      }
	    } else {
	      instance._debugID = 0;
	    }
	  }

	  // Internal instances should fully constructed at this point, so they should
	  // not get any new fields added to them at this point.
	  if (process.env.NODE_ENV !== 'production') {
	    if (Object.preventExtensions) {
	      Object.preventExtensions(instance);
	    }
	  }

	  return instance;
	}
96016
function apply (Component $component)
  {
    if ($component->supportsProperties()) {
      if ($this->props)
        $component->props->applyDefaults ($this->props);
      if ($this->unset)
        foreach ($this->unset as $prop)
          unset ($component->props->$prop);
    }

    if ($this->content) {
      $component->removeChildren();
      Metadata::compile ($this->content, $component);
    }
    if ($this->prepend)
      Metadata::compile ($this->prepend, $component, true);
    if ($this->append)
      Metadata::compile ($this->append, $component);
  }
222870
function Component (props) {
  this._parent = null
  this._collector = { refs: [], components: [] }

  /**
   * > Contains all component properties and children. <br>
   * > Do not modify it directly, but recreate a new component using `cloneElement` instead
   * @type {object}
   * @category Properties
   */
  this.props = props || {}

  /**
   * > HTMLElement used as "base" for the component instance. Can also be an array of elements if `template` return an array.
   * @type {(VNode|HTMLElement|array)}
   * @category Properties
   */
  this.base = null

  /**
   * Set to true when component is mounted
   * @type {boolean}
   * @category Properties
   */
  this.mounted = false
}
458497
function updateComponentsJS(newFileName) {

  console.log(" 🔰  updating: ".cyan + "components.js".white);

  if (process.cwd().includes('client/app/components') === false) {
    process.chdir(`./client/app/components`);
  }

  componentsArray = [];
  genArr = [];


  // sync app.component with updates
  fs.readdir(process.cwd(), function (err, items) {
    genArr = items;
    generateDirectArray(genArr);
  });


  function generateDirectArray(items) {
    for (var i = 0; i < items.length; i++) {
      if (isDirectory(items[i])) {
      } else {
        componentsArray.push(items[i]);
      }
    }
    importStringGenerator();
  }

  function isDirectory(inputString) {
    var str = inputString;
    var patt = new RegExp("[.]");
    var res = patt.test(str);
    return res;
  }

  String.prototype.capitalizeFirstLetter = function () {
    return this.charAt(0).toUpperCase() + this.slice(1);
  }

  function importStringGenerator() {
    if (typeof newFileName != 'undefined') {
      componentsArray.push(`${newFileName}`);
    }

    genString = "";
    for (var i = 0; i < componentsArray.length; i++) {
      genString = genString + `    import ${componentsArray[i].capitalizeFirstLetter()}Module from './${componentsArray[i]}/${componentsArray[i]}.module';\r`
    }
    listString = "";
    for (var i = 0; i < componentsArray.length; i++) {

      // check if last in list in order to not include comma
      if (i === (componentsArray.length - 1)) {
        listString = listString + `     ${componentsArray[i].capitalizeFirstLetter()}Module` + `.name \r`
      } else {
        listString = listString + `     ${componentsArray[i].capitalizeFirstLetter()}Module` + '.name, \r'
      }

    }


    fs.writeFile("components.js", `import angular from 'angular';
${genString}

const ComponentsModule = angular.module('app.components',[
  ${listString}
]);

export default ComponentsModule;

  `, function (err) {
      if (err) {
        return console.log(` ❌  failed to update due to error:  ${err}`);
      }
      console.log(" 🔰  updated: ".cyan + "components.js".white);
    });
  }
}
487869
function(component){
		var edges = 0;
		for(var i=0;i<component.nodes.length;i++){
			var node = component.nodes[i];
			edges += node.nodes.length;
			
			this.setComponentRefs(node.obj, component);
		}
		component.circuits = (edges>>1) - component.nodes.length + 1;
		
		this.setExtraData(component);
	}
492704
@Override
    public void processComponent(String propertyName, JComponent component) {

        if (component instanceof JComboBox) {
            this.installSearchable((JComboBox) component);
        } else if (component instanceof JList) {
            this.installSearchable((JList) component);
        } else if (component instanceof JTable) {
            this.installSearchable((JTable) component);
        } else if (component instanceof JTextComponent) {
            this.installSearchable((JTextComponent) component);
        }
    }
424326
function ComponentCreateError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.message = message;
  this.code = 'COMPONENT_CREATE_ERROR';
}
57927
function (component) {
    var callbacks = this.callbacks;
    if (component.beforeStep) {
      callbacks.beforeStep.splice(callbacks.beforeStep.indexOf(component), 1);
    }
    if (component.step) {
      callbacks.step.splice(callbacks.step.indexOf(component), 1);
    }
    if (component.afterStep) {
      callbacks.afterStep.splice(callbacks.afterStep.indexOf(component), 1);
    }
  }
498735
public static void replaceComponent(Component component, Component replacement) {

        if (!component.isAttached()) {
            throw new IllegalArgumentException("Component must be attached");
        }
        HasComponents parent = component.getParent();
        if (parent instanceof ComponentContainer) {
            ((ComponentContainer)parent).replaceComponent(component, replacement);
        } else if (parent instanceof SingleComponentContainer) {
            ((SingleComponentContainer)parent).setContent(replacement);
        } else {
            throw new IllegalArgumentException("Illegal class for parent: " + parent.getClass());
        }
    }