ref-core
参照基础包
Last updated 3 months ago by yangchch .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ref-core 
SYNC missed versions from official npm registry.

ref-core

参照组件的通用功能提取

如何使用

$ npm install ref-core --save

import RefCoreError from 'ref-core/lib/refs/RefCoreError';
import RefCoreButton from 'ref-core/lib/refs/RefCoreButton';
import RefCoreTab from 'ref-core/lib/refs/RefCoreTab';
import RefCoreSearch from 'ref-core/lib/refs/RefCoreSearch';
import RefWithInput from 'ref-core/lib/refs/RefWithInput';
import RefCoreGlobal from 'ref-core/lib/refs/RefCoreGlobal';

refcore提供以下通用组件

RefCoreButton

提供确认,取消,清空已选按钮,已经进行国际化适配。在树参照、表格参照可见到

RefCoreError

没有查询到数据的提示,默认提示‘没有查询到数据’,已经进行国际化适配。在树参照、表格参照可见到。

RefCoreGlobal

return (
        <div>
            { React.cloneElement(
                this.props.children,
                {...this.props}
            )}
        </div>  
    )
可以与所有参照类型进行组合

RefCoreList

输出带有多选的list列表。暂未使用

RefCoreSearch

带有input的搜索。在带有搜索的树参照、简单搜索表格参照可见。

RefCoreTab

tab切换,默认展示的文字是‘已选’,‘收起已选’。可在表格参照中见到

RefCoreTable

包含表格和分页。暂未使用

RefCoreTree

树组件。可在树参照中可见

RefCoreWithInput

input组件。可以与所有参照类型进行组合。

API

注意:分为接收参数和提供参数。

RefCoreButton

接收参数

参数 类型 默认值 说明 必选
emptyBut bool false 清空按钮是否展示
onClickBtn function(value) - 点击按钮的onclick回调,value分为save、cancel、clear
language string zh_CN 多语配置,详情查看参数详解。可选'zh_CN'/'en_US'/'zh_TW'/'fr_FR'/'de_DE'/'ja_JP'
buttons object - {buttons:{cancelButton:'',saveButton:'',clearButton:''}} 按钮文字展示

提供参数暂无

RefCoreError

接收参数

参数 类型 默认值 说明 必选
language string zh_CN 多语配置,详情查看参数详解。可选'zh_CN'/'en_US'/'zh_TW'/'fr_FR'/'de_DE'/'ja_JP'
show bool - 是否展示

提供参数暂无

RefCoreGlobal

接收参数

暂无

提供参数

暂无

RefCoreList

RefCoreSearch

接收参数

参数 类型 默认值 说明 必选
language string zh_CN 多语配置,详情查看参数详解。可选'zh_CN'/'en_US'/'zh_TW'/'fr_FR'/'de_DE'/'ja_JP'
placeholder string zh_CN input的placeholder,已做国际化。可选'zh_CN'/'en_US'/'zh_TW'/'fr_FR'/'de_DE'/'ja_JP'
className string '' input的class类名。
show bool true input是否展示
onSearch function(value) -- 搜索按钮点击回调,value是搜索内容
onChange function(value) -- input输入回调,value是输入内容

提供参数

暂无

RefCoreTab

接收参数

参数 类型 默认值 说明 必选
language string zh_CN 多语配置,详情查看参数详解。可选'zh_CN'/'en_US'/'zh_TW'/'fr_FR'/'de_DE'/'ja_JP'
className string '' tabPanel的class类名。
show bool true tabPanel是否展示
selectedData array [] 已选择的数据
selecteing bool -- selecteing:true,展示已选择数;selecteing:false,展示文字:收起已选
onSelectTabItem function(selectedData, selecteing ? 'selected' : 'selecting') -- tab切换文字点击操作

提供参数

暂无

RefCoreTable

RefCoreTree

接收参数

参数 类型 默认值 说明 必选
show bool true tree是否展示
data array -- tree数据
checkable bool -- 行数据选中有对号展示
nodeKeys function(value,index) return item.id index;
displayField string 或 function '{refname}' 记录中显示的内容的格式。
当为字符串时则会根据{}包裹的增则匹配替换。
如:'人员姓名:{refname},编号:{refcode}'
当为函数时则需自定义返回内容,参数为迭代已选择的记录。
如:
displayField: (record)=> ${record.refname}-${record.refname}

提供参数

暂无

RefCoreWithInput

接收参数

参数 类型 默认值 说明 必选
wrapClassName string 文本框的class样,默认为空。
placeholder string 文本框的 placeholder
style object {width:200} 文本框的style,默认宽度200px
filterUrl string 快捷录入接口。
filterUrlFunc function(value) ()=>{} 必须配合filterUrl使用,当filterUrl为空或者不传入,才会回调filterUrlFunc
filertData Array [] 必须配合filterUrl使用,当filterUrl为空或者不传入,才会使用filterData
displayField string 或 function '{refname}' 记录中显示的内容的格式。
当为字符串时则会根据{}包裹的增则匹配替换。
如:'人员姓名:{refname},编号:{refcode}'
当为函数时则需自定义返回内容,参数为迭代已选择的记录。
如:
displayField: (record)=> ${record.refname}-${record.refname},是input展示value
valueField string 'refcode' 待提交的 value 的键。
value string 默认值,例如 '{"refname":"初级-T1","refpk":"level1"}'
disabled bool false 禁用整个参照
onChange function(values, record) -- value改变、快捷录入和保存时数据回调
canClickGoOn function() ()=>{return true} 当点击文本框右侧弹出按钮时是否打开modal
适用于级联情况下当选择不全时的处理
canInputGoOn function() ()=>{return true} 当点击文本框触发快捷录入时是否可以录入
适用于级联情况下当选择不全时的处理
menuIcon string <span className={uf uf-navmenu ${disabled ? 'ref-input-wrap-display' : ''}}> input框打开参照的处的icon

