Skip to content

Commit 35c28a5

Browse files
committed
improved styling for multipart-formdata
1 parent 3ea8447 commit 35c28a5

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

src/components/api-request.js

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ export default class ApiRequest extends LitElement {
549549
</div>
550550
<div class="param-type">${paramSchema.type}</div>
551551
</td>
552-
<td style="${fieldType === 'object' ? 'width:100%; padding:0;' : 'width:160px;'} min-width:100px;">
552+
<td style="${fieldType === 'object' ? 'width:100%; padding:0;' : 'width:160px;'} min-width:100px;" colspan="${fieldType === 'object' ? 2 : 1}">
553553
${fieldType === 'array'
554554
? fieldSchema.items.format === 'binary'
555555
? html`
@@ -605,7 +605,7 @@ export default class ApiRequest extends LitElement {
605605
</div>
606606
</div>
607607
${html`
608-
<div class="tab-content col" data-tab = 'model' style="display:none; padding:0 10px; width:100%;">
608+
<div class="tab-content col" data-tab = 'model' style="display:${this.activeSchemaTab === 'model' ? 'block' : 'none'}; padding-left:5px; width:100%;">
609609
<schema-tree
610610
.data = '${formdataPartSchema}'
611611
schema-expand-level = "${this.schemaExpandLevel}"
@@ -614,7 +614,7 @@ export default class ApiRequest extends LitElement {
614614
</div>`
615615
}
616616
${html`
617-
<div class="tab-content col" data-tab = 'example' style="display:block; padding:0 10px; width:100%">
617+
<div class="tab-content col" data-tab = 'example' style="display:${this.activeSchemaTab === 'example' ? 'block' : 'none'}; padding-left:5px; width:100%">
618618
<textarea
619619
class = "textarea"
620620
style = "width:100%; border:none; resize:vertical;"
@@ -643,27 +643,35 @@ export default class ApiRequest extends LitElement {
643643
}`
644644
}
645645
</td>
646-
<td>
647-
<div class="param-constraint">
648-
${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues
649-
? html`
650-
<div class="param-constraint">
651-
${paramSchema.default ? html`<span style="font-weight:bold">Default: </span>${paramSchema.default}<br/>` : ''}
652-
${paramSchema.constrain ? html`${paramSchema.constrain}<br/>` : ''}
653-
${paramSchema.allowedValues ? html`<span style="font-weight:bold">Allowed: </span>${paramSchema.allowedValues}` : ''}
654-
</div>`
655-
: ''
656-
}
657-
</div>
658-
</td>
659-
</tr>
660-
<tr>
661-
${this.allowTry === 'true' ? html`<td style="border:none"> </td>` : ''}
662-
<td colspan="2" style="border:none; margin-top:0; padding:0 5px 8px 5px;">
663-
<span class="m-markdown-small">${unsafeHTML(marked(fieldSchema.description || ''))}</span>
664-
</td>
646+
${fieldType === 'object'
647+
? ''
648+
: html`
649+
<td>
650+
<div class="param-constraint">
651+
${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues
652+
? html`
653+
<div class="param-constraint">
654+
${paramSchema.default ? html`<span style="font-weight:bold">Default: </span>${paramSchema.default}<br/>` : ''}
655+
${paramSchema.constrain ? html`${paramSchema.constrain}<br/>` : ''}
656+
${paramSchema.allowedValues ? html`<span style="font-weight:bold">Allowed: </span>${paramSchema.allowedValues}` : ''}
657+
</div>`
658+
: ''
659+
}
660+
</div>
661+
</td>`
662+
}
665663
</tr>
666-
`);
664+
${fieldType === 'object'
665+
? ''
666+
: html`
667+
<tr>
668+
${this.allowTry === 'true' ? html`<td style="border:none"> </td>` : ''}
669+
<td colspan="2" style="border:none; margin-top:0; padding:0 5px 8px 5px;">
670+
<span class="m-markdown-small">${unsafeHTML(marked(fieldSchema.description || ''))}</span>
671+
</td>
672+
</tr>
673+
`
674+
}`);
667675
}
668676
return html`
669677
<table style="width:100%;" class="m-table">

0 commit comments

Comments
 (0)