Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rmc-cascader

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rmc-cascader - npm Package Compare versions

Comparing version 0.2.10 to 0.3.0

57

lib/Popup.js

@@ -85,4 +85,11 @@ 'use strict';

if (this.state.visible) {
if (!this.onDocumentClickListener) {
this.onDocumentClickListener = (0, _utils.addEventListener)(document, 'click', this.onDocumentClick);
}
_reactDom2['default'].render(this.getModal(), this.popupContainer);
} else {
if (this.onDocumentClickListener) {
this.onDocumentClickListener.remove();
this.onDocumentClickListener = null;
}
this.pickerValue = null;

@@ -125,10 +132,17 @@ _reactDom2['default'].unmountComponentAtNode(this.popupContainer);

},
onDocumentClick: function onDocumentClick(e) {
if (e.target !== this.modalContent && !(0, _utils.contains)(this.modalContent, e.target)) {
this.setVisibleState(false);
}
},
setVisibleState: function setVisibleState(visible) {
this.setState({
visible: visible
});
if (!visible) {
if (this.state.visible !== visible) {
this.setState({
pickerValue: null
visible: visible
});
if (!visible) {
this.setState({
pickerValue: null
});
}
}

@@ -166,18 +180,22 @@ },

'div',
{ className: prefixCls + '-popup-header' },
{ ref: this.saveModalContent },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-popup-item', onClick: this.onDismiss },
dismissText
{ className: prefixCls + '-popup-header' },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-popup-item', onClick: this.onDismiss },
dismissText
),
_react2['default'].createElement('div', { className: prefixCls + '-popup-item' }),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-popup-item', onClick: this.onChange },
okText
)
),
_react2['default'].createElement('div', { className: prefixCls + '-popup-item' }),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-popup-item', onClick: this.onChange },
okText
)
),
_react2['default'].createElement(_MCascader2['default'], _extends({ data: data, value: this.state.pickerValue || value,
cols: cols,
onChange: this.onPickerChange }, extraProps))
_react2['default'].createElement(_MCascader2['default'], _extends({ data: data, value: this.state.pickerValue || value,
cols: cols,
onChange: this.onPickerChange }, extraProps))
)
);

@@ -191,2 +209,5 @@ },

},
saveModalContent: function saveModalContent(content) {
this.modalContent = content;
},
render: function render() {

@@ -193,0 +214,0 @@ var props = this.props;

@@ -1,8 +0,16 @@

"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.getDefaultValue = getDefaultValue;
exports.addEventListener = addEventListener;
exports.contains = contains;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
function getDefaultValue(d, val, cols) {

@@ -25,3 +33,28 @@ var data = d;

function addEventListener(target, eventType, cb) {
/* eslint camelcase: 2 */
var callback = _reactDom2['default'].unstable_batchedUpdates ? function run(e) {
_reactDom2['default'].unstable_batchedUpdates(cb, e);
} : cb;
target.addEventListener(eventType, callback, false);
return {
remove: function remove() {
target.removeEventListener(eventType, callback, false);
}
};
}
function contains(root, n) {
var node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
var COLS = 3;
exports.COLS = COLS;
{
"name": "rmc-cascader",
"version": "0.2.10",
"version": "0.3.0",
"description": "m-cascader ui component for react",

@@ -12,3 +12,2 @@ "keywords": [

"homepage": "https://github.com/react-component/m-cascader",
"author": "hualei5280@gmail.com",
"repository": {

@@ -63,2 +62,2 @@ "type": "git",

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc