Skip to content

Commit 5a4d802

Browse files
authored
feat: add a half row to maxRows (#27)
1 parent bc98bc5 commit 5a4d802

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@stoplight/storybook-config": "^2.0.2",
5959
"@stoplight/tree-list": "^4.0.0",
6060
"@stoplight/types": "4.1.0",
61-
"@stoplight/ui-kit": "^2.0.0",
61+
"@stoplight/ui-kit": "^2.4.0",
6262
"@types/classnames": "^2.2.7",
6363
"@types/enzyme": "3.9.1",
6464
"@types/jest": "^24.0.12",

src/__stories__/JsonSchemaViewer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ storiesOf('JsonSchemaViewer', module)
5454
expanded={boolean('expanded', true)}
5555
hideTopBar={boolean('hideTopBar', false)}
5656
onGoToRef={action('onGoToRef')}
57+
maxRows={number('maxRows', 5)}
5758
/>
5859
))
5960
.add('stress-test schema', () => (
@@ -64,6 +65,7 @@ storiesOf('JsonSchemaViewer', module)
6465
expanded={boolean('expanded', false)}
6566
hideTopBar={boolean('hideTopBar', false)}
6667
onGoToRef={action('onGoToRef')}
68+
maxRows={number('maxRows', 10)}
6769
/>
6870
))
6971
.add('allOf-schema', () => (
@@ -92,7 +94,7 @@ storiesOf('JsonSchemaViewer', module)
9294
<div style={{ height: '100vh' }} className="bp3-dark bg-gray-8">
9395
<JsonSchemaViewer
9496
name={text('name', 'my stress schema')}
95-
schema={stressSchema as JSONSchema4}
97+
schema={schema as JSONSchema4}
9698
defaultExpandedDepth={number('defaultExpandedDepth', 2)}
9799
expanded={boolean('expanded', false)}
98100
hideTopBar={boolean('hideTopBar', false)}

src/components/SchemaTree.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ export const SchemaTree = observer<ISchemaTree>(props => {
4646
</div>
4747
)}
4848

49-
<TreeList striped maxRows={maxRows} store={treeStore} rowRenderer={rowRenderer} canDrag={canDrag} />
49+
<TreeList
50+
striped
51+
maxRows={maxRows !== undefined ? maxRows + 0.5 : maxRows}
52+
store={treeStore}
53+
rowRenderer={rowRenderer}
54+
canDrag={canDrag}
55+
/>
5056
</div>
5157
);
5258
});

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,9 +1776,9 @@
17761776
webpack "4.30.0"
17771777

17781778
"@stoplight/tree-list@^4.0.0":
1779-
version "4.0.0"
1780-
resolved "https://registry.yarnpkg.com/@stoplight/tree-list/-/tree-list-4.0.0.tgz#c0f32a8c0d12a823a9dbd568db4117d59eb79289"
1781-
integrity sha512-CZoMmJYLly56E/2MCufmKarRNeaIyzgtyuhcSnOjhNJi9pmrlsi8EHdJGVvsGjWVRt/KU1CvspFSN+8NiSXMsg==
1779+
version "4.3.1"
1780+
resolved "https://registry.yarnpkg.com/@stoplight/tree-list/-/tree-list-4.3.1.tgz#5063e9fcfb22a0ac2f49603b31b6d3b95cb215ef"
1781+
integrity sha512-//pQPH+h0wymqXx0m8gtBMA2dgrAXiAkQa2I0IJgYrbpt7Xd3EczrRXNi+CKbwX6jvM8XHBac5CJWwG5hARV1w==
17821782
dependencies:
17831783
"@stoplight/lifecycle" "2.x.x"
17841784
classnames "2.x.x"
@@ -1801,10 +1801,10 @@
18011801
resolved "https://registry.yarnpkg.com/@stoplight/types/-/types-5.1.0.tgz#33fb18d8927e2538b2f0b19edc076d6f7e3a9978"
18021802
integrity sha512-GKOcgmwDMJyg09WmI4irIiq7d32hwlqyrdAqpV4b/Eg6/XT2e3g8spguiOsQKIqQSvZqSrrfpGWn/ENCPBvFEA==
18031803

1804-
"@stoplight/ui-kit@^2.0.0":
1805-
version "2.0.0"
1806-
resolved "https://registry.yarnpkg.com/@stoplight/ui-kit/-/ui-kit-2.0.0.tgz#7c0714ca2509b238ed0bbb7bead2e5c7d8ff8ef2"
1807-
integrity sha512-riqYporkodtC/q1vr0HQuPgo1uGWGNenPjByM4qEuSqgqdepl+3u2xZlWlJ+SjVnzy/pWP0WWbWPd3jVsY5cMQ==
1804+
"@stoplight/ui-kit@^2.4.0":
1805+
version "2.4.0"
1806+
resolved "https://registry.yarnpkg.com/@stoplight/ui-kit/-/ui-kit-2.4.0.tgz#2a23f58335c6f9fc0ea138b72a3527814cae8075"
1807+
integrity sha512-uQsa9xBGPnYy+qnopHyR9hteGk06UROzNsZhWnakP2rKp7+N+NVlIPjTxEoTV6wdJ4UYmMIoWDDtjlVf3a4DdA==
18081808
dependencies:
18091809
"@blueprintjs/core" "^3.15.1"
18101810
"@blueprintjs/icons" "^3.8.0"

0 commit comments

Comments
 (0)