/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ import{property as h,customElement as u}from"lit/decorators.js";import{LitElement as P,nothing as i,html as t}from"lit";import"@typo3/backend/element/icon-element.js";var n=function(s,e,l,r){var g=arguments.length,a=g<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,l):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,e,l,r);else for(var d=s.length-1;d>=0;d--)(c=s[d])&&(a=(g<3?c(a):g>3?c(e,l,a):c(e,l))||a);return g>3&&a&&Object.defineProperty(e,l,a),a};let p=class extends P{constructor(){super(...arguments),this.pagination=null,this.loading=!1}createRenderRoot(){return this}render(){return this.loading||this.pagination===null||this.pagination.allPageNumbers.length<=1?i:t``}};n([h({type:Object})],p.prototype,"pagination",void 0),n([h({type:Boolean,attribute:!1})],p.prototype,"loading",void 0),p=n([u("typo3-backend-live-search-result-pagination")],p);let o=class extends P{connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.dispatchPaginationEvent)}disconnectedCallback(){this.removeEventListener("click",this.dispatchPaginationEvent),super.disconnectedCallback()}createRenderRoot(){return this}render(){return i}dispatchPaginationEvent(){this.closest("typo3-backend-live-search").dispatchEvent(new CustomEvent("livesearch:pagination-selected",{detail:{offset:(this.page-1)*this.perPage}}))}};n([h({type:Number})],o.prototype,"page",void 0),n([h({type:Number})],o.prototype,"perPage",void 0),o=n([u("typo3-backend-live-search-result-page")],o);export{p as ResultPagination,o as ResultPaginationPage};