Socket
Socket
Sign inDemoInstall

@semcore/utils

Package Overview
Dependencies
Maintainers
1
Versions
299
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semcore/utils - npm Package Compare versions

Comparing version 1.1.2 to 1.3.0

lib/assignProps.js

45

CHANGELOG.md

@@ -5,2 +5,47 @@ # Changelog

## [1.3.0] - 2018-11-22
### Added
- функция `assignProps` теперь расширяет свойство `className`
## [1.2.0] - 2018-11-07
### Added
- функция `isPromise` для идентификации функции возвращающей `Promise`
- возможность передать в функцию `propsForElement` второй аргумент `element`
## [1.1.6] - 2018-10-11
### Added
- набор функций для работы со слиянием пропсов, находятся в пакете `assignProps`
## [1.1.5] - 2018-09-27
### Added
- функция `capitalizeFirstLetter` для отображения строки с заглавной буквы
- функция `getRandomInt` возвращает рандомное число, между `min` и `max` заданными значениями
- вспомогательный компонент `If` с возможностью упарвлять отображением дочерних узлов при помощи свойства `condition`
- функция `ownerDocument` возвращает объект документа верхнего уровня (document) для переданного узла
- функция `setRef` устанавливает переданное значение как `node` элемента
- набор функций для работы со `state`-ом компонента (чтение и изменение), находятся в пакете `uncontroll`
- возможность пробрасывать опции на обертку при создании компонентов с помощью `createHoc`
## [1.1.4] - 2018-09-10
### Added
- хелпер функция для локализации `getL10n`
- хелпер функция для возврата числовых значений из css `cssToIntDefault`
- хелпер функция для отправки событий в GA `withAnalytics`
## [1.1.3] - 2018-08-30
### Changed
- Цвет \$gray60 изменился на #757575
## [1.1.2] - 2018-08-17

@@ -7,0 +52,0 @@

9

lib/capitalizeFirstLetter.js

@@ -1,3 +0,10 @@

export default function capitalizeFirstLetter(input) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = capitalizeFirstLetter;
function capitalizeFirstLetter(input) {
return input.charAt(0).toUpperCase() + input.slice(1);
}

@@ -1,3 +0,10 @@

export default function compose() {
for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = compose;
function compose() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];

@@ -4,0 +11,0 @@ }

99

lib/createHoc.js

@@ -1,37 +0,90 @@

