@paperless/core 2.22.0-alpha.30 → 2.22.0-alpha.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/build/{p-66626b17.js → p-39695802.js} +1 -1
  2. package/dist/build/p-4c47faf5.entry.js +1 -0
  3. package/dist/build/paperless.esm.js +1 -1
  4. package/dist/cjs/p-button_3.cjs.entry.js +7 -6
  5. package/dist/collection/components/molecules/button/button.component.css +1 -1
  6. package/dist/collection/components/molecules/button/button.component.js +6 -5
  7. package/dist/components/{p-iMCMxc-_.js → p-BQNrSoo9.js} +1 -1
  8. package/dist/components/{p-BY-iZ7C8.js → p-BqgXqvox.js} +1 -1
  9. package/dist/components/p-BvUfWfx-.js +1 -0
  10. package/dist/components/{p-CFmYQoDA.js → p-CaN_dhnG.js} +1 -1
  11. package/dist/components/{p-CPlMlM6g.js → p-CkCQHYtH.js} +1 -1
  12. package/dist/components/{p-CIqBta1w.js → p-CvE78NPe.js} +1 -1
  13. package/dist/components/{p-C23JF7PQ.js → p-PyPr6c8z.js} +1 -1
  14. package/dist/components/{p-BkkPm9Yp.js → p-SggF_Jar.js} +1 -1
  15. package/dist/components/{p-CeX--L43.js → p-ZcEew3GF.js} +1 -1
  16. package/dist/components/p-attachment.js +1 -1
  17. package/dist/components/p-button.js +1 -1
  18. package/dist/components/p-calendar.js +1 -1
  19. package/dist/components/p-datepicker.js +1 -1
  20. package/dist/components/p-drawer-header.js +1 -1
  21. package/dist/components/p-drawer.js +1 -1
  22. package/dist/components/p-empty-state.js +1 -1
  23. package/dist/components/p-field.js +1 -1
  24. package/dist/components/{p-Bw7wEGKa.js → p-kAKe_qDq.js} +1 -1
  25. package/dist/components/p-modal-header.js +1 -1
  26. package/dist/components/p-modal.js +1 -1
  27. package/dist/components/p-navbar.js +1 -1
  28. package/dist/components/p-pagination-pages.js +1 -1
  29. package/dist/components/p-pagination.js +1 -1
  30. package/dist/components/p-profile.js +1 -1
  31. package/dist/components/p-select.js +1 -1
  32. package/dist/components/p-table-footer.js +1 -1
  33. package/dist/components/p-table-header.js +1 -1
  34. package/dist/components/p-table.js +1 -1
  35. package/dist/esm/p-button_3.entry.js +7 -6
  36. package/dist/index.html +1 -1
  37. package/dist/paperless/p-4c47faf5.entry.js +1 -0
  38. package/dist/paperless/paperless.esm.js +1 -1
  39. package/dist/sw.js +1 -1
  40. package/dist/sw.js.map +1 -1
  41. package/hydrate/index.js +7 -6
  42. package/hydrate/index.mjs +7 -6
  43. package/package.json +1 -1
  44. package/dist/build/p-5fb0fde5.entry.js +0 -1
  45. package/dist/components/p-DPtX6elD.js +0 -1
  46. package/dist/paperless/p-5fb0fde5.entry.js +0 -1
