diff --git a/CHANGELOG.md b/CHANGELOG.md index 781e146..bd36dea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [1.5.10](https://github.com/tinper-bee/bee-table/compare/v1.5.9...v1.5.10) (2018-11-26) + + + + +## [1.5.9](https://github.com/tinper-bee/bee-table/compare/v1.5.8...v1.5.9) (2018-11-26) + + + ## [1.5.8](https://github.com/tinper-bee/bee-table/compare/v1.5.7...v1.5.8) (2018-11-22) @@ -34,7 +44,7 @@ -## [1.5.1](https://github.com/tinper-bee/bee-table/compare/v1.5.0...v1.5.1) (2018-11-19) +## [1.5.1](https://github.com/tinper-bee/bee-table/compare/v1.5.0...v1.5.1) (2018-11-18) diff --git a/build/FilterType.js b/build/FilterType.js index 539182b..f360043 100644 --- a/build/FilterType.js +++ b/build/FilterType.js @@ -14,6 +14,10 @@ var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); +var _zh_CN = require('rc-calendar/lib/locale/zh_CN'); + +var _zh_CN2 = _interopRequireDefault(_zh_CN); + var _beeFormControl = require('bee-form-control'); var _beeFormControl2 = _interopRequireDefault(_beeFormControl); @@ -44,6 +48,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } +var RangePicker = _beeDatepicker2["default"].RangePicker; + + var propTypes = { filterDropdown: _propTypes2["default"].string }; @@ -146,6 +153,7 @@ var FilterType = function (_Component) { var _this$props = _this.props, filterDropdown = _this$props.filterDropdown, filterDropdownType = _this$props.filterDropdownType, + format = _this$props.format, className = _this$props.className, onChange = _this$props.onChange, onSelectDropdown = _this$props.onSelectDropdown, @@ -217,7 +225,31 @@ var FilterType = function (_Component) { _react2["default"].createElement(_beeDatepicker2["default"], _extends({}, _this.props, { value: _this.state.dateValue, onChange: _this.changeDate, - open: _this.state.open + open: _this.state.open, + format: format, + locale: _zh_CN2["default"] + })), + filterDropdown == 'show' && _react2["default"].createElement(_FilterDropDown2["default"], { + locale: locale, + onSelectDropdown: onSelectDropdown, + onClickClear: _this.clearDateValue, + isShowCondition: filterDropdown, + isShowClear: _this.state.dateValue + }) + ); + case 'daterange': + return _react2["default"].createElement( + 'div', + { className: clsPrefix + ' filter-wrap' }, + _react2["default"].createElement(RangePicker, _extends({}, _this.props, { + value: _this.state.dateValue, + onChange: _this.changeDate, + open: _this.state.open, + format: format, + locale: _zh_CN2["default"], + placeholder: '开始 ~ 结束', + dateInputPlaceholder: ['开始', '结束'], + showClear: true })), filterDropdown == 'show' && _react2["default"].createElement(_FilterDropDown2["default"], { locale: locale, diff --git a/build/TableHeader.js b/build/TableHeader.js index 43f4505..c56972d 100644 --- a/build/TableHeader.js +++ b/build/TableHeader.js @@ -384,6 +384,19 @@ var TableHeader = function (_Component) { filterDropdown: rows[1][index]["filterdropdown"], filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number }); + //日期范围 + case "daterange": + return _react2["default"].createElement(_FilterType2["default"], { + locale: locale, + rendertype: type, + className: "filter-date", + onClick: function onClick() {}, + format: rows[1][index]["format"] || "YYYY-MM-DD", + onChange: _this.handlerFilterTextChange.bind(_this, dataIndex), + onSelectDropdown: _this.handlerFilterDropChange.bind(_this, dataIndex), + filterDropdown: rows[1][index]["filterdropdown"], + filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number + }); default: //不匹配类型默认文本输入 return _react2["default"].createElement("div", null); diff --git a/package.json b/package.json index 654bb14..e3a028d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "1.5.9", + "version": "1.5.10", "description": "Table ui component for react", "keywords": [ "react",