@paperless/core 2.22.0-alpha.41 → 2.22.0-alpha.43
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.
- package/dist/{paperless/p-78ffff6a.entry.js → build/p-03121981.entry.js} +1 -1
- package/dist/build/p-1b335285.entry.js +1 -0
- package/dist/build/{p-c4d3df4f.js → p-53a82cc8.js} +1 -1
- package/dist/build/{p-f38db824.entry.js → p-96599994.entry.js} +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-checkbox_3.cjs.entry.js +6 -5
- package/dist/cjs/p-content-slider.cjs.entry.js +5 -4
- package/dist/cjs/p-empty-state_8.cjs.entry.js +4 -3
- package/dist/cjs/p-tooltip.cjs.entry.js +6 -5
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +6 -5
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +5 -4
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +6 -5
- package/dist/collection/components/molecules/table/footer/table-footer.component.css +1 -1
- package/dist/collection/components/molecules/table/footer/table-footer.component.js +3 -2
- package/dist/components/{p-B1C3pWHd.js → p--y4GWpzd.js} +1 -1
- package/dist/components/{p-DKnG790x.js → p-B5p7dHkY.js} +1 -1
- package/dist/components/{p-B4SlrLmQ.js → p-BSZKPMsM.js} +1 -1
- package/dist/components/{p-DeN_SuJc.js → p-CLSdb2d9.js} +1 -1
- package/dist/components/{p-DrjlghgA.js → p-CsM6uU5j.js} +1 -1
- package/dist/components/{p-BhgmuAMP.js → p-DMxy9lYo.js} +1 -1
- package/dist/components/{p-J6tyjX7a.js → p-Di2sUFEC.js} +1 -1
- package/dist/components/{p-DBf1mJgp.js → p-LPQSLn5-.js} +1 -1
- package/dist/components/{p-C_cIWc9H.js → p-S2ExrdpO.js} +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-datepicker.js +1 -1
- package/dist/components/p-dropdown.js +1 -1
- package/dist/components/{p-D63yb0hu.js → p-eLkNCIS4.js} +1 -1
- package/dist/components/p-field-container.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-gC6gM50g.js +1 -0
- package/dist/components/p-helper.js +1 -1
- package/dist/components/p-pagination-pages.js +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-select.js +1 -1
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table.js +1 -1
- package/dist/components/p-tooltip.js +1 -1
- package/dist/esm/p-checkbox_3.entry.js +6 -5
- package/dist/esm/p-content-slider.entry.js +5 -4
- package/dist/esm/p-empty-state_8.entry.js +4 -3
- package/dist/esm/p-tooltip.entry.js +6 -5
- package/dist/index.html +1 -1
- package/dist/{build/p-78ffff6a.entry.js → paperless/p-03121981.entry.js} +1 -1
- package/dist/paperless/p-1b335285.entry.js +1 -0
- package/dist/paperless/{p-f38db824.entry.js → p-96599994.entry.js} +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/hydrate/index.js +21 -17
- package/hydrate/index.mjs +21 -17
- package/package.json +2 -2
- package/dist/build/p-72da9cc9.entry.js +0 -1
- package/dist/components/p-B2QTs61q.js +0 -1
- package/dist/paperless/p-72da9cc9.entry.js +0 -1
- /package/dist/build/{p-d04029f6.entry.js → p-1c1eddff.entry.js} +0 -0
- /package/dist/paperless/{p-d04029f6.entry.js → p-1c1eddff.entry.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as a,H as t,c as r,h as i,F as o}from"./p-CySg37XO.js";import{c as s}from"./p-CBWjHURv.js";import{T as p}from"./p-Au2WuEGF.js";import{P as
|
|
1
|
+
import{t as e,p as a,H as t,c as r,h as i,F as o}from"./p-CySg37XO.js";import{c as s}from"./p-CBWjHURv.js";import{T as p}from"./p-Au2WuEGF.js";import{P as d,a as n}from"./p-CEaB2BT0.js";import{d as c}from"./p-XWWy0siW.js";import{d as m}from"./p-Cpwq0YdW.js";import{d as h}from"./p-Pg_XF2ti.js";import{d as g}from"./p-CLSdb2d9.js";import{d as b}from"./p-Bl7NThUo.js";import{d as l}from"./p-Bqj-EqkF.js";import{d as f}from"./p-B5p7dHkY.js";import{d as k}from"./p-BSZKPMsM.js";import{d as u}from"./p-eLkNCIS4.js";import{d as w}from"./p-DLBcQv2y.js";import{d as y}from"./p-CXxGdOem.js";import{d as x}from"./p-LPQSLn5-.js";import{d as E}from"./p-DEW7r6Qi.js";import{d as j}from"./p-S2ExrdpO.js";import{d as P}from"./p--y4GWpzd.js";const z=s(["p-pagination","items-center gap-2","rounded-full","bg-off-white-300 border border-solid border-off-white-700","dark:bg-hurricane-500 dark:border-hurricane-400","p-1"],{variants:{hidden:{false:"flex",true:"hidden"}}}),S=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pageChange=r(this,"pageChange",3),this.pageSizeChange=r(this,"pageSizeChange",3),this.pagesChange=r(this,"pagesChange",3)}hideOnSinglePage=!0;enablePaginationSize=!0;enablePaginationPages=!0;page=1;total;pageSize=d;pageSizeOptions=n;pageChange;pageSizeChange;pagesChange;_hasPaginationPages=!0;render(){const e=this.hideOnSinglePage&&this.total<=this.pageSizeOptions?.[0];return i(p,{key:"bb991c6f71f5824182288a5976a1ed5d7a5d6ae1"},i("div",{key:"80bc0a9d7440759d64b46d5545fe1e3ab2d5b339",class:z({hidden:e&&!this._hasPaginationPages||!this.enablePaginationSize&&!this.enablePaginationPages})},this.enablePaginationPages&&this.enablePaginationSize&&i(o,{key:"5812bfaaee47936e0f1d910c4da0421589e5cf9b"},i("p-pagination-size",{key:"2fe1f8e733d96ef2843d184f17c02b2db44b3fb5",hidden:e,size:this.pageSize,sizeOptions:this.pageSizeOptions,onSizeChange:({detail:e})=>this._changePageSize(e)}),!e&&this.hideOnSinglePage&&this._hasPaginationPages&&i("p-divider",{key:"fa14cc1d718604f931f95ee9d2accd28b1bf43e7",class:"mx-0 h-4 text-off-white-700 dark:text-hurricane-400",variant:"vertical"})),this.enablePaginationPages&&i("p-pagination-pages",{key:"265840dfb523c4330e5c44a00fe28d9397f7b45c",hideOnSinglePage:this.hideOnSinglePage,page:this.page,pageSize:this.pageSize,total:this.total,onPageChange:({detail:e})=>this.pageChange.emit(e),onPagesChange:({detail:e})=>{this._hasPaginationPages=e>1,this.pagesChange.emit(e)}})))}_changePageSize(e){e&&(this.pageSize=e,this.pageSizeChange.emit(this.pageSize))}static get style(){return"*{box-sizing:border-box}.static{position:static}.mx-0{margin-left:0;margin-right:0}.flex{display:flex}.hidden{display:none}.h-4{height:1rem}.items-center{align-items:center}.gap-2{gap:.5rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.p-1{padding:.25rem}.text-off-white-700{--tw-text-opacity:1;color:rgb(222 219 213/var(--tw-text-opacity,1))}.dark\\:border-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:border-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}.dark\\:bg-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(54 60 70/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}"}},[513,"p-pagination",{hideOnSinglePage:[4,"hide-on-single-page"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],_hasPaginationPages:[32]}]);function v(){"undefined"!=typeof customElements&&["p-pagination","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-pages","p-pagination-pages-item","p-pagination-size","p-tooltip"].forEach((a=>{switch(a){case"p-pagination":customElements.get(e(a))||customElements.define(e(a),S);break;case"p-button":customElements.get(e(a))||c();break;case"p-checkbox":customElements.get(e(a))||m();break;case"p-divider":customElements.get(e(a))||h();break;case"p-dropdown":customElements.get(e(a))||g();break;case"p-dropdown-menu-container":customElements.get(e(a))||b();break;case"p-dropdown-menu-item":customElements.get(e(a))||l();break;case"p-field":customElements.get(e(a))||f();break;case"p-field-container":customElements.get(e(a))||k();break;case"p-helper":customElements.get(e(a))||u();break;case"p-icon":customElements.get(e(a))||w();break;case"p-loader":customElements.get(e(a))||y();break;case"p-pagination-pages":customElements.get(e(a))||x();break;case"p-pagination-pages-item":customElements.get(e(a))||E();break;case"p-pagination-size":customElements.get(e(a))||j();break;case"p-tooltip":customElements.get(e(a))||P()}}))}v();export{S as P,v 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
|
|
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}from"./p-XWWy0siW.js";import{d as c}from"./p-Cpwq0YdW.js";import{d as m}from"./p-CLSdb2d9.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 b}from"./p-CXxGdOem.js";import{d as y}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))||d();break;case"p-checkbox":customElements.get(e(t))||c();break;case"p-dropdown":customElements.get(e(t))||m();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))||b();break;case"p-pagination-pages-item":customElements.get(e(t))||y();break;case"p-tooltip":customElements.get(e(t))||v()}}))}j();export{E as P,j as d}
|
|
@@ -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-
|
|
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-CLSdb2d9.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 a,c as r,h as o,F as i}from"./p-CySg37XO.js";import{c as d}from"./p-CBWjHURv.js";import{h as s,f as l}from"./p-CWO2YJCh.js";import{c}from"./p-xs4N_Y-0.js";import{d as h}from"./p-XWWy0siW.js";import{d as n}from"./p-
|
|
1
|
+
import{t as e,p as t,H as a,c as r,h as o,F as i}from"./p-CySg37XO.js";import{c as d}from"./p-CBWjHURv.js";import{h as s,f as l}from"./p-CWO2YJCh.js";import{c}from"./p-xs4N_Y-0.js";import{d as h}from"./p-XWWy0siW.js";import{d as n}from"./p-BSZKPMsM.js";import{d as p}from"./p-eLkNCIS4.js";import{d as b}from"./p-DLBcQv2y.js";import{d as m}from"./p-CXxGdOem.js";import{d as f}from"./p--y4GWpzd.js";const w=d(["flex flex-1 items-center justify-start gap-2","h-8 min-w-0 px-2 rounded-lg","border border-solid","bg-white-600 text-storm-200","dark:bg-white/15 dark:text-hurricane-200"],{variants:{click:{false:null,true:"cursor-pointer"},error:{false:"border-storm-100 dark:border-white/15",true:"border-negative-red-500 dark:border-negative-red-alternative"}}}),k=t(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.upload=r(this,"upload",3),this.download=r(this,"download",3),this.delete=r(this,"delete",3)}enableCameraOnMobile=!1;value;fileId;accept=null;label;helper;required=!0;mode="read";placeholder="Upload a file...";cameraTooltip="Camera";downloadTooltip="Download";uploadTooltip="Upload";deleteTooltip="Delete";loading=!1;error;upload;download;delete;_fileRef;_cameraFileRef;render(){let e=o("p-icon",{key:"c32bd5160f16b5fe66dd6bdddc7abab643ecac69",class:"text-storm-300",variant:"attachment"});this.error&&(e=o("p-icon",{key:"258cc04fd6a6ca24cc99fd4402740c600c845641",class:"text-negative-red-500",variant:"warning"}));const t=s(),a="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm";return o(i,{key:"2d4812f3d31f3cd0816628933c7f430526db82d6"},o("p-field-container",{key:"349206b933ad13c0f37cd07d2a8da5b7be1a5c06",error:this.error,forceShowTooltip:!!this.error?.length,helper:this.helper,label:this.label,required:this.required,variant:"write"},o("div",{key:"59d1189891173772085e25882c3fcb474e459e0a",class:"flex w-full items-start gap-2",slot:"content"},o("div",{key:"41b8af0f2636db293df1e503effbd1ec7f97685b",class:w({click:"write"===this.mode&&!this.value?.length,error:!!this.error?.length}),onClick:()=>this._uploadClick()},e,o("span",{key:"d53642b51ad59ff0b5ccf497085ba81f4111bebf",class:c(a,"peer empty:hidden dark:text-white")},this.value),o("span",{key:"285839432a117ed07ad59c5d66e5784109ac5f79",class:c(a,"hidden peer-empty:block")},this.placeholder)),o("p-tooltip",{key:"1e5cd8b15e61316f678fb7b66af77969a3cb403a",class:"w-8",content:"read"===this.mode?this.downloadTooltip:this.value?.length?this.deleteTooltip:this.uploadTooltip},o("p-button",{key:"a0f090e19e177cff757ebae1fc2f5d1f4df8db68",disabled:this.loading,icon:"read"===this.mode?"download":this.value?.length?"trash":"upload",iconOnly:!0,loading:this.loading,slot:"trigger",variant:"secondary",onOnClick:()=>"write"!==this.mode||this.value?.length?("read"===this.mode?this.download:this.delete).emit():this._uploadClick()})),this.enableCameraOnMobile&&"write"===this.mode&&t&&!this.value?.length&&o("p-tooltip",{key:"2b41ef669b3fc1e58a394d847a30b1316f0e3a0d",class:"w-8 desktop-xs:hidden",content:this.cameraTooltip},o("p-button",{key:"b3ddba24285c00e05397221a77f73a08164c6953",icon:"camera",iconOnly:!0,slot:"trigger",variant:"secondary",onOnClick:()=>this._cameraClick()})))),o("input",{key:"5eec66f53142eb76391fbd626a01556470ce395a",accept:Array.isArray(this.accept)?this.accept?.join(","):this.accept,class:"hidden",ref:e=>this._fileRef=e,type:"file",onChange:e=>this._onFileChange(e)}),o("input",{key:"288987b14646880b3fbe960514e0b5915b421270",accept:"image/*",capture:"true",class:"hidden",ref:e=>this._cameraFileRef=e,type:"file",onChange:e=>this._onFileChange(e)}))}_uploadClick(){this._fileRef&&"write"===this.mode&&!this.value?.length&&this._fileRef.click()}_cameraClick(){this.enableCameraOnMobile&&!l()&&this._cameraFileRef&&"write"===this.mode&&this._cameraFileRef?.click()}_onFileChange(e){const t=e.target,a=t.files?.[0];if(a){this.loading=!0;const e=new FileReader;e.addEventListener("load",(e=>this._onLoad(a,e?.currentTarget?.result))),e.readAsDataURL(a)}}_onLoad(e,t){this.upload.emit({fileId:this.fileId,result:t,file:e}),this._fileRef&&(this._fileRef.value=""),this._cameraFileRef&&(this._cameraFileRef.value=""),this.loading=!1}static get style(){return".block{display:block}*{box-sizing:border-box}:host{display:block;width:100%}.static{position:static}.flex{display:flex}.hidden{display:none}.h-8{height:2rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-negative-red-500{--tw-border-opacity:1;border-color:rgb(230 30 30/var(--tw-border-opacity,1))}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-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}.text-negative-red-500{--tw-text-opacity:1;color:rgb(230 30 30/var(--tw-text-opacity,1))}.text-storm-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))}.empty\\:hidden:empty{display:none}.peer:empty~.peer-empty\\:block{display:block}@media (min-width:64rem){.desktop-xs\\:hidden{display:none}}.dark\\:border-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-color:hsla(0,0%,100%,.15)}.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-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\\:border-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where([data-theme=dark],[data-theme=dark] *){border-color:hsla(0,0%,100%,.15)}.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-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[513,"p-attachment",{enableCameraOnMobile:[4,"enable-camera-on-mobile"],value:[1],fileId:[1,"file-id"],accept:[1],label:[1],helper:[1],required:[516],mode:[1],placeholder:[1],cameraTooltip:[1,"camera-tooltip"],downloadTooltip:[1,"download-tooltip"],uploadTooltip:[1,"upload-tooltip"],deleteTooltip:[1,"delete-tooltip"],loading:[4],error:[1]}]);function y(){"undefined"!=typeof customElements&&["p-attachment","p-button","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((t=>{switch(t){case"p-attachment":customElements.get(e(t))||customElements.define(e(t),k);break;case"p-button":customElements.get(e(t))||h();break;case"p-field-container":customElements.get(e(t))||n();break;case"p-helper":customElements.get(e(t))||p();break;case"p-icon":customElements.get(e(t))||b();break;case"p-loader":customElements.get(e(t))||m();break;case"p-tooltip":customElements.get(e(t))||f()}}))}y();const g=k,u=y;export{g as PAttachment,u as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as s,d as o}from"./p-CsM6uU5j.js";const p=s,r=o;export{p as PCalendar,r as defineCustomElement}
|
|
@@ -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-
|
|
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-CLSdb2d9.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-
|
|
1
|
+
import{D as o,d as s}from"./p-CLSdb2d9.js";const d=o,p=s;export{d as PDropdown,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as r,h as a}from"./p-CySg37XO.js";import{T as o}from"./p-Au2WuEGF.js";import{d as s}from"./p-DLBcQv2y.js";import{d as c}from"./p
|
|
1
|
+
import{t,p as e,H as r,h as a}from"./p-CySg37XO.js";import{T as o}from"./p-Au2WuEGF.js";import{d as s}from"./p-DLBcQv2y.js";import{d as c}from"./p--y4GWpzd.js";const i=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}strategy="absolute";placement="top";render(){return a(o,{key:"d7f07b4f232bb43ce0988ea8533353a8d193e7bf"},a("p-tooltip",{key:"df76c8696c9621a6ea5431c5d256eded55de0b57",class:"flex",placement:this.placement,strategy:this.strategy},a("p-icon",{key:"e7c4d59174ec46413381af510485a890fcab91f8",class:"cursor-pointer text-storm-300 hover:text-storm-500 dark:text-hurricane-300 dark:hover:text-hurricane-200",size:"sm",slot:"trigger",variant:"question-circle"}),a("div",{key:"1173d658220d127af6982fb2939f7493a84cf52d",slot:"content"},a("slot",{key:"53d7d9c9c9c919ba312dc57f92d68fdc5f6b385c"}))))}static get style(){return".inline-flex{display:inline-flex}.h-\\[0\\.875rem\\]{height:.875rem}.w-\\[0\\.875rem\\]{width:.875rem}*{box-sizing:border-box}:host{display:inline-flex;height:.875rem;width:.875rem}.static{position:static}.absolute{position:absolute}.flex{display:flex}.cursor-pointer{cursor:pointer}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:text-hurricane-300:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.dark\\:hover\\:text-hurricane-200:hover: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-hurricane-300:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.dark\\:hover\\:text-hurricane-200:hover:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}"}},[769,"p-helper",{strategy:[1],placement:[1]}]);function d(){"undefined"!=typeof customElements&&["p-helper","p-icon","p-tooltip"].forEach((e=>{switch(e){case"p-helper":customElements.get(t(e))||customElements.define(t(e),i);break;case"p-icon":customElements.get(t(e))||s();break;case"p-tooltip":customElements.get(t(e))||c()}}))}d();export{i as H,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as
|
|
1
|
+
import{F as s,d as o}from"./p-BSZKPMsM.js";const p=s,r=o;export{p as PFieldContainer,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,d as
|
|
1
|
+
import{F as o,d as p}from"./p-B5p7dHkY.js";const s=o,r=p;export{s as PField,r as defineCustomElement}
|
|
@@ -0,0 +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-CLSdb2d9.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-Di2sUFEC.js";import{d as y}from"./p-LPQSLn5-.js";import{d as z}from"./p-DEW7r6Qi.js";import{d as S}from"./p-S2ExrdpO.js";import{d as P}from"./p--y4GWpzd.js";const j=o(["justify-center relative","w-full px-6","pointer-events-none","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:"b4d2d2593767e487424eea1aadc988b272b0d0b5"},n("div",{key:"bc15f489a739c85e5082ca6b7098fd75e61f3257",class:j({pinned:this._isPinned,hidden:this._hidden,tableHeaderHasAction:this.tableHeaderHasAction})},(this.enablePaginationPages||this.enablePaginationSize)&&this.total>0&&n("p-pagination",{key:"64f707817de608a06376420d6914c11af89b808f",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'.sticky{position:sticky}.z-\\[1\\]{z-index:1}*{box-sizing:border-box}:host{--tw-content:"";position:sticky;z-index:1}.pointer-events-none{pointer-events:none}.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{H as o,d as s}from"./p-
|
|
1
|
+
import{H as o,d as s}from"./p-eLkNCIS4.js";const p=o,r=s;export{p as PHelper,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as o,d as
|
|
1
|
+
import{P as o,d as s}from"./p-LPQSLn5-.js";const p=o,r=s;export{p as PPaginationPages,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as o,d as
|
|
1
|
+
import{P as o,d as p}from"./p-S2ExrdpO.js";const r=o,s=p;export{r as PPaginationSize,s as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as
|
|
1
|
+
import{P as s,d as o}from"./p-Di2sUFEC.js";const p=s,r=o;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-
|
|
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-CLSdb2d9.js";import{d as p}from"./p-Bl7NThUo.js";import{d as l}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,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))||p();break;case"p-icon":customElements.get(t(e))||l();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-DeN_SuJc.js";import{d as u}from"./p-Bl7NThUo.js";import{d as w}from"./p-Bqj-EqkF.js";import{d as y}from"./p-DKnG790x.js";import{d as x}from"./p-B4SlrLmQ.js";import{d as g}from"./p-D63yb0hu.js";import{d as v}from"./p-DLBcQv2y.js";import{d as f}from"./p-CXxGdOem.js";import{d as b}from"./p-B1C3pWHd.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:"85f6409928f327efcfc78cef1dddb9c30178e6ed",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"9c892e4edc472af73e0c2cbba419012d08302adc",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:"6fa19bac84f26dbc0c3aa97985c6deb40c4eb641",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-CLSdb2d9.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:"85f6409928f327efcfc78cef1dddb9c30178e6ed",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"9c892e4edc472af73e0c2cbba419012d08302adc",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:"6fa19bac84f26dbc0c3aa97985c6deb40c4eb641",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 +1 @@
|
|
|
1
|
-
import{T as
|
|
1
|
+
import{T as o,d as s}from"./p-gC6gM50g.js";const g=o,p=s;export{g as PTableFooter,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-DMxy9lYo.js";const p=o,r=s;export{p as PTableHeader,r 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-DeN_SuJc.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-DKnG790x.js";import{d as x}from"./p-B4SlrLmQ.js";import{d as C}from"./p-Bv-ByGSf.js";import{d as v}from"./p-DexJ62g_.js";import{d as E}from"./p-D63yb0hu.js";import{d as F}from"./p-DLBcQv2y.js";import{d as j}from"./p-CMmvAq1F.js";import{d as R}from"./p-CXxGdOem.js";import{d as A}from"./p-J6tyjX7a.js";import{d as D}from"./p-DBf1mJgp.js";import{d as B}from"./p-DEW7r6Qi.js";import{d as z}from"./p-C_cIWc9H.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-B2QTs61q.js";import{d as O}from"./p-BhgmuAMP.js";import{d as I}from"./p-g9hO5RJl.js";import{d as Q}from"./p-Br5JzRPb.js";import{d as W}from"./p-B1C3pWHd.js";const J=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 M(){"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),J);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))||j();break;case"p-loader":customElements.get(e(t))||R();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))||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))||Q();break;case"p-tooltip":customElements.get(e(t))||W()}}))}M();const U=J,K=M;export{U as PTable,K 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-CLSdb2d9.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 x}from"./p-B5p7dHkY.js";import{d as _}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-Di2sUFEC.js";import{d as D}from"./p-LPQSLn5-.js";import{d as B}from"./p-DEW7r6Qi.js";import{d as L}from"./p-S2ExrdpO.js";import{d as z}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-gC6gM50g.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 Q}from"./p--y4GWpzd.js";const W=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 U(){"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),W);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))||x();break;case"p-field-container":customElements.get(e(t))||_();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))||L();break;case"p-segment-container":customElements.get(e(t))||z();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))||Q()}}))}U();const Y=W,J=U;export{Y as PTable,J as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o,d as p}from"./p
|
|
1
|
+
import{T as o,d as p}from"./p--y4GWpzd.js";const s=o,r=p;export{s as PTooltip,r as defineCustomElement}
|