2022-10-27 00:53:41 +03:00
|
|
|
import { FC, ReactNode, RefAttributes } from 'react';
|
2022-10-24 20:33:40 -04:00
|
|
|
|
2024-05-12 15:45:26 -04:00
|
|
|
import { Export, findModuleExport } from '../webpack';
|
2022-08-26 01:12:21 -04:00
|
|
|
import { FooterLegendProps } from './FooterLegend';
|
2022-06-22 21:44:41 -04:00
|
|
|
|
2022-10-27 00:49:14 +03:00
|
|
|
export interface FieldProps extends FooterLegendProps {
|
2024-05-25 19:14:30 -04:00
|
|
|
children?: ReactNode;
|
2022-09-17 16:57:36 +03:00
|
|
|
label?: ReactNode;
|
|
|
|
|
bottomSeparator?: 'standard' | 'thick' | 'none';
|
|
|
|
|
description?: ReactNode;
|
2022-06-22 21:44:41 -04:00
|
|
|
disabled?: boolean;
|
|
|
|
|
icon?: ReactNode;
|
2022-09-17 16:57:36 +03:00
|
|
|
inlineWrap?: 'keep-inline' | 'shift-children-below'; // If label is too long it will move shildren below before starting to wrap label
|
|
|
|
|
childrenLayout?: 'below' | 'inline';
|
|
|
|
|
childrenContainerWidth?: 'min' | 'max' | 'fixed'; // Does not work with childrenLayout==='below'
|
2022-10-24 20:33:40 -04:00
|
|
|
spacingBetweenLabelAndChild?: 'none'; // This applies only when childrenLayout==='below'
|
2022-09-17 16:57:36 +03:00
|
|
|
padding?: 'none' | 'standard' | 'compact';
|
|
|
|
|
className?: string;
|
2022-06-22 21:44:41 -04:00
|
|
|
highlightOnFocus?: boolean;
|
|
|
|
|
indentLevel?: number;
|
2022-09-17 16:57:36 +03:00
|
|
|
verticalAlignment?: 'center' | 'none'; // Alligns inline label with children
|
2022-10-26 15:19:16 +03:00
|
|
|
focusable?: boolean; // Allows to get focus without any focusable children or on* callbacks
|
|
|
|
|
onActivate?: (e: CustomEvent | MouseEvent) => void;
|
2022-10-27 00:49:14 +03:00
|
|
|
onClick?: (e: CustomEvent | MouseEvent) => void;
|
2022-06-22 21:44:41 -04:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 15:48:13 -04:00
|
|
|
export const Field = findModuleExport((e: Export) => e?.render?.toString().includes('"shift-children-below"')) as FC<
|
|
|
|
|
FieldProps & RefAttributes<HTMLDivElement>
|
|
|
|
|
>;
|