diff --git a/README.md b/README.md index 83b9ca1..3ff92a2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # react-widget-listbox ## 安装 -`npm install --save react-widget-select` +`npm install --save react-widget-listbox` ## API ```html - + ``` @@ -17,40 +19,41 @@ | prefixCls | 组件CSS样式前缀 | string | rw-listbox | | className | 组件className属性 | string | - | | style | 组件style属性 | React.CSSProperties | - | +| width | css快捷属性 | number | - | +| height | css快捷属性 | number | - | | tabIndex | 组件tabIndex属性 | number | - | -| items | 组件数据 | Array\ | false | -| headerStyle | - | - | - | -| footerStyle | - | - | - | -| bodyStyle | - | - | - | +| multiple | 多选模式, 多选模式下value是数组 | boolean | false | +| defaultValue | 指定默认选中的条目 | string\|number|Array\ | - | +| value | 指定默认选中的条目 `受控` | string\|number|Array\ | - | +| autoFocus | 默认获取焦点 | boolean | false | +| disabled | 是否禁用 | boolean | false | | valueField | 设置取值字段 | string | value | | labelField | 设置显示字段 | string | label | | childrenField | 设置子节点字段 | string | children | -| headerStyle | - | - | - | -| headerStyle | - | - | - | -| headerStyle | - | - | - | -| emptyLabel | 下拉框无内容时显示 | ReactNode | no data. | -| multiple | - | - | - | - -| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: ReactNode}` 的格式 | boolean | false | -| autoFocus | 默认获取焦点 | boolean | false | -| defaultValue | 指定默认选中的条目 | string|number | - | -| value | 指定默认选中的条目 `受控` | string|number | - | -| disabled | 是否禁用 | boolean | false | - -| renderValue | 自定义渲染被选中的选项 | (menu: ReactNode, option: Option) => ReactNode | - | -| renderMenu | 自定义下拉框内容 | (menu: ReactNode, props) => ReactNode | - | -| renderMenuItem | 自定义下拉选项内容 | (label:React.Node, option:Option) => ReactNode | - | -| renderMenuGroupTitle | 自定义下拉分组标题内容 | (label:React.Node, option:Option) => ReactNode | - | +| headerStyle | 设置header的样式,renderHeader启用时有效 | React.CSSProperties | - | +| footerStyle | 设置footer的样式,renderFooter启用时有效 | React.CSSProperties | - | +| bodyStyle | 设置body的样式 | React.CSSProperties | - | +| items | 组件数据 | Array\ | [] | +| itemsMap | 组件数据Hash表 | Object\ | [] | +| emptyLabel | 无内容时显示 | ReactNode | Not Found. | +| labelInValue | 开启后`onChange(ItemData \| Array\)` | boolean | false | +| enableDownUpSelect | 开启可通过上下方向键选择项目 | boolean | true | +| fixListBodyHeightOnIE | IE下会自动设置body的maxHeight,如果CSS中已经确定可以关闭 | boolean | true | +| onItemClick | 列表项点击时触发,注:如果开启`enableDownUpSelect`并回车时也会触发 | function(item: ItemData, e: Event) => ReactNode | - | +| onItemGroupClick | 列表分组項点击时触发 | function(item: ItemGroupData, e: Event) | - | +| onChange | 数据改变时触发 | function(item: number\|string\|ItemData \| Array\) | - | | onBlur | 失去焦点的时回调 | function | - | | onFocus | 获得焦点时回调 | function | - | -| onChange | 选中 option 时调用此函数 | function(value, option:Option) | - | -| onItemClick | 搜- | | -| onItemGroupClick | - | - | -| onKeyDown | - | function(open) | - | -| wrapperComponent | - | function | - | -| headerWrapperComponent | - | function | - | -| bodyWrapperComponent | -- | function | - | -| footerWrapperComponent | - | function | - | +| onKeyDown | 键盘按下时触发 | function | - | +| renderMenu | 自定义列表框内容 | (menus: Array\, props) => ReactNode | - | +| renderMenuItem | 自定义列表项内容 | (label:React.Node, item:ItemData) => ReactNode | - | +| renderMenuGroupTitle | 自定义列表项分组标题内容 | (label:React.Node, item:ItemGroupData) => ReactNode | - | +| renderHeader | 渲染列表项头部 | function(props): ReactNode | null | +| renderFooter | 渲染列表项尾部 | function(props): ReactNode | null | +| wrapperComponent | ListBox最外层容器组件 | ReactNode | div | +| headerWrapperComponent | ListBox头部容器组件 | ReactNode | div | +| bodyWrapperComponent | ListBox列表项容器组件 | ReactNode | div | +| footerWrapperComponent | ListBox尾部容器组件 | ReactNode | div | ### ListBox Methods @@ -65,8 +68,8 @@ | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | disabled | 是否禁用 | boolean | false | -| label | 选中该 Option 后,Select 的 title | ReactNode | - | -| value | 默认根据此属性值进行筛选 | string\|number | - | +| label | 列表项的title | ReactNode | - | +| value | 列表项值 | any | - | ### ItemGroupData props diff --git a/docs/index.html b/docs/index.html index 75849c0..1b5ba58 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,6 +20,6 @@
- + \ No newline at end of file diff --git a/docs/static/js/index.32677c7a.js.map b/docs/static/js/index.32677c7a.js.map deleted file mode 100644 index 0f5c6bc..0000000 --- a/docs/static/js/index.32677c7a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./examples/Demo.js","webpack:///./examples/DemoList.js","webpack:///./examples/demos/demo1.js","webpack:///./examples/index.js","webpack:///./examples/style/animate.scss?bdcb","webpack:///./examples/style/index.scss?2d25","webpack:///./src/ListBox.js","webpack:///./src/ListItem.js","webpack:///./src/ListItemGroup.js","webpack:///./src/index.js","webpack:///./src/style/index.scss?9cab","webpack:///./src/util.js"],"names":["Demo","current","DemoList","item","e","setState","state","map","i","onDemoChange","bind","label","Component","component","Demo1","ListItem","ListBox","ListItemGroup","dataset","uuid","items","d","children","push","j","value","disabled","DEMO","console","log","maxWidth","maxHeight","a","borderBottom","borderTop","handleChange","filter","indexOf","filterMsg","handleChange2","height","ReactDOM","render","demo","noop","copy","data","concat","getItemsMap","props","valueField","childrenField","maps","toMaps","forEach","onItemClick","target","getListViewBody","onItemGroupClick","el","setValue","multiple","onChange","labelInValue","selectedValue","newSelectedValue","transformChangeValue","prefixCls","selector","activeCls","selectCls","list","getActiveIndex","keyCode","idx","UP","DOWN","sIdx","dom","ENTER","indexValueMap","_indexValueMap","activeIndex","_activeIndex","enableDownUpSelect","onKeyDown","querySelectorAll","length","minIndex","maxIndex","preventDefault","getAttribute","itemsMap","node","_listview","_listview_header","_listview_body","_listview_footer","defaultValue","_itemIndex","autoFocus","focus","selectedItem","querySelector","blur","v","selectedMap","labelField","renderMenuItem","renderMenuGroupTitle","isGroup","itemPrefixCls","onMouseEnter","onMouseLeave","itemIndex","currentTarget","onItemSelect","onItemDeselect","renderListItems","emptyLabel","getListView","header","getListViewHeader","footer","getListViewFooter","body","style","hasScroll","scrollHeight","clientHeight","headerHeight","offsetHeight","footerHeight","fixListBodyHeightOnIE","resizeListBoxBodyHeight","BodyWrapperComponent","bodyWrapperComponent","bodyStyle","renderMenu","Menus","renderList","saveListViewBody","className","width","tabIndex","onFocus","onBlur","WrapperComponent","wrapperComponent","HeaderWrapperComponent","headerWrapperComponent","FooterWrapperComponent","footerWrapperComponent","renderHeader","renderFooter","headerStyle","footerStyle","classes","saveListView","saveListViewHeader","saveListViewFooter","nextProps","prevState","newState","React","PropTypes","string","object","array","oneOfType","number","any","bool","func","onSelect","onDeselect","onClick","selected","itemDOM","getItemDOM","nextState","saveItem","handleItemClick","ItemGroup","handleClick","ObjProto","Object","prototype","toString","nativeIsArray","isNumber","obj","isArray","call","isUndefined","undefined","isEqual","b","String","each","iterator","context","hasContext"],"mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAiB,4BAA4B;AAC7C;AACA;AACA,0BAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;A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,EAA6CuL,GAAG,CAACvL,CAAD,CAAhD,EAAqDA,CAArD,EAAwDuL,GAAxD,MAAiE,KAArE,EAA4E;AAC/E;;AAED,SAAOA,GAAP;AACH,C","file":"static\\js\\index.32677c7a.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import React, { Component } from 'react';\r\nimport DemoList from './DemoList';\r\n\r\nexport default class Demo extends Component {\r\n\r\n state = {\r\n current: DemoList[0]\r\n }\r\n\r\n onDemoChange(item, e) {\r\n this.setState({\r\n current: item\r\n });\r\n }\r\n\r\n render() {\r\n const { current } = this.state;\r\n return (\r\n
\r\n
\r\n {\r\n DemoList.map((item, i) => {\r\n return (\r\n \r\n {item.label}\r\n
\r\n );\r\n })\r\n }\r\n
\r\n
\r\n {current ? : null}\r\n
\r\n \r\n )\r\n }\r\n}","import Demo1 from './demos/demo1';\r\n// import Demo2 from './demos/Demo2';\r\n// import Demo3 from './demos/Demo3';\r\n// import Demo4 from './demos/Demo4';\r\n\r\nexport default [\r\n {\r\n label: '基本功能',\r\n component: Demo1\r\n }\r\n]","import React, { Component } from 'react';\r\nimport ListBox from '../../src';\r\n\r\nconst { ListItem, ListItemGroup } = ListBox\r\n\r\nconst dataset = [];\r\n\r\nvar uuid = 100;\r\n\r\nfor (let i = 0; i < 10; i++) {\r\n const items = [];\r\n const d = {\r\n children: items,\r\n label: '分组' + (i + 1)\r\n }\r\n\r\n dataset.push(d)\r\n\r\n for (let j = 0; j < 40; j++) {\r\n let d = {\r\n value: uuid++,\r\n label: '选项' + (j + 1),\r\n disabled: !(j % 5)\r\n }\r\n items.push(d)\r\n }\r\n}\r\n\r\n\r\nexport default class DEMO extends Component {\r\n\r\n state = {\r\n value: 2\r\n }\r\n\r\n\r\n handleChange = (value) => {\r\n this.setState({\r\n value\r\n })\r\n\r\n console.log('changed ', value)\r\n }\r\n\r\n handleChange2 = (value) => {\r\n console.log('changed ', value)\r\n }\r\n\r\n filterMsg = ''\r\n\r\n render() {\r\n\r\n return (\r\n
\r\n

