Mike Phares 127634f5ab Delete self contained Thunder Tests
Back to .net8.0
api/v4/InfinityQS
ApiExplorerSettings
Wafer Counter
Color Sorting
2024-03-13 13:15:56 -07:00

2 lines
9.6 KiB
JavaScript

import{r as i,c as t,h as e,g as l}from"./p-5308bbce.js";const a='@charset "UTF-8";:root{--ifx-font-family:"Source Sans 3";font-family:var(--ifx-font-family, sans-serif)}:host{display:inline-flex}.container{display:inline-flex;justify-content:center;align-items:center;gap:32px;font-family:var(--ifx-font-family)}.container .items__per-page-wrapper{display:flex;align-items:center;gap:16px}.container .items__per-page-wrapper .items__per-page-label{color:#1D1D1D;font-size:14px;font-style:normal;font-weight:600;line-height:20px}.container .items__per-page-wrapper .items__per-page-field{display:flex;flex-direction:column;align-items:flex-start}.container .items__per-page-wrapper .items__per-page-field ifx-select{width:92px}.container .items__total-wrapper{display:flex;justify-content:center;align-items:center;gap:12px}.container .items__total-wrapper .items__total-button{display:flex;width:40px;height:40px;justify-content:center;align-items:center;border-radius:100px;border:1px solid #BFBBBB;background:#FFF}.container .items__total-wrapper .page__numbers-wrapper{display:flex;justify-content:center;align-items:center;gap:12px}.container .items__total-wrapper .page__numbers-wrapper .page__number-item{display:flex;padding:6px;flex-direction:column;justify-content:center;align-items:center;gap:10px;border-radius:100px}.container .items__total-wrapper .page__numbers-wrapper .page__number-item.active{background-color:#0A8276}.container .items__total-wrapper .page__numbers-wrapper .page__number-item.active span{color:#fff}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:hover{cursor:pointer}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:hover:not(.active){background-color:#ddd}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:active:not(.active){background-color:#575352}.container .items__total-wrapper .page__numbers-wrapper .page__number-item span{display:flex;width:16px;height:16px;flex-direction:column;justify-content:center;color:#1D1D1D;text-align:center;font-size:13px;font-style:normal;font-weight:400;line-height:20px}.pagination{display:flex}.pagination ifx-icon-button:first-of-type{margin-right:12px}.pagination ifx-icon-button:last-of-type{margin-left:12px}a{padding:6px;border-radius:100px}ol{list-style-type:none;padding:0;margin:0;display:inline-flex;align-items:center;gap:12px}li{display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:100px}li:hover:not(.active) a{background-color:#EEEDED}li:active:not(.active) a{background-color:#575352;color:#fff}li.active{background-color:#0A8276}li.active a{color:#fff}li:hover{cursor:pointer}li a{text-decoration:none;display:flex;width:16px;height:16px;flex-direction:column;justify-content:center;color:#1D1D1D;text-align:center;font-size:13px;font-style:normal;font-weight:400;line-height:20px}.prev.disabled,.next.disabled{cursor:default}.prev.disabled:hover,.next.disabled:hover{cursor:default;text-decoration:none}.prev{margin-right:2.5px}.next{margin-left:2.5px}@media (min-width: 400px){li:first-child,li.active-sibling,li.active,li.active+li,li:last-child{display:inline-flex !important;flex-direction:row}li:first-child:nth-last-child(n+8)~li{display:none}li:first-child:nth-last-child(n+8)~li.active-sibling:before{content:"…";font-size:13px;display:inline-block;margin-right:6px}li:first-child:nth-last-child(n+8)~li.active+li:after{content:"…";font-size:13px;display:inline-block;margin-left:6px}li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+5){display:inline-flex;flex-direction:row}li:first-child:nth-last-child(n+8)~li:nth-last-child(5):before{content:"…";font-size:13px;display:inline-block;margin-right:6px}li:first-child:nth-last-child(n+8)~li:nth-child(-n+2):before,li:first-child:nth-last-child(n+8)~li:nth-child(-n+2):after,li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+2):before,li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+2):after,li:first-child:nth-last-child(n+8)~li.active-sibling:nth-last-child(-n+4):before,li:first-child:nth-last-child(n+8)~li.active-sibling:nth-last-child(-n+4):after{display:none !important}li:first-child:nth-last-child(n+8).active~li:nth-last-child(-n+5),li:first-child:nth-last-child(n+8)~li.active~li:nth-last-child(-n+5){display:none}li:first-child:nth-last-child(n+8).active~li:nth-last-child(-n+5):before,li:first-child:nth-last-child(n+8)~li.active~li:nth-last-child(-n+5):before{display:none}li:first-child:nth-last-child(n+8).active~li:nth-child(-n+5),li:first-child:nth-last-child(n+8)~li.active~li:nth-child(-n+5){display:inline-flex !important;flex-direction:row}li:first-child:nth-last-child(n+8).active~li:nth-child(-n+4):after,li:first-child:nth-last-child(n+8)~li.active~li:nth-child(-n+4):after{display:none}li:first-child:nth-last-child(n+8).active~li:nth-child(5):after,li:first-child:nth-last-child(n+8)~li.active~li:nth-child(5):after{content:"…";font-size:13px;display:inline-block;margin-left:6px}li:first-child:nth-last-child(n+8).active:before,li:first-child:nth-last-child(n+8).active:after,li:first-child:nth-last-child(n+8)~li.active:before,li:first-child:nth-last-child(n+8)~li.active:after{display:none}}';const n=class{constructor(e){i(this,e);this.ifxPageChange=t(this,"ifxPageChange",7);this.ifxNextPage=t(this,"ifxNextPage",7);this.ifxPrevPage=t(this,"ifxPrevPage",7);this.CLASS_DISABLED="disabled";this.CLASS_ACTIVE="active";this.CLASS_SIBLING_ACTIVE="active-sibling";this.DATA_KEY="pagination";this.currentPage=0;this.internalPage=1;this.itemsPerPage=10;this.numberOfPages=[];this.total=1}setItemsPerPage(i){this.itemsPerPage=parseInt(i.detail.label)}componentDidLoad(){this.calculateVisiblePageIndices();var i=this.el.shadowRoot.querySelector(".pagination");let t=i.querySelector(".prev");this.navigateSinglePage(t,true)}calculateNumberOfPages(){if(isNaN(this.currentPage)){this.currentPage=1}const i=this.total<=this.itemsPerPage?this.itemsPerPage:this.total;const t=this.itemsPerPage;const e=Math.ceil(i/t);if(this.currentPage<=0){this.internalPage=1}else if(this.currentPage>e){this.internalPage=e}else this.internalPage=this.currentPage;this.numberOfPages=Array.from({length:e},((i,t)=>t+1))}componentWillLoad(){this.calculateNumberOfPages()}componentDidUpdate(){var i=this.el.shadowRoot.querySelector(".pagination");var t=i.querySelectorAll("li");this.addEventListenersToPageItems(t,i);if(i.dataset[this.DATA_KEY]<this.numberOfPages){i.dataset[this.DATA_KEY]=i.dataset[this.DATA_KEY]}else i.dataset[this.DATA_KEY]=0;this.changePage(i,false)}componentWillUpdate(){this.calculateNumberOfPages()}handleEventEmission(i){let t=i+1;let e=this.numberOfPages.length;let l=i===0?null:i;let a=i+2>e?null:i+2;let n=this.itemsPerPage;this.ifxPageChange.emit({currentPage:t,totalPages:e,prevPage:l,nextPage:a,itemsPerPage:n})}addEventListenersToPageItems(i,t){i.forEach((i=>{i.addEventListener("click",(i=>{var e=t;let l=e.querySelectorAll("li");e.dataset[this.DATA_KEY]=Array.from(l).indexOf(i.currentTarget);this.changePage(e,false)}))}))}initPagination(i){var t=i.querySelectorAll("li");i.dataset[this.DATA_KEY]=Array.from(t).indexOf(i.querySelector(".active"));i.querySelector(".prev").addEventListener("click",(i=>this.navigateSinglePage(i,false)));i.querySelector(".next").addEventListener("click",(i=>this.navigateSinglePage(i,false)));this.addEventListenersToPageItems(t,i)}navigateSinglePage(i,t){let e=i;if(typeof i.target==="object"){e=i.target}if(!e.classList.contains(this.CLASS_DISABLED)){var l=e.closest(".pagination");var a=parseInt(l.dataset[this.DATA_KEY],10);a+=1*(e.classList.contains("prev")?-1:1);if(a===-1){a=0}l.dataset[this.DATA_KEY]=a;this.changePage(l,t)}}changePage(i,t){const e=i;var l=e.querySelectorAll("li");var a=parseInt(e.dataset[this.DATA_KEY],10);l.forEach((i=>{i.classList.remove(this.CLASS_ACTIVE);i.classList.remove(this.CLASS_SIBLING_ACTIVE)}));if(t&&this.internalPage>1){a=Math.floor(this.internalPage-1);e.dataset[this.DATA_KEY]=a}this.handleEventEmission(a);l[a].classList.add(this.CLASS_ACTIVE);if(a===0){e.querySelector(".prev").classList.add(this.CLASS_DISABLED);e.querySelector(".prev").disabled=true}else{l[a-1].classList.add(this.CLASS_SIBLING_ACTIVE);e.querySelector(".prev").classList.remove(this.CLASS_DISABLED);e.querySelector(".prev").disabled=false}if(a===l.length-1){e.querySelector(".next").classList.add(this.CLASS_DISABLED);e.querySelector(".next").disabled=true}else{e.querySelector(".next").classList.remove(this.CLASS_DISABLED);e.querySelector(".next").disabled=false}}calculateVisiblePageIndices(){var i=this.el.shadowRoot.querySelector(".pagination");this.initPagination(i)}render(){return e("div",{"aria-label":"a pagination","aria-value":this.currentPage,class:"container"},e("div",{class:"items__per-page-wrapper"},e("div",{class:"items__per-page-label"},"Results per Page"),e("div",{class:"items__per-page-field"},e("ifx-select",{type:"single",value:"undefined","ifx-size":"s",placeholder:"false","search-enabled":"false","search-placeholder-value":"Search...","ifx-disabled":"false","ifx-error":"false","ifx-error-message":"Error","ifx-label":"","ifx-placeholder-value":"Placeholder","ifx-options":'[{"value":"ten","label":"10","selected":true}, {"value":"Twenty","label":"20","selected":false}, {"value":"Thirty","label":"30","selected":false}]'}))),e("div",{class:"items__total-wrapper"},e("div",{class:"page__numbers-wrapper"},e("div",{class:"pagination"},e("ifx-icon-button",{variant:"secondary",class:"prev",color:"primary",icon:"arrow-left-24"}),e("ol",null,this.numberOfPages.map((i=>e("li",{class:`${this.internalPage===i?"active":""}`},e("a",{href:undefined},i))))),e("ifx-icon-button",{class:"next",variant:"secondary",color:"primary",icon:"arrow-right-24"})))))}get el(){return l(this)}};n.style=a;export{n as ifx_pagination};
//# sourceMappingURL=p-5b4e3d51.entry.js.map