-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically wrap non-layout components in box containers (#804)
* Automatically wrap non-layout components in box containers * Fix controls spacing * Better names * Start with prop default value if available * Fix default values with bindings * Fix layout box bindings * Better layout prop names * Fix type errors * Improve layout prop interface and layout alignment prop names * Prevent binding collisions and simplify layour prop names * Fix binding id
- Loading branch information
1 parent
7ea4eaa
commit fffed02
Showing
11 changed files
with
208 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { BoxProps } from '@mui/material'; | ||
import { ArgTypeDefinition } from '@mui/toolpad-core'; | ||
|
||
export const LAYOUT_DIRECTION_HORIZONTAL = 'horizontal'; | ||
export const LAYOUT_DIRECTION_VERTICAL = 'vertical'; | ||
export const LAYOUT_DIRECTION_BOTH = 'both'; | ||
|
||
export const layoutBoxArgTypes: { | ||
horizontalAlign: ArgTypeDefinition<BoxProps['justifyContent']>; | ||
verticalAlign: ArgTypeDefinition<BoxProps['alignItems']>; | ||
} = { | ||
horizontalAlign: { | ||
typeDef: { | ||
type: 'string', | ||
enum: ['start', 'center', 'end', 'space-between', 'space-around', 'space-evenly'], | ||
}, | ||
label: 'Horizontal alignment', | ||
control: { type: 'HorizontalAlign' }, | ||
defaultValue: 'start', | ||
}, | ||
verticalAlign: { | ||
typeDef: { | ||
type: 'string', | ||
enum: ['start', 'center', 'end', 'space-between', 'space-around', 'space-evenly'], | ||
}, | ||
label: 'Vertical alignment', | ||
control: { type: 'VerticalAlign' }, | ||
defaultValue: 'center', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.