react-json-view-lite
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -29,3 +29,3 @@ import * as React from 'react'; | ||
export interface ExpandableRenderProps { | ||
field?: string; | ||
field: string | undefined; | ||
value: Array<any> | object; | ||
@@ -41,2 +41,9 @@ data: Array<[string | undefined, any]>; | ||
} | ||
export interface EmptyRenderProps { | ||
field: string | undefined; | ||
openBracket: string; | ||
closeBracket: string; | ||
lastElement: boolean; | ||
style: StyleProps; | ||
} | ||
export default function DataRender(props: JsonRenderProps<any>): React.JSX.Element; |
@@ -121,5 +121,26 @@ var React = require('react'); | ||
} | ||
function JsonObject(_ref2) { | ||
function EmptyObject(_ref2) { | ||
let { | ||
field, | ||
openBracket, | ||
closeBracket, | ||
lastElement, | ||
style | ||
} = _ref2; | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: style.basicChildStyle, | ||
role: 'listitem' | ||
}, field && /*#__PURE__*/React.createElement("span", { | ||
className: style.label | ||
}, field, ":"), /*#__PURE__*/React.createElement("span", { | ||
className: style.punctuation | ||
}, openBracket), /*#__PURE__*/React.createElement("span", { | ||
className: style.punctuation | ||
}, closeBracket), !lastElement && /*#__PURE__*/React.createElement("span", { | ||
className: style.punctuation | ||
}, ",")); | ||
} | ||
function JsonObject(_ref3) { | ||
let { | ||
field, | ||
value, | ||
@@ -131,3 +152,12 @@ style, | ||
level | ||
} = _ref2; | ||
} = _ref3; | ||
if (Object.keys(value).length === 0) { | ||
return EmptyObject({ | ||
field, | ||
openBracket: '{', | ||
closeBracket: '}', | ||
lastElement, | ||
style | ||
}); | ||
} | ||
return ExpandableObject({ | ||
@@ -146,3 +176,3 @@ field, | ||
} | ||
function JsonArray(_ref3) { | ||
function JsonArray(_ref4) { | ||
let { | ||
@@ -156,3 +186,12 @@ field, | ||
clickToExpandNode | ||
} = _ref3; | ||
} = _ref4; | ||
if (value.length === 0) { | ||
return EmptyObject({ | ||
field, | ||
openBracket: '[', | ||
closeBracket: ']', | ||
lastElement, | ||
style | ||
}); | ||
} | ||
return ExpandableObject({ | ||
@@ -171,3 +210,3 @@ field, | ||
} | ||
function JsonPrimitiveValue(_ref4) { | ||
function JsonPrimitiveValue(_ref5) { | ||
let { | ||
@@ -178,3 +217,3 @@ field, | ||
lastElement | ||
} = _ref4; | ||
} = _ref5; | ||
let stringValue = value; | ||
@@ -181,0 +220,0 @@ let valueStyle = style.otherValue; |
@@ -121,5 +121,26 @@ import { useState, useRef, createElement, useEffect } from 'react'; | ||
} | ||
function JsonObject(_ref2) { | ||
function EmptyObject(_ref2) { | ||
let { | ||
field, | ||
openBracket, | ||
closeBracket, | ||
lastElement, | ||
style | ||
} = _ref2; | ||
return /*#__PURE__*/createElement("div", { | ||
className: style.basicChildStyle, | ||
role: 'listitem' | ||
}, field && /*#__PURE__*/createElement("span", { | ||
className: style.label | ||
}, field, ":"), /*#__PURE__*/createElement("span", { | ||
className: style.punctuation | ||
}, openBracket), /*#__PURE__*/createElement("span", { | ||
className: style.punctuation | ||
}, closeBracket), !lastElement && /*#__PURE__*/createElement("span", { | ||
className: style.punctuation | ||
}, ",")); | ||
} | ||
function JsonObject(_ref3) { | ||
let { | ||
field, | ||
value, | ||
@@ -131,3 +152,12 @@ style, | ||
level | ||
} = _ref2; | ||
} = _ref3; | ||
if (Object.keys(value).length === 0) { | ||
return EmptyObject({ | ||
field, | ||
openBracket: '{', | ||
closeBracket: '}', | ||
lastElement, | ||
style | ||
}); | ||
} | ||
return ExpandableObject({ | ||
@@ -146,3 +176,3 @@ field, | ||
} | ||
function JsonArray(_ref3) { | ||
function JsonArray(_ref4) { | ||
let { | ||
@@ -156,3 +186,12 @@ field, | ||
clickToExpandNode | ||
} = _ref3; | ||
} = _ref4; | ||
if (value.length === 0) { | ||
return EmptyObject({ | ||
field, | ||
openBracket: '[', | ||
closeBracket: ']', | ||
lastElement, | ||
style | ||
}); | ||
} | ||
return ExpandableObject({ | ||
@@ -171,3 +210,3 @@ field, | ||
} | ||
function JsonPrimitiveValue(_ref4) { | ||
function JsonPrimitiveValue(_ref5) { | ||
let { | ||
@@ -178,3 +217,3 @@ field, | ||
lastElement | ||
} = _ref4; | ||
} = _ref5; | ||
let stringValue = value; | ||
@@ -181,0 +220,0 @@ let valueStyle = style.otherValue; |
{ | ||
"name": "react-json-view-lite", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "JSON viewer component for React focused on performance for large volume input while still providing few customiziation features", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/AnyRoad/react-json-view-lite", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87929
850