Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/lib/kit/components/Inputs/ObjectBase/ObjectBase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
}
}
}

&_inline-table-item {
& > .#{$ns}use-search {
width: auto;
min-width: 0;
flex: 1 1 0;
}
}
}

&__delimiter {
Expand Down
10 changes: 9 additions & 1 deletion src/lib/kit/components/Inputs/ObjectBase/ObjectBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,17 @@ export const ObjectBase: React.FC<ObjectBaseProps> = ({
const orderProperties = spec.viewSpec.order?.length
? spec.viewSpec.order
: Object.keys(specProperties);
const hasTableItemLayout = orderProperties.some(
(property) => specProperties[property]?.viewSpec?.layout === 'table_item',
);

return (
<div className={b('content', {inline})}>
<div
className={b('content', {
inline,
'inline-table-item': inline && hasTableItemLayout,
})}
>
{orderProperties.map((property: string) =>
specProperties[property] ? (
<React.Fragment key={`${name ? name + '.' : ''}${property}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

&_without-max-width {
max-width: unset;
width: 100%;

& > .#{$ns}error-wrapper {
width: var(--df-transparent-error-wrapper-width, auto);
width: var(--df-transparent-error-wrapper-width, 100%);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Transparent = <T extends FieldValue, S extends Spec>({
const arrayItem = React.useMemo(() => isArrayItem(name), [name]);
const generateButton = React.useMemo(() => withGenerateButton(spec), [spec]);
const arrOrObjFlag = React.useMemo(() => isArraySpec(spec) || isObjectSpec(spec), [spec]);
const tableItemLayout = spec.viewSpec.layout === 'table_item';

const removeButton = React.useMemo(() => {
if (arrayItem) {
Expand All @@ -43,7 +44,7 @@ export const Transparent = <T extends FieldValue, S extends Spec>({
return (
<div
className={b({
'array-item': arrayItem && !arrOrObjFlag,
'array-item': arrayItem && !arrOrObjFlag && !tableItemLayout,
'without-max-width': arrOrObjFlag,
})}
>
Expand Down
Loading