@@ -1 +1 @@
1
- import{M as o,d as s}from"./p-CIqBta1w.js";const t=o,a=s;export{t as PModalHeader,a as defineCustomElement}
1
+ import{M as o,d as s}from"./p-CvE78NPe.js";const p=o,r=s;export{p as PModalHeader,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as o,H as s,c as e,h as t,t as l}from"./p-mR4MYqqI.js";import{d as a}from"./p-DM8w1S9L.js";import{d as r}from"./p-DPtX6elD.js";import{d as i}from"./p-CQaFushj.js";import{d as p}from"./p-DfBWP1bt.js";import{d as c}from"./p--JxtpGtF.js";import{d as m}from"./p-CpaA1Iq7.js";import{d}from"./p-hBh42vsk.js";import{d as h}from"./p-CpnSfiGo.js";import{d as n}from"./p-CIqBta1w.js";import{d as u}from"./p-B0_4fWrY.js";const b=o(class extends s{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.closeClicked=e(this,"closeClicked",3),this.closed=e(this,"closed",3)}size="base";header;show=!1;applyBlur=!1;showClose=!0;showMobileFooter=!1;backdropClickClose=!0;scrollLock=!0;closeClicked;closed;get _el(){return this}_hasFooterSlot=!1;_hasHeaderSlot=!1;_closing=!1;componentWillLoad(){this._hasFooterSlot=!!this._el.querySelector(':scope > [slot="footer"]'),this._hasHeaderSlot=!!this._el.querySelector(':scope > [slot="header"]')}render(){if(!this.show)return;const o=t("slot",{name:"header"}),s=t("slot",{name:"content"}),e=t("slot",{name:"footer"});return t("p-backdrop",{applyBlur:this.applyBlur,onClicked:o=>this._backdropClick(o.detail),closing:this._closing,scrollLock:this.scrollLock},t("p-modal-container",{size:this.size,closing:this._closing},(this.header?.length||this._hasHeaderSlot)&&t("p-modal-header",{showClose:this.showClose,onClose:o=>this.close("button",o.detail)},this._hasHeaderSlot?o:this.header),t("p-modal-body",{roundedBottom:!this._hasFooterSlot,roundedTop:!this._hasHeaderSlot&&!this.header?.length},s),this._hasFooterSlot&&t("p-modal-footer",null,e)))}_backdropClick(o){this.backdropClickClose&&(this._findModal(o.target)||this.close("backdrop",o))}_findModal(o){return o?"p-modal-container"===o.nodeName.toLowerCase()?o:"p-backdrop"===o?.nodeName?.toLowerCase()?null:this._findModal(o?.parentElement):null}close(o,s){this.closeClicked.emit(s),this._closing=!0,setTimeout((()=>{this.show=!1,this._closing=!1,this.closed.emit(o)}),550)}handleCloseModal(){this.close("event")}},[769,"p-modal",{size:[1],header:[1],show:[4],applyBlur:[4,"apply-blur"],showClose:[4,"show-close"],showMobileFooter:[4,"show-mobile-footer"],backdropClickClose:[4,"backdrop-click-close"],scrollLock:[4,"scroll-lock"],_closing:[32]},[[8,"closeModal","handleCloseModal"]]]),k=b,f=function(){"undefined"!=typeof customElements&&["p-modal","p-backdrop","p-button","p-divider","p-icon","p-loader","p-modal-body","p-modal-container","p-modal-footer","p-modal-header","p-smile"].forEach((o=>{switch(o){case"p-modal":customElements.get(l(o))||customElements.define(l(o),b);break;case"p-backdrop":customElements.get(l(o))||a();break;case"p-button":customElements.get(l(o))||r();break;case"p-divider":customElements.get(l(o))||i();break;case"p-icon":customElements.get(l(o))||p();break;case"p-loader":customElements.get(l(o))||c();break;case"p-modal-body":customElements.get(l(o))||m();break;case"p-modal-container":customElements.get(l(o))||d();break;case"p-modal-footer":customElements.get(l(o))||h();break;case"p-modal-header":customElements.get(l(o))||n();break;case"p-smile":customElements.get(l(o))||u()}}))};export{k as PModal,f as defineCustomElement}
1
+ import{p as o,H as s,c as e,h as t,t as l}from"./p-mR4MYqqI.js";import{d as a}from"./p-DM8w1S9L.js";import{d as r}from"./p-BvUfWfx-.js";import{d as i}from"./p-CQaFushj.js";import{d as p}from"./p-DfBWP1bt.js";import{d as c}from"./p--JxtpGtF.js";import{d as m}from"./p-CpaA1Iq7.js";import{d}from"./p-hBh42vsk.js";import{d as h}from"./p-CpnSfiGo.js";import{d as n}from"./p-CvE78NPe.js";import{d as u}from"./p-B0_4fWrY.js";const b=o(class extends s{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.closeClicked=e(this,"closeClicked",3),this.closed=e(this,"closed",3)}size="base";header;show=!1;applyBlur=!1;showClose=!0;showMobileFooter=!1;backdropClickClose=!0;scrollLock=!0;closeClicked;closed;get _el(){return this}_hasFooterSlot=!1;_hasHeaderSlot=!1;_closing=!1;componentWillLoad(){this._hasFooterSlot=!!this._el.querySelector(':scope > [slot="footer"]'),this._hasHeaderSlot=!!this._el.querySelector(':scope > [slot="header"]')}render(){if(!this.show)return;const o=t("slot",{name:"header"}),s=t("slot",{name:"content"}),e=t("slot",{name:"footer"});return t("p-backdrop",{applyBlur:this.applyBlur,onClicked:o=>this._backdropClick(o.detail),closing:this._closing,scrollLock:this.scrollLock},t("p-modal-container",{size:this.size,closing:this._closing},(this.header?.length||this._hasHeaderSlot)&&t("p-modal-header",{showClose:this.showClose,onClose:o=>this.close("button",o.detail)},this._hasHeaderSlot?o:this.header),t("p-modal-body",{roundedBottom:!this._hasFooterSlot,roundedTop:!this._hasHeaderSlot&&!this.header?.length},s),this._hasFooterSlot&&t("p-modal-footer",null,e)))}_backdropClick(o){this.backdropClickClose&&(this._findModal(o.target)||this.close("backdrop",o))}_findModal(o){return o?"p-modal-container"===o.nodeName.toLowerCase()?o:"p-backdrop"===o?.nodeName?.toLowerCase()?null:this._findModal(o?.parentElement):null}close(o,s){this.closeClicked.emit(s),this._closing=!0,setTimeout((()=>{this.show=!1,this._closing=!1,this.closed.emit(o)}),550)}handleCloseModal(){this.close("event")}},[769,"p-modal",{size:[1],header:[1],show:[4],applyBlur:[4,"apply-blur"],showClose:[4,"show-close"],showMobileFooter:[4,"show-mobile-footer"],backdropClickClose:[4,"backdrop-click-close"],scrollLock:[4,"scroll-lock"],_closing:[32]},[[8,"closeModal","handleCloseModal"]]]),k=b,f=function(){"undefined"!=typeof customElements&&["p-modal","p-backdrop","p-button","p-divider","p-icon","p-loader","p-modal-body","p-modal-container","p-modal-footer","p-modal-header","p-smile"].forEach((o=>{switch(o){case"p-modal":customElements.get(l(o))||customElements.define(l(o),b);break;case"p-backdrop":customElements.get(l(o))||a();break;case"p-button":customElements.get(l(o))||r();break;case"p-divider":customElements.get(l(o))||i();break;case"p-icon":customElements.get(l(o))||p();break;case"p-loader":customElements.get(l(o))||c();break;case"p-modal-body":customElements.get(l(o))||m();break;case"p-modal-container":customElements.get(l(o))||d();break;case"p-modal-footer":customElements.get(l(o))||h();break;case"p-modal-header":customElements.get(l(o))||n();break;case"p-smile":customElements.get(l(o))||u()}}))};export{k as PModal,f as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as a,h as t,t as r}from"./p-mR4MYqqI.js";import{c as o}from"./p-CBWjHURv.js";import{T as i}from"./p-C1fCuFhI.js";import{d as n}from"./p-DM8w1S9L.js";import{d as s}from"./p-DPtX6elD.js";import{d as l}from"./p-DfBWP1bt.js";import{d as c}from"./p--JxtpGtF.js";const d=o(["transition","bg-off-white-300 dark:bg-hurricane-800","border-0 border-solid border-off-white-700 dark:border-hurricane-500","p-4"]),f=o(["flex flex-col","fixed left-0 top-0 z-navbar h-screen w-60","w-full max-w-[16.5rem]","layout-1280:relative layout-1280:z-0 layout-1280:max-w-none layout-1280:h-full","gap-6","transition-all","will-change-transform","-translate-x-full transform-gpu layout-1280:translate-x-0","border-r","safe-sidebar"],{variants:{show:{false:null,true:"show"}}}),b=o(["flex w-full justify-between items-center","relative z-navbar-topbar","border-b","layout-1280:hidden","safe-topbar"]),p=o(["z-navbar-backdrop layout-1280:hidden transition-opacity relative"],{variants:{show:{false:"opacity-0 pointer-events-none",true:"opacity-100"}}}),w=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}_show=!1;render(){return t(i,{key:"ee599d3472ef0a332d17353d8e7f559e36d5529b"},t("p-backdrop",{key:"aa5b71247881e2a23998bab23f194ff6f58a6662",class:p({show:this._show}),scrollLock:this._show,onClicked:()=>this._show=!1}),t("div",{key:"121da670f6b7dbbfbce4a018c56b56ac1352c212",class:f({class:d(),show:this._show})},t("div",{key:"e789b6c904b4715c271e03324d8e8643acd5d8a8",class:"flex w-full items-center justify-end layout-1280:hidden"},t("p-button",{key:"9d6f49157fc731f91ff34bc7e37aebe40c5d0612",variant:"secondary",icon:"menu-arrow",iconFlip:"horizontal",iconOnly:!0,onClick:()=>this._show=!1})),t("div",{key:"c88909335eed7df5a93b32a65d24b1a8ff2a3f19",class:"flex w-full flex-shrink-0 flex-col items-stretch"},t("slot",{key:"e09b2eaefb99e51502f3629c377728d298b0e8d9",name:"company"})),t("div",{key:"2ce82f037a53e8529d834958812d74f3cdd25ef2",class:"flex w-full flex-1 flex-col gap-6 overflow-y-auto"},t("slot",{key:"eaf615dd6f9d5b8fb260fe5a10c43b1e0b6f52c0",name:"content"})),t("div",{key:"9b8bedc34ab2bcbe8935426007b6fd8c2d33c177",class:"mt-auto hidden w-full flex-shrink-0 flex-col layout-1280:flex"},t("slot",{key:"7a4889a2554cad25f9e8be122863fb5c2783376d",name:"user"}))),t("div",{key:"e9d88767781757f7fc81c772fbe750a15a03fa6c",class:b({class:d()})},t("p-button",{key:"3517c55339958c4461f20b190c220358658a71cf",variant:"secondary",iconOnly:!0,icon:"menu-arrow",onClick:()=>this._show=!0}),t("slot",{key:"b89f63dfbeba643e3f46f72e6862944ba75f1213",name:"topbar"})))}handleCloseNavbar(){this._show=!1}handleOpenNavbar(){this._show=!0}static get style(){return".w-full{width:100%}.max-h-screen-safe{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))}*{box-sizing:border-box}:host{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));width:100%;.safe-sidebar{padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important;&.show{--tw-translate-x:env(safe-area-inset-left,0)!important}}.safe-topbar{height:calc(env(safe-area-inset-top, 0) + 4rem);padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}}@media (min-width:80rem){:host{width:15rem}}@media (min-width:105rem){:host{width:18rem}}@media (min-width:80rem){.layout-1280\\:w-60{width:15rem}}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-navbar{z-index:300}.z-navbar-backdrop{z-index:290}.z-navbar-topbar{z-index:280}.mt-auto{margin-top:auto}.flex{display:flex}.hidden{display:none}.h-screen{height:100vh}.w-60{width:15rem}.max-w-\\[16\\.5rem\\]{max-width:16.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-6{gap:1.5rem}.overflow-y-auto{overflow-y:auto}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform{will-change:transform}@media (min-width:80rem){.layout-1280\\:relative{position:relative}.layout-1280\\:z-0{z-index:0}.layout-1280\\:flex{display:flex}.layout-1280\\:hidden{display:none}.layout-1280\\:h-full{height:100%}.layout-1280\\:max-w-none{max-width:none}.layout-1280\\:translate-x-0{--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}.dark\\:border-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(54 60 70/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:border-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(54 60 70/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}"}},[769,"p-navbar",{_show:[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]),m=w,h=function(){"undefined"!=typeof customElements&&["p-navbar","p-backdrop","p-button","p-icon","p-loader"].forEach((e=>{switch(e){case"p-navbar":customElements.get(r(e))||customElements.define(r(e),w);break;case"p-backdrop":customElements.get(r(e))||n();break;case"p-button":customElements.get(r(e))||s();break;case"p-icon":customElements.get(r(e))||l();break;case"p-loader":customElements.get(r(e))||c()}}))};export{m as PNavbar,h as defineCustomElement}
1
+ import{p as e,H as a,h as t,t as r}from"./p-mR4MYqqI.js";import{c as o}from"./p-CBWjHURv.js";import{T as i}from"./p-C1fCuFhI.js";import{d as n}from"./p-DM8w1S9L.js";import{d as s}from"./p-BvUfWfx-.js";import{d as l}from"./p-DfBWP1bt.js";import{d as c}from"./p--JxtpGtF.js";const d=o(["transition","bg-off-white-300 dark:bg-hurricane-800","border-0 border-solid border-off-white-700 dark:border-hurricane-500","p-4"]),f=o(["flex flex-col","fixed left-0 top-0 z-navbar h-screen w-60","w-full max-w-[16.5rem]","layout-1280:relative layout-1280:z-0 layout-1280:max-w-none layout-1280:h-full","gap-6","transition-all","will-change-transform","-translate-x-full transform-gpu layout-1280:translate-x-0","border-r","safe-sidebar"],{variants:{show:{false:null,true:"show"}}}),b=o(["flex w-full justify-between items-center","relative z-navbar-topbar","border-b","layout-1280:hidden","safe-topbar"]),p=o(["z-navbar-backdrop layout-1280:hidden transition-opacity relative"],{variants:{show:{false:"opacity-0 pointer-events-none",true:"opacity-100"}}}),w=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}_show=!1;render(){return t(i,{key:"ee599d3472ef0a332d17353d8e7f559e36d5529b"},t("p-backdrop",{key:"aa5b71247881e2a23998bab23f194ff6f58a6662",class:p({show:this._show}),scrollLock:this._show,onClicked:()=>this._show=!1}),t("div",{key:"121da670f6b7dbbfbce4a018c56b56ac1352c212",class:f({class:d(),show:this._show})},t("div",{key:"e789b6c904b4715c271e03324d8e8643acd5d8a8",class:"flex w-full items-center justify-end layout-1280:hidden"},t("p-button",{key:"9d6f49157fc731f91ff34bc7e37aebe40c5d0612",variant:"secondary",icon:"menu-arrow",iconFlip:"horizontal",iconOnly:!0,onClick:()=>this._show=!1})),t("div",{key:"c88909335eed7df5a93b32a65d24b1a8ff2a3f19",class:"flex w-full flex-shrink-0 flex-col items-stretch"},t("slot",{key:"e09b2eaefb99e51502f3629c377728d298b0e8d9",name:"company"})),t("div",{key:"2ce82f037a53e8529d834958812d74f3cdd25ef2",class:"flex w-full flex-1 flex-col gap-6 overflow-y-auto"},t("slot",{key:"eaf615dd6f9d5b8fb260fe5a10c43b1e0b6f52c0",name:"content"})),t("div",{key:"9b8bedc34ab2bcbe8935426007b6fd8c2d33c177",class:"mt-auto hidden w-full flex-shrink-0 flex-col layout-1280:flex"},t("slot",{key:"7a4889a2554cad25f9e8be122863fb5c2783376d",name:"user"}))),t("div",{key:"e9d88767781757f7fc81c772fbe750a15a03fa6c",class:b({class:d()})},t("p-button",{key:"3517c55339958c4461f20b190c220358658a71cf",variant:"secondary",iconOnly:!0,icon:"menu-arrow",onClick:()=>this._show=!0}),t("slot",{key:"b89f63dfbeba643e3f46f72e6862944ba75f1213",name:"topbar"})))}handleCloseNavbar(){this._show=!1}handleOpenNavbar(){this._show=!0}static get style(){return".w-full{width:100%}.max-h-screen-safe{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))}*{box-sizing:border-box}:host{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));width:100%;.safe-sidebar{padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important;&.show{--tw-translate-x:env(safe-area-inset-left,0)!important}}.safe-topbar{height:calc(env(safe-area-inset-top, 0) + 4rem);padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}}@media (min-width:80rem){:host{width:15rem}}@media (min-width:105rem){:host{width:18rem}}@media (min-width:80rem){.layout-1280\\:w-60{width:15rem}}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-navbar{z-index:300}.z-navbar-backdrop{z-index:290}.z-navbar-topbar{z-index:280}.mt-auto{margin-top:auto}.flex{display:flex}.hidden{display:none}.h-screen{height:100vh}.w-60{width:15rem}.max-w-\\[16\\.5rem\\]{max-width:16.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-6{gap:1.5rem}.overflow-y-auto{overflow-y:auto}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform{will-change:transform}@media (min-width:80rem){.layout-1280\\:relative{position:relative}.layout-1280\\:z-0{z-index:0}.layout-1280\\:flex{display:flex}.layout-1280\\:hidden{display:none}.layout-1280\\:h-full{height:100%}.layout-1280\\:max-w-none{max-width:none}.layout-1280\\:translate-x-0{--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}.dark\\:border-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(54 60 70/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:border-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(54 60 70/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}"}},[769,"p-navbar",{_show:[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]),m=w,h=function(){"undefined"!=typeof customElements&&["p-navbar","p-backdrop","p-button","p-icon","p-loader"].forEach((e=>{switch(e){case"p-navbar":customElements.get(r(e))||customElements.define(r(e),w);break;case"p-backdrop":customElements.get(r(e))||n();break;case"p-button":customElements.get(r(e))||s();break;case"p-icon":customElements.get(r(e))||l();break;case"p-loader":customElements.get(r(e))||c()}}))};export{m as PNavbar,h as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as p}from"./p-BkkPm9Yp.js";const s=o,m=p;export{s as PPaginationPages,m as defineCustomElement}
1
+ import{P as o,d as r}from"./p-SggF_Jar.js";const s=o,a=r;export{s as PPaginationPages,a as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as s}from"./p-iMCMxc-_.js";const p=o,r=s;export{p as PPagination,r as defineCustomElement}
1
+ import{P as o,d as r}from"./p-BQNrSoo9.js";const s=o,p=r;export{s as PPagination,p as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,h as o,t as a}from"./p-mR4MYqqI.js";import{c as s}from"./p-CBWjHURv.js";import{T as r}from"./p-C1fCuFhI.js";import{d as i}from"./p-DPtX6elD.js";import{d as n}from"./p-CNMa-_yN.js";import{d as p}from"./p-Cmsf0PX2.js";import{d as l}from"./p-DfBWP1bt.js";import{d}from"./p--JxtpGtF.js";const m=s(["flex gap-2 items-center flex-1 min-w-0"],{variants:{dropdown:{false:"h-10 py-1",true:null}}}),c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}dropdownLocation="bottom-end";get _el(){return this}_dropdownOpen=!1;_hasDropdownSlot=!1;componentWillLoad(){this._checkDropdownSlot()}componentWillRender(){this._updateAvatar()}render(){const t=this._getContent();return o(r,{key:"d8b3c59997be743df436a92d272715015d2e876d"},this._hasDropdownSlot?o("p-dropdown",{strategy:"absolute",placement:this.dropdownLocation,applyFullWidth:!0,applyMaxWidth:!1,onIsOpen:t=>this._dropdownOpen=t.detail},o("p-button",{variant:"dropdown",chevron:this._dropdownOpen?"up":"down",active:this._dropdownOpen,slot:"trigger",size:"lg",class:"w-full"},t),o("div",{slot:"items"},o("slot",{name:"dropdown",onSlotchange:()=>this._checkDropdownSlot()}))):t)}slotchange(){this._checkDropdownSlot()}_checkDropdownSlot(){this._hasDropdownSlot=!!this._el.querySelector(':scope > [slot="dropdown"]'),!this._hasDropdownSlot&&this._dropdownOpen&&(this._dropdownOpen=!1)}_getContent(){return o("div",{class:m({dropdown:this._hasDropdownSlot})},o("slot",{name:"avatar"}),o("div",{class:"flex min-w-0 flex-1 flex-col items-start"},o("p",{class:"my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-storm-500 dark:text-white"},o("slot",{name:"title"})),o("p",{class:"my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs font-medium text-storm-400 dark:text-hurricane-200"},o("slot",{name:"subtitle"}))),o("slot",{name:"post-title"}))}_updateAvatar(){const t=this._el.querySelector('p-avatar[slot="avatar"]');t&&(t.size=this._hasDropdownSlot?"sm":t.size)}static get style(){return"*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.my-0{margin-bottom:0;margin-top:0}.flex{display:flex}.h-10{height:2.5rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[769,"p-profile",{dropdownLocation:[1,"dropdown-location"],_dropdownOpen:[32],_hasDropdownSlot:[32]},[[0,"slotchange","slotchange"]]]),h=c,w=function(){"undefined"!=typeof customElements&&["p-profile","p-button","p-dropdown","p-dropdown-menu-container","p-icon","p-loader"].forEach((t=>{switch(t){case"p-profile":customElements.get(a(t))||customElements.define(a(t),c);break;case"p-button":customElements.get(a(t))||i();break;case"p-dropdown":customElements.get(a(t))||n();break;case"p-dropdown-menu-container":customElements.get(a(t))||p();break;case"p-icon":customElements.get(a(t))||l();break;case"p-loader":customElements.get(a(t))||d()}}))};export{h as PProfile,w as defineCustomElement}
1
+ import{p as t,H as e,h as o,t as a}from"./p-mR4MYqqI.js";import{c as s}from"./p-CBWjHURv.js";import{T as r}from"./p-C1fCuFhI.js";import{d as i}from"./p-BvUfWfx-.js";import{d as n}from"./p-CNMa-_yN.js";import{d as p}from"./p-Cmsf0PX2.js";import{d as l}from"./p-DfBWP1bt.js";import{d}from"./p--JxtpGtF.js";const m=s(["flex gap-2 items-center flex-1 min-w-0"],{variants:{dropdown:{false:"h-10 py-1",true:null}}}),c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}dropdownLocation="bottom-end";get _el(){return this}_dropdownOpen=!1;_hasDropdownSlot=!1;componentWillLoad(){this._checkDropdownSlot()}componentWillRender(){this._updateAvatar()}render(){const t=this._getContent();return o(r,{key:"d8b3c59997be743df436a92d272715015d2e876d"},this._hasDropdownSlot?o("p-dropdown",{strategy:"absolute",placement:this.dropdownLocation,applyFullWidth:!0,applyMaxWidth:!1,onIsOpen:t=>this._dropdownOpen=t.detail},o("p-button",{variant:"dropdown",chevron:this._dropdownOpen?"up":"down",active:this._dropdownOpen,slot:"trigger",size:"lg",class:"w-full"},t),o("div",{slot:"items"},o("slot",{name:"dropdown",onSlotchange:()=>this._checkDropdownSlot()}))):t)}slotchange(){this._checkDropdownSlot()}_checkDropdownSlot(){this._hasDropdownSlot=!!this._el.querySelector(':scope > [slot="dropdown"]'),!this._hasDropdownSlot&&this._dropdownOpen&&(this._dropdownOpen=!1)}_getContent(){return o("div",{class:m({dropdown:this._hasDropdownSlot})},o("slot",{name:"avatar"}),o("div",{class:"flex min-w-0 flex-1 flex-col items-start"},o("p",{class:"my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-storm-500 dark:text-white"},o("slot",{name:"title"})),o("p",{class:"my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs font-medium text-storm-400 dark:text-hurricane-200"},o("slot",{name:"subtitle"}))),o("slot",{name:"post-title"}))}_updateAvatar(){const t=this._el.querySelector('p-avatar[slot="avatar"]');t&&(t.size=this._hasDropdownSlot?"sm":t.size)}static get style(){return"*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.my-0{margin-bottom:0;margin-top:0}.flex{display:flex}.h-10{height:2.5rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[769,"p-profile",{dropdownLocation:[1,"dropdown-location"],_dropdownOpen:[32],_hasDropdownSlot:[32]},[[0,"slotchange","slotchange"]]]),h=c,w=function(){"undefined"!=typeof customElements&&["p-profile","p-button","p-dropdown","p-dropdown-menu-container","p-icon","p-loader"].forEach((t=>{switch(t){case"p-profile":customElements.get(a(t))||customElements.define(a(t),c);break;case"p-button":customElements.get(a(t))||i();break;case"p-dropdown":customElements.get(a(t))||n();break;case"p-dropdown-menu-container":customElements.get(a(t))||p();break;case"p-icon":customElements.get(a(t))||l();break;case"p-loader":customElements.get(a(t))||d()}}))};export{h as PProfile,w as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as i,h as s,t as a}from"./p-mR4MYqqI.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-C1fCuFhI.js";import{a as h,d as l}from"./p-CNMa-_yN.js";import{c as n}from"./p-xs4N_Y-0.js";import{S as c}from"./p-CEaB2BT0.js";import{d}from"./p-BwD4wr14.js";import{d as p}from"./p-DPtX6elD.js";import{d as m}from"./p-D08B3cFE.js";import{d as u}from"./p-Cmsf0PX2.js";import{d as w}from"./p-CGFPlslj.js";import{d as x}from"./p-BY-iZ7C8.js";import{d as y}from"./p-BBpjifjG.js";import{d as g}from"./p-DoDhkUVy.js";import{d as f}from"./p-DfBWP1bt.js";import{d as v}from"./p--JxtpGtF.js";import{d as b}from"./p-2ng-Aose.js";const k=r(["flex items-center gap-2","flex-1 min-w-0 h-full","pointer-events-none overflow-hidden"]),C=r(["item group/item","pointer-events-auto cursor-pointer","flex h-[1.625rem] items-center gap-2","h-[1.625rem] px-2","text-sm font-semibold whitespace-nowrap","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"text-storm-400 dark:text-white",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"text-negative-red-700 dark:text-negative-red-alternative group-hover/button:text-negative-red-800",false:null}}}),I=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=i(this,"queryChange",3),this.valueChange=i(this,"valueChange",3),this.selectAllChange=i(this,"selectAllChange",3),this.dropdownShown=i(this,"dropdownShown",3),this.add=i(this,"add",3),this._internals=this.attachInternals()}items;multi;strategy="absolute";icon;query;placeholder;autocompletePlaceholder="Search...";value;displayKey="text";dropdownDisplayKey;selectionDisplayKey;valueKey;avatarKey;iconKey="icon";iconClassKey="iconClass";showIconOnSelectedItem;classKey="class";applyClassOnSelectedItem;applyClassOnSelectedItemInMenu;avatarLettersKey;identifierKey;queryKey;autoSelectFirst=!0;showChevron=!0;maxDisplayedItems=c;enableAutocomplete=!0;enableTextWrap=!1;asyncFilter=!1;loading=!1;enableSelectAll=!1;selectAllText="Select all";selectAllIcon;queryChange;valueChange;selectAllChange;dropdownShown;size="base";prefix;label;helper;required=!0;showOptional=!0;error;disabled=!1;showAddItem=!1;addItemText="Add item";add;emptyStateText="No items available";get _el(){return this}_showDropdown=!1;_selectedItem=null;_allSelected=!1;_amountHidden=0;_internals;_inputRef;autocompleteInputRef;_multiContainerRef;_resizeObserver;_resizeDebounceTimer;_checkSelectedItemsTimeout;get _items(){return this._getParsedItems()}get _displayValue(){const t=s("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:s("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>s("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],s("p-icon",{class:"text-xs text-indigo-500 group-hover/item:text-indigo-800 dark:text-white/15 dark:group-hover/item:text-white",variant:"negative"})))),s("div",{class:"extra pointer-events-none hidden text-sm text-storm-100"},"+",this._amountHidden)):this._getDisplay(this._selectedItem,!0):t}get _identifierKey(){return this.identifierKey??this.valueKey??"value"}formResetCallback(){this._selectValue(null)}componentDidLoad(){if(!this.valueKey&&!this.identifierKey)throw Error("You must provide a valueKey or identifierKey");this.multi&&(this._setMultiContainerMaxWidth(),this._resizeObserver=new ResizeObserver((()=>{this._resizeDebounceTimer&&(clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=null),this._resizeDebounceTimer=setTimeout((()=>{this._setMultiContainerMaxWidth(),this._setCheckSelectedItemsTimeout()}),200)})),this._resizeObserver.observe(this._el)),this.value?this._valueChange():this.itemChanges()}componentDidRender(){this.multi&&this._setMultiContainerMaxWidth()}disconnectedCallback(){this.multi&&this._resizeObserver.disconnect()}render(){let t=this.icon;return this._selectedItem&&!this.avatarKey&&this.iconKey&&this._selectedItem?.[this.iconKey]&&!this.showIconOnSelectedItem&&(t=this._selectedItem[this.iconKey]),(this.avatarKey&&this._selectedItem?.[this.avatarKey]||this.avatarLettersKey&&this._selectedItem?.[this.avatarLettersKey])&&(t=null),this.error?.length&&(t="warning"),s(o,{key:"617063ca6cf31255928f6f6856cb1902b1d225a2"},s("p-field-container",{key:"4a6d95f7bfbc79b886044f2fe31695990b4e210d",variant:"write",prefix:this.prefix,label:this.label,helper:this.helper,required:this.required,showOptional:this.showOptional,error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown},s("p-dropdown",{key:"a505febe8197f86f5e43ffa71f99c4b72cd2d8aa",applyFullWidth:!0,applyMaxWidth:!1,slot:"content",insideClick:!0,manual:!0,scrollable:!this.enableAutocomplete||"large","disable-trigger-click":this.disabled,show:this._showDropdown,onIsOpen:t=>this._onDropdownOpen(t),strategy:this.strategy},s("p-button",{key:"fd28bc0407580787fdb73d87dc3f282c78db0cd4",slot:"trigger",class:"w-full",variant:"secondary",size:this.size,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),active:this._showDropdown,error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],onClick:t=>this._onClick(t)},s("div",{key:"bd68cd902b3b2c09c7f0810aab598fb12b06e84f",class:"relative min-w-0 flex-1",ref:t=>this._inputRef=t},this._displayValue)),this.loading?this._getLoadingItems():this._getItems(),this.showAddItem&&this._getAddItem())))}documentClickHandler(t){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_valueChange(){setTimeout((()=>{this._preselectItem(),this._setCheckSelectedItemsTimeout()}))}itemChanges(){setTimeout((()=>this._preselectItem()))}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}multiChanges(){this._selectedItem&&!Array.isArray(this._selectedItem)&&(this._selectedItem=[])}_preselectItem(){let t="string"==typeof this.value&&this.multi?JSON.parse(this.value):this.value;if(this.multi)return Array.isArray(t)?(this.value=t,0===t.length?void(this._selectedItem=[]):void(this._selectedItem=this.valueKey&&"false"!==this.valueKey?this._items.filter((e=>t.includes(e?.[this.valueKey]))):[...t])):(this.value=[],void this.valueChange.emit(this.value));this._selectedItem||t||!this.autoSelectFirst||(t=this._items[0]);const e="object"==typeof t&&null!==t?t[this._identifierKey]:t,i="string"==typeof e||"number"==typeof e?e:JSON.stringify(e),s=this._selectedItem?this._selectedItem?.[this._identifierKey]:null,a="string"==typeof s||"number"==typeof s?s:JSON.stringify(s);if(this._selectedItem&&a===i)return;if(!this._items?.length&&t)return void this._selectValue(t,!1);const r=this._getParsedItems(!1).find((t=>{const e=t?.[this._identifierKey];return("string"==typeof e||"number"==typeof e?e:JSON.stringify(e))===i}));this._selectValue(r??t,!1)}_selectValue(t,e=!0){let i=this.valueKey&&"false"!==this.valueKey&&null!==t&&!this.loading?t?.[this.valueKey]:t;if(this.multi){this._selectedItem&&Array.isArray(this._selectedItem)||(this._selectedItem=[]),this.value&&Array.isArray(this.value)||(this.value=[]);const e=[...this._selectedItem],s=[...this.value],a=e.findIndex((e=>e[this._identifierKey]===t[this._identifierKey]));return-1===a?(e.push(t),s.push(i)):(e.splice(a,1),s.splice(a,1)),this._selectedItem=e,this.value=s,void this.valueChange.emit(s)}this._selectedItem=t,this._onBlur(e),i!==this.value&&(this.value=i,this.valueChange.emit(i))}_onClick(t){const e=t?.composedPath();for(const t of e){if("p-button"===t.nodeName.toLowerCase())break;if(t.classList?.contains("item"))return}this._showDropdown=!this._showDropdown}_onBlur(t=!1){this.enableAutocomplete&&!t||(this._showDropdown=!1)}_onAutoComplete(t){this.enableAutocomplete&&(this._showDropdown=!0,this.query=t.detail,this.queryChange.emit(t.detail))}_checkvalue(t,e){return e?.[t]?.toString()?.toLowerCase().indexOf(this.query?.toLowerCase())>=0}_getItems(){let t=this._items.map((t=>{const e=this.multi&&this._selectedItem&&Array.isArray(this._selectedItem)?this._selectedItem.some((e=>e[this._identifierKey]===t[this._identifierKey])):t[this._identifierKey]===this._selectedItem?.[this._identifierKey];return s("p-dropdown-menu-item",{enableTextWrap:this.enableTextWrap,useContainer:!1,onClick:()=>this._selectValue(t),active:e,checkbox:!!this.multi,slot:"items"},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[s("p",{class:"w-full p-2 text-center text-sm text-storm-400 dark:text-hurricane-200",slot:"items"},this.emptyStateText)]),this.enableSelectAll&&this._items.length>0&&t.unshift(s("p-dropdown-menu-item",{slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange(),active:this._allSelected},this.selectAllIcon?.length?s("span",{class:"flex items-center gap-2"},s("div",{class:"flex w-6 justify-center text-lg"},s("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return s("p-dropdown-menu-item",{onClick:()=>this.add.emit(),useContainer:!1,slot:"items"},s("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,s("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>s("p-dropdown-menu-item",{enableHover:!1,slot:"items"},s("p-loader",{variant:"ghost",class:"h-6 w-full rounded"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return s("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},s("p-field",{class:"block",placeholder:this.autocompletePlaceholder,onValueChange:t=>this._onAutoComplete(t),onInputRefChange:t=>this.autocompleteInputRef=t.detail,value:this.query}))}_setMultiContainerMaxWidth(){this._inputRef&&this._multiContainerRef&&(this._multiContainerRef.style.maxWidth=Math.max(this._inputRef.clientWidth-16,16)+"px")}_setCheckSelectedItemsTimeout(){this._checkSelectedItemsTimeout&&clearTimeout(this._checkSelectedItemsTimeout),this._checkSelectedItemsTimeout=setTimeout((()=>this._checkSelectedItems()),50)}_checkSelectedItems(){if(!this._multiContainerRef)return;const t=this._multiContainerRef.getBoundingClientRect(),e=this._multiContainerRef.querySelectorAll(".item");let i=0;for(const s of e)s.classList.remove("hidden"),s.classList.add("flex"),s.getBoundingClientRect().right>t.right&&(s.classList.remove("flex"),s.classList.add("hidden"),i++);this._amountHidden=i;const s=this._multiContainerRef.querySelector(".extra");s&&(s.classList.contains("hidden")||s.classList.add("hidden"),i>0&&s.classList.remove("hidden"))}_onDropdownOpen(t){t.detail&&this.autocompleteInputRef&&setTimeout((()=>this.autocompleteInputRef.focus()),100)}_selectAllChange(){this._allSelected=!this._allSelected,this.selectAllChange.emit(this._allSelected)}_getDisplay(t,e=!1,i=!1){let a=s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(a=s("span",{class:"flex items-center gap-2"},s("p-avatar",{size:"sm",src:t[this.avatarKey],letters:t[this.avatarLettersKey]}),s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(a=s("span",{class:"flex items-center gap-2"},t[this.iconKey]&&s("p-icon",{class:n("text-storm-300 dark:text-hurricane-200",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu||!t?.[this.classKey]?.length?a:s("div",{class:t[this.classKey]},a)}_getParsedItems(t=!0){if(!this.items||this.loading)return[];let e="string"==typeof this.items?JSON.parse(this.items):this.items;return"string"==typeof e?.[0]&&(this.displayKey="text",this.valueKey="value",e=e.map((t=>({value:t,text:t})))),this.query?.length&&!this.asyncFilter&&(e=e.filter((t=>this.queryKey?this._checkvalue(this.queryKey,t):this._checkvalue(this._identifierKey,t)||this._checkvalue(this.displayKey,t)))),t?e?.slice(0,this.maxDisplayedItems):e}static get formAssociated(){return!0}static get watchers(){return{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}}static get style(){return"*{box-sizing:border-box}:host{--tw-translate-y:0px!important;--tw-translate-x:0px!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mb-3{margin-bottom:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[1\\.625rem\\]{height:1.625rem}.h-full{height:100%}.w-6{width:1.5rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-start{text-align:start}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-indigo-500{--tw-text-opacity:1;color:rgb(142 179 251/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-negative-red-700{--tw-text-opacity:1;color:rgb(147 16 16/var(--tw-text-opacity,1))}.text-storm-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group\\/button:hover .group-hover\\/button\\:text-negative-red-800{--tw-text-opacity:1;color:rgb(141 16 16/var(--tw-text-opacity,1))}.group\\/item:hover .group-hover\\/item\\:text-indigo-800{--tw-text-opacity:1;color:rgb(27 88 210/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[576,"p-select",{items:[1],multi:[516],strategy:[1],icon:[1],query:[1],placeholder:[1],autocompletePlaceholder:[1,"autocomplete-placeholder"],value:[8],displayKey:[1,"display-key"],dropdownDisplayKey:[1,"dropdown-display-key"],selectionDisplayKey:[1,"selection-display-key"],valueKey:[1,"value-key"],avatarKey:[1,"avatar-key"],iconKey:[1,"icon-key"],iconClassKey:[1,"icon-class-key"],showIconOnSelectedItem:[1,"show-icon-on-selected-item"],classKey:[1,"class-key"],applyClassOnSelectedItem:[4,"apply-class-on-selected-item"],applyClassOnSelectedItemInMenu:[4,"apply-class-on-selected-item-in-menu"],avatarLettersKey:[1,"avatar-letters-key"],identifierKey:[1,"identifier-key"],queryKey:[1,"query-key"],autoSelectFirst:[4,"auto-select-first"],showChevron:[4,"show-chevron"],maxDisplayedItems:[2,"max-displayed-items"],enableAutocomplete:[4,"enable-autocomplete"],enableTextWrap:[4,"enable-text-wrap"],asyncFilter:[4,"async-filter"],loading:[4],enableSelectAll:[4,"enable-select-all"],selectAllText:[1,"select-all-text"],selectAllIcon:[1,"select-all-icon"],size:[1],prefix:[1],label:[1],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],showAddItem:[4,"show-add-item"],addItemText:[1,"add-item-text"],emptyStateText:[1,"empty-state-text"],_showDropdown:[32],_selectedItem:[32],_allSelected:[32],_amountHidden:[32]},[[6,"click","documentClickHandler"]],{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}]),S=I,T=function(){"undefined"!=typeof customElements&&["p-select","p-avatar","p-button","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((t=>{switch(t){case"p-select":customElements.get(a(t))||customElements.define(a(t),I);break;case"p-avatar":customElements.get(a(t))||d();break;case"p-button":customElements.get(a(t))||p();break;case"p-checkbox":customElements.get(a(t))||m();break;case"p-dropdown":customElements.get(a(t))||l();break;case"p-dropdown-menu-container":customElements.get(a(t))||u();break;case"p-dropdown-menu-item":customElements.get(a(t))||w();break;case"p-field":customElements.get(a(t))||x();break;case"p-field-container":customElements.get(a(t))||y();break;case"p-helper":customElements.get(a(t))||g();break;case"p-icon":customElements.get(a(t))||f();break;case"p-loader":customElements.get(a(t))||v();break;case"p-tooltip":customElements.get(a(t))||b()}}))};export{S as PSelect,T as defineCustomElement}
1
+ import{p as t,H as e,c as i,h as s,t as a}from"./p-mR4MYqqI.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-C1fCuFhI.js";import{a as h,d as l}from"./p-CNMa-_yN.js";import{c as n}from"./p-xs4N_Y-0.js";import{S as c}from"./p-CEaB2BT0.js";import{d}from"./p-BwD4wr14.js";import{d as p}from"./p-BvUfWfx-.js";import{d as m}from"./p-D08B3cFE.js";import{d as u}from"./p-Cmsf0PX2.js";import{d as w}from"./p-CGFPlslj.js";import{d as x}from"./p-BqgXqvox.js";import{d as y}from"./p-BBpjifjG.js";import{d as g}from"./p-DoDhkUVy.js";import{d as f}from"./p-DfBWP1bt.js";import{d as v}from"./p--JxtpGtF.js";import{d as b}from"./p-2ng-Aose.js";const k=r(["flex items-center gap-2","flex-1 min-w-0 h-full","pointer-events-none overflow-hidden"]),C=r(["item group/item","pointer-events-auto cursor-pointer","flex h-[1.625rem] items-center gap-2","h-[1.625rem] px-2","text-sm font-semibold whitespace-nowrap","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"text-storm-400 dark:text-white",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"text-negative-red-700 dark:text-negative-red-alternative group-hover/button:text-negative-red-800",false:null}}}),I=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=i(this,"queryChange",3),this.valueChange=i(this,"valueChange",3),this.selectAllChange=i(this,"selectAllChange",3),this.dropdownShown=i(this,"dropdownShown",3),this.add=i(this,"add",3),this._internals=this.attachInternals()}items;multi;strategy="absolute";icon;query;placeholder;autocompletePlaceholder="Search...";value;displayKey="text";dropdownDisplayKey;selectionDisplayKey;valueKey;avatarKey;iconKey="icon";iconClassKey="iconClass";showIconOnSelectedItem;classKey="class";applyClassOnSelectedItem;applyClassOnSelectedItemInMenu;avatarLettersKey;identifierKey;queryKey;autoSelectFirst=!0;showChevron=!0;maxDisplayedItems=c;enableAutocomplete=!0;enableTextWrap=!1;asyncFilter=!1;loading=!1;enableSelectAll=!1;selectAllText="Select all";selectAllIcon;queryChange;valueChange;selectAllChange;dropdownShown;size="base";prefix;label;helper;required=!0;showOptional=!0;error;disabled=!1;showAddItem=!1;addItemText="Add item";add;emptyStateText="No items available";get _el(){return this}_showDropdown=!1;_selectedItem=null;_allSelected=!1;_amountHidden=0;_internals;_inputRef;autocompleteInputRef;_multiContainerRef;_resizeObserver;_resizeDebounceTimer;_checkSelectedItemsTimeout;get _items(){return this._getParsedItems()}get _displayValue(){const t=s("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:s("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>s("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],s("p-icon",{class:"text-xs text-indigo-500 group-hover/item:text-indigo-800 dark:text-white/15 dark:group-hover/item:text-white",variant:"negative"})))),s("div",{class:"extra pointer-events-none hidden text-sm text-storm-100"},"+",this._amountHidden)):this._getDisplay(this._selectedItem,!0):t}get _identifierKey(){return this.identifierKey??this.valueKey??"value"}formResetCallback(){this._selectValue(null)}componentDidLoad(){if(!this.valueKey&&!this.identifierKey)throw Error("You must provide a valueKey or identifierKey");this.multi&&(this._setMultiContainerMaxWidth(),this._resizeObserver=new ResizeObserver((()=>{this._resizeDebounceTimer&&(clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=null),this._resizeDebounceTimer=setTimeout((()=>{this._setMultiContainerMaxWidth(),this._setCheckSelectedItemsTimeout()}),200)})),this._resizeObserver.observe(this._el)),this.value?this._valueChange():this.itemChanges()}componentDidRender(){this.multi&&this._setMultiContainerMaxWidth()}disconnectedCallback(){this.multi&&this._resizeObserver.disconnect()}render(){let t=this.icon;return this._selectedItem&&!this.avatarKey&&this.iconKey&&this._selectedItem?.[this.iconKey]&&!this.showIconOnSelectedItem&&(t=this._selectedItem[this.iconKey]),(this.avatarKey&&this._selectedItem?.[this.avatarKey]||this.avatarLettersKey&&this._selectedItem?.[this.avatarLettersKey])&&(t=null),this.error?.length&&(t="warning"),s(o,{key:"617063ca6cf31255928f6f6856cb1902b1d225a2"},s("p-field-container",{key:"4a6d95f7bfbc79b886044f2fe31695990b4e210d",variant:"write",prefix:this.prefix,label:this.label,helper:this.helper,required:this.required,showOptional:this.showOptional,error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown},s("p-dropdown",{key:"a505febe8197f86f5e43ffa71f99c4b72cd2d8aa",applyFullWidth:!0,applyMaxWidth:!1,slot:"content",insideClick:!0,manual:!0,scrollable:!this.enableAutocomplete||"large","disable-trigger-click":this.disabled,show:this._showDropdown,onIsOpen:t=>this._onDropdownOpen(t),strategy:this.strategy},s("p-button",{key:"fd28bc0407580787fdb73d87dc3f282c78db0cd4",slot:"trigger",class:"w-full",variant:"secondary",size:this.size,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),active:this._showDropdown,error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],onClick:t=>this._onClick(t)},s("div",{key:"bd68cd902b3b2c09c7f0810aab598fb12b06e84f",class:"relative min-w-0 flex-1",ref:t=>this._inputRef=t},this._displayValue)),this.loading?this._getLoadingItems():this._getItems(),this.showAddItem&&this._getAddItem())))}documentClickHandler(t){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_valueChange(){setTimeout((()=>{this._preselectItem(),this._setCheckSelectedItemsTimeout()}))}itemChanges(){setTimeout((()=>this._preselectItem()))}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}multiChanges(){this._selectedItem&&!Array.isArray(this._selectedItem)&&(this._selectedItem=[])}_preselectItem(){let t="string"==typeof this.value&&this.multi?JSON.parse(this.value):this.value;if(this.multi)return Array.isArray(t)?(this.value=t,0===t.length?void(this._selectedItem=[]):void(this._selectedItem=this.valueKey&&"false"!==this.valueKey?this._items.filter((e=>t.includes(e?.[this.valueKey]))):[...t])):(this.value=[],void this.valueChange.emit(this.value));this._selectedItem||t||!this.autoSelectFirst||(t=this._items[0]);const e="object"==typeof t&&null!==t?t[this._identifierKey]:t,i="string"==typeof e||"number"==typeof e?e:JSON.stringify(e),s=this._selectedItem?this._selectedItem?.[this._identifierKey]:null,a="string"==typeof s||"number"==typeof s?s:JSON.stringify(s);if(this._selectedItem&&a===i)return;if(!this._items?.length&&t)return void this._selectValue(t,!1);const r=this._getParsedItems(!1).find((t=>{const e=t?.[this._identifierKey];return("string"==typeof e||"number"==typeof e?e:JSON.stringify(e))===i}));this._selectValue(r??t,!1)}_selectValue(t,e=!0){let i=this.valueKey&&"false"!==this.valueKey&&null!==t&&!this.loading?t?.[this.valueKey]:t;if(this.multi){this._selectedItem&&Array.isArray(this._selectedItem)||(this._selectedItem=[]),this.value&&Array.isArray(this.value)||(this.value=[]);const e=[...this._selectedItem],s=[...this.value],a=e.findIndex((e=>e[this._identifierKey]===t[this._identifierKey]));return-1===a?(e.push(t),s.push(i)):(e.splice(a,1),s.splice(a,1)),this._selectedItem=e,this.value=s,void this.valueChange.emit(s)}this._selectedItem=t,this._onBlur(e),i!==this.value&&(this.value=i,this.valueChange.emit(i))}_onClick(t){const e=t?.composedPath();for(const t of e){if("p-button"===t.nodeName.toLowerCase())break;if(t.classList?.contains("item"))return}this._showDropdown=!this._showDropdown}_onBlur(t=!1){this.enableAutocomplete&&!t||(this._showDropdown=!1)}_onAutoComplete(t){this.enableAutocomplete&&(this._showDropdown=!0,this.query=t.detail,this.queryChange.emit(t.detail))}_checkvalue(t,e){return e?.[t]?.toString()?.toLowerCase().indexOf(this.query?.toLowerCase())>=0}_getItems(){let t=this._items.map((t=>{const e=this.multi&&this._selectedItem&&Array.isArray(this._selectedItem)?this._selectedItem.some((e=>e[this._identifierKey]===t[this._identifierKey])):t[this._identifierKey]===this._selectedItem?.[this._identifierKey];return s("p-dropdown-menu-item",{enableTextWrap:this.enableTextWrap,useContainer:!1,onClick:()=>this._selectValue(t),active:e,checkbox:!!this.multi,slot:"items"},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[s("p",{class:"w-full p-2 text-center text-sm text-storm-400 dark:text-hurricane-200",slot:"items"},this.emptyStateText)]),this.enableSelectAll&&this._items.length>0&&t.unshift(s("p-dropdown-menu-item",{slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange(),active:this._allSelected},this.selectAllIcon?.length?s("span",{class:"flex items-center gap-2"},s("div",{class:"flex w-6 justify-center text-lg"},s("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return s("p-dropdown-menu-item",{onClick:()=>this.add.emit(),useContainer:!1,slot:"items"},s("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,s("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>s("p-dropdown-menu-item",{enableHover:!1,slot:"items"},s("p-loader",{variant:"ghost",class:"h-6 w-full rounded"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return s("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},s("p-field",{class:"block",placeholder:this.autocompletePlaceholder,onValueChange:t=>this._onAutoComplete(t),onInputRefChange:t=>this.autocompleteInputRef=t.detail,value:this.query}))}_setMultiContainerMaxWidth(){this._inputRef&&this._multiContainerRef&&(this._multiContainerRef.style.maxWidth=Math.max(this._inputRef.clientWidth-16,16)+"px")}_setCheckSelectedItemsTimeout(){this._checkSelectedItemsTimeout&&clearTimeout(this._checkSelectedItemsTimeout),this._checkSelectedItemsTimeout=setTimeout((()=>this._checkSelectedItems()),50)}_checkSelectedItems(){if(!this._multiContainerRef)return;const t=this._multiContainerRef.getBoundingClientRect(),e=this._multiContainerRef.querySelectorAll(".item");let i=0;for(const s of e)s.classList.remove("hidden"),s.classList.add("flex"),s.getBoundingClientRect().right>t.right&&(s.classList.remove("flex"),s.classList.add("hidden"),i++);this._amountHidden=i;const s=this._multiContainerRef.querySelector(".extra");s&&(s.classList.contains("hidden")||s.classList.add("hidden"),i>0&&s.classList.remove("hidden"))}_onDropdownOpen(t){t.detail&&this.autocompleteInputRef&&setTimeout((()=>this.autocompleteInputRef.focus()),100)}_selectAllChange(){this._allSelected=!this._allSelected,this.selectAllChange.emit(this._allSelected)}_getDisplay(t,e=!1,i=!1){let a=s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(a=s("span",{class:"flex items-center gap-2"},s("p-avatar",{size:"sm",src:t[this.avatarKey],letters:t[this.avatarLettersKey]}),s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(a=s("span",{class:"flex items-center gap-2"},t[this.iconKey]&&s("p-icon",{class:n("text-storm-300 dark:text-hurricane-200",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),s("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu||!t?.[this.classKey]?.length?a:s("div",{class:t[this.classKey]},a)}_getParsedItems(t=!0){if(!this.items||this.loading)return[];let e="string"==typeof this.items?JSON.parse(this.items):this.items;return"string"==typeof e?.[0]&&(this.displayKey="text",this.valueKey="value",e=e.map((t=>({value:t,text:t})))),this.query?.length&&!this.asyncFilter&&(e=e.filter((t=>this.queryKey?this._checkvalue(this.queryKey,t):this._checkvalue(this._identifierKey,t)||this._checkvalue(this.displayKey,t)))),t?e?.slice(0,this.maxDisplayedItems):e}static get formAssociated(){return!0}static get watchers(){return{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}}static get style(){return"*{box-sizing:border-box}:host{--tw-translate-y:0px!important;--tw-translate-x:0px!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mb-3{margin-bottom:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[1\\.625rem\\]{height:1.625rem}.h-full{height:100%}.w-6{width:1.5rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-start{text-align:start}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-indigo-500{--tw-text-opacity:1;color:rgb(142 179 251/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-negative-red-700{--tw-text-opacity:1;color:rgb(147 16 16/var(--tw-text-opacity,1))}.text-storm-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group\\/button:hover .group-hover\\/button\\:text-negative-red-800{--tw-text-opacity:1;color:rgb(141 16 16/var(--tw-text-opacity,1))}.group\\/item:hover .group-hover\\/item\\:text-indigo-800{--tw-text-opacity:1;color:rgb(27 88 210/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[576,"p-select",{items:[1],multi:[516],strategy:[1],icon:[1],query:[1],placeholder:[1],autocompletePlaceholder:[1,"autocomplete-placeholder"],value:[8],displayKey:[1,"display-key"],dropdownDisplayKey:[1,"dropdown-display-key"],selectionDisplayKey:[1,"selection-display-key"],valueKey:[1,"value-key"],avatarKey:[1,"avatar-key"],iconKey:[1,"icon-key"],iconClassKey:[1,"icon-class-key"],showIconOnSelectedItem:[1,"show-icon-on-selected-item"],classKey:[1,"class-key"],applyClassOnSelectedItem:[4,"apply-class-on-selected-item"],applyClassOnSelectedItemInMenu:[4,"apply-class-on-selected-item-in-menu"],avatarLettersKey:[1,"avatar-letters-key"],identifierKey:[1,"identifier-key"],queryKey:[1,"query-key"],autoSelectFirst:[4,"auto-select-first"],showChevron:[4,"show-chevron"],maxDisplayedItems:[2,"max-displayed-items"],enableAutocomplete:[4,"enable-autocomplete"],enableTextWrap:[4,"enable-text-wrap"],asyncFilter:[4,"async-filter"],loading:[4],enableSelectAll:[4,"enable-select-all"],selectAllText:[1,"select-all-text"],selectAllIcon:[1,"select-all-icon"],size:[1],prefix:[1],label:[1],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],showAddItem:[4,"show-add-item"],addItemText:[1,"add-item-text"],emptyStateText:[1,"empty-state-text"],_showDropdown:[32],_selectedItem:[32],_allSelected:[32],_amountHidden:[32]},[[6,"click","documentClickHandler"]],{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}]),S=I,T=function(){"undefined"!=typeof customElements&&["p-select","p-avatar","p-button","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((t=>{switch(t){case"p-select":customElements.get(a(t))||customElements.define(a(t),I);break;case"p-avatar":customElements.get(a(t))||d();break;case"p-button":customElements.get(a(t))||p();break;case"p-checkbox":customElements.get(a(t))||m();break;case"p-dropdown":customElements.get(a(t))||l();break;case"p-dropdown-menu-container":customElements.get(a(t))||u();break;case"p-dropdown-menu-item":customElements.get(a(t))||w();break;case"p-field":customElements.get(a(t))||x();break;case"p-field-container":customElements.get(a(t))||y();break;case"p-helper":customElements.get(a(t))||g();break;case"p-icon":customElements.get(a(t))||f();break;case"p-loader":customElements.get(a(t))||v();break;case"p-tooltip":customElements.get(a(t))||b()}}))};export{S as PSelect,T as defineCustomElement}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-CFmYQoDA.js";const m=o,p=s;export{m as PTableFooter,p as defineCustomElement}
1
+ import{T as o,d as s}from"./p-CaN_dhnG.js";const a=o,p=s;export{a as PTableFooter,p as defineCustomElement}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-Bw7wEGKa.js";const a=o,p=s;export{a as PTableHeader,p as defineCustomElement}
1
+ import{T as o,d as s}from"./p-kAKe_qDq.js";const p=o,r=s;export{p as PTableHeader,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as i,h as s,d as o,t as a}from"./p-mR4MYqqI.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r,d as c}from"./p-Ch5U9kWZ.js";import{f as h}from"./p-CWO2YJCh.js";import{c as p}from"./p-xs4N_Y-0.js";import{P as m,a as d,T as u}from"./p-CEaB2BT0.js";import{d as b}from"./p-D-IyTfol.js";import{d as f}from"./p-DPtX6elD.js";import{d as g}from"./p-D08B3cFE.js";import{d as k}from"./p-CQaFushj.js";import{d as w}from"./p-CNMa-_yN.js";import{d as y}from"./p-Cmsf0PX2.js";import{d as S}from"./p-CGFPlslj.js";import{d as _}from"./p-C23JF7PQ.js";import{d as C}from"./p-BY-iZ7C8.js";import{d as x}from"./p-BBpjifjG.js";import{d as v}from"./p-CtHAbYCa.js";import{d as E}from"./p-CCufTu-v.js";import{d as F}from"./p-DoDhkUVy.js";import{d as A}from"./p-DfBWP1bt.js";import{d as j}from"./p-DqfNKkNq.js";import{d as R}from"./p--JxtpGtF.js";import{d as D}from"./p-iMCMxc-_.js";import{d as z}from"./p-BkkPm9Yp.js";import{d as T}from"./p-D5_UJJpn.js";import{d as B}from"./p-OF_TU9VQ.js";import{d as L}from"./p-DvzTP_tN.js";import{d as P}from"./p-h4mS749f.js";import{d as H}from"./p-B7T2fQYF.js";import{d as q}from"./p-CFmYQoDA.js";import{d as I}from"./p-Bw7wEGKa.js";import{d as O}from"./p-J_pAdYL8.js";import{d as Q}from"./p-Akpqyi53.js";import{d as M}from"./p-2ng-Aose.js";const U=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectedRowsChange=i(this,"selectedRowsChange",3),this.rowClick=i(this,"rowClick",3),this.rowSelected=i(this,"rowSelected",3),this.rowDeselected=i(this,"rowDeselected",3),this.hasRendered=i(this,"hasRendered",3),this.quickFilter=i(this,"quickFilter",3),this.queryChange=i(this,"queryChange",3),this.filter=i(this,"filter",3),this.action=i(this,"action",3),this.pageChange=i(this,"pageChange",3),this.pageSizeChange=i(this,"pageSizeChange",3),this.export=i(this,"export",3),this.emptyStateActionClick=i(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=m;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(o,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},s("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&s("p-table-header",{key:"9d49ef03a1b0c8b47e8292f36ade24a2eb0b3f7d",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"555237f446a654201d12321505062d4c4e06210c",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"4e935caf48c9cf1b0516a61ca9076a3755f98546",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"23816ab229344ba5a7c5cc02a358b277e5ff8da1",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"d3012e94582c06ca536db0ab83d1bd0df4d80c48",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:!0,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"3c5138a3af7594642a8e750d40524bc13f138892",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=h(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{variant:"header-secondary",isLast:!0},this._extraHeaders.map(((t,e)=>s("p-table-cell",{definition:t,variant:"header-secondary",checkboxOffset:0===e&&this._enableRowSelection,index:e},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!h()?s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":!0,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:!0,size:"sm",onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,o)=>s("p-table-cell",{definition:i,item:t,checkbox:0===o||i.hasCheckbox?this._getCheckbox(e):null,index:o,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"});if("header"===e)return s("p-checkbox",{class:p({"opacity-0":void 0!==this._rowSelectionLimit}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:void 0!==this._rowSelectionLimit,onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],o=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!o&&this.selectedRows.length===this._rowSelectionLimit,checked:o,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()}:{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const o=this._selectionContains(i,!0),a=[...this.selectedRows];a.splice(o,1),this.selectedRows=a,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]),Y=U,J=function(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((t=>{switch(t){case"p-table":customElements.get(a(t))||customElements.define(a(t),U);break;case"p-badge":customElements.get(a(t))||b();break;case"p-button":customElements.get(a(t))||f();break;case"p-checkbox":customElements.get(a(t))||g();break;case"p-divider":customElements.get(a(t))||k();break;case"p-dropdown":customElements.get(a(t))||w();break;case"p-dropdown-menu-container":customElements.get(a(t))||y();break;case"p-dropdown-menu-item":customElements.get(a(t))||S();break;case"p-empty-state":customElements.get(a(t))||_();break;case"p-field":customElements.get(a(t))||C();break;case"p-field-container":customElements.get(a(t))||x();break;case"p-floating-menu-container":customElements.get(a(t))||v();break;case"p-floating-menu-item":customElements.get(a(t))||E();break;case"p-helper":customElements.get(a(t))||F();break;case"p-icon":customElements.get(a(t))||A();break;case"p-illustration":customElements.get(a(t))||j();break;case"p-loader":customElements.get(a(t))||R();break;case"p-pagination":customElements.get(a(t))||D();break;case"p-pagination-pages":customElements.get(a(t))||z();break;case"p-pagination-pages-item":customElements.get(a(t))||T();break;case"p-pagination-size":customElements.get(a(t))||B();break;case"p-segment-container":customElements.get(a(t))||L();break;case"p-segment-item":customElements.get(a(t))||P();break;case"p-table-cell":customElements.get(a(t))||c();break;case"p-table-container":customElements.get(a(t))||H();break;case"p-table-footer":customElements.get(a(t))||q();break;case"p-table-header":customElements.get(a(t))||I();break;case"p-table-row":customElements.get(a(t))||O();break;case"p-table-row-actions-container":customElements.get(a(t))||Q();break;case"p-tooltip":customElements.get(a(t))||M()}}))};export{Y as PTable,J as defineCustomElement}
1
+ import{p as t,H as e,c as i,h as s,d as o,t as a}from"./p-mR4MYqqI.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r,d as c}from"./p-Ch5U9kWZ.js";import{f as h}from"./p-CWO2YJCh.js";import{c as p}from"./p-xs4N_Y-0.js";import{P as m,a as d,T as u}from"./p-CEaB2BT0.js";import{d as b}from"./p-D-IyTfol.js";import{d as f}from"./p-BvUfWfx-.js";import{d as g}from"./p-D08B3cFE.js";import{d as k}from"./p-CQaFushj.js";import{d as w}from"./p-CNMa-_yN.js";import{d as y}from"./p-Cmsf0PX2.js";import{d as S}from"./p-CGFPlslj.js";import{d as _}from"./p-PyPr6c8z.js";import{d as x}from"./p-BqgXqvox.js";import{d as C}from"./p-BBpjifjG.js";import{d as v}from"./p-CtHAbYCa.js";import{d as E}from"./p-CCufTu-v.js";import{d as F}from"./p-DoDhkUVy.js";import{d as A}from"./p-DfBWP1bt.js";import{d as j}from"./p-DqfNKkNq.js";import{d as R}from"./p--JxtpGtF.js";import{d as D}from"./p-BQNrSoo9.js";import{d as z}from"./p-SggF_Jar.js";import{d as T}from"./p-D5_UJJpn.js";import{d as B}from"./p-OF_TU9VQ.js";import{d as L}from"./p-DvzTP_tN.js";import{d as q}from"./p-h4mS749f.js";import{d as P}from"./p-B7T2fQYF.js";import{d as H}from"./p-CaN_dhnG.js";import{d as I}from"./p-kAKe_qDq.js";import{d as O}from"./p-J_pAdYL8.js";import{d as N}from"./p-Akpqyi53.js";import{d as Q}from"./p-2ng-Aose.js";const U=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectedRowsChange=i(this,"selectedRowsChange",3),this.rowClick=i(this,"rowClick",3),this.rowSelected=i(this,"rowSelected",3),this.rowDeselected=i(this,"rowDeselected",3),this.hasRendered=i(this,"hasRendered",3),this.quickFilter=i(this,"quickFilter",3),this.queryChange=i(this,"queryChange",3),this.filter=i(this,"filter",3),this.action=i(this,"action",3),this.pageChange=i(this,"pageChange",3),this.pageSizeChange=i(this,"pageSizeChange",3),this.export=i(this,"export",3),this.emptyStateActionClick=i(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=m;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(o,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},s("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&s("p-table-header",{key:"9d49ef03a1b0c8b47e8292f36ade24a2eb0b3f7d",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"555237f446a654201d12321505062d4c4e06210c",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"4e935caf48c9cf1b0516a61ca9076a3755f98546",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"23816ab229344ba5a7c5cc02a358b277e5ff8da1",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"d3012e94582c06ca536db0ab83d1bd0df4d80c48",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:!0,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"3c5138a3af7594642a8e750d40524bc13f138892",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=h(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{variant:"header-secondary",isLast:!0},this._extraHeaders.map(((t,e)=>s("p-table-cell",{definition:t,variant:"header-secondary",checkboxOffset:0===e&&this._enableRowSelection,index:e},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!h()?s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":!0,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:!0,size:"sm",onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,o)=>s("p-table-cell",{definition:i,item:t,checkbox:0===o||i.hasCheckbox?this._getCheckbox(e):null,index:o,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"});if("header"===e)return s("p-checkbox",{class:p({"opacity-0":void 0!==this._rowSelectionLimit}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:void 0!==this._rowSelectionLimit,onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],o=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!o&&this.selectedRows.length===this._rowSelectionLimit,checked:o,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()}:{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const o=this._selectionContains(i,!0),a=[...this.selectedRows];a.splice(o,1),this.selectedRows=a,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]),J=U,M=function(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((t=>{switch(t){case"p-table":customElements.get(a(t))||customElements.define(a(t),U);break;case"p-badge":customElements.get(a(t))||b();break;case"p-button":customElements.get(a(t))||f();break;case"p-checkbox":customElements.get(a(t))||g();break;case"p-divider":customElements.get(a(t))||k();break;case"p-dropdown":customElements.get(a(t))||w();break;case"p-dropdown-menu-container":customElements.get(a(t))||y();break;case"p-dropdown-menu-item":customElements.get(a(t))||S();break;case"p-empty-state":customElements.get(a(t))||_();break;case"p-field":customElements.get(a(t))||x();break;case"p-field-container":customElements.get(a(t))||C();break;case"p-floating-menu-container":customElements.get(a(t))||v();break;case"p-floating-menu-item":customElements.get(a(t))||E();break;case"p-helper":customElements.get(a(t))||F();break;case"p-icon":customElements.get(a(t))||A();break;case"p-illustration":customElements.get(a(t))||j();break;case"p-loader":customElements.get(a(t))||R();break;case"p-pagination":customElements.get(a(t))||D();break;case"p-pagination-pages":customElements.get(a(t))||z();break;case"p-pagination-pages-item":customElements.get(a(t))||T();break;case"p-pagination-size":customElements.get(a(t))||B();break;case"p-segment-container":customElements.get(a(t))||L();break;case"p-segment-item":customElements.get(a(t))||q();break;case"p-table-cell":customElements.get(a(t))||c();break;case"p-table-container":customElements.get(a(t))||P();break;case"p-table-footer":customElements.get(a(t))||H();break;case"p-table-header":customElements.get(a(t))||I();break;case"p-table-row":customElements.get(a(t))||O();break;case"p-table-row-actions-container":customElements.get(a(t))||N();break;case"p-tooltip":customElements.get(a(t))||Q()}}))};export{J as PTable,M as defineCustomElement}