altinn-studio
altinn-studio copied to clipboard
12787 resizable layout component
Description
- New component in
studio-components
using flexbox and flex-grow to create a resizable layout that keeps proportions when scaled- StudioResizableLayoutContainer
- Should be used as parent element to
StudioResizableLayoutElement
- Can be defined as either a vertical or horizontal layout
- Saves resize state in local storage (uniquely identified by
localStorageContext
prop) - Custom styling can be added with the
style
prop
- Should be used as parent element to
- StudioResizableLayoutElement
- Can restrict resizing with
minimumSize
- Collapsing can be toggled with
collapsed
and size controlled withcollapsedSize
- Custom styling can be added with the
style
prop
- Can restrict resizing with
- StudioResizableLayoutHandle
- Automatically added between
Element
components - Handles mouse and keyboard events for resizing
- Automatically added between
- StudioResizableLayoutContainer
-
Container
is a wrapper to set up the resizable layout container.Element
is used to create individual resizable boxes within the container and should only be used inside aContainer
component - New storybook entry
- Moved
useLocalStorage
anduseWebStorage
hooks tostudio-components
hooks folder - Moved
layoutSet
dropdown from components pane to new toolbar similar to the one on the datamodels page
Related Issue(s)
- #12787
- #12730
- Also trying to solve #13006 as part of using the component in formdesigner
Verification
- [x] Your code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [x] Relevant automated test added (if you find this hard, leave it and we'll help out)
Documentation
- [ ] User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)
- [x] Storybook entry added