0.1.6 • Published 3 years ago

whale-docgen-render v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

whale-docgen-render

TNPM version TNPM downloads 提Bug 提需求

财鲸组件文档渲染

安装方法

$ tnpm install whale-docgen-render --save

如何iceworks中使用组件

API

DocStructureCollapse

折叠样式文档组件。

参数说明类型可选值默认值
props (必填)需要渲染的组件字段WmProps

DocStructureTypesCollapse

折叠样式文档组件。

参数说明类型可选值默认值
types (必填)需要渲染的组件字段WmPropItemType[]

DocStructureTable

表格样式文档组件。

参数说明类型可选值默认值
props (必填)需要渲染的组件字段WmProps
prefix样式类名的品牌前缀string
size尺寸 small为紧凑模式"small" | "medium""small", "medium"
className自定义类名string
style自定义内联样式CSSProperties
columnsany[]
tableLayout表格元素的 table-layout 属性,设为 fixed 表示内容不会影响列的布局"fixed" | "auto""fixed", "auto"
tableWidth表格的总长度,可以这么用:设置表格总长度 、设置部分列的宽度,这样表格会按照剩余空间大小,自动其他列分配宽度number
dataSource表格展示的数据源any[]
onRowClick点击表格每一行触发的事件(record: any, index: number, e: MouseEvent<Element, MouseEvent>) => void
onRowMouseEnter悬浮在表格每一行的时候触发的事件(record: any, index: number, e: MouseEvent<Element, MouseEvent>) => void
onRowMouseLeave离开表格每一行的时候触发的事件(record: any, index: number, e: MouseEvent<Element, MouseEvent>) => void
onSort点击列排序触发的事件(dataIndex: string, order: string) => void
onFilter点击过滤确认按钮触发的事件(filterParams: any) => void
onResizeChange重设列尺寸的时候触发的事件(dataIndex: string, value: number) => void
getRowProps设置每一行的属性,如果返回值和其他针对行操作的属性冲突则无效。(record: any, index: number) => any
rowProps(record: any, index: number) => any
getCellProps设置单元格的属性,通过该属性可以进行合并单元格(rowIndex: number, colIndex: number, dataIndex: string, record: any) => any
cellProps(rowIndex: number, colIndex: number, dataIndex: string, record: any) => any
hasBorder表格是否具有边框boolean
hasHeader表格是否具有头部boolean
isZebra表格是否是斑马线boolean
loading表格是否在加载中boolean
loadingComponent自定义 Loading 组件 请务必传递 props, 使用方式: loadingComponent={props => <Loading {...props}/>}(props: LoadingProps) => ReactNode
filterParams当前过滤的的keys,使用此属性可以控制表格的头部的过滤选项中哪个菜单被选中,格式为 {dataIndex: {selectedKeys:[]}} 示例: 假设要控制dataIndex为id的列的过滤菜单中key为one的菜单项选中 `<Table filterParams={{id: {selectedKeys: ['one']}}}/>`{ [propName: string]: any; }
sort当前排序的字段,使用此属性可以控制表格的字段的排序,格式为{dataIndex: 'asc'}{ [propName: string]: any; }
sortIcons自定义排序按钮,例如上下排布的: `{desc: <Icon style={{top: '6px', left: '4px'}} type={'arrow-down'} size="small" />, asc: <Icon style={{top: '-6px', left: '4px'}} type={'arrow-up'} size="small" />}`{ desc?: ReactNode; asc?: ReactNode; }
locale自定义国际化文案对象{ ok: string; reset: string; empty: string; asc: string; desc: string; expanded: string; folded: string; filter: string; selectAll: string; }
emptyContent设置数据为空的时候的表格内容展现ReactNode
primaryKeydataSource当中数据的主键,如果给定的数据源中的属性不包含该主键,会造成选择状态全部选中string
expandedRowRender额外渲染行的渲染函数(record: any, index: number) => ReactElement<any, string | JSXElementConstructor<any>>
rowExpandable(record: any) => boolean
expandedRowIndent额外渲染行的缩进any[]
openRowKeys默认情况下展开的渲染行或者Tree, 传入此属性为受控状态any[]
hasExpandedRowCtrl是否显示点击展开额外渲染行的+号按钮boolean
getExpandedColProps设置额外渲染行的属性<IRecord extends unknown = any>(record: IRecord, index: number) => object | Record<string | number, any>
onRowOpen在额外渲染行或者Tree展开或者收起的时候触发的事件(openRowKeys: any[], currentRowKey: string, expanded: boolean, currentRecord: any) => void
onExpandedRowClick点击额外渲染行触发的事件(record: any, index: number, e: MouseEvent<Element, MouseEvent>) => void
fixedHeader表头是否固定,该属性配合maxBodyHeight使用,当内容区域的高度超过maxBodyHeight的时候,在内容区域会出现滚动条boolean
maxBodyHeight最大内容区域的高度,在`fixedHeader``true`的时候,超过这个高度会出现滚动条string | numberstring, number
rowSelection是否启用选择模式{ getProps?: (record: any, index: number) => void; onChange?: (selectedRowKeys: any[], records: any[]) => void; onSelect?: (selected: boolean, record: any, records: any[]) => void; onSelectAll?: (selected: boolean, records: any[]) => void; ... 4 more ...; titleAddons?: () => any; }
stickyHeader表头是否是stickyboolean
offsetTop距离窗口顶部达到指定偏移量后触发number
affixPropsaffix组件的的属性AffixProps
indent在tree模式下的缩进尺寸, 仅在isTree为true时候有效number
isTree开启Table的tree模式, 接收的数据格式中包含children则渲染成tree tableboolean
useVirtual是否开启虚拟滚动boolean
scrollToRow滚动到指定行number
rowHeight设置行高number | (() => void)number, () => void
onBodyScroll在内容区域滚动的时候触发的函数() => void
expandedIndexSimulate开启时,getExpandedColProps() / getRowProps() / expandedRowRender() 的第二个参数 index (该行所对应的序列) 将按照01,2,3,4...的顺序返回,否则返回真实index(0,2,4,6... / 1,3,5,7...)boolean
crossline在 hover 时出现十字参考轴,适用于表头比较复杂,需要做表头分类的场景。boolean
defaultCheckedboolean
defaultValuestring | number | readonly string[]string, number, readonly string[]
suppressContentEditableWarningboolean
suppressHydrationWarningboolean
accessKeystring
contentEditableBooleanish | "inherit"false, true, "true", "false", "inherit"
contextMenustring
dirstring
draggableBooleanish
hiddenboolean
idstring
langstring
placeholderstring
slotstring
spellCheckBooleanish
tabIndexnumber
titlestring
translate"yes" | "no""yes", "no"
radioGroupstring
rolestring
aboutstring
datatypestring
inlistany
propertystring
resourcestring
typeofstring
vocabstring
autoCapitalizestring
autoCorrectstring
autoSavestring
colorstring
itemPropstring
itemScopeboolean
itemTypestring