rmc-cascader
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -7,4 +7,18 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -24,23 +38,23 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } | ||
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var EXCLUDE_PROPS = { | ||
popupPrefixCls: 1, | ||
pickerPrefixCls: 1, | ||
visible: 1, | ||
mode: 1, | ||
onPickerChange: 1, | ||
onChange: 1, | ||
onVisibleChange: 1 | ||
}; | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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 PROPS = ['onDismiss', 'children', 'style', 'WrapComponent', 'okText', 'dismissText', 'title', 'className', 'styles', 'triggerType']; | ||
var PopupCascader = function (_React$Component) { | ||
_inherits(PopupCascader, _React$Component); | ||
(0, _inherits3["default"])(PopupCascader, _React$Component); | ||
function PopupCascader(props) { | ||
_classCallCheck(this, PopupCascader); | ||
(0, _classCallCheck3["default"])(this, PopupCascader); | ||
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); | ||
var _this = (0, _possibleConstructorReturn3["default"])(this, _React$Component.call(this, props)); | ||
@@ -114,9 +128,9 @@ _this.onPickerChange = function (value) { | ||
} | ||
return React.createElement(_Cascader2["default"], _extends({ value: this.state.pickerValue || value, cols: cols, onChange: this.onPickerChange }, extraProps)); | ||
return React.createElement(_Cascader2["default"], (0, _extends3["default"])({ value: this.state.pickerValue || value, cols: cols, onChange: this.onPickerChange }, extraProps)); | ||
}; | ||
PopupCascader.prototype.render = function render() { | ||
var props = (0, _utils.pick)(this.props, PROPS); | ||
var props = (0, _utils.exclude)(this.props, EXCLUDE_PROPS); | ||
props.prefixCls = this.props.popupPrefixCls; | ||
return React.createElement(_Popup2["default"], _extends({}, props, { onVisibleChange: this.fireVisibleChange, onOk: this.onOk, content: this.getModal(), visible: this.state.visible })); | ||
return React.createElement(_Popup2["default"], (0, _extends3["default"])({}, props, { onVisibleChange: this.fireVisibleChange, onOk: this.onOk, content: this.getModal(), visible: this.state.visible })); | ||
}; | ||
@@ -123,0 +137,0 @@ |
export declare function getDefaultValue(d: any, val: any, cols: any): any; | ||
export declare function pick(props: any, wl: any): {}; | ||
export declare function exclude(props: any, bl: any): {}; | ||
export declare function noop(): void; | ||
export declare const COLS: number; |
@@ -6,5 +6,14 @@ "use strict"; | ||
}); | ||
exports.COLS = undefined; | ||
var _keys = require("babel-runtime/core-js/object/keys"); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
exports.getDefaultValue = getDefaultValue; | ||
exports.pick = pick; | ||
exports.exclude = exclude; | ||
exports.noop = noop; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function getDefaultValue(d, val, cols) { | ||
@@ -26,7 +35,7 @@ var data = d; | ||
} | ||
function pick(props, wl) { | ||
function exclude(props, bl) { | ||
var ret = {}; | ||
wl.forEach(function (w) { | ||
if (w in props) { | ||
ret[w] = props[w]; | ||
(0, _keys2["default"])(props).forEach(function (k) { | ||
if (!bl[k]) { | ||
ret[k] = props[k]; | ||
} | ||
@@ -33,0 +42,0 @@ }); |
{ | ||
"name": "rmc-cascader", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "m-cascader ui component for react", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
"start": "rc-tools run server", | ||
"pub": "rc-tools run pub", | ||
"pub": "rc-tools run pub --babel-runtime", | ||
"lint": "rc-tools run lint --no-js-lint", | ||
@@ -59,2 +59,3 @@ "karma": "rc-tools run karma", | ||
"dependencies": { | ||
"babel-runtime": "6.x", | ||
"array-tree-filter": "1.0.x", | ||
@@ -61,0 +62,0 @@ "classnames": "2.x", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
449
22156
4
+ Addedbabel-runtime@6.x