@paperless/core 3.0.0 → 3.0.1

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 (30) hide show
  1. package/dist/build/{p-4ccf0ea2.entry.js → p-2937ea4e.entry.js} +1 -1
  2. package/dist/build/{p-99950bb2.js → p-57abbf5d.js} +1 -1
  3. package/dist/build/paperless.esm.js +1 -1
  4. package/dist/cjs/p-checkbox_3.cjs.entry.js +11 -8
  5. package/dist/collection/components/molecules/dropdown/dropdown.component.js +11 -8
  6. package/dist/components/{p-CzcyDhea.js → p-B4ldecyo.js} +1 -1
  7. package/dist/components/p-CFSNSi-H.js +1 -0
  8. package/dist/components/{p-COEYnacB.js → p-CKY-2A7w.js} +1 -1
  9. package/dist/components/{p-BfdNz0_n.js → p-Duu0fwUk.js} +1 -1
  10. package/dist/components/{p-DA6lXn-F.js → p-a6F6aMNs.js} +1 -1
  11. package/dist/components/p-datepicker.js +1 -1
  12. package/dist/components/p-dropdown.js +1 -1
  13. package/dist/components/p-pagination-pages.js +1 -1
  14. package/dist/components/p-pagination-size.js +1 -1
  15. package/dist/components/p-pagination.js +1 -1
  16. package/dist/components/p-profile.js +1 -1
  17. package/dist/components/p-select.js +1 -1
  18. package/dist/components/p-table-footer.js +1 -1
  19. package/dist/components/p-table.js +1 -1
  20. package/dist/esm/p-checkbox_3.entry.js +11 -8
  21. package/dist/index.html +1 -1
  22. package/dist/paperless/{p-4ccf0ea2.entry.js → p-2937ea4e.entry.js} +1 -1
  23. package/dist/paperless/paperless.esm.js +1 -1
  24. package/dist/sw.js +1 -1
  25. package/dist/sw.js.map +1 -1
  26. package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +1 -0
  27. package/hydrate/index.js +11 -8
  28. package/hydrate/index.mjs +11 -8
  29. package/package.json +1 -1
  30. package/dist/components/p-D9NAGtqV.js +0 -1
