katoikia-app/web-ui/web-react/node_modules/primereact/galleria/galleria.esm.min.js

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.autoPlay&&this.props.startSlideShow()}},{key:"renderBackwardNavigator",value:function(){if(this.props.showItemNavigators){var e=!this.props.circular&&0===this.props.activeItemIndex,n=i("p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":e});return t.createElement("button",{type:"button",className:n,onClick:this.navBackward,disabled:e},t.createElement("span",{className:"p-galleria-item-prev-icon pi pi-chevron-left"}),t.createElement(a,null))}return null}},{key:"renderForwardNavigator",value:function(){if(this.props.showItemNavigators){var e=!this.props.circular&&this.props.activeItemIndex===this.props.value.length-1,n=i("p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":e});return t.createElement("button",{type:"button",className:n,onClick:this.navForward,disabled:e},t.createElement("span",{className:"p-galleria-item-next-icon pi pi-chevron-right"}),t.createElement(a,null))}return null}},{key:"renderCaption",value:function(){if(this.props.caption){var e=this.props.caption(this.props.value[this.props.activeItemIndex]);return t.createElement("div",{className:"p-galleria-caption"},e)}return null}},{key:"renderIndicator",value:function(e){var n=this,r=this.props.indicator&&this.props.indicator(e),s=i("p-galleria-indicator",{"p-highlight":this.props.activeItemIndex===e});return r||(r=t.createElement("button",{type:"button",tabIndex:-1,className:"p-link"},t.createElement(a,null))),t.createElement("li",{className:s,key:"p-galleria-indicator-"+e,tabIndex:0,onClick:function(){return n.onIndicatorClick(e)},onMouseEnter:function(){return n.onIndicatorMouseEnter(e)},onKeyDown:function(t){return n.onIndicatorKeyDown(t,e)}},r)}},{key:"renderIndicators",value:function(){if(this.props.showIndicators){for(var e=i("p-galleria-indicators p-reset",this.props.indicatorsContentClassName),n=[],r=0;r<this.props.value.length;r++)n.push(this.renderIndicator(r));return t.createElement("ul",{className:e},n)}return null}},{key:"render",value:function(){var e=this,i=this.props.itemTemplate&&this.props.itemTemplate(this.props.value[this.props.activeItemIndex]),n=this.renderBackwardNavigator(),r=this.renderForwardNavigator(),s=this.renderCaption(),a=this.renderIndicators();return t.createElement("div",{ref:function(t){return e.props.forwardRef(t)},className:"p-galleria-item-wrapper"},t.createElement("div",{className:"p-galleria-item-container"},n,t.createElement("div",{className:"p-galleria-item"},i),r,s),a)}}]),l}(),k=t.forwardRef((function(e,i){return t.createElement(S,g({forwardRef:i},e))}));function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function E(t){if(Array.isArray(t))return x(t)}function C(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(t,e):void 0}}function N(){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 V(t){var e=P();return function(){var i,n=I(t);if(e){var r=I(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return b(this,i)}}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(t){return!1}}var T=function(n){v(s,e);var r=V(s);function s(t){var e;return c(this,s),(e=r.call(this,t)).onItemClick=e.onItemClick.bind(m(e)),e.onItemKeyDown=e.onItemKeyDown.bind(m(e)),e}return u(s,[{key:"onItemClick",value:function(t){this.props.onItemClick({originalEvent:t,index:this.props.index})}},{key:"onItemKeyDown",value:function(t){13===t.which&&this.props.onItemClick({originalEvent:t,index:this.props.index})}},{key:"render",value:function(){var e=this.props.template&&this.props.template(this.props.item),n=i(this.props.className,"p-galleria-thumbnail-item",{"p-galleria-thumbnail-item-current":this.props.current,"p-galleria-thumbnail-item-active":this.props.active,"p-galleria-thumbnail-item-start":this.props.start,"p-galleria-thumbnail-item-end":this.props.end});return t.createElement("div",{className:n},t.createElement("div",{className:"p-galleria-thumbnail-item-content",tabIndex:this.props.active?0:null,onClick:this.onItemClick,onKeyDown:this.onItemKeyDown},e))}}]),s}();y(T,"defaultProps",{index:null,template:null,item:null,current:!1,active:!1,start:!1,end:!1,className:null,onItemClick:null});var A=function(s){v(p,e);var l=V(p);function p(t){var e;return c(this,p),(e=l.call(this,t)).state={numVisible:t.numVisible,totalShiftedItems:0,page:0},e.navForward=e.navForward.bind(m(e)),e.navBackward=e.navBackward.bind(m(e)),e.onTransitionEnd=e.onTransitionEnd.bind(m(e)),e.onTouchStart=e.onTouchStart.bind(m(e)),e.onTouchMove=e.onTouchMove.bind(m(e)),e.onTouchEnd=e.onTouchEnd.bind(m(e)),e.onItemClick=e.onItemClick.bind(m(e)),e.attributeSelector=n(),e}return u(p,[{key:"step",value:function(t){var e=this.state.totalShiftedItems+t;t<0&&-1*e+this.state.numVisible>this.props.value.length-1?e=this.state.numVisible-this.props.value.length:t>0&&e>0&&(e=0),this.props.circular&&(t<0&&this.props.value.length-1===this.props.activeItemIndex?e=0:t>0&&0===this.props.activeItemIndex&&(e=this.state.numVisible-this.props.value.length)),this.itemsContainer&&(r.removeClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transform=this.props.isVertical?"translate3d(0, ".concat(e*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(e*(100/this.state.numVisible),"%, 0, 0)"),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.setState({totalShiftedItems:e})}},{key:"stopSlideShow",value:function(){this.props.slideShowActive&&this.props.stopSlideShow&&this.props.stopSlideShow()}},{key:"getMedianItemIndex",value:function(){var t=Math.floor(this.state.numVisible/2);return this.state.numVisible%2?t:t-1}},{key:"navBackward",value:function(t){this.stopSlideShow();var e=0!==this.props.activeItemIndex?this.props.activeItemIndex-1:0;this.state.numVisible-(e+this.state.totalShiftedItems)-1>this.getMedianItemIndex()&&(-1*this.state.totalShiftedItems!=0||this.props.circular)&&this.step(1),this.props.onActiveItemChange({index:this.props.circular&&0===this.props.activeItemIndex?this.props.value.length-1:e}),t.cancelable&&t.preventDefault()}},{key:"navForward",value:function(t){this.stopSlideShow();var e=this.props.activeItemIndex+1;e+this.state.totalShiftedItems>this.getMedianItemIndex()&&(-1*this.state.totalShiftedItems<this.getTotalPageNumber()-1||this.props.circular)&&this.step(-1),this.props.onActiveItemChange({index:this.props.circular&&this.props.value.length-1===this.props.activeItemIndex?0:e}),t.cancelable&&t.preventDefault()}},{key:"onItemClick",value:function(t){this.stopSlideShow();var e=t.index;if(e!==this.props.activeItemIndex){var i=e+this.state.totalShiftedItems,n=0;e<this.props.activeItemIndex?(n=this.state.numVisible-i-1-this.getMedianItemIndex())>0&&-1*this.state.totalShiftedItems!=0&&this.step(n):(n=this.getMedianItemIndex()-i)<0&&-1*this.state.totalShiftedItems<this.getTotalPageNumber()-1&&this.step(n),this.props.onActiveItemChange({index:e})}}},{key:"onTransitionEnd",value:function(t){this.itemsContainer&&"transform"===t.propertyName&&(r.addClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transition="")}},{key:"onTouchStart",value:function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}}},{key:"onTouchMove",value:function(t){t.cancelable&&t.preventDefault()}},{key:"onTouchEnd",value:function(t){var e=t.changedTouches[0];this.changePageOnTouch(t,this.props.isVertical?e.pageY-this.startPos.y:e.pageX-this.startPos.x)}},{key:"changePageOnTouch",value:function(t,e){e<0?this.navForward(t):this.navBackward(t)}},{key:"getTotalPageNumber",value:function(){return this.props.value.length>this.state.numVisible?this.props.value.length-this.state.numVisible+1:0}},{key:"createStyle",value:function(){this.thumbnailsStyle||(this.thumbnailsStyle=r.createInlineStyle(o.nonce));var t,e="\n .p-galleria-thumbnail-items[".concat(this.attributeSelector,"] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100/this.state.numVisible,"%\n }\n ");if(this.props.responsiveOptions){this.responsiveOptions=E(t=this.props.responsiveOptions)||C(t)||O(t)||N(),this.responsiveOptions.sort((function(t,e){var i=t.breakpoint,n=e.breakpoint;return-1*(null==i&&null!=n?-1:null!=i&&null==n?1:null==i&&null==n?0:"string"==typeof i&&"string"==typeof n?i.localeCompare(n,void 0,{numeric:!0}):i<n?-1:i>n?1:0)}));for(var i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];e+="\n @media screen and (max-width: ".concat(n.breakpoint,") {\n .p-galleria-thumbnail-items[").concat(this.attributeSelector,"] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100/n.numVisible,"%\n }\n }\n ")}}this.thumbnailsStyle.innerHTML=e}},{key:"calculatePosition",value:function(){if(this.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.props.numVisible},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=t&&(e=n)}this.state.numVisible!==e.numVisible&&this.setState({numVisible:e.numVisible})}}},{key:"bindDocumentListeners",value:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(){t.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentListeners",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.itemsContainer&&this.itemsContainer.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.props.responsiveOptions&&this.bindDocumentListeners()}},{key:"componentDidUpdate",value:function(t,e){var i=this.state.totalShiftedItems;e.numVisible===this.state.numVisible&&t.activeItemIndex===this.props.activeItemIndex||((i=this.props.activeItemIndex<=this.getMedianItemIndex()?0:this.props.value.length-this.state.numVisible+this.getMedianItemIndex()<this.props.activeItemIndex?this.state.numVisible-this.props.value.length:this.props.value.length-this.state.numVisible<this.props.activeItemIndex&&this.state.numVisible%2==0?-1*this.props.activeItemIndex+this.getMedianItemIndex()+1:-1*this.props.activeItemIndex+this.getMedianItemIndex())!==this.state.totalShiftedItems&&this.setState({totalShiftedItems:i}),this.itemsContainer.style.transform=this.props.isVertical?"translate3d(0, ".concat(i*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(i*(100/this.state.numVisible),"%, 0, 0)"),t.activeItemIndex!==this.props.activeItemIndex&&(r.removeClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transition="transform 500ms ease 0s"))}},{key:"componentWillUnmount",value:function(){this.props.responsiveOptions&&this.unbindDocumentListeners()}},{key:"renderItems",value:function(){var e=this;return this.props.value.map((function(i,n){var r=-1*e.state.totalShiftedItems,s=r+e.state.numVisible-1;return t.createElement(T,{key:n,index:n,template:e.props.itemTemplate,item:i,active:r<=n&&s>=n,start:r===n,end:s===n,onItemClick:e.onItemClick,current:e.props.activeItemIndex===n})}))}},{key:"renderBackwardNavigator",value:function(){if(this.props.showThumbnailNavigators){var e=!this.props.circular&&0===this.props.activeItemIndex||this.props.value.length<=this.state.numVisible,n=i("p-galleria-thumbnail-prev p-link",{"p-disabled":e}),r=i("p-galleria-thumbnail-prev-icon pi",{"pi-chevron-left":!this.props.isVertical,"pi-chevron-up":this.props.isVertical});return t.createElement("button",{className:n,onClick:this.navBackward,disabled:e},t.createElement("span",{className:r}),t.createElement(a,null))}return null}},{key:"renderForwardNavigator",value:function(){if(this.props.showThumbnailNavigators){var e=!this.props.circular&&this.props.activeItemIndex===this.props.value.length-1||this.props.value.length<=this.state.numVisible,n=i("p-galleria-thumbnail-next p-link",{"p-disabled":e}),r=i("p-galleria-thumbnail-next-icon pi",{"pi-chevron-right":!this.props.isVertical,"pi-chevron-down":this.props.isVertical});return t.createElement("button",{className:n,onClick:this.navForward,disabled:e},t.createElement("span",{className:r}),t.createElement(a,null))}return null}},{key:"renderContent",value:function(){var e=this,i=this.renderItems(),n=this.props.isVertical?this.props.contentHeight:"",r=this.renderBackwardNavigator(),s=this.renderForwardNavigator();return t.createElement("div",{className:"p-galleria-thumbnail-container"},r,t.createElement("div",{className:"p-galleria-thumbnail-items-container",style:{height:n}},t.createElement("div",{ref:function(t){return e.itemsContainer=t},className:"p-galleria-thumbnail-items",onTransitionEnd:this.onTransitionEnd,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},i)),s)}},{key:"render",value:function(){var e=this.renderContent();return t.createElement("div",{className:"p-galleria-thumbnail-wrapper"},e)}}]),p}();function R(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function j(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?R(Object(i),!0).forEach((function(e){y(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function D(){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 M=function(n){v(y,e);var h,d,f=(h=y,d=D(),function(){var t,e=I(h);if(d){var i=I(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return b(this,t)});function y(e){var i;return c(this,y),(i=f.call(this,e)).state={visible:!1,numVisible:e.numVisible,slideShowActive:!1},i.props.onItemChange||(i.state=j(j({},i.state),{},{activeIndex:e.activeIndex})),i.onActiveItemChange=i.onActiveItemChange.bind(m(i)),i.show=i.show.bind(m(i)),i.hide=i.hide.bind(m(i)),i.startSlideShow=i.startSlideShow.bind(m(i)),i.stopSlideShow=i.stopSlideShow.bind(m(i)),i.onEnter=i.onEnter.bind(m(i)),i.onEntering=i.onEntering.bind(m(i)),i.onEntered=i.onEntered.bind(m(i)),i.onExit=i.onExit.bind(m(i)),i.onExited=i.onExited.bind(m(i)),i.galleriaRef=t.createRef(),i}return u(y,[{key:"activeItemIndex",get:function(){return this.props.onItemChange?this.props.activeIndex:this.state.activeIndex}},{key:"onActiveItemChange",value:function(t){this.props.onItemChange?this.props.onItemChange(t):this.setState({activeIndex:t.index})}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(){this.setState({visible:!1})}},{key:"onEnter",value:function(){r.addClass(document.body,"p-overflow-hidden")}},{key:"onEntering",value:function(){s.set("modal",this.mask,o.autoZIndex,this.props.baseZIndex||o.zIndex.modal),r.addMultipleClasses(this.mask,"p-component-overlay p-component-overlay-enter")}},{key:"onEntered",value:function(){this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){r.removeClass(document.body,"p-overflow-hidden"),r.addClass(this.mask,"p-component-overlay-leave")}},{key:"onExited",value:function(){s.clear(this.mask),this.props.onHide&&this.props.onHide()}},{key:"isAutoPlayActive",value:function(){return this.state.slideShowActive}},{key:"startSlideShow",value:function(){var t=this;this.interval=setInterval((function(){t.onActiveItemChange({index:t.props.circular&&t.props.value.length-1===t.activeItemIndex?0:t.activeItemIndex+1})}),this.props.transitionInterval),this.setState({slideShowActive:!0})}},{key:"stopSlideShow",value:function(){this.interval&&clearInterval(this.interval),this.setState({slideShowActive:!1})}},{key:"getPositionClassName",value:function(t,e){var i=["top","left","bottom","right"].find((function(t){return t===e}));return i?"".concat(t,"-").concat(i):""}},{key:"isVertical",value:function(){return"left"===this.props.thumbnailsPosition||"right"===this.props.thumbnailsPosition}},{key:"componentDidUpdate",value:function(t,e){t.value!==this.props.value&&this.props.value&&this.props.value.length<this.state.numVisible&&this.setState({numVisible:this.props.value.length}),t.numVisible!==this.props.numVisible&&this.setState({numVisible:this.props.numVisible})}},{key:"componentWillUnmount",value:function(){this.state.slideShowActive&&this.stopSlideShow(),s.clear(this.mask)}},{key:"renderHeader",value:function(){return this.props.header?t.createElement("div",{className:"p-galleria-header"},this.props.header):null}},{key:"renderFooter",value:function(){return this.props.footer?t.createElement("div",{className:"p-galleria-footer"},this.props.footer):null}},{key:"renderElement",value:function(){var e=this,n=this.isVertical(),r=this.props.showThumbnails&&this.getPositionClassName("p-galleria-thumbnails",this.props.thumbnailsPosition),s=this.props.showIndicators&&this.getPositionClassName("p-galleria-indicators",this.props.indicatorsPosition),o=i("p-galleria p-component",this.props.className,{"p-galleria-fullscreen":this.props.fullScreen,"p-galleria-indicator-onitem":this.props.showIndicatorsOnItem,"p-galleria-item-nav-onhover":this.props.showItemNavigatorsOnHover&&!this.props.fullScreen},r,s),l=this.props.fullScreen&&t.createElement("button",{type:"button",className:"p-galleria-close p-link",onClick:this.hide},t.createElement("span",{className:"p-galleria-close-icon pi pi-times"}),t.createElement(a,null)),p=this.renderHeader(),c=this.renderFooter();return t.createElement("div",{ref:this.galleriaRef,id:this.props.id,className:o,style:this.props.style},l,p,t.createElement("div",{className:"p-galleria-content"},t.createElement(k,{ref:function(t){return e.previewContent=t},value:this.props.value,activeItemIndex:this.activeItemIndex,onActiveItemChange:this.onActiveItemChange,itemTemplate:this.props.item,circular:this.props.circular,caption:this.props.caption,showIndicators:this.props.showIndicators,changeItemOnIndicatorHover:this.props.changeItemOnIndicatorHover,indicator:this.props.indicator,showItemNavigators:this.props.showItemNavigators,autoPlay:this.props.autoPlay,slideShowActive:this.state.slideShowActive,startSlideShow:this.startSlideShow,stopSlideShow:this.stopSlideShow}),this.props.showThumbnails&&t.createElement(A,{value:this.props.value,activeItemIndex:this.activeItemIndex,onActiveItemChange:this.onActiveItemChange,itemTemplate:this.props.thumbnail,numVisible:this.state.numVisible,responsiveOptions:this.props.responsiveOptions,circular:this.props.circular,isVertical:n,contentHeight:this.props.verticalThumbnailViewPortHeight,showThumbnailNavigators:this.props.showThumbnailNavigators,autoPlay:this.props.autoPlay,slideShowActive:this.state.slideShowActive,stopSlideShow:this.stopSlideShow})),c)}},{key:"renderGalleria",value:function(){var e=this,n=this.renderElement();if(this.props.fullScreen){var r=i("p-galleria-mask",{"p-galleria-visible":this.state.visible});return t.createElement(p,{element:t.createElement("div",{ref:function(t){return e.mask=t},className:r},t.createElement(l,{nodeRef:this.galleriaRef,classNames:"p-galleria",in:this.state.visible,timeout:{enter:150,exit:150},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},n))})}return n}},{key:"render",value:function(){return this.props.value&&this.props.value.length>0&&this.renderGalleria()}}]),y}();y(M,"defaultProps",{id:null,value:null,activeIndex:0,fullScreen:!1,item:null,thumbnail:null,indicator:null,caption:null,className:null,style:null,header:null,footer:null,numVisible:3,responsiveOptions:null,showItemNavigators:!1,showThumbnailNavigators:!0,showItemNavigatorsOnHover:!1,changeItemOnIndicatorHover:!1,circular:!1,autoPlay:!1,transitionInterval:4e3,showThumbnails:!0,thumbnailsPosition:"bottom",verticalThumbnailViewPortHeight:"300px",showIndicators:!1,showIndicatorsOnItem:!1,indicatorsPosition:"bottom",baseZIndex:0,transitionOptions:null,onItemChange:null});export{M as Galleria};