@infotech/uikit-core
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,54 +6,57 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _identity = _interopRequireDefault(require("lodash/identity")); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
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; } } | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
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); } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
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); } } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var _react = require('react'); | ||
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); } | ||
var _react2 = _interopRequireDefault(_react); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _identity = require('lodash/identity'); | ||
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 _identity2 = _interopRequireDefault(_identity); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* Awesome Hocs, hold props until refresh handler will return true */ | ||
exports.default = function () { | ||
var _default = function _default() { | ||
var refreshOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () { | ||
return true; | ||
}; | ||
var filterProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _identity2.default; | ||
var filterProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _identity.default; | ||
return function (BaseComponent) { | ||
return function (_Component) { | ||
(0, _inherits3.default)(AccumalatedProps, _Component); | ||
var _temp; | ||
return _temp = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(AccumalatedProps, _Component); | ||
function AccumalatedProps(props) { | ||
(0, _classCallCheck3.default)(this, AccumalatedProps); | ||
var _this; | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (AccumalatedProps.__proto__ || (0, _getPrototypeOf2.default)(AccumalatedProps)).call(this, props)); | ||
_classCallCheck(this, AccumalatedProps); | ||
_this.accumulatedProps = _this.props; | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(AccumalatedProps).call(this, props)); | ||
_defineProperty(_assertThisInitialized(_this), "accumulatedProps", _this.props); | ||
_this.accumulatedProps = filterProps(_this.props); | ||
@@ -63,4 +66,4 @@ return _this; | ||
(0, _createClass3.default)(AccumalatedProps, [{ | ||
key: 'componentWillReceiveProps', | ||
_createClass(AccumalatedProps, [{ | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
@@ -72,12 +75,14 @@ if (refreshOn(nextProps, this.props)) { | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var nextProps = this.props === this.accumulatedProps ? this.props : (0, _assign2.default)({}, this.props, this.accumulatedProps); | ||
return _react2.default.createElement(BaseComponent, nextProps); | ||
var nextProps = this.props === this.accumulatedProps ? this.props : _objectSpread({}, this.props, this.accumulatedProps); | ||
return _react.default.createElement(BaseComponent, nextProps); | ||
} | ||
}]); | ||
return AccumalatedProps; | ||
}(_react.Component); | ||
}(_react.Component), _temp; | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,33 +6,30 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.defaultIterator = exports.arrayIterator = undefined; | ||
exports.default = exports.defaultIterator = exports.arrayIterator = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
require("./styles.css"); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _react = require('react'); | ||
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 _react2 = _interopRequireDefault(_react); | ||
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; } | ||
var _classnames = require('classnames'); | ||
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; } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
require('./styles.css'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var styles = { | ||
'List': 'uikit_internal_core__List_66b0c562' | ||
"List": "uikit_internal_core__List_66b0c562" | ||
}; // @related-file ./styles.css | ||
var arrayIterator = exports.arrayIterator = function arrayIterator(array, iteratee) { | ||
var arrayIterator = function arrayIterator(array, iteratee) { | ||
return array && array.length ? array.map(iteratee) : null; | ||
}; | ||
var defaultIterator = exports.defaultIterator = arrayIterator; | ||
exports.arrayIterator = arrayIterator; | ||
var defaultIterator = arrayIterator; | ||
exports.defaultIterator = defaultIterator; | ||
var asList = function asList(WrappedComponent) { | ||
@@ -43,19 +40,18 @@ var iterator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultIterator; | ||
className = _ref.className, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['data', 'className']); | ||
return _react2.default.createElement( | ||
'ul', | ||
{ className: (0, _classnames2.default)(styles.List, className) | ||
}, | ||
iterator(data, function (item, index, collection) { | ||
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({ | ||
key: index, | ||
index: index, | ||
data: item, | ||
collection: collection | ||
}, props)); | ||
}) | ||
); | ||
props = _objectWithoutProperties(_ref, ["data", "className"]); | ||
return _react.default.createElement("ul", { | ||
className: (0, _classnames.default)(styles.List, className) | ||
}, iterator(data, function (item, index, collection) { | ||
return _react.default.createElement(WrappedComponent, _extends({ | ||
key: index, | ||
index: index, | ||
data: item, | ||
collection: collection | ||
}, props)); | ||
})); | ||
}; | ||
}; | ||
exports.default = asList; | ||
var _default = asList; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
var _omitProps = require('./omit-props'); | ||
var _omitProps = _interopRequireDefault(require("./omit-props")); | ||
var _omitProps2 = _interopRequireDefault(_omitProps); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = (0, _recompose.compose)((0, _recompose.withState)('mounted', 'setMounted', false), (0, _recompose.lifecycle)({ | ||
var _default = (0, _recompose.compose)((0, _recompose.withState)("mounted", "setMounted", false), (0, _recompose.lifecycle)({ | ||
componentDidMount: function componentDidMount() { | ||
@@ -23,2 +22,4 @@ this.props.setMounted(true); | ||
} | ||
}), (0, _omitProps2.default)(['setMounted'])); | ||
}), (0, _omitProps.default)(["setMounted"])); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,109 +6,96 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _recompose = require("recompose"); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _noop = _interopRequireDefault(require("lodash/noop")); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _omitProps = _interopRequireDefault(require("./omit-props")); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _clickedOutsideElement = _interopRequireDefault(require("../tools/clicked-outside-element")); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
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); } | ||
var _react = require('react'); | ||
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 _react2 = _interopRequireDefault(_react); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _reactDom = require('react-dom'); | ||
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); } } | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _propTypes = require('prop-types'); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var _recompose = require('recompose'); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var _noop = require('lodash/noop'); | ||
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); } | ||
var _noop2 = _interopRequireDefault(_noop); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _omitProps = require('./omit-props'); | ||
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 _omitProps2 = _interopRequireDefault(_omitProps); | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
var _clickedOutsideElement = require('../tools/clicked-outside-element'); | ||
var _clickedOutsideElement2 = _interopRequireDefault(_clickedOutsideElement); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var clickedOutside = function clickedOutside(WrappedComponent) { | ||
var _class, _temp2; | ||
var _class, _temp; | ||
var WrappedClassComponent = (0, _recompose.toClass)(WrappedComponent); | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(ClickedOutside, _React$Component); | ||
return _temp2 = _class = function (_React$Component) { | ||
(0, _inherits3.default)(ClickedOutside, _React$Component); | ||
function ClickedOutside() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
(0, _classCallCheck3.default)(this, ClickedOutside); | ||
_classCallCheck(this, ClickedOutside); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ClickedOutside.__proto__ || (0, _getPrototypeOf2.default)(ClickedOutside)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (event) { | ||
if ((0, _clickedOutsideElement2.default)(_this.element, event)) _this.props.onClickOutside(event); | ||
}, _this.ref = function (component) { | ||
_this.element = _reactDom2.default.findDOMNode(component); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ClickedOutside)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) { | ||
if ((0, _clickedOutsideElement.default)(_this.element, event)) _this.props.onClickOutside(event); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "ref", function (component) { | ||
_this.element = _reactDom.default.findDOMNode(component); | ||
}); | ||
return _this; | ||
} | ||
(0, _createClass3.default)(ClickedOutside, [{ | ||
key: 'componentDidMount', | ||
_createClass(ClickedOutside, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
document.addEventListener('click', this.handleClick); | ||
document.addEventListener("click", this.handleClick); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
document.removeEventListener('click', this.handleClick); | ||
document.removeEventListener("click", this.handleClick); | ||
} | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
// eslint-disable-line | ||
value: function render() { | ||
return _react2.default.createElement(WrappedClassComponent, (0, _extends3.default)({ | ||
return _react.default.createElement(WrappedClassComponent, _extends({ | ||
ref: this.ref | ||
@@ -118,14 +105,17 @@ }, this.props)); | ||
}]); | ||
return ClickedOutside; | ||
}(_react2.default.Component), _class.defaultProps = { | ||
onClickOutside: _noop2.default | ||
}, _temp2; | ||
}(_react.default.Component), _defineProperty(_class, "defaultProps", { | ||
onClickOutside: _noop.default | ||
}), _temp; | ||
}; | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
onClickOutside: _propTypes2.default.func | ||
onClickOutside: _propTypes.default.func | ||
} | ||
})); | ||
exports.default = (0, _recompose.compose)((0, _wrapDisplayName2.default)('clickedOutside'), proxyStatics(clickedOutside), (0, _omitProps2.default)(['onClickOutside'])); | ||
var _default = (0, _recompose.compose)((0, _wrapDisplayName.default)("clickedOutside"), proxyStatics(clickedOutside), (0, _omitProps.default)(["onClickOutside"])); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.debugRender = exports.debugWrapping = undefined; | ||
exports.default = exports.debugRender = exports.debugWrapping = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var debugWrapping = exports.debugWrapping = function debugWrapping() { | ||
for (var _len = arguments.length, data = Array(_len), _key = 0; _key < _len; _key++) { | ||
/* eslint-disable no-console */ | ||
/* eslint-disable no-debugger */ | ||
var debugWrapping = function debugWrapping() { | ||
for (var _len = arguments.length, data = new Array(_len), _key = 0; _key < _len; _key++) { | ||
data[_key] = arguments[_key]; | ||
@@ -23,12 +24,15 @@ } | ||
(_console = console).log.apply(_console, ['Debug Wrapping: ', { | ||
(_console = console).log.apply(_console, ["Debug Wrapping: ", { | ||
Wrapped: Wrapped | ||
}].concat(data)); | ||
debugger; | ||
return Wrapped; | ||
}; | ||
}; /* eslint-disable no-console */ | ||
/* eslint-disable no-debugger */ | ||
var debugRender = exports.debugRender = function debugRender() { | ||
for (var _len2 = arguments.length, data = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
}; | ||
exports.debugWrapping = debugWrapping; | ||
var debugRender = function debugRender() { | ||
for (var _len2 = arguments.length, data = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
data[_key2] = arguments[_key2]; | ||
@@ -41,8 +45,9 @@ } | ||
(_console2 = console).log.apply(_console2, ['Debug Render: ', { | ||
(_console2 = console).log.apply(_console2, ["Debug Render: ", { | ||
props: props, | ||
Wrapped: Wrapped | ||
}].concat(data)); | ||
debugger; | ||
return _react2.default.createElement(Wrapped, props); | ||
return _react.default.createElement(Wrapped, props); | ||
}; | ||
@@ -52,2 +57,4 @@ }; | ||
exports.default = debugRender; | ||
exports.debugRender = debugRender; | ||
var _default = debugRender; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.logRender = exports.logWrapping = undefined; | ||
exports.default = exports.logRender = exports.logWrapping = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var logWrapping = exports.logWrapping = function logWrapping() { | ||
for (var _len = arguments.length, data = Array(_len), _key = 0; _key < _len; _key++) { | ||
/* eslint-disable no-console */ | ||
var logWrapping = function logWrapping() { | ||
for (var _len = arguments.length, data = new Array(_len), _key = 0; _key < _len; _key++) { | ||
data[_key] = arguments[_key]; | ||
@@ -23,10 +22,14 @@ } | ||
(_console = console).log.apply(_console, ['Log Wrapping: ', { | ||
(_console = console).log.apply(_console, ["Log Wrapping: ", { | ||
Wrapped: Wrapped | ||
}].concat(data)); | ||
return Wrapped; | ||
}; | ||
}; /* eslint-disable no-console */ | ||
var logRender = exports.logRender = function logRender() { | ||
for (var _len2 = arguments.length, data = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
}; | ||
exports.logWrapping = logWrapping; | ||
var logRender = function logRender() { | ||
for (var _len2 = arguments.length, data = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
data[_key2] = arguments[_key2]; | ||
@@ -39,7 +42,8 @@ } | ||
(_console2 = console).log.apply(_console2, ['Log Render: ', { | ||
(_console2 = console).log.apply(_console2, ["Log Render: ", { | ||
props: props, | ||
Wrapped: Wrapped | ||
}].concat(data)); | ||
return _react2.default.createElement(Wrapped, props); | ||
return _react.default.createElement(Wrapped, props); | ||
}; | ||
@@ -49,2 +53,4 @@ }; | ||
exports.default = logRender; | ||
exports.logRender = logRender; | ||
var _default = logRender; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (Wrapped) { | ||
var _default = function _default(Wrapped) { | ||
return function (props) { | ||
return _react2.default.createElement(Wrapped, props); | ||
return _react.default.createElement(Wrapped, props); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
/* Always invalid if error exists */ | ||
exports.default = (0, _recompose.withPropsOnChange)(['error', 'invalid'], function (_ref) { | ||
var _default = (0, _recompose.withPropsOnChange)(["error", "invalid"], function (_ref) { | ||
var error = _ref.error, | ||
@@ -17,2 +18,4 @@ invalid = _ref.invalid; | ||
}; | ||
}); | ||
}); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,39 +6,40 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.restoreRef = exports.forwardRef = undefined; | ||
exports.restoreRef = exports.forwardRef = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
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); } | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
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 _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
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; } | ||
var _defineProperty3 = _interopRequireDefault(_defineProperty2); | ||
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; } | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
var _assign2 = _interopRequireDefault(_assign); | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
var _react = require('react'); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _react2 = _interopRequireDefault(_react); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var FORWARED_REF_PROP_NAME = "forwardedRef"; | ||
var FORWARED_REF_PROP_NAME = 'forwardedRef'; | ||
var forwardRef = exports.forwardRef = function forwardRef(WrappedComponent) { | ||
return _react2.default.forwardRef(function (props, ref) { | ||
return _react2.default.createElement(WrappedComponent, (0, _assign2.default)((0, _defineProperty3.default)({}, FORWARED_REF_PROP_NAME, ref), props)); | ||
var forwardRef = function forwardRef(WrappedComponent) { | ||
return _react.default.forwardRef(function (props, ref) { | ||
return _react.default.createElement(WrappedComponent, _objectSpread(_defineProperty({}, FORWARED_REF_PROP_NAME, ref), props)); | ||
}); | ||
}; | ||
exports.forwardRef = forwardRef; | ||
var restoreRef = function restoreRef(WrappedComponent) { | ||
return function (_ref) { | ||
var ref = _ref[FORWARED_REF_PROP_NAME], | ||
props = (0, _objectWithoutProperties3.default)(_ref, [FORWARED_REF_PROP_NAME]); | ||
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({ | ||
props = _objectWithoutProperties(_ref, [FORWARED_REF_PROP_NAME].map(_toPropertyKey)); | ||
return _react.default.createElement(WrappedComponent, _extends({ | ||
ref: ref | ||
@@ -48,2 +49,3 @@ }, props)); | ||
}; | ||
exports.restoreRef = restoreRef; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,36 +6,29 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _recompose = require('recompose'); | ||
var _proxyPropStatics = _interopRequireDefault(require("../proxy-prop-statics")); | ||
var _propTypes = require('prop-types'); | ||
var _proxyDisplayName = _interopRequireDefault(require("../proxy-display-name")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _wrapDisplayName = _interopRequireDefault(require("../wrap-display-name")); | ||
var _proxyPropStatics = require('../proxy-prop-statics'); | ||
require("./index.css"); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _proxyDisplayName = require('../proxy-display-name'); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
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 _wrapDisplayName = require('../wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
require('./index.css'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var fullWidthStyles = { | ||
'fullWidth': 'uikit_internal_core__fullWidth_88374fbd' | ||
"fullWidth": "uikit_internal_core__fullWidth_88374fbd" | ||
}; // @related-file ./index.css | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
fullWidth: _propTypes2.default.bool | ||
fullWidth: _propTypes.default.bool | ||
}, | ||
@@ -46,10 +39,11 @@ defaultProps: { | ||
})); | ||
var logic = (0, _recompose.compose)((0, _recompose.withPropsOnChange)(['styles'], function (_ref) { | ||
var logic = (0, _recompose.compose)((0, _recompose.withPropsOnChange)(["styles"], function (_ref) { | ||
var styles = _ref.styles; | ||
return { | ||
styles: (0, _assign2.default)({}, styles, fullWidthStyles) | ||
styles: _objectSpread({}, styles, fullWidthStyles) | ||
}; | ||
})); | ||
exports.default = (0, _recompose.compose)((0, _wrapDisplayName2.default)('fullWidth'), proxyStatics(logic)); | ||
var _default = (0, _recompose.compose)((0, _wrapDisplayName.default)("fullWidth"), proxyStatics(logic)); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,29 +6,18 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _recompose = require("recompose"); | ||
var _recompose = require('recompose'); | ||
var _invoke = _interopRequireDefault(require("lodash/invoke")); | ||
var _invoke = require('lodash/invoke'); | ||
var _omit = _interopRequireDefault(require("lodash/omit")); | ||
var _invoke2 = _interopRequireDefault(_invoke); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _omit = require('lodash/omit'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _omit2 = _interopRequireDefault(_omit); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -42,22 +31,24 @@ | ||
var _ref$valueProp = _ref.valueProp, | ||
valueProp = _ref$valueProp === undefined ? 'value' : _ref$valueProp, | ||
valueProp = _ref$valueProp === void 0 ? "value" : _ref$valueProp, | ||
_ref$changeHandlerPro = _ref.changeHandlerProp, | ||
changeHandlerProp = _ref$changeHandlerPro === undefined ? 'changeHandler' : _ref$changeHandlerPro; | ||
changeHandlerProp = _ref$changeHandlerPro === void 0 ? "changeHandler" : _ref$changeHandlerPro; | ||
return (0, _recompose.compose)((0, _recompose.withHandlers)({ | ||
onChange: function onChange(props) { | ||
return function (event) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
if (changeHandlerProp !== "onChange") { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
_invoke.default.apply(void 0, [props, "onChange", event].concat(args)); | ||
} | ||
if (changeHandlerProp !== 'onChange') { | ||
_invoke2.default.apply(undefined, [props, 'onChange', event].concat(args)); | ||
} | ||
(0, _invoke2.default)(props, changeHandlerProp, valueFromEvent(event, valueProp)); | ||
(0, _invoke.default)(props, changeHandlerProp, valueFromEvent(event, valueProp)); | ||
}; | ||
} | ||
}), (0, _recompose.mapProps)(function (props) { | ||
if (changeHandlerProp !== 'onChange') { | ||
return (0, _omit2.default)(props, [changeHandlerProp]); | ||
if (changeHandlerProp !== "onChange") { | ||
return (0, _omit.default)(props, [changeHandlerProp]); | ||
} | ||
return props; | ||
@@ -67,11 +58,13 @@ })); | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
onChange: _propTypes2.default.func, | ||
changeHandler: _propTypes2.default.func | ||
onChange: _propTypes.default.func, | ||
changeHandler: _propTypes.default.func | ||
} | ||
})); | ||
exports.default = function () { | ||
return (0, _recompose.compose)((0, _wrapDisplayName2.default)('handlesChanges'), proxyStatics(handlesChanges.apply(undefined, arguments))); | ||
}; | ||
var _default = function _default() { | ||
return (0, _recompose.compose)((0, _wrapDisplayName.default)("handlesChanges"), proxyStatics(handlesChanges.apply(void 0, arguments))); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,31 +6,24 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
var _omit = require('lodash/fp/omit'); | ||
var _omit = _interopRequireDefault(require("lodash/fp/omit")); | ||
var _omit2 = _interopRequireDefault(_omit); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var omitProps = (0, _recompose.compose)(_recompose.mapProps, _omit2.default); | ||
var omitProps = (0, _recompose.compose)(_recompose.mapProps, _omit.default); | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)()); | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)()); | ||
var enhance = function enhance(excludeProps) { | ||
return (0, _recompose.compose)((0, _wrapDisplayName2.default)('omitProps'), proxyStatics(omitProps(excludeProps))); | ||
return (0, _recompose.compose)((0, _wrapDisplayName.default)("omitProps"), proxyStatics(omitProps(excludeProps))); | ||
}; | ||
exports.default = enhance; | ||
var _default = enhance; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,21 +6,22 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _setDefaultProps = _interopRequireDefault(require("./set-default-props")); | ||
var _recompose = require('recompose'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _setDefaultProps = require('./set-default-props'); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _setDefaultProps2 = _interopRequireDefault(_setDefaultProps); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (defaultProps) { | ||
var _default = function _default(defaultProps) { | ||
return function (hoc) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.compose)((0, _setDefaultProps2.default)((0, _assign2.default)({}, WrappedComponent.defaultProps, defaultProps)), hoc)(WrappedComponent); | ||
return (0, _recompose.compose)((0, _setDefaultProps.default)(_objectSpread({}, WrappedComponent.defaultProps, defaultProps)), hoc)(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,9 +6,12 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
exports.default = function (hoc) { | ||
var _default = function _default(hoc) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.compose)((0, _recompose.setDisplayName)((0, _recompose.getDisplayName)(WrappedComponent)), hoc)(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,16 +6,13 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
var _proxyPropTypes = require('./proxy-prop-types'); | ||
var _proxyPropTypes = _interopRequireDefault(require("./proxy-prop-types")); | ||
var _proxyPropTypes2 = _interopRequireDefault(_proxyPropTypes); | ||
var _proxyDefaultProps = _interopRequireDefault(require("./proxy-default-props")); | ||
var _proxyDefaultProps = require('./proxy-default-props'); | ||
var _proxyDefaultProps2 = _interopRequireDefault(_proxyDefaultProps); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function () { | ||
var _default = function _default() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
@@ -25,3 +22,5 @@ propTypes = _ref.propTypes, | ||
return (0, _recompose.compose)((0, _proxyPropTypes2.default)(propTypes), (0, _proxyDefaultProps2.default)(defaultProps)); | ||
}; | ||
return (0, _recompose.compose)((0, _proxyPropTypes.default)(propTypes), (0, _proxyDefaultProps.default)(defaultProps)); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,17 +6,18 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _recompose = require('recompose'); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (propTypes) { | ||
var _default = function _default(propTypes) { | ||
return function (hoc) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.compose)((0, _recompose.setPropTypes)((0, _assign2.default)({}, WrappedComponent.propTypes, propTypes)), hoc)(WrappedComponent); | ||
return (0, _recompose.compose)((0, _recompose.setPropTypes)(_objectSpread({}, WrappedComponent.propTypes, propTypes)), hoc)(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,33 +6,26 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _recompose = require("recompose"); | ||
var _propTypes = require('prop-types'); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _recompose = require('recompose'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
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 _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var proxyStatics = function proxyStatics(defaultStyles) { | ||
return (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
return (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
styles: _propTypes2.default.shape({}), | ||
style: _propTypes2.default.shape({}), | ||
className: _propTypes2.default.string | ||
styles: _propTypes.default.shape({}), | ||
style: _propTypes.default.shape({}), | ||
className: _propTypes.default.string | ||
}, | ||
@@ -45,15 +38,13 @@ defaultProps: { | ||
})); | ||
}; /** | ||
* HOC, accepts classnames hashmap (generated by css-modules). Provides styles | ||
* as props to child component. Thus, you can use it in your component as is, | ||
* or customize by passing props with another hashmap. Here is such a trick. | ||
*/ | ||
}; | ||
exports.default = function (defaultStyles) { | ||
return (0, _recompose.compose)((0, _wrapDisplayName2.default)('restyled'), proxyStatics(defaultStyles)((0, _recompose.withPropsOnChange)(['styles'], function (_ref) { | ||
var _default = function _default(defaultStyles) { | ||
return (0, _recompose.compose)((0, _wrapDisplayName.default)("restyled"), proxyStatics(defaultStyles)((0, _recompose.withPropsOnChange)(["styles"], function (_ref) { | ||
var styles = _ref.styles; | ||
return { | ||
styles: (0, _assign2.default)({}, defaultStyles, styles) | ||
styles: _objectSpread({}, defaultStyles, styles) | ||
}; | ||
}))); | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
exports.default = function (defaultProps) { | ||
return (0, _recompose.setStatic)('defaultProps', defaultProps); | ||
}; | ||
var _default = function _default(defaultProps) { | ||
return (0, _recompose.setStatic)("defaultProps", defaultProps); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,16 +6,17 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
var _omit = require('lodash/fp/omit'); | ||
var _omit = _interopRequireDefault(require("lodash/fp/omit")); | ||
var _omit2 = _interopRequireDefault(_omit); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// TODO format | ||
exports.default = function (excludePropTypes) { | ||
var _default = function _default(excludePropTypes) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.setPropTypes)((0, _omit2.default)(excludePropTypes, WrappedComponent.propTypes))(WrappedComponent); | ||
return (0, _recompose.setPropTypes)((0, _omit.default)(excludePropTypes, WrappedComponent.propTypes))(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,47 +6,33 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.uncontrollableHoc = undefined; | ||
exports.default = exports.uncontrollableHoc = void 0; | ||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _defineProperty3 = _interopRequireDefault(_defineProperty2); | ||
var _recompose = require("recompose"); | ||
var _propTypes = require('prop-types'); | ||
var _invoke = _interopRequireDefault(require("lodash/invoke")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _recompose = require('recompose'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _invoke = require('lodash/invoke'); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _invoke2 = _interopRequireDefault(_invoke); | ||
var _omitProps = _interopRequireDefault(require("./omit-props")); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
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 _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _omitProps = require('./omit-props'); | ||
var _omitProps2 = _interopRequireDefault(_omitProps); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var uncontrollableHoc = exports.uncontrollableHoc = function uncontrollableHoc(_ref) { | ||
var uncontrollableHoc = function uncontrollableHoc(_ref) { | ||
var _ref$valueProp = _ref.valueProp, | ||
valueProp = _ref$valueProp === undefined ? 'value' : _ref$valueProp, | ||
valueProp = _ref$valueProp === void 0 ? "value" : _ref$valueProp, | ||
_ref$changeHandlerPro = _ref.changeHandlerProp, | ||
changeHandlerProp = _ref$changeHandlerPro === undefined ? 'changeHandler' : _ref$changeHandlerPro; | ||
return (0, _recompose.compose)((0, _wrapDisplayName2.default)('uncontrollable'), (0, _proxyDisplayName2.default)((0, _recompose.withStateHandlers)(function (props) { | ||
return (0, _defineProperty3.default)({}, valueProp, props[valueProp]); | ||
}, (0, _defineProperty3.default)({}, changeHandlerProp, function (state, props) { | ||
changeHandlerProp = _ref$changeHandlerPro === void 0 ? "changeHandler" : _ref$changeHandlerPro; | ||
return (0, _recompose.compose)((0, _wrapDisplayName.default)("uncontrollable"), (0, _proxyDisplayName.default)((0, _recompose.withStateHandlers)(function (props) { | ||
return _defineProperty({}, valueProp, props[valueProp]); | ||
}, _defineProperty({}, changeHandlerProp, function (state, props) { | ||
return function (value) { | ||
(0, _invoke2.default)(props, changeHandlerProp, value); | ||
return (0, _defineProperty3.default)({}, valueProp, value); | ||
(0, _invoke.default)(props, changeHandlerProp, value); | ||
return _defineProperty({}, valueProp, value); | ||
}; | ||
@@ -56,5 +42,6 @@ })))); | ||
var proxyStatics = (0, _recompose.compose)((0, _proxyPropStatics2.default)({ | ||
exports.uncontrollableHoc = uncontrollableHoc; | ||
var proxyStatics = (0, _recompose.compose)((0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
uncontrollable: _propTypes2.default.bool | ||
uncontrollable: _propTypes.default.bool | ||
}, | ||
@@ -66,3 +53,3 @@ defaultProps: { | ||
exports.default = function () { | ||
var _default = function _default() { | ||
return (0, _recompose.compose)(proxyStatics((0, _recompose.branch)(function (_ref4) { | ||
@@ -72,5 +59,6 @@ var uncontrollable = _ref4.uncontrollable, | ||
return uncontrollable || stateful; | ||
}, uncontrollableHoc.apply(undefined, arguments))), | ||
// omit props after hoc default props mixed in | ||
(0, _proxyPropStatics2.default)()((0, _omitProps2.default)(['uncontrollable']))); | ||
}; | ||
}, uncontrollableHoc.apply(void 0, arguments))), // omit props after hoc default props mixed in | ||
(0, _proxyPropStatics.default)()((0, _omitProps.default)(["uncontrollable"]))); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,27 +6,24 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _map = _interopRequireDefault(require("lodash/map")); | ||
var _classnames = require('classnames'); | ||
var _recompose = require("recompose"); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _map = require('lodash/map'); | ||
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; } | ||
var _map2 = _interopRequireDefault(_map); | ||
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; } | ||
var _recompose = require('recompose'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var mapNames = function mapNames(names, props) { | ||
return (0, _map2.default)(names, function (name) { | ||
return typeof name === 'function' ? name(props) : name; | ||
return (0, _map.default)(names, function (name) { | ||
return typeof name === "function" ? name(props) : name; | ||
}); | ||
}; | ||
exports.default = function () { | ||
for (var _len = arguments.length, classNames = Array(_len), _key = 0; _key < _len; _key++) { | ||
var _default = function _default() { | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
@@ -37,7 +34,10 @@ } | ||
var className = _ref.className, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['className']); | ||
props = _objectWithoutProperties(_ref, ["className"]); | ||
return { | ||
className: (0, _classnames2.default)(mapNames(classNames, props), className) | ||
className: (0, _classnames.default)(mapNames(classNames, props), className) | ||
}; | ||
}); | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,17 +6,18 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _setDefaultProps = _interopRequireDefault(require("./set-default-props")); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _setDefaultProps = require('./set-default-props'); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _setDefaultProps2 = _interopRequireDefault(_setDefaultProps); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (defaultProps) { | ||
var _default = function _default(defaultProps) { | ||
return function (WrappedComponent) { | ||
return (0, _setDefaultProps2.default)((0, _assign2.default)({}, WrappedComponent.defaultProps, defaultProps))(WrappedComponent); | ||
return (0, _setDefaultProps.default)(_objectSpread({}, WrappedComponent.defaultProps, defaultProps))(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,74 +6,78 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _recompose = require("recompose"); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _lodash = require("lodash"); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
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); } | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
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 _createClass3 = _interopRequireDefault(_createClass2); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
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); } } | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var _react = require('react'); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var _react2 = _interopRequireDefault(_react); | ||
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); } | ||
var _reactDom = require('react-dom'); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
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 _recompose = require('recompose'); | ||
var _lodash = require('lodash'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var withDelayedMouseLeave = function withDelayedMouseLeave(delay) { | ||
return function (WrappedComponent) { | ||
var _class, _temp2; | ||
var _class, _temp; | ||
var WrappedClassComponent = (0, _recompose.toClass)(WrappedComponent); | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(WithDelayedMouseLeave, _React$Component); | ||
return _temp2 = _class = function (_React$Component) { | ||
(0, _inherits3.default)(WithDelayedMouseLeave, _React$Component); | ||
function WithDelayedMouseLeave() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
(0, _classCallCheck3.default)(this, WithDelayedMouseLeave); | ||
_classCallCheck(this, WithDelayedMouseLeave); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = WithDelayedMouseLeave.__proto__ || (0, _getPrototypeOf2.default)(WithDelayedMouseLeave)).call.apply(_ref, [this].concat(args))), _this), _this.handleMouseLeave = function (event) { | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithDelayedMouseLeave)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function (event) { | ||
_this.callbackTimeout = setTimeout(function () { | ||
return _this.props.onMouseLeave(event); | ||
}, delay); | ||
}, _this.handleMouseEnter = function () { | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () { | ||
_this.cancelCallback(); | ||
}, _this.ref = function (component) { | ||
_this.element = _reactDom2.default.findDOMNode(component); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "ref", function (component) { | ||
_this.element = _reactDom.default.findDOMNode(component); | ||
}); | ||
return _this; | ||
} | ||
(0, _createClass3.default)(WithDelayedMouseLeave, [{ | ||
key: 'componentDidMount', | ||
_createClass(WithDelayedMouseLeave, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
@@ -83,3 +87,3 @@ this.addEventListeners(); | ||
}, { | ||
key: 'componentDidUpdate', | ||
key: "componentDidUpdate", | ||
value: function componentDidUpdate() { | ||
@@ -89,3 +93,3 @@ this.addEventListeners(); | ||
}, { | ||
key: 'componentWillUnmount', | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
@@ -96,21 +100,19 @@ this.removeEventListeners(); | ||
}, { | ||
key: 'addEventListeners', | ||
key: "addEventListeners", | ||
value: function addEventListeners() { | ||
if (!this.element || this.areListenersSet) return; | ||
this.element.addEventListener('mouseleave', this.handleMouseLeave); | ||
this.element.addEventListener('mouseenter', this.handleMouseEnter); | ||
this.element.addEventListener("mouseleave", this.handleMouseLeave); | ||
this.element.addEventListener("mouseenter", this.handleMouseEnter); | ||
this.areListenersSet = true; | ||
} | ||
}, { | ||
key: 'removeEventListeners', | ||
key: "removeEventListeners", | ||
value: function removeEventListeners() { | ||
if (!this.element) return; | ||
this.element.removeEventListener('mouseleave', this.handleMouseLeave); | ||
this.element.removeEventListener('mouseenter', this.handleMouseEnter); | ||
this.element.removeEventListener("mouseleave", this.handleMouseLeave); | ||
this.element.removeEventListener("mouseenter", this.handleMouseEnter); | ||
this.areListenersSet = false; | ||
} | ||
}, { | ||
key: 'cancelCallback', | ||
key: "cancelCallback", | ||
value: function cancelCallback() { | ||
@@ -120,18 +122,19 @@ clearTimeout(this.callbackTimeout); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
// eslint-disable-line | ||
value: function render() { | ||
return _react2.default.createElement(WrappedClassComponent, (0, _extends3.default)({ | ||
return _react.default.createElement(WrappedClassComponent, _extends({ | ||
ref: this.ref | ||
}, (0, _lodash.omit)(this.props, ['onMouseLeave']))); | ||
}, (0, _lodash.omit)(this.props, ["onMouseLeave"]))); | ||
} | ||
}]); | ||
return WithDelayedMouseLeave; | ||
}(_react2.default.Component), _class.defaultProps = { | ||
}(_react.default.Component), _defineProperty(_class, "defaultProps", { | ||
onMouseLeave: _lodash.noop | ||
}, _temp2; | ||
}), _temp; | ||
}; | ||
}; | ||
exports.default = withDelayedMouseLeave; | ||
var _default = withDelayedMouseLeave; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,74 +6,72 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.withFocus = undefined; | ||
exports.default = exports.withFocus = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _recompose = require("recompose"); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
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); } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
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 _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
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); } } | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _react = require('react'); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var _react2 = _interopRequireDefault(_react); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var _recompose = require('recompose'); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var _propTypes = require('prop-types'); | ||
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); } | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
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 _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var withFocus = function withFocus(WrappedComponent) { | ||
var _temp; | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
return _temp = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(WithFocus, _React$Component); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var withFocus = exports.withFocus = function withFocus(WrappedComponent) { | ||
return function (_React$Component) { | ||
(0, _inherits3.default)(WithFocus, _React$Component); | ||
function WithFocus() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
(0, _classCallCheck3.default)(this, WithFocus); | ||
_classCallCheck(this, WithFocus); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = WithFocus.__proto__ || (0, _getPrototypeOf2.default)(WithFocus)).call.apply(_ref, [this].concat(args))), _this), _this.refProxy = function (element) { | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithFocus)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "refProxy", function (element) { | ||
return _this.element = element; | ||
}, _this.focusMeOnUpdate = false, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "focusMeOnUpdate", false); | ||
return _this; | ||
} | ||
(0, _createClass3.default)(WithFocus, [{ | ||
key: 'componentDidMount', | ||
_createClass(WithFocus, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
@@ -83,3 +81,3 @@ this.props.autoFocus && this.element && this.element.focus(); | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(newProps) { | ||
@@ -89,3 +87,3 @@ this.focusMeOnUpdate = !this.props.autoFocus && newProps.autoFocus; | ||
}, { | ||
key: 'componentDidUpdate', | ||
key: "componentDidUpdate", | ||
value: function componentDidUpdate() { | ||
@@ -97,5 +95,5 @@ if (this.focusMeOnUpdate) { | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({ | ||
return _react.default.createElement(WrappedComponent, _extends({ | ||
refProxy: this.refProxy | ||
@@ -105,12 +103,16 @@ }, this.props)); | ||
}]); | ||
return WithFocus; | ||
}(_react2.default.Component); | ||
}(_react.default.Component), _temp; | ||
}; | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
exports.withFocus = withFocus; | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
autoFocus: _propTypes2.default.bool | ||
autoFocus: _propTypes.default.bool | ||
} | ||
})); | ||
exports.default = (0, _recompose.compose)((0, _wrapDisplayName2.default)('withFocus'), proxyStatics(withFocus)); | ||
var _default = (0, _recompose.compose)((0, _wrapDisplayName.default)("withFocus"), proxyStatics(withFocus)); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,27 +6,22 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _defineProperty3 = _interopRequireDefault(_defineProperty2); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _react = require('react'); | ||
require("./styles.css"); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames = require('classnames'); | ||
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 _classnames2 = _interopRequireDefault(_classnames); | ||
require('./styles.css'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var styles = { | ||
'ErrorMessageContainer': 'uikit_internal_core__ErrorMessageContainer_302113ac', | ||
'ErrorMessage': 'uikit_internal_core__ErrorMessage_302113ac', | ||
'inline': 'uikit_internal_core__inline_302113ac', | ||
'beetle': 'uikit_internal_core__beetle_302113ac' | ||
"ErrorMessageContainer": "uikit_internal_core__ErrorMessageContainer_302113ac", | ||
"ErrorMessage": "uikit_internal_core__ErrorMessage_302113ac", | ||
"inline": "uikit_internal_core__inline_302113ac", | ||
"beetle": "uikit_internal_core__beetle_302113ac" | ||
}; // @related-file ./styles.css | ||
exports.default = function (_ref) { | ||
var _default = function _default(_ref) { | ||
var _cn; | ||
@@ -40,13 +35,9 @@ | ||
alwaysShow = _ref.alwaysShow; | ||
return _react2.default.createElement( | ||
'div', | ||
{ className: (0, _classnames2.default)(styles.ErrorMessageContainer, (_cn = {}, (0, _defineProperty3.default)(_cn, styles.inline, inline), (0, _defineProperty3.default)(_cn, styles.beetle, alwaysShow), _cn)) | ||
}, | ||
children, | ||
!hideErrorMessage && _react2.default.createElement( | ||
'div', | ||
{ className: (0, _classnames2.default)(styles.ErrorMessage, errorMessageClassName) }, | ||
message | ||
) | ||
); | ||
}; | ||
return _react.default.createElement("div", { | ||
className: (0, _classnames.default)(styles.ErrorMessageContainer, (_cn = {}, _defineProperty(_cn, styles.inline, inline), _defineProperty(_cn, styles.beetle, alwaysShow), _cn)) | ||
}, children, !hideErrorMessage && _react.default.createElement("div", { | ||
className: (0, _classnames.default)(styles.ErrorMessage, errorMessageClassName) | ||
}, message)); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,39 +6,29 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _omit = _interopRequireDefault(require("lodash/omit")); | ||
var _react = require('react'); | ||
var _ErrorMessageContainer = _interopRequireDefault(require("./ErrorMessageContainer")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _omit = require('lodash/omit'); | ||
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 _omit2 = _interopRequireDefault(_omit); | ||
var _ErrorMessageContainer = require('./ErrorMessageContainer'); | ||
var _ErrorMessageContainer2 = _interopRequireDefault(_ErrorMessageContainer); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* Wrap with component, that display error message */ | ||
exports.default = function (BaseComponent) { | ||
var _default = function _default(BaseComponent) { | ||
return function (props) { | ||
return _react2.default.createElement( | ||
_ErrorMessageContainer2.default, | ||
{ | ||
inline: props.inline, | ||
message: props.error, | ||
hideErrorMessage: props.hideErrorMessage, | ||
alwaysShow: props.showBottomSpace, | ||
errorMessageClassName: props.errorMessageClassName | ||
}, | ||
_react2.default.createElement(BaseComponent, (0, _extends3.default)({}, (0, _omit2.default)(props, ['inline']), { | ||
invalid: props.invalid || props.error | ||
})) | ||
); | ||
return _react.default.createElement(_ErrorMessageContainer.default, { | ||
inline: props.inline, | ||
message: props.error, | ||
hideErrorMessage: props.hideErrorMessage, | ||
alwaysShow: props.showBottomSpace, | ||
errorMessageClassName: props.errorMessageClassName | ||
}, _react.default.createElement(BaseComponent, _extends({}, (0, _omit.default)(props, ["inline"]), { | ||
invalid: props.invalid || props.error | ||
}))); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,35 +6,24 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _recompose = require("recompose"); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _react = require('react'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _recompose = require('recompose'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _propTypes = require('prop-types'); | ||
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 _propTypes2 = _interopRequireDefault(_propTypes); | ||
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; } | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
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; } | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var WithLabelLayout = function WithLabelLayout(_ref) { | ||
@@ -45,15 +34,9 @@ var label = _ref.label, | ||
children = _ref.children, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['label', 'styles', 'className', 'children']); | ||
return _react2.default.createElement( | ||
'label', | ||
(0, _extends3.default)({ | ||
className: className | ||
}, props), | ||
children, | ||
label && _react2.default.createElement( | ||
'span', | ||
{ className: styles.Label }, | ||
label | ||
) | ||
); | ||
props = _objectWithoutProperties(_ref, ["label", "styles", "className", "children"]); | ||
return _react.default.createElement("label", _extends({ | ||
className: className | ||
}, props), children, label && _react.default.createElement("span", { | ||
className: styles.Label | ||
}, label)); | ||
}; | ||
@@ -66,24 +49,21 @@ | ||
styles = _ref2.styles, | ||
props = (0, _objectWithoutProperties3.default)(_ref2, ['label', 'labelProps', 'styles']); | ||
return _react2.default.createElement( | ||
WithLabelLayout, | ||
(0, _extends3.default)({ | ||
label: label, | ||
styles: styles | ||
}, labelProps), | ||
_react2.default.createElement(WrappedComponent, (0, _extends3.default)({ | ||
styles: styles | ||
}, props)) | ||
); | ||
props = _objectWithoutProperties(_ref2, ["label", "labelProps", "styles"]); | ||
return _react.default.createElement(WithLabelLayout, _extends({ | ||
label: label, | ||
styles: styles | ||
}, labelProps), _react.default.createElement(WrappedComponent, _extends({ | ||
styles: styles | ||
}, props))); | ||
}; | ||
}; | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
label: _propTypes2.default.node, | ||
labelProps: _propTypes2.default.shape({ | ||
styles: _propTypes2.default.shape({ | ||
Label: _propTypes2.default.string | ||
label: _propTypes.default.node, | ||
labelProps: _propTypes.default.shape({ | ||
styles: _propTypes.default.shape({ | ||
Label: _propTypes.default.string | ||
}), | ||
className: _propTypes2.default.string | ||
className: _propTypes.default.string | ||
}) | ||
@@ -93,2 +73,4 @@ } | ||
exports.default = (0, _recompose.compose)((0, _wrapDisplayName2.default)('withLabel'), proxyStatics(wrap)); | ||
var _default = (0, _recompose.compose)((0, _wrapDisplayName.default)("withLabel"), proxyStatics(wrap)); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,42 +6,35 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _recompose = require('recompose'); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _propTypes = require('prop-types'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
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 _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
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; } | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
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; } | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
disabled: _propTypes2.default.bool, | ||
onClick: _propTypes2.default.func, | ||
onDoubleClick: _propTypes2.default.func, | ||
onMouseDown: _propTypes2.default.func, | ||
onMouseUp: _propTypes2.default.func | ||
disabled: _propTypes.default.bool, | ||
onClick: _propTypes.default.func, | ||
onDoubleClick: _propTypes.default.func, | ||
onMouseDown: _propTypes.default.func, | ||
onMouseUp: _propTypes.default.func | ||
} | ||
})); | ||
exports.default = (0, _recompose.compose)((0, _wrapDisplayName2.default)('withPointerHandlers'), proxyStatics((0, _recompose.mapProps)(function (_ref) { | ||
var _default = (0, _recompose.compose)((0, _wrapDisplayName.default)("withPointerHandlers"), proxyStatics((0, _recompose.mapProps)(function (_ref) { | ||
var disabled = _ref.disabled, | ||
@@ -52,6 +45,7 @@ onClick = _ref.onClick, | ||
onMouseUp = _ref.onMouseUp, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['disabled', 'onClick', 'onDoubleClick', 'onMouseDown', 'onMouseUp']); | ||
return disabled ? (0, _assign2.default)({}, props, { | ||
props = _objectWithoutProperties(_ref, ["disabled", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp"]); | ||
return disabled ? _objectSpread({}, props, { | ||
disabled: disabled | ||
}) : (0, _assign2.default)({ | ||
}) : _objectSpread({ | ||
disabled: disabled, | ||
@@ -63,2 +57,4 @@ onClick: onClick, | ||
}, props); | ||
}))); | ||
}))); | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,16 +6,13 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
var _withPropTypes = require('./with-prop-types'); | ||
var _withPropTypes = _interopRequireDefault(require("./with-prop-types")); | ||
var _withPropTypes2 = _interopRequireDefault(_withPropTypes); | ||
var _withDefaultProps = _interopRequireDefault(require("./with-default-props")); | ||
var _withDefaultProps = require('./with-default-props'); | ||
var _withDefaultProps2 = _interopRequireDefault(_withDefaultProps); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function () { | ||
var _default = function _default() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
@@ -25,3 +22,5 @@ propTypes = _ref.propTypes, | ||
return (0, _recompose.compose)((0, _withPropTypes2.default)(propTypes), (0, _withDefaultProps2.default)(defaultProps)); | ||
}; | ||
return (0, _recompose.compose)((0, _withPropTypes.default)(propTypes), (0, _withDefaultProps.default)(defaultProps)); | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,15 +6,16 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _recompose = require('recompose'); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (propTypes) { | ||
var _default = function _default(propTypes) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.setPropTypes)((0, _assign2.default)({}, WrappedComponent.propTypes, propTypes))(WrappedComponent); | ||
return (0, _recompose.setPropTypes)(_objectSpread({}, WrappedComponent.propTypes, propTypes))(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,57 +6,62 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _omit = _interopRequireDefault(require("lodash/omit")); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
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; } } | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
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); } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
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 _createClass2 = require('babel-runtime/helpers/createClass'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
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); } } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var _react = require('react'); | ||
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); } | ||
var _react2 = _interopRequireDefault(_react); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _omit = require('lodash/omit'); | ||
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 _omit2 = _interopRequireDefault(_omit); | ||
var _default = function _default(BaseComponent) { | ||
var _temp; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
return _temp = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(RefProxy3, _Component); | ||
exports.default = function (BaseComponent) { | ||
return function (_Component) { | ||
(0, _inherits3.default)(RefProxy3, _Component); | ||
function RefProxy3() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
(0, _classCallCheck3.default)(this, RefProxy3); | ||
_classCallCheck(this, RefProxy3); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = RefProxy3.__proto__ || (0, _getPrototypeOf2.default)(RefProxy3)).call.apply(_ref, [this].concat(args))), _this), _this.localRef = _react2.default.createRef(), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RefProxy3)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "localRef", _react.default.createRef()); | ||
return _this; | ||
} | ||
(0, _createClass3.default)(RefProxy3, [{ | ||
key: 'componentDidMount', | ||
_createClass(RefProxy3, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
@@ -68,5 +73,5 @@ if (this.props.refProxy) { | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
return _react2.default.createElement(BaseComponent, (0, _extends3.default)({}, (0, _omit2.default)(this.props, 'refProxy'), { | ||
return _react.default.createElement(BaseComponent, _extends({}, (0, _omit.default)(this.props, "refProxy"), { | ||
ref: this.localRef | ||
@@ -76,4 +81,7 @@ })); | ||
}]); | ||
return RefProxy3; | ||
}(_react.Component); | ||
}; | ||
}(_react.Component), _temp; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,53 +6,36 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _recompose = require("recompose"); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _map = _interopRequireDefault(require("lodash/map")); | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _mapKeys = _interopRequireDefault(require("lodash/mapKeys")); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
var _isFunction = _interopRequireDefault(require("lodash/isFunction")); | ||
var _recompose = require('recompose'); | ||
var _proxyPropStatics = _interopRequireDefault(require("./proxy-prop-statics")); | ||
var _propTypes = require('prop-types'); | ||
var _proxyDisplayName = _interopRequireDefault(require("./proxy-display-name")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _wrapDisplayName = _interopRequireDefault(require("./wrap-display-name")); | ||
var _classnames = require('classnames'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _map = require('lodash/map'); | ||
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 _map2 = _interopRequireDefault(_map); | ||
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; } | ||
var _mapKeys = require('lodash/mapKeys'); | ||
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; } | ||
var _mapKeys2 = _interopRequireDefault(_mapKeys); | ||
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); } | ||
var _isFunction = require('lodash/isFunction'); | ||
var _isFunction2 = _interopRequireDefault(_isFunction); | ||
var _proxyPropStatics = require('./proxy-prop-statics'); | ||
var _proxyPropStatics2 = _interopRequireDefault(_proxyPropStatics); | ||
var _proxyDisplayName = require('./proxy-display-name'); | ||
var _proxyDisplayName2 = _interopRequireDefault(_proxyDisplayName); | ||
var _wrapDisplayName = require('./wrap-display-name'); | ||
var _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var invokePredicate = function invokePredicate(predicate, props) { | ||
return (0, _isFunction2.default)(predicate) ? predicate(props) : predicate; | ||
return (0, _isFunction.default)(predicate) ? predicate(props) : predicate; | ||
}; | ||
@@ -63,26 +46,34 @@ | ||
}; | ||
var stringMapper = function stringMapper(styleName, styles) { | ||
return styles[styleName]; | ||
}; | ||
var functionMapper = function functionMapper(styleName, styles, props) { | ||
return (0, _mapKeys2.default)(styleName(props), function (value, name) { | ||
return (0, _mapKeys.default)(styleName(props), function (value, name) { | ||
return styles[name]; | ||
}); | ||
}; | ||
var arrayMapper = function arrayMapper(styleNames, styles, props) { | ||
return (0, _map2.default)(styleNames, function (styleName) { | ||
return (0, _map.default)(styleNames, function (styleName) { | ||
return mapStyleNames(styleName, styles, props); | ||
}); | ||
}; | ||
var objectMapper = function objectMapper(styleNames, styles, props) { | ||
return (0, _map2.default)(styleNames, function (value, styleName) { | ||
return (0, _map.default)(styleNames, function (value, styleName) { | ||
return invokePredicate(value, props) ? stringMapper(styleName, styles) : undefined; | ||
}); | ||
}; | ||
var getType = function getType(value) { | ||
if (!value) return 'undefined'; // 0, ``, null, undefined. numbers are not allowed | ||
var type = typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value); | ||
if (type === 'object') { | ||
return value instanceof Array ? 'array' : type; | ||
if (!value) return "undefined"; // 0, ``, null, undefined. numbers are not allowed | ||
var type = _typeof(value); | ||
if (type === "object") { | ||
return value instanceof Array ? "array" : type; | ||
} | ||
return type; | ||
@@ -104,25 +95,28 @@ }; | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName2.default, (0, _proxyPropStatics2.default)({ | ||
var proxyStatics = (0, _recompose.compose)(_proxyDisplayName.default, (0, _proxyPropStatics.default)({ | ||
propTypes: { | ||
styles: _propTypes2.default.shape({}).isRequired, | ||
className: _propTypes2.default.string, | ||
styleName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.objectOf(_propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func])), _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func, _propTypes2.default.shape({})])), _propTypes2.default.func]) | ||
styles: _propTypes.default.shape({}).isRequired, | ||
className: _propTypes.default.string, | ||
styleName: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func])), _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func, _propTypes.default.shape({})])), _propTypes.default.func]) | ||
} | ||
})); | ||
exports.default = function () { | ||
for (var _len = arguments.length, defaultStyleNames = Array(_len), _key = 0; _key < _len; _key++) { | ||
var _default = function _default() { | ||
for (var _len = arguments.length, defaultStyleNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
defaultStyleNames[_key] = arguments[_key]; | ||
} | ||
return (0, _recompose.compose)((0, _wrapDisplayName2.default)('withStyleNames'), proxyStatics((0, _recompose.mapProps)(function (_ref) { | ||
return (0, _recompose.compose)((0, _wrapDisplayName.default)("withStyleNames"), proxyStatics((0, _recompose.mapProps)(function (_ref) { | ||
var styles = _ref.styles, | ||
className = _ref.className, | ||
styleName = _ref.styleName, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['styles', 'className', 'styleName']); | ||
return (0, _assign2.default)({ | ||
className: (0, _classnames2.default)(mapStyleNames(defaultStyleNames, styles, props), mapStyleNames(styleName, styles, props), className), | ||
props = _objectWithoutProperties(_ref, ["styles", "className", "styleName"]); | ||
return _objectSpread({ | ||
className: (0, _classnames.default)(mapStyleNames(defaultStyleNames, styles, props), mapStyleNames(styleName, styles, props), className), | ||
styles: styles | ||
}, props); | ||
}))); | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,9 +6,12 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
var _recompose = require('recompose'); | ||
var _recompose = require("recompose"); | ||
exports.default = function (wrapperName) { | ||
var _default = function _default(wrapperName) { | ||
return function (WrappedComponent) { | ||
return (0, _recompose.setDisplayName)((0, _recompose.wrapDisplayName)(WrappedComponent, wrapperName))(WrappedComponent); | ||
}; | ||
}; | ||
}; | ||
exports.default = _default; |
119
lib/index.js
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,120 +6,107 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
var _asMounted = require('./hocs/as-mounted'); | ||
Object.defineProperty(exports, 'asMounted', { | ||
Object.defineProperty(exports, "asMounted", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_asMounted).default; | ||
return _asMounted.default; | ||
} | ||
}); | ||
var _handlesChanges = require('./hocs/handles-changes'); | ||
Object.defineProperty(exports, 'handlesChanges', { | ||
Object.defineProperty(exports, "handlesChanges", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_handlesChanges).default; | ||
return _handlesChanges.default; | ||
} | ||
}); | ||
var _omitProps = require('./hocs/omit-props'); | ||
Object.defineProperty(exports, 'omitProps', { | ||
Object.defineProperty(exports, "omitProps", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_omitProps).default; | ||
return _omitProps.default; | ||
} | ||
}); | ||
var _proxyPropTypes = require('./hocs/proxy-prop-types'); | ||
Object.defineProperty(exports, 'proxyPropTypes', { | ||
Object.defineProperty(exports, "proxyPropTypes", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_proxyPropTypes).default; | ||
return _proxyPropTypes.default; | ||
} | ||
}); | ||
var _withClassnames = require('./hocs/with-classnames'); | ||
Object.defineProperty(exports, 'withClassNames', { | ||
Object.defineProperty(exports, "withClassNames", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withClassnames).default; | ||
return _withClassnames.default; | ||
} | ||
}); | ||
var _withFocus = require('./hocs/with-focus'); | ||
Object.defineProperty(exports, 'withFocus', { | ||
Object.defineProperty(exports, "withFocus", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withFocus).default; | ||
return _withFocus.default; | ||
} | ||
}); | ||
var _withLabel = require('./hocs/with-label'); | ||
Object.defineProperty(exports, 'withLabel', { | ||
Object.defineProperty(exports, "withLabel", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withLabel).default; | ||
return _withLabel.default; | ||
} | ||
}); | ||
var _withPropTypes = require('./hocs/with-prop-types'); | ||
Object.defineProperty(exports, 'withPropTypes', { | ||
Object.defineProperty(exports, "withPropTypes", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withPropTypes).default; | ||
return _withPropTypes.default; | ||
} | ||
}); | ||
var _withRefProxy = require('./hocs/with-ref-proxy'); | ||
Object.defineProperty(exports, 'withRefProxy', { | ||
Object.defineProperty(exports, "withRefProxy", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withRefProxy).default; | ||
return _withRefProxy.default; | ||
} | ||
}); | ||
var _withStylenames = require('./hocs/with-stylenames'); | ||
Object.defineProperty(exports, 'withStyleNames', { | ||
Object.defineProperty(exports, "withStyleNames", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withStylenames).default; | ||
return _withStylenames.default; | ||
} | ||
}); | ||
var _uncontrollable = require('./hocs/uncontrollable'); | ||
Object.defineProperty(exports, 'uncontrollable', { | ||
Object.defineProperty(exports, "uncontrollable", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_uncontrollable).default; | ||
return _uncontrollable.default; | ||
} | ||
}); | ||
var _fullWidth = require('./hocs/full-width'); | ||
Object.defineProperty(exports, 'fullWidth', { | ||
Object.defineProperty(exports, "fullWidth", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_fullWidth).default; | ||
return _fullWidth.default; | ||
} | ||
}); | ||
var _clickedOutside = require('./hocs/clicked-outside'); | ||
Object.defineProperty(exports, 'clickedOutside', { | ||
Object.defineProperty(exports, "clickedOutside", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_clickedOutside).default; | ||
return _clickedOutside.default; | ||
} | ||
}); | ||
var _asMounted = _interopRequireDefault(require("./hocs/as-mounted")); | ||
var _handlesChanges = _interopRequireDefault(require("./hocs/handles-changes")); | ||
var _omitProps = _interopRequireDefault(require("./hocs/omit-props")); | ||
var _proxyPropTypes = _interopRequireDefault(require("./hocs/proxy-prop-types")); | ||
var _withClassnames = _interopRequireDefault(require("./hocs/with-classnames")); | ||
var _withFocus = _interopRequireDefault(require("./hocs/with-focus")); | ||
var _withLabel = _interopRequireDefault(require("./hocs/with-label")); | ||
var _withPropTypes = _interopRequireDefault(require("./hocs/with-prop-types")); | ||
var _withRefProxy = _interopRequireDefault(require("./hocs/with-ref-proxy")); | ||
var _withStylenames = _interopRequireDefault(require("./hocs/with-stylenames")); | ||
var _uncontrollable = _interopRequireDefault(require("./hocs/uncontrollable")); | ||
var _fullWidth = _interopRequireDefault(require("./hocs/full-width")); | ||
var _clickedOutside = _interopRequireDefault(require("./hocs/clicked-outside")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -6,8 +6,10 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
var clickedOutsideElement = function clickedOutsideElement(element, event) { | ||
var eventTarget = event.target ? event.target : event.srcElement; | ||
return !!eventTarget.offsetParent || eventTarget === document.documentElement ? !element.contains(eventTarget) : false; | ||
}; | ||
exports.default = clickedOutsideElement; | ||
var _default = clickedOutsideElement; | ||
exports.default = _default; |
@@ -6,5 +6,6 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports.default = function () { | ||
for (var _len = arguments.length, styleNames = Array(_len), _key = 0; _key < _len; _key++) { | ||
var _default = function _default() { | ||
for (var _len = arguments.length, styleNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
styleNames[_key] = arguments[_key]; | ||
@@ -16,2 +17,4 @@ } | ||
}, []); | ||
}; | ||
}; | ||
exports.default = _default; |
{ | ||
"name": "@infotech/uikit-core", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=8.5.0" |
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
77476
1344
1