2 lines
6.3 KiB
JavaScript
2 lines
6.3 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.styleclass=function(e,t,n){"use strict";function s(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 s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(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&&i(e,t)}function o(e){return o="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},o(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function p(){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 m,h,d,f=function(e){a(d,e);var t,i,o,l,m,h=(t=d,i=p(),function(){var e,n=u(t);if(i){var s=u(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return c(this,e)});function d(){return s(this,d),h.apply(this,arguments)}return o=d,(l=[{key:"enter",value:function(){var e=this;this.props.enterActiveClassName?this.animating||(this.animating=!0,"slidedown"===this.props.enterActiveClassName&&(this.target.style.height="0px",n.DomHandler.removeClass(this.target,"hidden"),this.target.style.maxHeight=this.target.scrollHeight+"px",n.DomHandler.addClass(this.target,"hidden"),this.target.style.height=""),n.DomHandler.addClass(this.target,this.props.enterActiveClassName),this.props.enterClassName&&n.DomHandler.removeClass(this.target,this.props.enterClassName),this.enterListener=function(){n.DomHandler.removeClass(e.target,e.props.enterActiveClassName),e.props.enterToClassName&&n.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&&n.DomHandler.removeClass(this.target,this.props.enterClassName),this.props.enterToClassName&&n.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,n.DomHandler.addClass(this.target,this.props.leaveActiveClassName),this.props.leaveClassName&&n.DomHandler.removeClass(this.target,this.props.leaveClassName),this.leaveListener=function(){n.DomHandler.removeClass(e.target,e.props.leaveActiveClassName),e.props.leaveToClassName&&n.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&&n.DomHandler.removeClass(this.target,this.props.leaveClassName),this.props.leaveToClassName&&n.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"@prev":return this.el.previousElementSibli
|