Elements: remove global width: 100%

This commit is contained in:
Chika 2022-06-03 17:22:11 +03:00
parent 29a5f6cd4b
commit 2a863a5f30
3 changed files with 15 additions and 10 deletions

View File

@ -62,7 +62,7 @@ const renderElements = (Object.keys(map) as (keyof typeof map)[]).reduce((acc, e
render: () => (
<Container key={elementName}>
<Head title={title} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
),
};
@ -92,7 +92,7 @@ const overrideRenderElements: Partial<Record<keyof typeof map, RenderProps>> = {
return (
<Container>
<Head title={title} addon={<LinkComponent text="Открыть в CRM" />} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
);
},
@ -119,7 +119,7 @@ const overrideRenderElements: Partial<Record<keyof typeof map, RenderProps>> = {
return (
<Container>
<Head title={title} addon={<LinkComponent text="Открыть в CRM" />} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
);
},
@ -146,7 +146,7 @@ const overrideRenderElements: Partial<Record<keyof typeof map, RenderProps>> = {
return (
<Container>
<Head title={title} addon={<LinkComponent text="Открыть в CRM" />} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
);
},
@ -169,7 +169,7 @@ const overrideRenderElements: Partial<Record<keyof typeof map, RenderProps>> = {
<Tooltip title="Без учета налога на роскошь" placement="topLeft">
<Container>
<Head title={title} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
</Tooltip>
);
@ -193,7 +193,7 @@ const overrideRenderElements: Partial<Record<keyof typeof map, RenderProps>> = {
<Tooltip title="С какого платежа начинается полный высокий сезон" placement="topLeft">
<Container>
<Head title={title} />
<Element {...props} style={{ width: '100%' }} />
<Element {...props} />
</Container>
</Tooltip>
);

View File

@ -13,7 +13,14 @@ export default function InputNumber({
}: BaseElementProps<number>) {
return (
<FormItem hasFeedback validateStatus={isValid === false ? 'error' : ''} help={help}>
<AntInputNumber onChange={setValue} disabled={status === 'Disabled'} {...props} />
<AntInputNumber
onChange={setValue}
disabled={status === 'Disabled'}
style={{
width: '100%',
}}
{...props}
/>
</FormItem>
);
}

View File

@ -1,4 +1,4 @@
import type { SegmentedProps, SpaceProps } from 'antd';
import type { SpaceProps } from 'antd';
import { Form, Segmented as AntSegmented } from 'antd';
import type { BaseElementProps, BaseOption } from './types';
@ -7,7 +7,6 @@ const { Item: FormItem } = Form;
type ElementProps = BaseElementProps<string | number> & {
options: BaseOption[];
spaceProps?: SpaceProps;
style: SegmentedProps['style'];
};
export default function Segmented({
@ -18,7 +17,6 @@ export default function Segmented({
isValid,
help,
spaceProps,
style,
...props
}: ElementProps) {
return (