@paperless/core 3.2.1 → 3.2.3
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/build/{p-1ac00601.entry.js → p-102da1de.entry.js} +1 -1
- package/dist/{paperless/p-6ac04b16.entry.js → build/p-187a4dda.entry.js} +1 -1
- package/dist/build/{p-b70ee063.entry.js → p-1b85b4f5.entry.js} +1 -1
- package/dist/{paperless/p-8a8adc4d.entry.js → build/p-2f9a3144.entry.js} +2 -2
- package/dist/{paperless/p-9e1977a6.entry.js → build/p-2ff08beb.entry.js} +1 -1
- package/dist/{paperless/p-9889be94.entry.js → build/p-31869c91.entry.js} +1 -1
- package/dist/build/{p-b47f3a0f.js → p-340daf05.js} +1 -1
- package/dist/build/{p-047da5c9.entry.js → p-4cd9344a.entry.js} +1 -1
- package/dist/{paperless/p-1fa99d63.entry.js → build/p-62f87c18.entry.js} +1 -1
- package/dist/{paperless/p-18245eb9.entry.js → build/p-6b1c18a6.entry.js} +1 -1
- package/dist/build/{p-7158dacd.entry.js → p-748c6ed3.entry.js} +1 -1
- package/dist/build/{p-6a7ce335.entry.js → p-7868dc58.entry.js} +1 -1
- package/dist/build/{p-fbd4c0ed.entry.js → p-8c1a3795.entry.js} +1 -1
- package/dist/build/p-8d67b17e.entry.js +1 -0
- package/dist/build/{p-381c13a8.entry.js → p-902adabf.entry.js} +1 -1
- package/dist/build/p-980f3529.entry.js +1 -0
- package/dist/build/p-c4af6a8c.entry.js +1 -0
- package/dist/build/{p-cdcc28c2.entry.js → p-d6958e7a.entry.js} +1 -1
- package/dist/{paperless/p-afa4d38a.entry.js → build/p-df709c40.entry.js} +1 -1
- package/dist/build/{p-34448061.entry.js → p-e021a548.entry.js} +1 -1
- package/dist/build/{p-459f7a0b.entry.js → p-f13f7779.entry.js} +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js +3 -3
- package/dist/cjs/p-attachment.cjs.entry.js +8 -8
- package/dist/cjs/p-button-group.cjs.entry.js +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js +1 -1
- package/dist/cjs/p-checkbox_3.cjs.entry.js +2 -2
- package/dist/cjs/p-content-slider.cjs.entry.js +2 -2
- package/dist/cjs/p-cropper.cjs.entry.js +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +11 -6
- package/dist/cjs/p-empty-state_8.cjs.entry.js +8 -8
- package/dist/cjs/p-field_3.cjs.entry.js +4 -4
- package/dist/cjs/p-label.cjs.entry.js +3 -3
- package/dist/cjs/p-listing.cjs.entry.js +2 -2
- package/dist/cjs/p-navbar.cjs.entry.js +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +3 -3
- package/dist/cjs/p-navigation-section.cjs.entry.js +1 -1
- package/dist/cjs/p-pagination_3.cjs.entry.js +3 -3
- package/dist/cjs/p-profile.cjs.entry.js +1 -1
- package/dist/cjs/p-range.cjs.entry.js +3 -3
- package/dist/cjs/p-select.cjs.entry.js +2 -2
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.css +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.js +2 -2
- package/dist/collection/components/molecules/attachment/attachment.component.js +8 -8
- package/dist/collection/components/molecules/button-group/button-group.component.js +1 -1
- package/dist/collection/components/molecules/calendar/calendar.component.js +1 -1
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +2 -2
- package/dist/collection/components/molecules/cropper/cropper.component.js +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +11 -6
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +2 -2
- package/dist/collection/components/molecules/empty-state/empty-state.component.js +2 -2
- package/dist/collection/components/molecules/field/field/field.component.js +4 -4
- package/dist/collection/components/molecules/label/label.component.js +3 -3
- package/dist/collection/components/molecules/navigation/item/navigation-item.component.js +3 -3
- package/dist/collection/components/molecules/navigation/section/navigation-section.component.js +1 -1
- package/dist/collection/components/molecules/pagination/pagination/pagination.component.js +3 -3
- package/dist/collection/components/molecules/profile/profile.component.js +1 -1
- package/dist/collection/components/molecules/range/range.component.js +3 -3
- package/dist/collection/components/molecules/select/select.component.js +2 -2
- package/dist/collection/components/molecules/table/cell/table-cell.component.js +1 -1
- package/dist/collection/components/molecules/table/footer/table-footer.component.js +2 -2
- package/dist/collection/components/molecules/table/row/table-row.component.js +3 -3
- package/dist/collection/components/molecules/toast/toast.component.js +1 -1
- package/dist/collection/components/organisms/listing/listing.component.js +2 -2
- package/dist/collection/components/organisms/navbar/navbar.component.js +1 -1
- package/dist/components/{p-Dy1wXwZf.js → p-06SzeIsG.js} +1 -1
- package/dist/components/{p-NEqovphH.js → p-B-BsxOeK.js} +1 -1
- package/dist/components/{p-CTQuFuDk.js → p-B9s4_6Vm.js} +1 -1
- package/dist/components/{p-Cat2_HoM.js → p-BEhC6raw.js} +1 -1
- package/dist/components/p-C16aqi4P.js +1 -0
- package/dist/components/{p-COFt46UN.js → p-CCqpQJ15.js} +1 -1
- package/dist/components/{p-CtxKjhiD.js → p-CcNA1hkp.js} +1 -1
- package/dist/components/{p-0Uawv030.js → p-CpYDgn2m.js} +1 -1
- package/dist/components/{p-D8FhwO0Q.js → p-DWHcD5b-.js} +1 -1
- package/dist/components/{p-BtliZ0U_.js → p-N5WuUoFr.js} +1 -1
- package/dist/components/{p-DKnCWy7F.js → p-TfYQFmRD.js} +1 -1
- package/dist/components/p-accordion.js +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-button-group.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-content-slider.js +1 -1
- package/dist/components/p-cropper.js +2 -2
- package/dist/components/p-datepicker.js +1 -1
- package/dist/components/p-dropdown.js +1 -1
- package/dist/components/p-empty-state.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-label.js +1 -1
- package/dist/components/p-listing.js +1 -1
- package/dist/components/{p-BAvGAs2F.js → p-nGuULFe2.js} +1 -1
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-navigation-item.js +1 -1
- package/dist/components/p-navigation-section.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-range.js +1 -1
- package/dist/components/p-select.js +1 -1
- package/dist/components/p-table-cell.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-row.js +1 -1
- package/dist/components/p-table.js +1 -1
- package/dist/components/p-toast.js +1 -1
- package/dist/esm/p-accordion.entry.js +3 -3
- package/dist/esm/p-attachment.entry.js +8 -8
- package/dist/esm/p-button-group.entry.js +1 -1
- package/dist/esm/p-calendar.entry.js +1 -1
- package/dist/esm/p-checkbox_3.entry.js +2 -2
- package/dist/esm/p-content-slider.entry.js +2 -2
- package/dist/esm/p-cropper.entry.js +1 -1
- package/dist/esm/p-datepicker.entry.js +11 -6
- package/dist/esm/p-empty-state_8.entry.js +8 -8
- package/dist/esm/p-field_3.entry.js +4 -4
- package/dist/esm/p-label.entry.js +3 -3
- package/dist/esm/p-listing.entry.js +2 -2
- package/dist/esm/p-navbar.entry.js +1 -1
- package/dist/esm/p-navigation-item.entry.js +3 -3
- package/dist/esm/p-navigation-section.entry.js +1 -1
- package/dist/esm/p-pagination_3.entry.js +3 -3
- package/dist/esm/p-profile.entry.js +1 -1
- package/dist/esm/p-range.entry.js +3 -3
- package/dist/esm/p-select.entry.js +2 -2
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/{p-1ac00601.entry.js → p-102da1de.entry.js} +1 -1
- package/dist/{build/p-6ac04b16.entry.js → paperless/p-187a4dda.entry.js} +1 -1
- package/dist/paperless/{p-b70ee063.entry.js → p-1b85b4f5.entry.js} +1 -1
- package/dist/{build/p-8a8adc4d.entry.js → paperless/p-2f9a3144.entry.js} +2 -2
- package/dist/{build/p-9e1977a6.entry.js → paperless/p-2ff08beb.entry.js} +1 -1
- package/dist/{build/p-9889be94.entry.js → paperless/p-31869c91.entry.js} +1 -1
- package/dist/paperless/{p-047da5c9.entry.js → p-4cd9344a.entry.js} +1 -1
- package/dist/{build/p-1fa99d63.entry.js → paperless/p-62f87c18.entry.js} +1 -1
- package/dist/{build/p-18245eb9.entry.js → paperless/p-6b1c18a6.entry.js} +1 -1
- package/dist/paperless/{p-7158dacd.entry.js → p-748c6ed3.entry.js} +1 -1
- package/dist/paperless/{p-6a7ce335.entry.js → p-7868dc58.entry.js} +1 -1
- package/dist/paperless/{p-fbd4c0ed.entry.js → p-8c1a3795.entry.js} +1 -1
- package/dist/paperless/p-8d67b17e.entry.js +1 -0
- package/dist/paperless/{p-381c13a8.entry.js → p-902adabf.entry.js} +1 -1
- package/dist/paperless/p-980f3529.entry.js +1 -0
- package/dist/paperless/p-c4af6a8c.entry.js +1 -0
- package/dist/paperless/{p-cdcc28c2.entry.js → p-d6958e7a.entry.js} +1 -1
- package/dist/{build/p-afa4d38a.entry.js → paperless/p-df709c40.entry.js} +1 -1
- package/dist/paperless/{p-34448061.entry.js → p-e021a548.entry.js} +1 -1
- package/dist/paperless/{p-459f7a0b.entry.js → p-f13f7779.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/dist/types/components/molecules/datepicker/datepicker.component.d.ts +1 -0
- package/hydrate/index.js +61 -56
- package/hydrate/index.mjs +61 -56
- package/package.json +1 -1
- package/dist/build/p-a4ec1798.entry.js +0 -1
- package/dist/build/p-d93446ad.entry.js +0 -1
- package/dist/build/p-fd032172.entry.js +0 -1
- package/dist/components/p-MeQ48Q-1.js +0 -1
- package/dist/paperless/p-a4ec1798.entry.js +0 -1
- package/dist/paperless/p-d93446ad.entry.js +0 -1
- package/dist/paperless/p-fd032172.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as a,h as e}from"./p-CySg37XO.js";import{c as n}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as r}from"./p-C5CTp9IA.js";import{c}from"./p-xs4N_Y-0.js";import{d as m}from"./p-Crasy6LB.js";import{d as s}from"./p-aZcUXH1b.js";import{d}from"./p-D8faiybE.js";const p=n(["h-8 w-[inherit]","flex items-center gap-2","\n hover:text-storm-500\n dark:hover:text-white\n ","rounded-lg","px-2 py-1","text-sm font-medium","cursor-pointer"],{variants:{active:{false:["\n text-storm-400\n dark:text-hurricane-200\n ","\n hover:bg-off-white-500\n dark:hover:bg-white/10\n "],true:["\n bg-off-white-600 font-semibold text-storm-500\n dark:bg-white/10 dark:text-white\n "]},icon:{false:!1,true:["pl-1"]}}}),h=n(["flex aspect-branding h-6 items-center justify-center rounded-full"],{variants:{active:{false:!1,true:["bg-indigo-500 text-storm-500"]}}}),g=i(class extends a{constructor(t){super(),!1!==t&&this.__registerHost()}icon;active=!1;loading=!1;as="a";counter;href;target;class;applyFullWidth=!1;render(){const t=this.as,i=r(this.active)||this.class?.includes("active");return e(o,{key:"
|
|
1
|
+
import{t,p as i,H as a,h as e}from"./p-CySg37XO.js";import{c as n}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as r}from"./p-C5CTp9IA.js";import{c}from"./p-xs4N_Y-0.js";import{d as m}from"./p-Crasy6LB.js";import{d as s}from"./p-aZcUXH1b.js";import{d}from"./p-D8faiybE.js";const p=n(["h-8 w-[inherit]","flex items-center gap-2","\n hover:text-storm-500\n dark:hover:text-white\n ","rounded-lg","px-2 py-1","text-sm font-medium","cursor-pointer"],{variants:{active:{false:["\n text-storm-400\n dark:text-hurricane-200\n ","\n hover:bg-off-white-500\n dark:hover:bg-white/10\n "],true:["\n bg-off-white-600 font-semibold text-storm-500\n dark:bg-white/10 dark:text-white\n "]},icon:{false:!1,true:["pl-1"]}}}),h=n(["flex aspect-branding h-6 items-center justify-center rounded-full"],{variants:{active:{false:!1,true:["bg-indigo-500 text-storm-500"]}}}),g=i(class extends a{constructor(t){super(),!1!==t&&this.__registerHost()}icon;active=!1;loading=!1;as="a";counter;href;target;class;applyFullWidth=!1;render(){const t=this.as,i=r(this.active)||this.class?.includes("active");return e(o,{key:"f683b2979f9fde20b6e37ba7f3460fd052cce426",class:c("p-navigation-item inline-block",this.class)},e(t,{key:"8f9b4557b535d893375bcbe9108a618aff26974e",class:p({icon:!!this.icon,active:i}),href:this.href,target:this.target},e("div",{key:"6a32cd63b465492becb679ba08175e79a9c053c8",class:h({active:i})},e("p-icon",{key:"5fd49857c3f424479731379311ee426d2bf9b79e",variant:this.icon})),e("span",{key:"8d1527282d584b49e7990455e6bba80debd48cd5",class:c({"has-counter":!!this.counter,"w-full":this.applyFullWidth})},e("slot",{key:"6b9480c94455eeb524a029f21794fc89cb31c857"})),!!this.counter&&"0"!==this.counter&&e("p-badge",{key:"7677e25cb31c5f98bbe70b05e4ca95c518ab696c"},this.counter),!!this.loading&&e("p-loader",{key:"c006a2604a54309028adda2d3aaff26e1d0acd3c",class:"ml-auto"})))}static get style(){return"*.sc-p-navigation-item{box-sizing:border-box}.static.sc-p-navigation-item{position:static}.ml-auto.sc-p-navigation-item{margin-left:auto}.inline-block.sc-p-navigation-item{display:inline-block}.flex.sc-p-navigation-item{display:flex}.aspect-branding.sc-p-navigation-item{aspect-ratio:23/24}.h-6.sc-p-navigation-item{height:1.5rem}.h-8.sc-p-navigation-item{height:2rem}.w-\\[inherit\\].sc-p-navigation-item{width:inherit}.w-full.sc-p-navigation-item{width:100%}.cursor-pointer.sc-p-navigation-item{cursor:pointer}.items-center.sc-p-navigation-item{align-items:center}.justify-center.sc-p-navigation-item{justify-content:center}.gap-2.sc-p-navigation-item{gap:.5rem}.rounded-full.sc-p-navigation-item{border-radius:9999px}.rounded-lg.sc-p-navigation-item{border-radius:.5rem}.bg-indigo-500.sc-p-navigation-item{--tw-bg-opacity:1;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))}.bg-off-white-600.sc-p-navigation-item{--tw-bg-opacity:1;background-color:rgb(236 234 229/var(--tw-bg-opacity,1))}.px-2.sc-p-navigation-item{padding-left:.5rem;padding-right:.5rem}.py-1.sc-p-navigation-item{padding-bottom:.25rem;padding-top:.25rem}.pl-1.sc-p-navigation-item{padding-left:.25rem}.text-sm.sc-p-navigation-item{font-size:.875rem;line-height:1.25rem}.font-medium.sc-p-navigation-item{font-weight:500}.font-semibold.sc-p-navigation-item{font-weight:600}.text-storm-400.sc-p-navigation-item{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.text-storm-500.sc-p-navigation-item{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.container.sc-p-navigation-item{width:100%}@media (min-width:40rem){.container.sc-p-navigation-item{max-width:40rem}}@media (min-width:64rem){.container.sc-p-navigation-item{max-width:64rem}}@media (min-width:80rem){.container.sc-p-navigation-item{max-width:80rem}}@media (min-width:85.375rem){.container.sc-p-navigation-item{max-width:85.375rem}}@media (min-width:90rem){.container.sc-p-navigation-item{max-width:90rem}}@media (min-width:96rem){.container.sc-p-navigation-item{max-width:96rem}}@media (min-width:105rem){.container.sc-p-navigation-item{max-width:105rem}}@media (min-width:120rem){.container.sc-p-navigation-item{max-width:120rem}}@media (min-width:160rem){.container.sc-p-navigation-item{max-width:160rem}}@media (min-width:640px){.container.sc-p-navigation-item{max-width:640px}}@media (min-width:768px){.container.sc-p-navigation-item{max-width:768px}}@media (min-width:1024px){.container.sc-p-navigation-item{max-width:1024px}}@media (min-width:1280px){.container.sc-p-navigation-item{max-width:1280px}}@media (min-width:1536px){.container.sc-p-navigation-item{max-width:1536px}}.hover\\:bg-off-white-500.sc-p-navigation-item:hover{--tw-bg-opacity:1;background-color:rgb(243 241 237/var(--tw-bg-opacity,1))}.hover\\:text-storm-500.sc-p-navigation-item:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:bg-white\\/10:where([data-theme=dark].sc-p-navigation-item-h,[data-theme=dark].sc-p-navigation-item-h *){background-color:hsla(0,0%,100%,.1)}.dark\\:text-hurricane-200:where([data-theme=dark].sc-p-navigation-item-h,[data-theme=dark].sc-p-navigation-item-h *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark].sc-p-navigation-item-h,[data-theme=dark].sc-p-navigation-item-h *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-white\\/10:hover:where([data-theme=dark].sc-p-navigation-item-h,[data-theme=dark].sc-p-navigation-item-h *){background-color:hsla(0,0%,100%,.1)}.dark\\:hover\\:text-white:hover:where([data-theme=dark].sc-p-navigation-item-h,[data-theme=dark].sc-p-navigation-item-h *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/10.sc-p-navigation-item:where([data-theme=dark],[data-theme=dark] *).sc-p-navigation-item{background-color:hsla(0,0%,100%,.1)}.dark\\:text-hurricane-200.sc-p-navigation-item:where([data-theme=dark],[data-theme=dark] *).sc-p-navigation-item{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white.sc-p-navigation-item:where([data-theme=dark],[data-theme=dark] *).sc-p-navigation-item{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-white\\/10.sc-p-navigation-item:hover:where([data-theme=dark],[data-theme=dark] *).sc-p-navigation-item{background-color:hsla(0,0%,100%,.1)}.dark\\:hover\\:text-white.sc-p-navigation-item:hover:where([data-theme=dark],[data-theme=dark] *).sc-p-navigation-item{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[774,"p-navigation-item",{icon:[1],active:[4],loading:[4],as:[1],counter:[8],href:[1],target:[1],class:[1],applyFullWidth:[4,"apply-full-width"]}]);function v(){"undefined"!=typeof customElements&&["p-navigation-item","p-badge","p-icon","p-loader"].forEach((i=>{switch(i){case"p-navigation-item":customElements.get(t(i))||customElements.define(t(i),g);break;case"p-badge":customElements.get(t(i))||m();break;case"p-icon":customElements.get(t(i))||s();break;case"p-loader":customElements.get(t(i))||d()}}))}v();const w=g,l=v;export{w as PNavigationItem,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as
|
|
1
|
+
import{t as e,p as t,H as s,h as c}from"./p-CySg37XO.js";import{T as a}from"./p-Au2WuEGF.js";import{d as i}from"./p-D5t-6wkl.js";const o=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost()}header;render(){return c(a,{key:"8fb1c4a553d9c4a5326c1692f50913be4d9865dc",class:"flex flex-col gap-2"},this.header?.length>0&&c("p-navigation-title",{key:"e5d53c6cc8c05cfb0a0566b94ceebe1a894f77b3"},this.header),c("div",{key:"a29814e605c46668e89773b1e7d3540aabd8c3ae",class:"flex flex-col"},c("slot",{key:"683d1571c171719465093efc4d6c9d7dcb3ddeb5"})))}static get style(){return"*{box-sizing:border-box}.static{position:static}.flex{display:flex}.flex-col{flex-direction:column}.gap-2{gap:.5rem}"}},[772,"p-navigation-section",{header:[1]}]);function n(){"undefined"!=typeof customElements&&["p-navigation-section","p-navigation-title"].forEach((t=>{switch(t){case"p-navigation-section":customElements.get(e(t))||customElements.define(e(t),o);break;case"p-navigation-title":customElements.get(e(t))||i()}}))}n();const l=o,d=n;export{l as PNavigationSection,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as
|
|
1
|
+
import{P as s,d as o}from"./p-B-BsxOeK.js";const p=s,r=o;export{p as PPaginationPages,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as o,d as s}from"./p-
|
|
1
|
+
import{P as o,d as s}from"./p-DWHcD5b-.js";const p=o,r=s;export{p as PPaginationSize,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as o,d as
|
|
1
|
+
import{P as o,d as p}from"./p-CcNA1hkp.js";const s=o,r=p;export{s 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-AkD55vN_.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-AkD55vN_.js";import{d as n}from"./p-N5WuUoFr.js";import{d as p}from"./p-BtH8h7p9.js";import{d as l}from"./p-aZcUXH1b.js";import{d}from"./p-D8faiybE.js";const m=s(["flex min-w-0 flex-1 items-center gap-2"],{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:"ca4c5879a59946cdbbab9a802fbf62547194aaa9"},this._hasDropdownSlot?a("p-dropdown",{applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,manualChevron:!0,placement:this.dropdownLocation,strategy:"absolute",onIsOpen:t=>this._dropdownOpen=t.detail},a("p-button",{active:this._dropdownOpen,chevron:this._dropdownOpen?"up":"down",class:"w-full",size:"lg",slot:"trigger",variant:"dropdown"},t),a("div",{slot:"items"},a("slot",{name:"dropdown",onSlotchange:()=>this._checkDropdownSlot()}))):t)}slotchange(){this._checkDropdownSlot()}_checkDropdownSlot(){this._hasDropdownSlot=!!this._el.querySelector(':scope > [slot="dropdown"]'),!this._hasDropdownSlot&&this._dropdownOpen&&(this._dropdownOpen=!1)}_getContent(){return a("div",{class:m({dropdown:this._hasDropdownSlot})},a("slot",{name:"avatar"}),a("div",{class:"flex min-w-0 flex-1 flex-col items-start"},a("p",{class:"\n my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap\n text-sm font-semibold text-storm-500\n dark:text-white\n "},a("slot",{name:"title"})),a("p",{class:"\n my-0 w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap\n text-xs font-medium text-storm-400\n dark:text-hurricane-200\n "},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{R as o,d as
|
|
1
|
+
import{R as o,d as p}from"./p-CpYDgn2m.js";const s=o,m=p;export{s as PRange,m 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 n}from"./p-xs4N_Y-0.js";import{S as l}from"./p-CEaB2BT0.js";import{d as c}from"./p-iLGr9rDU.js";import{d}from"./p-AkD55vN_.js";import{d as p}from"./p-ShAy0ruV.js";import{d as m}from"./p-BtliZ0U_.js";import{d as u}from"./p-BtH8h7p9.js";import{d as w}from"./p-DlQumf-0.js";import{d as y}from"./p-Dy1wXwZf.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as g}from"./p-SYK2C-7G.js";import{d as v}from"./p-aZcUXH1b.js";import{d as f}from"./p-D8faiybE.js";import{d as b}from"./p-2yaxaWU2.js";const k=r(["flex items-center gap-2","h-full min-w-0 flex-1","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","whitespace-nowrap text-sm font-semibold","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"\n text-storm-400\n dark:text-white\n ",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"\n text-negative-red-700\n group-hover/button:text-negative-red-800\n dark:text-negative-red-alternative\n ",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=l;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:"\n text-xs text-indigo-500\n group-hover/item:text-indigo-800\n dark:text-white/15\n dark:group-hover/item:text-white\n ",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:"76b10df3dbbf0a1758ea13c7205ea4c11ea05056"},a("p-field-container",{key:"e17bca429b8a24a4c5e4399911c9efcebd8a6b24",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:"1bcd1b15692330794bed8b34fbe203b8015681d9",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"383466f2cec3fa3e7aa65aa3db077445cb2917ef",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:"8d5b4d842f4d49f029f1a61f98a8d768c61cf3ef",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:"\n w-full p-2 text-center text-sm text-storm-400\n dark:text-hurricane-200\n ",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:n("\n text-storm-300\n dark:text-hurricane-200\n ",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,A=S;export{T as PSelect,A 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 n}from"./p-xs4N_Y-0.js";import{S as l}from"./p-CEaB2BT0.js";import{d as c}from"./p-iLGr9rDU.js";import{d}from"./p-AkD55vN_.js";import{d as p}from"./p-ShAy0ruV.js";import{d as m}from"./p-N5WuUoFr.js";import{d as u}from"./p-BtH8h7p9.js";import{d as w}from"./p-DlQumf-0.js";import{d as y}from"./p-06SzeIsG.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as g}from"./p-SYK2C-7G.js";import{d as v}from"./p-aZcUXH1b.js";import{d as f}from"./p-D8faiybE.js";import{d as b}from"./p-2yaxaWU2.js";const k=r(["flex items-center gap-2","h-full min-w-0 flex-1","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","whitespace-nowrap text-sm font-semibold","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"\n text-storm-400\n dark:text-white\n ",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"\n text-negative-red-700\n group-hover/button:text-negative-red-800\n dark:text-negative-red-alternative\n ",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=l;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:"\n text-xs text-indigo-500\n group-hover/item:text-indigo-800\n dark:text-white/15\n dark:group-hover/item:text-white\n ",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:"c72782f726a393fbf065df5c19603b8513b992bd"},a("p-field-container",{key:"5414460d0eba2693c6d70175cd69df054bcfe01e",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:"1763f1babda4a931aaa46640f46c449ce8bb254e",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"6fb109a52eb65b8caa0d24adf8eaf2c2e6202ef4",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:"1c9c421e23b7b3ee13f7871cc31fd106baa7c392",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:"\n w-full p-2 text-center text-sm text-storm-400\n dark:text-hurricane-200\n ",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:n("\n text-storm-300\n dark:text-hurricane-200\n ",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,A=S;export{T as PSelect,A as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as
|
|
1
|
+
import{T as s,d as o}from"./p-B9s4_6Vm.js";const m=s,p=o;export{m as PTableCell,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o,d as
|
|
1
|
+
import{T as o,d as p}from"./p-CCqpQJ15.js";const s=o,r=p;export{s as PTableFooter,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o,d as s}from"./p-
|
|
1
|
+
import{T as o,d as s}from"./p-TfYQFmRD.js";const m=o,p=s;export{m as PTableHeader,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-C16aqi4P.js";const a=o,p=s;export{a as PTableRow,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,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-WEZng7dj.js";import{f as h}from"./p-CWO2YJCh.js";import{c}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-Crasy6LB.js";import{d as b}from"./p-AkD55vN_.js";import{d as f}from"./p-ShAy0ruV.js";import{d as g}from"./p-DP6H82uQ.js";import{d as w}from"./p-BtliZ0U_.js";import{d as k}from"./p-BtH8h7p9.js";import{d as y}from"./p-DlQumf-0.js";import{d as S}from"./p-BAvGAs2F.js";import{d as _}from"./p-Dy1wXwZf.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as C}from"./p-DT72kk3I.js";import{d as v}from"./p-BmU3MAfH.js";import{d as E}from"./p-SYK2C-7G.js";import{d as A}from"./p-aZcUXH1b.js";import{d as F}from"./p-CMmvAq1F.js";import{d as j}from"./p-D8faiybE.js";import{d as R}from"./p-CtxKjhiD.js";import{d as D}from"./p-NEqovphH.js";import{d as z}from"./p-BBAR0LE7.js";import{d as B}from"./p-D8FhwO0Q.js";import{d as L}from"./p-DDV-lx3_.js";import{d as H}from"./p-DR1auS78.js";import{d as T}from"./p-CTQuFuDk.js";import{d as O}from"./p-CtAGaRd5.js";import{d as P}from"./p-COFt46UN.js";import{d as q}from"./p-DKnCWy7F.js";import{d as I}from"./p-MeQ48Q-1.js";import{d as Q}from"./p-qeQ4j6y4.js";import{d as U}from"./p-2yaxaWU2.js";const M=e(class extends i{constructor(t){super(),!1!==t&&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=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=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:t})=>this.queryChange.emit(t),onQuickFilter:({detail:t})=>this.quickFilter.emit(t)},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((t=>o("p-floating-menu-item",{disabled:t.disabled,icon:t.icon,iconFlip:t.iconFlip,iconRotate:t.iconRotate,loading:t.loading,slot:"floating-menu-item",onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&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:t})=>this._footerHidden=t,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=h(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?o("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>o("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},o("b",null,t.name))))):null}_getHeader(){return o("p-table-row",{variant:"header"},this._columns.map(((t,e)=>o("p-table-cell",{checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:t,index:e,value:t.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>o("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>o("p-table-row",{checked:this._selectionContains(e),enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this._items.length-1,onClick:t=>this._rowClick(t,e)},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!h()?o("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>o("p-tooltip",{content:e.label,strategy:"fixed"},o("p-button",{icon:e.icon,iconFlip:e.iconFlip,iconOnly:!0,iconRotate:e.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,s)=>o("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:s,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>o("p-table-cell",{checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,definition:e,index:i,rowIndex:t,variant:"loading"})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return o("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return o("p-checkbox",{checked:this._selectionContainsAll(),class:c({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],s=this._selectionContains(t);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:e=>this._checkboxChange(e,t)})}_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(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const o=this._selectionContains(i,!0),a=[...this.selectedRows];a.splice(o,1),this.selectedRows=a,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of m.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[m[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function K(){"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((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),M);break;case"p-badge":customElements.get(t(e))||u();break;case"p-button":customElements.get(t(e))||b();break;case"p-checkbox":customElements.get(t(e))||f();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||w();break;case"p-dropdown-menu-container":customElements.get(t(e))||k();break;case"p-dropdown-menu-item":customElements.get(t(e))||y();break;case"p-empty-state":customElements.get(t(e))||S();break;case"p-field":customElements.get(t(e))||_();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-floating-menu-container":customElements.get(t(e))||C();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||E();break;case"p-icon":customElements.get(t(e))||A();break;case"p-illustration":customElements.get(t(e))||F();break;case"p-loader":customElements.get(t(e))||j();break;case"p-pagination":customElements.get(t(e))||R();break;case"p-pagination-pages":customElements.get(t(e))||D();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||B();break;case"p-segment-container":customElements.get(t(e))||L();break;case"p-segment-item":customElements.get(t(e))||H();break;case"p-table-cell":customElements.get(t(e))||T();break;case"p-table-container":customElements.get(t(e))||O();break;case"p-table-footer":customElements.get(t(e))||P();break;case"p-table-header":customElements.get(t(e))||q();break;case"p-table-row":customElements.get(t(e))||I();break;case"p-table-row-actions-container":customElements.get(t(e))||Q();break;case"p-tooltip":customElements.get(t(e))||U()}}))}K();const N=M,W=K;export{N as PTable,W as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as i,c as s,h as a,d as o}from"./p-CySg37XO.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r}from"./p-WEZng7dj.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 m,T as d}from"./p-CEaB2BT0.js";import{d as u}from"./p-Crasy6LB.js";import{d as b}from"./p-AkD55vN_.js";import{d as f}from"./p-ShAy0ruV.js";import{d as g}from"./p-DP6H82uQ.js";import{d as k}from"./p-N5WuUoFr.js";import{d as w}from"./p-BtH8h7p9.js";import{d as y}from"./p-DlQumf-0.js";import{d as S}from"./p-nGuULFe2.js";import{d as _}from"./p-06SzeIsG.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as C}from"./p-DT72kk3I.js";import{d as v}from"./p-BmU3MAfH.js";import{d as E}from"./p-SYK2C-7G.js";import{d as A}from"./p-aZcUXH1b.js";import{d as F}from"./p-CMmvAq1F.js";import{d as R}from"./p-D8faiybE.js";import{d as j}from"./p-CcNA1hkp.js";import{d as D}from"./p-B-BsxOeK.js";import{d as z}from"./p-BBAR0LE7.js";import{d as B}from"./p-DWHcD5b-.js";import{d as L}from"./p-DDV-lx3_.js";import{d as H}from"./p-DR1auS78.js";import{d as T}from"./p-B9s4_6Vm.js";import{d as P}from"./p-CtAGaRd5.js";import{d as q}from"./p-CCqpQJ15.js";import{d as I}from"./p-TfYQFmRD.js";import{d as O}from"./p-C16aqi4P.js";import{d as Q}from"./p-qeQ4j6y4.js";import{d as U}from"./p-2yaxaWU2.js";const M=e(class extends i{constructor(t){super(),!1!==t&&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=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=p;pageSizeOptions=m;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 a(o,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},a("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&a("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:t})=>this.queryChange.emit(t),onQuickFilter:({detail:t})=>this.quickFilter.emit(t)},this._hasCustomFilterSlot&&a("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&a("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),a("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),a("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?a("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((t=>a("p-floating-menu-item",{disabled:t.disabled,icon:t.icon,iconFlip:t.iconFlip,iconRotate:t.iconRotate,loading:t.loading,slot:"floating-menu-item",onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&a("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:t})=>this._footerHidden=t,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=c(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?a("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>a("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},a("b",null,t.name))))):null}_getHeader(){return a("p-table-row",{variant:"header"},this._columns.map(((t,e)=>a("p-table-cell",{checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:t,index:e,value:t.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>a("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>a("p-table-row",{checked:this._selectionContains(e),enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this._items.length-1,onClick:t=>this._rowClick(t,e)},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!c()?a("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>a("p-tooltip",{content:e.label,strategy:"fixed"},a("p-button",{icon:e.icon,iconFlip:e.iconFlip,iconOnly:!0,iconRotate:e.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,s)=>a("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:s,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>a("p-table-cell",{checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,definition:e,index:i,rowIndex:t,variant:"loading"})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return a("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return a("p-checkbox",{checked:this._selectionContainsAll(),class:h({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],s=this._selectionContains(t);return a("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:e=>this._checkboxChange(e,t)})}_getEmptyState(){return a("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(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const a=this._selectionContains(i,!0),o=[...this.selectedRows];o.splice(a,1),this.selectedRows=o,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const a=s?.querySelector('input[type="checkbox"]');a&&(a.checked=!a.checked,this._checkboxChange(a,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of d.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[d[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function W(){"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((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),M);break;case"p-badge":customElements.get(t(e))||u();break;case"p-button":customElements.get(t(e))||b();break;case"p-checkbox":customElements.get(t(e))||f();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||k();break;case"p-dropdown-menu-container":customElements.get(t(e))||w();break;case"p-dropdown-menu-item":customElements.get(t(e))||y();break;case"p-empty-state":customElements.get(t(e))||S();break;case"p-field":customElements.get(t(e))||_();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-floating-menu-container":customElements.get(t(e))||C();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||E();break;case"p-icon":customElements.get(t(e))||A();break;case"p-illustration":customElements.get(t(e))||F();break;case"p-loader":customElements.get(t(e))||R();break;case"p-pagination":customElements.get(t(e))||j();break;case"p-pagination-pages":customElements.get(t(e))||D();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||B();break;case"p-segment-container":customElements.get(t(e))||L();break;case"p-segment-item":customElements.get(t(e))||H();break;case"p-table-cell":customElements.get(t(e))||T();break;case"p-table-container":customElements.get(t(e))||P();break;case"p-table-footer":customElements.get(t(e))||q();break;case"p-table-header":customElements.get(t(e))||I();break;case"p-table-row":customElements.get(t(e))||O();break;case"p-table-row-actions-container":customElements.get(t(e))||Q();break;case"p-tooltip":customElements.get(t(e))||U()}}))}W();const K=M,N=W;export{K as PTable,N as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as a,c as r,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as
|
|
1
|
+
import{t,p as e,H as a,c as r,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as c}from"./p-Au2WuEGF.js";import{d}from"./p-aZcUXH1b.js";const n=i("h-9 w-[2px] flex-shrink-0 rounded-full",{variants:{variant:{neutral:"\n bg-indigo-800\n dark:bg-indigo-400\n ",positive:"\n bg-positive-green-500\n dark:bg-positive-green-alternative\n ",biased:"\n bg-amber-500\n dark:bg-amber-alternative\n ",negative:"\n bg-negative-red-500\n dark:bg-negative-red-alternative\n "}}}),b=i(["flex items-center justify-between gap-2","w-[calc(100%-2px-0.5rem)]"]),s=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.action=r(this,"action",3)}variant="positive";header;content;enableAction=!0;actionIcon="negative";actionIconFlip;actionIconRotate;action;render(){return o(c,{key:"8d36846b85c4e661ccd81533ac05eb6a651bedb6"},o("div",{key:"5a60824f6868fa38893b7e451850f6e181caa95c",class:"\n flex gap-2 rounded-lg border border-solid border-storm-100 bg-white p-2\n shadow-2\n dark:border-hurricane-800 dark:bg-hurricane-800\n ",onClick:()=>this._onClick()},o("div",{key:"c3ebd2eecb1f3378176653bfe7ae96bd9b7b4b13",class:n({variant:this.variant})}),o("div",{key:"89ce39565adb3958a12551d5021f7ab86c9babb5",class:b()},o("div",{key:"9c833a877f81b34c53ff73378b799fad436e76fd",class:"flex w-full min-w-0 flex-col"},o("p",{key:"7ec87f298e4dda01ff689f877d436c726abef8a5",class:"\n m-0 overflow-hidden text-ellipsis whitespace-nowrap text-sm\n font-semibold text-storm-500\n dark:text-white\n "},this.header?.length?this.header:o("slot",{name:"header"})),o("p",{key:"08c6c263d6ce9915b055fc24e4b0aca7d2b7bfc2",class:"\n m-0 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs\n text-storm-300\n dark:text-hurricane-200\n "},this.content?.length?this.content:o("slot",{name:"content"}))),this.enableAction&&o("div",{key:"111084df846674e17f00ec8c7902a099f05a1e58",class:"\n flex-shrink-0 cursor-pointer p-2 text-storm-200\n hover:text-storm-500 hover:text-white\n dark:text-hurricane-200\n "},o("p-icon",{key:"660342af8a7f33cdd2495cf03fd54fe8923babc8",flip:this.actionIconFlip,rotate:this.actionIconRotate,variant:this.actionIcon})))))}_onClick(){this.enableAction&&this.action.emit()}static get style(){return"*{box-sizing:border-box}.static{position:static}.m-0{margin:0}.flex{display:flex}.h-9{height:2.25rem}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%-2px-0\\.5rem\\)\\]{width:calc(100% - 2px - .5rem)}.w-full{width:100%}.min-w-0{min-width:0}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(225 159 35/var(--tw-bg-opacity,1))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(27 88 210/var(--tw-bg-opacity,1))}.bg-negative-red-500{--tw-bg-opacity:1;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))}.bg-positive-green-500{--tw-bg-opacity:1;background-color:rgb(92 195 14/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.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))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-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\\:border-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-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-toast",{variant:[1],header:[1],content:[1],enableAction:[4,"enable-action"],actionIcon:[1,"action-icon"],actionIconFlip:[1,"action-icon-flip"],actionIconRotate:[2,"action-icon-rotate"]}]);function h(){"undefined"!=typeof customElements&&["p-toast","p-icon"].forEach((e=>{switch(e){case"p-toast":customElements.get(t(e))||customElements.define(t(e),s);break;case"p-icon":customElements.get(t(e))||d()}}))}h();const g=s,p=h;export{g as PToast,p as defineCustomElement}
|
|
@@ -4,7 +4,7 @@ import { c as cn } from './cn-CsNqHcjL.js';
|
|
|
4
4
|
import './state-BJbOyUuL.js';
|
|
5
5
|
import './clsx-ChV9xqsO.js';
|
|
6
6
|
|
|
7
|
-
const accordionComponentCss = () => `*{box-sizing:border-box}.static{position:static}.my-0{margin-bottom:0;margin-top:0}.mt-4{margin-top:1rem}.flex{display:flex}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.gap-2{gap:.5rem}.whitespace-nowrap{white-space:nowrap}.text-base{font-size:1rem;line-height:1.5rem}.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))}.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))}`;
|
|
7
|
+
const accordionComponentCss = () => `*{box-sizing:border-box}.static{position:static}.my-0{margin-bottom:0;margin-top:0}.mt-4{margin-top:1rem}.flex{display:flex}.w-full{width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-2{gap:.5rem}.whitespace-nowrap{white-space:nowrap}.text-base{font-size:1rem;line-height:1.5rem}.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))}.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))}`;
|
|
8
8
|
|
|
9
9
|
const Accordion = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -36,10 +36,10 @@ const Accordion = class {
|
|
|
36
36
|
*/
|
|
37
37
|
isOpen;
|
|
38
38
|
render() {
|
|
39
|
-
return (h(ThemedHost, { key: '36d39106bf27e5005cfdd96f062e89d3be88dbef' }, h("div", { key: '
|
|
39
|
+
return (h(ThemedHost, { key: '36d39106bf27e5005cfdd96f062e89d3be88dbef' }, h("div", { key: '3e08603b16cb1e63be370f3f69bf302d55a73a6d', class: 'flex w-full flex-col' }, h("div", { key: 'b434652c2acda88e09f87d7099cc10d87dba2799', class: cn('flex cursor-pointer items-center gap-2', {
|
|
40
40
|
'text-storm-500 dark:text-white': this.variant === 'primary',
|
|
41
41
|
'text-storm-300 dark:text-hurricane-200': this.variant === 'secondary',
|
|
42
|
-
}), onClick: () => this._onClick() }, h("p-icon", { key: '
|
|
42
|
+
}), onClick: () => this._onClick() }, h("p-icon", { key: '1b56837e3c8c799e8c950cb435c1a41b1b34a93e', class: 'flex shrink-0', rotate: this.open ? 0 : -90, variant: 'caret' }), h("p", { key: '8e009479a0e30100ec50e0336758c67ef8b775e0', class: 'my-0 shrink-0 whitespace-nowrap text-base font-medium' }, this.header), h("p-divider", { key: '4b7029e11b60b2493b21a89fd377e42e9c6dbaf1', class: 'flex-1' })), this.open && (h("div", { key: '1e7b7f6b9d4d3983e77eee7ba02f6bb1f7a53819', class: 'mt-4' }, h("slot", { key: 'e7ea3de6a43120e5533f8f6f320eb6714bbae73a' }))))));
|
|
43
43
|
}
|
|
44
44
|
_onClick() {
|
|
45
45
|
if (!this.closeable && this.open) {
|
|
@@ -112,28 +112,28 @@ const Attachment = class {
|
|
|
112
112
|
_fileRef;
|
|
113
113
|
_cameraFileRef;
|
|
114
114
|
render() {
|
|
115
|
-
let prefix = (h("p-icon", { key: '
|
|
115
|
+
let prefix = (h("p-icon", { key: 'ff0d8b84e7b9a7dd184912d9689bcb8eca336c27', class: 'text-storm-300', variant: 'attachment' }));
|
|
116
116
|
if (this.error) {
|
|
117
|
-
prefix = (h("p-icon", { key: '
|
|
117
|
+
prefix = (h("p-icon", { key: 'edafa66b2cd94083d4b14f3bb0c4cf1a956db04f', class: 'text-negative-red-500', variant: 'warning' }));
|
|
118
118
|
}
|
|
119
119
|
// const isMobileDevice = isMobile();
|
|
120
120
|
const isMobileDevice = isTablet();
|
|
121
121
|
const baseText = 'min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm';
|
|
122
|
-
return (h(Fragment, { key: '
|
|
122
|
+
return (h(Fragment, { key: 'b2d624708b9d8ca28de78dd54fe9cc8eeeecb549' }, h("p-field-container", { key: '07fffd5b21f0ac93ed152759ab84a389aee3e34e', error: this.error, forceShowTooltip: !!this.error?.length, helper: this.helper, label: this.label, required: this.required, variant: 'write' }, h("div", { key: '69ecea8f62871917c241518f6890d9bbd70839cf', class: 'flex w-full items-start gap-2', slot: 'content' }, h("div", { key: '46e0bd7eda892914725c6f742fe0c1f2ccc93834', class: attachment({
|
|
123
123
|
click: this.mode === 'write' && !this.value?.length,
|
|
124
124
|
error: !!this.error?.length,
|
|
125
|
-
}), onClick: () => this._uploadClick() }, prefix, h("span", { key: '
|
|
125
|
+
}), onClick: () => this._uploadClick() }, prefix, h("span", { key: '0bee81f6c2a114113f6f7910e243d6f96dd158b1', class: cn(baseText, `
|
|
126
126
|
peer
|
|
127
127
|
empty:hidden
|
|
128
128
|
dark:text-white
|
|
129
|
-
`) }, this.value), h("span", { key: '
|
|
129
|
+
`) }, this.value), h("span", { key: '0ca55b4c5565663a1523fb23318e061413ab7024', class: cn(baseText, `
|
|
130
130
|
hidden
|
|
131
131
|
peer-empty:block
|
|
132
|
-
`) }, this.placeholder)), h("p-tooltip", { key: '
|
|
132
|
+
`) }, this.placeholder)), h("p-tooltip", { key: '9e96a2663671403a3a81571732af88e49df30749', class: 'w-8', content: this.mode === 'read'
|
|
133
133
|
? this.downloadTooltip
|
|
134
134
|
: this.value?.length
|
|
135
135
|
? this.deleteTooltip
|
|
136
|
-
: this.uploadTooltip }, h("p-button", { key: '
|
|
136
|
+
: this.uploadTooltip }, h("p-button", { key: '99cf07323a901392dd3049a43ed61b3f3c074483', disabled: this.loading, icon: this.mode === 'read'
|
|
137
137
|
? 'download'
|
|
138
138
|
: this.value?.length
|
|
139
139
|
? 'trash'
|
|
@@ -144,7 +144,7 @@ const Attachment = class {
|
|
|
144
144
|
: this.delete).emit() })), this.enableCameraOnMobile &&
|
|
145
145
|
this.mode === 'write' &&
|
|
146
146
|
isMobileDevice &&
|
|
147
|
-
!this.value?.length && (h("p-tooltip", { key: '
|
|
147
|
+
!this.value?.length && (h("p-tooltip", { key: '6e152a4fd9c5c9b3abb5e0f53fc100a0a2d09901', class: '\n w-8\n desktop-xs:hidden\n ', content: this.cameraTooltip }, h("p-button", { key: '1337d04a24c9b1b6ed2d8b5d72e3765ca9f6a0cb', icon: 'camera', iconOnly: true, slot: 'trigger', variant: 'secondary', onOnClick: () => this._cameraClick() }))))), h("input", { key: 'bcf332bfadc788d74e76918043bf6ac4e2970270', accept: Array.isArray(this.accept) ? this.accept?.join(',') : this.accept, class: 'hidden', ref: el => (this._fileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) }), h("input", { key: 'a3f7befdf02a4ed11d90bb3595bc37e678908ad0', accept: 'image/*', capture: 'true', class: 'hidden', ref: el => (this._cameraFileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) })));
|
|
148
148
|
}
|
|
149
149
|
_uploadClick() {
|
|
150
150
|
if (!this._fileRef || this.mode !== 'write' || this.value?.length) {
|
|
@@ -15,7 +15,7 @@ const ButtonGroup = class {
|
|
|
15
15
|
this._checkButtons();
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: '0194482014cf63bb2b1b232f3a535dbc38fe3943', class: 'flex items-center' }, h("slot", { key: '29f15517952e4eea497b805c089a858d556394ab' })));
|
|
19
19
|
}
|
|
20
20
|
slotchange() {
|
|
21
21
|
this._checkButtons();
|
|
@@ -196,7 +196,7 @@ const Calendar = class {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
render() {
|
|
199
|
-
return (h(ThemedHost, { key: '
|
|
199
|
+
return (h(ThemedHost, { key: '396e1c7059b24d8aec57317d839f448be1e37f26' }, h("div", { key: '9030d30aa2fbd06919ec711c01f135ef35c5d7f6', class: calendar({ variant: this.variant }) }, this._getView())));
|
|
200
200
|
}
|
|
201
201
|
_checkTodayButton() {
|
|
202
202
|
if (this._maxDate && dateFnsExports.isAfter(this._today, this._maxDate)) {
|
|
@@ -310,12 +310,12 @@ const Dropdown = class {
|
|
|
310
310
|
this._checkItems();
|
|
311
311
|
}
|
|
312
312
|
render() {
|
|
313
|
-
return (h(Host, { key: '
|
|
313
|
+
return (h(Host, { key: 'bedacfe4315ca3990dd8b87c32dbae364722666d', class: 'relative' }, h("div", { key: 'd10200cc877f7ab3dcd3ba012b6ca9c6d622cee3', class: 'trigger', ref: el => (this._trigger = el), onClick: () => this._triggerClickHandler() }, h("slot", { key: '9b5929215afd8d87b966edad2a1093af1e80107a', name: 'trigger' })), h("div", { key: '11ab8f42724bd08e60dd2b492b6e88384be92312', class: 'relative w-full' }, h("p-dropdown-menu-container", { key: '1cfd2dd29d735f2f4fa7afe6cb3f6a8a0acb3b11', allowOverflow: this.allowOverflow, class: cn(dropdownContainerClass({
|
|
314
314
|
strategy: this.strategy,
|
|
315
315
|
maxWidth: this.applyMaxWidth,
|
|
316
316
|
fullWidth: this.applyFullWidth && !this.applyMaxWidth,
|
|
317
317
|
isDatepicker: this.isDatepicker,
|
|
318
|
-
}), this.containerClass), "data-placement": this.placement, "data-strategy": this.strategy, fullWidth: this.applyFullWidth && !this.applyMaxWidth, maxWidth: this.applyMaxWidth, ref: el => this._load(el), role: 'popover', scrollable: this.scrollable, variant: this.variant, onClick: () => this._containerClickHandler() }, h("slot", { key: '
|
|
318
|
+
}), this.containerClass), "data-placement": this.placement, "data-strategy": this.strategy, fullWidth: this.applyFullWidth && !this.applyMaxWidth, maxWidth: this.applyMaxWidth, ref: el => this._load(el), role: 'popover', scrollable: this.scrollable, variant: this.variant, onClick: () => this._containerClickHandler() }, h("slot", { key: '024950445590c6fe467cf729b0df8e8eaa87241b', name: 'items' })))));
|
|
319
319
|
}
|
|
320
320
|
_checkButtons(active = false) {
|
|
321
321
|
const buttons = this._el.querySelectorAll('p-button[slot="trigger"]');
|
|
@@ -51,13 +51,13 @@ const ContentSlider = class {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: 'ced2d428e5bb5831898a3092ea2f0d7b9802ef02', class: 'p-content-slider' }, h("div", { key: 'e3dfda6e2643f979be7d68b908dd282c94c39b1d', class: `
|
|
55
55
|
slider
|
|
56
56
|
${!this.disableDrag && 'draggable'}
|
|
57
57
|
${this._dragging && 'dragging'}
|
|
58
58
|
`, ref: el => (this._sliderRef = el), style: {
|
|
59
59
|
height: `${this._outerHeight}px`,
|
|
60
|
-
}, onMouseDown: e => this._mouseDownHandler(e), onMouseMove: e => this._mouseMoveHandler(e), onTouchMove: e => this._mouseMoveHandler(e), onTouchStart: e => this._mouseDownHandler(e) }, h("div", { key: '
|
|
60
|
+
}, onMouseDown: e => this._mouseDownHandler(e), onMouseMove: e => this._mouseMoveHandler(e), onTouchMove: e => this._mouseMoveHandler(e), onTouchStart: e => this._mouseDownHandler(e) }, h("div", { key: 'cfef628f79dd457341ff316119afe53386585fd4', class: 'inner-slider', ref: ref => this._setInnerSliderReft(ref), onTransitionEnd: () => this._transitionEndHandler() }, h("slot", { key: '08496344b73b4fb1c84d0df7e53d01b83c54a01c', onSlotchange: () => this._slotChange() }))), h("div", { key: '1f058ce1a871ce924a19e5f03733087b347fe7dc', class: `
|
|
61
61
|
indicator
|
|
62
62
|
${this.hideMobileIndicator && 'hidden'}
|
|
63
63
|
` }, this._filteredItems.map((_, i) => (h("div", { class: `
|
|
@@ -2846,7 +2846,7 @@ const Cropper = class {
|
|
|
2846
2846
|
const themeColor = state.theme === 'dark'
|
|
2847
2847
|
? 'rgba(70, 75, 84, 0.5)'
|
|
2848
2848
|
: 'rgba(255, 255, 255, 0.5)';
|
|
2849
|
-
return (h(ThemedHost, { key: '
|
|
2849
|
+
return (h(ThemedHost, { key: '52a057456517492463f371277934b7e486dc5b79' }, this._loaded && (h("cropper-canvas", { key: 'a6322cc2fe70a66d880e7346b203dce27f8c9c5b', class: '\n h-[17.5rem] w-full border-0 border-b border-solid border-off-white-700\n bg-white\n dark:border-hurricane-200\n ', onAction: () => this._onAction() }, h("cropper-image", { key: '10b5a28a47fcf404b7a715750407420bf565ed3c', alt: 'Picture', crossorigin: 'anonymous', ref: ref => this._setImageRef(ref), src: this.value, scalable: true, translatable: true }), h("cropper-shade", { key: '72e99381cd0275245d7e09cad083743116bf2466', class: 'aspect-branding rounded-full', "theme-color": themeColor, hidden: true }), h("cropper-selection", { key: '00294b6423488b070b998039e3bb096cdc1f621b', "aspect-ratio": '1', "initial-coverage": '0.7', ref: ref => (this._selectionRef = ref) }), h("cropper-handle", { key: '08bec65589e6f90042a0502f0def27e60383565d', action: 'move', plain: true }))), h("p-range", { key: '95c2c0305abbdd03271d1c02d6a8bcf896037a71', class: '\n w-full px-14\n tablet:max-w-xs tablet:px-1\n ', value: this._currentScale, onValueChange: ev => this._onInput(ev.detail) })));
|
|
2850
2850
|
}
|
|
2851
2851
|
_setImageRef(ref) {
|
|
2852
2852
|
if (this._imageRef || !ref) {
|
|
@@ -212,14 +212,16 @@ const Datepicker = class {
|
|
|
212
212
|
}
|
|
213
213
|
this.parseMinDate(this.minDate);
|
|
214
214
|
this.parseMaxDate(this.maxDate);
|
|
215
|
+
this._isMobileBrowser = isMobileBrowser();
|
|
216
|
+
this.parseValue(this.value);
|
|
217
|
+
}
|
|
218
|
+
componentWillRender() {
|
|
215
219
|
if (this.mode !== 'day' && this.format === this._defaultFormats['day']) {
|
|
216
220
|
this.format = this._defaultFormats[this.mode];
|
|
217
221
|
}
|
|
218
|
-
this._isMobileBrowser = isMobileBrowser();
|
|
219
|
-
this.parseValue(this.value);
|
|
220
222
|
}
|
|
221
223
|
render() {
|
|
222
|
-
return (h("p-dropdown", { key: '
|
|
224
|
+
return (h("p-dropdown", { key: '9bd033bcc9c678b922d2708f0115359a10eda050', allowOverflow: true, applyFullWidth: false, applyMaxWidth: false, disableTriggerClick: true, insideClick: true, isDatepicker: true, placement: this.placement, show: this._showDropdown, strategy: this.strategy }, h("p-field", { key: '9954ad569303d1c301e9e23c11ddc8667ed5885b', autoShowError: false, disabled: asBoolean(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: asBoolean(this.required), showOptional: asBoolean(this.showOptional), size: this.size, slot: 'trigger', value: this._getFormattedDate(), onBlur: (ev) => this._onBlur(ev), onFocus: () => this._onFocus(), onInputRefChange: ev => (this._inputRef = ev.detail), onValueChange: ev => this._onValueChange(ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: '910da60dd3e8493be39af5153ec17fcaa712d547', class: '\n pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden\n opacity-0\n ', max: this.maxDate &&
|
|
223
225
|
dateFnsExports.format(new Date(this.maxDate), 'yyyy-MM-dd', {
|
|
224
226
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
225
227
|
}), min: this._minDate &&
|
|
@@ -228,7 +230,7 @@ const Datepicker = class {
|
|
|
228
230
|
}), ref: ref => (this._dateInputRef = ref), slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', value: this._value &&
|
|
229
231
|
dateFnsExports.format(this._value, 'yyyy-MM-dd', {
|
|
230
232
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
231
|
-
}), onInput: ev => this._onNativeInput(ev) })), h("div", { key: '
|
|
233
|
+
}), onInput: ev => this._onNativeInput(ev) })), h("div", { key: 'dbc9708700e9da87b6eaed0074b2c0874af1273e', slot: 'items', tabIndex: -1 }, h("p-calendar", { key: 'f209ed8fb397826f9d17f1d635e815418335903c', 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 }) => (this.value = detail) }))));
|
|
232
234
|
}
|
|
233
235
|
documentClickHandler({ target }) {
|
|
234
236
|
if (!this._showDropdown || childOf(target, this._el)) {
|
|
@@ -245,7 +247,8 @@ const Datepicker = class {
|
|
|
245
247
|
}
|
|
246
248
|
this._showDropdown = true;
|
|
247
249
|
}
|
|
248
|
-
_onBlur(ev, parseFormat
|
|
250
|
+
_onBlur(ev, parseFormat) {
|
|
251
|
+
parseFormat = parseFormat || this.format;
|
|
249
252
|
if (this._isMobileBrowser && this._dateInputRef) {
|
|
250
253
|
return;
|
|
251
254
|
}
|
|
@@ -256,7 +259,9 @@ const Datepicker = class {
|
|
|
256
259
|
if (target.value === null) {
|
|
257
260
|
return;
|
|
258
261
|
}
|
|
259
|
-
const value = dateFnsExports.parse(target.value, parseFormat, new Date()
|
|
262
|
+
const value = dateFnsExports.parse(target.value, parseFormat, new Date(), {
|
|
263
|
+
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
264
|
+
});
|
|
260
265
|
if (value === this._value) {
|
|
261
266
|
return;
|
|
262
267
|
}
|