2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.listbox=function(t,e,n,o,r,i,l,a){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var p=s(e);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 v(){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 y(t){return f(t)||h(t)||d(t)||v()}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(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 O(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(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 j(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 g(t)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x(){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 D=function(t){E(l,t);var e,n,i=(e=l,n=x(),function(){var t,o=C(e);if(n){var r=C(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return j(this,t)});function l(t){var e;return b(this,l),(e=i.call(this,t)).onClick=e.onClick.bind(g(e)),e.onTouchEnd=e.onTouchEnd.bind(g(e)),e.onKeyDown=e.onKeyDown.bind(g(e)),e}return O(l,[{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.DomHandler.hasClass(e,"p-disabled")||o.DomHandler.hasClass(e,"p-listbox-item-group")?this.findNextItem(e):e:null}},{key:"findPrevItem",value:function(t){var e=t.previousElementSibling;return e?o.DomHandl
|