mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-04 20:10:34 +03:00
Update agnular to the latest beta
This commit is contained in:
parent
a7c6309d1d
commit
9d13b702b3
|
@ -8,7 +8,7 @@ import {CORE_DIRECTIVES} from 'angular2/common';
|
|||
events: ['change'],
|
||||
template: `
|
||||
<ul>
|
||||
<li *ngFor="#tab of tabs" [ngClass]="{active: tab.active}" (click)="selectTab(tab)"
|
||||
<li *ngFor="let tab of tabs" [ngClass]="{active: tab.active}" (click)="selectTab(tab)"
|
||||
class="tab-{{tab.tabStatus}}">{{tab.tabTitle}}</li>
|
||||
</ul>
|
||||
<ng-content></ng-content>
|
||||
|
@ -61,7 +61,7 @@ export class Tabs {
|
|||
selector: 'tab',
|
||||
inputs: ['tabTitle', 'tabStatus'],
|
||||
template: `
|
||||
<div class="tab-wrap" [ngClass]="{ 'active': active }">
|
||||
<div class="tab-wrap" [ngClass]="{'active': active}">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
`,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
import {Component, ElementRef} from 'angular2/core';
|
||||
import {Component, ElementRef, ViewContainerRef} from 'angular2/core';
|
||||
import {CORE_DIRECTIVES} from 'angular2/common';
|
||||
import {DynamicComponentLoader} from 'angular2/src/core/linker/dynamic_component_loader';
|
||||
|
||||
|
@ -18,10 +18,11 @@ var cache = {};
|
|||
template: '',
|
||||
directives: [CORE_DIRECTIVES]
|
||||
})
|
||||
@Reflect.metadata('parameters', [[SchemaManager], [ElementRef], [DynamicComponentLoader], [OptionsManager]])
|
||||
@Reflect.metadata('parameters', [[SchemaManager], [ViewContainerRef], [ElementRef], [DynamicComponentLoader], [OptionsManager]])
|
||||
export default class JsonSchemaLazy {
|
||||
|
||||
constructor(schemaMgr, elementRef, dcl, optionsMgr) {
|
||||
constructor(schemaMgr, viewRef, elementRef, dcl, optionsMgr) {
|
||||
this.viewRef = viewRef;
|
||||
this.elementRef = elementRef;
|
||||
this.dcl = dcl;
|
||||
this.optionsMgr = optionsMgr;
|
||||
|
@ -37,7 +38,7 @@ export default class JsonSchemaLazy {
|
|||
if (this.optionsMgr.options.disableLazySchemas) return;
|
||||
if (this.loaded) return;
|
||||
if (this.pointer) {
|
||||
this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => {
|
||||
this.dcl.loadNextToLocation(JsonSchema, this.viewRef).then((compRef) => {
|
||||
this.initComponent(compRef);
|
||||
// trigger change detection
|
||||
compRef.hostView.changeDetectorRef.detectChanges();
|
||||
|
@ -57,9 +58,9 @@ export default class JsonSchemaLazy {
|
|||
// skip caching view with tabs inside (discriminator) as it needs attached controller
|
||||
// FIXME: get rid of dependency on selector
|
||||
if ($element.querySelector('.discriminator-wrap')) {
|
||||
this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => {
|
||||
this.dcl.loadNextToLocation(JsonSchema, this.viewRef).then((compRef) => {
|
||||
this.initComponent(compRef);
|
||||
compRef.hostView.changeDetectorRef.markForCheck();
|
||||
compRef.hostView.changeDetectorRef.detectChanges();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -67,9 +68,9 @@ export default class JsonSchemaLazy {
|
|||
} );
|
||||
});
|
||||
} else {
|
||||
cache[this.pointer] = this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => {
|
||||
cache[this.pointer] = this.dcl.loadNextToLocation(JsonSchema, this.viewRef).then((compRef) => {
|
||||
this.initComponent(compRef);
|
||||
compRef.hostView.changeDetectorRef.markForCheck();
|
||||
compRef.hostView.changeDetectorRef.detectChanges();
|
||||
return compRef;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<span class="param-range" *ngIf="schema._range"> {{schema._range}} </span>
|
||||
</span>
|
||||
<div *ngIf="schema.enum" class="param-enum">
|
||||
<span *ngFor="#enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
<span *ngFor="let enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
</div>
|
||||
</span>
|
||||
<table *ngIf="!schema.isTrivial" class="params-wrap" [ngClass]="{'params-array': schema._isArray}">
|
||||
<!-- <caption> {{_displayType}} </caption> -->
|
||||
<template ngFor [ngForOf]="schema.properties" #prop="$implicit" #last="last">
|
||||
<template ngFor [ngForOf]="schema.properties" let-prop="$implicit" let-last="last">
|
||||
<tr class="param" [ngClass]="{'last': last,
|
||||
'discriminator': prop.isDiscriminator && !derivedEmtpy,
|
||||
'complex': prop._pointer,
|
||||
|
@ -27,14 +27,14 @@
|
|||
</span>
|
||||
<span *ngIf="prop.required" class="param-required">Required</span>
|
||||
<div *ngIf="prop.enum && !prop.isDiscriminator" class="param-enum">
|
||||
<span *ngFor="#enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
<span *ngFor="let enumItem of prop.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-description" innerHtml="{{prop.description | marked}}"></div>
|
||||
<div class="discriminator-info" *ngIf="prop.isDiscriminator">
|
||||
<span>This field value determines the exact schema:</span>
|
||||
<dropdown (change)="selectDerived($event)">
|
||||
<option *ngFor="#derived of schema.derived; #i=index"
|
||||
<option *ngFor="let derived of schema.derived; let i=index"
|
||||
[value]="i">{{derived.name}}</option>
|
||||
</dropdown>
|
||||
</div>
|
||||
|
@ -50,7 +50,7 @@
|
|||
</template>
|
||||
<tr *ngIf="schema.derived.length" class="param-wrap discriminator-wrap" [ngClass]="{'empty': derivedEmtpy}">
|
||||
<td colspan="2">
|
||||
<div class="derived-schema" *ngFor="#derived of schema.derived" [ngClass]="{active: derived.active}">
|
||||
<div class="derived-schema" *ngFor="let derived of schema.derived" [ngClass]="{active: derived.active}">
|
||||
<json-schema class="discriminator-part" *ngIf="!derived.empty" [childFor]="pointer"
|
||||
pointer="{{derived.$ref}}" [final]="derived.final" [skipReadOnly]="skipReadOnly">
|
||||
</json-schema>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<a class="share-link" href="#{{data.methodAnchor}}"></a>{{data.methodInfo.summary}}
|
||||
</h2>
|
||||
<div class="method-tags" *ngIf="data.methodInfo.tags.length">
|
||||
<a *ngFor="#tag of data.methodInfo.tags" attr.href="#{{tag}}"> {{tag}} </a>
|
||||
<a *ngFor="let tag of data.methodInfo.tags" attr.href="#{{tag}}"> {{tag}} </a>
|
||||
</div>
|
||||
<p *ngIf="data.methodInfo.description" class="method-description"
|
||||
innerHtml="{{data.methodInfo.description | marked}}">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<div class="methods">
|
||||
<div class="tag" *ngFor="#tag of data.tags">
|
||||
<div class="tag" *ngFor="let tag of data.tags">
|
||||
<div class="tag-info" [attr.tag]="tag.name">
|
||||
<h1 class="sharable-header"> <a class="share-link" href="#tag/{{tag.name | encodeURIComponent}}"></a>{{tag.name}} </h1>
|
||||
<p *ngIf="tag.description" innerHtml="{{ tag.description | marked }}"> </p>
|
||||
</div>
|
||||
<method *ngFor="#method of tag.methods" [pointer]="method.pointer" [attr.pointer]="method.pointer"
|
||||
<method *ngFor="let method of tag.methods" [pointer]="method.pointer" [attr.pointer]="method.pointer"
|
||||
[attr.tag]="method.tag" [tag]="method.tag" [attr.operation-id]="method.operationId"></method>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<h5 class="param-list-header" *ngIf="data.params.length"> Parameters </h5>
|
||||
<template ngFor [ngForOf]="data.params" #paramType="$implicit">
|
||||
<template ngFor [ngForOf]="data.params" let-paramType="$implicit">
|
||||
<header class="paramType">
|
||||
{{paramType.place}} Parameters
|
||||
<span class="hint--top-right hint--large" [attr.data-hint]="paramType.placeHint">?</span>
|
||||
</header>
|
||||
<br>
|
||||
<div class="params-wrap">
|
||||
<div *ngFor="#param of paramType.params" class="param">
|
||||
<div *ngFor="let param of paramType.params" class="param">
|
||||
<div class="param-name">
|
||||
<span class="param-name-content"> {{param.name}} </span>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
|||
title="{{param._displayTypeHint}}"> {{param._displayType}} {{param._displayFormat}}</span>
|
||||
<span *ngIf="param.required" class="param-required">Required</span>
|
||||
<div *ngIf="param.enum" class="param-enum">
|
||||
<span *ngFor="#enumItem of param.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
<span *ngFor="let enumItem of param.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-description" innerHtml="{{param.description | marked}}"></div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<tab tabTitle="JSON">
|
||||
<schema-sample [pointer]="data.bodySchemaPtr"> </schema-sample>
|
||||
</tab>
|
||||
<tab *ngFor="#sample of data.samples" [tabTitle]="sample.lang">
|
||||
<tab *ngFor="let sample of data.samples" [tabTitle]="sample.lang">
|
||||
<pre innerHtml="{{sample.source | prism:sample.lang}}"></pre>
|
||||
</tab>
|
||||
</tabs>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<h2 class="responses-list-header" *ngIf="data.responses.length"> Responses </h2>
|
||||
<zippy *ngFor="#response of data.responses" title="{{response.code}} {{response.description}}"
|
||||
<zippy *ngFor="let response of data.responses" title="{{response.code}} {{response.description}}"
|
||||
[type]="response.type" [empty]="response.empty" (open)="lazySchema.load()">
|
||||
<div *ngIf="response.headers" class="response-headers">
|
||||
<header>
|
||||
Headers
|
||||
</header>
|
||||
<div class="header" *ngFor="#header of response.headers">
|
||||
<div class="header" *ngFor="let header of response.headers">
|
||||
<div class="header-name"> {{header.name}} </div>
|
||||
<div class="header-type"> {{header.type}} </div>
|
||||
<div class="header-description" innerHtml="{{header.description | marked}}"> </div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<header *ngIf="data.responses.length"> Response samples </header>
|
||||
<tabs *ngIf="data.responses.length">
|
||||
<tab *ngFor="#response of data.responses" tabTitle="{{response.code}} {{response.description}}"
|
||||
<tab *ngFor="let response of data.responses" tabTitle="{{response.code}} {{response.description}}"
|
||||
[tabStatus]="response.type">
|
||||
<schema-sample [pointer]="response.pointer"></schema-sample>
|
||||
</tab>
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
</div>
|
||||
<div id="resources-nav">
|
||||
<h5 class="menu-header"> API reference </h5>
|
||||
<div *ngFor="var cat of data.menu; #idx = index" class="menu-cat">
|
||||
<div *ngFor="let cat of data.menu; let idx = index" class="menu-cat">
|
||||
|
||||
<label class="menu-cat-header" (click)="activateAndScroll(idx, -1)" [ngClass]="{active: cat.active}"> {{cat.name}}</label>
|
||||
<ul class="menu-subitems" [ngClass]="{active: cat.active}">
|
||||
<li *ngFor="var method of cat.methods; var methIdx = index"
|
||||
<li *ngFor="let method of cat.methods; let methIdx = index"
|
||||
[ngClass]="{active: method.active}"
|
||||
(click)="activateAndScroll(idx, methIdx)">
|
||||
{{method.summary}}
|
||||
|
|
|
@ -75,7 +75,7 @@ export function RedocComponent(options) {
|
|||
inputs: inputs,
|
||||
outputs: options.outputs,
|
||||
providers: options.providers,
|
||||
changeDetection: options.changeDetection || ChangeDetectionStrategy.Detached,
|
||||
changeDetection: options.changeDetection || ChangeDetectionStrategy.Default,
|
||||
templateUrl: options.templateUrl,
|
||||
template: options.template,
|
||||
styles: options.styles,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
"configFile": "system.config.js",
|
||||
"dependencies": {
|
||||
"Robdel12/DropKick": "github:Robdel12/DropKick@^2.1.7",
|
||||
"angular2": "npm:angular2@^2.0.0-beta.12",
|
||||
"angular2": "npm:angular2@2.0.0-beta.17",
|
||||
"es6-shim": "github:es-shims/es6-shim@^0.33.6",
|
||||
"hint.css": "npm:hint.css@^2.2.1",
|
||||
"json": "github:systemjs/plugin-json@^0.1.0",
|
||||
|
|
|
@ -38,7 +38,7 @@ System.config({
|
|||
|
||||
map: {
|
||||
"Robdel12/DropKick": "github:Robdel12/DropKick@2.1.7",
|
||||
"angular2": "npm:angular2@2.0.0-beta.12",
|
||||
"angular2": "npm:angular2@2.0.0-beta.17",
|
||||
"babel": "npm:babel-core@5.8.34",
|
||||
"babel-runtime": "npm:babel-runtime@5.8.34",
|
||||
"clean-css": "npm:clean-css@3.4.6",
|
||||
|
@ -137,10 +137,10 @@ System.config({
|
|||
"path": "github:jspm/nodelibs-path@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:angular2@2.0.0-beta.12": {
|
||||
"reflect-metadata": "npm:reflect-metadata@0.1.3",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.3",
|
||||
"zone.js": "npm:zone.js@0.5.15"
|
||||
"npm:angular2@2.0.0-beta.17": {
|
||||
"reflect-metadata": "npm:reflect-metadata@0.1.2",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.7",
|
||||
"zone.js": "npm:zone.js@0.6.12"
|
||||
},
|
||||
"npm:argparse@1.0.3": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
|
@ -743,6 +743,10 @@ System.config({
|
|||
"string_decoder": "npm:string_decoder@0.10.31",
|
||||
"util-deprecate": "npm:util-deprecate@1.0.2"
|
||||
},
|
||||
"npm:reflect-metadata@0.1.2": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:request@2.72.0": {
|
||||
"aws-sign2": "npm:aws-sign2@0.6.0",
|
||||
"aws4": "npm:aws4@1.3.2",
|
||||
|
@ -781,9 +785,10 @@ System.config({
|
|||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:rxjs@5.0.0-beta.3": {
|
||||
"npm:rxjs@5.0.0-beta.7": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
"process": "github:jspm/nodelibs-process@0.1.2",
|
||||
"symbol-observable": "npm:symbol-observable@0.2.4"
|
||||
},
|
||||
"npm:sha.js@2.4.5": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
|
@ -912,6 +917,10 @@ System.config({
|
|||
"request": "npm:request@2.72.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.2",
|
||||
"validator": "npm:validator@5.2.0"
|
||||
},
|
||||
"npm:zone.js@0.6.12": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user