|
- {"ast":null,"code":"!function (e, t) {\n \"object\" == typeof exports && \"object\" == typeof module ? module.exports = t(require(\"react\"), require(\"prop-types\"), require(\"smooth-scrollbar\")) : \"function\" == typeof define && define.amd ? define([\"react\", \"prop-types\", \"smooth-scrollbar\"], t) : \"object\" == typeof exports ? exports.Scrollbar = t(require(\"react\"), require(\"prop-types\"), require(\"smooth-scrollbar\")) : e.Scrollbar = t(e.React, e.PropTypes, e.Scrollbar);\n}(this, function (e, t, r) {\n return function (e) {\n function t(o) {\n if (r[o]) return r[o].exports;\n var n = r[o] = {\n exports: {},\n id: o,\n loaded: !1\n };\n return e[o].call(n.exports, n, n.exports, t), n.loaded = !0, n.exports;\n }\n\n var r = {};\n return t.m = e, t.c = r, t.p = \"\", t(0);\n }([function (e, t, r) {\n \"use strict\";\n\n function o(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n }\n\n function n(e, t) {\n var r = {};\n\n for (var o in e) {\n t.indexOf(o) >= 0 || Object.prototype.hasOwnProperty.call(e, o) && (r[o] = e[o]);\n }\n\n return r;\n }\n\n function l(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }\n\n function i(e, t) {\n if (!e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return !t || \"object\" != typeof t && \"function\" != typeof t ? e : t;\n }\n\n function c(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function, not \" + typeof t);\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);\n }\n\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n });\n\n var a = Object.assign || function (e) {\n for (var t = 1; t < arguments.length; t++) {\n var r = arguments[t];\n\n for (var o in r) {\n Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);\n }\n }\n\n return e;\n },\n u = function () {\n function e(e, t) {\n for (var r = 0; r < t.length; r++) {\n var o = t[r];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);\n }\n }\n\n return function (t, r, o) {\n return r && e(t.prototype, r), o && e(t, o), t;\n };\n }(),\n s = r(1),\n f = o(s),\n p = r(2),\n b = o(p),\n d = r(3),\n h = o(d),\n y = function (e) {\n function t(e) {\n l(this, t);\n var r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));\n return r.callbacks = [], r;\n }\n\n return c(t, e), u(t, [{\n key: \"getChildContext\",\n value: function value() {\n var e = this;\n return {\n getScrollbar: function getScrollbar(t) {\n \"function\" == typeof t && (e.scrollbar ? setTimeout(function () {\n return t(e.scrollbar);\n }) : e.callbacks.push(t));\n }\n };\n }\n }, {\n key: \"componentDidMount\",\n value: function value() {\n var e = this;\n this.scrollbar = h[\"default\"].init(this.$container, this.props), this.callbacks.forEach(function (t) {\n requestAnimationFrame(function () {\n return t(e.scrollbar);\n });\n }), this.scrollbar.addListener(this.handleScroll.bind(this));\n }\n }, {\n key: \"componentWillUnmount\",\n value: function value() {\n this.scrollbar && this.scrollbar.destroy();\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function value(e) {\n var t = this;\n Object.keys(e).forEach(function (r) {\n !r in t.scrollbar.options || (\"plugins\" === r ? Object.keys(e.plugins).forEach(function (r) {\n t.scrollbar.updatePluginOptions(r, e.plugins[r]);\n }) : t.scrollbar.options[r] = e[r]);\n });\n }\n }, {\n key: \"componentDidUpdate\",\n value: function value() {\n this.scrollbar && this.scrollbar.update();\n }\n }, {\n key: \"handleScroll\",\n value: function value(e) {\n this.props.onScroll && this.props.onScroll(e, this.scrollbar);\n }\n }, {\n key: \"render\",\n value: function value() {\n var e = this,\n t = this.props,\n r = (t.damping, t.thumbMinSize, t.syncCallbacks, t.renderByPixels, t.alwaysShowTracks, t.continuousScrolling, t.wheelEventTarget, t.plugins, t.onScroll, t.children),\n o = n(t, [\"damping\", \"thumbMinSize\", \"syncCallbacks\", \"renderByPixels\", \"alwaysShowTracks\", \"continuousScrolling\", \"wheelEventTarget\", \"plugins\", \"onScroll\", \"children\"]);\n return f[\"default\"].createElement(\"section\", a({\n \"data-scrollbar\": !0,\n ref: function ref(t) {\n return e.$container = t;\n }\n }, o), f[\"default\"].createElement(\"div\", null, r));\n }\n }]), t;\n }(f[\"default\"].Component);\n\n y.propTypes = {\n damping: b[\"default\"].number,\n thumbMinSize: b[\"default\"].number,\n syncCallbacks: b[\"default\"].bool,\n renderByPixels: b[\"default\"].bool,\n alwaysShowTracks: b[\"default\"].bool,\n continuousScrolling: b[\"default\"].bool,\n wheelEventTarget: b[\"default\"].element,\n plugins: b[\"default\"].object,\n onScroll: b[\"default\"].func,\n children: b[\"default\"].node\n }, y.childContextTypes = {\n getScrollbar: b[\"default\"].func\n }, t[\"default\"] = y, e.exports = t[\"default\"];\n }, function (t, r) {\n t.exports = e;\n }, function (e, r) {\n e.exports = t;\n }, function (e, t) {\n e.exports = r;\n }]);\n});","map":null,"metadata":{},"sourceType":"script"}
|