Skip to content

Commit 0867ffa

Browse files
committed
added option to specify response area height
1 parent 7c2712b commit 0867ffa

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

docs/api.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,14 @@ <h2> Attributes</h2>
241241
</td>
242242
<td>model</td>
243243
</tr>
244+
244245
<tr>
245-
<td class="mono bold right">api-list-style</td>
246+
<td class="mono bold right">response-area-height</td>
246247
<td class="gray">
247-
<span class='bold dark-gray'>Allowed:<span class='blue'> group-by-tag, group-by-path</span></span> -
248-
This controls how the API litings are grouped. this can be changed from the UI too (applied only in view mode)
248+
<span class='bold dark-gray'>Allowed:<span class='blue'> valid css height value such as 400px, 50%, 60vh etc</span></span> -
249+
Use this value to control the height of response textarea
249250
</td>
250-
<td>group-by-tag</td>
251+
<td>300px</td>
251252
</tr>
252253
</table>
253254

src/rapidoc.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default class RapiDoc extends LitElement {
4848
defaultSchemaTab: { type: String, attribute: 'default-schema-tab' },
4949
schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },
5050
schemaDescriptionExpanded: { type: String, attribute: 'schema-description-expanded' },
51+
responseAreaHeight: { type: String, attribute: 'response-area-height' },
5152

5253
// API Server
5354
apiKeyName: { type: String, attribute: 'api-key-name' },
@@ -97,6 +98,10 @@ export default class RapiDoc extends LitElement {
9798
if (!this.defaultSchemaTab || !'example model'.includes(this.defaultSchemaTab)) { this.defaultSchemaTab = 'model'; }
9899
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) { this.schemaExpandLevel = 99999; }
99100
if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) { this.schemaDescriptionExpanded = 'false'; }
101+
debugger;
102+
if (!this.responseAreaHeight) {
103+
this.responseAreaHeight = '300px';
104+
}
100105
if (!this.allowTry || !'true false'.includes(this.allowTry)) { this.allowTry = 'true'; }
101106
if (!this.apiKeyName) { this.apiKeyName = ''; }
102107
if (!this.apiKeyValue) { this.apiKeyValue = ''; }
@@ -139,10 +144,11 @@ export default class RapiDoc extends LitElement {
139144
--font-mono:${this.monoFont ? `${this.monoFont}` : 'Monaco, "Andale Mono", "Roboto Mono", Consolas'};
140145
--font-regular:${this.regularFont ? `${this.regularFont}` : 'rapidoc, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
141146
142-
--font-size-mono:13px;
143-
--font-size-regular:14px;
144-
--font-size-small:12px;
145-
--border-radius:2px;
147+
--font-size-mono: 13px;
148+
--font-size-regular: 14px;
149+
--font-size-small: 12px;
150+
--border-radius: 2px;
151+
--resp-area-height: ${this.responseAreaHeight};
146152
147153
display:flex;
148154
flex-direction: column;

src/styles/font-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default html`
2424
.red-text {color: var(--red)}
2525
.multiline {
2626
overflow: scroll;
27-
max-height: 200px;
27+
max-height: var(--resp-area-height, 300px);
2828
color: var(--fg3);
2929
}
3030
.method-fg.put { color: var(--orange); }

0 commit comments

Comments
 (0)