Skip to content

Json components height #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 8, 2024
Prev Previous commit
Next Next commit
scrollbar comp used
  • Loading branch information
MenamAfzal committed Aug 6, 2024
commit 9b7f49babb15c33728bec39f7a3059dfb21e4289
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Section, sectionNames } from "lowcoder-design";
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
import { UICompBuilder, withDefault } from "../../generators";
import { NameConfigHidden, NameConfig, withExposingConfigs } from "../../generators/withExposing";
import ReactJson, { type ThemeKeys } from "react-json-view";
Expand Down Expand Up @@ -41,8 +41,6 @@ const bgColorMap = {
const JsonExplorerContainer = styled.div<{
$theme: keyof typeof bgColorMap;
$animationStyle: AnimationStyleType;
$height: boolean;
$showVerticalScrollbar:boolean;
}>`
${(props) => props.$animationStyle}
height: 100%;
Expand All @@ -51,10 +49,6 @@ const JsonExplorerContainer = styled.div<{
border: 1px solid #d7d9e0;
border-radius: 4px;
padding: 10px;
&::-webkit-scrollbar {
width: 16px;
display: ${props=>props.$showVerticalScrollbar&&'block !important'};
}
`;

let JsonExplorerTmpComp = (function () {
Expand All @@ -72,21 +66,21 @@ let JsonExplorerTmpComp = (function () {

return (
<JsonExplorerContainer
$height={props.autoHeight}
$theme={props.theme as keyof typeof bgColorMap}
$animationStyle={props.animationStyle}
$showVerticalScrollbar={props.showVerticalScrollbar}
>
<ReactJson
name={false}
src={props.value}
theme={props.theme as ThemeKeys}
collapsed={!props.expandToggle}
displayDataTypes={false}
indentWidth={props.indent}
/>
<ScrollBar hideScrollbar={!props.showVerticalScrollbar}>
<ReactJson
name={false}
src={props.value}
theme={props.theme as ThemeKeys}
collapsed={!props.expandToggle}
displayDataTypes={false}
indentWidth={props.indent}
/>
</ScrollBar>
</JsonExplorerContainer>
)
);
})
.setPropertyViewFn((children) => {
return (
Expand Down
Loading