type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration
|
private _isDynamicallyLoadedComponentKey(key: Key): boolean {
return isPresent(this._dynamicallyCreatedComponentBinding) &&
key.id === this._dynamicallyCreatedComponentBinding.key.id;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
_new(binding: ResolvedBinding): any {
if (this._constructionCounter++ > this._strategy.getMaxDirectives()) {
throw new CyclicDependencyError(binding.key);
}
var factory = binding.factory;
var deps = <List<DirectiveDependency>>binding.dependencies;
var length = deps.length;
var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
try {
d0 = length > 0 ? this._getByDependency(deps[0], binding.key) : null;
d1 = length > 1 ? this._getByDependency(deps[1], binding.key) : null;
d2 = length > 2 ? this._getByDependency(deps[2], binding.key) : null;
d3 = length > 3 ? this._getByDependency(deps[3], binding.key) : null;
d4 = length > 4 ? this._getByDependency(deps[4], binding.key) : null;
d5 = length > 5 ? this._getByDependency(deps[5], binding.key) : null;
d6 = length > 6 ? this._getByDependency(deps[6], binding.key) : null;
d7 = length > 7 ? this._getByDependency(deps[7], binding.key) : null;
d8 = length > 8 ? this._getByDependency(deps[8], binding.key) : null;
d9 = length > 9 ? this._getByDependency(deps[9], binding.key) : null;
} catch (e) {
if (e instanceof AbstractBindingError) e.addKey(binding.key);
throw e;
}
var obj;
switch (length) {
case 0:
obj = factory();
break;
case 1:
obj = factory(d0);
break;
case 2:
obj = factory(d0, d1);
break;
case 3:
obj = factory(d0, d1, d2);
break;
case 4:
obj = factory(d0, d1, d2, d3);
break;
case 5:
obj = factory(d0, d1, d2, d3, d4);
break;
case 6:
obj = factory(d0, d1, d2, d3, d4, d5);
break;
case 7:
obj = factory(d0, d1, d2, d3, d4, d5, d6);
break;
case 8:
obj = factory(d0, d1, d2, d3, d4, d5, d6, d7);
break;
case 9:
obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8);
break;
case 10:
obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9);
break;
}
this._addToQueries(obj, binding.key.token);
return obj;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _getByDependency(dep: DependencyWithVisibility, requestor: Key): any {
if (!(dep instanceof DirectiveDependency)) {
return this._getByKey(dep.key, dep.visibility, dep.optional, requestor);
}
var dirDep = <DirectiveDependency>dep;
if (isPresent(dirDep.attributeName)) return this._buildAttribute(dirDep);
if (isPresent(dirDep.queryDirective)) return this._findQuery(dirDep.queryDirective).list;
if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) {
var componentView = this._preBuiltObjects.view.componentChildViews[this._proto.index];
return componentView.changeDetector.ref;
}
if (dirDep.key.id === StaticKeys.instance().elementRefId) {
return this.getElementRef();
}
if (dirDep.key.id === StaticKeys.instance().viewContainerId) {
return this.getViewContainerRef();
}
if (dirDep.key.id === StaticKeys.instance().protoViewId) {
if (isBlank(this._preBuiltObjects.protoView)) {
if (dirDep.optional) {
return null;
}
throw new NoBindingError(dirDep.key);
}
return new ProtoViewRef(this._preBuiltObjects.protoView);
}
return this._getByKey(dirDep.key, dirDep.visibility, dirDep.optional, requestor);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _buildAttribute(dep: DirectiveDependency): string {
var attributes = this._proto.attributes;
if (isPresent(attributes) && MapWrapper.contains(attributes, dep.attributeName)) {
return MapWrapper.get(attributes, dep.attributeName);
} else {
return null;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
_buildQueriesForDeps(deps: List<DirectiveDependency>): void {
for (var i = 0; i < deps.length; i++) {
var dep = deps[i];
if (isPresent(dep.queryDirective)) {
this._createQueryRef(dep.queryDirective);
}
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _createQueryRef(directive): void {
var queryList = new QueryList<any>();
if (isBlank(this._query0)) {
this._query0 = new QueryRef(directive, queryList, this);
} else if (isBlank(this._query1)) {
this._query1 = new QueryRef(directive, queryList, this);
} else if (isBlank(this._query2)) {
this._query2 = new QueryRef(directive, queryList, this);
} else
throw new QueryError();
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _addToQueries(obj, token): void {
if (isPresent(this._query0) && (this._query0.directive === token)) {
this._query0.list.add(obj);
}
if (isPresent(this._query1) && (this._query1.directive === token)) {
this._query1.list.add(obj);
}
if (isPresent(this._query2) && (this._query2.directive === token)) {
this._query2.list.add(obj);
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
// TODO(rado): unify with _addParentQueries.
private _inheritQueries(parent: ElementInjector): void {
if (isBlank(parent)) return;
if (isPresent(parent._query0)) {
this._query0 = parent._query0;
}
if (isPresent(parent._query1)) {
this._query1 = parent._query1;
}
if (isPresent(parent._query2)) {
this._query2 = parent._query2;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _buildQueries(): void {
if (isPresent(this._proto)) {
this._strategy.buildQueries();
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _findQuery(token): QueryRef {
if (isPresent(this._query0) && this._query0.directive === token) {
return this._query0;
}
if (isPresent(this._query1) && this._query1.directive === token) {
return this._query1;
}
if (isPresent(this._query2) && this._query2.directive === token) {
return this._query2;
}
throw new BaseException(`Cannot find query for directive ${token}.`);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
link(parent: ElementInjector): void {
parent.addChild(this);
this._addParentQueries();
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
linkAfter(parent: ElementInjector, prevSibling: ElementInjector): void {
parent.addChildAfter(this, prevSibling);
this._addParentQueries();
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _addParentQueries(): void {
if (isPresent(this.parent._query0)) {
this._addQueryToTree(this.parent._query0);
this.parent._query0.update();
}
if (isPresent(this.parent._query1)) {
this._addQueryToTree(this.parent._query1);
this.parent._query1.update();
}
if (isPresent(this.parent._query2)) {
this._addQueryToTree(this.parent._query2);
this.parent._query2.update();
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
unlink(): void {
var queriesToUpDate = [];
if (isPresent(this.parent._query0)) {
this._pruneQueryFromTree(this.parent._query0);
ListWrapper.push(queriesToUpDate, this.parent._query0);
}
if (isPresent(this.parent._query1)) {
this._pruneQueryFromTree(this.parent._query1);
ListWrapper.push(queriesToUpDate, this.parent._query1);
}
if (isPresent(this.parent._query2)) {
this._pruneQueryFromTree(this.parent._query2);
ListWrapper.push(queriesToUpDate, this.parent._query2);
}
this.remove();
ListWrapper.forEach(queriesToUpDate, (q) => q.update());
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _pruneQueryFromTree(query: QueryRef): void {
this._removeQueryRef(query);
var child = this._head;
while (isPresent(child)) {
child._pruneQueryFromTree(query);
child = child._next;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _addQueryToTree(query: QueryRef): void {
this._assignQueryRef(query);
var child = this._head;
while (isPresent(child)) {
child._addQueryToTree(query);
child = child._next;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _assignQueryRef(query: QueryRef): void {
if (isBlank(this._query0)) {
this._query0 = query;
return;
} else if (isBlank(this._query1)) {
this._query1 = query;
return;
} else if (isBlank(this._query2)) {
this._query2 = query;
return;
}
throw new QueryError();
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _removeQueryRef(query: QueryRef): void {
if (this._query0 == query) this._query0 = null;
if (this._query1 == query) this._query1 = null;
if (this._query2 == query) this._query2 = null;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _getByKey(key: Key, visibility: Visibility, optional: boolean, requestor: Key): any {
var ei = this;
var currentVisibility = this._isComponentKey(requestor) ?
LIGHT_DOM_AND_SHADOW_DOM : // component can access both shadow dom
// and light dom dependencies
LIGHT_DOM;
var depth = visibility.depth;
if (!visibility.includeSelf) {
depth -= ei._proto.distanceToParent;
if (isPresent(ei._parent)) {
ei = ei._parent;
} else {
ei = ei._host;
currentVisibility = visibility.crossComponentBoundaries ? LIGHT_DOM : SHADOW_DOM;
}
}
while (ei != null && depth >= 0) {
var preBuiltObj = ei._getPreBuiltObjectByKeyId(key.id);
if (preBuiltObj !== _undefined) return preBuiltObj;
var dir = ei._getObjByKeyId(key.id, currentVisibility);
if (dir !== _undefined) return dir;
depth -= ei._proto.distanceToParent;
// we check only one mode with the SHADOW_DOM visibility
if (currentVisibility === SHADOW_DOM) break;
if (isPresent(ei._parent)) {
ei = ei._parent;
} else {
ei = ei._host;
currentVisibility = visibility.crossComponentBoundaries ? LIGHT_DOM : SHADOW_DOM;
}
}
if (isPresent(this._host) && this._host._isComponentKey(key)) {
return this._host.getComponent();
} else if (isPresent(this._host) && this._host._isDynamicallyLoadedComponentKey(key)) {
return this._host.getDynamicallyLoadedComponent();
} else if (optional) {
return this._appInjector(requestor).getOptional(key);
} else {
return this._appInjector(requestor).get(key);
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _appInjector(requestor: Key): Injector {
if (isPresent(requestor) &&
(this._isComponentKey(requestor) || this._isDynamicallyLoadedComponentKey(requestor))) {
return this._shadowDomAppInjector;
} else {
return this._lightDomAppInjector;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _getPreBuiltObjectByKeyId(keyId: number): any {
var staticKeys = StaticKeys.instance();
if (keyId === staticKeys.viewManagerId) return this._preBuiltObjects.viewManager;
return _undefined;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
private _getObjByKeyId(keyId: number, visibility: number) {
return this._strategy.getObjByKeyId(keyId, visibility);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getDirectiveAtIndex(index: number) { return this._strategy.getDirectiveAtIndex(index); }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
hasInstances(): boolean { return this._constructionCounter > 0; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
/** Gets whether this element is exporting a component instance as $implicit. */
isExportingComponent(): boolean { return this._proto.exportComponent; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
/** Gets whether this element is exporting its element as $implicit. */
isExportingElement(): boolean { return this._proto.exportElement; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
/** Get the name to which this element's $implicit is to be assigned. */
getExportImplicitName(): string { return this._proto.exportImplicitName; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getLightDomAppInjector(): Injector { return this._lightDomAppInjector; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getShadowDomAppInjector(): Injector { return this._shadowDomAppInjector; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getHost(): ElementInjector { return this._host; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getBoundElementIndex(): number { return this._proto.index; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
callOnDestroy(): void {
var p = this._protoStrategy;
if (p._binding0 instanceof DirectiveBinding && (<DirectiveBinding>p._binding0).callOnDestroy) {
this._obj0.onDestroy();
}
if (p._binding1 instanceof DirectiveBinding && (<DirectiveBinding>p._binding1).callOnDestroy) {
this._obj1.onDestroy();
}
if (p._binding2 instanceof DirectiveBinding && (<DirectiveBinding>p._binding2).callOnDestroy) {
this._obj2.onDestroy();
}
if (p._binding3 instanceof DirectiveBinding && (<DirectiveBinding>p._binding3).callOnDestroy) {
this._obj3.onDestroy();
}
if (p._binding4 instanceof DirectiveBinding && (<DirectiveBinding>p._binding4).callOnDestroy) {
this._obj4.onDestroy();
}
if (p._binding5 instanceof DirectiveBinding && (<DirectiveBinding>p._binding5).callOnDestroy) {
this._obj5.onDestroy();
}
if (p._binding6 instanceof DirectiveBinding && (<DirectiveBinding>p._binding6).callOnDestroy) {
this._obj6.onDestroy();
}
if (p._binding7 instanceof DirectiveBinding && (<DirectiveBinding>p._binding7).callOnDestroy) {
this._obj7.onDestroy();
}
if (p._binding8 instanceof DirectiveBinding && (<DirectiveBinding>p._binding8).callOnDestroy) {
this._obj8.onDestroy();
}
if (p._binding9 instanceof DirectiveBinding && (<DirectiveBinding>p._binding9).callOnDestroy) {
this._obj9.onDestroy();
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
clearInstances(): void {
this._obj0 = null;
this._obj1 = null;
this._obj2 = null;
this._obj3 = null;
this._obj4 = null;
this._obj5 = null;
this._obj6 = null;
this._obj7 = null;
this._obj8 = null;
this._obj9 = null;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
hydrate(): void {
var p = this._protoStrategy;
if (isPresent(p._keyId0)) this.getObjByKeyId(p._keyId0, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId1)) this.getObjByKeyId(p._keyId1, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId2)) this.getObjByKeyId(p._keyId2, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId3)) this.getObjByKeyId(p._keyId3, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId4)) this.getObjByKeyId(p._keyId4, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId5)) this.getObjByKeyId(p._keyId5, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId6)) this.getObjByKeyId(p._keyId6, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId7)) this.getObjByKeyId(p._keyId7, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId8)) this.getObjByKeyId(p._keyId8, LIGHT_DOM_AND_SHADOW_DOM);
if (isPresent(p._keyId9)) this.getObjByKeyId(p._keyId9, LIGHT_DOM_AND_SHADOW_DOM);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getComponent(): any { return this._obj0; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
isComponentKey(key: Key): boolean {
return this._ei._proto._firstBindingIsComponent && isPresent(key) &&
key.id === this._protoStrategy._keyId0;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
buildQueries(): void {
var p = this._protoStrategy;
if (p._binding0 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding0.dependencies);
}
if (p._binding1 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding1.dependencies);
}
if (p._binding2 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding2.dependencies);
}
if (p._binding3 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding3.dependencies);
}
if (p._binding4 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding4.dependencies);
}
if (p._binding5 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding5.dependencies);
}
if (p._binding6 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding6.dependencies);
}
if (p._binding7 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding7.dependencies);
}
if (p._binding8 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding8.dependencies);
}
if (p._binding9 instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._binding9.dependencies);
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getObjByKeyId(keyId: number, visibility: number): any {
var p = this._protoStrategy;
if (p._keyId0 === keyId && (p._visibility0 & visibility) > 0) {
if (isBlank(this._obj0)) {
this._obj0 = this._ei._new(p._binding0);
}
return this._obj0;
}
if (p._keyId1 === keyId && (p._visibility1 & visibility) > 0) {
if (isBlank(this._obj1)) {
this._obj1 = this._ei._new(p._binding1);
}
return this._obj1;
}
if (p._keyId2 === keyId && (p._visibility2 & visibility) > 0) {
if (isBlank(this._obj2)) {
this._obj2 = this._ei._new(p._binding2);
}
return this._obj2;
}
if (p._keyId3 === keyId && (p._visibility3 & visibility) > 0) {
if (isBlank(this._obj3)) {
this._obj3 = this._ei._new(p._binding3);
}
return this._obj3;
}
if (p._keyId4 === keyId && (p._visibility4 & visibility) > 0) {
if (isBlank(this._obj4)) {
this._obj4 = this._ei._new(p._binding4);
}
return this._obj4;
}
if (p._keyId5 === keyId && (p._visibility5 & visibility) > 0) {
if (isBlank(this._obj5)) {
this._obj5 = this._ei._new(p._binding5);
}
return this._obj5;
}
if (p._keyId6 === keyId && (p._visibility6 & visibility) > 0) {
if (isBlank(this._obj6)) {
this._obj6 = this._ei._new(p._binding6);
}
return this._obj6;
}
if (p._keyId7 === keyId && (p._visibility7 & visibility) > 0) {
if (isBlank(this._obj7)) {
this._obj7 = this._ei._new(p._binding7);
}
return this._obj7;
}
if (p._keyId8 === keyId && (p._visibility8 & visibility) > 0) {
if (isBlank(this._obj8)) {
this._obj8 = this._ei._new(p._binding8);
}
return this._obj8;
}
if (p._keyId9 === keyId && (p._visibility9 & visibility) > 0) {
if (isBlank(this._obj9)) {
this._obj9 = this._ei._new(p._binding9);
}
return this._obj9;
}
return _undefined;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getDirectiveAtIndex(index: number) {
if (index == 0) return this._obj0;
if (index == 1) return this._obj1;
if (index == 2) return this._obj2;
if (index == 3) return this._obj3;
if (index == 4) return this._obj4;
if (index == 5) return this._obj5;
if (index == 6) return this._obj6;
if (index == 7) return this._obj7;
if (index == 8) return this._obj8;
if (index == 9) return this._obj9;
throw new OutOfBoundsAccess(index);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getComponentBinding(): DirectiveBinding {
return <DirectiveBinding>this._protoStrategy._binding0;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getMaxDirectives(): number { return _MAX_DIRECTIVE_CONSTRUCTION_COUNTER; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
callOnDestroy(): void {
var p = this._protoStrategy;
for (var i = 0; i < p._bindings.length; i++) {
if (p._bindings[i] instanceof DirectiveBinding &&
(<DirectiveBinding>p._bindings[i]).callOnDestroy) {
this._objs[i].onDestroy();
}
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
clearInstances(): void { ListWrapper.fill(this._objs, null); }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
hydrate(): void {
var p = this._protoStrategy;
for (var i = 0; i < p._keyIds.length; i++) {
if (isPresent(p._keyIds[i])) {
this.getObjByKeyId(p._keyIds[i], LIGHT_DOM_AND_SHADOW_DOM);
}
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getComponent(): any { return this._objs[0]; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
isComponentKey(key: Key): boolean {
return this._ei._proto._firstBindingIsComponent && isPresent(key) &&
key.id === this._protoStrategy._keyIds[0];
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
buildQueries(): void {
var p = this._protoStrategy;
for (var i = 0; i < p._bindings.length; i++) {
if (p._bindings[i] instanceof DirectiveBinding) {
this._ei._buildQueriesForDeps(<List<DirectiveDependency>>p._bindings[i].dependencies);
}
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getObjByKeyId(keyId: number, visibility: number): any {
var p = this._protoStrategy;
// TODO(vicb): optimize lookup ?
for (var i = 0; i < p._keyIds.length; i++) {
if (p._keyIds[i] === keyId && (p._visibilities[i] & visibility) > 0) {
if (isBlank(this._objs[i])) {
this._objs[i] = this._ei._new(p._bindings[i]);
}
return this._objs[i];
}
}
return _undefined;
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getDirectiveAtIndex(index: number): any {
if (index < 0 || index >= this._objs.length) {
throw new OutOfBoundsAccess(index);
}
return this._objs[index];
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getComponentBinding(): DirectiveBinding {
return <DirectiveBinding>this._protoStrategy._bindings[0];
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
getMaxDirectives(): number { return this._objs.length; }
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
update(): void {
var aggregator = [];
this.visit(this.originator, aggregator);
this.list.reset(aggregator);
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
MethodDeclaration
|
visit(inj: ElementInjector, aggregator): void {
if (isBlank(inj)) return;
if (inj.hasDirective(this.directive)) {
ListWrapper.push(aggregator, inj.get(this.directive));
}
var child = inj._head;
while (isPresent(child)) {
this.visit(child, aggregator);
child = child._next;
}
}
|
MiisterPatate/planning
|
node_modules/angular2/atscript/src/core/compiler/element_injector.ts
|
TypeScript
|
ClassDeclaration
|
@NgModule({
declarations: [
ProfileComponent,
BankComponent,
CollateralComponent,
FamilyComponent,
InstallmentComponent,
WorkComponent,
BusinessComponent,
OtherIncomeComponent,
OtherIncomeOneComponent,
OtherIncomeTwoComponent,
PersonalComponent,
SupportComponent
],
imports: [
CommonModule,
HttpModule,
FormsModule,
RouterModule.forChild(routes),
],providers: [ ]
})
export default class ProfileModule {
static routes = routes;
}
|
arifakhriwilaga/masskredit
|
src/app/dashboard/profile/index.ts
|
TypeScript
|
FunctionDeclaration
|
function createComponent(): ReactWrapper<{}, IKeyboardContext> {
return mount(
<KeyboardManager>
<div className="child">Hello - I am a child component</div>
</KeyboardManager>,
);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const registrationManagerMock = KeyboardRegistrationManager as jest.Mocked<typeof KeyboardRegistrationManager>;
let wrapper: ReactWrapper<{}, IKeyboardContext> = null;
let addEventListenerSpy: jest.SpyInstance = null;
let removeEventListenerSpy: jest.SpyInstance = null;
function createComponent(): ReactWrapper<{}, IKeyboardContext> {
return mount(
<KeyboardManager>
<div className="child">Hello - I am a child component</div>
</KeyboardManager>,
);
}
beforeEach(() => {
(registrationManagerMock.prototype.invokeHandler as any).mockClear();
addEventListenerSpy = jest.spyOn(window, "addEventListener");
removeEventListenerSpy = jest.spyOn(window, "removeEventListener");
wrapper = createComponent();
});
it("is defined", () => {
expect(wrapper).not.toBeNull();
});
it("initial state is defined", () => {
expect(wrapper.state().keyboard).toBeInstanceOf(KeyboardRegistrationManager);
});
it("registers event handlers for keydown events", () => {
expect(addEventListenerSpy).toBeCalled();
expect(removeEventListenerSpy).toBeCalled();
});
it("renders all child components", () => {
expect(wrapper.find(".child").exists()).toBe(true);
});
it("listens for CmdOrCtrl+ keydown events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "CmdOrCtrl+1", keyboardEvent);
});
it("listens for CmdOrCtrl+ keyup events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "CmdOrCtrl+1", keyboardEvent);
});
it("listens for CmdOrCtrl+ keypress events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "CmdOrCtrl+1", keyboardEvent);
});
it("listens for Alt+ keydown events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "Alt+1", keyboardEvent);
});
it("listens for Alt+ keyup events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "Alt+1", keyboardEvent);
});
it("listens for Alt+ keypress events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "Alt+1", keyboardEvent);
});
it("listens for keydown events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "F1", keyboardEvent);
});
it("listens for keyup events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "F1", keyboardEvent);
});
it("listens for keypress events and invokes handlers", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "F1", keyboardEvent);
});
describe("Disabling keyboard manager", () => {
it("ignores keyboard events when UI is focused on an input element", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("input")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("ignores keyboard events when UI is focused on an textarea element", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("textarea")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("ignores keyboard events when UI is focused on select elements", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("select")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("does not ignore keyboard events when UI is focused on other form elements", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("button")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).toBeCalled();
});
});
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
(registrationManagerMock.prototype.invokeHandler as any).mockClear();
addEventListenerSpy = jest.spyOn(window, "addEventListener");
removeEventListenerSpy = jest.spyOn(window, "removeEventListener");
wrapper = createComponent();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
expect(wrapper).not.toBeNull();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
expect(wrapper.state().keyboard).toBeInstanceOf(KeyboardRegistrationManager);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
expect(addEventListenerSpy).toBeCalled();
expect(removeEventListenerSpy).toBeCalled();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
expect(wrapper.find(".child").exists()).toBe(true);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "CmdOrCtrl+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "CmdOrCtrl+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "CmdOrCtrl+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "Alt+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "Alt+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: true,
key: "1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "Alt+1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyDown, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyDown, "F1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyUp, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyUp, "F1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "F1",
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler)
.toBeCalledWith(KeyEventType.KeyPress, "F1", keyboardEvent);
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
it("ignores keyboard events when UI is focused on an input element", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("input")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("ignores keyboard events when UI is focused on an textarea element", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("textarea")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("ignores keyboard events when UI is focused on select elements", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("select")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
});
it("does not ignore keyboard events when UI is focused on other form elements", () => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("button")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).toBeCalled();
});
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("input")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => document.createElement("input")
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("textarea")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => document.createElement("textarea")
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("select")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).not.toBeCalled();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => document.createElement("select")
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const keyboardEvent = new KeyboardEvent(
KeyEventType.KeyPress, {
ctrlKey: false,
altKey: false,
key: "a",
});
Object.defineProperty(document, "activeElement", {
get: jest.fn(() => document.createElement("button")),
configurable: true,
});
window.dispatchEvent(keyboardEvent);
expect(registrationManagerMock.prototype.invokeHandler).toBeCalled();
}
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
ArrowFunction
|
() => document.createElement("button")
|
open-flex/VoTT
|
src/react/components/common/keyboardManager/keyboardManager.test.tsx
|
TypeScript
|
FunctionDeclaration
|
function TeacherList() {
const [teachers, setTeachers] = useState([]);
const [subject, setSubject] = useState("");
const [week_day, setWeek_day] = useState("");
const [time, setTime] = useState("");
async function searchTeachers(e: FormEvent) {
e.preventDefault();
const response = await api.get("classes", {
params: {
subject,
week_day,
time,
},
});
setTeachers(response.data);
}
return (
<div id="page-teacher-list" className="container">
<PageHeader title="Estes são os proffys disponíveis!">
<form id="search-teachers" onSubmit={searchTeachers}>
<Select
name="subject"
label="Matéria"
value={subject}
onChange={(e) => {
setSubject(e.target.value);
}}
|
CharlesLB/proffy
|
web/src/pages/TeacherList/index.tsx
|
TypeScript
|
FunctionDeclaration
|
async function searchTeachers(e: FormEvent) {
e.preventDefault();
const response = await api.get("classes", {
params: {
subject,
week_day,
time,
},
});
setTeachers(response.data);
}
|
CharlesLB/proffy
|
web/src/pages/TeacherList/index.tsx
|
TypeScript
|
ArrowFunction
|
(teacher: Teacher) => {
return <TeacherItem key={teacher.id} teacher={teacher} />;
}
|
CharlesLB/proffy
|
web/src/pages/TeacherList/index.tsx
|
TypeScript
|
ClassDeclaration
|
/* tslint:disable:jsx-no-multiline-js jsx-no-lambda no-string-literal */
export class AppGridPage extends MapComponent<IAppGridPageProps, IAppGridPageState> {
constructor(props: IAppGridPageProps, context?: any) {
super(props, context);
this.state = {
hidden: false
};
}
render() {
return (
<div className="map-simple-pager">
<div className="el-pagination">
<div className="el-pagination__rightwrapper">
<Button type="default">
<Icon type="left" style={{ color: 'rgb(228, 228, 228)' }}
|
xprst/xprst-com
|
src/component/MapComponent/newMap/grid/AppGridPage.tsx
|
TypeScript
|
InterfaceDeclaration
|
// tslint:disable-next-line:no-empty-interface
export interface IAppGridPageProps extends IBaseProps {
}
|
xprst/xprst-com
|
src/component/MapComponent/newMap/grid/AppGridPage.tsx
|
TypeScript
|
InterfaceDeclaration
|
// tslint:disable-next-line:no-empty-interface
export interface IAppGridPageState extends IBaseState {
}
|
xprst/xprst-com
|
src/component/MapComponent/newMap/grid/AppGridPage.tsx
|
TypeScript
|
MethodDeclaration
|
render() {
return (
<div className="map-simple-pager">
<div className="el-pagination">
<div className="el-pagination__rightwrapper">
<Button type="default">
<Icon type="left" style={{ color: 'rgb(228, 228, 228)' }}
|
xprst/xprst-com
|
src/component/MapComponent/newMap/grid/AppGridPage.tsx
|
TypeScript
|
ClassDeclaration
|
@Injectable({ providedIn: 'root' })
export class NgLodgingsDoorwaysEpics extends RecordEpicsBase<LodgingDoorway, LodgingDoorwayKey> {
constructor(
protected requests: NgLodgingsDoorwaysRequests,
protected notifications: NgLodgingsDoorwaysNotifications,
private lodgingsStore: NgLodgingsStore,
private lodgingsActions: NgLodgingsActions,
private doorwaysStore: NgDoorwaysStore,
private doorwaysActions: NgDoorwaysActions,
private skysmackStore: NgSkysmackStore
) {
super(requests, LODGINGS_DOORWAYS_REDUX_KEY, notifications);
this.epics = this.epics.concat([
...getReadDependencies({
prefix: LODGINGS_DOORWAYS_REDUX_KEY,
relationIdSelector: 'lodgingId',
rsqlIdSelector: 'id',
skysmackStore: this.skysmackStore,
store: this.lodgingsStore,
actions: this.lodgingsActions,
dependencyIndexes: [0]
}),
...getReadDependencies({
prefix: LODGINGS_DOORWAYS_REDUX_KEY,
relationIdSelector: 'doorwayId',
rsqlIdSelector: 'id',
skysmackStore: this.skysmackStore,
store: this.doorwaysStore,
actions: this.doorwaysActions,
dependencyIndexes: [1]
})
]);
}
}
|
dovanduy/skysmack-web
|
libs/ng-packages/ng-lodgings-doorways/src/lib/lodgings-doorways/redux/ng-lodgings-doorways-epics.ts
|
TypeScript
|
ArrowFunction
|
async () => {
await this.modelToViewModel(model, viewModel, bindingContext);
this.eventManager.dispatchEvent("onContentUpdate", model.key.replace("files/", "popups/"));
}
|
rproserpio/paperbits-core
|
src/popup/ko/popupViewModelBinder.ts
|
TypeScript
|
ClassDeclaration
|
export class PopupViewModelBinder implements ViewModelBinder<PopupModel, PopupViewModel> {
constructor(
private readonly viewModelBinderSelector: ViewModelBinderSelector,
private readonly eventManager: EventManager,
private readonly styleCompiler: StyleCompiler
) { }
public async modelToViewModel(model: PopupModel, viewModel?: PopupViewModel, bindingContext?: Bag<any>): Promise<PopupViewModel> {
if (!viewModel) {
viewModel = new PopupViewModel();
}
const widgetViewModels = [];
for (const widgetModel of model.widgets) {
const widgetViewModelBinder = this.viewModelBinderSelector.getViewModelBinderByModel(widgetModel);
if (widgetViewModelBinder.createWidgetBinding) {
const binding = await widgetViewModelBinder.createWidgetBinding<any>(widgetModel, bindingContext);
widgetViewModels.push(binding);
}
else {
const widgetViewModel = await widgetViewModelBinder.modelToViewModel(widgetModel, null, bindingContext);
widgetViewModels.push(widgetViewModel);
}
}
if (widgetViewModels.length === 0) {
widgetViewModels.push(new PlaceholderViewModel("Popup content"));
}
if (model.styles) {
viewModel.styles(await this.styleCompiler.getStyleModelAsync(model.styles, bindingContext?.styleManager));
}
viewModel.identifier(model.key.replace("files/", "popups"));
viewModel.widgets(widgetViewModels);
viewModel.backdrop(model.backdrop);
if (!viewModel["widgetBinding"]) {
const binding: IWidgetBinding<PopupModel, PopupViewModel> = {
name: "popup",
displayName: "Popup",
readonly: bindingContext ? bindingContext.readonly : false,
flow: "block",
model: model,
draggable: true,
editor: "popup-editor",
handler: PopupHandlers,
applyChanges: async () => {
await this.modelToViewModel(model, viewModel, bindingContext);
this.eventManager.dispatchEvent("onContentUpdate", model.key.replace("files/", "popups/"));
}
};
viewModel["widgetBinding"] = binding;
}
return viewModel;
}
public canHandleModel(model: PopupModel): boolean {
return model instanceof PopupModel;
}
}
|
rproserpio/paperbits-core
|
src/popup/ko/popupViewModelBinder.ts
|
TypeScript
|
MethodDeclaration
|
public async modelToViewModel(model: PopupModel, viewModel?: PopupViewModel, bindingContext?: Bag<any>): Promise<PopupViewModel> {
if (!viewModel) {
viewModel = new PopupViewModel();
}
const widgetViewModels = [];
for (const widgetModel of model.widgets) {
const widgetViewModelBinder = this.viewModelBinderSelector.getViewModelBinderByModel(widgetModel);
if (widgetViewModelBinder.createWidgetBinding) {
const binding = await widgetViewModelBinder.createWidgetBinding<any>(widgetModel, bindingContext);
widgetViewModels.push(binding);
}
else {
const widgetViewModel = await widgetViewModelBinder.modelToViewModel(widgetModel, null, bindingContext);
widgetViewModels.push(widgetViewModel);
}
}
if (widgetViewModels.length === 0) {
widgetViewModels.push(new PlaceholderViewModel("Popup content"));
}
if (model.styles) {
viewModel.styles(await this.styleCompiler.getStyleModelAsync(model.styles, bindingContext?.styleManager));
}
viewModel.identifier(model.key.replace("files/", "popups"));
viewModel.widgets(widgetViewModels);
viewModel.backdrop(model.backdrop);
if (!viewModel["widgetBinding"]) {
const binding: IWidgetBinding<PopupModel, PopupViewModel> = {
name: "popup",
displayName: "Popup",
readonly: bindingContext ? bindingContext.readonly : false,
flow: "block",
model: model,
draggable: true,
editor: "popup-editor",
handler: PopupHandlers,
applyChanges: async () => {
await this.modelToViewModel(model, viewModel, bindingContext);
this.eventManager.dispatchEvent("onContentUpdate", model.key.replace("files/", "popups/"));
}
};
viewModel["widgetBinding"] = binding;
}
return viewModel;
}
|
rproserpio/paperbits-core
|
src/popup/ko/popupViewModelBinder.ts
|
TypeScript
|
MethodDeclaration
|
public canHandleModel(model: PopupModel): boolean {
return model instanceof PopupModel;
}
|
rproserpio/paperbits-core
|
src/popup/ko/popupViewModelBinder.ts
|
TypeScript
|
FunctionDeclaration
|
// Type definitions for dogapi 2.8
// Project: https://github.com/brettlangdon/node-dogapi#readme
// Definitions by: olebedev <https://github.com/olebedev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2
export function initialize(opts: { api_key: string; app_key: string; api_host?: string | undefined }): void;
|
0-Captain/DefinitelyTyped
|
types/dogapi/index.d.ts
|
TypeScript
|
InterfaceDeclaration
|
interface event {
create(title: string, text: string, callback: (err: Error | null, res: EventCreateResponse) => void): void;
create(
title: string,
text: string,
properties: {
date_happened?: number | undefined;
priority?: 'normal' | 'low' | undefined;
host?: string | undefined;
tags?: ReadonlyArray<string> | undefined;
alert_type?: 'error' | 'warning' | 'info' | 'success' | undefined;
aggregation_key?: string | undefined;
source_type_name?:
| 'nagios'
| 'hudson'
| 'jenkins'
| 'user'
| 'my apps'
| 'feed'
| 'chef'
| 'puppet'
| 'git'
| 'bitbucket'
| 'fabric'
| 'capistrano' | undefined;
},
callback: (err: Error | null, res: EventCreateResponse) => void,
): void;
}
|
0-Captain/DefinitelyTyped
|
types/dogapi/index.d.ts
|
TypeScript
|
InterfaceDeclaration
|
interface metric {
send(metric: string, points: number | number[], callback: (err: Error | null, res: 'ok') => void): void;
send(
metric: string,
points: number | number[],
extra: {
type?: 'gauge' | 'rate' | 'count' | undefined;
metric_type?: 'gauge' | 'count' | undefined;
host?: string | undefined;
tags?: ReadonlyArray<string> | undefined;
},
callback: (err: Error | null, res: 'ok') => void,
): void;
send_all(
metrics: Array<{
metric: string;
points: number | number[] | Array<[string, number]>;
tags?: string[] | undefined;
type?: string | undefined;
metric_type?: string | undefined;
}>,
callback: (err: Error | null, res: EventCreateResponse) => void,
): void;
}
|
0-Captain/DefinitelyTyped
|
types/dogapi/index.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface EventCreateResponse {
ok: boolean;
event: {
date_happened: number;
handle: any;
id: bigint;
priority: 'normal' | 'low';
related_event_id: number | null;
tags: ReadonlyArray<string>;
text: string;
title: string;
url: string;
};
status: 'ok';
}
|
0-Captain/DefinitelyTyped
|
types/dogapi/index.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Flattens an array.
* Use this function to keep support for node 10
* @param array
*/
declare function arrayFlat<T>(array: T[][]): T[];
|
Bryan-Guner-Backup/Bryan-Guner-Backup
|
node_modules/web-component-analyzer/lib/cjs/array-util-aa2883ec.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Filters an array returning only defined items
* @param array
*/
declare function arrayDefined<T>(array: (T | undefined)[]): T[];
|
Bryan-Guner-Backup/Bryan-Guner-Backup
|
node_modules/web-component-analyzer/lib/cjs/array-util-aa2883ec.d.ts
|
TypeScript
|
FunctionDeclaration
|
function getId(manifest: IExtensionManifest, withVersion?: boolean): string {
if (withVersion) {
return `${manifest.publisher}.${manifest.name}@${manifest.version}`;
} else {
return `${manifest.publisher}.${manifest.name}`;
}
}
|
jepetty/vscode
|
src/vs/code/node/cliProcessMain.ts
|
TypeScript
|
FunctionDeclaration
|
export function getIdAndVersion(id: string): [string, string | undefined] {
const matches = EXTENSION_ID_REGEX.exec(id);
if (matches && matches[1]) {
return [adoptToGalleryExtensionId(matches[1]), matches[2]];
}
return [adoptToGalleryExtensionId(id), undefined];
}
|
jepetty/vscode
|
src/vs/code/node/cliProcessMain.ts
|
TypeScript
|
FunctionDeclaration
|
async function getExtensionId(extensionDescription: string): Promise<string> {
if (!/\.vsix$/i.test(extensionDescription)) {
return extensionDescription;
}
const zipPath = path.isAbsolute(extensionDescription) ? extensionDescription : path.join(process.cwd(), extensionDescription);
const manifest = await getManifest(zipPath);
return getId(manifest);
}
|
jepetty/vscode
|
src/vs/code/node/cliProcessMain.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.