v0.7.3
This commit is contained in:
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 将布局字段配置按 (y, x) 排序并渲染为定位好的字段项元素列表
|
||||
* @param {Array} [fields=[]] 布局字段配置列表,每项包含 i/x/y/w/h 及 field(可含 boxStyle)
|
||||
* @param {Function} ItemWidget 用于渲染每个字段内容的组件
|
||||
* @param {*} [basicForm] 传给每个字段项的外层表单实例
|
||||
* @returns {Array} 已定位、可直接渲染的字段项元素列表
|
||||
*/
|
||||
declare function getNormalizeFields(fields?: any[], ItemWidget: Function, basicForm?: any): any[];
|
||||
|
||||
/**
|
||||
* 根据栅格坐标/尺寸及盒模型配置,生成布局字段项的行内样式(以 CSS 自定义属性表达)
|
||||
* @param {number} x 栅格列坐标
|
||||
* @param {number} y 栅格行坐标
|
||||
* @param {number} w 栅格宽度(列数)
|
||||
* @param {number} h 栅格高度(行数)
|
||||
* @param {Object} [boxStyle={}] 盒模型配置
|
||||
* @param {boolean} [boxStyle.autoHeight] 是否按内容自适应高度(不再固定跨行)
|
||||
* @param {string} [boxStyle.alignItems] 对齐方式,写入 `--grid-layout-box-align-items`
|
||||
* @param {string} [boxStyle.justifyContent] 主轴对齐方式,写入 `--grid-layout-box-justify-content`
|
||||
* @param {number} [boxStyle.marginTop] 外边距-上(px)
|
||||
* @param {number} [boxStyle.marginRight] 外边距-右(px)
|
||||
* @param {number} [boxStyle.marginBottom] 外边距-下(px)
|
||||
* @param {number} [boxStyle.marginLeft] 外边距-左(px)
|
||||
* @param {number} [boxStyle.paddingTop] 内边距-上(px)
|
||||
* @param {number} [boxStyle.paddingRight] 内边距-右(px)
|
||||
* @param {number} [boxStyle.paddingBottom] 内边距-下(px)
|
||||
* @param {number} [boxStyle.paddingLeft] 内边距-左(px)
|
||||
* @param {number} [height=0] 显式高度(px),传入时覆盖 autoHeight 计算出的 height
|
||||
* @returns {Object} 可直接用作 React style 的样式对象
|
||||
*/
|
||||
declare function getBoxStyle(x: number, y: number, w: number, h: number, boxStyle?: {
|
||||
autoHeight?: boolean;
|
||||
alignItems?: string;
|
||||
justifyContent?: string;
|
||||
marginTop?: number;
|
||||
marginRight?: number;
|
||||
marginBottom?: number;
|
||||
marginLeft?: number;
|
||||
paddingTop?: number;
|
||||
paddingRight?: number;
|
||||
paddingBottom?: number;
|
||||
paddingLeft?: number;
|
||||
}, 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 };
|
||||
Reference in New Issue
Block a user