2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
|
import t,{Component as e}from"react";import{classNames as i,UniqueComponentId as n,DomHandler as r,ZIndexUtils as s}from"primereact/utils";import{Ripple as a}from"primereact/ripple";import o from"primereact/api";import{CSSTransition as l}from"primereact/csstransition";import{Portal as p}from"primereact/portal";function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e,i){return e&&h(t.prototype,e),i&&h(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function v(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&&d(t,e)}function f(t){return f="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},f(t)}function b(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function y(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function g(){return g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},g.apply(this,arguments)}function w(){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 S=function(n){v(l,e);var r,s,o=(r=l,s=w(),function(){var t,e=I(r);if(s){var i=I(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return b(this,t)});function l(t){var e;return c(this,l),(e=o.call(this,t)).navForward=e.navForward.bind(m(e)),e.navBackward=e.navBackward.bind(m(e)),e.next=e.next.bind(m(e)),e.prev=e.prev.bind(m(e)),e}return u(l,[{key:"step",value:function(t){this.itemsContainer&&(this.itemsContainer.style.transform=this.isVertical()?"translate3d(0, ".concat(100*t,"%, 0)"):"translate3d(".concat(100*t,"%, 0, 0)"),this.itemsContainer.style.transition="transform 500ms ease 0s")}},{key:"next",value:function(){this.props.onActiveItemChange({index:this.props.circular&&this.props.value.length-1===this.props.activeItemIndex?0:this.props.activeItemIndex+1})}},{key:"prev",value:function(){this.props.onActiveItemChange({index:this.props.circular&&0===this.props.activeItemIndex?this.props.value.length-1:0!==this.props.activeItemIndex?this.props.activeItemIndex-1:0})}},{key:"stopSlideShow",value:function(){this.props.slideShowActive&&this.props.stopSlideShow&&this.props.stopSlideShow()}},{key:"navBackward",value:function(t){this.stopSlideShow(),this.prev(),t&&t.cancelable&&t.preventDefault()}},{key:"navForward",value:function(t){this.stopSlideShow(),this.next(),t&&t.cancelable&&t.preventDefault()}},{key:"onIndicatorClick",value:function(t){this.stopSlideShow(),this.props.onActiveItemChange({index:t})}},{key:"onIndicatorMouseEnter",value:function(t){this.props.changeItemOnIndicatorHover&&(this.stopSlideShow(),this.props.onActiveItemChange({index:t}))}},{key:"onIndicatorKeyDown",value:function(t,e){13===t.which&&(this.stopSlideShow(),this.props.onActiveItemChange({index:e}))}},{key:"componentDidMount",value:function(){this.props.autoPla
|