Skip to content

Commit

Permalink
feat(Row): render returns the index of the parent keys. #27 2e1d1ea
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 24, 2024
1 parent e913715 commit c547e2f
Show file tree
Hide file tree
Showing 76 changed files with 250 additions and 205 deletions.
6 changes: 3 additions & 3 deletions asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"files": {
"main.css": "/static/css/main.020a7543.css",
"main.js": "/static/js/main.5aa2840a.js",
"main.js": "/static/js/main.feea074c.js",
"refractor-prismjs-vendor.0abbb2f3.js": "/static/js/refractor-prismjs-vendor.0abbb2f3.4ed442e7.js",
"react-vendor.js": "/static/js/react-vendor.7038eeb0.js",
"refractor-prismjs-vendor.3665b250.js": "/static/js/refractor-prismjs-vendor.3665b250.eec550b5.js",
"refractor-prismjs-vendor.a81a7d65.js": "/static/js/refractor-prismjs-vendor.a81a7d65.e53936ae.js",
"index.html": "/index.html",
"main.020a7543.css.map": "/static/css/main.020a7543.css.map",
"main.5aa2840a.js.map": "/static/js/main.5aa2840a.js.map",
"main.feea074c.js.map": "/static/js/main.feea074c.js.map",
"refractor-prismjs-vendor.0abbb2f3.4ed442e7.js.map": "/static/js/refractor-prismjs-vendor.0abbb2f3.4ed442e7.js.map",
"react-vendor.7038eeb0.js.map": "/static/js/react-vendor.7038eeb0.js.map",
"refractor-prismjs-vendor.3665b250.eec550b5.js.map": "/static/js/refractor-prismjs-vendor.3665b250.eec550b5.js.map",
Expand All @@ -20,6 +20,6 @@
"static/js/refractor-prismjs-vendor.0abbb2f3.4ed442e7.js",
"static/js/react-vendor.7038eeb0.js",
"static/css/main.020a7543.css",
"static/js/main.5aa2840a.js"
"static/js/main.feea074c.js"
]
}
18 changes: 9 additions & 9 deletions badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="keywords" content="react,react-component,array-viewer,base-16,component,interactive,interactive-json,json,json-component,json-display,json-tree,json-view,json-viewer,json-inspector,json-tree,react,react-component,react-json,theme,tree,tree-view,treeview,jaywcjlove"><meta name="description" content="A React component for displaying and editing javascript arrays and JSON objects."><link rel="shortcut icon" href="/favicon.ico"><title>react-json-view</title><script defer="defer" src="./static/js/refractor-prismjs-vendor.3665b250.eec550b5.js"></script><script defer="defer" src="./static/js/refractor-prismjs-vendor.a81a7d65.e53936ae.js"></script><script defer="defer" src="./static/js/refractor-prismjs-vendor.0abbb2f3.4ed442e7.js"></script><script defer="defer" src="./static/js/react-vendor.7038eeb0.js"></script><script defer="defer" src="./static/js/main.5aa2840a.js"></script><link href="./static/css/main.020a7543.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="keywords" content="react,react-component,array-viewer,base-16,component,interactive,interactive-json,json,json-component,json-display,json-tree,json-view,json-viewer,json-inspector,json-tree,react,react-component,react-json,theme,tree,tree-view,treeview,jaywcjlove"><meta name="description" content="A React component for displaying and editing javascript arrays and JSON objects."><link rel="shortcut icon" href="/favicon.ico"><title>react-json-view</title><script defer="defer" src="./static/js/refractor-prismjs-vendor.3665b250.eec550b5.js"></script><script defer="defer" src="./static/js/refractor-prismjs-vendor.a81a7d65.e53936ae.js"></script><script defer="defer" src="./static/js/refractor-prismjs-vendor.0abbb2f3.4ed442e7.js"></script><script defer="defer" src="./static/js/react-vendor.7038eeb0.js"></script><script defer="defer" src="./static/js/main.feea074c.js"></script><link href="./static/css/main.020a7543.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
32 changes: 16 additions & 16 deletions lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">94.1% </span>
<span class="strong">94.11% </span>
<span class="quiet">Statements</span>
<span class='fraction'>750/797</span>
<span class='fraction'>751/798</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">76.88% </span>
<span class="strong">76.92% </span>
<span class="quiet">Branches</span>
<span class='fraction'>429/558</span>
<span class='fraction'>430/559</span>
</div>


