cpr-select
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -13,6 +13,2 @@ 'use strict'; | ||
var _reactDom = require('react-dom'); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _lodash = require('lodash'); | ||
@@ -184,3 +180,3 @@ | ||
setTimeout(function () { | ||
var menuDialog = _reactDom2['default'].findDOMNode(_this3).querySelector(".cp-select__menu"); | ||
var menuDialog = _this3.el.querySelector(".cp-select__menu"); | ||
if (menuDialog) { | ||
@@ -257,3 +253,3 @@ menuDialog.scrollTop = 36 * index - 192; | ||
try { | ||
_reactDom2['default'].findDOMNode(_this5).querySelector('.cp-select__hidden-input').focus(); | ||
_this5.el.querySelector('.cp-select__hidden-input').focus(); | ||
} catch (e) { | ||
@@ -287,2 +283,3 @@ // It is okay if the element does not exist anymore | ||
var selectedItem = this.props.options[this.getIndex(this.props.selected)]; | ||
var that = this; | ||
@@ -294,3 +291,5 @@ if (this.props.disabled) cpSelectClasses += ' +disabled'; | ||
'div', | ||
{ className: 'cp-select-outer', role: 'select' }, | ||
{ ref: function (el) { | ||
if (el) that.el = el; | ||
}, className: 'cp-select-outer', role: 'select' }, | ||
_react2['default'].createElement('input', { className: 'cp-select__hidden-input', onFocus: this.focusSelect, onBlur: this.onBlur, onKeyDown: this.onKeyDown }), | ||
@@ -297,0 +296,0 @@ _react2['default'].createElement( |
@@ -13,2 +13,6 @@ 'use strict'; | ||
var _reactDom = require('react-dom'); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _reactLibReactTestUtils = require('react/lib/ReactTestUtils'); | ||
@@ -33,3 +37,3 @@ | ||
var selection = _reactLibReactTestUtils2['default'].findRenderedDOMComponentWithClass(multiSelect, 'cp-select__selected'); | ||
expect(selection.getDOMNode().textContent).toEqual('Kifak?'); | ||
expect(_reactDom2['default'].findDOMNode(selection).textContent).toEqual('Kifak?'); | ||
}); | ||
@@ -52,3 +56,3 @@ | ||
var selection = _reactLibReactTestUtils2['default'].findRenderedDOMComponentWithClass(multiSelect, 'cp-select__selected'); | ||
expect(selection.getDOMNode().textContent).toEqual('Alaska'); | ||
expect(_reactDom2['default'].findDOMNode(selection).textContent).toEqual('Alaska'); | ||
}); | ||
@@ -75,3 +79,3 @@ | ||
expect(menu.length).toBe(1); | ||
expect(menu[0].getDOMNode().querySelectorAll('li').length).toBe(3); | ||
expect(_reactDom2['default'].findDOMNode(menu[0]).querySelectorAll('li').length).toBe(3); | ||
}); | ||
@@ -103,4 +107,4 @@ | ||
_reactLibReactTestUtils2['default'].Simulate.mouseDown(_react2['default'].findDOMNode(multiSelect.getDOMNode().querySelectorAll('li')[2])); | ||
_reactLibReactTestUtils2['default'].Simulate.mouseDown(_reactDom2['default'].findDOMNode(_reactDom2['default'].findDOMNode(multiSelect).querySelectorAll('li')[2])); | ||
}); | ||
}); |
{ | ||
"name": "cpr-select", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "A consistently styled cross-browser and keyboard friendly select component", | ||
@@ -12,5 +12,5 @@ "main": "lib/select.js", | ||
}, | ||
"sofe": { | ||
"url": "http://localhost:5555/test-services/urls.js" | ||
}, | ||
"sofe": { | ||
"url": "http://localhost:5555/test-services/urls.js" | ||
}, | ||
"repository": { | ||
@@ -42,2 +42,3 @@ "type": "git", | ||
"ngmin-webpack-plugin": "0.1.3", | ||
"phantomjs": "^2.1.3", | ||
"phantomjs-polyfill": "0.0.1", | ||
@@ -48,3 +49,3 @@ "style-loader": "0.8.3", | ||
"dependencies": { | ||
"lodash": "^3.10.0", | ||
"lodash": "^4.6.1", | ||
"react": "^0.14.2", | ||
@@ -51,0 +52,0 @@ "react-dom": "^0.14.2" |
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import {findIndex} from 'lodash'; | ||
@@ -145,3 +144,3 @@ | ||
setTimeout(() => { | ||
let menuDialog = ReactDOM.findDOMNode(this).querySelector(".cp-select__menu"); | ||
let menuDialog = this.el.querySelector(".cp-select__menu"); | ||
if (menuDialog) { | ||
@@ -205,3 +204,3 @@ menuDialog.scrollTop = (36 * index - 192); | ||
try { | ||
ReactDOM.findDOMNode(this).querySelector('.cp-select__hidden-input').focus(); | ||
this.el.querySelector('.cp-select__hidden-input').focus(); | ||
} catch(e) { | ||
@@ -230,2 +229,3 @@ // It is okay if the element does not exist anymore | ||
]; | ||
let that = this; | ||
@@ -236,3 +236,3 @@ if (this.props.disabled) cpSelectClasses += ' +disabled'; | ||
return ( | ||
<div className='cp-select-outer' role='select'> | ||
<div ref={function(el) { if (el) that.el = el; }} className='cp-select-outer' role='select'> | ||
<input className="cp-select__hidden-input" onFocus={this.focusSelect} onBlur={this.onBlur} onKeyDown={this.onKeyDown}/> | ||
@@ -239,0 +239,0 @@ <div className={cpSelectClasses} onClick={this.displayDialog}> |
import CanopySelect from './select.js'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import TestUtils from 'react/lib/ReactTestUtils'; | ||
@@ -24,3 +25,3 @@ | ||
let selection = TestUtils.findRenderedDOMComponentWithClass(multiSelect, 'cp-select__selected'); | ||
expect(selection.getDOMNode().textContent).toEqual('Kifak?'); | ||
expect(ReactDOM.findDOMNode(selection).textContent).toEqual('Kifak?'); | ||
}); | ||
@@ -47,3 +48,3 @@ | ||
let selection = TestUtils.findRenderedDOMComponentWithClass(multiSelect, 'cp-select__selected'); | ||
expect(selection.getDOMNode().textContent).toEqual('Alaska'); | ||
expect(ReactDOM.findDOMNode(selection).textContent).toEqual('Alaska'); | ||
}); | ||
@@ -74,3 +75,3 @@ | ||
expect(menu.length).toBe(1); | ||
expect(menu[0].getDOMNode().querySelectorAll('li').length).toBe(3); | ||
expect(ReactDOM.findDOMNode(menu[0]).querySelectorAll('li').length).toBe(3); | ||
}); | ||
@@ -107,6 +108,7 @@ | ||
TestUtils.Simulate.mouseDown( | ||
React.findDOMNode(multiSelect.getDOMNode().querySelectorAll('li')[2]) | ||
ReactDOM.findDOMNode( | ||
ReactDOM.findDOMNode(multiSelect).querySelectorAll('li')[2] | ||
) | ||
); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
282439
77
5080
19
1
39
2
+ Addedlodash@4.17.21(transitive)
- Removedlodash@3.10.1(transitive)
Updatedlodash@^4.6.1