2 lines
25 KiB
JavaScript
2 lines
25 KiB
JavaScript
this.primereact=this.primereact||{},this.primereact.galleria=function(e,t,i,n,s,r,a){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t),p=o(s);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 h(e,t,i){return t&&u(e.prototype,t),i&&u(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(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&&m(e,t)}function f(e){return f="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},f(e)}function b(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function y(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function g(){return g=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},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(e){return!1}}var S=function(e){v(a,e);var t,s,r=(t=a,s=w(),function(){var e,i=I(t);if(s){var n=I(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return b(this,e)});function a(e){var t;return c(this,a),(t=r.call(this,e)).navForward=t.navForward.bind(d(t)),t.navBackward=t.navBackward.bind(d(t)),t.next=t.next.bind(d(t)),t.prev=t.prev.bind(d(t)),t}return h(a,[{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",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,t=i.classNames("p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":e});return l.default.createElement("button",{type:"button",className:t,onClick:this.navBackward,disabled:e},l.default.createElement("span",{className:"p-galleria-item-prev-icon pi pi-chevron-left"}),l.default.createElement(n.Ripple,null))}return null}},{key:"renderForwardNavigator",value:function(){if(this.props.showItemNavigators){var e=!this.props.circular&&this.props.activeItemIndex===this.props.value.length-1,t=i.classNames("p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":e});return l.default.createElement("button",{type:"button",className:t,onClick:this.navForward,disabled:e},l.default.createElement("span",{className:"p-galleria-item-next-icon pi pi-chevron-right"}),l.default.createElement(n.Ripple,null))}return null}},{key:"renderCaption",value:function(){if(this.props.caption){var e=this.props.caption(this.props.value[this.props.activeItemIndex]);return l.default.createElement("div",{className:"p-galleria-caption"},e)}return null}},{key:"renderIndicator",value:function(e){var t=this,s=this.props.indicator&&this.props.indicator(e),r=i.classNames("p-galleria-indicator",{"p-highlight":this.props.activeItemIndex===e});return s||(s=l.default.createElement("button",{type:"button",tabIndex:-1,className:"p-link"},l.default.createElement(n.Ripple,null))),l.default.createElement("li",{className:r,key:"p-galleria-indicator-"+e,tabIndex:0,onClick:function(){return t.onIndicatorClick(e)},onMouseEnter:function(){return t.onIndicatorMouseEnter(e)},onKeyDown:function(i){return t.onIndicatorKeyDown(i,e)}},s)}},{key:"renderIndicators",value:function(){if(this.props.showIndicators){for(var e=i.classNames("p-galleria-indicators p-reset",this.props.indicatorsContentClassName),t=[],n=0;n<this.props.value.length;n++)t.push(this.renderIndicator(n));return l.default.createElement("ul",{className:e},t)}return null}},{key:"render",value:function(){var e=this,t=this.props.itemTemplate&&this.props.itemTemplate(this.props.value[this.props.activeItemIndex]),i=this.renderBackwardNavigator(),n=this.renderForwardNavigator(),s=this.renderCaption(),r=this.renderIndicators();return l.default.createElement("div",{ref:function(t){return e.props.forwardRef(t)},className:"p-galleria-item-wrapper"},l.default.createElement("div",{className:"p-galleria-item-container"},i,l.default.createElement("div",{className:"p-galleria-item"},t),n,s),r)}}]),a}(t.Component),k=l.default.forwardRef((function(e,t){return l.default.createElement(S,g({forwardRef:t},e))}));function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function E(e){if(Array.isArray(e))return x(e)}function C(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function N(e,t){if(e){if("string"==typeof e)return x(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}function O(){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(e){var t=P();return function(){var i,n=I(e);if(t){var s=I(this).constructor;i=Reflect.construct(n,arguments,s)}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(e){return!1}}var T=function(e){v(n,e);var t=V(n);function n(e){var i;return c(this,n),(i=t.call(this,e)).onItemClick=i.onItemClick.bind(d(i)),i.onItemKeyDown=i.onItemKeyDown.bind(d(i)),i}return h(n,[{key:"onItemClick",value:function(e){this.props.onItemClick({originalEvent:e,index:this.props.index})}},{key:"onItemKeyDown",value:function(e){13===e.which&&this.props.onItemClick({originalEvent:e,index:this.props.index})}},{key:"render",value:function(){var e=this.props.template&&this.props.template(this.props.item),t=i.classNames(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 l.default.createElement("div",{className:t},l.default.createElement("div",{className:"p-galleria-thumbnail-item-content",tabIndex:this.props.active?0:null,onClick:this.onItemClick,onKeyDown:this.onItemKeyDown},e))}}]),n}(t.Component);y(T,"defaultProps",{index:null,template:null,item:null,current:!1,active:!1,start:!1,end:!1,className:null,onItemClick:null});var A=function(e){v(s,e);var t=V(s);function s(e){var n;return c(this,s),(n=t.call(this,e)).state={numVisible:e.numVisible,totalShiftedItems:0,page:0},n.navForward=n.navForward.bind(d(n)),n.navBackward=n.navBackward.bind(d(n)),n.onTransitionEnd=n.onTransitionEnd.bind(d(n)),n.onTouchStart=n.onTouchStart.bind(d(n)),n.onTouchMove=n.onTouchMove.bind(d(n)),n.onTouchEnd=n.onTouchEnd.bind(d(n)),n.onItemClick=n.onItemClick.bind(d(n)),n.attributeSelector=i.UniqueComponentId(),n}return h(s,[{key:"step",value:function(e){var t=this.state.totalShiftedItems+e;e<0&&-1*t+this.state.numVisible>this.props.value.length-1?t=this.state.numVisible-this.props.value.length:e>0&&t>0&&(t=0),this.props.circular&&(e<0&&this.props.value.length-1===this.props.activeItemIndex?t=0:e>0&&0===this.props.activeItemIndex&&(t=this.state.numVisible-this.props.value.length)),this.itemsContainer&&(i.DomHandler.removeClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transform=this.props.isVertical?"translate3d(0, ".concat(t*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(t*(100/this.state.numVisible),"%, 0, 0)"),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.setState({totalShiftedItems:t})}},{key:"stopSlideShow",value:function(){this.props.slideShowActive&&this.props.stopSlideShow&&this.props.stopSlideShow()}},{key:"getMedianItemIndex",value:function(){var e=Math.floor(this.state.numVisible/2);return this.state.numVisible%2?e:e-1}},{key:"navBackward",value:function(e){this.stopSlideShow();var t=0!==this.props.activeItemIndex?this.props.activeItemIndex-1:0;this.state.numVisible-(t+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:t}),e.cancelable&&e.preventDefault()}},{key:"navForward",value:function(e){this.stopSlideShow();var t=this.props.activeItemIndex+1;t+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:t}),e.cancelable&&e.preventDefault()}},{key:"onItemClick",value:function(e){this.stopSlideShow();var t=e.index;if(t!==this.props.activeItemIndex){var i=t+this.state.totalShiftedItems,n=0;t<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:t})}}},{key:"onTransitionEnd",value:function(e){this.itemsContainer&&"transform"===e.propertyName&&(i.DomHandler.addClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transition="")}},{key:"onTouchStart",value:function(e){var t=e.changedTouches[0];this.startPos={x:t.pageX,y:t.pageY}}},{key:"onTouchMove",value:function(e){e.cancelable&&e.preventDefault()}},{key:"onTouchEnd",value:function(e){var t=e.changedTouches[0];this.changePageOnTouch(e,this.props.isVertical?t.pageY-this.startPos.y:t.pageX-this.startPos.x)}},{key:"changePageOnTouch",value:function(e,t){t<0?this.navForward(e):this.navBackward(e)}},{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=i.DomHandler.createInlineStyle(p.default.nonce));var e,t="\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(e=this.props.responsiveOptions)||C(e)||N(e)||O(),this.responsiveOptions.sort((function(e,t){var i=e.breakpoint,n=t.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 n=0;n<this.responsiveOptions.length;n++){var s=this.responsiveOptions[n];t+="\n @media screen and (max-width: ".concat(s.breakpoint,") {\n .p-galleria-thumbnail-items[").concat(this.attributeSelector,"] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100/s.numVisible,"%\n }\n }\n ")}}this.thumbnailsStyle.innerHTML=t}},{key:"calculatePosition",value:function(){if(this.itemsContainer&&this.responsiveOptions){for(var e=window.innerWidth,t={numVisible:this.props.numVisible},i=0;i<this.responsiveOptions.length;i++){var n=this.responsiveOptions[i];parseInt(n.breakpoint,10)>=e&&(t=n)}this.state.numVisible!==t.numVisible&&this.setState({numVisible:t.numVisible})}}},{key:"bindDocumentListeners",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.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(e,t){var n=this.state.totalShiftedItems;t.numVisible===this.state.numVisible&&e.activeItemIndex===this.props.activeItemIndex||((n=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:n}),this.itemsContainer.style.transform=this.props.isVertical?"translate3d(0, ".concat(n*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(n*(100/this.state.numVisible),"%, 0, 0)"),e.activeItemIndex!==this.props.activeItemIndex&&(i.DomHandler.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(t,i){var n=-1*e.state.totalShiftedItems,s=n+e.state.numVisible-1;return l.default.createElement(T,{key:i,index:i,template:e.props.itemTemplate,item:t,active:n<=i&&s>=i,start:n===i,end:s===i,onItemClick:e.onItemClick,current:e.props.activeItemIndex===i})}))}},{key:"renderBackwardNavigator",value:function(){if(this.props.showThumbnailNavigators){var e=!this.props.circular&&0===this.props.activeItemIndex||this.props.value.length<=this.state.numVisible,t=i.classNames("p-galleria-thumbnail-prev p-link",{"p-disabled":e}),s=i.classNames("p-galleria-thumbnail-prev-icon pi",{"pi-chevron-left":!this.props.isVertical,"pi-chevron-up":this.props.isVertical});return l.default.createElement("button",{className:t,onClick:this.navBackward,disabled:e},l.default.createElement("span",{className:s}),l.default.createElement(n.Ripple,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,t=i.classNames("p-galleria-thumbnail-next p-link",{"p-disabled":e}),s=i.classNames("p-galleria-thumbnail-next-icon pi",{"pi-chevron-right":!this.props.isVertical,"pi-chevron-down":this.props.isVertical});return l.default.createElement("button",{className:t,onClick:this.navForward,disabled:e},l.default.createElement("span",{className:s}),l.default.createElement(n.Ripple,null))}return null}},{key:"renderContent",value:function(){var e=this,t=this.renderItems(),i=this.props.isVertical?this.props.contentHeight:"",n=this.renderBackwardNavigator(),s=this.renderForwardNavigator();return l.default.createElement("div",{className:"p-galleria-thumbnail-container"},n,l.default.createElement("div",{className:"p-galleria-thumbnail-items-container",style:{height:i}},l.default.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},t)),s)}},{key:"render",value:function(){var e=this.renderContent();return l.default.createElement("div",{className:"p-galleria-thumbnail-wrapper"},e)}}]),s}(t.Component);function R(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function D(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?R(Object(i),!0).forEach((function(t){y(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(){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=function(e){v(u,e);var t,s,o=(t=u,s=j(),function(){var e,i=I(t);if(s){var n=I(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return b(this,e)});function u(e){var t;return c(this,u),(t=o.call(this,e)).state={visible:!1,numVisible:e.numVisible,slideShowActive:!1},t.props.onItemChange||(t.state=D(D({},t.state),{},{activeIndex:e.activeIndex})),t.onActiveItemChange=t.onActiveItemChange.bind(d(t)),t.show=t.show.bind(d(t)),t.hide=t.hide.bind(d(t)),t.startSlideShow=t.startSlideShow.bind(d(t)),t.stopSlideShow=t.stopSlideShow.bind(d(t)),t.onEnter=t.onEnter.bind(d(t)),t.onEntering=t.onEntering.bind(d(t)),t.onEntered=t.onEntered.bind(d(t)),t.onExit=t.onExit.bind(d(t)),t.onExited=t.onExited.bind(d(t)),t.galleriaRef=l.default.createRef(),t}return h(u,[{key:"activeItemIndex",get:function(){return this.props.onItemChange?this.props.activeIndex:this.state.activeIndex}},{key:"onActiveItemChange",value:function(e){this.props.onItemChange?this.props.onItemChange(e):this.setState({activeIndex:e.index})}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(){this.setState({visible:!1})}},{key:"onEnter",value:function(){i.DomHandler.addClass(document.body,"p-overflow-hidden")}},{key:"onEntering",value:function(){i.ZIndexUtils.set("modal",this.mask,p.default.autoZIndex,this.props.baseZIndex||p.default.zIndex.modal),i.DomHandler.addMultipleClasses(this.mask,"p-component-overlay p-component-overlay-enter")}},{key:"onEntered",value:function(){this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){i.DomHandler.removeClass(document.body,"p-overflow-hidden"),i.DomHandler.addClass(this.mask,"p-component-overlay-leave")}},{key:"onExited",value:function(){i.ZIndexUtils.clear(this.mask),this.props.onHide&&this.props.onHide()}},{key:"isAutoPlayActive",value:function(){return this.state.slideShowActive}},{key:"startSlideShow",value:function(){var e=this;this.interval=setInterval((function(){e.onActiveItemChange({index:e.props.circular&&e.props.value.length-1===e.activeItemIndex?0:e.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(e,t){var i=["top","left","bottom","right"].find((function(e){return e===t}));return i?"".concat(e,"-").concat(i):""}},{key:"isVertical",value:function(){return"left"===this.props.thumbnailsPosition||"right"===this.props.thumbnailsPosition}},{key:"componentDidUpdate",value:function(e,t){e.value!==this.props.value&&this.props.value&&this.props.value.length<this.state.numVisible&&this.setState({numVisible:this.props.value.length}),e.numVisible!==this.props.numVisible&&this.setState({numVisible:this.props.numVisible})}},{key:"componentWillUnmount",value:function(){this.state.slideShowActive&&this.stopSlideShow(),i.ZIndexUtils.clear(this.mask)}},{key:"renderHeader",value:function(){return this.props.header?l.default.createElement("div",{className:"p-galleria-header"},this.props.header):null}},{key:"renderFooter",value:function(){return this.props.footer?l.default.createElement("div",{className:"p-galleria-footer"},this.props.footer):null}},{key:"renderElement",value:function(){var e=this,t=this.isVertical(),s=this.props.showThumbnails&&this.getPositionClassName("p-galleria-thumbnails",this.props.thumbnailsPosition),r=this.props.showIndicators&&this.getPositionClassName("p-galleria-indicators",this.props.indicatorsPosition),a=i.classNames("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},s,r),o=this.props.fullScreen&&l.default.createElement("button",{type:"button",className:"p-galleria-close p-link",onClick:this.hide},l.default.createElement("span",{className:"p-galleria-close-icon pi pi-times"}),l.default.createElement(n.Ripple,null)),p=this.renderHeader(),c=this.renderFooter();return l.default.createElement("div",{ref:this.galleriaRef,id:this.props.id,className:a,style:this.props.style},o,p,l.default.createElement("div",{className:"p-galleria-content"},l.default.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&&l.default.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:t,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,t=this.renderElement();if(this.props.fullScreen){var n=i.classNames("p-galleria-mask",{"p-galleria-visible":this.state.visible});return l.default.createElement(a.Portal,{element:l.default.createElement("div",{ref:function(t){return e.mask=t},className:n},l.default.createElement(r.CSSTransition,{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},t))})}return t}},{key:"render",value:function(){return this.props.value&&this.props.value.length>0&&this.renderGalleria()}}]),u}(t.Component);return 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}),e.Galleria=M,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.ripple,primereact.api,primereact.csstransition,primereact.portal);
|