@@ -1 +1 @@
1
- import{t,p as r,H as e,c as a,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as s}from"./p-Au2WuEGF.js";import{f as d,g as n}from"./p-CwQG70_4.js";import{c as h}from"./p-xs4N_Y-0.js";import{P as w,a as g}from"./p-CEaB2BT0.js";import{a as c}from"./p-C5CTp9IA.js";import{d as p}from"./p-Cpwq0YdW.js";import{d as l}from"./p-D9NAGtqV.js";import{d as m}from"./p-Bl7NThUo.js";import{d as f}from"./p-Bqj-EqkF.js";import{d as b}from"./p-DLBcQv2y.js";const v=i("p-pagination-size",{variants:{hidden:{false:null,true:"hidden"}}}),x=i(["group/pagination-size-trigger","flex items-center gap-2","px-2 h-6","text-sm text-storm-500 font-medium ","dark:text-white","cursor-pointer rounded-full","shadow-1 border border-solid"],{variants:{active:{false:["bg-white hover:bg-white-600 border-transparent","dark:bg-white/15 dark:hover:bg-white/25"],true:["bg-white-600 border-indigo-600 ring ring-2 ring-indigo-100","dark:bg-white/25 dark:ring-0"]}}}),k=r(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.sizeChange=a(this,"sizeChange",3)}_defaultItemTemplate=t=>d(this._locales.item,{size:t});size=w;sizeOptions=g;sizeChange;itemTemplate=this._defaultItemTemplate;get _el(){return this}hidden=!1;dropdownIsOpen=!1;_locales={};componentWillLoad(){this._setLocales()}render(){return o(s,{key:"1062e4a018038b23e5514a50f9fa658b6fae7010",class:v({hidden:c(this.hidden)})},o("p-dropdown",{key:"521979380d535dcd911c26b881338ddaaf3e7344",applyFullWidth:!0,applyMaxWidth:!1,chevronDirection:"down",placement:"top-start",onIsOpen:({detail:t})=>this.dropdownIsOpen=t},o("div",{key:"81cdccac14a27636661d30889d5894a9fb5d7ce6",class:x({active:this.dropdownIsOpen}),slot:"trigger"},o("p",{key:"3477755b3365205fef5a3e3f8f465f0d1d41ddd1",class:"min-w-0 flex-1 overflow-hidden text-ellipsis text-nowrap"},this.itemTemplate?this.itemTemplate(this.size):this._defaultItemTemplate(this.size)),o("p-icon",{key:"f08b75643a97c86192e87893c80ad67b9cf61a9d",class:h(["flex-shrink-0","group-hover/pagination-size-trigger:text-storm-500","dark:group-hover/pagination-size-trigger:text-white"],{"text-storm-300 dark:text-hurricane-200":!this.dropdownIsOpen,"text-storm-500 dark:text-white":!!this.dropdownIsOpen}),size:"sm",variant:"double-caret"})),o("slot",{key:"4ac113bf401a0a3019c6430a58f5cfd8a153e5c4",slot:"items"},this.sizeOptions.map((t=>o("p-dropdown-menu-item",{active:t===this.size,onClick:()=>this._changeSize(t)},this.itemTemplate?this.itemTemplate(t):this._defaultItemTemplate(t)))))))}async _setLocales(){this._locales=await n(this._el)}_changeSize(t){t&&(this.size=t,this.sizeChange.emit(this.size))}static get style(){return"*{box-sizing:border-box}.static{position:static}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-solid{border-style:solid}.border-indigo-600{--tw-border-opacity:1;border-color:rgb(82 138 250/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white-600{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-hurricane-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.shadow-1{--tw-shadow:0 1px 1px rgba(0,2,2,.08);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-indigo-100{--tw-ring-opacity:1;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))}.hover\\:bg-white-600:hover{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.group\\/pagination-size-trigger:hover .group-hover\\/pagination-size-trigger\\:text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/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\\:bg-white\\/25:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.25)}.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\\:ring-0:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:hover\\:bg-white\\/25:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.25)}.group\\/pagination-size-trigger:hover .dark\\:group-hover\\/pagination-size-trigger\\: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\\:bg-white\\/25:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.25)}.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))}.dark\\:ring-0:where([data-theme=dark],[data-theme=dark] *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:hover\\:bg-white\\/25:hover:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.25)}.group\\/pagination-size-trigger:hover .dark\\:group-hover\\/pagination-size-trigger\\: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-pagination-size",{size:[1538],sizeOptions:[16],itemTemplate:[16],hidden:[4],dropdownIsOpen:[32],_locales:[32]},[[16,"localeChanged","_setLocales"]]]);function u(){"undefined"!=typeof customElements&&["p-pagination-size","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-icon"].forEach((r=>{switch(r){case"p-pagination-size":customElements.get(t(r))||customElements.define(t(r),k);break;case"p-checkbox":customElements.get(t(r))||p();break;case"p-dropdown":customElements.get(t(r))||l();break;case"p-dropdown-menu-container":customElements.get(t(r))||m();break;case"p-dropdown-menu-item":customElements.get(t(r))||f();break;case"p-icon":customElements.get(t(r))||b()}}))}u();export{k as P,u as d}
1
+ import{t,p as r,H as e,c as a,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as s}from"./p-Au2WuEGF.js";import{f as d,g as n}from"./p-CwQG70_4.js";import{c as h}from"./p-xs4N_Y-0.js";import{P as w,a as g}from"./p-CEaB2BT0.js";import{a as c}from"./p-C5CTp9IA.js";import{d as p}from"./p-Cpwq0YdW.js";import{d as l}from"./p-CFSNSi-H.js";import{d as m}from"./p-Bl7NThUo.js";import{d as f}from"./p-Bqj-EqkF.js";import{d as b}from"./p-DLBcQv2y.js";const v=i("p-pagination-size",{variants:{hidden:{false:null,true:"hidden"}}}),x=i(["group/pagination-size-trigger","flex items-center gap-2","px-2 h-6","text-sm text-storm-500 font-medium ","dark:text-white","cursor-pointer rounded-full","shadow-1 border border-solid"],{variants:{active:{false:["bg-white hover:bg-white-600 border-transparent","dark:bg-white/15 dark:hover:bg-white/25"],true:["bg-white-600 border-indigo-600 ring ring-2 ring-indigo-100","dark:bg-white/25 dark:ring-0"]}}}),k=r(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.sizeChange=a(this,"sizeChange",3)}_defaultItemTemplate=t=>d(this._locales.item,{size:t});size=w;sizeOptions=g;sizeChange;itemTemplate=this._defaultItemTemplate;get _el(){return this}hidden=!1;dropdownIsOpen=!1;_locales={};componentWillLoad(){this._setLocales()}render(){return o(s,{key:"1062e4a018038b23e5514a50f9fa658b6fae7010",class:v({hidden:c(this.hidden)})},o("p-dropdown",{key:"521979380d535dcd911c26b881338ddaaf3e7344",applyFullWidth:!0,applyMaxWidth:!1,chevronDirection:"down",placement:"top-start",onIsOpen:({detail:t})=>this.dropdownIsOpen=t},o("div",{key:"81cdccac14a27636661d30889d5894a9fb5d7ce6",class:x({active:this.dropdownIsOpen}),slot:"trigger"},o("p",{key:"3477755b3365205fef5a3e3f8f465f0d1d41ddd1",class:"min-w-0 flex-1 overflow-hidden text-ellipsis text-nowrap"},this.itemTemplate?this.itemTemplate(this.size):this._defaultItemTemplate(this.size)),o("p-icon",{key:"f08b75643a97c86192e87893c80ad67b9cf61a9d",class:h(["flex-shrink-0","group-hover/pagination-size-trigger:text-storm-500","dark:group-hover/pagination-size-trigger:text-white"],{"text-storm-300 dark:text-hurricane-200":!this.dropdownIsOpen,"text-storm-500 dark:text-white":!!this.dropdownIsOpen}),size:"sm",variant:"double-caret"})),o("slot",{key:"4ac113bf401a0a3019c6430a58f5cfd8a153e5c4",slot:"items"},this.sizeOptions.map((t=>o("p-dropdown-menu-item",{active:t===this.size,onClick:()=>this._changeSize(t)},this.itemTemplate?this.itemTemplate(t):this._defaultItemTemplate(t)))))))}async _setLocales(){this._locales=await n(this._el)}_changeSize(t){t&&(this.size=t,this.sizeChange.emit(this.size))}static get style(){return"*{box-sizing:border-box}.static{position:static}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-solid{border-style:solid}.border-indigo-600{--tw-border-opacity:1;border-color:rgb(82 138 250/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white-600{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-hurricane-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.shadow-1{--tw-shadow:0 1px 1px rgba(0,2,2,.08);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-indigo-100{--tw-ring-opacity:1;--tw-ring-color:rgb(227 236 254/var(--tw-ring-opacity,1))}.hover\\:bg-white-600:hover{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.group\\/pagination-size-trigger:hover .group-hover\\/pagination-size-trigger\\:text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/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\\:bg-white\\/25:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.25)}.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\\:ring-0:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:hover\\:bg-white\\/25:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.25)}.group\\/pagination-size-trigger:hover .dark\\:group-hover\\/pagination-size-trigger\\: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\\:bg-white\\/25:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.25)}.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))}.dark\\:ring-0:where([data-theme=dark],[data-theme=dark] *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:hover\\:bg-white\\/25:hover:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.25)}.group\\/pagination-size-trigger:hover .dark\\:group-hover\\/pagination-size-trigger\\: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-pagination-size",{size:[1538],sizeOptions:[16],itemTemplate:[16],hidden:[4],dropdownIsOpen:[32],_locales:[32]},[[16,"localeChanged","_setLocales"]]]);function u(){"undefined"!=typeof customElements&&["p-pagination-size","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-icon"].forEach((r=>{switch(r){case"p-pagination-size":customElements.get(t(r))||customElements.define(t(r),k);break;case"p-checkbox":customElements.get(t(r))||p();break;case"p-dropdown":customElements.get(t(r))||l();break;case"p-dropdown-menu-container":customElements.get(t(r))||m();break;case"p-dropdown-menu-item":customElements.get(t(r))||f();break;case"p-icon":customElements.get(t(r))||b()}}))}u();export{k as P,u as d}
@@ -1 +1 @@
1
- import{t as e,p as t,H as s,c as i,h as a}from"./p-CySg37XO.js";import{c as o}from"./p-CBWjHURv.js";import{T as p}from"./p-Au2WuEGF.js";import{a as n}from"./p-TyZ7uPES.js";import{P as r}from"./p-CEaB2BT0.js";import{f as l,g as h}from"./p-CwQG70_4.js";import{d as c}from"./p-XWWy0siW.js";import{d as m}from"./p-Cpwq0YdW.js";import{d}from"./p-D9NAGtqV.js";import{d as g}from"./p-Bl7NThUo.js";import{d as u}from"./p-Bqj-EqkF.js";import{d as f}from"./p-B5p7dHkY.js";import{d as k}from"./p-BSZKPMsM.js";import{d as w}from"./p-eLkNCIS4.js";import{d as y}from"./p-DLBcQv2y.js";import{d as C}from"./p-CXxGdOem.js";import{d as b}from"./p-DEW7r6Qi.js";import{d as v}from"./p--y4GWpzd.js";const _=o(["p-pagination","flex gap-2 items-center"],{variants:{hidden:{false:"flex",true:"hidden"}}}),E=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pageChange=i(this,"pageChange",3),this.pagesChange=i(this,"pagesChange",3)}_defaultDropdownPageTemplate=e=>l(this._locales.page,{page:e});page=1;pageChange;dropdownPageTemplate=this._defaultDropdownPageTemplate;pageSize=r;hideOnSinglePage=!1;total;pagesChange;_showDropdown=[!1,!1];_dropdowns=[];_locales={};get _el(){return this}_pages=[];_set=[];componentWillLoad(){this._setLocales()}componentWillRender(){this._generate()}render(){return a(p,{key:"f907f831961866c8c54361d1cb24bfc1d6782a91"},a("div",{key:"d23cdee3d91f4fc7fccd64bc13fb0e1c71885cf1",class:_({hidden:this.hideOnSinglePage&&3===this._set?.length})},this._set?.map((e=>"previous"===e.type||"next"===e.type?a("p-pagination-pages-item",{disabled:this._carouselDisabled(e.type),variant:"carousel",onClick:()=>"previous"===e.type?this._previousClick():this._nextClick()},e.value):"ellipsis"===e.type?a("p-dropdown",{applyChevron:!1,insideClick:!0,placement:"top",ref:t=>this._dropdowns[e.dropdownIndex]=t,show:this._showDropdown[e.dropdownIndex],onIsOpen:({detail:t})=>this._onShowDropdown(t,e.dropdownIndex)},a("p-pagination-pages-item",{slot:"trigger"},"..."),e.options?.slice(0,5).map((e=>a("p-dropdown-menu-item",{autoHeight:!0,slot:"items",variant:"pagination",onClick:()=>this._pageClick(e)},this.dropdownPageTemplate?this.dropdownPageTemplate(e):this._defaultDropdownPageTemplate(e)))),e.options?.length>5&&this._showDropdown[e.dropdownIndex]&&a("p-field",{autoFocus:!0,class:"mt-2 w-28",icon:"enter-key",iconPosition:"end",properties:{min:1,max:this._pages.length,step:1},size:"sm",slot:"items",type:"number",onEnter:({detail:e})=>this._enterPress(e)})):a("p-pagination-pages-item",{active:e.value===this.page,onClick:()=>this._pageClick(e.value)},e.value)))))}pageChangeHandler(){this._generate()}async _setLocales(){this._locales=await h(this._el)}documentClickHandler(e){const t=[!1,!1];this._dropdowns[0]&&n(e,this._dropdowns[0])&&(t[0]=!0),this._dropdowns[1]&&n(e,this._dropdowns[1])&&(t[1]=!0),this._showDropdown=t}_generate(){this._pages=this._generatePages(),this._set=this._generateSet(),this.page>this._pages?.length&&this._changePage(this._pages.length)}_changePage(e){e&&(this._showDropdown=[!1,!1],this.page=e,this.pageChange.emit(this.page))}_previousClick(){this._carouselDisabled("previous")||this._changePage(this.page-1)}_nextClick=()=>{this._carouselDisabled("next")||this._changePage(this.page+1)};_carouselDisabled=e=>"next"===e&&this.page+1>this._pages.at(-1)||"previous"===e&&this.page-1<this._pages[0];_pageClick=e=>this._changePage(e);_enterPress(e){"string"==typeof e&&(e=Number.parseInt(e)),Number.isNaN(e)||(e<1&&(e=1),e>this._pages.length&&(e=this._pages.length),this._changePage(e))}_onShowDropdown(e=!1,t){const s=[...this._showDropdown];s[t]=e,this._showDropdown=s}_generatePages(){if(!this.total||!this.pageSize)return[];const e=Math.ceil(this.total/this.pageSize);return this.pagesChange.emit(e),Array.from({length:e}).fill("").map(((e,t)=>t+1))}_generateSet=(e=1,t=!0)=>{const s=this._pages.length;if(!s)return[];let i=this.page-e,o=this.page+e;o>s&&(o=s,i=s-2*e,i=Math.max(i,1)),i<=1&&(i=1,o=Math.min(2*e+1,s));const p=[],n={type:"previous",value:a("p-icon",{rotate:90,size:"sm",variant:"caret"})},r={type:"next",value:a("p-icon",{rotate:-90,size:"sm",variant:"caret"})};if(null===e){const e=this._pages.map((e=>({type:"page",value:e})));return t?[n,...e,r]:e}t&&p.push(n);let l=0;if(i<=3)for(let e=1;e<i;e++)p.push({type:"page",value:this._pages[e-1]});else p.push({type:"page",value:1},{type:"ellipsis",dropdownIndex:l,options:Array.from({length:i-2},((e,t)=>t+2))}),l++;for(let e=i;e<=o;e++)p.push({type:"page",value:this._pages[e-1]});if(o>=s-2)for(let e=o+1;e<=s;e++)p.push({type:"page",value:this._pages[e-1]});else p.push({type:"ellipsis",dropdownIndex:l,options:Array.from({length:s-o-1},((e,t)=>t+o+1))},{type:"page",value:this._pages.at(-1)}),l++;return t&&p.push(r),p};static get watchers(){return{page:[{pageChangeHandler:0}],pageSize:[{pageChangeHandler:0}],total:[{pageChangeHandler:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.mt-2{margin-top:.5rem}.flex{display:flex}.hidden{display:none}.w-28{width:7rem}.items-center{align-items:center}.gap-2{gap:.5rem}"}},[513,"p-pagination-pages",{page:[1538],dropdownPageTemplate:[16],pageSize:[2,"page-size"],hideOnSinglePage:[4,"hide-on-single-page"],total:[2],_showDropdown:[32],_dropdowns:[32],_locales:[32]},[[16,"localeChanged","_setLocales"],[6,"click","documentClickHandler"]],{page:[{pageChangeHandler:0}],pageSize:[{pageChangeHandler:0}],total:[{pageChangeHandler:0}]}]);function j(){"undefined"!=typeof customElements&&["p-pagination-pages","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-pagination-pages-item","p-tooltip"].forEach((t=>{switch(t){case"p-pagination-pages":customElements.get(e(t))||customElements.define(e(t),E);break;case"p-button":customElements.get(e(t))||c();break;case"p-checkbox":customElements.get(e(t))||m();break;case"p-dropdown":customElements.get(e(t))||d();break;case"p-dropdown-menu-container":customElements.get(e(t))||g();break;case"p-dropdown-menu-item":customElements.get(e(t))||u();break;case"p-field":customElements.get(e(t))||f();break;case"p-field-container":customElements.get(e(t))||k();break;case"p-helper":customElements.get(e(t))||w();break;case"p-icon":customElements.get(e(t))||y();break;case"p-loader":customElements.get(e(t))||C();break;case"p-pagination-pages-item":customElements.get(e(t))||b();break;case"p-tooltip":customElements.get(e(t))||v()}}))}j();export{E as P,j as d}
1
+ import{t as e,p as t,H as s,c as i,h as a}from"./p-CySg37XO.js";import{c as o}from"./p-CBWjHURv.js";import{T as p}from"./p-Au2WuEGF.js";import{a as n}from"./p-TyZ7uPES.js";import{P as r}from"./p-CEaB2BT0.js";import{f as l,g as h}from"./p-CwQG70_4.js";import{d as c}from"./p-XWWy0siW.js";import{d as m}from"./p-Cpwq0YdW.js";import{d}from"./p-CFSNSi-H.js";import{d as g}from"./p-Bl7NThUo.js";import{d as u}from"./p-Bqj-EqkF.js";import{d as f}from"./p-B5p7dHkY.js";import{d as k}from"./p-BSZKPMsM.js";import{d as w}from"./p-eLkNCIS4.js";import{d as C}from"./p-DLBcQv2y.js";import{d as y}from"./p-CXxGdOem.js";import{d as b}from"./p-DEW7r6Qi.js";import{d as v}from"./p--y4GWpzd.js";const _=o(["p-pagination","flex gap-2 items-center"],{variants:{hidden:{false:"flex",true:"hidden"}}}),E=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pageChange=i(this,"pageChange",3),this.pagesChange=i(this,"pagesChange",3)}_defaultDropdownPageTemplate=e=>l(this._locales.page,{page:e});page=1;pageChange;dropdownPageTemplate=this._defaultDropdownPageTemplate;pageSize=r;hideOnSinglePage=!1;total;pagesChange;_showDropdown=[!1,!1];_dropdowns=[];_locales={};get _el(){return this}_pages=[];_set=[];componentWillLoad(){this._setLocales()}componentWillRender(){this._generate()}render(){return a(p,{key:"f907f831961866c8c54361d1cb24bfc1d6782a91"},a("div",{key:"d23cdee3d91f4fc7fccd64bc13fb0e1c71885cf1",class:_({hidden:this.hideOnSinglePage&&3===this._set?.length})},this._set?.map((e=>"previous"===e.type||"next"===e.type?a("p-pagination-pages-item",{disabled:this._carouselDisabled(e.type),variant:"carousel",onClick:()=>"previous"===e.type?this._previousClick():this._nextClick()},e.value):"ellipsis"===e.type?a("p-dropdown",{applyChevron:!1,insideClick:!0,placement:"top",ref:t=>this._dropdowns[e.dropdownIndex]=t,show:this._showDropdown[e.dropdownIndex],onIsOpen:({detail:t})=>this._onShowDropdown(t,e.dropdownIndex)},a("p-pagination-pages-item",{slot:"trigger"},"..."),e.options?.slice(0,5).map((e=>a("p-dropdown-menu-item",{autoHeight:!0,slot:"items",variant:"pagination",onClick:()=>this._pageClick(e)},this.dropdownPageTemplate?this.dropdownPageTemplate(e):this._defaultDropdownPageTemplate(e)))),e.options?.length>5&&this._showDropdown[e.dropdownIndex]&&a("p-field",{autoFocus:!0,class:"mt-2 w-28",icon:"enter-key",iconPosition:"end",properties:{min:1,max:this._pages.length,step:1},size:"sm",slot:"items",type:"number",onEnter:({detail:e})=>this._enterPress(e)})):a("p-pagination-pages-item",{active:e.value===this.page,onClick:()=>this._pageClick(e.value)},e.value)))))}pageChangeHandler(){this._generate()}async _setLocales(){this._locales=await h(this._el)}documentClickHandler(e){const t=[!1,!1];this._dropdowns[0]&&n(e,this._dropdowns[0])&&(t[0]=!0),this._dropdowns[1]&&n(e,this._dropdowns[1])&&(t[1]=!0),this._showDropdown=t}_generate(){this._pages=this._generatePages(),this._set=this._generateSet(),this.page>this._pages?.length&&this._changePage(this._pages.length)}_changePage(e){e&&(this._showDropdown=[!1,!1],this.page=e,this.pageChange.emit(this.page))}_previousClick(){this._carouselDisabled("previous")||this._changePage(this.page-1)}_nextClick=()=>{this._carouselDisabled("next")||this._changePage(this.page+1)};_carouselDisabled=e=>"next"===e&&this.page+1>this._pages.at(-1)||"previous"===e&&this.page-1<this._pages[0];_pageClick=e=>this._changePage(e);_enterPress(e){"string"==typeof e&&(e=Number.parseInt(e)),Number.isNaN(e)||(e<1&&(e=1),e>this._pages.length&&(e=this._pages.length),this._changePage(e))}_onShowDropdown(e=!1,t){const s=[...this._showDropdown];s[t]=e,this._showDropdown=s}_generatePages(){if(!this.total||!this.pageSize)return[];const e=Math.ceil(this.total/this.pageSize);return this.pagesChange.emit(e),Array.from({length:e}).fill("").map(((e,t)=>t+1))}_generateSet=(e=1,t=!0)=>{const s=this._pages.length;if(!s)return[];let i=this.page-e,o=this.page+e;o>s&&(o=s,i=s-2*e,i=Math.max(i,1)),i<=1&&(i=1,o=Math.min(2*e+1,s));const p=[],n={type:"previous",value:a("p-icon",{rotate:90,size:"sm",variant:"caret"})},r={type:"next",value:a("p-icon",{rotate:-90,size:"sm",variant:"caret"})};if(null===e){const e=this._pages.map((e=>({type:"page",value:e})));return t?[n,...e,r]:e}t&&p.push(n);let l=0;if(i<=3)for(let e=1;e<i;e++)p.push({type:"page",value:this._pages[e-1]});else p.push({type:"page",value:1},{type:"ellipsis",dropdownIndex:l,options:Array.from({length:i-2},((e,t)=>t+2))}),l++;for(let e=i;e<=o;e++)p.push({type:"page",value:this._pages[e-1]});if(o>=s-2)for(let e=o+1;e<=s;e++)p.push({type:"page",value:this._pages[e-1]});else p.push({type:"ellipsis",dropdownIndex:l,options:Array.from({length:s-o-1},((e,t)=>t+o+1))},{type:"page",value:this._pages.at(-1)}),l++;return t&&p.push(r),p};static get watchers(){return{page:[{pageChangeHandler:0}],pageSize:[{pageChangeHandler:0}],total:[{pageChangeHandler:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.mt-2{margin-top:.5rem}.flex{display:flex}.hidden{display:none}.w-28{width:7rem}.items-center{align-items:center}.gap-2{gap:.5rem}"}},[513,"p-pagination-pages",{page:[1538],dropdownPageTemplate:[16],pageSize:[2,"page-size"],hideOnSinglePage:[4,"hide-on-single-page"],total:[2],_showDropdown:[32],_dropdowns:[32],_locales:[32]},[[16,"localeChanged","_setLocales"],[6,"click","documentClickHandler"]],{page:[{pageChangeHandler:0}],pageSize:[{pageChangeHandler:0}],total:[{pageChangeHandler:0}]}]);function j(){"undefined"!=typeof customElements&&["p-pagination-pages","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-pagination-pages-item","p-tooltip"].forEach((t=>{switch(t){case"p-pagination-pages":customElements.get(e(t))||customElements.define(e(t),E);break;case"p-button":customElements.get(e(t))||c();break;case"p-checkbox":customElements.get(e(t))||m();break;case"p-dropdown":customElements.get(e(t))||d();break;case"p-dropdown-menu-container":customElements.get(e(t))||g();break;case"p-dropdown-menu-item":customElements.get(e(t))||u();break;case"p-field":customElements.get(e(t))||f();break;case"p-field-container":customElements.get(e(t))||k();break;case"p-helper":customElements.get(e(t))||w();break;case"p-icon":customElements.get(e(t))||C();break;case"p-loader":customElements.get(e(t))||y();break;case"p-pagination-pages-item":customElements.get(e(t))||b();break;case"p-tooltip":customElements.get(e(t))||v()}}))}j();export{E as P,j as d}
@@ -1 +1 @@
1
- import{t,p as e,H as a,c as i,h as n}from"./p-CySg37XO.js";import{c as o}from"./p-CBWjHURv.js";import{T as r}from"./p-Au2WuEGF.js";import{P as s,a as p}from"./p-CEaB2BT0.js";import{d}from"./p-XWWy0siW.js";import{d as c}from"./p-Cpwq0YdW.js";import{d as g}from"./p-Pg_XF2ti.js";import{d as m}from"./p-D9NAGtqV.js";import{d as f}from"./p-Bl7NThUo.js";import{d as h}from"./p-Bqj-EqkF.js";import{d as l}from"./p-B5p7dHkY.js";import{d as w}from"./p-BSZKPMsM.js";import{d as u}from"./p-eLkNCIS4.js";import{d as b}from"./p-DLBcQv2y.js";import{d as v}from"./p-CXxGdOem.js";import{d as k}from"./p-CzcyDhea.js";import{d as y}from"./p-BfdNz0_n.js";import{d as z}from"./p-DEW7r6Qi.js";import{d as P}from"./p-COEYnacB.js";import{d as S}from"./p--y4GWpzd.js";const j=o(["justify-center relative","w-full px-6","after:absolute after:top-0 after:left-0 after:z-[0]","after:w-full after:h-full after:transition-opacity","after:bg-gradient-to-t after:from-white dark:after:from-hurricane-700 after:via-white/80 dark:after:via-hurricane-700/80 after:to-transparent"],{variants:{pinned:{false:"after:opacity-0",true:"after:opacity-100"},hidden:{false:"flex",true:"hidden"},tableHeaderHasAction:{true:"pt-8 pb-20 desktop-xs:py-8",false:"py-8"}}}),E=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pageChange=i(this,"pageChange",3),this.pageSizeChange=i(this,"pageSizeChange",3),this.hiddenChange=i(this,"hiddenChange",3)}enablePaginationSize=!0;enablePaginationPages=!0;loading=!1;page=1;total;pageChange;pageSize=s;pageSizeOptions=p;tableHeaderHasAction=!1;pageSizeChange;hiddenChange;hideOnSinglePage=!0;get _el(){return this}_isPinned=!1;_hasPaginationPages=!0;_hidePageSizeSelect=!1;_hidden=!1;_renderCheckTimeout;componentWillRender(){this._hidePageSizeSelect=this.hideOnSinglePage&&this.total<=this.pageSizeOptions?.[0];const t=this._hidePageSizeSelect&&!this._hasPaginationPages||!this.enablePaginationSize&&!this.enablePaginationPages;t!==this._hidden&&(this._hidden=t,this.hiddenChange.emit(t))}componentDidRender(){this._renderCheckTimeout&&(clearTimeout(this._renderCheckTimeout),this._renderCheckTimeout=null),this._renderCheckTimeout=setTimeout((()=>this._checkStuck()),200)}render(){return n(r,{key:"b5ab268371811514f930f44fedea65da21cd6cae"},n("div",{key:"a98c709cc02b6b15fc7923520921f35d577ce78f",class:j({pinned:this._isPinned,hidden:this._hidden,tableHeaderHasAction:this.tableHeaderHasAction})},(this.enablePaginationPages||this.enablePaginationSize)&&this.total>0&&n("p-pagination",{key:"36b284675464d60e068480b668ec5632f3efa1fb",class:"pointer-events-auto z-[2]",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this._changePageSize(t),onPagesChange:({detail:t})=>this._hasPaginationPages=t>1})))}_changePageSize(t){t&&(this.pageSize=t,this.pageSizeChange.emit(this.pageSize))}_checkStuck(){const t=this._el.getBoundingClientRect(),e=this._el.closest("p-modal"),a=document.querySelector("p-layout");if(e){const t=e.shadowRoot.querySelector("p-modal-body").shadowRoot.querySelector("div"),a=getComputedStyle(t),i=Number.parseInt(a.paddingBottom,10);this._el.style.bottom=`-${i}px`,this._el.style.marginBottom=`-${i-1}px`}if(a&&!e){const t=a.shadowRoot.querySelector(".content"),e=getComputedStyle(t),i=Number.parseInt(e.paddingBottom,10);this._el.style.bottom=`-${i}px`,this._el.style.marginBottom=`-${i-1}px`}this._isPinned=window.innerHeight-t.bottom==0}onScroll(){this._checkStuck()}static get style(){return'.pointer-events-none{pointer-events:none}.sticky{position:sticky}.z-\\[1\\]{z-index:1}*{box-sizing:border-box}:host{--tw-content:"";pointer-events:none;position:sticky;z-index:1}.pointer-events-auto{pointer-events:auto}.static{position:static}.relative{position:relative}.z-\\[2\\]{z-index:2}.flex{display:flex}.table{display:table}.hidden{display:none}.w-full{width:100%}.justify-center{justify-content:center}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-20{padding-bottom:5rem}.pt-8{padding-top:2rem}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:left-0:after{content:var(--tw-content);left:0}.after\\:top-0:after{content:var(--tw-content);top:0}.after\\:z-\\[0\\]:after{content:var(--tw-content);z-index:0}.after\\:h-full:after{content:var(--tw-content);height:100%}.after\\:w-full:after{content:var(--tw-content);width:100%}.after\\:bg-gradient-to-t:after{background-image:linear-gradient(to top,var(--tw-gradient-stops));content:var(--tw-content)}.after\\:from-white:after{--tw-gradient-from:#fff var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.after\\:via-white\\/80:after{--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),hsla(0,0%,100%,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}.after\\:to-transparent:after{--tw-gradient-to:transparent var(--tw-gradient-to-position);content:var(--tw-content)}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:transition-opacity:after{content:var(--tw-content);transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:64rem){.desktop-xs\\:py-8{padding-bottom:2rem;padding-top:2rem}}.dark\\:after\\:from-hurricane-700:where(:host([data-theme=dark]),:host([data-theme=dark]) *):after{--tw-gradient-from:#232934 var(--tw-gradient-from-position);--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:via-hurricane-700\\/80:where(:host([data-theme=dark]),:host([data-theme=dark]) *):after{--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),rgba(35,41,52,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:from-hurricane-700:where([data-theme=dark],[data-theme=dark] *):after{--tw-gradient-from:#232934 var(--tw-gradient-from-position);--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:via-hurricane-700\\/80:where([data-theme=dark],[data-theme=dark] *):after{--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),rgba(35,41,52,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}'}},[513,"p-table-footer",{enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],loading:[4],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],tableHeaderHasAction:[4,"table-header-has-action"],hideOnSinglePage:[4,"hide-on-single-page"],_isPinned:[32],_hasPaginationPages:[32]},[[9,"scroll","onScroll"]]]);function x(){"undefined"!=typeof customElements&&["p-table-footer","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-tooltip"].forEach((e=>{switch(e){case"p-table-footer":customElements.get(t(e))||customElements.define(t(e),E);break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||c();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||f();break;case"p-dropdown-menu-item":customElements.get(t(e))||h();break;case"p-field":customElements.get(t(e))||l();break;case"p-field-container":customElements.get(t(e))||w();break;case"p-helper":customElements.get(t(e))||u();break;case"p-icon":customElements.get(t(e))||b();break;case"p-loader":customElements.get(t(e))||v();break;case"p-pagination":customElements.get(t(e))||k();break;case"p-pagination-pages":customElements.get(t(e))||y();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||P();break;case"p-tooltip":customElements.get(t(e))||S()}}))}x();export{E as T,x as d}
1
+ import{t,p as e,H as a,c as i,h as n}from"./p-CySg37XO.js";import{c as o}from"./p-CBWjHURv.js";import{T as r}from"./p-Au2WuEGF.js";import{P as s,a as p}from"./p-CEaB2BT0.js";import{d}from"./p-XWWy0siW.js";import{d as c}from"./p-Cpwq0YdW.js";import{d as g}from"./p-Pg_XF2ti.js";import{d as m}from"./p-CFSNSi-H.js";import{d as f}from"./p-Bl7NThUo.js";import{d as h}from"./p-Bqj-EqkF.js";import{d as l}from"./p-B5p7dHkY.js";import{d as w}from"./p-BSZKPMsM.js";import{d as u}from"./p-eLkNCIS4.js";import{d as b}from"./p-DLBcQv2y.js";import{d as v}from"./p-CXxGdOem.js";import{d as k}from"./p-B4ldecyo.js";import{d as y}from"./p-Duu0fwUk.js";import{d as z}from"./p-DEW7r6Qi.js";import{d as S}from"./p-CKY-2A7w.js";import{d as P}from"./p--y4GWpzd.js";const j=o(["justify-center relative","w-full px-6","after:absolute after:top-0 after:left-0 after:z-[0]","after:w-full after:h-full after:transition-opacity","after:bg-gradient-to-t after:from-white dark:after:from-hurricane-700 after:via-white/80 dark:after:via-hurricane-700/80 after:to-transparent"],{variants:{pinned:{false:"after:opacity-0",true:"after:opacity-100"},hidden:{false:"flex",true:"hidden"},tableHeaderHasAction:{true:"pt-8 pb-20 desktop-xs:py-8",false:"py-8"}}}),E=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pageChange=i(this,"pageChange",3),this.pageSizeChange=i(this,"pageSizeChange",3),this.hiddenChange=i(this,"hiddenChange",3)}enablePaginationSize=!0;enablePaginationPages=!0;loading=!1;page=1;total;pageChange;pageSize=s;pageSizeOptions=p;tableHeaderHasAction=!1;pageSizeChange;hiddenChange;hideOnSinglePage=!0;get _el(){return this}_isPinned=!1;_hasPaginationPages=!0;_hidePageSizeSelect=!1;_hidden=!1;_renderCheckTimeout;componentWillRender(){this._hidePageSizeSelect=this.hideOnSinglePage&&this.total<=this.pageSizeOptions?.[0];const t=this._hidePageSizeSelect&&!this._hasPaginationPages||!this.enablePaginationSize&&!this.enablePaginationPages;t!==this._hidden&&(this._hidden=t,this.hiddenChange.emit(t))}componentDidRender(){this._renderCheckTimeout&&(clearTimeout(this._renderCheckTimeout),this._renderCheckTimeout=null),this._renderCheckTimeout=setTimeout((()=>this._checkStuck()),200)}render(){return n(r,{key:"b5ab268371811514f930f44fedea65da21cd6cae"},n("div",{key:"a98c709cc02b6b15fc7923520921f35d577ce78f",class:j({pinned:this._isPinned,hidden:this._hidden,tableHeaderHasAction:this.tableHeaderHasAction})},(this.enablePaginationPages||this.enablePaginationSize)&&this.total>0&&n("p-pagination",{key:"36b284675464d60e068480b668ec5632f3efa1fb",class:"pointer-events-auto z-[2]",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this._changePageSize(t),onPagesChange:({detail:t})=>this._hasPaginationPages=t>1})))}_changePageSize(t){t&&(this.pageSize=t,this.pageSizeChange.emit(this.pageSize))}_checkStuck(){const t=this._el.getBoundingClientRect(),e=this._el.closest("p-modal"),a=document.querySelector("p-layout");if(e){const t=e.shadowRoot.querySelector("p-modal-body").shadowRoot.querySelector("div"),a=getComputedStyle(t),i=Number.parseInt(a.paddingBottom,10);this._el.style.bottom=`-${i}px`,this._el.style.marginBottom=`-${i-1}px`}if(a&&!e){const t=a.shadowRoot.querySelector(".content"),e=getComputedStyle(t),i=Number.parseInt(e.paddingBottom,10);this._el.style.bottom=`-${i}px`,this._el.style.marginBottom=`-${i-1}px`}this._isPinned=window.innerHeight-t.bottom==0}onScroll(){this._checkStuck()}static get style(){return'.pointer-events-none{pointer-events:none}.sticky{position:sticky}.z-\\[1\\]{z-index:1}*{box-sizing:border-box}:host{--tw-content:"";pointer-events:none;position:sticky;z-index:1}.pointer-events-auto{pointer-events:auto}.static{position:static}.relative{position:relative}.z-\\[2\\]{z-index:2}.flex{display:flex}.table{display:table}.hidden{display:none}.w-full{width:100%}.justify-center{justify-content:center}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-20{padding-bottom:5rem}.pt-8{padding-top:2rem}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:left-0:after{content:var(--tw-content);left:0}.after\\:top-0:after{content:var(--tw-content);top:0}.after\\:z-\\[0\\]:after{content:var(--tw-content);z-index:0}.after\\:h-full:after{content:var(--tw-content);height:100%}.after\\:w-full:after{content:var(--tw-content);width:100%}.after\\:bg-gradient-to-t:after{background-image:linear-gradient(to top,var(--tw-gradient-stops));content:var(--tw-content)}.after\\:from-white:after{--tw-gradient-from:#fff var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.after\\:via-white\\/80:after{--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),hsla(0,0%,100%,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}.after\\:to-transparent:after{--tw-gradient-to:transparent var(--tw-gradient-to-position);content:var(--tw-content)}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:transition-opacity:after{content:var(--tw-content);transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:64rem){.desktop-xs\\:py-8{padding-bottom:2rem;padding-top:2rem}}.dark\\:after\\:from-hurricane-700:where(:host([data-theme=dark]),:host([data-theme=dark]) *):after{--tw-gradient-from:#232934 var(--tw-gradient-from-position);--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:via-hurricane-700\\/80:where(:host([data-theme=dark]),:host([data-theme=dark]) *):after{--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),rgba(35,41,52,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:from-hurricane-700:where([data-theme=dark],[data-theme=dark] *):after{--tw-gradient-from:#232934 var(--tw-gradient-from-position);--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);content:var(--tw-content)}.dark\\:after\\:via-hurricane-700\\/80:where([data-theme=dark],[data-theme=dark] *):after{--tw-gradient-to:rgba(35,41,52,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),rgba(35,41,52,.8) var(--tw-gradient-via-position),var(--tw-gradient-to);content:var(--tw-content)}'}},[513,"p-table-footer",{enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],loading:[4],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],tableHeaderHasAction:[4,"table-header-has-action"],hideOnSinglePage:[4,"hide-on-single-page"],_isPinned:[32],_hasPaginationPages:[32]},[[9,"scroll","onScroll"]]]);function x(){"undefined"!=typeof customElements&&["p-table-footer","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-tooltip"].forEach((e=>{switch(e){case"p-table-footer":customElements.get(t(e))||customElements.define(t(e),E);break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||c();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||f();break;case"p-dropdown-menu-item":customElements.get(t(e))||h();break;case"p-field":customElements.get(t(e))||l();break;case"p-field-container":customElements.get(t(e))||w();break;case"p-helper":customElements.get(t(e))||u();break;case"p-icon":customElements.get(t(e))||b();break;case"p-loader":customElements.get(t(e))||v();break;case"p-pagination":customElements.get(t(e))||k();break;case"p-pagination-pages":customElements.get(t(e))||y();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||S();break;case"p-tooltip":customElements.get(t(e))||P()}}))}x();export{E as T,x as d}
@@ -1 +1 @@
1
- import{t,p as e,H as s,c as i,h as a}from"./p-CySg37XO.js";import{d as o,a as l,l as r}from"./p-CsM6uU5j.js";import{s as n}from"./p-BBiGYjKk.js";import{c as h}from"./p-TyZ7uPES.js";import{i as d}from"./p-DPc49L2n.js";import{a as p}from"./p-C5CTp9IA.js";import{d as c}from"./p-XWWy0siW.js";import{d as u}from"./p-D9NAGtqV.js";import{d as m}from"./p-Bl7NThUo.js";import{d as y}from"./p-B5p7dHkY.js";import{d as b}from"./p-BSZKPMsM.js";import{d as f}from"./p-eLkNCIS4.js";import{d as D}from"./p-DLBcQv2y.js";import{d as w}from"./p-CXxGdOem.js";import{d as v}from"./p--y4GWpzd.js";const k=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",3),this._internals=this.attachInternals()}placeholder;value;preselectToday=!1;enableNativePicker=!0;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;format="dd-MM-yyyy";hideIconWhenFilled=!1;size="base";prefix;label;loading=!1;helper;required;showOptional=!0;error;disabled=!1;strategy="absolute";placement="bottom-start";get _el(){return this}_showDropdown=!1;_value;_minDate;_maxDate;_disabledDates=[];_isMobileBrowser=!1;_internals;_onInputTimeout;_inputRef;_dateInputRef;_defaultFormats={year:"yyyy",month:"LLLL, yyyy",day:"dd-MM-yyyy",dayNoDashes:"ddMMyyyy"};parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),this._setValue(t)}parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),l.isValid(t)&&(this._minDate=t,l.isBefore(this._value,this._minDate)&&this._setValue(null))):this.minDate=new Date(l.getYear(l.subYears(new Date,100)),0,1)}parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),l.isValid(t)&&(this._maxDate=t,l.isAfter(this._value,this._maxDate)&&this._setValue(null))):this.maxDate=this._getAutomaticMax()}parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>l.isValid(t))),this._isDisabledDay(this._value)&&this._setValue(null))}formResetCallback(){this._setValue(null)}formDisabledCallback(t){this._internals.form&&(this.disabled=t)}componentWillLoad(){this.disabledDates&&this.parseDisabledDates(this.disabledDates),this.parseMinDate(this.minDate),this.parseMaxDate(this.maxDate),"day"!==this.mode&&this.format===this._defaultFormats.day&&(this.format=this._defaultFormats[this.mode]),this._isMobileBrowser=d(),this.parseValue(this.value)}render(){return a("p-dropdown",{key:"c65daeff45afabeefa654b8d033a40d9fda5b4e2",allowOverflow:!0,applyFullWidth:!1,applyMaxWidth:!1,disableTriggerClick:!0,insideClick:!0,isDatepicker:!0,placement:this.placement,show:this._showDropdown,strategy:this.strategy},a("p-field",{key:"09aaa8a320e9a1852171aa59054a9b269667addb",autoShowError:!1,disabled:p(this.disabled),error:this.error,focused:this._showDropdown,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,icon:this.hideIconWhenFilled&&this._value?null:"calendar-multi",iconPosition:"start",label:this.label,loading:this.loading,placeholder:this.placeholder,prefix:this.prefix,required:p(this.required),showOptional:p(this.showOptional),size:this.size,slot:"trigger",value:this._getFormattedDate(),onBlur:t=>this._onBlur(t),onFocus:()=>this._onFocus(),onInputRefChange:t=>this._inputRef=t.detail,onValueChange:t=>this._onValueChange(t.detail)}),this.enableNativePicker&&this._isMobileBrowser&&a("input",{key:"f63ca80f15e52a5824a51e997f7b45664104a196",class:"pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0",max:this.maxDate&&l.format(new Date(this.maxDate),"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),min:this._minDate&&l.format(new Date(this._minDate),"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),ref:t=>this._dateInputRef=t,slot:"trigger",type:"day"===this.mode?"date":"month",value:this._value&&l.format(this._value,"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),onInput:t=>this._onNativeInput(t)}),a("div",{key:"f57a7045507cc0bf0bb2ae070258c0d4ed1af81f",slot:"items",tabIndex:-1},a("p-calendar",{key:"469d4b2a4c2972a0bfb621d85a67fb3d8c3c3e83",disableWeekends:this.disableWeekends,disabledDates:this.disabledDates,enableToday:this.enableToday,maxDate:this.maxDate,minDate:this.minDate,mode:this.mode,preselectToday:this.preselectToday,todayText:this.todayText,value:this._value,variant:"embedded",onValueChange:({detail:t})=>this.value=t})))}documentClickHandler({target:t}){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_onFocus(){if(this._isMobileBrowser&&this._dateInputRef)return this._dateInputRef.focus(),this._dateInputRef.showPicker(),void this._inputRef.blur();this._showDropdown=!0}_onBlur(t,e=this.format){if(this._isMobileBrowser&&this._dateInputRef)return;t.relatedTarget&&!h(t.relatedTarget,this._el)&&(this._showDropdown=!1);const s=this._inputRef;if(null===s.value)return;const i=l.parse(s.value,e,new Date);if(i===this._value)return;const a=l.isValid(i);if(!a&&e===this.format&&"day"===this.mode)return this._onBlur(t,this._defaultFormats.dayNoDashes);a&&!this._isDisabledDay(i)?this._setValue(i,!1):s.value=this._getFormattedDate()}_onValueChange(t,e=this.format){this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{if(0===t.length){if(null===this._value)return;return void this._setValue(null)}const s=l.parse(t,e,new Date);l.isValid(s)&&l.format(s,e,{locale:"nl"===n.locale?r.nl:r.enUS})===t?this._setValue(s,!1):"day"===this.mode&&this._onValueChange(t,this._defaultFormats.dayNoDashes)}),300)}_onNativeInput(t){t.target&&(this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{this._setValue(""===t.target.value?null:new Date(t.target.value),!1)})))}_setValue(t,e=!0){if(null===t)return this._value=null,void this.valueChange.emit(null);l.isValid(t)&&(this._isDisabledDay(t)?this._dateInputRef?.value&&(this._dateInputRef.value=this._value?l.format(this._value,"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}):null):(t="day"===this.mode?l.startOfDay(t):"month"===this.mode?l.startOfMonth(t):l.startOfYear(t),l.isSameDay(t,this._value)||(e&&(this._showDropdown=!1),this._value=t,this.valueChange.emit(t))))}_isDisabledDay(t){return this.disableWeekends&&l.isWeekend(t)||l.isBefore(t,this._minDate)&&!l.isSameDay(t,this._minDate)||l.isAfter(t,this._maxDate)&&!l.isSameDay(t,this._maxDate)||this._disabledDates.some((e=>l.isSameDay(e,t)))}_getFormattedDate(){return this._value?l.format(this._value,this.format,{locale:"nl"===n.locale?r.nl:r.enUS}):""}_getAutomaticMax(){const t=l.addYears(new Date,50);let e=l.getYear(t);return e=10*Math.ceil(e/10),l.setYear(t,e)}static get formAssociated(){return!0}static get watchers(){return{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}}static get style(){return"*{box-sizing:border-box}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.left-0{left:0}.top-0{top:0}.z-\\[-10\\]{z-index:-10}.overflow-hidden{overflow:hidden}.opacity-0{opacity:0}.blur{--tw-blur:blur(8px)}.blur,.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)}"}},[576,"p-datepicker",{placeholder:[1],value:[1],preselectToday:[4,"preselect-today"],enableNativePicker:[4,"enable-native-picker"],disabledDates:[1,"disabled-dates"],minDate:[1,"min-date"],maxDate:[1,"max-date"],disableWeekends:[4,"disable-weekends"],enableToday:[4,"enable-today"],todayText:[1,"today-text"],mode:[1],format:[1],hideIconWhenFilled:[4,"hide-icon-when-filled"],size:[1],prefix:[1],label:[1],loading:[4],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],strategy:[1],placement:[513],_showDropdown:[32],_value:[32],_minDate:[32],_maxDate:[32],_disabledDates:[32],_isMobileBrowser:[32]},[[6,"click","documentClickHandler"]],{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}]);function g(){"undefined"!=typeof customElements&&["p-datepicker","p-button","p-calendar","p-dropdown","p-dropdown-menu-container","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((e=>{switch(e){case"p-datepicker":customElements.get(t(e))||customElements.define(t(e),k);break;case"p-button":customElements.get(t(e))||c();break;case"p-calendar":customElements.get(t(e))||o();break;case"p-dropdown":customElements.get(t(e))||u();break;case"p-dropdown-menu-container":customElements.get(t(e))||m();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||b();break;case"p-helper":customElements.get(t(e))||f();break;case"p-icon":customElements.get(t(e))||D();break;case"p-loader":customElements.get(t(e))||w();break;case"p-tooltip":customElements.get(t(e))||v()}}))}g();const x=k,M=g;export{x as PDatepicker,M as defineCustomElement}
1
+ import{t,p as e,H as s,c as i,h as a}from"./p-CySg37XO.js";import{d as o,a as l,l as r}from"./p-CsM6uU5j.js";import{s as n}from"./p-BBiGYjKk.js";import{c as h}from"./p-TyZ7uPES.js";import{i as d}from"./p-DPc49L2n.js";import{a as p}from"./p-C5CTp9IA.js";import{d as c}from"./p-XWWy0siW.js";import{d as u}from"./p-CFSNSi-H.js";import{d as m}from"./p-Bl7NThUo.js";import{d as y}from"./p-B5p7dHkY.js";import{d as b}from"./p-BSZKPMsM.js";import{d as f}from"./p-eLkNCIS4.js";import{d as D}from"./p-DLBcQv2y.js";import{d as w}from"./p-CXxGdOem.js";import{d as v}from"./p--y4GWpzd.js";const k=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",3),this._internals=this.attachInternals()}placeholder;value;preselectToday=!1;enableNativePicker=!0;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;format="dd-MM-yyyy";hideIconWhenFilled=!1;size="base";prefix;label;loading=!1;helper;required;showOptional=!0;error;disabled=!1;strategy="absolute";placement="bottom-start";get _el(){return this}_showDropdown=!1;_value;_minDate;_maxDate;_disabledDates=[];_isMobileBrowser=!1;_internals;_onInputTimeout;_inputRef;_dateInputRef;_defaultFormats={year:"yyyy",month:"LLLL, yyyy",day:"dd-MM-yyyy",dayNoDashes:"ddMMyyyy"};parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),this._setValue(t)}parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),l.isValid(t)&&(this._minDate=t,l.isBefore(this._value,this._minDate)&&this._setValue(null))):this.minDate=new Date(l.getYear(l.subYears(new Date,100)),0,1)}parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),l.isValid(t)&&(this._maxDate=t,l.isAfter(this._value,this._maxDate)&&this._setValue(null))):this.maxDate=this._getAutomaticMax()}parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>l.isValid(t))),this._isDisabledDay(this._value)&&this._setValue(null))}formResetCallback(){this._setValue(null)}formDisabledCallback(t){this._internals.form&&(this.disabled=t)}componentWillLoad(){this.disabledDates&&this.parseDisabledDates(this.disabledDates),this.parseMinDate(this.minDate),this.parseMaxDate(this.maxDate),"day"!==this.mode&&this.format===this._defaultFormats.day&&(this.format=this._defaultFormats[this.mode]),this._isMobileBrowser=d(),this.parseValue(this.value)}render(){return a("p-dropdown",{key:"c65daeff45afabeefa654b8d033a40d9fda5b4e2",allowOverflow:!0,applyFullWidth:!1,applyMaxWidth:!1,disableTriggerClick:!0,insideClick:!0,isDatepicker:!0,placement:this.placement,show:this._showDropdown,strategy:this.strategy},a("p-field",{key:"09aaa8a320e9a1852171aa59054a9b269667addb",autoShowError:!1,disabled:p(this.disabled),error:this.error,focused:this._showDropdown,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,icon:this.hideIconWhenFilled&&this._value?null:"calendar-multi",iconPosition:"start",label:this.label,loading:this.loading,placeholder:this.placeholder,prefix:this.prefix,required:p(this.required),showOptional:p(this.showOptional),size:this.size,slot:"trigger",value:this._getFormattedDate(),onBlur:t=>this._onBlur(t),onFocus:()=>this._onFocus(),onInputRefChange:t=>this._inputRef=t.detail,onValueChange:t=>this._onValueChange(t.detail)}),this.enableNativePicker&&this._isMobileBrowser&&a("input",{key:"f63ca80f15e52a5824a51e997f7b45664104a196",class:"pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden opacity-0",max:this.maxDate&&l.format(new Date(this.maxDate),"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),min:this._minDate&&l.format(new Date(this._minDate),"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),ref:t=>this._dateInputRef=t,slot:"trigger",type:"day"===this.mode?"date":"month",value:this._value&&l.format(this._value,"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}),onInput:t=>this._onNativeInput(t)}),a("div",{key:"f57a7045507cc0bf0bb2ae070258c0d4ed1af81f",slot:"items",tabIndex:-1},a("p-calendar",{key:"469d4b2a4c2972a0bfb621d85a67fb3d8c3c3e83",disableWeekends:this.disableWeekends,disabledDates:this.disabledDates,enableToday:this.enableToday,maxDate:this.maxDate,minDate:this.minDate,mode:this.mode,preselectToday:this.preselectToday,todayText:this.todayText,value:this._value,variant:"embedded",onValueChange:({detail:t})=>this.value=t})))}documentClickHandler({target:t}){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_onFocus(){if(this._isMobileBrowser&&this._dateInputRef)return this._dateInputRef.focus(),this._dateInputRef.showPicker(),void this._inputRef.blur();this._showDropdown=!0}_onBlur(t,e=this.format){if(this._isMobileBrowser&&this._dateInputRef)return;t.relatedTarget&&!h(t.relatedTarget,this._el)&&(this._showDropdown=!1);const s=this._inputRef;if(null===s.value)return;const i=l.parse(s.value,e,new Date);if(i===this._value)return;const a=l.isValid(i);if(!a&&e===this.format&&"day"===this.mode)return this._onBlur(t,this._defaultFormats.dayNoDashes);a&&!this._isDisabledDay(i)?this._setValue(i,!1):s.value=this._getFormattedDate()}_onValueChange(t,e=this.format){this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{if(0===t.length){if(null===this._value)return;return void this._setValue(null)}const s=l.parse(t,e,new Date);l.isValid(s)&&l.format(s,e,{locale:"nl"===n.locale?r.nl:r.enUS})===t?this._setValue(s,!1):"day"===this.mode&&this._onValueChange(t,this._defaultFormats.dayNoDashes)}),300)}_onNativeInput(t){t.target&&(this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{this._setValue(""===t.target.value?null:new Date(t.target.value),!1)})))}_setValue(t,e=!0){if(null===t)return this._value=null,void this.valueChange.emit(null);l.isValid(t)&&(this._isDisabledDay(t)?this._dateInputRef?.value&&(this._dateInputRef.value=this._value?l.format(this._value,"yyyy-MM-dd",{locale:"nl"===n.locale?r.nl:r.enUS}):null):(t="day"===this.mode?l.startOfDay(t):"month"===this.mode?l.startOfMonth(t):l.startOfYear(t),l.isSameDay(t,this._value)||(e&&(this._showDropdown=!1),this._value=t,this.valueChange.emit(t))))}_isDisabledDay(t){return this.disableWeekends&&l.isWeekend(t)||l.isBefore(t,this._minDate)&&!l.isSameDay(t,this._minDate)||l.isAfter(t,this._maxDate)&&!l.isSameDay(t,this._maxDate)||this._disabledDates.some((e=>l.isSameDay(e,t)))}_getFormattedDate(){return this._value?l.format(this._value,this.format,{locale:"nl"===n.locale?r.nl:r.enUS}):""}_getAutomaticMax(){const t=l.addYears(new Date,50);let e=l.getYear(t);return e=10*Math.ceil(e/10),l.setYear(t,e)}static get formAssociated(){return!0}static get watchers(){return{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}}static get style(){return"*{box-sizing:border-box}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.left-0{left:0}.top-0{top:0}.z-\\[-10\\]{z-index:-10}.overflow-hidden{overflow:hidden}.opacity-0{opacity:0}.blur{--tw-blur:blur(8px)}.blur,.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)}"}},[576,"p-datepicker",{placeholder:[1],value:[1],preselectToday:[4,"preselect-today"],enableNativePicker:[4,"enable-native-picker"],disabledDates:[1,"disabled-dates"],minDate:[1,"min-date"],maxDate:[1,"max-date"],disableWeekends:[4,"disable-weekends"],enableToday:[4,"enable-today"],todayText:[1,"today-text"],mode:[1],format:[1],hideIconWhenFilled:[4,"hide-icon-when-filled"],size:[1],prefix:[1],label:[1],loading:[4],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],strategy:[1],placement:[513],_showDropdown:[32],_value:[32],_minDate:[32],_maxDate:[32],_disabledDates:[32],_isMobileBrowser:[32]},[[6,"click","documentClickHandler"]],{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}]);function g(){"undefined"!=typeof customElements&&["p-datepicker","p-button","p-calendar","p-dropdown","p-dropdown-menu-container","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((e=>{switch(e){case"p-datepicker":customElements.get(t(e))||customElements.define(t(e),k);break;case"p-button":customElements.get(t(e))||c();break;case"p-calendar":customElements.get(t(e))||o();break;case"p-dropdown":customElements.get(t(e))||u();break;case"p-dropdown-menu-container":customElements.get(t(e))||m();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||b();break;case"p-helper":customElements.get(t(e))||f();break;case"p-icon":customElements.get(t(e))||D();break;case"p-loader":customElements.get(t(e))||w();break;case"p-tooltip":customElements.get(t(e))||v()}}))}g();const x=k,M=g;export{x as PDatepicker,M as defineCustomElement}
@@ -1 +1 @@
1
- import{D as o,d as s}from"./p-D9NAGtqV.js";const t=o,p=s;export{t as PDropdown,p as defineCustomElement}
1
+ import{D as o,d as s}from"./p-CFSNSi-H.js";const p=o,r=s;export{p as PDropdown,r as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as s}from"./p-BfdNz0_n.js";const p=o,r=s;export{p as PPaginationPages,r as defineCustomElement}
1
+ import{P as o,d as s}from"./p-Duu0fwUk.js";const p=o,r=s;export{p as PPaginationPages,r as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as s}from"./p-COEYnacB.js";const a=o,p=s;export{a as PPaginationSize,p as defineCustomElement}
1
+ import{P as o,d as s}from"./p-CKY-2A7w.js";const p=o,r=s;export{p as PPaginationSize,r as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as s}from"./p-CzcyDhea.js";const a=o,p=s;export{a as PPagination,p as defineCustomElement}
1
+ import{P as o,d as s}from"./p-B4ldecyo.js";const p=o,r=s;export{p as PPagination,r as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as o,h as a}from"./p-CySg37XO.js";import{c as s}from"./p-CBWjHURv.js";import{T as r}from"./p-Au2WuEGF.js";import{d as i}from"./p-XWWy0siW.js";import{d as n}from"./p-D9NAGtqV.js";import{d as l}from"./p-Bl7NThUo.js";import{d as p}from"./p-DLBcQv2y.js";import{d}from"./p-CXxGdOem.js";const m=s(["flex gap-2 items-center flex-1 min-w-0"],{variants:{dropdown:{false:"h-10 py-1",true:null}}}),c=e(class extends o{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 a(r,{key:"d8b3c59997be743df436a92d272715015d2e876d"},this._hasDropdownSlot?a("p-dropdown",{applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,manualChevron:!0,placement:this.dropdownLocation,strategy:"absolute",onIsOpen:t=>this._dropdownOpen=t.detail},a("p-button",{active:this._dropdownOpen,chevron:this._dropdownOpen?"up":"down",class:"w-full",size:"lg",slot:"trigger",variant:"dropdown"},t),a("div",{slot:"items"},a("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 a("div",{class:m({dropdown:this._hasDropdownSlot})},a("slot",{name:"avatar"}),a("div",{class:"flex min-w-0 flex-1 flex-col items-start"},a("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"},a("slot",{name:"title"})),a("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"},a("slot",{name:"subtitle"}))),a("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"]]]);function h(){"undefined"!=typeof customElements&&["p-profile","p-button","p-dropdown","p-dropdown-menu-container","p-icon","p-loader"].forEach((e=>{switch(e){case"p-profile":customElements.get(t(e))||customElements.define(t(e),c);break;case"p-button":customElements.get(t(e))||i();break;case"p-dropdown":customElements.get(t(e))||n();break;case"p-dropdown-menu-container":customElements.get(t(e))||l();break;case"p-icon":customElements.get(t(e))||p();break;case"p-loader":customElements.get(t(e))||d()}}))}h();const w=c,x=h;export{w as PProfile,x as defineCustomElement}
1
+ import{t,p as e,H as o,h as a}from"./p-CySg37XO.js";import{c as s}from"./p-CBWjHURv.js";import{T as r}from"./p-Au2WuEGF.js";import{d as i}from"./p-XWWy0siW.js";import{d as n}from"./p-CFSNSi-H.js";import{d as l}from"./p-Bl7NThUo.js";import{d as p}from"./p-DLBcQv2y.js";import{d}from"./p-CXxGdOem.js";const m=s(["flex gap-2 items-center flex-1 min-w-0"],{variants:{dropdown:{false:"h-10 py-1",true:null}}}),c=e(class extends o{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 a(r,{key:"d8b3c59997be743df436a92d272715015d2e876d"},this._hasDropdownSlot?a("p-dropdown",{applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,manualChevron:!0,placement:this.dropdownLocation,strategy:"absolute",onIsOpen:t=>this._dropdownOpen=t.detail},a("p-button",{active:this._dropdownOpen,chevron:this._dropdownOpen?"up":"down",class:"w-full",size:"lg",slot:"trigger",variant:"dropdown"},t),a("div",{slot:"items"},a("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 a("div",{class:m({dropdown:this._hasDropdownSlot})},a("slot",{name:"avatar"}),a("div",{class:"flex min-w-0 flex-1 flex-col items-start"},a("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"},a("slot",{name:"title"})),a("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"},a("slot",{name:"subtitle"}))),a("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"]]]);function h(){"undefined"!=typeof customElements&&["p-profile","p-button","p-dropdown","p-dropdown-menu-container","p-icon","p-loader"].forEach((e=>{switch(e){case"p-profile":customElements.get(t(e))||customElements.define(t(e),c);break;case"p-button":customElements.get(t(e))||i();break;case"p-dropdown":customElements.get(t(e))||n();break;case"p-dropdown-menu-container":customElements.get(t(e))||l();break;case"p-icon":customElements.get(t(e))||p();break;case"p-loader":customElements.get(t(e))||d()}}))}h();const w=c,x=h;export{w as PProfile,x as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as i,c as s,h as a}from"./p-CySg37XO.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as h}from"./p-TyZ7uPES.js";import{c as l}from"./p-xs4N_Y-0.js";import{S as n}from"./p-CEaB2BT0.js";import{d as c}from"./p-Ddm-XKZe.js";import{d}from"./p-XWWy0siW.js";import{d as p}from"./p-Cpwq0YdW.js";import{d as m}from"./p-D9NAGtqV.js";import{d as u}from"./p-Bl7NThUo.js";import{d as w}from"./p-Bqj-EqkF.js";import{d as y}from"./p-B5p7dHkY.js";import{d as x}from"./p-BSZKPMsM.js";import{d as g}from"./p-eLkNCIS4.js";import{d as v}from"./p-DLBcQv2y.js";import{d as f}from"./p-CXxGdOem.js";import{d as b}from"./p--y4GWpzd.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=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=s(this,"queryChange",3),this.valueChange=s(this,"valueChange",3),this.selectAllChange=s(this,"selectAllChange",3),this.dropdownShown=s(this,"dropdownShown",3),this.add=s(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=n;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=a("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:a("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>a("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],a("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"})))),a("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"),a(o,{key:"617063ca6cf31255928f6f6856cb1902b1d225a2"},a("p-field-container",{key:"4a6d95f7bfbc79b886044f2fe31695990b4e210d",error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,label:this.label,prefix:this.prefix,required:this.required,showOptional:this.showOptional,variant:"write"},a("p-dropdown",{key:"86dd982fca64c61a7c54a6ce104a358a8bfc4c04",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"21fe3c6214c05e6a8f90fd817ecb793bed8b7c3b",active:this._showDropdown,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),class:"w-full",error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],size:this.size,slot:"trigger",variant:"secondary",onClick:t=>this._onClick(t)},a("div",{key:"7e5b6ceacca4ca732caa7385b96c22d0c8436ac5",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 a("p-dropdown-menu-item",{active:e,checkbox:!!this.multi,enableTextWrap:this.enableTextWrap,slot:"items",useContainer:!1,onClick:()=>this._selectValue(t)},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[a("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(a("p-dropdown-menu-item",{active:this._allSelected,slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange()},this.selectAllIcon?.length?a("span",{class:"flex items-center gap-2"},a("div",{class:"flex w-6 justify-center text-lg"},a("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return a("p-dropdown-menu-item",{slot:"items",useContainer:!1,onClick:()=>this.add.emit()},a("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,a("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>a("p-dropdown-menu-item",{enableHover:!1,slot:"items"},a("p-loader",{class:"h-6 w-full rounded",variant:"ghost"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return a("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},a("p-field",{class:"block",placeholder:this.autocompletePlaceholder,value:this.query,onInputRefChange:t=>this.autocompleteInputRef=t.detail,onValueChange:t=>this._onAutoComplete(t)}))}_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 s=a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(s=a("span",{class:"flex items-center gap-2"},a("p-avatar",{letters:t[this.avatarLettersKey],size:"sm",src:t[this.avatarKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(s=a("span",{class:"flex items-center gap-2"},t[this.iconKey]&&a("p-icon",{class:l("text-storm-300 dark:text-hurricane-200",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),a("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?s:a("div",{class:t[this.classKey]},s)}_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}]}]);function S(){"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((e=>{switch(e){case"p-select":customElements.get(t(e))||customElements.define(t(e),I);break;case"p-avatar":customElements.get(t(e))||c();break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||p();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||u();break;case"p-dropdown-menu-item":customElements.get(t(e))||w();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-helper":customElements.get(t(e))||g();break;case"p-icon":customElements.get(t(e))||v();break;case"p-loader":customElements.get(t(e))||f();break;case"p-tooltip":customElements.get(t(e))||b()}}))}S();const T=I,K=S;export{T as PSelect,K as defineCustomElement}
1
+ import{t,p as e,H as i,c as s,h as a}from"./p-CySg37XO.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as h}from"./p-TyZ7uPES.js";import{c as l}from"./p-xs4N_Y-0.js";import{S as n}from"./p-CEaB2BT0.js";import{d as c}from"./p-Ddm-XKZe.js";import{d}from"./p-XWWy0siW.js";import{d as p}from"./p-Cpwq0YdW.js";import{d as m}from"./p-CFSNSi-H.js";import{d as u}from"./p-Bl7NThUo.js";import{d as w}from"./p-Bqj-EqkF.js";import{d as y}from"./p-B5p7dHkY.js";import{d as x}from"./p-BSZKPMsM.js";import{d as g}from"./p-eLkNCIS4.js";import{d as v}from"./p-DLBcQv2y.js";import{d as f}from"./p-CXxGdOem.js";import{d as b}from"./p--y4GWpzd.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}}}),S=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=s(this,"queryChange",3),this.valueChange=s(this,"valueChange",3),this.selectAllChange=s(this,"selectAllChange",3),this.dropdownShown=s(this,"dropdownShown",3),this.add=s(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=n;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=a("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:a("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>a("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],a("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"})))),a("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"),a(o,{key:"617063ca6cf31255928f6f6856cb1902b1d225a2"},a("p-field-container",{key:"4a6d95f7bfbc79b886044f2fe31695990b4e210d",error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,label:this.label,prefix:this.prefix,required:this.required,showOptional:this.showOptional,variant:"write"},a("p-dropdown",{key:"86dd982fca64c61a7c54a6ce104a358a8bfc4c04",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"21fe3c6214c05e6a8f90fd817ecb793bed8b7c3b",active:this._showDropdown,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),class:"w-full",error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],size:this.size,slot:"trigger",variant:"secondary",onClick:t=>this._onClick(t)},a("div",{key:"7e5b6ceacca4ca732caa7385b96c22d0c8436ac5",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 a("p-dropdown-menu-item",{active:e,checkbox:!!this.multi,enableTextWrap:this.enableTextWrap,slot:"items",useContainer:!1,onClick:()=>this._selectValue(t)},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[a("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(a("p-dropdown-menu-item",{active:this._allSelected,slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange()},this.selectAllIcon?.length?a("span",{class:"flex items-center gap-2"},a("div",{class:"flex w-6 justify-center text-lg"},a("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return a("p-dropdown-menu-item",{slot:"items",useContainer:!1,onClick:()=>this.add.emit()},a("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,a("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>a("p-dropdown-menu-item",{enableHover:!1,slot:"items"},a("p-loader",{class:"h-6 w-full rounded",variant:"ghost"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return a("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},a("p-field",{class:"block",placeholder:this.autocompletePlaceholder,value:this.query,onInputRefChange:t=>this.autocompleteInputRef=t.detail,onValueChange:t=>this._onAutoComplete(t)}))}_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 s=a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(s=a("span",{class:"flex items-center gap-2"},a("p-avatar",{letters:t[this.avatarLettersKey],size:"sm",src:t[this.avatarKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(s=a("span",{class:"flex items-center gap-2"},t[this.iconKey]&&a("p-icon",{class:l("text-storm-300 dark:text-hurricane-200",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),a("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?s:a("div",{class:t[this.classKey]},s)}_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}]}]);function I(){"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((e=>{switch(e){case"p-select":customElements.get(t(e))||customElements.define(t(e),S);break;case"p-avatar":customElements.get(t(e))||c();break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||p();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||u();break;case"p-dropdown-menu-item":customElements.get(t(e))||w();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-helper":customElements.get(t(e))||g();break;case"p-icon":customElements.get(t(e))||v();break;case"p-loader":customElements.get(t(e))||f();break;case"p-tooltip":customElements.get(t(e))||b()}}))}I();const T=S,K=I;export{T as PSelect,K as defineCustomElement}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-DA6lXn-F.js";const p=o,r=s;export{p as PTableFooter,r as defineCustomElement}
1
+ import{T as s,d as a}from"./p-a6F6aMNs.js";const o=s,p=a;export{o as PTableFooter,p as defineCustomElement}
@@ -1 +1 @@
1
- import{t as e,p as t,H as i,c as s,h as o,d as a}from"./p-CySg37XO.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r}from"./p-3RT3BYex.js";import{f as c}from"./p-CWO2YJCh.js";import{c as h}from"./p-xs4N_Y-0.js";import{P as p,a as d,T as m}from"./p-CEaB2BT0.js";import{d as u}from"./p-BDDbB69D.js";import{d as b}from"./p-XWWy0siW.js";import{d as f}from"./p-Cpwq0YdW.js";import{d as g}from"./p-Pg_XF2ti.js";import{d as w}from"./p-D9NAGtqV.js";import{d as k}from"./p-Bl7NThUo.js";import{d as y}from"./p-Bqj-EqkF.js";import{d as S}from"./p-DgL1D6Aj.js";import{d as _}from"./p-B5p7dHkY.js";import{d as x}from"./p-BSZKPMsM.js";import{d as C}from"./p-Bv-ByGSf.js";import{d as v}from"./p-DexJ62g_.js";import{d as E}from"./p-eLkNCIS4.js";import{d as F}from"./p-DLBcQv2y.js";import{d as A}from"./p-CMmvAq1F.js";import{d as R}from"./p-CXxGdOem.js";import{d as j}from"./p-CzcyDhea.js";import{d as D}from"./p-BfdNz0_n.js";import{d as B}from"./p-DEW7r6Qi.js";import{d as z}from"./p-COEYnacB.js";import{d as L}from"./p-Ch0_FdYv.js";import{d as T}from"./p-Dq0MN0E1.js";import{d as H}from"./p-CGKUYLex.js";import{d as q}from"./p-BcD4BpWF.js";import{d as P}from"./p-DA6lXn-F.js";import{d as O}from"./p-DMxy9lYo.js";import{d as I}from"./p-g9hO5RJl.js";import{d as M}from"./p-Br5JzRPb.js";import{d as W}from"./p--y4GWpzd.js";const Y=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectedRowsChange=s(this,"selectedRowsChange",3),this.rowClick=s(this,"rowClick",3),this.rowSelected=s(this,"rowSelected",3),this.rowDeselected=s(this,"rowDeselected",3),this.hasRendered=s(this,"hasRendered",3),this.quickFilter=s(this,"quickFilter",3),this.queryChange=s(this,"queryChange",3),this.filter=s(this,"filter",3),this.action=s(this,"action",3),this.pageChange=s(this,"pageChange",3),this.pageSizeChange=s(this,"pageSizeChange",3),this.export=s(this,"export",3),this.emptyStateActionClick=s(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=e=>n((1===e?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",e));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=p;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 o(a,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},o("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&o("p-table-header",{key:"6a1af71c86b2b23d26d8d344b1528b1356d7bd7b",actionButtonTemplate:this.actionButtonTemplate,actionIcon:this.actionButtonIcon,actionLoading:this.actionButtonLoading,actionText:this.actionButtonText,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,canUseAction:this.actionButtonEnabled,class:"mb-8",enableAction:this.enableAction,enableExport:this.enableExport,enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,enableSearch:this.enableSearch,filterButtonTemplate:this.filterButtonTemplate,itemsSelectedAmount:this.selectedRows?.length,loading:this.headerLoading,query:this.query,quickFilters:this.quickFilters,selectedFiltersAmount:this.selectedFiltersAmount,onAction:()=>this.action.emit(),onExport:()=>this.export.emit(),onFilter:()=>this.filter.emit(),onQueryChange:({detail:e})=>this.queryChange.emit(e),onQuickFilter:({detail:e})=>this.quickFilter.emit(e)},this._hasCustomFilterSlot&&o("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?o("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),enableAmountSelected:!!this._rowActionsFloating?.length,usedInTable:!0,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((e=>o("p-floating-menu-item",{disabled:e.disabled,icon:e.icon,iconFlip:e.iconFlip,iconRotate:e.iconRotate,loading:e.loading,slot:"floating-menu-item",onClick:()=>e.disabled||e.loading||!e.action||"single"!==e.type?e.action(this.selectedRows,!0):e.action(this.selectedRows[0],!1)},e.label)))):"",this.enableFooter&&o("p-table-footer",{key:"57d24f1f3803e58053eba3da5fad1ab6474eccc6",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,loading:this.footerLoading,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled,total:this.total,onHiddenChange:({detail:e})=>this._footerHidden=e,onPageChange:({detail:e})=>this.pageChange.emit(e),onPageSizeChange:({detail:e})=>this.pageSizeChange.emit(e)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:e}){"Control"===e&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:e}){"Control"===e&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(e){this._items=e?Array.isArray(e)?e:JSON.parse(e):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const e=c(),t=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=t.filter((e=>"both"===e.type||"single"===e.type)),this._rowActionsFloatingAll=t.filter((t=>this.enableRowSelection&&("both"===t.type||"multi"===t.type)||e&&"single"===t.type)).map((e=>("single"===e.type&&(e.disabled=this.selectedRows?.length>1),e)));let i=this.rowSelectionLimit;e&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;e&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let e=[...this._el.querySelectorAll("p-table-extra-header")];e=this._parseDefinitions(e),this._extraHeaders=e}_generateColumns(){let e=[...this._el.querySelectorAll("p-table-column")];e=this._parseDefinitions(e),this._columns=e}_getExtraHeader(){return this._extraHeaders?.length?o("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((e,t)=>o("p-table-cell",{checkboxOffset:0===t&&this._enableRowSelection,definition:e,index:t,variant:"header-secondary"},o("b",null,e.name))))):null}_getHeader(){return o("p-table-row",{variant:"header"},this._columns.map(((e,t)=>o("p-table-cell",{checkbox:0===t||e.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:e,index:t,value:e.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((e,t)=>o("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:t===this.amountOfLoadingRows-1},this._getLoadingColumns(t)))):0===this._items.length?this._getEmptyState():this._items.map(((e,t)=>o("p-table-row",{checked:this._selectionContains(t),enableHover:this._enableRowSelection||this.enableRowClick,isLast:t===this._items.length-1,onClick:e=>this._rowClick(e,t)},this._getRowColumns(e,t),this._getActions(e,t))))}_getActions(e,t){const i=this._rowActionsRow.filter((t=>!t.showFunction||t.showFunction(e)));return i?.length&&!c()?o("p-table-row-actions-container",{checked:this._selectionContains(t),slot:"actions"},i.map((t=>o("p-tooltip",{content:t.label,strategy:"fixed"},o("p-button",{icon:t.icon,iconFlip:t.iconFlip,iconOnly:!0,iconRotate:t.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof t.action&&t.action?.(e,!1)}))))):null}_getRowColumns(e,t){return this._columns.map(((i,s)=>o("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(t):null,definition:i,index:s,item:e,rowIndex:t})))}_getLoadingColumns(e){return this._columns.map(((t,i)=>o("p-table-cell",{checkbox:0===i||t.hasCheckbox?this._getCheckbox(e,"loading"):null,definition:t,index:i,rowIndex:e,variant:"loading"})))}_getCheckbox(e,t="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===t)return o("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===t)return o("p-checkbox",{checked:this._selectionContainsAll(),class:h({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:e=>this._selectAllChange(e)});const i=this._items[e],s=this._selectionContains(e);return o("p-checkbox",{checked:s,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!s&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:t=>this._checkboxChange(t,e)})}_getEmptyState(){return o("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",content:this.emptyStateFilteredContent(),header:this.emptyStateFilteredHeader(),illustration:"search"}:{actionIcon:"plus",actionText:this.emptyStateAction(),class:"my-16 self-center",content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,header:this.emptyStateHeader(),illustration:"table",onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(e,t){if(this._enableRowSelection){if(void 0===t?e?.detail??t:t){const e=[];for(let t=0;t<this._items.length;t++){const i=this._items[t];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(t)&&(e.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+e.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...e],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let e=0;e<this.selectedRows.length;e++){const t=this.selectedRows[e],i=this._items.find((i=>this._getSelectionValue(i,e)===this._getSelectionValue(t,e)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:e,target:t},i){if(!this._enableRowSelection)return;if(e&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(t.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(t.checked=!1);if(e)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(e,t){return this.selectionKey&&e?.[this.selectionKey]||t}_selectionContains(e,t=!1){const i=this.selectedRows.findIndex((t=>t.index===e));return t?i:-1!==i}_selectionContainsAll(){let e=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let t=0;t<this._items?.length;t++)if(!this._selectionContains(t)){e=!1;break}return e}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let e=0;for(let t=0;t<this._items?.length;t++)this._selectionContains(t)&&e++;return e>0&&e!==this._items.length}_rowClick(e,t){const i=e.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(e.target);if(this._findRowAction(e.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[t],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,t))}_findRow(e){return e?"p-table-row"===e?.tagName?.toLowerCase()?e:this._findRow(e?.parentElement):e}_findRowAction(e){return e?null!==e.dataset.isAction&&"false"!==e.dataset.isAction?e:"p-table-row"===e?.tagName?.toLowerCase()?null:this._findRowAction(e?.parentElement):null}_showFloatingMenu(){let e=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&e.some((e=>("single"===e.type||"both"===e.type)&&e.showFunction))&&(e=e.filter((e=>"multi"===e.type||!e.showFunction||e.showFunction(this.selectedRows[0])))),this._rowActionsFloating=e,this._floatingMenuShown=!0}_parseDefinitions(e){return e.map((e=>this._parseDefinitionSizes(e)))}_parseDefinitionSizes(e){const t=e;let i={default:"full"};"string"!=typeof e.sizes||["auto","hidden","full"].includes(e.sizes)||(e.sizes=JSON.parse(e.sizes));for(const[e,s]of m.entries())i[s]="auto"!==t.sizes&&"hidden"!==t.sizes&&"full"!==t.sizes&&"number"!=typeof t.sizes?t.sizes[s]??i[m[e-1]]:"auto"===t.sizes?"full":t.sizes;return e.parsedSizes=i,e}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}]}]);function N(){"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(e(t))||customElements.define(e(t),Y);break;case"p-badge":customElements.get(e(t))||u();break;case"p-button":customElements.get(e(t))||b();break;case"p-checkbox":customElements.get(e(t))||f();break;case"p-divider":customElements.get(e(t))||g();break;case"p-dropdown":customElements.get(e(t))||w();break;case"p-dropdown-menu-container":customElements.get(e(t))||k();break;case"p-dropdown-menu-item":customElements.get(e(t))||y();break;case"p-empty-state":customElements.get(e(t))||S();break;case"p-field":customElements.get(e(t))||_();break;case"p-field-container":customElements.get(e(t))||x();break;case"p-floating-menu-container":customElements.get(e(t))||C();break;case"p-floating-menu-item":customElements.get(e(t))||v();break;case"p-helper":customElements.get(e(t))||E();break;case"p-icon":customElements.get(e(t))||F();break;case"p-illustration":customElements.get(e(t))||A();break;case"p-loader":customElements.get(e(t))||R();break;case"p-pagination":customElements.get(e(t))||j();break;case"p-pagination-pages":customElements.get(e(t))||D();break;case"p-pagination-pages-item":customElements.get(e(t))||B();break;case"p-pagination-size":customElements.get(e(t))||z();break;case"p-segment-container":customElements.get(e(t))||L();break;case"p-segment-item":customElements.get(e(t))||T();break;case"p-table-cell":customElements.get(e(t))||H();break;case"p-table-container":customElements.get(e(t))||q();break;case"p-table-footer":customElements.get(e(t))||P();break;case"p-table-header":customElements.get(e(t))||O();break;case"p-table-row":customElements.get(e(t))||I();break;case"p-table-row-actions-container":customElements.get(e(t))||M();break;case"p-tooltip":customElements.get(e(t))||W()}}))}N();const Q=Y,U=N;export{Q as PTable,U as defineCustomElement}
1
+ import{t as e,p as t,H as i,c as s,h as o,d as a}from"./p-CySg37XO.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r}from"./p-3RT3BYex.js";import{f as c}from"./p-CWO2YJCh.js";import{c as h}from"./p-xs4N_Y-0.js";import{P as p,a as d,T as m}from"./p-CEaB2BT0.js";import{d as u}from"./p-BDDbB69D.js";import{d as b}from"./p-XWWy0siW.js";import{d as f}from"./p-Cpwq0YdW.js";import{d as g}from"./p-Pg_XF2ti.js";import{d as w}from"./p-CFSNSi-H.js";import{d as k}from"./p-Bl7NThUo.js";import{d as y}from"./p-Bqj-EqkF.js";import{d as S}from"./p-DgL1D6Aj.js";import{d as _}from"./p-B5p7dHkY.js";import{d as x}from"./p-BSZKPMsM.js";import{d as C}from"./p-Bv-ByGSf.js";import{d as v}from"./p-DexJ62g_.js";import{d as E}from"./p-eLkNCIS4.js";import{d as F}from"./p-DLBcQv2y.js";import{d as R}from"./p-CMmvAq1F.js";import{d as j}from"./p-CXxGdOem.js";import{d as A}from"./p-B4ldecyo.js";import{d as D}from"./p-Duu0fwUk.js";import{d as B}from"./p-DEW7r6Qi.js";import{d as z}from"./p-CKY-2A7w.js";import{d as L}from"./p-Ch0_FdYv.js";import{d as T}from"./p-Dq0MN0E1.js";import{d as H}from"./p-CGKUYLex.js";import{d as P}from"./p-BcD4BpWF.js";import{d as q}from"./p-a6F6aMNs.js";import{d as O}from"./p-DMxy9lYo.js";import{d as I}from"./p-g9hO5RJl.js";import{d as M}from"./p-Br5JzRPb.js";import{d as W}from"./p--y4GWpzd.js";const Y=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectedRowsChange=s(this,"selectedRowsChange",3),this.rowClick=s(this,"rowClick",3),this.rowSelected=s(this,"rowSelected",3),this.rowDeselected=s(this,"rowDeselected",3),this.hasRendered=s(this,"hasRendered",3),this.quickFilter=s(this,"quickFilter",3),this.queryChange=s(this,"queryChange",3),this.filter=s(this,"filter",3),this.action=s(this,"action",3),this.pageChange=s(this,"pageChange",3),this.pageSizeChange=s(this,"pageSizeChange",3),this.export=s(this,"export",3),this.emptyStateActionClick=s(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=e=>n((1===e?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",e));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=p;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 o(a,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},o("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&o("p-table-header",{key:"6a1af71c86b2b23d26d8d344b1528b1356d7bd7b",actionButtonTemplate:this.actionButtonTemplate,actionIcon:this.actionButtonIcon,actionLoading:this.actionButtonLoading,actionText:this.actionButtonText,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,canUseAction:this.actionButtonEnabled,class:"mb-8",enableAction:this.enableAction,enableExport:this.enableExport,enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,enableSearch:this.enableSearch,filterButtonTemplate:this.filterButtonTemplate,itemsSelectedAmount:this.selectedRows?.length,loading:this.headerLoading,query:this.query,quickFilters:this.quickFilters,selectedFiltersAmount:this.selectedFiltersAmount,onAction:()=>this.action.emit(),onExport:()=>this.export.emit(),onFilter:()=>this.filter.emit(),onQueryChange:({detail:e})=>this.queryChange.emit(e),onQuickFilter:({detail:e})=>this.quickFilter.emit(e)},this._hasCustomFilterSlot&&o("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?o("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),enableAmountSelected:!!this._rowActionsFloating?.length,usedInTable:!0,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((e=>o("p-floating-menu-item",{disabled:e.disabled,icon:e.icon,iconFlip:e.iconFlip,iconRotate:e.iconRotate,loading:e.loading,slot:"floating-menu-item",onClick:()=>e.disabled||e.loading||!e.action||"single"!==e.type?e.action(this.selectedRows,!0):e.action(this.selectedRows[0],!1)},e.label)))):"",this.enableFooter&&o("p-table-footer",{key:"57d24f1f3803e58053eba3da5fad1ab6474eccc6",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,loading:this.footerLoading,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled,total:this.total,onHiddenChange:({detail:e})=>this._footerHidden=e,onPageChange:({detail:e})=>this.pageChange.emit(e),onPageSizeChange:({detail:e})=>this.pageSizeChange.emit(e)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:e}){"Control"===e&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:e}){"Control"===e&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(e){this._items=e?Array.isArray(e)?e:JSON.parse(e):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const e=c(),t=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=t.filter((e=>"both"===e.type||"single"===e.type)),this._rowActionsFloatingAll=t.filter((t=>this.enableRowSelection&&("both"===t.type||"multi"===t.type)||e&&"single"===t.type)).map((e=>("single"===e.type&&(e.disabled=this.selectedRows?.length>1),e)));let i=this.rowSelectionLimit;e&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;e&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let e=[...this._el.querySelectorAll("p-table-extra-header")];e=this._parseDefinitions(e),this._extraHeaders=e}_generateColumns(){let e=[...this._el.querySelectorAll("p-table-column")];e=this._parseDefinitions(e),this._columns=e}_getExtraHeader(){return this._extraHeaders?.length?o("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((e,t)=>o("p-table-cell",{checkboxOffset:0===t&&this._enableRowSelection,definition:e,index:t,variant:"header-secondary"},o("b",null,e.name))))):null}_getHeader(){return o("p-table-row",{variant:"header"},this._columns.map(((e,t)=>o("p-table-cell",{checkbox:0===t||e.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:e,index:t,value:e.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((e,t)=>o("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:t===this.amountOfLoadingRows-1},this._getLoadingColumns(t)))):0===this._items.length?this._getEmptyState():this._items.map(((e,t)=>o("p-table-row",{checked:this._selectionContains(t),enableHover:this._enableRowSelection||this.enableRowClick,isLast:t===this._items.length-1,onClick:e=>this._rowClick(e,t)},this._getRowColumns(e,t),this._getActions(e,t))))}_getActions(e,t){const i=this._rowActionsRow.filter((t=>!t.showFunction||t.showFunction(e)));return i?.length&&!c()?o("p-table-row-actions-container",{checked:this._selectionContains(t),slot:"actions"},i.map((t=>o("p-tooltip",{content:t.label,strategy:"fixed"},o("p-button",{icon:t.icon,iconFlip:t.iconFlip,iconOnly:!0,iconRotate:t.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof t.action&&t.action?.(e,!1)}))))):null}_getRowColumns(e,t){return this._columns.map(((i,s)=>o("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(t):null,definition:i,index:s,item:e,rowIndex:t})))}_getLoadingColumns(e){return this._columns.map(((t,i)=>o("p-table-cell",{checkbox:0===i||t.hasCheckbox?this._getCheckbox(e,"loading"):null,definition:t,index:i,rowIndex:e,variant:"loading"})))}_getCheckbox(e,t="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===t)return o("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===t)return o("p-checkbox",{checked:this._selectionContainsAll(),class:h({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:e=>this._selectAllChange(e)});const i=this._items[e],s=this._selectionContains(e);return o("p-checkbox",{checked:s,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!s&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:t=>this._checkboxChange(t,e)})}_getEmptyState(){return o("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",content:this.emptyStateFilteredContent(),header:this.emptyStateFilteredHeader(),illustration:"search"}:{actionIcon:"plus",actionText:this.emptyStateAction(),class:"my-16 self-center",content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,header:this.emptyStateHeader(),illustration:"table",onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(e,t){if(this._enableRowSelection){if(void 0===t?e?.detail??t:t){const e=[];for(let t=0;t<this._items.length;t++){const i=this._items[t];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(t)&&(e.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+e.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...e],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let e=0;e<this.selectedRows.length;e++){const t=this.selectedRows[e],i=this._items.find((i=>this._getSelectionValue(i,e)===this._getSelectionValue(t,e)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:e,target:t},i){if(!this._enableRowSelection)return;if(e&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(t.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(t.checked=!1);if(e)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(e,t){return this.selectionKey&&e?.[this.selectionKey]||t}_selectionContains(e,t=!1){const i=this.selectedRows.findIndex((t=>t.index===e));return t?i:-1!==i}_selectionContainsAll(){let e=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let t=0;t<this._items?.length;t++)if(!this._selectionContains(t)){e=!1;break}return e}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let e=0;for(let t=0;t<this._items?.length;t++)this._selectionContains(t)&&e++;return e>0&&e!==this._items.length}_rowClick(e,t){const i=e.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(e.target);if(this._findRowAction(e.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[t],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,t))}_findRow(e){return e?"p-table-row"===e?.tagName?.toLowerCase()?e:this._findRow(e?.parentElement):e}_findRowAction(e){return e?null!==e.dataset.isAction&&"false"!==e.dataset.isAction?e:"p-table-row"===e?.tagName?.toLowerCase()?null:this._findRowAction(e?.parentElement):null}_showFloatingMenu(){let e=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&e.some((e=>("single"===e.type||"both"===e.type)&&e.showFunction))&&(e=e.filter((e=>"multi"===e.type||!e.showFunction||e.showFunction(this.selectedRows[0])))),this._rowActionsFloating=e,this._floatingMenuShown=!0}_parseDefinitions(e){return e.map((e=>this._parseDefinitionSizes(e)))}_parseDefinitionSizes(e){const t=e;let i={default:"full"};"string"!=typeof e.sizes||["auto","hidden","full"].includes(e.sizes)||(e.sizes=JSON.parse(e.sizes));for(const[e,s]of m.entries())i[s]="auto"!==t.sizes&&"hidden"!==t.sizes&&"full"!==t.sizes&&"number"!=typeof t.sizes?t.sizes[s]??i[m[e-1]]:"auto"===t.sizes?"full":t.sizes;return e.parsedSizes=i,e}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}]}]);function N(){"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(e(t))||customElements.define(e(t),Y);break;case"p-badge":customElements.get(e(t))||u();break;case"p-button":customElements.get(e(t))||b();break;case"p-checkbox":customElements.get(e(t))||f();break;case"p-divider":customElements.get(e(t))||g();break;case"p-dropdown":customElements.get(e(t))||w();break;case"p-dropdown-menu-container":customElements.get(e(t))||k();break;case"p-dropdown-menu-item":customElements.get(e(t))||y();break;case"p-empty-state":customElements.get(e(t))||S();break;case"p-field":customElements.get(e(t))||_();break;case"p-field-container":customElements.get(e(t))||x();break;case"p-floating-menu-container":customElements.get(e(t))||C();break;case"p-floating-menu-item":customElements.get(e(t))||v();break;case"p-helper":customElements.get(e(t))||E();break;case"p-icon":customElements.get(e(t))||F();break;case"p-illustration":customElements.get(e(t))||R();break;case"p-loader":customElements.get(e(t))||j();break;case"p-pagination":customElements.get(e(t))||A();break;case"p-pagination-pages":customElements.get(e(t))||D();break;case"p-pagination-pages-item":customElements.get(e(t))||B();break;case"p-pagination-size":customElements.get(e(t))||z();break;case"p-segment-container":customElements.get(e(t))||L();break;case"p-segment-item":customElements.get(e(t))||T();break;case"p-table-cell":customElements.get(e(t))||H();break;case"p-table-container":customElements.get(e(t))||P();break;case"p-table-footer":customElements.get(e(t))||q();break;case"p-table-header":customElements.get(e(t))||O();break;case"p-table-row":customElements.get(e(t))||I();break;case"p-table-row-actions-container":customElements.get(e(t))||M();break;case"p-tooltip":customElements.get(e(t))||W()}}))}N();const Q=Y,U=N;export{Q as PTable,U as defineCustomElement}
@@ -256,6 +256,7 @@ const Dropdown = class {
256
256
  isOpen;
257
257
  _loaded = false;
258
258
  _menu;
259
+ _trigger;
259
260
  _cleanup;
260
261
  componentShouldUpdate() {
261
262
  this._update();
@@ -275,16 +276,16 @@ const Dropdown = class {
275
276
  this._checkItems();
276
277
  }
277
278
  render() {
278
- return (h(Host, { key: 'f0b2ce04023c667bf22d051c29beaa53549ed637', class: 'relative' }, h("div", { key: 'c73fb7356e6948923b340983b22ceed3ec35b303', class: 'trigger', onClick: () => this._triggerClickHandler() }, h("slot", { key: '2204a45e84b794f6c57e3eb2731b28af6b9b9b95', name: 'trigger' })), h("div", { key: '6485ef65336ae895e9b6943880aed380ea409ea2', class: 'relative w-full' }, h("p-dropdown-menu-container", { key: '4aa30289b1b7522542db38fb1e29a6f203a64e16', allowOverflow: this.allowOverflow, class: cn(dropdownContainerClass({
279
+ return (h(Host, { key: '6b7b418a8b5e962f6881418630e9f284a8ed1785', class: 'relative' }, h("div", { key: '46fb2c0286f69da71e4fbf940123761ee1869077', class: 'trigger', ref: el => (this._trigger = el), onClick: () => this._triggerClickHandler() }, h("slot", { key: 'c9bb61458cfb2ef3dc99f04d699d83a173e94789', name: 'trigger' })), h("div", { key: '33693a79995e4fe465c3d9576f512115ca8c9c9c', class: 'relative w-full' }, h("p-dropdown-menu-container", { key: 'ca8c374c376c5529f8b1b91e542f3e6898038fbd', allowOverflow: this.allowOverflow, class: cn(dropdownContainerClass({
279
280
  strategy: this.strategy,
280
281
  maxWidth: this.applyMaxWidth,
281
282
  fullWidth: this.applyFullWidth && !this.applyMaxWidth,
282
283
  isDatepicker: this.isDatepicker,
283
- }), this.containerClass), "data-placement": this.placement, "data-strategy": this.strategy, fullWidth: this.applyFullWidth && !this.applyMaxWidth, maxWidth: this.applyMaxWidth, ref: el => this._load(el), role: 'popover', scrollable: this.scrollable, variant: this.variant, onClick: () => this._containerClickHandler() }, h("slot", { key: '60036ad51052c0ea0133f414857b3a329908fb98', name: 'items' })))));
284
+ }), this.containerClass), "data-placement": this.placement, "data-strategy": this.strategy, fullWidth: this.applyFullWidth && !this.applyMaxWidth, maxWidth: this.applyMaxWidth, ref: el => this._load(el), role: 'popover', scrollable: this.scrollable, variant: this.variant, onClick: () => this._containerClickHandler() }, h("slot", { key: '544f91dfb12b2f3e9a37b319270c75c2eed95662', name: 'items' })))));
284
285
  }
285
286
  _checkButtons(active = false) {
286
287
  const buttons = this._el.querySelectorAll('p-button[slot="trigger"]');
287
- const isOpen = this._menu.dataset.show === '';
288
+ const isOpen = this._menu.dataset.show === 'true';
288
289
  for (let button of buttons) {
289
290
  button.disabled = this.disableTriggerClick;
290
291
  button.active = active;
@@ -329,8 +330,9 @@ const Dropdown = class {
329
330
  this._show();
330
331
  }
331
332
  documentClickHandler(event) {
332
- if (!Object.hasOwn(this._menu.dataset, 'show') ||
333
- childOfComposed(event, this._menu)) {
333
+ if (this._menu.dataset.show === 'false' ||
334
+ childOfComposed(event, this._menu) ||
335
+ childOfComposed(event, this._trigger)) {
334
336
  return;
335
337
  }
336
338
  this._hide();
@@ -350,7 +352,8 @@ const Dropdown = class {
350
352
  if (this.manual) {
351
353
  return;
352
354
  }
353
- if (Object.hasOwn(this._menu.dataset, 'show')) {
355
+ const isOpen = this._menu.dataset.show === 'true';
356
+ if (isOpen) {
354
357
  this._hide();
355
358
  return;
356
359
  }
@@ -371,7 +374,7 @@ const Dropdown = class {
371
374
  return;
372
375
  }
373
376
  this._cleanup = autoUpdate(this._el, this._menu, () => this._update());
374
- this._menu.dataset.show = '';
377
+ this._menu.dataset.show = 'true';
375
378
  this._menu.classList.remove('hidden');
376
379
  this._menu.classList.add('block');
377
380
  this.isOpen.emit(true);
@@ -386,7 +389,7 @@ const Dropdown = class {
386
389
  this._cleanup = null;
387
390
  }
388
391
  // Hide the popover
389
- delete this._menu.dataset.show;
392
+ this._menu.dataset.show = 'false';
390
393
  this._menu.classList.remove('block');
391
394
  this._menu.classList.add('hidden');
392
395
  this.isOpen.emit(false);
package/dist/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-99950bb2.js"><link rel="modulepreload" href="/build/p-6XOzWrsN.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CSySY6aC.js"><link rel="modulepreload" href="/build/p-CXVK8SLW.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-xs4N_Y-0.js"><link rel="modulepreload" href="/build/p-yFtRjnrU.js"><script type="module" src="/build/p-99950bb2.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <link href="/build/p-ea6cc0bf.css" rel="stylesheet"> </head> <body> <p-button>Test</p-button> <script data-build="2026-02-06T13:05:07">
1
+ <!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-57abbf5d.js"><link rel="modulepreload" href="/build/p-6XOzWrsN.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CSySY6aC.js"><link rel="modulepreload" href="/build/p-CXVK8SLW.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-xs4N_Y-0.js"><link rel="modulepreload" href="/build/p-yFtRjnrU.js"><script type="module" src="/build/p-57abbf5d.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <link href="/build/p-ea6cc0bf.css" rel="stylesheet"> </head> <body> <p-button>Test</p-button> <script data-build="2026-02-12T10:54:11">
2
2
  if ('serviceWorker' in navigator && location.protocol !== 'file:') {
3
3
  window.addEventListener('load', function() {
4
4
  navigator.serviceWorker.register('/sw.js')