2 lines
6.2 KiB
JavaScript
2 lines
6.2 KiB
JavaScript
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils");function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(){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(e){return!1}}var p,m,h,d=function(s){i(f,e.Component);var a,o,p,m,h,d=(a=f,o=c(),function(){var e,t=u(a);if(o){var n=u(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function f(){return n(this,f),d.apply(this,arguments)}return p=f,(m=[{key:"enter",value:function(){var e=this;this.props.enterActiveClassName?this.animating||(this.animating=!0,"slidedown"===this.props.enterActiveClassName&&(this.target.style.height="0px",t.DomHandler.removeClass(this.target,"hidden"),this.target.style.maxHeight=this.target.scrollHeight+"px",t.DomHandler.addClass(this.target,"hidden"),this.target.style.height=""),t.DomHandler.addClass(this.target,this.props.enterActiveClassName),this.props.enterClassName&&t.DomHandler.removeClass(this.target,this.props.enterClassName),this.enterListener=function(){t.DomHandler.removeClass(e.target,e.props.enterActiveClassName),e.props.enterToClassName&&t.DomHandler.addClass(e.target,e.props.enterToClassName),e.target.removeEventListener("animationend",e.enterListener),"slidedown"===e.props.enterActiveClassName&&(e.target.style.maxHeight=""),e.animating=!1},this.target.addEventListener("animationend",this.enterListener)):(this.props.enterClassName&&t.DomHandler.removeClass(this.target,this.props.enterClassName),this.props.enterToClassName&&t.DomHandler.addClass(this.target,this.props.enterToClassName)),this.props.hideOnOutsideClick&&this.bindDocumentListener()}},{key:"leave",value:function(){var e=this;this.props.leaveActiveClassName?this.animating||(this.animating=!0,t.DomHandler.addClass(this.target,this.props.leaveActiveClassName),this.props.leaveClassName&&t.DomHandler.removeClass(this.target,this.props.leaveClassName),this.leaveListener=function(){t.DomHandler.removeClass(e.target,e.props.leaveActiveClassName),e.props.leaveToClassName&&t.DomHandler.addClass(e.target,e.props.leaveToClassName),e.target.removeEventListener("animationend",e.leaveListener),e.animating=!1},this.target.addEventListener("animationend",this.leaveListener)):(this.props.leaveClassName&&t.DomHandler.removeClass(this.target,this.props.leaveClassName),this.props.leaveToClassName&&t.DomHandler.addClass(this.target,this.props.leaveToClassName)),this.props.hideOnOutsideClick&&this.unbindDocumentListener()}},{key:"resolveTarget",value:function(){if(this.target)return this.target;switch(this.props.selector){case"@next":return this.el.nextElementSibling;case"@pr
|