header

}\r\n renderFooter={() =>

footer

}\r\n renderMenu={(a) => a}\r\n renderMenuItem={(a) => a + '-opt'}\r\n renderMenuGroupTitle={(a) => a + '-opt'}\r\n headerStyle={{\r\n borderBottom: '1px solid #ccc'\r\n }}\r\n footerStyle={{\r\n borderTop: '1px solid #ccc'\r\n }}\r\n value={this.state.value}\r\n onChange={this.handleChange}\r\n items={dataset.filter((item, i) => item.label.indexOf(this.filterMsg) >= 0)}\r\n emptyLabel=\"无匹配项\"\r\n onItemGroupClick={(d) => console.log(d)}\r\n />\r\n\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n}\r\n","import React from 'react'\r\nimport ReactDOM from 'react-dom';\r\n\r\nimport './style/index.scss';\r\nimport './style/animate.scss';\r\n\r\n//import 'react-widget-scrollview/lib/style/index.css';\r\nimport '../src/style/index.scss';\r\n\r\nimport Demo from './Demo';\r\n\r\n\r\nReactDOM.render(, demo);","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","import React from 'react';\r\nimport { findDOMNode } from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport isIE from 'bplokjs-utils/isIE';\r\nimport ListItem from './ListItem';\r\nimport ListItemGroup from './ListItemGroup';\r\nimport { isArray, isUndefined, isEqual, each } from './util';\r\nimport { hasClass, addClass, removeClass } from 'bplokjs-dom-utils/classes';\r\nimport scrollIntoView from 'bplokjs-dom-utils/scrollIntoView';\r\n\r\nfunction noop() { }\r\n\r\nfunction copy(data) {\r\n return isArray(data) ? [].concat(data) : data;\r\n}\r\n\r\nfunction getItemsMap(props) {\r\n const { items, valueField, childrenField } = props;\r\n const maps = {};\r\n\r\n function toMaps(items) {\r\n items.forEach(item => {\r\n if (item[childrenField] && Array.isArray(item[childrenField])) {\r\n toMaps(item[childrenField]);\r\n } else {\r\n maps[item[valueField]] = item;\r\n }\r\n });\r\n }\r\n\r\n toMaps(items);\r\n\r\n return maps;\r\n}\r\n\r\nexport default class ListBox extends React.Component {\r\n\r\n static propTypes = {\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n headerStyle: PropTypes.object,\r\n footerStyle: PropTypes.object,\r\n bodyStyle: PropTypes.object,\r\n prefixCls: PropTypes.string,\r\n valueField: PropTypes.string,\r\n labelField: PropTypes.string,\r\n childrenField: PropTypes.string,\r\n items: PropTypes.array,\r\n itemsMap: PropTypes.object,\r\n defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\r\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\r\n emptyLabel: PropTypes.any,\r\n multiple: PropTypes.bool,\r\n disabled: PropTypes.bool,\r\n autoFocus: PropTypes.bool,\r\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n labelInValue: PropTypes.bool,\r\n tabIndex: PropTypes.number,\r\n enableDownUpSelect: PropTypes.bool,\r\n fixListBodyHeightOnIE: PropTypes.bool,\r\n onItemClick: PropTypes.func,\r\n onItemGroupClick: PropTypes.func,\r\n onChange: PropTypes.func,\r\n onFocus: PropTypes.func,\r\n onBlur: PropTypes.func,\r\n onKeyDown: PropTypes.func,\r\n renderMenu: PropTypes.func,\r\n renderMenuGroupTitle: PropTypes.func,\r\n renderMenuItem: PropTypes.func,\r\n renderHeader: PropTypes.func,\r\n renderFooter: PropTypes.func,\r\n wrapperComponent: PropTypes.node,\r\n headerWrapperComponent: PropTypes.node,\r\n bodyWrapperComponent: PropTypes.node,\r\n footerWrapperComponent: PropTypes.node,\r\n };\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox',\r\n valueField: 'value',\r\n labelField: 'label',\r\n childrenField: 'children',\r\n labelInValue: false,\r\n tabIndex: 0,\r\n emptyLabel: 'Not Found',\r\n enableDownUpSelect: true,\r\n fixListBodyHeightOnIE: true,\r\n items: [],\r\n itemsMap: null,\r\n onFocus: noop,\r\n onBlur: noop,\r\n onKeyDown: noop,\r\n wrapperComponent: \"div\",\r\n headerWrapperComponent: 'div',\r\n bodyWrapperComponent: 'div',\r\n footerWrapperComponent: 'div',\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n const selectedValue = [];\r\n let value;\r\n\r\n if (!isUndefined(props.defaultValue)) {\r\n value = isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];\r\n }\r\n\r\n if (value) {\r\n selectedValue.push(...value);\r\n }\r\n\r\n //item 索引id\r\n this._itemIndex = 0;\r\n //索引值对应的item.value\r\n this._indexValueMap = {};\r\n this._activeIndex = null;\r\n\r\n this.state = {\r\n selectedValue\r\n };\r\n }\r\n\r\n static getDerivedStateFromProps(nextProps, prevState) {\r\n const value = nextProps.value;\r\n let itemsMap = nextProps.itemsMap || {};\r\n\r\n if (!nextProps.itemsMap) {\r\n itemsMap = getItemsMap(nextProps);\r\n }\r\n\r\n const newState = {\r\n itemsMap\r\n };\r\n\r\n if (!isUndefined(value)) {\r\n newState.selectedValue = isArray(value) ? copy(value) : [value];\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n componentDidMount() {\r\n const { prefixCls, autoFocus } = this.props;\r\n const el = findDOMNode(this);\r\n const selector = `.${prefixCls}-item-selected`;\r\n\r\n if (autoFocus) {\r\n this.focus();\r\n }\r\n\r\n const selectedItem = el.querySelector(selector);\r\n if (selectedItem) {\r\n scrollIntoView(selectedItem, this.getListViewBody());\r\n }\r\n }\r\n\r\n focus() {\r\n findDOMNode(this).focus();\r\n }\r\n\r\n blur() {\r\n findDOMNode(this).blur();\r\n }\r\n\r\n onItemClick = (item, e) => {\r\n const { onItemClick } = this.props;\r\n if (e) {\r\n scrollIntoView(e.target, this.getListViewBody());\r\n }\r\n\r\n if (onItemClick) onItemClick(item);\r\n }\r\n\r\n onItemGroupClick = (item, e) => {\r\n const { onItemGroupClick } = this.props;\r\n if (e) {\r\n scrollIntoView(e.target, this.getListViewBody());\r\n }\r\n\r\n if (onItemGroupClick) onItemGroupClick(item);\r\n }\r\n\r\n transformChangeValue(value) {\r\n const { labelInValue } = this.props;\r\n const { itemsMap } = this.state;\r\n\r\n if (labelInValue) {\r\n return isArray(value) ?\r\n value.map(v => itemsMap[v]) :\r\n itemsMap[value];\r\n }\r\n\r\n return value;\r\n }\r\n\r\n setValue(value) {\r\n const { multiple, onChange } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n if (!multiple) {\r\n selectedValue.length = 0;\r\n }\r\n\r\n selectedValue.push(value);\r\n if (!('value' in this.props)) {\r\n this.setState({\r\n selectedValue\r\n })\r\n }\r\n\r\n if (onChange) {\r\n onChange(this.transformChangeValue(multiple ? copy(selectedValue) : selectedValue[0]));\r\n }\r\n }\r\n\r\n getVaule() {\r\n const { multiple } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n return this.transformChangeValue(multiple ? copy(selectedValue) : selectedValue[0]);\r\n }\r\n\r\n onItemSelect = (item, el) => {\r\n const { valueField } = this.props;\r\n this.setValue(item[valueField]);\r\n }\r\n\r\n onItemDeselect = (item, el) => {\r\n const { multiple, onChange, labelInValue, valueField } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n if (!multiple) return;\r\n\r\n let newSelectedValue = selectedValue.filter((d) => !isEqual(item[valueField], d));\r\n\r\n if (!('value' in this.props)) {\r\n this.setState({\r\n selectedValue: newSelectedValue\r\n })\r\n }\r\n\r\n if (onChange) {\r\n onChange(this.transformChangeValue(copy(newSelectedValue)));\r\n }\r\n\r\n }\r\n\r\n onKeyDown = (e) => {\r\n const { prefixCls } = this.props;\r\n const selector = `.${prefixCls}-item:not(.${prefixCls}-item-disabled)`;\r\n const activeCls = `${prefixCls}-item-active`;\r\n const selectCls = `${prefixCls}-item-selected`;\r\n let list = null;//NodeList[]\r\n\r\n function getActiveIndex(keyCode) {\r\n let idx = -1;\r\n const UP = keyCode === 38;\r\n const DOWN = keyCode === 40;\r\n let sIdx = -1;\r\n\r\n if (list) {\r\n //ie no support NodeList.prototype.forEach\r\n each(list, (item, i) => {\r\n if (hasClass(item, activeCls)) {\r\n removeClass(item, activeCls);\r\n if (UP) {\r\n if (idx === -1) idx = i;\r\n } else {\r\n idx = i;\r\n }\r\n } else if (idx === -1 && hasClass(item, selectCls)) {\r\n sIdx = i;\r\n }\r\n })\r\n }\r\n\r\n return idx === -1 ? sIdx : idx;\r\n }\r\n\r\n const props = this.props;\r\n const state = this.state;\r\n const dom = findDOMNode(this);\r\n const UP = e.keyCode === 38;\r\n const DOWN = e.keyCode === 40;\r\n const ENTER = e.keyCode === 13;\r\n const indexValueMap = this._indexValueMap;\r\n const activeIndex = this._activeIndex;\r\n\r\n if (props.enableDownUpSelect) {\r\n props.onKeyDown(e);\r\n }\r\n\r\n if (!list) {\r\n list = dom.querySelectorAll(selector);\r\n }\r\n\r\n if (!list.length) return;\r\n\r\n const minIndex = 0;\r\n const maxIndex = list.length - 1;\r\n\r\n if (UP || DOWN) {\r\n e.preventDefault();\r\n let idx = getActiveIndex(e.keyCode);\r\n\r\n if (UP) {\r\n idx = idx === -1 ? maxIndex : --idx;\r\n if (idx < 0) idx = maxIndex;\r\n addClass(list[idx], activeCls);\r\n } else {\r\n idx = idx === -1 ? minIndex : ++idx;\r\n if (idx > maxIndex) idx = 0;\r\n addClass(list[idx], activeCls);\r\n }\r\n\r\n this._activeIndex = list[idx].getAttribute('data-index');\r\n scrollIntoView(list[idx], this.getListViewBody());\r\n } else if (ENTER && activeIndex !== null) {\r\n const value = indexValueMap[activeIndex];\r\n const item = state.itemsMap[value];\r\n this.setValue(value);\r\n //触发onItemClick\r\n this.onItemClick(item);\r\n }\r\n\r\n }\r\n\r\n renderListItems(items, selectedMap) {\r\n const { labelField, valueField, childrenField, prefixCls, disabled, renderMenuItem, renderMenuGroupTitle } = this.props;\r\n\r\n return items.map(item => {\r\n\r\n const isGroup = item[childrenField];\r\n const itemPrefixCls = `${prefixCls}-item`;\r\n const activeCls = `${prefixCls}-item-active`;\r\n let onMouseEnter = noop;\r\n let onMouseLeave = noop;\r\n let itemIndex = this._itemIndex++;\r\n\r\n if (!isGroup) {\r\n this._indexValueMap[itemIndex] = item[valueField];\r\n\r\n if (!disabled && !item.disabled) {\r\n onMouseEnter = e => {\r\n addClass(e.currentTarget, activeCls);\r\n }\r\n onMouseLeave = e => {\r\n removeClass(e.currentTarget, activeCls);\r\n }\r\n }\r\n }\r\n\r\n return !isGroup ? (\r\n \r\n {renderMenuItem ? renderMenuItem(item[labelField], item) : item[labelField]}\r\n \r\n ) : (\r\n \r\n {this.renderListItems(item[childrenField] || [], selectedMap)}\r\n \r\n );\r\n });\r\n }\r\n\r\n renderList() {\r\n const { items, emptyLabel } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n const selectedMap = {};\r\n selectedValue.forEach(v => selectedMap[v] = true);\r\n\r\n this._itemIndex = 0;\r\n this._indexValueMap = {};\r\n this._activeIndex = null;\r\n\r\n if (items && !items.length) {\r\n return emptyLabel;\r\n }\r\n\r\n return this.renderListItems(items, selectedMap);\r\n }\r\n\r\n saveListView = (node) => {\r\n this._listview = node;\r\n }\r\n\r\n saveListViewHeader = (node) => {\r\n this._listview_header = node;\r\n }\r\n\r\n saveListViewBody = (node) => {\r\n this._listview_body = node;\r\n }\r\n\r\n saveListViewFooter = (node) => {\r\n this._listview_footer = node;\r\n }\r\n\r\n getListView() {\r\n return findDOMNode(this._listview);\r\n }\r\n\r\n getListViewHeader() {\r\n return findDOMNode(this._listview_header);\r\n }\r\n\r\n getListViewBody() {\r\n return findDOMNode(this._listview_body);\r\n }\r\n\r\n getListViewFooter() {\r\n return findDOMNode(this._listview_footer);\r\n }\r\n //修正IE对flex支持不够完善\r\n resizeListBoxBodyHeight() {\r\n const dom = this.getListView();\r\n const header = this.getListViewHeader();\r\n const footer = this.getListViewFooter();\r\n const body = this.getListViewBody();\r\n\r\n body.style.maxHeight = '';\r\n\r\n const hasScroll = dom.scrollHeight > dom.clientHeight;\r\n\r\n const headerHeight = header ? header.offsetHeight : 0;\r\n const footerHeight = footer ? footer.offsetHeight : 0;\r\n\r\n if (hasScroll) {\r\n body.style.maxHeight = (dom.clientHeight - headerHeight - footerHeight) + 'px';\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n const fixListBodyHeightOnIE = this.props.fixListBodyHeightOnIE;\r\n if (isIE() && fixListBodyHeightOnIE) {\r\n this.resizeListBoxBodyHeight();\r\n }\r\n }\r\n\r\n componentDidUpdate() {\r\n const fixListBodyHeightOnIE = this.props.fixListBodyHeightOnIE;\r\n if (isIE() && fixListBodyHeightOnIE) {\r\n this.resizeListBoxBodyHeight();\r\n }\r\n }\r\n\r\n renderMenu() {\r\n const {\r\n bodyWrapperComponent: BodyWrapperComponent,\r\n prefixCls,\r\n bodyStyle = {},\r\n renderMenu,\r\n } = this.props;\r\n\r\n const Menus = this.renderList();\r\n\r\n return (\r\n \r\n {renderMenu ? renderMenu(Menus, this.props) : Menus}\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n className,\r\n value,\r\n prefixCls,\r\n items,\r\n width,\r\n height,\r\n tabIndex,\r\n disabled,\r\n enableDownUpSelect,\r\n onKeyDown,\r\n onFocus,\r\n onBlur,\r\n style = {},\r\n wrapperComponent: WrapperComponent,\r\n headerWrapperComponent: HeaderWrapperComponent,\r\n footerWrapperComponent: FooterWrapperComponent,\r\n renderHeader,\r\n renderFooter,\r\n headerStyle = {},\r\n footerStyle = {},\r\n } = this.props;\r\n\r\n if (width) {\r\n style.width = width;\r\n }\r\n if (height) {\r\n style.height = height;\r\n }\r\n\r\n const classes = classNames({\r\n [`${prefixCls}`]: true,\r\n [className]: className,\r\n [`${prefixCls}-disabled`]: disabled,\r\n });\r\n\r\n // scrollViewBodyCls={`${prefixCls}-body`}\r\n // scrollViewBodyStyle={scrollViewBodyStyle}\r\n\r\n return (\r\n \r\n {\r\n renderHeader ?\r\n \r\n {renderHeader()}\r\n :\r\n null\r\n }\r\n {this.renderMenu()}\r\n {\r\n renderFooter ?\r\n \r\n {renderFooter()}\r\n :\r\n null\r\n }\r\n \r\n );\r\n }\r\n\r\n}","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport shallowEqual from 'shallowequal';\r\n\r\nexport default class ListItem extends React.Component {\r\n\r\n static propTypes = {\r\n prefixCls: PropTypes.string,\r\n onSelect: PropTypes.func,\r\n onDeselect: PropTypes.func,\r\n onClick: PropTypes.func,\r\n onMouseEnter: PropTypes.func,\r\n onMouseLeave: PropTypes.func,\r\n selected: PropTypes.bool,\r\n disabled: PropTypes.bool,\r\n item: PropTypes.object,\r\n }\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox-item',\r\n selected: false,\r\n disabled: false,\r\n }\r\n\r\n static isListItem = true;\r\n\r\n shouldComponentUpdate(nextProps, nextState) {\r\n return !shallowEqual(this.props, nextProps) ||\r\n !shallowEqual(this.state, nextState);\r\n }\r\n\r\n handleItemClick = (e) => {\r\n const { onSelect, onDeselect, onClick, selected, disabled, item } = this.props;\r\n const itemDOM = this.getItemDOM();\r\n if (disabled) return;\r\n\r\n if (onClick) {\r\n onClick(item, e);\r\n }\r\n\r\n if (!selected) {\r\n onSelect && onSelect(item, itemDOM)\r\n } else {\r\n onDeselect && onDeselect(item, itemDOM)\r\n }\r\n }\r\n\r\n saveItem = (dom) => {\r\n this.node = dom;\r\n }\r\n\r\n getItemDOM() {\r\n return this.node;\r\n }\r\n\r\n render() {\r\n const { prefixCls, disabled, selected, children, onMouseEnter, onMouseLeave } = this.props;\r\n const classes = classNames({\r\n [`${prefixCls}`]: true,\r\n [`${prefixCls}-selected`]: selected,\r\n [`${prefixCls}-disabled`]: disabled,\r\n });\r\n\r\n return \r\n {children}\r\n ;\r\n }\r\n\r\n}","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class ItemGroup extends React.Component {\r\n\r\n static propTypes = {\r\n label: PropTypes.node,\r\n children: PropTypes.node,\r\n prefixCls: PropTypes.string,\r\n onClick: PropTypes.func,\r\n item: PropTypes.object,\r\n }\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox-item-group',\r\n label: '',\r\n };\r\n\r\n static isListItemGroup = true;\r\n\r\n handleClick = (e) => {\r\n const {\r\n onClick,\r\n item\r\n } = this.props;\r\n\r\n if (onClick) {\r\n onClick(item, e);\r\n }\r\n }\r\n\r\n render() {\r\n const { prefixCls, label, children } = this.props;\r\n return (\r\n
\r\n {label}
\r\n
\r\n {children}\r\n
\r\n \r\n );\r\n }\r\n\r\n}\r\n","import ListBox from './ListBox';\r\nimport ListItem from './ListItem';\r\nimport ListItemGroup from './ListItemGroup';\r\n\r\nexport {\r\n ListBox,\r\n ListItem,\r\n ListItemGroup\r\n}\r\n\r\nListBox.ListItemGroup = ListItemGroup;\r\nListBox.ListItem = ListItem;\r\n\r\nexport default ListBox;\r\n","// extracted by mini-css-extract-plugin","\r\nvar ObjProto = Object.prototype\r\n\r\nvar toString = ObjProto.toString;\r\n\r\nvar\r\n nativeIsArray = Array.isArray;\r\n\r\nexport function isNumber(obj) {\r\n return typeof obj === 'number';\r\n}\r\n\r\nexport var isArray = nativeIsArray ? nativeIsArray : function (value) {\r\n return toString.call(value) === '[object Array]';\r\n}\r\n\r\nexport function isUndefined(obj) {\r\n return obj === undefined;\r\n}\r\n\r\n\r\nexport function isEqual(a, b) {\r\n return String(a) === String(b);\r\n}\r\n\r\nexport function noop() { }\r\n\r\n\r\nexport function each(obj, iterator, context) {\r\n if (obj == null) return obj;\r\n\r\n var i, length, hasContext = context === void 0 ? false : true;\r\n\r\n for (i = 0, length = obj.length; i < length; i++) {\r\n if (iterator.call(hasContext ? context : obj[i], obj[i], i, obj) === false) break;\r\n }\r\n\r\n return obj;\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/index.32677c7a.js b/docs/static/js/index.f435093b.js similarity index 97% rename from docs/static/js/index.32677c7a.js rename to docs/static/js/index.f435093b.js index 7cc2ca7..97de49f 100644 --- a/docs/static/js/index.32677c7a.js +++ b/docs/static/js/index.f435093b.js @@ -315,8 +315,6 @@ var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_mo var _src = _interopRequireDefault(__webpack_require__(/*! ../../src */ "./src/index.js")); -var ListItem = _src.default.ListItem, - ListItemGroup = _src.default.ListItemGroup; var dataset = []; var uuid = 100; @@ -592,7 +590,7 @@ function (_React$Component) { (0, _scrollIntoView.default)(e.target, _this.getListViewBody()); } - if (onItemClick) onItemClick(item); + if (onItemClick) onItemClick(item, e); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "onItemGroupClick", function (item, e) { var onItemGroupClick = _this.props.onItemGroupClick; @@ -601,7 +599,7 @@ function (_React$Component) { (0, _scrollIntoView.default)(e.target, _this.getListViewBody()); } - if (onItemGroupClick) onItemGroupClick(item); + if (onItemGroupClick) onItemGroupClick(item, e); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "onItemSelect", function (item, el) { var valueField = _this.props.valueField; @@ -612,7 +610,6 @@ function (_React$Component) { var _this$props = _this.props, multiple = _this$props.multiple, onChange = _this$props.onChange, - labelInValue = _this$props.labelInValue, valueField = _this$props.valueField; var selectedValue = _this.state.selectedValue; if (!multiple) return; @@ -975,9 +972,7 @@ function (_React$Component) { var _this$props7 = this.props, className = _this$props7.className, - value = _this$props7.value, prefixCls = _this$props7.prefixCls, - items = _this$props7.items, width = _this$props7.width, height = _this$props7.height, tabIndex = _this$props7.tabIndex, @@ -1006,9 +1001,7 @@ function (_React$Component) { style.height = height; } - var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); // scrollViewBodyCls={`${prefixCls}-body`} - // scrollViewBodyStyle={scrollViewBodyStyle} - + var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); return _react.default.createElement(WrapperComponent, { ref: this.saveListView, tabIndex: tabIndex, @@ -1021,11 +1014,11 @@ function (_React$Component) { ref: this.saveListViewHeader, className: "".concat(prefixCls, "-header"), style: headerStyle - }, renderHeader()) : null, this.renderMenu(), renderFooter ? _react.default.createElement(FooterWrapperComponent, { + }, renderHeader(this.props)) : null, this.renderMenu(), renderFooter ? _react.default.createElement(FooterWrapperComponent, { ref: this.saveListViewFooter, className: "".concat(prefixCls, "-footer"), style: footerStyle - }, renderFooter()) : null); + }, renderFooter(this.props)) : null); } }], [{ key: "getDerivedStateFromProps", @@ -1053,27 +1046,27 @@ function (_React$Component) { exports.default = ListBox; (0, _defineProperty2.default)(ListBox, "propTypes", { + prefixCls: _propTypes.default.string, className: _propTypes.default.string, style: _propTypes.default.object, - headerStyle: _propTypes.default.object, - footerStyle: _propTypes.default.object, - bodyStyle: _propTypes.default.object, - prefixCls: _propTypes.default.string, + width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), + height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), + tabIndex: _propTypes.default.number, + multiple: _propTypes.default.bool, + defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), + disabled: _propTypes.default.bool, + autoFocus: _propTypes.default.bool, valueField: _propTypes.default.string, labelField: _propTypes.default.string, childrenField: _propTypes.default.string, + headerStyle: _propTypes.default.object, + footerStyle: _propTypes.default.object, + bodyStyle: _propTypes.default.object, items: _propTypes.default.array, itemsMap: _propTypes.default.object, - defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), - value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), emptyLabel: _propTypes.default.any, - multiple: _propTypes.default.bool, - disabled: _propTypes.default.bool, - autoFocus: _propTypes.default.bool, - width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), - height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), labelInValue: _propTypes.default.bool, - tabIndex: _propTypes.default.number, enableDownUpSelect: _propTypes.default.bool, fixListBodyHeightOnIE: _propTypes.default.bool, onItemClick: _propTypes.default.func, @@ -1371,34 +1364,10 @@ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs2/help Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "ListBox", { - enumerable: true, - get: function get() { - return _ListBox.default; - } -}); -Object.defineProperty(exports, "ListItem", { - enumerable: true, - get: function get() { - return _ListItem.default; - } -}); -Object.defineProperty(exports, "ListItemGroup", { - enumerable: true, - get: function get() { - return _ListItemGroup.default; - } -}); exports.default = void 0; var _ListBox = _interopRequireDefault(__webpack_require__(/*! ./ListBox */ "./src/ListBox.js")); -var _ListItem = _interopRequireDefault(__webpack_require__(/*! ./ListItem */ "./src/ListItem.js")); - -var _ListItemGroup = _interopRequireDefault(__webpack_require__(/*! ./ListItemGroup */ "./src/ListItemGroup.js")); - -_ListBox.default.ListItemGroup = _ListItemGroup.default; -_ListBox.default.ListItem = _ListItem.default; var _default = _ListBox.default; exports.default = _default; @@ -1492,4 +1461,4 @@ module.exports = __webpack_require__(/*! D:\wamp\www\github-projects\react-widge /***/ }) /******/ }); -//# sourceMappingURL=index.32677c7a.js.map \ No newline at end of file +//# sourceMappingURL=index.f435093b.js.map \ No newline at end of file diff --git a/docs/static/js/index.f435093b.js.map b/docs/static/js/index.f435093b.js.map new file mode 100644 index 0000000..00571e5 --- /dev/null +++ b/docs/static/js/index.f435093b.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./examples/Demo.js","webpack:///./examples/DemoList.js","webpack:///./examples/demos/demo1.js","webpack:///./examples/index.js","webpack:///./examples/style/animate.scss?bdcb","webpack:///./examples/style/index.scss?2d25","webpack:///./src/ListBox.js","webpack:///./src/ListItem.js","webpack:///./src/ListItemGroup.js","webpack:///./src/index.js","webpack:///./src/style/index.scss?9cab","webpack:///./src/util.js"],"names":["Demo","current","DemoList","item","e","setState","state","map","i","onDemoChange","bind","label","Component","component","Demo1","dataset","uuid","items","d","children","push","j","value","disabled","DEMO","console","log","maxWidth","maxHeight","a","borderBottom","borderTop","handleChange","filter","indexOf","filterMsg","handleChange2","height","ReactDOM","render","demo","noop","copy","data","concat","getItemsMap","props","valueField","childrenField","maps","toMaps","forEach","ListBox","onItemClick","target","getListViewBody","onItemGroupClick","el","setValue","multiple","onChange","selectedValue","newSelectedValue","transformChangeValue","prefixCls","selector","activeCls","selectCls","list","getActiveIndex","keyCode","idx","UP","DOWN","sIdx","dom","ENTER","indexValueMap","_indexValueMap","activeIndex","_activeIndex","enableDownUpSelect","onKeyDown","querySelectorAll","length","minIndex","maxIndex","preventDefault","getAttribute","itemsMap","node","_listview","_listview_header","_listview_body","_listview_footer","defaultValue","_itemIndex","autoFocus","focus","selectedItem","querySelector","blur","labelInValue","v","selectedMap","labelField","renderMenuItem","renderMenuGroupTitle","isGroup","itemPrefixCls","onMouseEnter","onMouseLeave","itemIndex","currentTarget","onItemSelect","onItemDeselect","renderListItems","emptyLabel","getListView","header","getListViewHeader","footer","getListViewFooter","body","style","hasScroll","scrollHeight","clientHeight","headerHeight","offsetHeight","footerHeight","fixListBodyHeightOnIE","resizeListBoxBodyHeight","BodyWrapperComponent","bodyWrapperComponent","bodyStyle","renderMenu","Menus","renderList","saveListViewBody","className","width","tabIndex","onFocus","onBlur","WrapperComponent","wrapperComponent","HeaderWrapperComponent","headerWrapperComponent","FooterWrapperComponent","footerWrapperComponent","renderHeader","renderFooter","headerStyle","footerStyle","classes","saveListView","saveListViewHeader","saveListViewFooter","nextProps","prevState","newState","React","PropTypes","string","object","oneOfType","number","bool","array","any","func","ListItem","onSelect","onDeselect","onClick","selected","itemDOM","getItemDOM","nextState","saveItem","handleItemClick","ItemGroup","handleClick","ObjProto","Object","prototype","toString","nativeIsArray","isNumber","obj","isArray","call","isUndefined","undefined","isEqual","b","String","each","iterator","context","hasContext"],"mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAiB,4BAA4B;AAC7C;AACA;AACA,0BAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA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E,EAA4E;AAC/E;;AAED,SAAOA,GAAP;AACH,C","file":"static\\js\\index.f435093b.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import React, { Component } from 'react';\r\nimport DemoList from './DemoList';\r\n\r\nexport default class Demo extends Component {\r\n\r\n state = {\r\n current: DemoList[0]\r\n }\r\n\r\n onDemoChange(item, e) {\r\n this.setState({\r\n current: item\r\n });\r\n }\r\n\r\n render() {\r\n const { current } = this.state;\r\n return (\r\n
\r\n
\r\n {\r\n DemoList.map((item, i) => {\r\n return (\r\n \r\n {item.label}\r\n
\r\n );\r\n })\r\n }\r\n
\r\n
\r\n {current ? : null}\r\n
\r\n \r\n )\r\n }\r\n}","import Demo1 from './demos/demo1';\r\n// import Demo2 from './demos/Demo2';\r\n// import Demo3 from './demos/Demo3';\r\n// import Demo4 from './demos/Demo4';\r\n\r\nexport default [\r\n {\r\n label: '基本功能',\r\n component: Demo1\r\n }\r\n]","import React, { Component } from 'react';\r\nimport ListBox from '../../src';\r\n\r\nconst dataset = [];\r\n\r\nvar uuid = 100;\r\n\r\nfor (let i = 0; i < 10; i++) {\r\n const items = [];\r\n const d = {\r\n children: items,\r\n label: '分组' + (i + 1)\r\n }\r\n\r\n dataset.push(d)\r\n\r\n for (let j = 0; j < 40; j++) {\r\n let d = {\r\n value: uuid++,\r\n label: '选项' + (j + 1),\r\n disabled: !(j % 5)\r\n }\r\n items.push(d)\r\n }\r\n}\r\n\r\n\r\nexport default class DEMO extends Component {\r\n\r\n state = {\r\n value: 2\r\n }\r\n\r\n\r\n handleChange = (value) => {\r\n this.setState({\r\n value\r\n })\r\n\r\n console.log('changed ', value)\r\n }\r\n\r\n handleChange2 = (value) => {\r\n console.log('changed ', value)\r\n }\r\n\r\n filterMsg = ''\r\n\r\n render() {\r\n\r\n return (\r\n
\r\n

