simplebar-react
Advanced tools
Comparing version 2.3.7 to 2.4.0
@@ -15,2 +15,3 @@ import React from 'react'; | ||
scrollableNodeProps?: object; | ||
tag?: string; | ||
children?: React.ReactNode | ((props: ChildrenProps) => React.ReactNode); | ||
@@ -17,0 +18,0 @@ } |
/** | ||
* simplebar-react - v2.3.7 | ||
* simplebar-react - v2.4.0 | ||
* React component for SimpleBar | ||
@@ -14,2 +14,28 @@ * https://grsmto.github.io/simplebar/ | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
enumerableOnly && (symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
})), keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = null != arguments[i] ? arguments[i] : {}; | ||
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _defineProperty(obj, key, value) { | ||
@@ -48,36 +74,2 @@ if (key in obj) { | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(source, true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(source).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -119,2 +111,3 @@ if (source == null) return {}; | ||
var _excluded = ["children", "scrollableNodeProps", "tag"]; | ||
/* Deprecated | ||
@@ -157,8 +150,11 @@ * Hardcore this here until we can safely deprecated it. | ||
var SimpleBar = React.forwardRef(function (_ref, ref) { | ||
var SimpleBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) { | ||
var children = _ref.children, | ||
_ref$scrollableNodePr = _ref.scrollableNodeProps, | ||
scrollableNodeProps = _ref$scrollableNodePr === void 0 ? {} : _ref$scrollableNodePr, | ||
otherProps = _objectWithoutProperties(_ref, ["children", "scrollableNodeProps"]); | ||
_ref$tag = _ref.tag, | ||
tag = _ref$tag === void 0 ? 'div' : _ref$tag, | ||
otherProps = _objectWithoutProperties(_ref, _excluded); | ||
var RootTag = tag; | ||
var instance; | ||
@@ -192,5 +188,5 @@ var scrollableNodeRef = useRef(); | ||
if (elRef.current) { | ||
instance = new SimpleBarJS(elRef.current, _objectSpread2({}, getOptions(deprecatedOptions), {}, options, {}, scrollableNodeRef && { | ||
instance = new SimpleBarJS(elRef.current, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getOptions(deprecatedOptions)), options), scrollableNodeRef && { | ||
scrollableNode: scrollableNodeRef.current | ||
}, {}, contentNodeRef.current && { | ||
}), contentNodeRef.current && { | ||
contentNode: contentNodeRef.current | ||
@@ -209,14 +205,14 @@ })); | ||
}, []); | ||
return React.createElement("div", _extends({ | ||
return /*#__PURE__*/React.createElement(RootTag, _extends({ | ||
ref: elRef, | ||
"data-simplebar": true | ||
}, rest), React.createElement("div", { | ||
}, rest), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-wrapper" | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-height-auto-observer-wrapper" | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-height-auto-observer" | ||
})), React.createElement("div", { | ||
})), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-mask" | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-offset" | ||
@@ -226,15 +222,15 @@ }, typeof children === 'function' ? children({ | ||
contentNodeRef: contentNodeRef | ||
}) : React.createElement("div", _extends({}, scrollableNodeProps, { | ||
}) : /*#__PURE__*/React.createElement("div", _extends({}, scrollableNodeProps, { | ||
className: "simplebar-content-wrapper".concat(scrollableNodeProps.className ? " ".concat(scrollableNodeProps.className) : '') | ||
}), React.createElement("div", { | ||
}), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-content" | ||
}, children)))), React.createElement("div", { | ||
}, children)))), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-placeholder" | ||
})), React.createElement("div", { | ||
})), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-track simplebar-horizontal" | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-scrollbar" | ||
})), React.createElement("div", { | ||
})), /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-track simplebar-vertical" | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "simplebar-scrollbar" | ||
@@ -246,5 +242,6 @@ }))); | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
scrollableNodeProps: PropTypes.object | ||
scrollableNodeProps: PropTypes.object, | ||
tag: PropTypes.string | ||
}; | ||
export default SimpleBar; |
{ | ||
"name": "simplebar-react", | ||
"version": "2.3.7", | ||
"version": "2.4.0", | ||
"description": "React component for SimpleBar", | ||
@@ -30,3 +30,3 @@ "files": [ | ||
"prop-types": "^15.6.1", | ||
"simplebar": "^5.3.6" | ||
"simplebar": "^5.3.7" | ||
}, | ||
@@ -47,3 +47,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "683691483ac409797b13362cbe172280b0ecbcd2" | ||
"gitHead": "cc2c78f5bfc69ea7819e9f0276550274bd940fe2" | ||
} |
Sorry, the diff of this file is too big to display
84838
502
Updatedsimplebar@^5.3.7