@uiw/react-json-view 2.0.0-alpha.3 → 2.0.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -38
- package/basic.d.ts +3 -0
- package/cjs/Container.d.ts +2 -0
- package/cjs/Container.js +13 -6
- package/cjs/arrow/TriangleArrow.js +1 -1
- package/cjs/comps/Copied.d.ts +2 -4
- package/cjs/comps/Copied.js +50 -17
- package/cjs/comps/KeyValues.d.ts +2 -4
- package/cjs/comps/KeyValues.js +62 -27
- package/cjs/comps/NestedClose.d.ts +1 -0
- package/cjs/comps/NestedClose.js +15 -5
- package/cjs/comps/NestedOpen.d.ts +2 -3
- package/cjs/comps/NestedOpen.js +34 -14
- package/cjs/comps/Value.d.ts +1 -2
- package/cjs/comps/Value.js +4 -8
- package/cjs/comps/useIdCompat.d.ts +1 -0
- package/cjs/comps/useIdCompat.js +14 -0
- package/cjs/editor/KeyName.d.ts +2 -0
- package/cjs/editor/KeyName.js +82 -0
- package/cjs/editor/index.d.ts +18 -0
- package/cjs/editor/index.js +44 -0
- package/cjs/editor/store.d.ts +27 -0
- package/cjs/editor/store.js +23 -0
- package/cjs/index.d.ts +12 -3
- package/cjs/index.js +11 -4
- package/cjs/section/Copied.d.ts +1 -1
- package/cjs/section/Copied.js +1 -2
- package/cjs/section/CountInfo.d.ts +1 -2
- package/cjs/section/CountInfo.js +3 -5
- package/cjs/section/CountInfoExtra.d.ts +1 -2
- package/cjs/section/CountInfoExtra.js +2 -4
- package/cjs/section/Ellipsis.d.ts +0 -1
- package/cjs/section/Ellipsis.js +4 -5
- package/cjs/section/KeyName.d.ts +7 -6
- package/cjs/section/KeyName.js +8 -6
- package/cjs/section/Row.d.ts +13 -0
- package/cjs/section/Row.js +51 -0
- package/cjs/store/Expands.js +2 -4
- package/cjs/store/Section.d.ts +12 -6
- package/cjs/store/Section.js +6 -4
- package/cjs/store/ShowTools.js +2 -4
- package/cjs/store/Symbols.d.ts +10 -3
- package/cjs/store/Symbols.js +2 -4
- package/cjs/store/Types.d.ts +29 -25
- package/cjs/store/Types.js +8 -8
- package/cjs/store.d.ts +9 -4
- package/cjs/store.js +5 -10
- package/cjs/symbol/Arrow.d.ts +1 -1
- package/cjs/symbol/Arrow.js +1 -2
- package/cjs/symbol/BraceLeft.d.ts +1 -1
- package/cjs/symbol/BraceLeft.js +1 -2
- package/cjs/symbol/BraceRight.d.ts +1 -1
- package/cjs/symbol/BraceRight.js +1 -2
- package/cjs/symbol/BracketsLeft.d.ts +1 -1
- package/cjs/symbol/BracketsLeft.js +1 -2
- package/cjs/symbol/BracketsRight.d.ts +1 -1
- package/cjs/symbol/BracketsRight.js +1 -2
- package/cjs/symbol/Colon.d.ts +1 -1
- package/cjs/symbol/Colon.js +1 -2
- package/cjs/symbol/Quote.d.ts +1 -1
- package/cjs/symbol/Quote.js +1 -2
- package/cjs/symbol/ValueQuote.d.ts +1 -1
- package/cjs/symbol/ValueQuote.js +1 -2
- package/cjs/symbol/index.d.ts +11 -16
- package/cjs/symbol/index.js +75 -30
- package/cjs/theme/basic.d.ts +1 -2
- package/cjs/theme/basic.js +4 -3
- package/cjs/theme/dark.d.ts +1 -2
- package/cjs/theme/dark.js +2 -3
- package/cjs/theme/github.dark.d.ts +1 -2
- package/cjs/theme/github.dark.js +2 -3
- package/cjs/theme/github.light.d.ts +1 -2
- package/cjs/theme/github.light.js +2 -3
- package/cjs/theme/gruvbox.d.ts +1 -2
- package/cjs/theme/gruvbox.js +2 -3
- package/cjs/theme/light.d.ts +1 -2
- package/cjs/theme/light.js +2 -3
- package/cjs/theme/monokai.d.ts +1 -2
- package/cjs/theme/monokai.js +2 -3
- package/cjs/theme/nord.d.ts +1 -2
- package/cjs/theme/nord.js +2 -3
- package/cjs/theme/vscode.d.ts +1 -2
- package/cjs/theme/vscode.js +2 -3
- package/cjs/types/Bigint.d.ts +1 -1
- package/cjs/types/Bigint.js +1 -2
- package/cjs/types/Date.d.ts +1 -1
- package/cjs/types/Date.js +1 -2
- package/cjs/types/False.d.ts +1 -1
- package/cjs/types/False.js +1 -2
- package/cjs/types/Float.d.ts +1 -1
- package/cjs/types/Float.js +1 -2
- package/cjs/types/Int.d.ts +1 -1
- package/cjs/types/Int.js +1 -2
- package/cjs/types/Map.d.ts +1 -1
- package/cjs/types/Map.js +1 -2
- package/cjs/types/Nan.d.ts +1 -1
- package/cjs/types/Nan.js +1 -2
- package/cjs/types/Null.d.ts +1 -1
- package/cjs/types/Null.js +1 -2
- package/cjs/types/Set.d.ts +1 -1
- package/cjs/types/Set.js +1 -2
- package/cjs/types/String.d.ts +1 -1
- package/cjs/types/String.js +1 -2
- package/cjs/types/True.d.ts +1 -1
- package/cjs/types/True.js +1 -2
- package/cjs/types/Undefined.d.ts +1 -1
- package/cjs/types/Undefined.js +1 -2
- package/cjs/types/Url.d.ts +1 -1
- package/cjs/types/Url.js +1 -2
- package/cjs/types/index.d.ts +3 -1
- package/cjs/types/index.js +102 -127
- package/cjs/utils/useHighlight.d.ts +0 -1
- package/cjs/utils/useRender.d.ts +1 -1
- package/editor.d.ts +22 -20
- package/esm/Container.d.ts +2 -0
- package/esm/Container.js +15 -7
- package/esm/arrow/TriangleArrow.js +1 -1
- package/esm/comps/Copied.d.ts +2 -4
- package/esm/comps/Copied.js +48 -16
- package/esm/comps/KeyValues.d.ts +2 -4
- package/esm/comps/KeyValues.js +53 -21
- package/esm/comps/NestedClose.d.ts +1 -0
- package/esm/comps/NestedClose.js +13 -3
- package/esm/comps/NestedOpen.d.ts +2 -3
- package/esm/comps/NestedOpen.js +33 -14
- package/esm/comps/Value.d.ts +1 -2
- package/esm/comps/Value.js +2 -4
- package/esm/comps/useIdCompat.d.ts +1 -0
- package/esm/comps/useIdCompat.js +8 -0
- package/esm/editor/KeyName.d.ts +2 -0
- package/esm/editor/KeyName.js +77 -0
- package/esm/editor/index.d.ts +18 -0
- package/esm/editor/index.js +33 -0
- package/esm/editor/store.d.ts +27 -0
- package/esm/editor/store.js +13 -0
- package/esm/index.d.ts +12 -3
- package/esm/index.js +12 -5
- package/esm/section/Copied.d.ts +1 -1
- package/esm/section/CountInfo.d.ts +1 -2
- package/esm/section/CountInfo.js +1 -1
- package/esm/section/CountInfoExtra.d.ts +1 -2
- package/esm/section/Ellipsis.d.ts +0 -1
- package/esm/section/Ellipsis.js +1 -1
- package/esm/section/KeyName.d.ts +7 -6
- package/esm/section/KeyName.js +6 -2
- package/esm/section/Row.d.ts +13 -0
- package/esm/section/Row.js +47 -0
- package/esm/store/Section.d.ts +12 -6
- package/esm/store/Section.js +4 -0
- package/esm/store/Symbols.d.ts +10 -3
- package/esm/store/Types.d.ts +29 -25
- package/esm/store/Types.js +6 -4
- package/esm/store.d.ts +9 -4
- package/esm/symbol/Arrow.d.ts +1 -1
- package/esm/symbol/BraceLeft.d.ts +1 -1
- package/esm/symbol/BraceRight.d.ts +1 -1
- package/esm/symbol/BracketsLeft.d.ts +1 -1
- package/esm/symbol/BracketsRight.d.ts +1 -1
- package/esm/symbol/Colon.d.ts +1 -1
- package/esm/symbol/Quote.d.ts +1 -1
- package/esm/symbol/ValueQuote.d.ts +1 -1
- package/esm/symbol/index.d.ts +11 -16
- package/esm/symbol/index.js +76 -23
- package/esm/theme/basic.d.ts +1 -2
- package/esm/theme/basic.js +2 -0
- package/esm/theme/dark.d.ts +1 -2
- package/esm/theme/github.dark.d.ts +1 -2
- package/esm/theme/github.light.d.ts +1 -2
- package/esm/theme/gruvbox.d.ts +1 -2
- package/esm/theme/light.d.ts +1 -2
- package/esm/theme/monokai.d.ts +1 -2
- package/esm/theme/nord.d.ts +1 -2
- package/esm/theme/vscode.d.ts +1 -2
- package/esm/types/Bigint.d.ts +1 -1
- package/esm/types/Date.d.ts +1 -1
- package/esm/types/False.d.ts +1 -1
- package/esm/types/Float.d.ts +1 -1
- package/esm/types/Int.d.ts +1 -1
- package/esm/types/Map.d.ts +1 -1
- package/esm/types/Nan.d.ts +1 -1
- package/esm/types/Null.d.ts +1 -1
- package/esm/types/Set.d.ts +1 -1
- package/esm/types/String.d.ts +1 -1
- package/esm/types/True.d.ts +1 -1
- package/esm/types/Undefined.d.ts +1 -1
- package/esm/types/Url.d.ts +1 -1
- package/esm/types/index.d.ts +3 -1
- package/esm/types/index.js +87 -103
- package/esm/utils/useHighlight.d.ts +0 -1
- package/esm/utils/useRender.d.ts +1 -1
- package/githubDark.d.ts +3 -0
- package/githubLight.d.ts +3 -0
- package/gruvbox.d.ts +3 -0
- package/monokai.d.ts +3 -0
- package/nord.d.ts +3 -0
- package/package.json +11 -5
- package/vscode.d.ts +3 -0
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
react-json-view
|
|
2
2
|
===
|
|
3
3
|
|
|
4
|
+
[](https://jaywcjlove.github.io/#/sponsor)
|
|
4
5
|
[](https://github.com/uiwjs/react-json-view/actions/workflows/ci.yml)
|
|
5
6
|
[](https://www.npmjs.com/package/@uiw/react-json-view)
|
|
6
7
|
[](https://www.npmjs.com/package/@uiw/react-json-view)
|
|
@@ -18,20 +19,19 @@ A React component for displaying and editing javascript arrays and JSON objects.
|
|
|
18
19
|
|
|
19
20
|
## Features
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
🎨
|
|
23
|
-
🌒
|
|
24
|
-
📦 Zero
|
|
25
|
-
📋
|
|
26
|
-
✏️
|
|
27
|
-
♻️
|
|
22
|
+
🚀 **Improved with TypeScript** – Better code hints for a smoother development experience.
|
|
23
|
+
🎨 **Customizable Themes** – Supports theme customization & [`online editing`](https://uiwjs.github.io/react-json-view/#online-editing-theme).
|
|
24
|
+
🌒 **Dark/Light Mode** – Seamless switching between themes.
|
|
25
|
+
📦 **Zero Dependencies** – Lightweight and efficient.
|
|
26
|
+
📋 **Clipboard Support** – Easily copy JSON data.
|
|
27
|
+
✏️ **Editable & Extendable** – Supports editing and adding new properties.
|
|
28
|
+
♻️ **Update Highlighting** – Option to highlight changes.
|
|
28
29
|
|
|
29
|
-
The
|
|
30
|
-
|
|
31
|
-
- [x] Complete all features of displaying JSON in v1.
|
|
32
|
-
- [ ] Add editing functionality to v2.
|
|
33
|
-
- [x] Add test cases to v2.
|
|
30
|
+
The latest version [**v2**](https://uiwjs.github.io/react-json-view/) features a redesigned API for better maintainability, a more flexible component customization system, and fully customizable rendering, making it more aligned with React’s component model. 📖 Check out the [v2 documentation](https://uiwjs.github.io/react-json-view/) and [examples](https://uiwjs.github.io/react-json-view/).
|
|
34
31
|
|
|
32
|
+
- [x] Fully implemented all v1 JSON display features.
|
|
33
|
+
- [ ] Adding editing functionality to v2.
|
|
34
|
+
- [x] Added comprehensive test cases for v2.
|
|
35
35
|
|
|
36
36
|
## Quick Start
|
|
37
37
|
|
|
@@ -126,7 +126,6 @@ export default function Demo() {
|
|
|
126
126
|
}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
|
|
130
129
|
Example of custom `vscode` theme styles:
|
|
131
130
|
|
|
132
131
|
```tsx mdx:preview
|
|
@@ -146,6 +145,7 @@ const object = {
|
|
|
146
145
|
const customTheme = {
|
|
147
146
|
'--w-rjv-font-family': 'monospace',
|
|
148
147
|
'--w-rjv-color': '#9cdcfe',
|
|
148
|
+
'--w-rjv-key-number': '#268bd2',
|
|
149
149
|
'--w-rjv-key-string': '#9cdcfe',
|
|
150
150
|
'--w-rjv-background-color': '#1e1e1e',
|
|
151
151
|
'--w-rjv-line-color': '#36334280',
|
|
@@ -159,6 +159,7 @@ const customTheme = {
|
|
|
159
159
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
160
160
|
'--w-rjv-colon-color': '#d4d4d4',
|
|
161
161
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
162
|
+
'--w-rjv-ellipsis-color': '#cb4b16',
|
|
162
163
|
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
163
164
|
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
164
165
|
|
|
@@ -216,6 +217,7 @@ const object = {
|
|
|
216
217
|
}
|
|
217
218
|
const customTheme = {
|
|
218
219
|
'--w-rjv-color': '#9cdcfe',
|
|
220
|
+
'--w-rjv-key-number': '#268bd2',
|
|
219
221
|
'--w-rjv-key-string': '#9cdcfe',
|
|
220
222
|
'--w-rjv-background-color': '#1e1e1e',
|
|
221
223
|
'--w-rjv-line-color': '#36334280',
|
|
@@ -229,6 +231,7 @@ const customTheme = {
|
|
|
229
231
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
230
232
|
'--w-rjv-colon-color': '#d4d4d4',
|
|
231
233
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
234
|
+
'--w-rjv-ellipsis-color': '#cb4b16',
|
|
232
235
|
'--w-rjv-quotes-color': '#9cdcfe',
|
|
233
236
|
'--w-rjv-quotes-string-color': '#ce9178',
|
|
234
237
|
|
|
@@ -278,21 +281,31 @@ export default function Demo() {
|
|
|
278
281
|
/>
|
|
279
282
|
<div>
|
|
280
283
|
<Colorful color={hex} onChange={onChange} />
|
|
281
|
-
<div style={{ display: 'flex', gap: '0.4rem', flexDirection: 'column' }}>
|
|
284
|
+
<div style={{ display: 'flex', gap: '0.4rem', flexDirection: 'column', ...customTheme }}>
|
|
282
285
|
{Object.keys(customTheme).map((varname, idx) => {
|
|
283
286
|
const click = () => {
|
|
284
287
|
setCssvar(varname);
|
|
285
288
|
setHex(customTheme[varname]);
|
|
286
289
|
};
|
|
287
290
|
const active = cssvar === varname ? '#a8a8a8' : '';
|
|
288
|
-
return
|
|
291
|
+
return (
|
|
292
|
+
<button key={idx}
|
|
293
|
+
style={{ background: active, border: 0,boxShadow: 'inset 0px 0px 1px #000', display: 'flex', alignItems: 'center', gap: 5, padding: '1px 3px' }}
|
|
294
|
+
onClick={click}
|
|
295
|
+
>
|
|
296
|
+
<span style={{ display: 'inline-block', width: 12, height: 12, background: `var(${varname})` }}></span>
|
|
297
|
+
{varname}
|
|
298
|
+
</button>
|
|
299
|
+
)
|
|
289
300
|
})}
|
|
290
301
|
</div>
|
|
291
302
|
</div>
|
|
292
303
|
</div>
|
|
293
|
-
<
|
|
304
|
+
<div>
|
|
294
305
|
Copy the theme configuration below into your project.
|
|
295
|
-
|
|
306
|
+
</div>
|
|
307
|
+
<pre style={{ padding: 10 }}>
|
|
308
|
+
{JSON.stringify(theme, null, 2)}
|
|
296
309
|
</pre>
|
|
297
310
|
</React.Fragment>
|
|
298
311
|
);
|
|
@@ -324,13 +337,13 @@ export default function Demo() {
|
|
|
324
337
|
}}
|
|
325
338
|
>
|
|
326
339
|
<JsonView.String
|
|
327
|
-
render={({ children, ...reset }, { type }) => {
|
|
328
|
-
const isImg = /^https?.*\.(jpg|png)$/i.test(
|
|
340
|
+
render={({ children, ...reset }, { type, value, keyName }) => {
|
|
341
|
+
const isImg = /^https?.*\.(jpg|png)$/i.test(value)
|
|
329
342
|
if (type === 'type' && isImg) {
|
|
330
343
|
return <span />
|
|
331
344
|
}
|
|
332
345
|
if (type === 'value' && isImg) {
|
|
333
|
-
return <img {...reset} height="26" src={
|
|
346
|
+
return <img {...reset} height="26" src={value} />
|
|
334
347
|
}
|
|
335
348
|
}}
|
|
336
349
|
/>
|
|
@@ -362,7 +375,7 @@ export default function Demo() {
|
|
|
362
375
|
}
|
|
363
376
|
```
|
|
364
377
|
|
|
365
|
-
Supports certain partial customizations such as: `<Copied />`, `<CountInfo />`, `<CountInfoExtra />`, `<Ellipsis />`, `<KeyName />`
|
|
378
|
+
Supports certain partial customizations such as: `<Copied />`, `<CountInfo />`, `<CountInfoExtra />`, `<Ellipsis />`, `<KeyName />`, `<Row />`
|
|
366
379
|
|
|
367
380
|
```tsx mdx:preview
|
|
368
381
|
import React, { Fragment } from 'react';
|
|
@@ -415,6 +428,59 @@ export default function Demo() {
|
|
|
415
428
|
}
|
|
416
429
|
```
|
|
417
430
|
|
|
431
|
+
More in-depth customization ([#19](https://github.com/uiwjs/react-json-view/issues/19))
|
|
432
|
+
|
|
433
|
+
```tsx mdx:preview
|
|
434
|
+
import React from 'react';
|
|
435
|
+
import JsonView from '@uiw/react-json-view';
|
|
436
|
+
|
|
437
|
+
const object = {
|
|
438
|
+
_id: "ObjectId('13212hakjdhajksd')",
|
|
439
|
+
uid: "test1",
|
|
440
|
+
attival_time: new Date('Tue Sep 13 2022 14:07:44 GMT-0500 (Central Daylight Time)'),
|
|
441
|
+
__v: 0
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export default function Demo() {
|
|
445
|
+
return (
|
|
446
|
+
<JsonView
|
|
447
|
+
value={object}
|
|
448
|
+
// keyName="root"
|
|
449
|
+
displayObjectSize={false}
|
|
450
|
+
style={{
|
|
451
|
+
'--w-rjv-background-color': '#ffffff',
|
|
452
|
+
}}
|
|
453
|
+
>
|
|
454
|
+
<JsonView.Quote render={() => <span />}/>
|
|
455
|
+
<JsonView.String
|
|
456
|
+
render={({ children, ...reset }, { type, value, keyName }) => {
|
|
457
|
+
if (type === 'type') {
|
|
458
|
+
return <span />
|
|
459
|
+
}
|
|
460
|
+
if (type === 'value' && /ObjectId\(['"](.*?)['"]\)/.test(value)) {
|
|
461
|
+
return <span {...reset}>{children}</span>
|
|
462
|
+
}
|
|
463
|
+
}}
|
|
464
|
+
/>
|
|
465
|
+
<JsonView.Date
|
|
466
|
+
render={({ children, ...reset }, { type, value, keyName }) => {
|
|
467
|
+
if (type === 'type') {
|
|
468
|
+
return <span />
|
|
469
|
+
}
|
|
470
|
+
}}
|
|
471
|
+
/>
|
|
472
|
+
<JsonView.Int
|
|
473
|
+
render={({ children, ...reset }, { type, value, keyName }) => {
|
|
474
|
+
if (type === 'type') {
|
|
475
|
+
return <span />
|
|
476
|
+
}
|
|
477
|
+
}}
|
|
478
|
+
/>
|
|
479
|
+
</JsonView>
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
418
484
|
Inspector
|
|
419
485
|
|
|
420
486
|
```tsx mdx:preview
|
|
@@ -526,6 +592,52 @@ Passing **as="tagName"** will automatically infer the type.
|
|
|
526
592
|
/>
|
|
527
593
|
```
|
|
528
594
|
|
|
595
|
+
Add a click event on the data row
|
|
596
|
+
|
|
597
|
+
```tsx mdx:preview
|
|
598
|
+
import React from 'react';
|
|
599
|
+
import JsonView from '@uiw/react-json-view';
|
|
600
|
+
|
|
601
|
+
export default function Demo() {
|
|
602
|
+
return (
|
|
603
|
+
<JsonView
|
|
604
|
+
style={{
|
|
605
|
+
'--w-rjv-background-color': '#ffffff',
|
|
606
|
+
}}
|
|
607
|
+
value={{
|
|
608
|
+
name: 'John',
|
|
609
|
+
age: 30,
|
|
610
|
+
hobbies: ['reading', 'coding', 'swimming'],
|
|
611
|
+
address: {
|
|
612
|
+
street: '123 Main St',
|
|
613
|
+
city: 'New York',
|
|
614
|
+
country: {
|
|
615
|
+
name: 'Main ',
|
|
616
|
+
codex: '123'
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}}
|
|
620
|
+
>
|
|
621
|
+
<JsonView.Row
|
|
622
|
+
as="div"
|
|
623
|
+
render={(props, { keyName, value, parentValue }) => {
|
|
624
|
+
return (
|
|
625
|
+
<div
|
|
626
|
+
{...props}
|
|
627
|
+
onClick={() => {
|
|
628
|
+
console.log("keyName", keyName)
|
|
629
|
+
console.log("value", value)
|
|
630
|
+
console.log("parentValue", parentValue)
|
|
631
|
+
}}
|
|
632
|
+
/>
|
|
633
|
+
)
|
|
634
|
+
}}
|
|
635
|
+
/>
|
|
636
|
+
</JsonView>
|
|
637
|
+
)
|
|
638
|
+
}
|
|
639
|
+
```
|
|
640
|
+
|
|
529
641
|
## Highlight Updates
|
|
530
642
|
|
|
531
643
|
```tsx mdx:preview
|
|
@@ -568,6 +680,74 @@ export default function Demo() {
|
|
|
568
680
|
|
|
569
681
|
This feature can be disabled with `highlightUpdates={false}`, and the default color can be changed with `--w-rjv-update-color`.
|
|
570
682
|
|
|
683
|
+
## Do not display array index
|
|
684
|
+
|
|
685
|
+
```tsx mdx:preview
|
|
686
|
+
import React, { Fragment } from 'react';
|
|
687
|
+
import JsonView from '@uiw/react-json-view';
|
|
688
|
+
|
|
689
|
+
export default function Demo() {
|
|
690
|
+
const value = { data: ["123", 23] }
|
|
691
|
+
return (
|
|
692
|
+
<JsonView value={value} style={{ '--w-rjv-background-color': '#ffffff' }}>
|
|
693
|
+
<JsonView.Colon render={(props, { parentValue, value, keyName }) => {
|
|
694
|
+
if (Array.isArray(parentValue) && props.children == ":") {
|
|
695
|
+
return <span />
|
|
696
|
+
}
|
|
697
|
+
return <span {...props} />
|
|
698
|
+
}}/>
|
|
699
|
+
<JsonView.KeyName
|
|
700
|
+
render={({ ...props }, { type, parentValue, value, keyName }) => {
|
|
701
|
+
if (Array.isArray(parentValue) && Number.isFinite( props.children)) {
|
|
702
|
+
return <span />
|
|
703
|
+
}
|
|
704
|
+
return <span {...props} />
|
|
705
|
+
}}
|
|
706
|
+
/>
|
|
707
|
+
</JsonView>
|
|
708
|
+
)
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
## Default Collapse/Expand
|
|
713
|
+
|
|
714
|
+
```tsx mdx:preview
|
|
715
|
+
import React from 'react';
|
|
716
|
+
import JsonView from '@uiw/react-json-view';
|
|
717
|
+
const object = {
|
|
718
|
+
string: 'Lorem ipsum dolor sit amet',
|
|
719
|
+
integer: 42,
|
|
720
|
+
float: 114.514,
|
|
721
|
+
object: {
|
|
722
|
+
'first-child': true,
|
|
723
|
+
'second-child': false,
|
|
724
|
+
'last-child': null,
|
|
725
|
+
},
|
|
726
|
+
nestedArray: [
|
|
727
|
+
[1, 2],
|
|
728
|
+
[3, 4],
|
|
729
|
+
],
|
|
730
|
+
}
|
|
731
|
+
export default function Demo() {
|
|
732
|
+
return (
|
|
733
|
+
<JsonView
|
|
734
|
+
value={object}
|
|
735
|
+
collapsed={2}
|
|
736
|
+
shouldExpandNodeInitially={(isExpanded, { value, keys, level }) => {
|
|
737
|
+
if (keys.length > 0 && keys[0] == "object") {
|
|
738
|
+
return true
|
|
739
|
+
}
|
|
740
|
+
return isExpanded
|
|
741
|
+
}}
|
|
742
|
+
style={{
|
|
743
|
+
'--w-rjv-background-color': '#ffffff',
|
|
744
|
+
}}
|
|
745
|
+
>
|
|
746
|
+
</JsonView>
|
|
747
|
+
)
|
|
748
|
+
}
|
|
749
|
+
```
|
|
750
|
+
|
|
571
751
|
## Modify Icon Style
|
|
572
752
|
|
|
573
753
|
Use built-in default icons.
|
|
@@ -687,7 +867,7 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
687
867
|
/** Define the root node name. @default undefined */
|
|
688
868
|
keyName?: string | number;
|
|
689
869
|
/** Whether sort keys through `String.prototype.localeCompare()` @default false */
|
|
690
|
-
objectSortKeys?: boolean | ((
|
|
870
|
+
objectSortKeys?: boolean | ((keyA: string, keyB: string, valueA: T, valueB: T) => number);
|
|
691
871
|
/** Set the indent-width for nested objects @default 15 */
|
|
692
872
|
indentWidth?: number;
|
|
693
873
|
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
|
|
@@ -696,15 +876,21 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
696
876
|
displayDataTypes?: boolean;
|
|
697
877
|
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
|
|
698
878
|
enableClipboard?: boolean;
|
|
879
|
+
/** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. @default false */
|
|
880
|
+
collapsed?: boolean | number;
|
|
881
|
+
/** Determine whether the node should be expanded on the first render, or you can use collapsed to control the level of expansion (by default, the root is expanded). */
|
|
882
|
+
shouldExpandNodeInitially?: (
|
|
883
|
+
isExpanded: boolean,
|
|
884
|
+
props: { value?: T; keys: (number | string)[]; level: number },
|
|
885
|
+
) => boolean;
|
|
699
886
|
/** Whether to highlight updates. @default true */
|
|
700
887
|
highlightUpdates?: boolean;
|
|
888
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
889
|
+
shortenTextAfterLength?: number;
|
|
890
|
+
/** When the text exceeds the length, `...` will be displayed. Currently, this `...` can be customized. @default "..." */
|
|
891
|
+
stringEllipsis?: number;
|
|
701
892
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
702
|
-
onExpand?: (props: {
|
|
703
|
-
expand: boolean;
|
|
704
|
-
value?: T;
|
|
705
|
-
keyid: string;
|
|
706
|
-
keyName?: string | number;
|
|
707
|
-
}) => void;
|
|
893
|
+
onExpand?: (props: { expand: boolean; value?: T; keyid: string; keyName?: string | number }) => void;
|
|
708
894
|
/** Fires event when you copy */
|
|
709
895
|
onCopied?: (text: string, value?: T) => void;
|
|
710
896
|
}
|
|
@@ -719,6 +905,7 @@ import { Arrow } from './symbol/Arrow';
|
|
|
719
905
|
import { Colon } from './symbol/Colon';
|
|
720
906
|
import { Quote } from './symbol/Quote';
|
|
721
907
|
import { ValueQuote } from './symbol/ValueQuote';
|
|
908
|
+
|
|
722
909
|
import { Bigint } from './types/Bigint';
|
|
723
910
|
import { Date } from './types/Date';
|
|
724
911
|
import { False } from './types/False';
|
|
@@ -732,13 +919,24 @@ import { StringText } from './types/String';
|
|
|
732
919
|
import { True } from './types/True';
|
|
733
920
|
import { Undefined } from './types/Undefined';
|
|
734
921
|
import { Url } from './types/Url';
|
|
922
|
+
|
|
735
923
|
import { Copied } from './section/Copied';
|
|
736
924
|
import { CountInfo } from './section/CountInfo';
|
|
737
925
|
import { CountInfoExtra } from './section/CountInfoExtra';
|
|
738
926
|
import { Ellipsis } from './section/Ellipsis';
|
|
739
927
|
import { KeyName } from './section/KeyName';
|
|
928
|
+
import { Row } from './section/Row';
|
|
740
929
|
|
|
741
930
|
type JsonViewComponent = React.FC<React.PropsWithRef<JsonViewProps<object>>> & {
|
|
931
|
+
BraceLeft: typeof BraceLeft;
|
|
932
|
+
BraceRight: typeof BraceRight;
|
|
933
|
+
BracketsLeft: typeof BracketsLeft;
|
|
934
|
+
BracketsRight: typeof BracketsRight;
|
|
935
|
+
Arrow: typeof Arrow;
|
|
936
|
+
Colon: typeof Colon;
|
|
937
|
+
Quote: typeof Quote;
|
|
938
|
+
ValueQuote: typeof ValueQuote;
|
|
939
|
+
|
|
742
940
|
Bigint: typeof Bigint;
|
|
743
941
|
Date: typeof Date;
|
|
744
942
|
False: typeof False;
|
|
@@ -752,19 +950,13 @@ type JsonViewComponent = React.FC<React.PropsWithRef<JsonViewProps<object>>> & {
|
|
|
752
950
|
True: typeof True;
|
|
753
951
|
Undefined: typeof Undefined;
|
|
754
952
|
Url: typeof Url;
|
|
755
|
-
|
|
756
|
-
BraceRight: typeof BraceRight;
|
|
757
|
-
BracketsLeft: typeof BracketsLeft;
|
|
758
|
-
BracketsRight: typeof BracketsRight;
|
|
759
|
-
Colon: typeof Colon;
|
|
760
|
-
Ellipsis: typeof Ellipsis;
|
|
761
|
-
Quote: typeof Quote;
|
|
762
|
-
ValueQuote: typeof ValueQuote;
|
|
763
|
-
Arrow: typeof Arrow;
|
|
953
|
+
|
|
764
954
|
Copied: typeof Copied;
|
|
765
955
|
CountInfo: typeof CountInfo;
|
|
766
956
|
CountInfoExtra: typeof CountInfoExtra;
|
|
957
|
+
Ellipsis: typeof Ellipsis;
|
|
767
958
|
KeyName: typeof KeyName;
|
|
959
|
+
Row: typeof Row;
|
|
768
960
|
};
|
|
769
961
|
declare const JsonView: JsonViewComponent;
|
|
770
962
|
export default JsonView;
|
|
@@ -786,7 +978,7 @@ Here is the size benchmark (using [bundlephobia.com](https://bundlephobia.com))
|
|
|
786
978
|
| [react-domify](https://github.com/JedWatson/react-domify) | [](https://bundlephobia.com/result?p=react-domify) [](https://bundlephobia.com/result?p=react-domify) | [](https://bundlephobia.com/result?p=react-domify) | [](https://github.com/JedWatson/react-domify/commits) | [](https://www.npmjs.com/package/react-domify) | ❌ | [demo](https://jedwatson.github.io/react-domify/) |
|
|
787
979
|
| [react18-json-view](https://github.com/YYsuni/react18-json-view) | [](https://bundlephobia.com/result?p=react18-json-view) [](https://bundlephobia.com/result?p=react18-json-view) | [](https://bundlephobia.com/result?p=react18-json-view) | [](https://github.com/YYsuni/react18-json-view/commits) | [](https://www.npmjs.com/package/react18-json-view) | ❌ | [demo](https://jv.yysuni.com/) |
|
|
788
980
|
| [@textea/json-viewer](https://github.com/TexteaInc/json-viewer) | [](https://bundlephobia.com/result?p=@textea/json-viewer) [](https://bundlephobia.com/result?p=@textea/json-viewer) | [](https://bundlephobia.com/result?p=@textea/json-viewer) | [](https://github.com/TexteaInc/json-viewer/commits) | [](https://www.npmjs.com/package/@textea/json-viewer) | ✅ | [demo](https://stackblitz.com/edit/textea-json-viewer-v3-b4wgxq) |
|
|
789
|
-
| [react-editable-json-tree](https://github.com/oxyno-zeta/react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) | [ | [](https://bundlephobia.com/result?p=react-editable-json-tree) [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://bundlephobia.com/result?p=react-editable-json-tree) | [](https://github.com/oxyno-zeta/react-editable-json-tree/commits) | [](https://www.npmjs.com/package/react-editable-json-tree) | ✅ | [demo](https://oxyno-zeta.github.io/react-editable-json-tree/) |
|
|
790
982
|
| [react-json-view](https://github.com/HuolalaTech/react-json-view) | [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [](https://github.com/HuolalaTech/react-json-view/commits) | [](https://www.npmjs.com/package/@huolala-tech/react-json-view) | ❌ | [demo](https://huolalatech.github.io/react-json-view/) |
|
|
791
983
|
|
|
792
984
|
## Development
|
package/basic.d.ts
ADDED
package/cjs/Container.d.ts
CHANGED
|
@@ -6,5 +6,7 @@ export interface ContainerProps<T extends object> extends React.HTMLAttributes<H
|
|
|
6
6
|
level?: number;
|
|
7
7
|
value?: T;
|
|
8
8
|
initialValue?: T;
|
|
9
|
+
/** Index of the parent `keyName` */
|
|
10
|
+
keys?: (string | number)[];
|
|
9
11
|
}
|
|
10
12
|
export declare const Container: React.ForwardRefExoticComponent<ContainerProps<object> & React.RefAttributes<HTMLDivElement>>;
|
package/cjs/Container.js
CHANGED
|
@@ -13,10 +13,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _NestedClose = require("./comps/NestedClose");
|
|
14
14
|
var _NestedOpen = require("./comps/NestedOpen");
|
|
15
15
|
var _KeyValues = require("./comps/KeyValues");
|
|
16
|
+
var _useIdCompat = require("./comps/useIdCompat");
|
|
16
17
|
var _ShowTools = require("./store/ShowTools");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keyName"];
|
|
19
|
-
var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
19
|
+
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keys", "keyName"];
|
|
20
|
+
var Container = exports.Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
20
21
|
var _props$className = props.className,
|
|
21
22
|
className = _props$className === void 0 ? '' : _props$className,
|
|
22
23
|
children = props.children,
|
|
@@ -26,10 +27,11 @@ var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
26
27
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
27
28
|
value = props.value,
|
|
28
29
|
initialValue = props.initialValue,
|
|
30
|
+
keys = props.keys,
|
|
29
31
|
keyName = props.keyName,
|
|
30
32
|
elmProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
31
33
|
var dispatch = (0, _ShowTools.useShowToolsDispatch)();
|
|
32
|
-
var subkeyid = (0,
|
|
34
|
+
var subkeyid = (0, _useIdCompat.useIdCompat)();
|
|
33
35
|
var defaultClassNames = [className, 'w-rjv-inner'].filter(Boolean).join(' ');
|
|
34
36
|
var reset = {
|
|
35
37
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -47,18 +49,23 @@ var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
47
49
|
expandKey: subkeyid,
|
|
48
50
|
value: value,
|
|
49
51
|
level: level,
|
|
52
|
+
keys: keys,
|
|
53
|
+
parentValue: parentValue,
|
|
50
54
|
keyName: keyName,
|
|
51
55
|
initialValue: initialValue
|
|
52
56
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyValues.KeyValues, {
|
|
53
57
|
expandKey: subkeyid,
|
|
54
58
|
value: value,
|
|
55
|
-
level: level
|
|
59
|
+
level: level,
|
|
60
|
+
keys: keys,
|
|
61
|
+
parentValue: parentValue,
|
|
62
|
+
keyName: keyName
|
|
56
63
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_NestedClose.NestedClose, {
|
|
57
64
|
expandKey: subkeyid,
|
|
58
65
|
value: value,
|
|
59
|
-
level: level
|
|
66
|
+
level: level,
|
|
67
|
+
keys: keys
|
|
60
68
|
})]
|
|
61
69
|
}));
|
|
62
70
|
});
|
|
63
|
-
exports.Container = Container;
|
|
64
71
|
Container.displayName = 'JVR.Container';
|
|
@@ -18,7 +18,7 @@ function TriangleArrow(props) {
|
|
|
18
18
|
height: '1em',
|
|
19
19
|
width: '1em',
|
|
20
20
|
userSelect: 'none',
|
|
21
|
-
display: 'flex'
|
|
21
|
+
display: 'inline-flex'
|
|
22
22
|
}, style);
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
24
24
|
viewBox: "0 0 24 24",
|
package/cjs/comps/Copied.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { type SectionElementResult } from '../store/Section';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export type CopiedOption<T extends object> = {
|
|
4
4
|
value?: T;
|
|
5
5
|
copied: boolean;
|
|
6
6
|
setCopied: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
7
|
};
|
|
8
|
-
export interface CopiedProps<T extends object> extends React.SVGProps<SVGSVGElement> {
|
|
9
|
-
value?: T;
|
|
10
|
-
keyName: string | number;
|
|
8
|
+
export interface CopiedProps<T extends object> extends React.SVGProps<SVGSVGElement>, SectionElementResult<T> {
|
|
11
9
|
expandKey: string;
|
|
12
10
|
}
|
|
13
11
|
export declare const Copied: {
|
package/cjs/comps/Copied.js
CHANGED
|
@@ -10,15 +10,18 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _store = require("../store");
|
|
13
|
-
var _ShowTools = require("../store/ShowTools");
|
|
14
13
|
var _Section = require("../store/Section");
|
|
14
|
+
var _ShowTools = require("../store/ShowTools");
|
|
15
|
+
var _types = require("../types");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
var _excluded = ["keyName", "value", "expandKey"],
|
|
17
|
+
var _excluded = ["keyName", "value", "parentValue", "expandKey", "keys"],
|
|
17
18
|
_excluded2 = ["as", "render"];
|
|
18
|
-
var Copied = function Copied(props) {
|
|
19
|
+
var Copied = exports.Copied = function Copied(props) {
|
|
19
20
|
var keyName = props.keyName,
|
|
20
21
|
value = props.value,
|
|
22
|
+
parentValue = props.parentValue,
|
|
21
23
|
expandKey = props.expandKey,
|
|
24
|
+
keys = props.keys,
|
|
22
25
|
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
23
26
|
var _useStore = (0, _store.useStore)(),
|
|
24
27
|
onCopied = _useStore.onCopied,
|
|
@@ -35,18 +38,42 @@ var Copied = function Copied(props) {
|
|
|
35
38
|
if (enableClipboard === false || !isShowTools) return null;
|
|
36
39
|
var click = function click(event) {
|
|
37
40
|
event.stopPropagation();
|
|
38
|
-
var copyText =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
var copyText = '';
|
|
42
|
+
if (typeof value === 'number' && value === Infinity) {
|
|
43
|
+
copyText = 'Infinity';
|
|
44
|
+
} else if (typeof value === 'number' && isNaN(value)) {
|
|
45
|
+
copyText = 'NaN';
|
|
46
|
+
} else if (typeof value === 'bigint') {
|
|
47
|
+
copyText = (0, _types.bigIntToString)(value);
|
|
48
|
+
} else if (value instanceof Date) {
|
|
49
|
+
copyText = value.toLocaleString();
|
|
50
|
+
} else {
|
|
51
|
+
copyText = JSON.stringify(value, function (_, v) {
|
|
52
|
+
return typeof v === 'bigint' ? (0, _types.bigIntToString)(v) : v;
|
|
53
|
+
}, 2);
|
|
54
|
+
}
|
|
55
|
+
onCopied && onCopied(copyText, value);
|
|
56
|
+
setCopied(true);
|
|
57
|
+
var _clipboard = navigator.clipboard || {
|
|
58
|
+
writeText: function writeText(text) {
|
|
59
|
+
return new Promise(function (reslove, reject) {
|
|
60
|
+
var textarea = document.createElement('textarea');
|
|
61
|
+
textarea.style.position = 'absolute';
|
|
62
|
+
textarea.style.opacity = '0';
|
|
63
|
+
textarea.style.left = '-99999999px';
|
|
64
|
+
textarea.value = text;
|
|
65
|
+
document.body.appendChild(textarea);
|
|
66
|
+
textarea.select();
|
|
67
|
+
if (!document.execCommand('copy')) {
|
|
68
|
+
reject();
|
|
69
|
+
} else {
|
|
70
|
+
reslove();
|
|
71
|
+
}
|
|
72
|
+
textarea.remove();
|
|
73
|
+
});
|
|
41
74
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (typeof value === 'number' && value === Infinity) copyText = 'Infinity';
|
|
45
|
-
if (typeof value === 'number' && isNaN(value)) copyText = 'NaN';
|
|
46
|
-
if (typeof value === 'bigint') copyText = value + 'n';
|
|
47
|
-
navigator.clipboard.writeText(copyText).then(function () {
|
|
48
|
-
onCopied && onCopied(copyText, value);
|
|
49
|
-
setCopied(true);
|
|
75
|
+
};
|
|
76
|
+
_clipboard.writeText(copyText).then(function () {
|
|
50
77
|
var timer = setTimeout(function () {
|
|
51
78
|
setCopied(false);
|
|
52
79
|
clearTimeout(timer);
|
|
@@ -54,19 +81,26 @@ var Copied = function Copied(props) {
|
|
|
54
81
|
})["catch"](function (error) {});
|
|
55
82
|
};
|
|
56
83
|
var svgProps = {
|
|
84
|
+
style: {
|
|
85
|
+
display: 'inline-flex'
|
|
86
|
+
},
|
|
57
87
|
fill: copied ? 'var(--w-rjv-copied-success-color, #28a745)' : 'var(--w-rjv-copied-color, currentColor)',
|
|
58
88
|
onClick: click
|
|
59
89
|
};
|
|
60
90
|
var as = Comp.as,
|
|
61
91
|
render = Comp.render,
|
|
62
92
|
reset = (0, _objectWithoutProperties2["default"])(Comp, _excluded2);
|
|
63
|
-
var elmProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), other), svgProps)
|
|
93
|
+
var elmProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), other), svgProps), {}, {
|
|
94
|
+
style: (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset.style), other.style), svgProps.style)
|
|
95
|
+
});
|
|
64
96
|
var isRender = render && typeof render === 'function';
|
|
65
97
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, elmProps), {}, {
|
|
66
98
|
'data-copied': copied
|
|
67
99
|
}), {
|
|
68
100
|
value: value,
|
|
69
|
-
keyName: keyName
|
|
101
|
+
keyName: keyName,
|
|
102
|
+
keys: keys,
|
|
103
|
+
parentValue: parentValue
|
|
70
104
|
});
|
|
71
105
|
if (child) return child;
|
|
72
106
|
if (copied) {
|
|
@@ -86,5 +120,4 @@ var Copied = function Copied(props) {
|
|
|
86
120
|
})
|
|
87
121
|
}));
|
|
88
122
|
};
|
|
89
|
-
exports.Copied = Copied;
|
|
90
123
|
Copied.displayName = 'JVR.Copied';
|
package/cjs/comps/KeyValues.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value?: T;
|
|
4
|
-
parentValue?: T;
|
|
1
|
+
import { type SectionElementResult } from '../store/Section';
|
|
2
|
+
interface KeyValuesProps<T extends object> extends SectionElementResult<T> {
|
|
5
3
|
expandKey?: string;
|
|
6
4
|
level: number;
|
|
7
5
|
}
|