header

}\r\n renderFooter={() =>

footer

}\r\n renderMenu={(a) => a}\r\n renderMenuItem={(a) => a + '-opt'}\r\n renderMenuGroupTitle={(a) => a + '-opt'}\r\n headerStyle={{\r\n borderBottom: '1px solid #ccc'\r\n }}\r\n footerStyle={{\r\n borderTop: '1px solid #ccc'\r\n }}\r\n value={this.state.value}\r\n onChange={this.handleChange}\r\n items={dataset.filter((item, i) => item.label.indexOf(this.filterMsg) >= 0)}\r\n emptyLabel=\"无匹配项\"\r\n onItemGroupClick={(d) => console.log(d)}\r\n />\r\n\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n}\r\n","import React from 'react'\r\nimport ReactDOM from 'react-dom';\r\n\r\nimport './style/index.scss';\r\nimport './style/animate.scss';\r\n\r\n//import 'react-widget-scrollview/lib/style/index.css';\r\nimport '../src/style/index.scss';\r\n\r\nimport Demo from './Demo';\r\n\r\n\r\nReactDOM.render(, demo);","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","import React from 'react';\r\nimport { findDOMNode } from 'react-dom';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport isIE from 'bplokjs-utils/isIE';\r\nimport ListItem from './ListItem';\r\nimport ListItemGroup from './ListItemGroup';\r\nimport { isArray, isUndefined, isEqual, each } from './util';\r\nimport { hasClass, addClass, removeClass } from 'bplokjs-dom-utils/classes';\r\nimport scrollIntoView from 'bplokjs-dom-utils/scrollIntoView';\r\n\r\nfunction noop() { }\r\n\r\nfunction copy(data) {\r\n return isArray(data) ? [].concat(data) : data;\r\n}\r\n\r\nfunction getItemsMap(props) {\r\n const { items, valueField, childrenField } = props;\r\n const maps = {};\r\n\r\n function toMaps(items) {\r\n items.forEach(item => {\r\n if (item[childrenField] && Array.isArray(item[childrenField])) {\r\n toMaps(item[childrenField]);\r\n } else {\r\n maps[item[valueField]] = item;\r\n }\r\n });\r\n }\r\n\r\n toMaps(items);\r\n\r\n return maps;\r\n}\r\n\r\nexport default class ListBox extends React.Component {\r\n\r\n static propTypes = {\r\n prefixCls: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n tabIndex: PropTypes.number,\r\n multiple: PropTypes.bool,\r\n defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\r\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\r\n disabled: PropTypes.bool,\r\n autoFocus: PropTypes.bool,\r\n valueField: PropTypes.string,\r\n labelField: PropTypes.string,\r\n childrenField: PropTypes.string,\r\n headerStyle: PropTypes.object,\r\n footerStyle: PropTypes.object,\r\n bodyStyle: PropTypes.object,\r\n items: PropTypes.array,\r\n itemsMap: PropTypes.object,\r\n emptyLabel: PropTypes.any,\r\n labelInValue: PropTypes.bool,\r\n enableDownUpSelect: PropTypes.bool,\r\n fixListBodyHeightOnIE: PropTypes.bool,\r\n onItemClick: PropTypes.func,\r\n onItemGroupClick: PropTypes.func,\r\n onChange: PropTypes.func,\r\n onFocus: PropTypes.func,\r\n onBlur: PropTypes.func,\r\n onKeyDown: PropTypes.func,\r\n renderMenu: PropTypes.func,\r\n renderMenuGroupTitle: PropTypes.func,\r\n renderMenuItem: PropTypes.func,\r\n renderHeader: PropTypes.func,\r\n renderFooter: PropTypes.func,\r\n wrapperComponent: PropTypes.node,\r\n headerWrapperComponent: PropTypes.node,\r\n bodyWrapperComponent: PropTypes.node,\r\n footerWrapperComponent: PropTypes.node,\r\n };\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox',\r\n valueField: 'value',\r\n labelField: 'label',\r\n childrenField: 'children',\r\n labelInValue: false,\r\n tabIndex: 0,\r\n emptyLabel: 'Not Found',\r\n enableDownUpSelect: true,\r\n fixListBodyHeightOnIE: true,\r\n items: [],\r\n itemsMap: null,\r\n onFocus: noop,\r\n onBlur: noop,\r\n onKeyDown: noop,\r\n wrapperComponent: \"div\",\r\n headerWrapperComponent: 'div',\r\n bodyWrapperComponent: 'div',\r\n footerWrapperComponent: 'div',\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n const selectedValue = [];\r\n let value;\r\n\r\n if (!isUndefined(props.defaultValue)) {\r\n value = isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];\r\n }\r\n\r\n if (value) {\r\n selectedValue.push(...value);\r\n }\r\n\r\n //item 索引id\r\n this._itemIndex = 0;\r\n //索引值对应的item.value\r\n this._indexValueMap = {};\r\n this._activeIndex = null;\r\n\r\n this.state = {\r\n selectedValue\r\n };\r\n }\r\n\r\n static getDerivedStateFromProps(nextProps, prevState) {\r\n const value = nextProps.value;\r\n let itemsMap = nextProps.itemsMap || {};\r\n\r\n if (!nextProps.itemsMap) {\r\n itemsMap = getItemsMap(nextProps);\r\n }\r\n\r\n const newState = {\r\n itemsMap\r\n };\r\n\r\n if (!isUndefined(value)) {\r\n newState.selectedValue = isArray(value) ? copy(value) : [value];\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n componentDidMount() {\r\n const { prefixCls, autoFocus } = this.props;\r\n const el = findDOMNode(this);\r\n const selector = `.${prefixCls}-item-selected`;\r\n\r\n if (autoFocus) {\r\n this.focus();\r\n }\r\n\r\n const selectedItem = el.querySelector(selector);\r\n if (selectedItem) {\r\n scrollIntoView(selectedItem, this.getListViewBody());\r\n }\r\n }\r\n\r\n focus() {\r\n findDOMNode(this).focus();\r\n }\r\n\r\n blur() {\r\n findDOMNode(this).blur();\r\n }\r\n\r\n onItemClick = (item, e) => {\r\n const { onItemClick } = this.props;\r\n if (e) {\r\n scrollIntoView(e.target, this.getListViewBody());\r\n }\r\n\r\n if (onItemClick) onItemClick(item, e);\r\n }\r\n\r\n onItemGroupClick = (item, e) => {\r\n const { onItemGroupClick } = this.props;\r\n if (e) {\r\n scrollIntoView(e.target, this.getListViewBody());\r\n }\r\n\r\n if (onItemGroupClick) onItemGroupClick(item, e);\r\n }\r\n\r\n transformChangeValue(value) {\r\n const { labelInValue } = this.props;\r\n const { itemsMap } = this.state;\r\n\r\n if (labelInValue) {\r\n return isArray(value) ?\r\n value.map(v => itemsMap[v]) :\r\n itemsMap[value];\r\n }\r\n\r\n return value;\r\n }\r\n\r\n setValue(value) {\r\n const { multiple, onChange } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n if (!multiple) {\r\n selectedValue.length = 0;\r\n }\r\n\r\n selectedValue.push(value);\r\n if (!('value' in this.props)) {\r\n this.setState({\r\n selectedValue\r\n })\r\n }\r\n\r\n if (onChange) {\r\n onChange(this.transformChangeValue(multiple ? copy(selectedValue) : selectedValue[0]));\r\n }\r\n }\r\n\r\n getVaule() {\r\n const { multiple } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n return this.transformChangeValue(multiple ? copy(selectedValue) : selectedValue[0]);\r\n }\r\n\r\n onItemSelect = (item, el) => {\r\n const { valueField } = this.props;\r\n this.setValue(item[valueField]);\r\n }\r\n\r\n onItemDeselect = (item, el) => {\r\n const { multiple, onChange, valueField } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n if (!multiple) return;\r\n\r\n let newSelectedValue = selectedValue.filter((d) => !isEqual(item[valueField], d));\r\n\r\n if (!('value' in this.props)) {\r\n this.setState({\r\n selectedValue: newSelectedValue\r\n })\r\n }\r\n\r\n if (onChange) {\r\n onChange(this.transformChangeValue(copy(newSelectedValue)));\r\n }\r\n\r\n }\r\n\r\n onKeyDown = (e) => {\r\n const { prefixCls } = this.props;\r\n const selector = `.${prefixCls}-item:not(.${prefixCls}-item-disabled)`;\r\n const activeCls = `${prefixCls}-item-active`;\r\n const selectCls = `${prefixCls}-item-selected`;\r\n let list = null;//NodeList[]\r\n\r\n function getActiveIndex(keyCode) {\r\n let idx = -1;\r\n const UP = keyCode === 38;\r\n const DOWN = keyCode === 40;\r\n let sIdx = -1;\r\n\r\n if (list) {\r\n //ie no support NodeList.prototype.forEach\r\n each(list, (item, i) => {\r\n if (hasClass(item, activeCls)) {\r\n removeClass(item, activeCls);\r\n if (UP) {\r\n if (idx === -1) idx = i;\r\n } else {\r\n idx = i;\r\n }\r\n } else if (idx === -1 && hasClass(item, selectCls)) {\r\n sIdx = i;\r\n }\r\n })\r\n }\r\n\r\n return idx === -1 ? sIdx : idx;\r\n }\r\n\r\n const props = this.props;\r\n const state = this.state;\r\n const dom = findDOMNode(this);\r\n const UP = e.keyCode === 38;\r\n const DOWN = e.keyCode === 40;\r\n const ENTER = e.keyCode === 13;\r\n const indexValueMap = this._indexValueMap;\r\n const activeIndex = this._activeIndex;\r\n\r\n if (props.enableDownUpSelect) {\r\n props.onKeyDown(e);\r\n }\r\n\r\n if (!list) {\r\n list = dom.querySelectorAll(selector);\r\n }\r\n\r\n if (!list.length) return;\r\n\r\n const minIndex = 0;\r\n const maxIndex = list.length - 1;\r\n\r\n if (UP || DOWN) {\r\n e.preventDefault();\r\n let idx = getActiveIndex(e.keyCode);\r\n\r\n if (UP) {\r\n idx = idx === -1 ? maxIndex : --idx;\r\n if (idx < 0) idx = maxIndex;\r\n addClass(list[idx], activeCls);\r\n } else {\r\n idx = idx === -1 ? minIndex : ++idx;\r\n if (idx > maxIndex) idx = 0;\r\n addClass(list[idx], activeCls);\r\n }\r\n\r\n this._activeIndex = list[idx].getAttribute('data-index');\r\n scrollIntoView(list[idx], this.getListViewBody());\r\n } else if (ENTER && activeIndex !== null) {\r\n const value = indexValueMap[activeIndex];\r\n const item = state.itemsMap[value];\r\n this.setValue(value);\r\n //触发onItemClick\r\n this.onItemClick(item);\r\n }\r\n\r\n }\r\n\r\n renderListItems(items, selectedMap) {\r\n const { labelField, valueField, childrenField, prefixCls, disabled, renderMenuItem, renderMenuGroupTitle } = this.props;\r\n\r\n return items.map(item => {\r\n\r\n const isGroup = item[childrenField];\r\n const itemPrefixCls = `${prefixCls}-item`;\r\n const activeCls = `${prefixCls}-item-active`;\r\n let onMouseEnter = noop;\r\n let onMouseLeave = noop;\r\n let itemIndex = this._itemIndex++;\r\n\r\n if (!isGroup) {\r\n this._indexValueMap[itemIndex] = item[valueField];\r\n\r\n if (!disabled && !item.disabled) {\r\n onMouseEnter = e => {\r\n addClass(e.currentTarget, activeCls);\r\n }\r\n onMouseLeave = e => {\r\n removeClass(e.currentTarget, activeCls);\r\n }\r\n }\r\n }\r\n\r\n return !isGroup ? (\r\n \r\n {renderMenuItem ? renderMenuItem(item[labelField], item) : item[labelField]}\r\n \r\n ) : (\r\n \r\n {this.renderListItems(item[childrenField] || [], selectedMap)}\r\n \r\n );\r\n });\r\n }\r\n\r\n renderList() {\r\n const { items, emptyLabel } = this.props;\r\n const { selectedValue } = this.state;\r\n\r\n const selectedMap = {};\r\n selectedValue.forEach(v => selectedMap[v] = true);\r\n\r\n this._itemIndex = 0;\r\n this._indexValueMap = {};\r\n this._activeIndex = null;\r\n\r\n if (items && !items.length) {\r\n return emptyLabel;\r\n }\r\n\r\n return this.renderListItems(items, selectedMap);\r\n }\r\n\r\n saveListView = (node) => {\r\n this._listview = node;\r\n }\r\n\r\n saveListViewHeader = (node) => {\r\n this._listview_header = node;\r\n }\r\n\r\n saveListViewBody = (node) => {\r\n this._listview_body = node;\r\n }\r\n\r\n saveListViewFooter = (node) => {\r\n this._listview_footer = node;\r\n }\r\n\r\n getListView() {\r\n return findDOMNode(this._listview);\r\n }\r\n\r\n getListViewHeader() {\r\n return findDOMNode(this._listview_header);\r\n }\r\n\r\n getListViewBody() {\r\n return findDOMNode(this._listview_body);\r\n }\r\n\r\n getListViewFooter() {\r\n return findDOMNode(this._listview_footer);\r\n }\r\n //修正IE对flex支持不够完善\r\n resizeListBoxBodyHeight() {\r\n const dom = this.getListView();\r\n const header = this.getListViewHeader();\r\n const footer = this.getListViewFooter();\r\n const body = this.getListViewBody();\r\n\r\n body.style.maxHeight = '';\r\n\r\n const hasScroll = dom.scrollHeight > dom.clientHeight;\r\n\r\n const headerHeight = header ? header.offsetHeight : 0;\r\n const footerHeight = footer ? footer.offsetHeight : 0;\r\n\r\n if (hasScroll) {\r\n body.style.maxHeight = (dom.clientHeight - headerHeight - footerHeight) + 'px';\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n const fixListBodyHeightOnIE = this.props.fixListBodyHeightOnIE;\r\n if (isIE() && fixListBodyHeightOnIE) {\r\n this.resizeListBoxBodyHeight();\r\n }\r\n }\r\n\r\n componentDidUpdate() {\r\n const fixListBodyHeightOnIE = this.props.fixListBodyHeightOnIE;\r\n if (isIE() && fixListBodyHeightOnIE) {\r\n this.resizeListBoxBodyHeight();\r\n }\r\n }\r\n\r\n renderMenu() {\r\n const {\r\n bodyWrapperComponent: BodyWrapperComponent,\r\n prefixCls,\r\n bodyStyle = {},\r\n renderMenu,\r\n } = this.props;\r\n\r\n const Menus = this.renderList();\r\n\r\n return (\r\n \r\n {renderMenu ? renderMenu(Menus, this.props) : Menus}\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n className,\r\n prefixCls,\r\n width,\r\n height,\r\n tabIndex,\r\n disabled,\r\n enableDownUpSelect,\r\n onKeyDown,\r\n onFocus,\r\n onBlur,\r\n style = {},\r\n wrapperComponent: WrapperComponent,\r\n headerWrapperComponent: HeaderWrapperComponent,\r\n footerWrapperComponent: FooterWrapperComponent,\r\n renderHeader,\r\n renderFooter,\r\n headerStyle = {},\r\n footerStyle = {},\r\n } = this.props;\r\n\r\n if (width) {\r\n style.width = width;\r\n }\r\n if (height) {\r\n style.height = height;\r\n }\r\n\r\n const classes = classNames({\r\n [`${prefixCls}`]: true,\r\n [className]: className,\r\n [`${prefixCls}-disabled`]: disabled,\r\n });\r\n\r\n return (\r\n \r\n {\r\n renderHeader ?\r\n \r\n {renderHeader(this.props)}\r\n :\r\n null\r\n }\r\n {this.renderMenu()}\r\n {\r\n renderFooter ?\r\n \r\n {renderFooter(this.props)}\r\n :\r\n null\r\n }\r\n \r\n );\r\n }\r\n\r\n}","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport shallowEqual from 'shallowequal';\r\n\r\nexport default class ListItem extends React.Component {\r\n\r\n static propTypes = {\r\n prefixCls: PropTypes.string,\r\n onSelect: PropTypes.func,\r\n onDeselect: PropTypes.func,\r\n onClick: PropTypes.func,\r\n onMouseEnter: PropTypes.func,\r\n onMouseLeave: PropTypes.func,\r\n selected: PropTypes.bool,\r\n disabled: PropTypes.bool,\r\n item: PropTypes.object,\r\n }\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox-item',\r\n selected: false,\r\n disabled: false,\r\n }\r\n\r\n static isListItem = true;\r\n\r\n shouldComponentUpdate(nextProps, nextState) {\r\n return !shallowEqual(this.props, nextProps) ||\r\n !shallowEqual(this.state, nextState);\r\n }\r\n\r\n handleItemClick = (e) => {\r\n const { onSelect, onDeselect, onClick, selected, disabled, item } = this.props;\r\n const itemDOM = this.getItemDOM();\r\n if (disabled) return;\r\n\r\n if (onClick) {\r\n onClick(item, e);\r\n }\r\n\r\n if (!selected) {\r\n onSelect && onSelect(item, itemDOM)\r\n } else {\r\n onDeselect && onDeselect(item, itemDOM)\r\n }\r\n }\r\n saveItem = (dom) => {\r\n this.node = dom;\r\n }\r\n\r\n getItemDOM() {\r\n return this.node;\r\n }\r\n\r\n render() {\r\n const { prefixCls, disabled, selected, children, onMouseEnter, onMouseLeave } = this.props;\r\n const classes = classNames({\r\n [`${prefixCls}`]: true,\r\n [`${prefixCls}-selected`]: selected,\r\n [`${prefixCls}-disabled`]: disabled,\r\n });\r\n\r\n return \r\n {children}\r\n ;\r\n }\r\n\r\n}","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class ItemGroup extends React.Component {\r\n\r\n static propTypes = {\r\n label: PropTypes.node,\r\n children: PropTypes.node,\r\n prefixCls: PropTypes.string,\r\n onClick: PropTypes.func,\r\n item: PropTypes.object,\r\n }\r\n\r\n static defaultProps = {\r\n prefixCls: 'rw-listbox-item-group',\r\n label: '',\r\n };\r\n\r\n static isListItemGroup = true;\r\n\r\n handleClick = (e) => {\r\n const {\r\n onClick,\r\n item\r\n } = this.props;\r\n\r\n if (onClick) {\r\n onClick(item, e);\r\n }\r\n }\r\n\r\n render() {\r\n const { prefixCls, label, children } = this.props;\r\n return (\r\n
\r\n {label}
\r\n
\r\n {children}\r\n
\r\n \r\n );\r\n }\r\n\r\n}\r\n","import ListBox from './ListBox';\r\n\r\nexport default ListBox;\r\n","// extracted by mini-css-extract-plugin","\r\nvar ObjProto = Object.prototype\r\n\r\nvar toString = ObjProto.toString;\r\n\r\nvar\r\n nativeIsArray = Array.isArray;\r\n\r\nexport function isNumber(obj) {\r\n return typeof obj === 'number';\r\n}\r\n\r\nexport var isArray = nativeIsArray ? nativeIsArray : function (value) {\r\n return toString.call(value) === '[object Array]';\r\n}\r\n\r\nexport function isUndefined(obj) {\r\n return obj === undefined;\r\n}\r\n\r\n\r\nexport function isEqual(a, b) {\r\n return String(a) === String(b);\r\n}\r\n\r\nexport function noop() { }\r\n\r\n\r\nexport function each(obj, iterator, context) {\r\n if (obj == null) return obj;\r\n\r\n var i, length, hasContext = context === void 0 ? false : true;\r\n\r\n for (i = 0, length = obj.length; i < length; i++) {\r\n if (iterator.call(hasContext ? context : obj[i], obj[i], i, obj) === false) break;\r\n }\r\n\r\n return obj;\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/ListBox.js b/lib/ListBox.js index dcfbd3d..570104c 100644 --- a/lib/ListBox.js +++ b/lib/ListBox.js @@ -89,7 +89,7 @@ function (_React$Component) { (0, _scrollIntoView.default)(e.target, _this.getListViewBody()); } - if (onItemClick) onItemClick(item); + if (onItemClick) onItemClick(item, e); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "onItemGroupClick", function (item, e) { var onItemGroupClick = _this.props.onItemGroupClick; @@ -98,7 +98,7 @@ function (_React$Component) { (0, _scrollIntoView.default)(e.target, _this.getListViewBody()); } - if (onItemGroupClick) onItemGroupClick(item); + if (onItemGroupClick) onItemGroupClick(item, e); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "onItemSelect", function (item, el) { var valueField = _this.props.valueField; @@ -109,7 +109,6 @@ function (_React$Component) { var _this$props = _this.props, multiple = _this$props.multiple, onChange = _this$props.onChange, - labelInValue = _this$props.labelInValue, valueField = _this$props.valueField; var selectedValue = _this.state.selectedValue; if (!multiple) return; @@ -514,11 +513,11 @@ function (_React$Component) { ref: this.saveListViewHeader, className: "".concat(prefixCls, "-header"), style: headerStyle - }, renderHeader()) : null, this.renderMenu(), renderFooter ? _react.default.createElement(FooterWrapperComponent, { + }, renderHeader(this.props)) : null, this.renderMenu(), renderFooter ? _react.default.createElement(FooterWrapperComponent, { ref: this.saveListViewFooter, className: "".concat(prefixCls, "-footer"), style: footerStyle - }, renderFooter()) : null); + }, renderFooter(this.props)) : null); } }], [{ key: "getDerivedStateFromProps", @@ -546,27 +545,27 @@ function (_React$Component) { exports.default = ListBox; (0, _defineProperty2.default)(ListBox, "propTypes", { + prefixCls: _propTypes.default.string, className: _propTypes.default.string, style: _propTypes.default.object, - headerStyle: _propTypes.default.object, - footerStyle: _propTypes.default.object, - bodyStyle: _propTypes.default.object, - prefixCls: _propTypes.default.string, + width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), + height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), + tabIndex: _propTypes.default.number, + multiple: _propTypes.default.bool, + defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), + disabled: _propTypes.default.bool, + autoFocus: _propTypes.default.bool, valueField: _propTypes.default.string, labelField: _propTypes.default.string, childrenField: _propTypes.default.string, + headerStyle: _propTypes.default.object, + footerStyle: _propTypes.default.object, + bodyStyle: _propTypes.default.object, items: _propTypes.default.array, itemsMap: _propTypes.default.object, - defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), - value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array]), emptyLabel: _propTypes.default.any, - multiple: _propTypes.default.bool, - disabled: _propTypes.default.bool, - autoFocus: _propTypes.default.bool, - width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), - height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), labelInValue: _propTypes.default.bool, - tabIndex: _propTypes.default.number, enableDownUpSelect: _propTypes.default.bool, fixListBodyHeightOnIE: _propTypes.default.bool, onItemClick: _propTypes.default.func, diff --git a/lib/ListItem.js b/lib/ListItem.js index d2726f9..1985256 100644 --- a/lib/ListItem.js +++ b/lib/ListItem.js @@ -70,6 +70,9 @@ function (_React$Component) { onDeselect && onDeselect(item, itemDOM); } }); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "saveItem", function (dom) { + _this.node = dom; + }); return _this; } @@ -78,6 +81,11 @@ function (_React$Component) { value: function shouldComponentUpdate(nextProps, nextState) { return !(0, _shallowequal.default)(this.props, nextProps) || !(0, _shallowequal.default)(this.state, nextState); } + }, { + key: "getItemDOM", + value: function getItemDOM() { + return this.node; + } }, { key: "render", value: function render() { @@ -92,6 +100,7 @@ function (_React$Component) { onMouseLeave = _this$props2.onMouseLeave; var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-selected"), selected), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); return _react.default.createElement("div", { + ref: this.saveItem, className: classes, onClick: this.handleItemClick, onMouseEnter: onMouseEnter, diff --git a/lib/__util.js b/lib/__util.js deleted file mode 100644 index ec74c9b..0000000 --- a/lib/__util.js +++ /dev/null @@ -1,443 +0,0 @@ - -'use strict'; - -var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isString = isString; -exports.isNumber = isNumber; -exports.isNull = isNull; -exports.isTrue = isTrue; -exports.isUndefined = isUndefined; -exports.isDefined = isDefined; -exports.isStringOrNumber = isStringOrNumber; -exports.isNullOrUndef = isNullOrUndef; -exports.isInvalid = isInvalid; -exports.isEmpty = isEmpty; -exports.isPromiseLike = isPromiseLike; -exports.isWindow = isWindow; -exports.isEmptyObject = isEmptyObject; -exports.throwError = throwError; -exports.warning = warning; -exports.isArrayLike = isArrayLike; -exports.identity = identity; -exports.has = has; -exports.keys = keys; -exports.extend = extend; -exports.isEqual = isEqual; -exports.extendIf = extendIf; -exports.values = values; -exports.noop = noop; -exports.toArray = toArray; -exports.each = each; -exports.map = map; -exports.filter = filter; -exports.compact = compact; -exports.indexOf = indexOf; -exports.contains = contains; -exports.uniq = uniq; -exports.range = range; -exports.bind = bind; -exports.uuid = uuid; -exports.delay = delay; -exports.classNames = classNames; -exports.isError = exports.isRegExp = exports.isDate = exports.isFunction = exports.isArguments = exports.forEach = exports.now = exports.isObject = exports.isArray = void 0; - -var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof")); - -var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now")); - -var _create = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/create")); - -var _keys2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys")); - -var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array")); - -var ArrayProto = Array.prototype, - ObjProto = Object.prototype, - FuncProto = Function.prototype; -var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; -var nativeIsArray = _isArray.default, - nativeKeys = _keys2.default, - nativeBind = FuncProto.bind, - nativeCreate = _create.default; -var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - -function _extend(dest, source) { - var i, j, k; - - for (i in source) { - dest[i] = source[i]; - } - - return dest; -} - -function isString(obj) { - return typeof obj === 'string'; -} - -function isNumber(obj) { - return typeof obj === 'number'; -} - -var isArray = nativeIsArray ? nativeIsArray : function (value) { - return toString.call(value) === '[object Array]'; -}; -exports.isArray = isArray; - -function isNull(obj) { - return obj === null; -} - -function isTrue(obj) { - return obj === true; -} - -function isUndefined(obj) { - return obj === undefined; -} - -function isDefined(obj) { - return obj !== undefined; -} - -function isStringOrNumber(obj) { - return isString(obj) || isNumber(obj); -} - -function isNullOrUndef(obj) { - return isUndefined(obj) || isNull(obj); -} - -function isInvalid(obj) { - return isNull(obj) || obj === false || isTrue(obj) || isUndefined(obj); -} - -function isEmpty(value, allowEmptyString) { - return value === null || value === undefined || (!allowEmptyString ? value === '' : false) || isArray(value) && value.length === 0 || isObject(value) && isEmptyObject(value); //return (!allowEmptyString ? value === '' : false) || isEmpty(value); -} - -function isPromiseLike(promise) { - return promise && isFunction(promise.then); -} - -function isWindow(obj) { - return obj != null && obj == obj.window; -} - -function isEmptyObject(obj) { - var name; - - for (name in obj) { - return false; - } - - return true; -} - -function throwError(message) { - if (!message) { - message = 'a runtime error occured!'; - } - - throw new Error("Neact Error: ".concat(message)); -} - -function warning(message) { - console && console.warn(message); -} - -function isArrayLike(obj) { - var length = obj == null ? void 0 : obj.length; - return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; -} - -var isObject = toString.call(null) === '[object Object]' ? function (value) { - // check ownerDocument here as well to exclude DOM nodes - return value !== null && value !== undefined && toString.call(value) === '[object Object]' && value.ownerDocument === undefined; -} : function (value) { - return toString.call(value) === '[object Object]'; -}; -exports.isObject = isObject; - -var now = _now.default || function () { - return new Date().getTime(); -}; - -exports.now = now; - -function identity(value) { - return value; -} - -function has(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); -} - -function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - - for (var key in obj) { - if (has(obj, key)) keys.push(key); - } - - return keys; -} - -function extend(dest, sources) { - if (!dest) { - dest = {}; - } - - for (var i = 1, l = arguments.length; i < l; i++) { - _extend(dest, arguments[i]); - } - - return dest; -} - -function isEqual(a, b) { - return String(a) === String(b); -} - -function extendIf(dest, sources) { - var i = 1, - l = arguments.length, - prop; - - if (!dest) { - dest = {}; - } - - for (; i < l; i++) { - for (prop in arguments[i]) { - if (dest[prop] === undefined) { - dest[prop] = arguments[i][prop]; - } - } - } - - return dest; -} - -function values(obj) { - var keys = keys(obj); - var length = keys.length; - var values = Array(length); - - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - - return values; -} - -function noop() {} - -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -function each(obj, iterator, context) { - if (obj == null) return obj; - var i, - length, - hasContext = context === void 0 ? false : true; - - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - if (iterator.call(hasContext ? context : obj[i], obj[i], i, obj) === false) break; - } - } else { - var _keys = keys(obj); - - for (i = 0, length = _keys.length; i < length; i++) { - if (iterator.call(hasContext ? context : obj[_keys[i]], obj[_keys[i]], _keys[i], obj) === false) break; - } - } - - return obj; -} - -var forEach = each; -exports.forEach = forEach; - -function map(obj, iterator, context) { - if (obj == null) return obj; - var i, - length, - results = [], - hasContext = context === void 0 ? false : true; - - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - results.push(iterator.call(hasContext ? context : obj[i], obj[i], i, obj)); - } - } else { - var keys = keys(obj); - - for (i = 0, length = keys.length; i < length; i++) { - results.push(iterator.call(hasContext ? context : obj[keys[i]], obj[keys[i]], keys[i], obj)); - } - } - - return results; -} - -function filter(obj, iterator, context) { - var results = [], - hasContext = context === void 0 ? false : true; - each(obj, function (value, index, list) { - if (iterator.call(hasContext ? context : value, value, index, list)) results.push(value); - }); - return results; -} - -function compact(array) { - return filter(array, identity); -} - -function indexOf(array, item) { - var i = 0, - length = array && array.length; - - for (; i < length; i++) { - if (array[i] === item) return i; - } - - return -1; -} - -function contains(array, item) { - return indexOf(array, item) >= 0; -} - -function uniq(array) { - if (array == null) return []; - var result = []; - - for (var i = 0, length = array.length; i < length; i++) { - var value = array[i]; - - if (!contains(result, value)) { - result.push(value); - } - } - - return result; -} - -function range(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - - step = step || 1; - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -function bind(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - return function () { - return func.apply(context, arguments); - }; -} - -function uuid(n) { - var n = n || 6; - var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; - var res = ""; - - for (var i = 0; i < n; i++) { - var id = Math.ceil(Math.random() * 35); - res += chars[id]; - } - - return res; -} - -function delay(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function () { - return func.apply(null, args); - }, wait); -} - -function classNames() { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - var argType = (0, _typeof2.default)(arg); - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwnProperty.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); -} - -var _util = {}; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - -each(['Arguments', 'Function', 'Date', 'RegExp', 'Error'], function (name) { - _util['is' + name] = function (obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; -}); // Define a fallback version of the method in browsers (ahem, IE < 9), where -// there isn't any inspectable "Arguments" type. - -if (!_util.isArguments(arguments)) { - _util.isArguments = function (obj) { - return has(obj, 'callee'); - }; -} // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, -// IE 11 (#1621), and in Safari 8 (#1929). - - -if (typeof /./ != 'function' && (typeof Int8Array === "undefined" ? "undefined" : (0, _typeof2.default)(Int8Array)) != 'object') { - _util.isFunction = function (obj) { - return typeof obj == 'function' || false; - }; -} - -var isArguments = _util.isArguments; -exports.isArguments = isArguments; -var isFunction = _util.isFunction; -exports.isFunction = isFunction; -var isDate = _util.isDate; -exports.isDate = isDate; -var isRegExp = _util.isRegExp; -exports.isRegExp = isRegExp; -var isError = _util.isError; -exports.isError = isError; \ No newline at end of file diff --git a/package.json b/package.json index fc5c915..82d943a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-widget-listbox", - "version": "1.1.0", + "version": "1.1.1", "description": "", "main": "index.js", "repository": { diff --git a/src/ListBox.js b/src/ListBox.js index a4aa66c..e82f112 100644 --- a/src/ListBox.js +++ b/src/ListBox.js @@ -37,27 +37,27 @@ function getItemsMap(props) { export default class ListBox extends React.Component { static propTypes = { + prefixCls: PropTypes.string, className: PropTypes.string, style: PropTypes.object, - headerStyle: PropTypes.object, - footerStyle: PropTypes.object, - bodyStyle: PropTypes.object, - prefixCls: PropTypes.string, + width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + tabIndex: PropTypes.number, + multiple: PropTypes.bool, + defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]), + value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]), + disabled: PropTypes.bool, + autoFocus: PropTypes.bool, valueField: PropTypes.string, labelField: PropTypes.string, childrenField: PropTypes.string, + headerStyle: PropTypes.object, + footerStyle: PropTypes.object, + bodyStyle: PropTypes.object, items: PropTypes.array, itemsMap: PropTypes.object, - defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]), emptyLabel: PropTypes.any, - multiple: PropTypes.bool, - disabled: PropTypes.bool, - autoFocus: PropTypes.bool, - width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), labelInValue: PropTypes.bool, - tabIndex: PropTypes.number, enableDownUpSelect: PropTypes.bool, fixListBodyHeightOnIE: PropTypes.bool, onItemClick: PropTypes.func, @@ -171,7 +171,7 @@ export default class ListBox extends React.Component { scrollIntoView(e.target, this.getListViewBody()); } - if (onItemClick) onItemClick(item); + if (onItemClick) onItemClick(item, e); } onItemGroupClick = (item, e) => { @@ -180,7 +180,7 @@ export default class ListBox extends React.Component { scrollIntoView(e.target, this.getListViewBody()); } - if (onItemGroupClick) onItemGroupClick(item); + if (onItemGroupClick) onItemGroupClick(item, e); } transformChangeValue(value) { @@ -229,7 +229,7 @@ export default class ListBox extends React.Component { } onItemDeselect = (item, el) => { - const { multiple, onChange, labelInValue, valueField } = this.props; + const { multiple, onChange, valueField } = this.props; const { selectedValue } = this.state; if (!multiple) return; @@ -539,7 +539,7 @@ export default class ListBox extends React.Component { className={`${prefixCls}-header`} style={headerStyle} > - {renderHeader()} + {renderHeader(this.props)} : null } @@ -551,7 +551,7 @@ export default class ListBox extends React.Component { className={`${prefixCls}-footer`} style={footerStyle} > - {renderFooter()} + {renderFooter(this.props)} : null } diff --git a/src/ListItem.js b/src/ListItem.js index 552c54e..165325c 100644 --- a/src/ListItem.js +++ b/src/ListItem.js @@ -45,6 +45,13 @@ export default class ListItem extends React.Component { onDeselect && onDeselect(item, itemDOM) } } + saveItem = (dom) => { + this.node = dom; + } + + getItemDOM() { + return this.node; + } render() { const { prefixCls, disabled, selected, children, onMouseEnter, onMouseLeave } = this.props; @@ -55,6 +62,7 @@ export default class ListItem extends React.Component { }); return
= 0 && length <= MAX_ARRAY_INDEX; - } - - export var isObject = (toString.call(null) === '[object Object]') ? - function(value) { - // check ownerDocument here as well to exclude DOM nodes - return value !== null && value !== undefined && toString.call(value) === '[object Object]' && value.ownerDocument === undefined; - } : - function(value) { - return toString.call(value) === '[object Object]'; - }; - - export var now = Date.now || function() { - return new Date().getTime(); - } - - export function identity(value) { - return value; - } - - export function has(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - } - - export function keys(obj) { - if (!isObject(obj)) return []; - - if (nativeKeys) return nativeKeys(obj); - - var keys = []; - - for (var key in obj) - if (has(obj, key)) keys.push(key); - - return keys; - } - - export function extend(dest, sources) { - if (!dest) { dest = {}; } - for (var i = 1, l = arguments.length; i < l; i++) { - _extend(dest, arguments[i]); - } - return dest; - } - -export function isEqual(a, b){ - return String(a) === String(b); -} - - export function extendIf(dest, sources) { - var i = 1, - l = arguments.length, - prop; - - if (!dest) { dest = {}; } - - for (; i < l; i++) { - for (prop in arguments[i]) { - if (dest[prop] === undefined) { - dest[prop] = arguments[i][prop]; - } - } - } - - return dest; - } - - export function values(obj) { - var keys = keys(obj); - var length = keys.length; - var values = Array(length); - - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - - return values; - } - - export function noop() {} - - export function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return map(obj, identity); - - return values(obj); - } - - export function each(obj, iterator, context) { - if (obj == null) return obj; - - var i, length, hasContext = context === void 0 ? false : true; - - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - if (iterator.call(hasContext ? context : obj[i], obj[i], i, obj) === false) break; - } - } else { - var _keys = keys(obj); - - for (i = 0, length = _keys.length; i < length; i++) { - if (iterator.call(hasContext ? context : obj[_keys[i]], obj[_keys[i]], _keys[i], obj) === false) break; - } - } - - return obj; - } - - export var forEach = each; - - export function map(obj, iterator, context) { - if (obj == null) return obj; - - var i, length, results = [], - hasContext = context === void 0 ? false : true; - - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - results.push(iterator.call(hasContext ? context : obj[i], obj[i], i, obj)); - } - } else { - var keys = keys(obj); - - for (i = 0, length = keys.length; i < length; i++) { - results.push(iterator.call(hasContext ? context : obj[keys[i]], obj[keys[i]], keys[i], obj)); - } - } - - return results; - } - - export function filter(obj, iterator, context) { - var results = [], - hasContext = context === void 0 ? false : true; - - each(obj, function(value, index, list) { - if (iterator.call(hasContext ? context : value, value, index, list)) results.push(value); - }); - - return results; - } - - export function compact(array) { - return filter(array, identity); - } - - export function indexOf(array, item) { - var i = 0, - length = array && array.length; - - for (; i < length; i++) - if (array[i] === item) return i; - - return -1; - } - - export function contains(array, item) { - return indexOf(array, item) >= 0; - } - - export function uniq(array) { - if (array == null) return []; - - var result = []; - - for (var i = 0, length = array.length; i < length; i++) { - var value = array[i]; - - if (!contains(result, value)) { - result.push(value); - } - } - - return result; - } - - export function range(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - - step = step || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - } - - export function bind(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - - return function() { - return func.apply(context, arguments); - }; - } - -export function uuid(n){ - var n = n || 6; - var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; - var res = ""; - for(var i = 0; i < n ; i ++) { - var id = Math.ceil(Math.random()*35); - res += chars[id]; - } - return res; -} - - export function delay(func, wait) { - var args = slice.call(arguments, 2); - - return setTimeout(function() { - return func.apply(null, args); - }, wait); - } - - export function classNames () { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwnProperty.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); - } - - var _util = {}; - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - each(['Arguments', 'Function', 'Date', 'RegExp', 'Error'], function(name) { - _util['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - if (!_util.isArguments(arguments)) { - _util.isArguments = function(obj) { - return has(obj, 'callee'); - }; - } - - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), and in Safari 8 (#1929). - if (typeof /./ != 'function' && typeof Int8Array != 'object') { - _util.isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - export var isArguments = _util.isArguments; - export var isFunction = _util.isFunction; - export var isDate = _util.isDate; - export var isRegExp = _util.isRegExp; - export var isError = _util.isError; \ No newline at end of file