Merge branch 'ft/oas3' of github.com:swagger-api/swagger-ui into ft/oas3
This commit is contained in:
2
dist/swagger-ui.css
vendored
2
dist/swagger-ui.css
vendored
File diff suppressed because one or more lines are too long
18
dist/swagger-ui.js
vendored
18
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui.js.map
vendored
2
dist/swagger-ui.js.map
vendored
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AA21CA;AAoyHA;AAmyHA;AAokGA;AA+9BA;AA0hCA;AAgjCA;AAu5BA","sourceRoot":""}
|
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAm2CA;AAoyHA;AAmyHA;AAokGA;AA89BA;AAwhCA;AA2kCA;AAu5BA","sourceRoot":""}
|
||||||
@@ -7,6 +7,15 @@ const eachMap = (iterable, fn) => iterable.valueSeq().filter(Im.Map.isMap).map(f
|
|||||||
|
|
||||||
export default class Parameters extends Component {
|
export default class Parameters extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.state = {
|
||||||
|
callbackVisible: false,
|
||||||
|
parametersVisible: true
|
||||||
|
}
|
||||||
|
//this.toggleTab = this.toggleTab.bind(this)
|
||||||
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
parameters: ImPropTypes.list.isRequired,
|
parameters: ImPropTypes.list.isRequired,
|
||||||
specActions: PropTypes.object.isRequired,
|
specActions: PropTypes.object.isRequired,
|
||||||
@@ -48,6 +57,14 @@ export default class Parameters extends Component {
|
|||||||
changeConsumesValue(onChangeKey, val)
|
changeConsumesValue(onChangeKey, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// toggleTab = (tab) => {
|
||||||
|
// if(tab === "parameters"){
|
||||||
|
// this.setState({parametersVisible: true})
|
||||||
|
// }else if(tab === "callbacks"){
|
||||||
|
// this.setState({callbackVisible: true})
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -71,38 +88,49 @@ export default class Parameters extends Component {
|
|||||||
return (
|
return (
|
||||||
<div className="opblock-section">
|
<div className="opblock-section">
|
||||||
<div className="opblock-section-header">
|
<div className="opblock-section-header">
|
||||||
<h4 className="opblock-title">Parameters</h4>
|
<div className="tab-header">
|
||||||
|
<div onClick={this.toggleTab("parameters")} className={this.state.parametersVisible ? "tab-item active" : "tab-item"}>
|
||||||
|
<h4 className="opblock-title"><span>Parameters</span></h4>
|
||||||
|
</div>
|
||||||
|
<div onClick={this.toggleTab("callbacks")} className="tab-item">
|
||||||
|
<h4 className="opblock-title"><span>Callbacks</span></h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{ allowTryItOut ? (
|
{ allowTryItOut ? (
|
||||||
<TryItOutButton enabled={ tryItOutEnabled } onCancelClick={ onCancelClick } onTryoutClick={ onTryoutClick } />
|
<TryItOutButton enabled={ tryItOutEnabled } onCancelClick={ onCancelClick } onTryoutClick={ onTryoutClick } />
|
||||||
) : null }
|
) : null }
|
||||||
</div>
|
</div>
|
||||||
{ !parameters.count() ? <div className="opblock-description-wrapper"><p>No parameters</p></div> :
|
{this.state.parametersVisible ? <div className="parameters-container">
|
||||||
<div className="table-container">
|
{ !parameters.count() ? <div className="opblock-description-wrapper"><p>No parameters</p></div> :
|
||||||
<table className="parameters">
|
<div className="table-container">
|
||||||
<thead>
|
<table className="parameters">
|
||||||
<tr>
|
<thead>
|
||||||
<th className="col col_header parameters-col_name">Name</th>
|
<tr>
|
||||||
<th className="col col_header parameters-col_description">Description</th>
|
<th className="col col_header parameters-col_name">Name</th>
|
||||||
</tr>
|
<th className="col col_header parameters-col_description">Description</th>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
{
|
<tbody>
|
||||||
eachMap(parameters, (parameter) => (
|
{
|
||||||
<ParameterRow fn={ fn }
|
eachMap(parameters, (parameter) => (
|
||||||
getComponent={ getComponent }
|
<ParameterRow fn={ fn }
|
||||||
param={ parameter }
|
getComponent={ getComponent }
|
||||||
key={ parameter.get( "name" ) }
|
param={ parameter }
|
||||||
onChange={ this.onChange }
|
key={ parameter.get( "name" ) }
|
||||||
onChangeConsumes={this.onChangeConsumesWrapper}
|
onChange={ this.onChange }
|
||||||
specSelectors={ specSelectors }
|
onChangeConsumes={this.onChangeConsumesWrapper}
|
||||||
pathMethod={ pathMethod }
|
specSelectors={ specSelectors }
|
||||||
isExecute={ isExecute }/>
|
pathMethod={ pathMethod }
|
||||||
)).toArray()
|
isExecute={ isExecute }/>
|
||||||
}
|
)).toArray()
|
||||||
</tbody>
|
}
|
||||||
</table>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
}
|
</div>
|
||||||
|
}
|
||||||
|
</div> : "" }
|
||||||
|
|
||||||
|
{this.state.callbackVisible ? <div className="callbacks-container"></div> : "" }
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ body
|
|||||||
{
|
{
|
||||||
border-color: $color;
|
border-color: $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-header .tab-item.active h4 span:after
|
||||||
|
{
|
||||||
|
background: $color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -142,6 +147,51 @@ body
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0 0 3px rgba(#000,.19);
|
box-shadow: 0 0 3px rgba(#000,.19);
|
||||||
|
|
||||||
|
.tab-header
|
||||||
|
{
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.tab-item
|
||||||
|
{
|
||||||
|
padding: 0 40px;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:first-of-type
|
||||||
|
{
|
||||||
|
padding: 0 40px 0 0;
|
||||||
|
}
|
||||||
|
&.active
|
||||||
|
{
|
||||||
|
h4
|
||||||
|
{
|
||||||
|
span
|
||||||
|
{
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
&:after
|
||||||
|
{
|
||||||
|
position: absolute;
|
||||||
|
bottom: -15px;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
width: 120%;
|
||||||
|
height: 4px;
|
||||||
|
|
||||||
|
content: '';
|
||||||
|
transform: translateX(-50%);
|
||||||
|
|
||||||
|
background: #888;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
&.is-open
|
&.is-open
|
||||||
{
|
{
|
||||||
@@ -186,7 +236,6 @@ body
|
|||||||
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
flex: 1;
|
|
||||||
@include text_headline();
|
@include text_headline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -310,12 +359,12 @@ body
|
|||||||
|
|
||||||
.opblock-schemes
|
.opblock-schemes
|
||||||
{
|
{
|
||||||
padding: 8px 20px;
|
padding: 8px 20px;
|
||||||
|
|
||||||
.schemes-title
|
.schemes-title
|
||||||
{
|
{
|
||||||
padding: 0 10px 0 0;
|
padding: 0 10px 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user