This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: alternative layout approach using flexbox (#38)
BREAKING CHANGE: We are now using Flexbox because it works better with dynamically hiding and showing fields using the `show` schema property. This is a breaking change because forms using the previous Grid layout system would leave an empty place in the grid when they were hidden, but the new system will stretch rows to fill in missing space.
- Loading branch information
1 parent
3642d55
commit 4afe1b8
Showing
8 changed files
with
291 additions
and
45 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,39 @@ | ||
{ | ||
"_selection": ".", | ||
"a": "Alpha", | ||
"b": "Bravo", | ||
"c": "Charlie", | ||
"d": "Delta", | ||
"e": { | ||
"f": "Foxtrot", | ||
"g": "Golf", | ||
"h": "Hotel", | ||
"i": "India" | ||
}, | ||
"j": { | ||
"k": { | ||
"f": "Foxtrot", | ||
"g": "Golf", | ||
"h": "Hotel", | ||
"i": "India" | ||
}, | ||
"l": { | ||
"f": "Foxtrot", | ||
"g": "Golf", | ||
"h": "Hotel", | ||
"i": "India" | ||
}, | ||
"m": { | ||
"f": "Foxtrot", | ||
"g": "Golf", | ||
"h": "Hotel", | ||
"i": "India" | ||
}, | ||
"n": { | ||
"f": "Foxtrot", | ||
"g": "Golf", | ||
"h": "Hotel", | ||
"i": "India" | ||
} | ||
} | ||
} |
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,113 @@ | ||
{ | ||
"$schema": "../../../../ui-schema.json", | ||
"type": "form", | ||
"title": "Layout Examples", | ||
"description": "Play with the layout prop in the knobs panel", | ||
"layouts": { | ||
"2-col": [ | ||
"a b", | ||
"c d", | ||
"e e", | ||
"j j" | ||
], | ||
"4-col": [ | ||
"a b c d", | ||
"e e e e", | ||
"j j j j" | ||
] | ||
}, | ||
"fields": { | ||
"a": { | ||
"type": "string", | ||
"title": "A" | ||
}, | ||
"b": { | ||
"type": "string", | ||
"title": "B" | ||
}, | ||
"c": { | ||
"type": "string", | ||
"title": "C" | ||
}, | ||
"d": { | ||
"type": "string", | ||
"title": "D" | ||
}, | ||
"e": { | ||
"type": "form", | ||
"title": "E", | ||
"layouts": { | ||
"2-col": [ | ||
"f g", | ||
"h i" | ||
], | ||
"4-col": [ | ||
"f g h i" | ||
] | ||
}, | ||
"fields": { | ||
"f": { | ||
"type": "string", | ||
"title": "F" | ||
}, | ||
"g": { | ||
"type": "string", | ||
"title": "G" | ||
}, | ||
"h": { | ||
"type": "string", | ||
"title": "H" | ||
}, | ||
"i": { | ||
"type": "string", | ||
"title": "I" | ||
} | ||
} | ||
}, | ||
"j": { | ||
"title": "J", | ||
"type": "object", | ||
"default": { | ||
"f": "", | ||
"g": "", | ||
"h": "", | ||
"i": "" | ||
}, | ||
"keys": { | ||
"title": "key", | ||
"type": "string" | ||
}, | ||
"values": { | ||
"type": "form", | ||
"title": "value", | ||
"layouts": { | ||
"2-col": [ | ||
"f", "g", "h", "i" | ||
], | ||
"4-col": [ | ||
"f g", | ||
"h i" | ||
] | ||
}, | ||
"fields": { | ||
"f": { | ||
"type": "string", | ||
"title": "F" | ||
}, | ||
"g": { | ||
"type": "string", | ||
"title": "G" | ||
}, | ||
"h": { | ||
"type": "string", | ||
"title": "H" | ||
}, | ||
"i": { | ||
"type": "string", | ||
"title": "I" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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.