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