2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
|
import t,{Component as e}from"react";import{FilterService as n}from"primereact/api";import{DomHandler as o,classNames as r,ObjectUtils as i}from"primereact/utils";import{Ripple as l}from"primereact/ripple";import{InputText as a}from"primereact/inputtext";import{tip as s}from"primereact/tooltip";import{VirtualScroller as p}from"primereact/virtualscroller";function u(){return u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},u.apply(this,arguments)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function f(t){if(Array.isArray(t))return c(t)}function h(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function d(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t){return f(t)||h(t)||d(t)||y()}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function g(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t,e){return k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},k(t,e)}function E(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&&k(t,e)}function S(t){return S="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},S(t)}function w(t,e){if(e&&("object"===S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return O(t)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T(){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 L=function(n){E(u,e);var a,s,p=(a=u,s=T(),function(){var t,e=C(a);if(s){var n=C(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return w(this,t)});function u(t){var e;return m(this,u),(e=p.call(this,t)).onClick=e.onClick.bind(O(e)),e.onTouchEnd=e.onTouchEnd.bind(O(e)),e.onKeyDown=e.onKeyDown.bind(O(e)),e}return g(u,[{key:"onClick",value:function(t){this.props.onClick&&this.props.onClick({originalEvent:t,option:this.props.option}),t.preventDefault()}},{key:"onTouchEnd",value:function(t){this.props.onTouchEnd&&this.props.onTouchEnd({originalEvent:t,option:this.props.option})}},{key:"onKeyDown",value:function(t){var e=t.currentTarget;switch(t.which){case 40:var n=this.findNextItem(e);n&&n.focus(),t.preventDefault();break;case 38:var o=this.findPrevItem(e);o&&o.focus(),t.preventDefault();break;case 13:this.onClick(t),t.preventDefault()}}},{key:"findNextItem",value:function(t){var e=t.nextElementSibling;return e?o.hasClass(e,"p-disabled")||o.
|