var _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; };
"use strict";
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
import React from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import getDisplayName from './getDisplayName';
var _react = _interopRequireWildcard(require("react"));
export default (function (EnhancedComponent) {
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
var _getDisplayName = _interopRequireDefault(require("./getDisplayName"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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; }
var _default = function _default(EnhancedComponent) {
return function creacteHoC() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return function (WrappedComponent) {
function Component(props) {
var ref = props.ref,
others = _objectWithoutProperties(props, ['ref']);
var Component =
/*#__PURE__*/
function (_PureComponent) {
_inherits(Component, _PureComponent);
return React.createElement(
EnhancedComponent,
props,
function (overwriteProps) {
return React.createElement(WrappedComponent, _extends({ ref: ref }, others, overwriteProps));
function Component() {
_classCallCheck(this, Component);
return _possibleConstructorReturn(this, _getPrototypeOf(Component).apply(this, arguments));
}
_createClass(Component, [{
key: "render",
value: function render() {
var _this$props = this.props,
forwardedRef = _this$props.forwardedRef,
others = _objectWithoutProperties(_this$props, ["forwardedRef"]);
return _react.default.createElement(EnhancedComponent, _extends({}, options, this.props), function (overwriteProps) {
return _react.default.createElement(WrappedComponent, _extends({
ref: forwardedRef
}, others, overwriteProps));
});
}
);
}
}]);
// function forwardRef(props, ref) {
// return <Component {...props} ref={ref} />;
return Component;
}(_react.PureComponent); // function forwardRef(props, ref) {
// return <Component {...props} forwardedRef={ref} />;
// }
// const ComponentWithRefForwarding = React.forwardRef(forwardRef);
// ComponentWithRefForwarding.displayName = getDisplayName(WrappedComponent);
Component.displayName = getDisplayName(WrappedComponent);
hoistNonReactStatics(Component, WrappedComponent);
// hoistNonReactStatics(ComponentWithRefForwarding, WrappedComponent);
return Component;
_defineProperty(Component, "displayName", (0, _getDisplayName.default)(WrappedComponent));
return (0, _hoistNonReactStatics.default)(Component, WrappedComponent);
};
};
});
};
exports.default = _default;

@@ -1,2 +0,9 @@

export default function createUUID() {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createUUID;
function createUUID() {
var pattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';

@@ -3,0 +10,0 @@ return pattern.replace(/[xy]/g, function (c) {

@@ -1,50 +0,86 @@

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.EnhancedWithKeyboardFocus = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _createHoc = _interopRequireDefault(require("@semcore/utils/lib/createHoc"));
var _setStateIfNeeded = _interopRequireDefault(require("../setStateIfNeeded"));
var _fire = _interopRequireDefault(require("../fire"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import createHoc from '@semcore/utils/lib/createHoc';
import setStateIfNeeded from '../setStateIfNeeded';
import fire from '../fire';
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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; }
var usingKeyBoard = false;
export var EnhancedWithKeyboardFocus = function (_PureComponent) {
var EnhancedWithKeyboardFocus =
/*#__PURE__*/
function (_PureComponent) {
_inherits(EnhancedWithKeyboardFocus, _PureComponent);
function EnhancedWithKeyboardFocus(props) {
var _this;
_classCallCheck(this, EnhancedWithKeyboardFocus);
var _this = _possibleConstructorReturn(this, (EnhancedWithKeyboardFocus.__proto__ || Object.getPrototypeOf(EnhancedWithKeyboardFocus)).call(this, props));
_this = _possibleConstructorReturn(this, _getPrototypeOf(EnhancedWithKeyboardFocus).call(this, props));
_this.handlerFocus = function (e) {
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handlerFocus", function (e) {
// console.log('focus', usingKeyBoard);
fire(_this, 'onFocus', e);
(0, _fire.default)(_assertThisInitialized(_assertThisInitialized(_this)), 'onFocus', e);
if (usingKeyBoard) {
setStateIfNeeded(_this, { keyboardFocused: true });
(0, _setStateIfNeeded.default)(_assertThisInitialized(_assertThisInitialized(_this)), {
keyboardFocused: true
});
}
};
});
_this.handlerBlur = function (e) {
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handlerBlur", function (e) {
// console.log('blur');
fire(_this, 'onBlur', e);
setStateIfNeeded(_this, { keyboardFocused: false });
};
(0, _fire.default)(_assertThisInitialized(_assertThisInitialized(_this)), 'onBlur', e);
(0, _setStateIfNeeded.default)(_assertThisInitialized(_assertThisInitialized(_this)), {
keyboardFocused: false
});
});
_this.handlerKeyDown = function (e) {
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handlerKeyDown", function (e) {
// console.log('key');
fire(_this, 'onKeyDown', e);
(0, _fire.default)(_assertThisInitialized(_assertThisInitialized(_this)), 'onKeyDown', e);
usingKeyBoard = true;
};
});
_this.handlerMouseDown = function (e) {
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handlerMouseDown", function (e) {
// console.log('mouse');
fire(_this, 'onMouseDown', e);
(0, _fire.default)(_assertThisInitialized(_assertThisInitialized(_this)), 'onMouseDown', e);
usingKeyBoard = false;
};
});

@@ -58,9 +94,8 @@ _this.state = {

_createClass(EnhancedWithKeyboardFocus, [{
key: 'render',
key: "render",
value: function render() {
var _props = this.props,
children = _props.children,
tabIndex = _props.tabIndex;
var _this$props = this.props,
children = _this$props.children,
tabIndex = _this$props.tabIndex;
var keyboardFocused = this.state.keyboardFocused;
return children({

@@ -78,13 +113,20 @@ tabIndex: tabIndex,

return EnhancedWithKeyboardFocus;
}(PureComponent);
}(_react.PureComponent);
EnhancedWithKeyboardFocus.UIname = 'EnhancedWithKeyboardFocus';
EnhancedWithKeyboardFocus.propTypes = {
keyboardFocused: PropTypes.bool,
tabIndex: PropTypes.number
};
EnhancedWithKeyboardFocus.defaultProps = {
exports.EnhancedWithKeyboardFocus = EnhancedWithKeyboardFocus;
_defineProperty(EnhancedWithKeyboardFocus, "UIname", 'EnhancedWithKeyboardFocus');
_defineProperty(EnhancedWithKeyboardFocus, "propTypes", {
keyboardFocused: _propTypes.default.bool,
tabIndex: _propTypes.default.number
});
_defineProperty(EnhancedWithKeyboardFocus, "defaultProps", {
tabIndex: 0,
keyboardFocused: false
};
export default createHoc(EnhancedWithKeyboardFocus);
});
var _default = (0, _createHoc.default)(EnhancedWithKeyboardFocus);
exports.default = _default;

@@ -1,19 +0,45 @@

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.EnhancedWithNeighborLocation = exports.Consumer = exports.Provider = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _createHoc = _interopRequireDefault(require("@semcore/utils/lib/createHoc"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import createHoc from '@semcore/utils/lib/createHoc';
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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; }
// TODO: support 15 react
var _React$createContext = React.createContext(),
var _React$createContext = _react.default.createContext(),
Provider = _React$createContext.Provider,
Consumer = _React$createContext.Consumer;
export { Provider, Consumer };
exports.Consumer = Consumer;
exports.Provider = Provider;

@@ -24,3 +50,5 @@ function chooseNeighborLocation(selfNeighborLocation, contextNeighborLocation) {

export var EnhancedWithNeighborLocation = function (_PureComponent) {
var EnhancedWithNeighborLocation =
/*#__PURE__*/
function (_PureComponent) {
_inherits(EnhancedWithNeighborLocation, _PureComponent);

@@ -31,23 +59,20 @@

return _possibleConstructorReturn(this, (EnhancedWithNeighborLocation.__proto__ || Object.getPrototypeOf(EnhancedWithNeighborLocation)).apply(this, arguments));
return _possibleConstructorReturn(this, _getPrototypeOf(EnhancedWithNeighborLocation).apply(this, arguments));
}
_createClass(EnhancedWithNeighborLocation, [{
key: 'render',
key: "render",
value: function render() {
var _this2 = this;
var _this = this;
var _props = this.props,
children = _props.children,
neighborLocation = _props.neighborLocation;
return React.createElement(
Consumer,
null,
function (getNeighborLocation) {
var contextNeighborLocation = getNeighborLocation ? getNeighborLocation(_this2.neighborLocation) : undefined;
_this2.neighborLocation = chooseNeighborLocation(neighborLocation, contextNeighborLocation);
return children({ neighborLocation: _this2.neighborLocation });
}
);
var _this$props = this.props,
children = _this$props.children,
neighborLocation = _this$props.neighborLocation;
return _react.default.createElement(Consumer, null, function (getNeighborLocation) {
var contextNeighborLocation = getNeighborLocation ? getNeighborLocation(_this.neighborLocation) : undefined;
_this.neighborLocation = chooseNeighborLocation(neighborLocation, contextNeighborLocation);
return children({
neighborLocation: _this.neighborLocation
});
});
}

@@ -57,8 +82,14 @@ }]);

return EnhancedWithNeighborLocation;
}(PureComponent);
}(_react.PureComponent);
EnhancedWithNeighborLocation.UIname = 'EnhancedWithNeighborLocation';
EnhancedWithNeighborLocation.propTypes = {
neighborLocationInGroup: PropTypes.oneOf(['right', 'both', 'left'])
};
export default createHoc(EnhancedWithNeighborLocation);
exports.EnhancedWithNeighborLocation = EnhancedWithNeighborLocation;
_defineProperty(EnhancedWithNeighborLocation, "UIname", 'EnhancedWithNeighborLocation');
_defineProperty(EnhancedWithNeighborLocation, "propTypes", {
neighborLocationInGroup: _propTypes.default.oneOf(['right', 'both', 'left'])
});
var _default = (0, _createHoc.default)(EnhancedWithNeighborLocation);
exports.default = _default;

@@ -1,10 +0,23 @@

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var EventEmitter = function () {
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
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; }
var EventEmitter =
/*#__PURE__*/
function () {
function EventEmitter() {
_classCallCheck(this, EventEmitter);
this.events = {};
_defineProperty(this, "events", {});
}

@@ -16,2 +29,3 @@

var event = this.events[eventName];
if (event) {

@@ -44,2 +58,2 @@ event.forEach(function (fn) {

export default EventEmitter;
exports.default = EventEmitter;

@@ -1,7 +0,16 @@

import getValue from './getValue';
"use strict";
export default function fire(context, eventName) {
var fn = getValue(context, 'props.' + eventName);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = fire;
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
var _getValue = _interopRequireDefault(require("./getValue"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function fire(context, eventName) {
var fn = (0, _getValue.default)(context, "props.".concat(eventName));
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];

@@ -8,0 +17,0 @@ }

@@ -1,3 +0,10 @@

export default function getDisplayName(WrappedComponent) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDisplayName;
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}

@@ -0,4 +1,10 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getValue;
var pathRegExp = /\[(\d+)]/g;
export default function getValue(obj, path, def) {
function getValue(obj, path, def) {
var paths = typeof path === 'string' ? path.replace(pathRegExp, '.$1') : path.join('.');

@@ -5,0 +11,0 @@ return paths.split('.').filter(Boolean).every(function (step) {

@@ -1,25 +0,119 @@

import capitalizeFirstLetter from './capitalizeFirstLetter';
import getDisplayName from './getDisplayName';
import setStateIfNeeded from './setStateIfNeeded';
import get from './getValue';
import fire from './fire';
import propsForElement from './propsForElement';
import compose from './compose';
import isNode from './isNode';
import createUUID from './createUUID';
import EventEmitter from './eventEmitter';
import createHoc from './createHoc';
import WithKeyboardFocus from './enhances/WithKeyboardFocus';
"use strict";
export { capitalizeFirstLetter };
export { getDisplayName };
export { setStateIfNeeded };
export { get };
export { fire };
export { propsForElement };
export { compose };
export { isNode };
export { createUUID };
export { EventEmitter };
export { WithKeyboardFocus };
export { createHoc };
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "capitalizeFirstLetter", {
enumerable: true,
get: function get() {
return _capitalizeFirstLetter.default;
}
});
Object.defineProperty(exports, "getDisplayName", {
enumerable: true,
get: function get() {
return _getDisplayName.default;
}
});
Object.defineProperty(exports, "setStateIfNeeded", {
enumerable: true,
get: function get() {
return _setStateIfNeeded.default;
}
});
Object.defineProperty(exports, "get", {
enumerable: true,
get: function get() {
return _getValue.default;
}
});
Object.defineProperty(exports, "fire", {
enumerable: true,
get: function get() {
return _fire.default;
}
});
Object.defineProperty(exports, "propsForElement", {
enumerable: true,
get: function get() {
return _propsForElement.default;
}
});
Object.defineProperty(exports, "compose", {
enumerable: true,
get: function get() {
return _compose.default;
}
});
Object.defineProperty(exports, "isNode", {
enumerable: true,
get: function get() {
return _isNode.default;
}
});
Object.defineProperty(exports, "isPromise", {
enumerable: true,
get: function get() {
return _isPromise.default;
}
});
Object.defineProperty(exports, "createUUID", {
enumerable: true,
get: function get() {
return _createUUID.default;
}
});
Object.defineProperty(exports, "EventEmitter", {
enumerable: true,
get: function get() {
return _eventEmitter.default;
}
});
Object.defineProperty(exports, "createHoc", {
enumerable: true,
get: function get() {
return _createHoc.default;
}
});
Object.defineProperty(exports, "WithKeyboardFocus", {
enumerable: true,
get: function get() {
return _WithKeyboardFocus.default;
}
});
Object.defineProperty(exports, "intOrDefault", {
enumerable: true,
get: function get() {
return _intOrDefault.default;
}
});
var _capitalizeFirstLetter = _interopRequireDefault(require("./capitalizeFirstLetter"));
var _getDisplayName = _interopRequireDefault(require("./getDisplayName"));
var _setStateIfNeeded = _interopRequireDefault(require("./setStateIfNeeded"));
var _getValue = _interopRequireDefault(require("./getValue"));
var _fire = _interopRequireDefault(require("./fire"));
var _propsForElement = _interopRequireDefault(require("./propsForElement"));
var _compose = _interopRequireDefault(require("./compose"));
var _isNode = _interopRequireDefault(require("./isNode"));
var _isPromise = _interopRequireDefault(require("./isPromise"));
var _createUUID = _interopRequireDefault(require("./createUUID"));
var _eventEmitter = _interopRequireDefault(require("./eventEmitter"));
var _createHoc = _interopRequireDefault(require("./createHoc"));
var _WithKeyboardFocus = _interopRequireDefault(require("./enhances/WithKeyboardFocus"));
var _intOrDefault = _interopRequireDefault(require("./intOrDefault"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -1,19 +0,33 @@

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
"use strict";
import React from 'react';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNode;
export default function isNode(node) {
switch (typeof node === 'undefined' ? 'undefined' : _typeof(node)) {
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function isNode(node) {
switch (_typeof(node)) {
case 'number':
return Number.isFinite(node);
case 'string':
return Boolean(node);
case 'undefined':
return false;
case 'boolean':
return node;
case 'object':
if (Array.isArray(node)) return node.some(isNode);
if (node === null) return false;
return React.isValidElement(node);
return _react.default.isValidElement(node);
default:

@@ -20,0 +34,0 @@ return false;

@@ -0,4 +1,13 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = propsForElement;
exports.validAttr = void 0;
/*
* COPY FROM https://github.com/styled-components/styled-components/blob/master/src/utils/validAttr.js
* */
* COPY FROM https://github.com/styled-components/styled-components/blob/master/src/utils/validAttr.js
* */
/**

@@ -15,24 +24,33 @@ * Trying to avoid the unknown-prop errors on styled components by filtering by

* */
/*
children dangerouslySetInnerHTML key ref autoFocus defaultValue valueLink defaultChecked checkedLink innerHTML suppressContentEditableWarning onFocusIn onFocusOut className onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onInvalid onSubmit onReset onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onAnimationStart onAnimationEnd onAnimationIteration onTransitionEnd onCopyCapture onCutCapture onPasteCapture onCompositionEndCapture onCompositionStartCapture onCompositionUpdateCapture onKeyDownCapture onKeyPressCapture onKeyUpCapture onFocusCapture onBlurCapture onChangeCapture onInputCapture onSubmitCapture onResetCapture onClickCapture onContextMenuCapture onDoubleClickCapture onDragCapture onDragEndCapture onDragEnterCapture onDragExitCapture onDragLeaveCapture onDragOverCapture onDragStartCapture onDropCapture onMouseDownCapture onMouseEnterCapture onMouseLeaveCapture onMouseMoveCapture onMouseOutCapture onMouseOverCapture onMouseUpCapture onSelectCapture onTouchCancelCapture onTouchEndCapture onTouchMoveCapture onTouchStartCapture onScrollCapture onWheelCapture onAbortCapture onCanPlayCapture onCanPlayThroughCapture onDurationChangeCapture onEmptiedCapture onEncryptedCapture onEndedCapture onErrorCapture onLoadedDataCapture onLoadedMetadataCapture onLoadStartCapture onPauseCapture onPlayCapture onPlayingCapture onProgressCapture onRateChangeCapture onSeekedCapture onSeekingCapture onStalledCapture onSuspendCapture onTimeUpdateCapture onVolumeChangeCapture onWaitingCapture onLoadCapture onAnimationStartCapture onAnimationEndCapture onAnimationIterationCapture onTransitionEndCapture accept acceptCharset accessKey action allowFullScreen allowTransparency alt as async autoComplete autoPlay capture cellPadding cellSpacing charSet challenge checked cite classID className cols colSpan content contentEditable contextMenu controlsList controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name nonce noValidate open optimum pattern placeholder playsInline poster preload profile radioGroup readOnly referrerPolicy rel required reversed role rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap about datatype inlist prefix property resource typeof vocab autoCapitalize autoCorrect autoSave color itemProp itemScope itemType itemID itemRef results security unselectable accentHeight accumulate additive alignmentBaseline allowReorder alphabetic amplitude arabicForm ascent attributeName attributeType autoReverse azimuth baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight clip clipPath clipRule clipPathUnits colorInterpolation colorInterpolationFilters colorProfile colorRendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground end exponent externalResourcesRequired fill fillOpacity fillRule filter filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor limitingConeAngle local markerEnd markerMid markerStart markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode numOctaves offset opacity operator order orient orientation origin overflow overlinePosition overlineThickness paintOrder panose1 pathLength patternContentUnits patternTransform patternUnits pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shapeRendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor textDecoration textRendering textLength to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture onLostPointerCapture onPointerEnter onPointerLeave onPointerOver onPointerOut
children dangerouslySetInnerHTML key ref autoFocus defaultValue valueLink defaultChecked checkedLink innerHTML suppressContentEditableWarning onFocusIn onFocusOut className onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onInvalid onSubmit onReset onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onAnimationStart onAnimationEnd onAnimationIteration onTransitionEnd onCopyCapture onCutCapture onPasteCapture onCompositionEndCapture onCompositionStartCapture onCompositionUpdateCapture onKeyDownCapture onKeyPressCapture onKeyUpCapture onFocusCapture onBlurCapture onChangeCapture onInputCapture onSubmitCapture onResetCapture onClickCapture onContextMenuCapture onDoubleClickCapture onDragCapture onDragEndCapture onDragEnterCapture onDragExitCapture onDragLeaveCapture onDragOverCapture onDragStartCapture onDropCapture onMouseDownCapture onMouseEnterCapture onMouseLeaveCapture onMouseMoveCapture onMouseOutCapture onMouseOverCapture onMouseUpCapture onSelectCapture onTouchCancelCapture onTouchEndCapture onTouchMoveCapture onTouchStartCapture onScrollCapture onWheelCapture onAbortCapture onCanPlayCapture onCanPlayThroughCapture onDurationChangeCapture onEmptiedCapture onEncryptedCapture onEndedCapture onErrorCapture onLoadedDataCapture onLoadedMetadataCapture onLoadStartCapture onPauseCapture onPlayCapture onPlayingCapture onProgressCapture onRateChangeCapture onSeekedCapture onSeekingCapture onStalledCapture onSuspendCapture onTimeUpdateCapture onVolumeChangeCapture onWaitingCapture onLoadCapture onAnimationStartCapture onAnimationEndCapture onAnimationIterationCapture onTransitionEndCapture accept acceptCharset accessKey action allowFullScreen allowTransparency alt as async autoComplete autoPlay capture cellPadding cellSpacing charSet challenge checked cite classID className cols colSpan content contentEditable contextMenu controlsList controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name nonce noValidate open optimum pattern placeholder playsInline poster preload profile radioGroup readOnly referrerPolicy rel required reversed role rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap about datatype inlist prefix property resource typeof vocab autoCapitalize autoCorrect autoSave color itemProp itemScope itemType itemID itemRef results security unselectable accentHeight accumulate additive alignmentBaseline allowReorder alphabetic amplitude arabicForm ascent attributeName attributeType autoReverse azimuth baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight clip clipPath clipRule clipPathUnits colorInterpolation colorInterpolationFilters colorProfile colorRendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground end exponent externalResourcesRequired fill fillOpacity fillRule filter filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor limitingConeAngle local markerEnd markerMid markerStart markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode numOctaves offset opacity operator order orient orientation origin overflow overlinePosition overlineThickness paintOrder panose1 pathLength patternContentUnits patternTransform patternUnits pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shapeRendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor textDecoration textRendering textLength to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture onLostPointerCapture onPointerEnter onPointerLeave onPointerOver onPointerOut class for autofocus
*/
var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:Animation|Touch|Load|Drag)Start|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|Lo(?:stPointer|ad)|TimeUpdate|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|GotPointer|MouseDown|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|KeyPress|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|P(?:rogress|laying)|DragEnd|Key(?:Down|Up)|(?:MouseU|Dro)p|(?:Wait|Seek)ing|Scroll|Focus|Paste|Abort|Drag|Play|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|onPointerLeav|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|onPointerMov|(?:attribute|glyph)Nam|playsInlin|(?:writing|input|edge)Mod|(?:formE|e)ncTyp|(?:amplitu|mo)d|(?:xlinkTy|itemSco|keyTy|slo)p|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ord)s|o(?:lor(?:Interpolation)?|nt(?:rols|ent))|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|(?:ontrolsLis|apHeigh)t|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|o(?:ntextMenu|ls)|(?:rossOrigi|olSpa)n|lip(?:Path)?|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|autoFocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|on(?:PointerDow|FocusI)|formActio|zoomAndPa|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveA(?:spectRatio|lpha)|ointsAt[X-Z]|anose1)|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:gradientT|patternT|t)ransform|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:strokeMiterlimi|(?:specularConsta|repeatCou|fontVaria)n|(?:(?:specularE|e)xpon|renderingInt|asc)en|d(?:iffuseConsta|esce)n|(?:fontSizeAdju|lengthAdju|manife)s|baselineShif|onPointerOu|vectorEffec|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|markerStar|a(?:utoCorrec|bou)|onFocusOu|intercep|restar|forma|inlis|heigh|lis)t|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|k(?:ernel(?:UnitLength|Matrix)|[1-4])|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|(?:markerM|onInval)i|preloa|metho|kin)d|strokeDasharray|(?:onPointerCanc|lab)el|(?:allowFullScre|hidd)en|systemLanguage|(?:(?:o(?:nPointer(?:Ent|Ov)|rd)|allowReord|placehold|frameBord|paintOrd|post)e|repeatDu|d(?:efe|u))r|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|(?:pointerEve|keyPoi)nts|(?:strokeLineca|onPointerU|itemPro|useMa|wra|loo)p|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|(?:vI|i)deographic|unicodeRange|mathematical|vAlphabetic|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|(?:xmlnsXl|valueL)ink|mediaGroup|spellCheck|(?:text|m(?:in|ax))Length|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|a(?:rabicForm|l(?:phabetic|t)|sync)|pathLength|innerHTML|xlinkShow|(?:xlinkHr|glyphR)ef|(?:tabInde|(?:sand|b)bo|viewBo)x|(?:(?:href|xml|src)La|kerni)ng|autoPlay|o(?:verflow|pen)|f(?:o(?:ntSize|rm)|il(?:ter|l))|r(?:e(?:quired|sult|f))?|divisor|p(?:attern|oints)|unicode|d(?:efault|ata|ir)?|i(?:temRef|n2|s)|t(?:arget[XY]|o)|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|(?:width|size)s|prefix|typeof|itemID|s(?:t(?:roke|art)|hape|cope|rc)|t(?:arget|ype)|(?:stri|la)ng|a(?:ccept|s)|m(?:edia|a(?:sk|x)|in)|x(?:mlns)?|width|value|size|href|k(?:ey)?|end|low|by|i[dn]|y[12]|g[12]|x[12]|f[xy]|[yz])$/;
/* eslint-enable max-len */
var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:Animation|Touch|Load|Drag)Start|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|Lo(?:stPointer|ad)|TimeUpdate|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|GotPointer|MouseDown|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|KeyPress|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|P(?:rogress|laying)|DragEnd|Key(?:Down|Up)|(?:MouseU|Dro)p|(?:Wait|Seek)ing|Scroll|Focus|Paste|Abort|Drag|Play|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|onPointerLeav|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|onPointerMov|(?:attribute|glyph)Nam|playsInlin|(?:writing|input|edge)Mod|(?:formE|e)ncTyp|(?:amplitu|mo)d|(?:xlinkTy|itemSco|keyTy|slo)p|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ord)s|o(?:lor(?:Interpolation)?|nt(?:rols|ent))|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|(?:ontrolsLis|apHeigh)t|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|o(?:ntextMenu|ls)|(?:rossOrigi|olSpa)n|l(?:ip(?:Path)?|ass)|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|auto[Ff]ocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|on(?:PointerDow|FocusI)|formActio|zoomAndPa|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveA(?:spectRatio|lpha)|ointsAt[X-Z]|anose1)|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:gradientT|patternT|t)ransform|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:strokeMiterlimi|(?:specularConsta|repeatCou|fontVaria)n|(?:(?:specularE|e)xpon|renderingInt|asc)en|d(?:iffuseConsta|esce)n|(?:fontSizeAdju|lengthAdju|manife)s|baselineShif|onPointerOu|vectorEffec|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|markerStar|a(?:utoCorrec|bou)|onFocusOu|intercep|restar|forma|inlis|heigh|lis)t|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|k(?:ernel(?:UnitLength|Matrix)|[1-4])|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|(?:markerM|onInval)i|preloa|metho|kin)d|strokeDasharray|(?:onPointerCanc|lab)el|(?:allowFullScre|hidd)en|systemLanguage|(?:(?:o(?:nPointer(?:Ent|Ov)|rd)|allowReord|placehold|frameBord|paintOrd|post)e|repeatDu|d(?:efe|u))r|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|(?:pointerEve|keyPoi)nts|(?:strokeLineca|onPointerU|itemPro|useMa|wra|loo)p|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|(?:vI|i)deographic|unicodeRange|mathematical|vAlphabetic|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|(?:xmlnsXl|valueL)ink|mediaGroup|spellCheck|(?:text|m(?:in|ax))Length|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|a(?:rabicForm|l(?:phabetic|t)|sync)|pathLength|innerHTML|xlinkShow|(?:xlinkHr|glyphR)ef|(?:tabInde|(?:sand|b)bo|viewBo)x|(?:(?:href|xml|src)La|kerni)ng|autoPlay|o(?:verflow|pen)|f(?:o(?:ntSize|rm?)|il(?:ter|l))|r(?:e(?:quired|sult|f))?|divisor|p(?:attern|oints)|unicode|d(?:efault|ata|ir)?|i(?:temRef|n2|s)|t(?:arget[XY]|o)|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|(?:width|size)s|prefix|typeof|itemID|s(?:t(?:roke|art)|hape|cope|rc)|t(?:arget|ype)|(?:stri|la)ng|a(?:ccept|s)|m(?:edia|a(?:sk|x)|in)|x(?:mlns)?|width|value|size|href|k(?:ey)?|end|low|by|i[dn]|y[12]|g[12]|x[12]|f[xy]|[yz])$/;
/* From DOMProperty */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(x|data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));
export var validAttr = function validAttr(name) {
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
var ATTRIBUTE_NAME_CHAR = "".concat(ATTRIBUTE_NAME_START_CHAR, "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040");
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp("^(x|data|aria)-[".concat(ATTRIBUTE_NAME_CHAR, "]*$")));
var validAttr = function validAttr(name) {
return ATTRIBUTE_REGEX.test(name) || isCustomAttribute(name.toLowerCase());
};
export default function propsForElement(props) {
return Object.keys(props).reduce(function (acc, propName) {
if (validAttr(propName)) {
acc[propName] = props[propName];
}
return acc;
}, {});
exports.validAttr = validAttr;
function propsForElement(props, element) {
if (element && typeof element !== 'string') {
return props;
} else {
return Object.keys(props).reduce(function (acc, propName) {
if (validAttr(propName)) {
acc[propName] = props[propName];
}
return acc;
}, {});
}
}

@@ -1,4 +0,12 @@

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
"use strict";
export function stateIfNeeded(state, props) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stateIfNeeded = stateIfNeeded;
exports.default = setStateIfNeeded;
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function stateIfNeeded(state, props) {
return Object.keys(state).reduce(function (newState, name) {

@@ -8,2 +16,3 @@ if (_typeof(props[name]) !== undefined) {

}
return newState;

@@ -13,3 +22,3 @@ }, {});

export default function setStateIfNeeded(self) {
function setStateIfNeeded(self) {
var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -21,5 +30,5 @@

});
} else if ((typeof state === 'undefined' ? 'undefined' : _typeof(state)) === 'object') {
} else if (_typeof(state) === 'object') {
self.setState(stateIfNeeded(state, self.props));
}
}
{
"name": "@semcore/utils",
"description": "SEMRush Utils Component",
"version": "1.1.2",
"version": "1.3.0",
"main": "lib/index.js",

@@ -25,2 +25,3 @@ "author": "Roman Lysov <r.lysov@semrush.com>",

"dependencies": {
"classnames": "^2.2.5",
"hoist-non-react-statics": "^2.5.5"

@@ -27,0 +28,0 @@ },

Sorry, the diff of this file is not supported yet

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