katoikia-app/web-ui/web-react/node_modules/primereact/virtualscroller/virtualscroller.esm.min.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
import t,{Component as e}from"react";import{ObjectUtils as o,classNames as s}from"primereact/utils";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 h(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 p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function u(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){u(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(l){a(w,e);var c,u,f,v,g,y=(c=w,u=m(),function(){var t,e=p(c);if(u){var o=p(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return h(this,t)});function w(t){var e;r(this,w);var o=(e=y.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 f=w,v=[{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(),h=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},p=function(t,e,o){return t*e+o},u=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:h(t[0],l[0]),cols:h(t[1],l[1])};f.rows===i.rows&&f.cols===i.cols||(u(p(f.cols,a[1],c.left),p(f.rows,a[0],c.top)),this.setState({first:f}))}else{var d=h(t,l);d!==i&&(r?u(p(d,a,c.left),0):u(0,p(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(),l=n.first,a=n.viewport,c=this.props.itemSize,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?argument