Files
2026-09-22 16:04:51 +08:00

38 lines
1.9 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { GridLayoutItem, BoxStyle } from '../grid-layout';
/**
* 将布局字段配置按 (y, x) 排序并渲染为定位好的字段项元素列表
* @param {GridLayoutItem[]} [fields=[]] 布局字段配置列表,每项包含 i/x/y/w/h 及 field(可含 boxStyle)
* @param {Function} ItemWidget 用于渲染每个字段内容的组件
* @param {*} [basicForm] 传给每个字段项的外层表单实例
* @returns {Array} 已定位、可直接渲染的字段项元素列表
*/
declare function getNormalizeFields(fields?: GridLayoutItem[], ItemWidget: Function, basicForm?: any): any[];
/**
* 根据栅格坐标/尺寸及盒模型配置,生成布局字段项的行内样式(以 CSS 自定义属性表达)
* @param {number} x 栅格列坐标
* @param {number} y 栅格行坐标
* @param {number} w 栅格宽度(列数)
* @param {number} h 栅格高度(行数)
* @param {BoxStyle} [boxStyle={}] 盒模型配置
* @param {number} [height=0] 显式高度(px),传入时覆盖 autoHeight 计算出的 height
* @returns {Object} 可直接用作 React style 的样式对象
*/
declare function getBoxStyle(x: number, y: number, w: number, h: number, boxStyle?: BoxStyle, height?: number): any;
/**
* 将部件名归一化为完整标识;以 `@` 或 `blob:` 开头时按原样返回,否则拼接 widgetPrefix 前缀
* @param {string} [widget='Text'] 部件名
* @param {string} [widgetPrefix='@pkg/ff/grid-layouts'] widget 非绝对标识时使用的前缀
* @returns {string} 归一化后的部件标识
*/
declare function getNormalizeWidget(widget?: string, widgetPrefix?: string): string;
/**
* 从 props 中提取所有事件回调(即形如 onXxx 的属性)
* @param {Object} props 任意 props 对象
* @returns {Object} 仅包含事件回调属性的子集
*/
declare function getEventProps(props: any): any;
export { getBoxStyle, getEventProps, getNormalizeFields, getNormalizeWidget };