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

cpr-select

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpr-select - npm Package Compare versions

Comparing version 1.1.6 to 1.2.0

node_modules/history/CHANGES.md

13

lib/select.js

@@ -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

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