Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e4324ef

Browse files
author
FalkWolsky
committedMar 26, 2024
Enabling Sections to control open-state
1 parent 7bbda3a commit e4324ef

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed
 

‎client/packages/lowcoder-design/src/components/Section.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const ShowChildren = styled.div<{ $show?: string; $noMargin?: boolean }>`
7575

7676
interface ISectionConfig<T> {
7777
name?: string;
78+
open?: boolean;
7879
width?: number;
7980
noMargin?: boolean;
8081
style?: React.CSSProperties;
@@ -103,7 +104,9 @@ export const PropertySectionContext = React.createContext<PropertySectionContext
103104
export const BaseSection = (props: ISectionConfig<ReactNode>) => {
104105
const { name } = props;
105106
const { compName, state, toggle } = useContext(PropertySectionContext);
106-
const open = name ? state[compName]?.[name] !== false : true;
107+
const open = props.open !== undefined ? props.open : name ? state[compName]?.[name] !== false : true;
108+
109+
console.log("open", open, props.open);
107110

108111
const handleToggle = () => {
109112
if (!name) {

‎client/packages/lowcoder/src/comps/comps/numberInputComp/sliderComp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const SliderBasicComp = (function () {
3333
value={props.value.value}
3434
$style={props.style}
3535
style={{margin: 0}}
36+
// FALK TODO : vertical={true}
3637
onChange={(e) => {
3738
props.value.onChange(e);
3839
props.onEvent("change");

‎client/packages/lowcoder/src/comps/comps/numberInputComp/sliderCompConstants.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const SliderStyled = styled(Slider)<{ $style: SliderStyleType }>`
4949
${(props) => props.$style && getStyle(props.$style)}
5050
`;
5151

52+
// Falk TODO: height: 300px;
5253
export const SliderWrapper = styled.div`
5354
width: 100%;
5455
display: inline-flex;

‎client/packages/lowcoder/src/comps/comps/tabs/tabbedContainerComp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
256256
return (
257257
<div style={{padding: props.style.margin, height: '100%'}}>
258258
<StyledTabs
259+
// FALK: TODO tabPosition="right"
259260
activeKey={activeKey}
260261
$style={style}
261262
$headerStyle={headerStyle}

0 commit comments

Comments
 (0)
Please sign in to comment.