/// import { ComponentSize } from '../ConfigProvider'; export declare const defaultSize: ComponentSize; export declare const sizeCtx: import("react").Context; /** 获取控件所在表单的 size 信息 */ export declare function useFormSize(sizeFromProps: ComponentSize | undefined): ComponentSize; /** 表单布局模式:水平、垂直、行内 */ export declare type LayoutType = 'horizontal' | 'vertical' | 'inline'; /** label 内容的对齐方式 */ export declare type LabelAlign = 'left' | 'right'; export declare const defaultLabelAlign: LabelAlign; /** * 可选的 label 文本颜色 * light: 浅色,适用于偏展示类表单 * deep: 深色,适用于偏操作类表单 */ export declare type LabelColor = 'light' | 'deep'; export declare const defaultLabelColor: LabelColor; export declare function useLabelColorMap(): Record; /** * label 在垂直方向的对齐方式 * input: 与常规的表单输入组件()对齐,对应 `src/style/base.less` 中 `@icecream-form-input-height` 的高度 * text: 与文本对齐,对应文本的常规行高(`RadioGroup` / `CheckboxGroup` 等输入组件也是这个高度) */ export declare type LabelVerticalAlign = 'input' | 'text'; export declare const defaultLabelVerticalAlign: LabelVerticalAlign; export declare const defaultLabelWidth = "auto"; export declare const defaultLabelGapForHorizontal = "28px"; export declare const defaultLabelGapForInline = "8px"; /** 表单 label 相关配置 */ export interface LabelOptions { /** * label 宽度,仅当表单 `layout: horizontal` 时生效 * @default 'auto' */ labelWidth?: string; /** * label 与主体内容的间距,仅当表单 `layout: horizontal | inline` 时生效 * 一般来说间距不小于 16px,且是 4px 的整数倍 * @default '28px' (`layout: horizontal`) * @default '8px' (`layout: inline`) */ labelGap?: string; /** * label 内容的对齐方式,仅当表单 `layout: horizontal` 时生效 * @default 'left' */ labelAlign?: LabelAlign; /** * label 文本颜色 * @default 'deep' */ labelColor?: LabelColor; /** * label 在垂直方向的对齐方式,设置该值使得 label 与右侧主体内容首行对齐,仅当表单 `layout: horizontal` 时生效 * @default 'input' */ labelVerticalAlign?: LabelVerticalAlign; } export declare const labelOptionsCtx: import("react").Context; /** 获取控件所在表单的 label 相关配置 */ export declare function useFormLabelOptions(labelOptionsFromProps?: LabelOptions): LabelOptions; /** 表单布局配置 */ export declare type Layout = { /** 表单布局模式 */ type: LayoutType; }; export declare function normalizeLayout(layout: Layout | LayoutType): Layout; export declare const defaultLayout: Layout; export declare const layoutCtx: import("react").Context; /** 获取控件所在表单的 layout 信息 */ export declare function useFormLayout(layoutFromProps: LayoutType | Layout | undefined): Layout; /** 表单项的校验状态:未校验、校验通过、校验失败 */ export declare type ValidateStatus = 'default' | 'success' | 'error'; export declare const defaultValidateStatus: ValidateStatus; export declare type ValidateMessage = string | null | undefined; export declare type ValidateResult = { status: ValidateStatus; message: ValidateMessage; }; export declare const validateResultCtx: import("react").Context; export declare const defaultVerticalGap = "24px"; export declare const verticalGapCtx: import("react").Context; /** 获取所在表单的垂直间距信息 */ export declare function useFormVerticalGap(verticalGapFromProps: string | undefined): string; /** 用于输入控件获取所在表单的信息的 hook */ export declare function useFormInfo(): { size: ComponentSize; layout: Layout; validateStatus: ValidateStatus; validateMessage: string | null | undefined; }; /** Footer 内容的对齐方向(对 `layout: inline` 的 Form 不生效) */ export declare type FooterAlign = 'left' | 'right'; /** 控制 Footer 内容默认对齐方向的 context,(icecream)内部使用 */ export declare const footerDefaultAlignCtx: import("react").Context; export interface FooterCtxValue { submitting: boolean; onCancel?: () => void; } export declare const footerCtx: import("react").Context; /** 消费 footer 相关的 context 内容 */ export declare function useFooterCtx(): { defaultAlign: LabelAlign; submitting: boolean; onCancel?: (() => void) | undefined; };