提供的参数

参数 类型 默认值 说明 必选
showModal bool false 是否展示参照 ,true显示,false不显示
onSave function(value) -- 参照确定的回调,会更新checkedArray,showname(input的value),showModal关闭,最后回调RefWithInput接收的参数onSave
onCancel function() -- 参照取消的回调,会更新showModal关闭,最后回调RefWithInput接收的参数onCancel
checkedArray Array [] 传给树选中的节点
onMatchInitValue function(value) onMatchInitValue = (checkedArray) => {this.setState({checkedArray})} 更改checkedArray

RefCoreWithInput提供的参数可以保证参照组件的checkedArray更新以及参照showModal关闭打开,因此在使用RefCoreWithInput就不需要额外手动维护这两个参数

Current Tags

  • 0.2.12-beta.0                                ...           beta (a year ago)
  • 0.2.20                                ...           latest (3 months ago)
  • 0.1.26                                ...           walsin (2 years ago)

106 Versions

  • 0.2.20                                ...           3 months ago
  • 0.2.18                                ...           3 months ago
  • 0.2.19                                ...           3 months ago
  • 0.2.17                                ...           a year ago
  • 0.2.16                                ...           a year ago
  • 0.2.15                                ...           a year ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 0.2.14                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 0.2.13                                ...           a year ago
  • 0.2.12-beta.0                                ...           a year ago
  • 0.2.12                                ...           a year ago
  • 0.2.11                                ...           a year ago
  • 0.2.10                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 0.2.9                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11-beta.0                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.0-beta.2                                ...           a year ago
  • 1.0.0-beta.1                                ...           a year ago
  • 1.0.0-beta.0                                ...           a year ago
  • 0.2.8                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6-beta.0                                ...           a year ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4-beta.1                                ...           a year ago
  • 0.2.4-beta.0                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.3.4-beta.4                                ...           a year ago
  • 0.3.4-beta.3                                ...           2 years ago
  • 0.3.4-beta.2                                ...           2 years ago
  • 0.3.4-beta.1                                ...           2 years ago
  • 0.3.4-beta                                ...           2 years ago
  • 0.3.3-beta                                ...           2 years ago
  • 0.3.2-beta                                ...           2 years ago
  • 0.3.1-beta                                ...           2 years ago
  • 0.3.0-beta                                ...           2 years ago
  • 0.2.24-beta                                ...           2 years ago
  • 0.2.23-beta                                ...           2 years ago
  • 0.2.22-beta                                ...           2 years ago
  • 0.2.21-beta                                ...           2 years ago
  • 0.2.20-beta                                ...           2 years ago
  • 0.2.19-beta                                ...           2 years ago
  • 0.2.18-beta                                ...           2 years ago
  • 0.2.17-beta                                ...           2 years ago
  • 0.2.16-beta                                ...           2 years ago
  • 0.2.15-beta                                ...           2 years ago
  • 0.2.14-beta                                ...           2 years ago
  • 0.2.13-beta                                ...           2 years ago
  • 0.2.12-beta                                ...           2 years ago
  • 0.2.11-beta                                ...           2 years ago
  • 0.2.10-beta                                ...           2 years ago
  • 0.2.9-beta                                ...           2 years ago
  • 0.2.8-beta                                ...           2 years ago
  • 0.2.7-beta                                ...           2 years ago
  • 0.2.6-beta                                ...           2 years ago
  • 0.2.5-beta                                ...           2 years ago
  • 0.2.4-beta                                ...           2 years ago
  • 0.2.3-beta                                ...           2 years ago
  • 0.2.2-beta                                ...           2 years ago
  • 0.2.1-beta                                ...           2 years ago
  • 0.2.0-beta                                ...           2 years ago
  • 0.1.26                                ...           2 years ago
  • 0.1.25                                ...           2 years ago
  • 0.1.24                                ...           2 years ago
  • 0.1.23                                ...           2 years ago
  • 0.1.22                                ...           2 years ago
  • 0.1.21                                ...           2 years ago
  • 0.1.20                                ...           2 years ago
  • 0.1.19                                ...           2 years ago
  • 0.1.18                                ...           2 years ago
  • 0.1.17                                ...           2 years ago
  • 0.1.16                                ...           2 years ago
  • 0.1.15                                ...           2 years ago
  • 0.1.14                                ...           2 years ago
  • 0.1.13                                ...           2 years ago
  • 0.1.12                                ...           2 years ago
  • 0.1.11                                ...           2 years ago
  • 0.1.10                                ...           2 years ago
  • 0.1.9                                ...           2 years ago
  • 0.1.8                                ...           2 years ago
  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
Downloads
Today 13
This Week 29
This Month 278
Last Day 16
Last Week 199
Last Month 1,349
Dependencies (15)
Dev Dependencies (58)

Copyright 2014 - 2016 © taobao.org |