-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(ObjectBase): add inline variant #104
Conversation
Preview is ready. |
653ff92
to
3c5ba43
Compare
|
||
& > div { | ||
flex: auto; | ||
margin-right: 8px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/stories/ObjectInline.stories.tsx
Outdated
|
||
const value = {gender: 'other', name: 'Foo'}; | ||
|
||
const excludeOptions = ['description', 'viewSpec.type', 'viewSpec.oneOfParams']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add 'viewSpec.placeholder'
import {InputPreview} from './components'; | ||
|
||
export default { | ||
title: 'Object/Inline', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename it to objectInline - as objectValue
and accordingly in the config object_inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for ObjectBase
the name is base
. I named it according to this logic.
|
||
.#{$ns}object-base { | ||
&__content { | ||
&_inline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make the same width for each child input
@@ -49,18 +64,24 @@ export const ObjectBase: ObjectIndependentInput = ({spec, name, Layout, ...restP | |||
); | |||
|
|||
const content = React.useMemo(() => { | |||
if (!_.isObjectLike(spec.properties) || !Object.keys(spec.properties || {}).length) { | |||
if ( | |||
!spec.properties || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems this check is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is required for typings. Otherwise we have to make type casting
3c5ba43
to
ca27407
Compare
845682e
to
0d3e393
Compare
No description provided.