Skip to content
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

Merged
merged 4 commits into from
Sep 5, 2023
Merged

feat(ObjectBase): add inline variant #104

merged 4 commits into from
Sep 5, 2023

Conversation

DakEnviy
Copy link
Contributor

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.


& > div {
flex: auto;
margin-right: 8px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image large indent


const value = {gender: 'other', name: 'Foo'};

const excludeOptions = ['description', 'viewSpec.type', 'viewSpec.oneOfParams'];
Copy link
Contributor

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',
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Collaborator

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 ||
Copy link
Collaborator

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

Copy link
Contributor Author

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

@DakEnviy DakEnviy merged commit 31480c3 into main Sep 5, 2023
@DakEnviy DakEnviy deleted the object-inline branch September 5, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants