2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function p(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function f(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?f(Object(o),!0).forEach((function(e){p(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var v=function(o){a(y,t.Component);var l,c,p,f,v,g=(l=y,c=m(),function(){var t,e=h(l);if(c){var o=h(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return u(this,t)});function y(t){var e;r(this,y);var o=(e=g.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(n(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return p=y,f=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.calculateNumItems(),l=n.numToleratedItems,a=this.props.itemSize,c=this.getContentPosition(),u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},h=function(t,e,o){return t*e+o},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var f={rows:u(t[0],l[0]),cols:u(t[1],l[1])};f.rows===i.rows&&f.cols===i.cols||(p(h(f.cols,a[1],c.left),h(f.rows,a[0],c.top)),this.setState({first:f}))}else{var d=u(t,l);d!==i&&(r?p(h(d,a,c.left),0):p(0,h(d,a,c.top)),this.setState({first:d}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),
|