bee-form-control
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -13,6 +13,2 @@ 'use strict'; | ||
var _reactDom = require('react-dom'); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _classnames = require('classnames'); | ||
@@ -36,4 +32,2 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -71,3 +65,6 @@ | ||
_this.setState(_defineProperty({ value: value, showSearch: false }, 'showSearch', value == "")); | ||
_this.setState({ | ||
value: value, | ||
showSearch: value == null || value === "" | ||
}); | ||
if (onChange) { | ||
@@ -84,3 +81,3 @@ onChange(value); | ||
showSearch: true, | ||
value: props.value || "" | ||
value: props.value == null ? "" : props.value | ||
}; | ||
@@ -115,3 +112,3 @@ _this.input = {}; | ||
} | ||
if (type == "search") { | ||
if (type === "search") { | ||
classes['u-input-search'] = true; | ||
@@ -125,3 +122,3 @@ } | ||
if (type == "search") { | ||
if (type === "search") { | ||
@@ -128,0 +125,0 @@ return _react2["default"].createElement( |
110
package.json
{ | ||
"name": "bee-form-control", | ||
"version": "1.0.2", | ||
"description": "form-control ui component for react", | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"react-form-control", | ||
"iuap-design", | ||
"neoui-react", | ||
"form-control" | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"homepage": "https://github.com/tinper-bee/form-control", | ||
"author": "yonyou", | ||
"repository": "http://github.com/tinper-bee/form-control", | ||
"bugs": "https://github.com/tinper-bee/form-control/issues", | ||
"license": "MIT", | ||
"main": "./build/index", | ||
"config": { | ||
"port": 8000 | ||
}, | ||
"scripts": { | ||
"dev": "bee-tools run start", | ||
"build": "bee-tools run build", | ||
"lint": "bee-tools run lint", | ||
"test": "bee-tools run test", | ||
"chrome": "bee-tools run chrome", | ||
"browsers": "bee-tools run browsers", | ||
"pub": "bee-tools run pub", | ||
"coveralls": "bee-tools run coverage" | ||
}, | ||
"dependencies": { | ||
"bee-icon": "latest", | ||
"classnames": "^2.2.5", | ||
"console-polyfill": "^0.2.3", | ||
"es5-shim": "^4.5.9", | ||
"tinper-bee-core": "latest", | ||
"warning": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.3.0 || ^16.0", | ||
"react-dom": "^15.3.0 || ^16.0", | ||
"prop-types": "15.6.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"enzyme": "^2.4.1", | ||
"react-addons-test-utils": "15.3.2", | ||
"bee-panel": "latest", | ||
"bee-layout": "latest", | ||
"bee-button": "latest" | ||
} | ||
} | ||
"name": "bee-form-control", | ||
"version": "1.0.3", | ||
"description": "form-control ui component for react", | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"react-form-control", | ||
"iuap-design", | ||
"neoui-react", | ||
"form-control" | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"homepage": "https://github.com/tinper-bee/form-control", | ||
"author": "yonyou", | ||
"repository": "http://github.com/tinper-bee/form-control", | ||
"bugs": "https://github.com/tinper-bee/form-control/issues", | ||
"license": "MIT", | ||
"main": "./build/index", | ||
"config": { | ||
"port": 8000 | ||
}, | ||
"scripts": { | ||
"dev": "bee-tools run start", | ||
"build": "bee-tools run build", | ||
"lint": "bee-tools run lint", | ||
"test": "bee-tools run test", | ||
"chrome": "bee-tools run chrome", | ||
"browsers": "bee-tools run browsers", | ||
"pub": "bee-tools run pub", | ||
"coveralls": "bee-tools run coverage" | ||
}, | ||
"dependencies": { | ||
"bee-icon": "latest", | ||
"classnames": "^2.2.5", | ||
"console-polyfill": "^0.2.3", | ||
"es5-shim": "^4.5.9", | ||
"tinper-bee-core": "latest", | ||
"warning": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.3.0 || ^16.0", | ||
"react-dom": "^15.3.0 || ^16.0", | ||
"prop-types": "15.6.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"enzyme": "^2.4.1", | ||
"react-addons-test-utils": "15.3.2", | ||
"bee-panel": "latest", | ||
"bee-layout": "latest", | ||
"bee-button": "latest" | ||
} | ||
} |
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import classnames from 'classnames'; | ||
@@ -31,3 +30,3 @@ import Icon from 'bee-icon'; | ||
showSearch: true, | ||
value: props.value || "" | ||
value: props.value == null ? "" : props.value | ||
} | ||
@@ -46,3 +45,6 @@ this.input = {}; | ||
const {onChange} = this.props; | ||
this.setState({value:value,showSearch:false,showSearch:value==""}); | ||
this.setState({ | ||
value:value, | ||
showSearch: value == null || value === "" | ||
}); | ||
if(onChange) { | ||
@@ -73,3 +75,3 @@ onChange(value); | ||
} | ||
if(type=="search") { | ||
if(type === "search") { | ||
classes[`u-input-search`] = true; | ||
@@ -83,3 +85,3 @@ } | ||
if(type=="search") { | ||
if(type === "search") { | ||
@@ -86,0 +88,0 @@ return ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1128800
12037