Expand All @@ -44,9 +44,9 @@ <h1>All files</h1>


<div class='fl pad1y space-right2'>
<span class="strong">94.2% </span>
<span class="strong">94.21% </span>
<span class="quiet">Lines</span>
<span class='fraction'>715/759</span>
<span class='fraction'>716/760</span>
</div>


Expand Down Expand Up @@ -115,8 +115,8 @@ <h1>All files</h1>
</td>
<td data-value="97.27" class="pct high">97.27%</td>
<td data-value="147" class="abs high">143/147</td>
<td data-value="88.4" class="pct high">88.4%</td>
<td data-value="138" class="abs high">122/138</td>
<td data-value="87.85" class="pct high">87.85%</td>
<td data-value="140" class="abs high">123/140</td>
<td data-value="89.47" class="pct high">89.47%</td>
<td data-value="19" class="abs high">17/19</td>
<td data-value="97.22" class="pct high">97.22%</td>
Expand All @@ -140,17 +140,17 @@ <h1>All files</h1>

<tr>
<td class="file high" data-value="src/section"><a href="src/section/index.html">src/section</a></td>
<td data-value="95.83" class="pic high">
<td data-value="95.87" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="95.83" class="pct high">95.83%</td>
<td data-value="96" class="abs high">92/96</td>
<td data-value="63.49" class="pct medium">63.49%</td>
<td data-value="63" class="abs medium">40/63</td>
<td data-value="95.87" class="pct high">95.87%</td>
<td data-value="97" class="abs high">93/97</td>
<td data-value="64.51" class="pct medium">64.51%</td>
<td data-value="62" class="abs medium">40/62</td>
<td data-value="90.9" class="pct high">90.9%</td>
<td data-value="11" class="abs high">10/11</td>
<td data-value="96.59" class="pct high">96.59%</td>
<td data-value="88" class="abs high">85/88</td>
<td data-value="96.62" class="pct high">96.62%</td>
<td data-value="89" class="abs high">86/89</td>
</tr>

<tr>
Expand Down Expand Up @@ -236,7 +236,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
47 changes: 43 additions & 4 deletions lcov-report/src/Container.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,22 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> Contain
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -111,6 +126,17 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> Contain
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">67x</span>
<span class="cline-any cline-yes">67x</span>
<span class="cline-any cline-yes">67x</span>
Expand Down Expand Up @@ -142,9 +168,22 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> Contain
level?: number;
value?: T;
initialValue?: T;
/** Index of the parent `keyName` */
keys?: (string | number)[];
}
export const Container = forwardRef(&lt;T extends object&gt;(props: ContainerProps&lt;T&gt;, ref: React.Ref&lt;HTMLDivElement&gt;) =&gt; {
const { className = '', children, parentValue, keyid, level = 1, value, initialValue, keyName, ...elmProps } = props;
const {
className = '',
children,
parentValue,
keyid,
level = 1,
value,
initialValue,
keys,
keyName,
...elmProps
} = props;
const dispatch = useShowToolsDispatch();
const subkeyid = useId();
const defaultClassNames = [className, 'w-rjv-inner'].filter(Boolean).join(' ');
Expand All @@ -155,7 +194,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> Contain
return (
&lt;div className={defaultClassNames} ref={ref} {...elmProps} {...reset}&gt;
&lt;NestedOpen expandKey={subkeyid} value={value} level={level} keyName={keyName} initialValue={initialValue} /&gt;
&lt;KeyValues expandKey={subkeyid} value={value} level={level} /&gt;
&lt;KeyValues expandKey={subkeyid} value={value} level={level} keys={keys} /&gt;
&lt;NestedClose expandKey={subkeyid} value={value} level={level} /&gt;
&lt;/div&gt;
);
Expand All @@ -169,7 +208,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> Contain
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/arrow/TriangleArrow.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/arrow</a
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/arrow/TriangleSolidArrow.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/arrow</a
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/arrow/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1><a href="../../index.html">All files</a> src/arrow</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/comps/Copied.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/comps</a
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-02-24T21:20:57.955Z
at 2024-02-24T22:55:48.604Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit c547e2f

Please sign in to comment.