react-select-search
Advanced tools
Comparing version 1.0.0-rc4 to 1.0.0-rc5
@@ -7,2 +7,3 @@ import createClasses from '../src/lib/createClasses'; | ||
main: `${baseClass}`, | ||
modifier: 'friends', | ||
value: `${baseClass}__value`, | ||
@@ -19,3 +20,3 @@ input: `${baseClass}__input`, | ||
test('Should return expected object of class names', () => { | ||
const classNames = createClasses(baseClass); | ||
const classNames = createClasses(`${baseClass} friends`); | ||
@@ -22,0 +23,0 @@ expect(classNames).toEqual(expectedClasses); |
@@ -18,2 +18,3 @@ "use strict"; | ||
main: null, | ||
modifier: null, | ||
value: 'value', | ||
@@ -29,7 +30,17 @@ input: 'input', | ||
function e(baseClass, className) { | ||
if (className === null) { | ||
return baseClass; | ||
function e(baseClass, className, key) { | ||
if (key === 'main') { | ||
return baseClass.split(' ')[0].trim(); | ||
} | ||
if (key === 'modifier') { | ||
var classNames = baseClass.split(' '); | ||
if (classNames.length > 1) { | ||
return classNames[1].trim(); | ||
} | ||
return ''; | ||
} | ||
return "".concat(baseClass.split(' ')[0].trim(), "__").concat(className); | ||
@@ -46,3 +57,3 @@ } | ||
return [key, e(baseClass, cls)]; | ||
return [key, e(baseClass, cls, key)]; | ||
}).forEach(function (_ref3) { | ||
@@ -49,0 +60,0 @@ var _ref4 = _slicedToArray(_ref3, 2), |
@@ -478,3 +478,3 @@ "use strict"; | ||
}; | ||
var className = this.theme.classes.main; | ||
var className = "".concat(this.theme.classes.main, " ").concat(this.theme.classes.modifier); | ||
@@ -506,3 +506,4 @@ if (search) { | ||
className: className | ||
}, (search || !multiple) && _react.default.createElement(_Value.default, _extends({ | ||
}, (search || !multiple) && // eslint-disable-next-line react/jsx-props-no-spreading | ||
_react.default.createElement(_Value.default, _extends({ | ||
ref: this.valueRef | ||
@@ -509,0 +510,0 @@ }, valueProps)), !disabled && _react.default.createElement("div", { |
@@ -11,2 +11,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
main: null, | ||
modifier: null, | ||
value: 'value', | ||
@@ -22,7 +23,17 @@ input: 'input', | ||
function e(baseClass, className) { | ||
if (className === null) { | ||
return baseClass; | ||
function e(baseClass, className, key) { | ||
if (key === 'main') { | ||
return baseClass.split(' ')[0].trim(); | ||
} | ||
if (key === 'modifier') { | ||
var classNames = baseClass.split(' '); | ||
if (classNames.length > 1) { | ||
return classNames[1].trim(); | ||
} | ||
return ''; | ||
} | ||
return "".concat(baseClass.split(' ')[0].trim(), "__").concat(className); | ||
@@ -39,3 +50,3 @@ } | ||
return [key, e(baseClass, cls)]; | ||
return [key, e(baseClass, cls, key)]; | ||
}).forEach(function (_ref3) { | ||
@@ -42,0 +53,0 @@ var _ref4 = _slicedToArray(_ref3, 2), |
@@ -458,3 +458,3 @@ function _extends() { _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; }; return _extends.apply(this, arguments); } | ||
}; | ||
var className = this.theme.classes.main; | ||
var className = "".concat(this.theme.classes.main, " ").concat(this.theme.classes.modifier); | ||
@@ -486,3 +486,4 @@ if (search) { | ||
className: className | ||
}, (search || !multiple) && React.createElement(Value, _extends({ | ||
}, (search || !multiple) && // eslint-disable-next-line react/jsx-props-no-spreading | ||
React.createElement(Value, _extends({ | ||
ref: this.valueRef | ||
@@ -489,0 +490,0 @@ }, valueProps)), !disabled && React.createElement("div", { |
@@ -102,2 +102,3 @@ import React from 'react'; | ||
multiple | ||
className="select-search-box select-search-box--friends" | ||
value={this.state.friends} | ||
@@ -104,0 +105,0 @@ onChange={this.updateFriends} |
{ | ||
"name": "react-select-search", | ||
"version": "1.0.0-rc4", | ||
"version": "1.0.0-rc5", | ||
"description": "React powered selectbox with search", | ||
@@ -5,0 +5,0 @@ "main": "dist/esm/index.js", |
const classes = { | ||
main: null, | ||
modifier: null, | ||
value: 'value', | ||
@@ -13,7 +14,17 @@ input: 'input', | ||
function e(baseClass, className) { | ||
if (className === null) { | ||
return baseClass; | ||
function e(baseClass, className, key) { | ||
if (key === 'main') { | ||
return baseClass.split(' ')[0].trim(); | ||
} | ||
if (key === 'modifier') { | ||
const classNames = baseClass.split(' '); | ||
if (classNames.length > 1) { | ||
return classNames[1].trim(); | ||
} | ||
return ''; | ||
} | ||
return `${baseClass.split(' ')[0].trim()}__${className}`; | ||
@@ -26,3 +37,3 @@ } | ||
classesArray.map(([key, cls]) => [key, e(baseClass, cls)]).forEach(([key, cls]) => { | ||
classesArray.map(([key, cls]) => [key, e(baseClass, cls, key)]).forEach(([key, cls]) => { | ||
returnObj[key] = cls; | ||
@@ -29,0 +40,0 @@ }); |
@@ -412,3 +412,3 @@ import React from 'react'; | ||
let className = this.theme.classes.main; | ||
let className = `${this.theme.classes.main} ${this.theme.classes.modifier}`; | ||
@@ -439,2 +439,3 @@ if (search) { | ||
{(search || !multiple) && ( | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
<Value ref={this.valueRef} {...valueProps} /> | ||
@@ -441,0 +442,0 @@ )} |
Sorry, the diff of this file is not supported yet
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
195720
83
4439