@paperless/core 2.18.0 → 2.18.2
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/index.esm.js +1 -1
- package/dist/build/{p-b94bc701.entry.js → p-28aa7b28.entry.js} +2 -2
- package/dist/{paperless/p-9ec11e61.entry.js → build/p-458b268a.entry.js} +2 -2
- package/dist/build/{p-9ec11e61.entry.js.map → p-458b268a.entry.js.map} +1 -1
- package/dist/{paperless/p-6dc60fc9.entry.js → build/p-4f199fd5.entry.js} +2 -2
- package/dist/build/{p-520a265d.js → p-81ba2f91.js} +1 -1
- package/dist/build/p-DIDkQXzJ.js +2 -0
- package/dist/build/p-DIDkQXzJ.js.map +1 -0
- package/dist/build/p-button.p-icon.p-loader.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/p-button.p-icon.p-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +4 -4
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-empty-state_8.cjs.entry.js +1 -1
- package/dist/cjs/p-table.cjs.entry.js +1 -1
- package/dist/cjs/table-helpers-NzNb7-i7.js +117 -0
- package/dist/cjs/table-helpers-NzNb7-i7.js.map +1 -0
- package/dist/collection/components/molecules/button/button.component.js +5 -5
- package/dist/collection/components/molecules/button/button.component.js.map +1 -1
- package/dist/collection/utils/table-helpers.js +42 -38
- package/dist/collection/utils/table-helpers.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CT2cHZ7O.js → p-BWB7MxpW.js} +44 -40
- package/dist/components/p-BWB7MxpW.js.map +1 -0
- package/dist/components/{p-DtslqW6g.js → p-BqKXLcZb.js} +3 -3
- package/dist/components/{p-DtslqW6g.js.map → p-BqKXLcZb.js.map} +1 -1
- package/dist/components/{p-Lw_7l_n4.js → p-BsFb_hX4.js} +4 -4
- package/dist/components/{p-Lw_7l_n4.js.map → p-BsFb_hX4.js.map} +1 -1
- package/dist/components/{p-BrTUiyZW.js → p-CDJmZjDG.js} +6 -6
- package/dist/components/{p-BrTUiyZW.js.map → p-CDJmZjDG.js.map} +1 -1
- package/dist/components/{p-BZlZvtjK.js → p-CFIY22oV.js} +3 -3
- package/dist/components/{p-BZlZvtjK.js.map → p-CFIY22oV.js.map} +1 -1
- package/dist/components/{p-BupM6TXy.js → p-CRadQFtR.js} +3 -3
- package/dist/components/{p-BupM6TXy.js.map → p-CRadQFtR.js.map} +1 -1
- package/dist/components/{p-CEBFKdul.js → p-CcfOgVyY.js} +3 -3
- package/dist/components/{p-CEBFKdul.js.map → p-CcfOgVyY.js.map} +1 -1
- package/dist/components/{p-XoglNnlr.js → p-D7R1YUFy.js} +6 -6
- package/dist/components/{p-XoglNnlr.js.map → p-D7R1YUFy.js.map} +1 -1
- package/dist/components/{p-CKMtLokt.js → p-DMk-079N.js} +3 -3
- package/dist/components/{p-CKMtLokt.js.map → p-DMk-079N.js.map} +1 -1
- package/dist/components/{p-gNkAxCho.js → p-D_p65Zxm.js} +4 -4
- package/dist/components/{p-gNkAxCho.js.map → p-D_p65Zxm.js.map} +1 -1
- package/dist/components/{p-BsKPQOEM.js → p-DqSbhKx7.js} +5 -5
- package/dist/components/{p-BsKPQOEM.js.map → p-DqSbhKx7.js.map} +1 -1
- package/dist/components/{p-Dyc4CMNs.js → p-DvZcjOgI.js} +3 -3
- package/dist/components/{p-Dyc4CMNs.js.map → p-DvZcjOgI.js.map} +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-button.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-datepicker.js +3 -3
- package/dist/components/p-drawer-header.js +1 -1
- package/dist/components/p-drawer.js +2 -2
- package/dist/components/p-empty-state.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-modal-header.js +1 -1
- package/dist/components/p-modal.js +2 -2
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-pagination-pages.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-select.js +2 -2
- 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.js +9 -9
- package/dist/esm/index.js +1 -1
- package/dist/esm/p-button.p-icon.p-loader.entry.js.map +1 -1
- package/dist/esm/p-button_3.entry.js +4 -4
- package/dist/esm/p-button_3.entry.js.map +1 -1
- package/dist/esm/p-empty-state_8.entry.js +1 -1
- package/dist/esm/p-table.entry.js +1 -1
- package/dist/esm/table-helpers-DN6qBpAd.js +112 -0
- package/dist/esm/table-helpers-DN6qBpAd.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/paperless/{p-b94bc701.entry.js → p-28aa7b28.entry.js} +2 -2
- package/dist/{build/p-9ec11e61.entry.js → paperless/p-458b268a.entry.js} +2 -2
- package/dist/paperless/{p-9ec11e61.entry.js.map → p-458b268a.entry.js.map} +1 -1
- package/dist/{build/p-6dc60fc9.entry.js → paperless/p-4f199fd5.entry.js} +2 -2
- package/dist/paperless/p-DIDkQXzJ.js +2 -0
- package/dist/paperless/p-DIDkQXzJ.js.map +1 -0
- package/dist/paperless/p-button.p-icon.p-loader.entry.esm.js.map +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/utils/table-helpers.d.ts +2 -2
- package/package.json +1 -1
- package/dist/build/p-C-WRzhFe.js +0 -2
- package/dist/build/p-C-WRzhFe.js.map +0 -1
- package/dist/cjs/table-helpers-Du9NM7La.js +0 -113
- package/dist/cjs/table-helpers-Du9NM7La.js.map +0 -1
- package/dist/components/p-CT2cHZ7O.js.map +0 -1
- package/dist/esm/table-helpers-DozDU2EV.js +0 -108
- package/dist/esm/table-helpers-DozDU2EV.js.map +0 -1
- package/dist/paperless/p-C-WRzhFe.js +0 -2
- package/dist/paperless/p-C-WRzhFe.js.map +0 -1
- /package/dist/build/{p-b94bc701.entry.js.map → p-28aa7b28.entry.js.map} +0 -0
- /package/dist/build/{p-6dc60fc9.entry.js.map → p-4f199fd5.entry.js.map} +0 -0
- /package/dist/paperless/{p-b94bc701.entry.js.map → p-28aa7b28.entry.js.map} +0 -0
- /package/dist/paperless/{p-6dc60fc9.entry.js.map → p-4f199fd5.entry.js.map} +0 -0
package/dist/build/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{i as initTheme,o as onStateChange,b as state,a as stateLocaleOptions,s as stateThemeOptions}from"./p-BIwGgs9f.js";import{s as r}from"./p-B3sNjfzc.js";export{g as getScreenSize,b as getScreenSizeInPixels,a as getScreenSizeInRem,d as isBetweenScreens,i as isBiggerThanScreen,j as isDesktop,f as isMobile,c as isSmallerThanScreen,h as isTablet,e as isTouchDevice}from"./p-B3sNjfzc.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes,i as isTableColumnSizesKey}from"./p-C-WRzhFe.js";export{t as tableColumSizesOptions}from"./p-DdQ-S2l7.js";export{I as IBAN_ICON_VARIANTS_ARRAY}from"./p-By0EdXx2.js";export{c as childOf,a as childOfComposed}from"./p-BFSNj6hu.js";export{c as categorized,i as icons}from"./p-fTcVMKKh.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-DiJj8rmO.js";export{o as objectGetByPath}from"./p-CrdJDtHg.js";export{i as isMobileBrowser}from"./p-DVCJlilm.js";export{c as cn}from"./p-CT54OXR2.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS}from"./p-vyRrSf5s.js";import"./p-Dpmiv2da.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var l={};var m={};var p;function v(){if(p)return m;p=1;(function(e){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"default",{enumerable:true,get:function(){return a}});function t(e,t){return{handler:e,config:t}}t.withOptions=function(e,t=()=>({})){const a=function(a){return{__options:a,handler:e(a),config:t(a)}};a.__isOptionsFunction=true;a.__pluginFunction=e;a.__configFunction=t;return a};const a=t})(m);return m}var u;function x(){if(u)return l;u=1;(function(e){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"default",{enumerable:true,get:function(){return r}});const t=a(v());function a(e){return e&&e.__esModule?e:{default:e}}const r=t.default})(l);return l}var F;var w;function E(){if(w)return F;w=1;let e=x();F=(e.__esModule?e:{default:e}).default;return F}var C=E();var D=n(C);var B={animation:{"fade-in":"forwards fadeIn .2s ease","fade-out":"forwards fadeOut .2s ease","slide-in-right":"forwards slideInRight .5s ease","slide-in-left":"forwards slideInLeft .5s ease","slide-in-top":"forwards slideInTop .25 ease","slide-in-bottom":"forwards slideInBottom .5s ease","slide-in-right-small":"forwards slideInRightSmall .5s ease","slide-in-left-small":"forwards slideInLeftSmall .5s ease","slide-in-top-small":"forwards slideInTopSmall .5s ease","slide-in-bottom-small":"forwards slideInBottomSmall .5s ease","slide-out-right":"forwards slideOutRight .2s ease","slide-out-left":"forwards slideOutLeft .2s ease","slide-out-top":"forwards slideOutTop .2s ease","slide-out-bottom":"forwards slideOutBottom .5s ease","slide-out-top-small":"forwards slideOutTopSmall .5s ease","slide-out-bottom-small":"forwards slideOutBottomSmall .5s ease","floating-menu-container-out":"forwards floatingMenuContainerOut .5s ease","floating-menu-container-in":"forwards floatingMenuContainerIn .5s ease",wave:"wave .5s ease-in-out -0.5s infinite alternate forwards"},keyframes:{fadeIn:{"0%":{opacity:"0"},"100%":{opacity:"100"}},fadeOut:{"0%":{opacity:"100"},"100%":{opacity:"0"}},slideInRight:{"0%":{transform:"translateX(100%)"},"100%":{transform:"translateX(0)"}},slideInLeft:{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}},slideInTop:{"0%":{transform:"translateY(-100%)"},"100%":{transform:"translateY(0)"}},slideInBottom:{"0%":{transform:"translateY(100%)"},"100%":{transform:"translateY(0)"}},slideInRightSmall:{"0%":{transform:"translateX(20%)"},"100%":{transform:"translateX(0)"}},slideInLeftSmall:{"0%":{transform:"translateX(-20%)"},"100%":{transform:"translateX(0)"}},slideInTopSmall:{"0%":{transform:"translateY(-20%)"},"100%":{transform:"translateY(0)"}},slideInBottomSmall:{"0%":{transform:"translateY(20%)"},"100%":{transform:"translateY(0)"}},slideOutRight:{"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(100%)"}},slideOutLeft:{"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}},slideOutTop:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(-100%)"}},slideOutBottom:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(100%)"}},slideOutTopSmall:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(-20%)"}},slideOutBottomSmall:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(20%)"}},floatingMenuContainerOut:{"0%":{display:"flex",transform:"translateY(0)",opacity:"100"},"99%":{display:"flex",transform:"translateY(100%)",opacity:"0"},"100%":{display:"none",transform:"translateY(100%)",opacity:"0"}},floatingMenuContainerIn:{"0%":{display:"none",transform:"translateY(100%)",opacity:"0"},"1%":{display:"flex",transform:"translateY(100%)",opacity:"0"},"100%":{display:"flex",transform:"translateY(0)",opacity:"100"}},wave:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(-15deg)"}}}};var A={inherit:"inherit",transparent:"transparent",current:"currentColor",black:"#000",white:{800:"#E4E3E3",700:"#F2F2F2",600:"#FAFAFA",500:"#FFFFFF",DEFAULT:"#FFFFFF"},"negative-red":{800:"#8D1010",700:"#931010",500:"#E61E1E",100:"#FFDDDD",50:"#FDEDED",alternative:"#FF5C5C"},"positive-green":{800:"#2F6407",500:"#5CC30E",100:"#D5FBC7",50:"#EAFDE3",alternative:"#62FF5C"},amber:{800:"#944D0B",500:"#E19F23",100:"#FFF6C2",50:"#FFFAE0",alternative:"#FFE75C"},indigo:{900:"#1349B6",800:"#1B58D2",700:"#2F6FF0",600:"#528AFA",500:"#8EB3FB",400:"#A5C2FC",300:"#BBD1FD",200:"#C7D9FD",100:"#E3ECFE",50:"#F1F6FF"},storm:{800:"#020815",700:"#080F1C",600:"#0F1622",500:"#181E29",400:"#464B54",300:"#74787F",200:"#A3A5A9",100:"#D1D2D4",50:"#E8E8EA"},hurricane:{900:"#020815",800:"#181E29",700:"#232934",600:"#2E343E",500:"#363C46",400:"#464B54",300:"#74787F",200:"#A3A5A9",100:"#D1D2D4",50:"#E8E8EA"},"off-white":{800:"#D5D0C3",700:"#DEDBD5",600:"#ECEAE5",500:"#F3F1ED",400:"#F5F4F1",300:"#F8F7F4",200:"#FAF9F8",100:"#FDFCFB",50:"#FEFEFD"}};var O={height:{unset:"unset",inherit:"inherit"}};const T={};for(let e=1;e<360;e++){T[`${e}`]=`${e}deg`;T[`-${e}`]=`-${e}deg`}var y={flip:"-1"};var R={1:["0 1px 1px rgba(0, 2, 2, 0.08)"],2:["0 1px 1px rgba(0, 2, 2, 0.04)","0 2px 2px rgba(0, 2, 2, 0.04)","0 4px 4px rgba(0, 2, 2, 0.04)"],3:["0 1px 1px rgba(0, 2, 2, 0.08)","0 2px 2px rgba(0, 2, 2, 0.08)","0 4px 4px rgba(0, 2, 2, 0.08)"],modal:["0 0 0 1px rgba(0, 2, 2, 0.10)","0 1px 1px 0 rgba(0, 2, 2, 0.20)","0 2px 2px 0 rgba(0, 2, 2, 0.08)","0 4px 4px 0 rgba(0, 2, 2, 0.08)","0 8px 8px 0 rgba(0, 2, 2, 0.08)"],"supportive-lilac":"0px 1px 1px rgba(189, 140, 255, 0.20)","storm-10%":"0px 1px 0px rgba(3, 42, 36, 0.1)","primary-button":"0px 1px 1px 0px rgba(24, 30 41, 0.08)","off-white-600":"0px 0px 0px 1px #ECEAE5",inherit:"inherit",transparent:"transparent"};var Y={"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"};var _={fontSize:{xxs:["0.5rem","1rem"],"3xl":["2rem","2.5rem"],"4xl":["2.5rem","3rem"]},lineHeight:{xs:"1rem",sm:"1.5rem",base:"1.5rem",lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.5rem","4xl":"3rem"}};var L={width:{unset:"unset",inherit:"inherit","content-mobile":"100%","content-1280":"62rem","content-1440":"71rem","content-1536":"77rem","content-1680":"83rem","sidebar-desktop-login":"100%","content-desktop-login":"21rem"}};var X={"floating-menu":"190",dropdown:"200","navbar-topbar":"280","navbar-backdrop":"290",navbar:"300",tooltip:"400",datepicker:"401",backdrop:"490",drawer:"500","drawer-header":"501",modal:"600",toast:"700"};const k=({addVariant:e})=>{e("has-hover","@media (hover: hover)");e("no-hover","@media (hover: none)");e("hover-never","@media (hover: hover) { &:hover }");e("group-hover-never","@media (hover: hover) { :merge(.group):hover & }");e("peer-hover-never","@media (hover: hover) { :merge(.peer):hover & }");e("hover-always",["@media (hover: hover) { &:hover }","@media (hover: none)"]);e("group-hover-always",["@media (hover: hover) { :merge(.group):hover & }","@media (hover: none)"]);e("peer-hover-always",["@media (hover: hover) { :merge(.peer):hover & }","@media (hover: none)"])};const z=({addUtilities:e})=>{const t={".m-safe":{marginTop:"env(safe-area-inset-top)",marginRight:"env(safe-area-inset-right)",marginBottom:"env(safe-area-inset-bottom)",marginLeft:"env(safe-area-inset-left)"},".mx-safe":{marginRight:"env(safe-area-inset-right)",marginLeft:"env(safe-area-inset-left)"},".my-safe":{marginTop:"env(safe-area-inset-top)",marginBottom:"env(safe-area-inset-bottom)"},".my-safe-2":{marginTop:"calc(env(safe-area-inset-top)+0.5rem)",marginBottom:"calc(env(safe-area-inset-bottom)+0.5rem)"},".mt-safe":{marginTop:"env(safe-area-inset-top)"},".mr-safe":{marginRight:"env(safe-area-inset-right)"},".mb-safe":{marginBottom:"env(safe-area-inset-bottom)"},".ml-safe":{marginLeft:"env(safe-area-inset-left)"},".p-safe":{paddingTop:"env(safe-area-inset-top)",paddingRight:"env(safe-area-inset-right)",paddingBottom:"env(safe-area-inset-bottom)",paddingLeft:"env(safe-area-inset-left)"},".px-safe":{paddingRight:"env(safe-area-inset-right)",paddingLeft:"env(safe-area-inset-left)"},".py-safe":{paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)"},".py-safe-2":{paddingTop:"calc(env(safe-area-inset-top)+0.5rem)",paddingBottom:"calc(env(safe-area-inset-bottom)+0.5rem)"},".pt-safe":{paddingTop:"env(safe-area-inset-top)"},".pr-safe":{paddingRight:"env(safe-area-inset-right)"},".pb-safe":{paddingBottom:"env(safe-area-inset-bottom)"},".pl-safe":{paddingLeft:"env(safe-area-inset-left)"},".min-h-screen":{minHeight:"100vh"},".min-h-screen-safe":{minHeight:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".max-h-screen":{maxHeight:"100vh"},".max-h-screen-safe":{maxHeight:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".h-screen-safe":{height:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".min-w-screen":{minWidth:"100vw"},".min-w-screen-safe":{minWidth:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"},".max-w-screen":{maxWidth:"100vw"},".max-w-screen-safe":{maxWidth:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"},".w-screen-safe":{width:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"}};e(t)};var $;var M;function N(){if(M)return $;M=1;const e=E();const t={position:"relative",paddingBottom:`calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)`};const a={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"};const r={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}};const s=e((function({addComponents:e,matchComponents:s,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(s){s({"aspect-w":e=>[{...t,"--tw-aspect-w":e},{"> *":a}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l});e(r);return}const f=Object.entries(l).map((([e,t])=>`.${i(`aspect-w-${e}`)}`)).join(",\n");const m=Object.entries(l).map((([e,t])=>`.${i(`aspect-w-${e}`)} > *`)).join(",\n");e([{[f]:t,[m]:a},r,Object.entries(l).map((([e,t])=>({[`.${i(`aspect-w-${e}`)}`]:{"--tw-aspect-w":t}}))),Object.entries(l).map((([e,t])=>({[`.${i(`aspect-h-${e}`)}`]:{"--tw-aspect-h":t}})))],o("aspectRatio"))}),{theme:{aspectRatio:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",14:"14",15:"15",16:"16"}},variants:{aspectRatio:["responsive"]}});$=s;return $}var H=N();var G=n(H);var U;var W;function V(){if(W)return U;W=1;const e=E();const t=e((function({addUtilities:e}){e({".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},["responsive"])}));U=t;return U}var J=V();var K=n(J);const Z=D((e=>{z(e);k(e)}),{theme:{colors:A,boxShadow:R,dropShadow:R,extend:{animation:B.animation,keyframes:B.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:y,rotate:T,fontSize:_.fontSize,lineHeight:_.lineHeight,zIndex:X,screens:r,width:L.width,height:O.height,spacing:Y,aspectRatio:{branding:"23/24"}}},plugins:[G,K,z,k]});const q=e=>e.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`));const Q=e=>e.toLowerCase().replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")));const ee=e=>e.replace(/-/g," ");const te=e=>e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()));export{q as camelToSnakeCase,ee as kebabToSpaces,Z as paperless,Q as snakeToCamelCase,te as titleCase};
|
|
1
|
+
export{i as initTheme,o as onStateChange,b as state,a as stateLocaleOptions,s as stateThemeOptions}from"./p-BIwGgs9f.js";import{s as r}from"./p-B3sNjfzc.js";export{g as getScreenSize,b as getScreenSizeInPixels,a as getScreenSizeInRem,d as isBetweenScreens,i as isBiggerThanScreen,j as isDesktop,f as isMobile,c as isSmallerThanScreen,h as isTablet,e as isTouchDevice}from"./p-B3sNjfzc.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes,i as isTableColumnSizesKey}from"./p-DIDkQXzJ.js";export{t as tableColumSizesOptions}from"./p-DdQ-S2l7.js";export{I as IBAN_ICON_VARIANTS_ARRAY}from"./p-By0EdXx2.js";export{c as childOf,a as childOfComposed}from"./p-BFSNj6hu.js";export{c as categorized,i as icons}from"./p-fTcVMKKh.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-DiJj8rmO.js";export{o as objectGetByPath}from"./p-CrdJDtHg.js";export{i as isMobileBrowser}from"./p-DVCJlilm.js";export{c as cn}from"./p-CT54OXR2.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS}from"./p-vyRrSf5s.js";import"./p-Dpmiv2da.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var l={};var m={};var p;function v(){if(p)return m;p=1;(function(e){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"default",{enumerable:true,get:function(){return a}});function t(e,t){return{handler:e,config:t}}t.withOptions=function(e,t=()=>({})){const a=function(a){return{__options:a,handler:e(a),config:t(a)}};a.__isOptionsFunction=true;a.__pluginFunction=e;a.__configFunction=t;return a};const a=t})(m);return m}var u;function x(){if(u)return l;u=1;(function(e){Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"default",{enumerable:true,get:function(){return r}});const t=a(v());function a(e){return e&&e.__esModule?e:{default:e}}const r=t.default})(l);return l}var F;var w;function E(){if(w)return F;w=1;let e=x();F=(e.__esModule?e:{default:e}).default;return F}var D=E();var C=n(D);var B={animation:{"fade-in":"forwards fadeIn .2s ease","fade-out":"forwards fadeOut .2s ease","slide-in-right":"forwards slideInRight .5s ease","slide-in-left":"forwards slideInLeft .5s ease","slide-in-top":"forwards slideInTop .25 ease","slide-in-bottom":"forwards slideInBottom .5s ease","slide-in-right-small":"forwards slideInRightSmall .5s ease","slide-in-left-small":"forwards slideInLeftSmall .5s ease","slide-in-top-small":"forwards slideInTopSmall .5s ease","slide-in-bottom-small":"forwards slideInBottomSmall .5s ease","slide-out-right":"forwards slideOutRight .2s ease","slide-out-left":"forwards slideOutLeft .2s ease","slide-out-top":"forwards slideOutTop .2s ease","slide-out-bottom":"forwards slideOutBottom .5s ease","slide-out-top-small":"forwards slideOutTopSmall .5s ease","slide-out-bottom-small":"forwards slideOutBottomSmall .5s ease","floating-menu-container-out":"forwards floatingMenuContainerOut .5s ease","floating-menu-container-in":"forwards floatingMenuContainerIn .5s ease",wave:"wave .5s ease-in-out -0.5s infinite alternate forwards"},keyframes:{fadeIn:{"0%":{opacity:"0"},"100%":{opacity:"100"}},fadeOut:{"0%":{opacity:"100"},"100%":{opacity:"0"}},slideInRight:{"0%":{transform:"translateX(100%)"},"100%":{transform:"translateX(0)"}},slideInLeft:{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}},slideInTop:{"0%":{transform:"translateY(-100%)"},"100%":{transform:"translateY(0)"}},slideInBottom:{"0%":{transform:"translateY(100%)"},"100%":{transform:"translateY(0)"}},slideInRightSmall:{"0%":{transform:"translateX(20%)"},"100%":{transform:"translateX(0)"}},slideInLeftSmall:{"0%":{transform:"translateX(-20%)"},"100%":{transform:"translateX(0)"}},slideInTopSmall:{"0%":{transform:"translateY(-20%)"},"100%":{transform:"translateY(0)"}},slideInBottomSmall:{"0%":{transform:"translateY(20%)"},"100%":{transform:"translateY(0)"}},slideOutRight:{"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(100%)"}},slideOutLeft:{"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}},slideOutTop:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(-100%)"}},slideOutBottom:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(100%)"}},slideOutTopSmall:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(-20%)"}},slideOutBottomSmall:{"0%":{transform:"translateY(0)"},"100%":{transform:"translateY(20%)"}},floatingMenuContainerOut:{"0%":{display:"flex",transform:"translateY(0)",opacity:"100"},"99%":{display:"flex",transform:"translateY(100%)",opacity:"0"},"100%":{display:"none",transform:"translateY(100%)",opacity:"0"}},floatingMenuContainerIn:{"0%":{display:"none",transform:"translateY(100%)",opacity:"0"},"1%":{display:"flex",transform:"translateY(100%)",opacity:"0"},"100%":{display:"flex",transform:"translateY(0)",opacity:"100"}},wave:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(-15deg)"}}}};var A={inherit:"inherit",transparent:"transparent",current:"currentColor",black:"#000",white:{800:"#E4E3E3",700:"#F2F2F2",600:"#FAFAFA",500:"#FFFFFF",DEFAULT:"#FFFFFF"},"negative-red":{800:"#8D1010",700:"#931010",500:"#E61E1E",100:"#FFDDDD",50:"#FDEDED",alternative:"#FF5C5C"},"positive-green":{800:"#2F6407",500:"#5CC30E",100:"#D5FBC7",50:"#EAFDE3",alternative:"#62FF5C"},amber:{800:"#944D0B",500:"#E19F23",100:"#FFF6C2",50:"#FFFAE0",alternative:"#FFE75C"},indigo:{900:"#1349B6",800:"#1B58D2",700:"#2F6FF0",600:"#528AFA",500:"#8EB3FB",400:"#A5C2FC",300:"#BBD1FD",200:"#C7D9FD",100:"#E3ECFE",50:"#F1F6FF"},storm:{800:"#020815",700:"#080F1C",600:"#0F1622",500:"#181E29",400:"#464B54",300:"#74787F",200:"#A3A5A9",100:"#D1D2D4",50:"#E8E8EA"},hurricane:{900:"#020815",800:"#181E29",700:"#232934",600:"#2E343E",500:"#363C46",400:"#464B54",300:"#74787F",200:"#A3A5A9",100:"#D1D2D4",50:"#E8E8EA"},"off-white":{800:"#D5D0C3",700:"#DEDBD5",600:"#ECEAE5",500:"#F3F1ED",400:"#F5F4F1",300:"#F8F7F4",200:"#FAF9F8",100:"#FDFCFB",50:"#FEFEFD"}};var O={height:{unset:"unset",inherit:"inherit"}};const T={};for(let e=1;e<360;e++){T[`${e}`]=`${e}deg`;T[`-${e}`]=`-${e}deg`}var y={flip:"-1"};var R={1:["0 1px 1px rgba(0, 2, 2, 0.08)"],2:["0 1px 1px rgba(0, 2, 2, 0.04)","0 2px 2px rgba(0, 2, 2, 0.04)","0 4px 4px rgba(0, 2, 2, 0.04)"],3:["0 1px 1px rgba(0, 2, 2, 0.08)","0 2px 2px rgba(0, 2, 2, 0.08)","0 4px 4px rgba(0, 2, 2, 0.08)"],modal:["0 0 0 1px rgba(0, 2, 2, 0.10)","0 1px 1px 0 rgba(0, 2, 2, 0.20)","0 2px 2px 0 rgba(0, 2, 2, 0.08)","0 4px 4px 0 rgba(0, 2, 2, 0.08)","0 8px 8px 0 rgba(0, 2, 2, 0.08)"],"supportive-lilac":"0px 1px 1px rgba(189, 140, 255, 0.20)","storm-10%":"0px 1px 0px rgba(3, 42, 36, 0.1)","primary-button":"0px 1px 1px 0px rgba(24, 30 41, 0.08)","off-white-600":"0px 0px 0px 1px #ECEAE5",inherit:"inherit",transparent:"transparent"};var Y={"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"};var _={fontSize:{xxs:["0.5rem","1rem"],"3xl":["2rem","2.5rem"],"4xl":["2.5rem","3rem"]},lineHeight:{xs:"1rem",sm:"1.5rem",base:"1.5rem",lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.5rem","4xl":"3rem"}};var L={width:{unset:"unset",inherit:"inherit","content-mobile":"100%","content-1280":"62rem","content-1440":"71rem","content-1536":"77rem","content-1680":"83rem","sidebar-desktop-login":"100%","content-desktop-login":"21rem"}};var X={"floating-menu":"190",dropdown:"200","navbar-topbar":"280","navbar-backdrop":"290",navbar:"300",tooltip:"400",datepicker:"401",backdrop:"490",drawer:"500","drawer-header":"501",modal:"600",toast:"700"};const k=({addVariant:e})=>{e("has-hover","@media (hover: hover)");e("no-hover","@media (hover: none)");e("hover-never","@media (hover: hover) { &:hover }");e("group-hover-never","@media (hover: hover) { :merge(.group):hover & }");e("peer-hover-never","@media (hover: hover) { :merge(.peer):hover & }");e("hover-always",["@media (hover: hover) { &:hover }","@media (hover: none)"]);e("group-hover-always",["@media (hover: hover) { :merge(.group):hover & }","@media (hover: none)"]);e("peer-hover-always",["@media (hover: hover) { :merge(.peer):hover & }","@media (hover: none)"])};const z=({addUtilities:e})=>{const t={".m-safe":{marginTop:"env(safe-area-inset-top)",marginRight:"env(safe-area-inset-right)",marginBottom:"env(safe-area-inset-bottom)",marginLeft:"env(safe-area-inset-left)"},".mx-safe":{marginRight:"env(safe-area-inset-right)",marginLeft:"env(safe-area-inset-left)"},".my-safe":{marginTop:"env(safe-area-inset-top)",marginBottom:"env(safe-area-inset-bottom)"},".my-safe-2":{marginTop:"calc(env(safe-area-inset-top)+0.5rem)",marginBottom:"calc(env(safe-area-inset-bottom)+0.5rem)"},".mt-safe":{marginTop:"env(safe-area-inset-top)"},".mr-safe":{marginRight:"env(safe-area-inset-right)"},".mb-safe":{marginBottom:"env(safe-area-inset-bottom)"},".ml-safe":{marginLeft:"env(safe-area-inset-left)"},".p-safe":{paddingTop:"env(safe-area-inset-top)",paddingRight:"env(safe-area-inset-right)",paddingBottom:"env(safe-area-inset-bottom)",paddingLeft:"env(safe-area-inset-left)"},".px-safe":{paddingRight:"env(safe-area-inset-right)",paddingLeft:"env(safe-area-inset-left)"},".py-safe":{paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)"},".py-safe-2":{paddingTop:"calc(env(safe-area-inset-top)+0.5rem)",paddingBottom:"calc(env(safe-area-inset-bottom)+0.5rem)"},".pt-safe":{paddingTop:"env(safe-area-inset-top)"},".pr-safe":{paddingRight:"env(safe-area-inset-right)"},".pb-safe":{paddingBottom:"env(safe-area-inset-bottom)"},".pl-safe":{paddingLeft:"env(safe-area-inset-left)"},".min-h-screen":{minHeight:"100vh"},".min-h-screen-safe":{minHeight:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".max-h-screen":{maxHeight:"100vh"},".max-h-screen-safe":{maxHeight:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".h-screen-safe":{height:"calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)))"},".min-w-screen":{minWidth:"100vw"},".min-w-screen-safe":{minWidth:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"},".max-w-screen":{maxWidth:"100vw"},".max-w-screen-safe":{maxWidth:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"},".w-screen-safe":{width:"calc(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)))"}};e(t)};var $;var M;function N(){if(M)return $;M=1;const e=E();const t={position:"relative",paddingBottom:`calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)`};const a={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"};const r={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}};const s=e((function({addComponents:e,matchComponents:s,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(s){s({"aspect-w":e=>[{...t,"--tw-aspect-w":e},{"> *":a}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l});e(r);return}const f=Object.entries(l).map((([e,t])=>`.${i(`aspect-w-${e}`)}`)).join(",\n");const m=Object.entries(l).map((([e,t])=>`.${i(`aspect-w-${e}`)} > *`)).join(",\n");e([{[f]:t,[m]:a},r,Object.entries(l).map((([e,t])=>({[`.${i(`aspect-w-${e}`)}`]:{"--tw-aspect-w":t}}))),Object.entries(l).map((([e,t])=>({[`.${i(`aspect-h-${e}`)}`]:{"--tw-aspect-h":t}})))],o("aspectRatio"))}),{theme:{aspectRatio:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",14:"14",15:"15",16:"16"}},variants:{aspectRatio:["responsive"]}});$=s;return $}var H=N();var G=n(H);var U;var V;function W(){if(V)return U;V=1;const e=E();const t=e((function({addUtilities:e}){e({".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},["responsive"])}));U=t;return U}var J=W();var K=n(J);const Z=C((e=>{z(e);k(e)}),{theme:{colors:A,boxShadow:R,dropShadow:R,extend:{animation:B.animation,keyframes:B.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:y,rotate:T,fontSize:_.fontSize,lineHeight:_.lineHeight,zIndex:X,screens:r,width:L.width,height:O.height,spacing:Y,aspectRatio:{branding:"23/24"}}},plugins:[G,K,z,k]});const Q=e=>e.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`));const q=e=>e.toLowerCase().replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")));const ee=e=>e.replace(/-/g," ");const te=e=>e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()));export{Q as camelToSnakeCase,ee as kebabToSpaces,Z as paperless,q as snakeToCamelCase,te as titleCase};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,g as i,h as s,H as n}from"./p-Dpmiv2da.js";import{t as a}from"./p-DdQ-S2l7.js";import{f as o,g as r}from"./p-DiJj8rmO.js";import{f as h}from"./p-C-WRzhFe.js";import{f as l}from"./p-B3sNjfzc.js";import{c}from"./p-CT54OXR2.js";import{P as f,a as u}from"./p-vyRrSf5s.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const d="*{box-sizing:border-box}.static{position:static!important}.fixed{position:fixed!important}.z-0{z-index:0!important}.my-16{margin-bottom:4rem!important;margin-top:4rem!important}.mb-8{margin-bottom:2rem!important}.flex{display:flex!important}.table{display:table!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.resize{resize:both!important}.flex-col{flex-direction:column!important}.self-center{align-self:center!important}.rounded{border-radius:.25rem!important}.opacity-0{opacity:0!important}.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)!important}";const p=class{constructor(i){t(this,i);this.selectedRowsChange=e(this,"selectedRowsChange",3);this.rowClick=e(this,"rowClick",3);this.rowSelected=e(this,"rowSelected",3);this.rowDeselected=e(this,"rowDeselected",3);this.hasRendered=e(this,"hasRendered",3);this.quickFilter=e(this,"quickFilter",3);this.queryChange=e(this,"queryChange",3);this.filter=e(this,"filter",3);this.action=e(this,"action",3);this.pageChange=e(this,"pageChange",3);this.pageSizeChange=e(this,"pageSizeChange",3);this.export=e(this,"export",3);this.emptyStateActionClick=e(this,"emptyStateActionClick",3)}items;loading=false;headerLoading=false;footerLoading=false;amountOfLoadingRows=6;enableRowSelection=true;rowSelectionLimit;enableRowClick=true;selectedRows=[];enableFloatingMenu=true;floatingMenuAmountSelectedTemplate=t=>o((t===1?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=true;quickFilters=[];activeQuickFilterIdentifier;enableSearch=true;query;enableFilter=true;enableFilterDesktop=true;selectedFiltersAmount;filterButtonTemplate;enableAction=false;actionButtonLoading=false;actionButtonEnabled=false;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=true;enablePaginationSize=true;enablePaginationPages=true;enableExport=true;page=1;total;pageChange;pageSize=f;pageSizeOptions=u;pageSizeChange;export;hideOnSinglePage=true;emptyStateHeader=()=>o(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>o(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>o(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=true;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=true;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=false;_ctrlDown=false;_hasCustomFilterSlot=false;_hasCustomActionsSlot=false;_floatingMenuShown=false;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]');this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]');this._setRowSelectionData();this._setLocales();this._parseItems(this.items);this._generateExtraHeaders();this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"d5675ecf7d464628f39cf0656d152d316a3675fc",class:"z-0 flex flex-col"},s("p-table-container",{key:"84e69afe650c47560b62d31ad76a8cb6faae9a6e"},this.enableHeader&&s("p-table-header",{key:"c4b1a5c57e756d96f597b4fa7fb61dc8202a5bb5",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"6fcc35dbbd37ec70a36cf8912d90f6133f4d3bf6",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"9423bcb8027f58f984c3708221adf2f81651b07a",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"fcf40912d68573281c8e18ee4e30b8f6c3e0c3ef",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"b9f2eaeffd25c1f71662ab1de4985805c1c8f708",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:true,class:h({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,false)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>!t.disabled&&!t.loading&&!!t.action&&t.type==="single"?t.action(this.selectedRows[0],false):t.action(this.selectedRows,true)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"b58718c15d1584296b019f554fa6d06938636b79",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await r(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){if(t!=="Control"||this._ctrlDown===true){return}this._ctrlDown=true}keyUp({key:t}){if(t!=="Control"||this._ctrlDown===false){return}this._ctrlDown=false}visibilityChange(){if(document.visibilityState!=="hidden"||this._ctrlDown===false){return}this._ctrlDown=false}_parseItems(t){if(!t){this._items=[];return}if(Array.isArray(t)){this._items=t;return}this._items=JSON.parse(t)}_setRowSelectionData(){if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=setTimeout((()=>{const t=l();const e=Array.from(this._el.querySelectorAll(":scope > p-table-row-action"));this._rowActionsRow=e.filter((t=>t.type==="both"||t.type==="single"));this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&(e.type==="both"||e.type==="multi")||t&&e.type==="single")).map((t=>{if(t.type==="single"){t.disabled=this.selectedRows?.length>1}return t}));let i=this.rowSelectionLimit;if(t&&this._rowActionsFloatingAll?.length&&(i!==undefined&&this.enableRowSelection||!this.enableRowSelection)){i=1}this._rowSelectionLimit=i;let s=this.enableRowSelection;if(t&&this._rowActionsFloatingAll?.length&&!s){s=true}this._enableRowSelection=s;if(this._floatingMenuShown){this._showFloatingMenu()}}),200)}_generateExtraHeaders(){const t=this._el.querySelectorAll("p-table-extra-header");let e=Array.from(t);e=this._parseDefinitions(e);this._extraHeaders=e}_generateColumns(){const t=this._el.querySelectorAll("p-table-column");let e=Array.from(t);e=this._parseDefinitions(e);this._columns=e}_getExtraHeader(){if(!this._extraHeaders?.length){return null}return s("p-table-row",{variant:"header-secondary",isLast:true},this._extraHeaders.map(((t,e)=>s("p-table-cell",{definition:t,variant:"header-secondary",checkboxOffset:e===0&&this._enableRowSelection,index:e},s("b",null,t.name)))))}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:e===0||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){if(this.loading){return Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e))))}if(!this._items.length){return this._getEmptyState()}return this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>e.showFunction?e.showFunction(t):true));if(i?.length&&!l()){return s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":true,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:true,size:"sm",onClick:()=>typeof e.action==="function"&&e.action?.(t,false)})))))}return null}_getRowColumns(t,e){return this._columns.map(((i,n)=>s("p-table-cell",{definition:i,item:t,checkbox:n===0||i.hasCheckbox?this._getCheckbox(e):null,index:n,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:i===0||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length){return}if(e==="loading"){return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"})}if(e==="header"){return s("p-checkbox",{class:c({"opacity-0":this._rowSelectionLimit!==undefined}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:this._rowSelectionLimit!==undefined,onCheckedChange:t=>this._selectAllChange(t)})}const i=this._items[t];const n=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||this._rowSelectionLimit!==undefined&&!n&&this.selectedRows.length===this._rowSelectionLimit,checked:n,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){if(this.query?.length||this.selectedFiltersAmount){return s("p-empty-state",{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()})}return s("p-empty-state",{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(!this._enableRowSelection){return}const i=t?.detail??e??false;const s=e===undefined?i:e;if(s){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if(this.canSelectKey&&!i[this.canSelectKey]){continue}if(this._selectionContains(e)){continue}t.push(i);this.rowSelected.emit(i);if(this._rowSelectionLimit!==undefined&&this.selectedRows.length+t.length===this._rowSelectionLimit){break}}this.selectedRows=[...this.selectedRows,...t];this.selectedRowsChange.emit(this.selectedRows);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t];const i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));if(!i){continue}this.rowDeselected.emit(i)}this.selectedRows=[];this.selectedRowsChange.emit(this.selectedRows)}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection){return}if(t&&this._rowSelectionLimit!==undefined&&this.selectedRows.length>=this._rowSelectionLimit){e.checked=false;return}const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey]){e.checked=false;return}if(t){this.selectedRows=[...this.selectedRows,{...s,index:i}];this.selectedRowsChange.emit(this.selectedRows);this.rowSelected.emit(s);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}const n=this._selectionContains(i,true);const a=[...this.selectedRows];a.splice(n,1);this.selectedRows=a;this.selectedRowsChange.emit(this.selectedRows);this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey?t?.[this.selectionKey]||e:e}_selectionContains(t,e=false){const i=this.selectedRows.findIndex((e=>e.index===t));return!e?i>=0:i}_selectionContainsAll(){let t=true;if(!this._items?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return true}for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(!i){t=false;break}}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return false}let t=0;for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(i){t++}}return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if(i.tagName.toLowerCase()==="input"||i.type==="checkbox"){return}const s=this._findRow(t.target);const n=this._findRowAction(t.target);if(n){return}if(this.enableRowClick){const t=this._items[e];this.rowClick.emit({item:t,ctrlDown:this._ctrlDown});return}if(!this._enableRowSelection){return}const a=s?.querySelector('input[type="checkbox"]');if(!a){return}a.checked=!a.checked;this._checkboxChange(a,e)}_findRow(t){if(!t){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return t}return this._findRow(t?.parentElement)}_findRowAction(t){if(!t){return null}if(t.getAttribute("data-is-action")!==null&&t.getAttribute("data-is-action")!=="false"){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return null}return this._findRowAction(t?.parentElement)}_showFloatingMenu(){let t=this._rowActionsFloatingAll;if(this.rowSelectionLimit===1&&t.findIndex((t=>(t.type==="single"||t.type==="both")&&t.showFunction))>=0){t=t.filter((t=>t.type==="multi"||!t.showFunction||t.showFunction(this.selectedRows[0])))}this._rowActionsFloating=t;this._floatingMenuShown=true}_parseDefinitions(t){return t.map((t=>{t=this._parseDefinitionSizes(t);return t}))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};if(typeof t.sizes==="string"&&!["auto","hidden","full"].includes(t.sizes)){t.sizes=JSON.parse(t.sizes)}for(const[t,s]of a.entries()){if(e.sizes==="auto"||e.sizes==="hidden"||e.sizes==="full"||typeof e.sizes==="number"){i[s]=e.sizes==="auto"?"full":e.sizes;continue}i[s]=e.sizes[s]??i[a[t-1]]}t.parsedSizes=i;return t}static get watchers(){return{items:["_parseItems"],enableRowSelection:["_setRowSelectionData"],rowSelectionLimit:["_setRowSelectionData"],selectedRows:["_setRowSelectionData"]}}};p.style=d;export{p as p_table};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,g as i,h as s,H as n}from"./p-Dpmiv2da.js";import{t as a}from"./p-DdQ-S2l7.js";import{f as o,g as r}from"./p-DiJj8rmO.js";import{f as h}from"./p-DIDkQXzJ.js";import{f as l}from"./p-B3sNjfzc.js";import{c}from"./p-CT54OXR2.js";import{P as f,a as u}from"./p-vyRrSf5s.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const d="*{box-sizing:border-box}.static{position:static!important}.fixed{position:fixed!important}.z-0{z-index:0!important}.my-16{margin-bottom:4rem!important;margin-top:4rem!important}.mb-8{margin-bottom:2rem!important}.flex{display:flex!important}.table{display:table!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.resize{resize:both!important}.flex-col{flex-direction:column!important}.self-center{align-self:center!important}.rounded{border-radius:.25rem!important}.opacity-0{opacity:0!important}.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)!important}";const p=class{constructor(i){t(this,i);this.selectedRowsChange=e(this,"selectedRowsChange",3);this.rowClick=e(this,"rowClick",3);this.rowSelected=e(this,"rowSelected",3);this.rowDeselected=e(this,"rowDeselected",3);this.hasRendered=e(this,"hasRendered",3);this.quickFilter=e(this,"quickFilter",3);this.queryChange=e(this,"queryChange",3);this.filter=e(this,"filter",3);this.action=e(this,"action",3);this.pageChange=e(this,"pageChange",3);this.pageSizeChange=e(this,"pageSizeChange",3);this.export=e(this,"export",3);this.emptyStateActionClick=e(this,"emptyStateActionClick",3)}items;loading=false;headerLoading=false;footerLoading=false;amountOfLoadingRows=6;enableRowSelection=true;rowSelectionLimit;enableRowClick=true;selectedRows=[];enableFloatingMenu=true;floatingMenuAmountSelectedTemplate=t=>o((t===1?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=true;quickFilters=[];activeQuickFilterIdentifier;enableSearch=true;query;enableFilter=true;enableFilterDesktop=true;selectedFiltersAmount;filterButtonTemplate;enableAction=false;actionButtonLoading=false;actionButtonEnabled=false;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=true;enablePaginationSize=true;enablePaginationPages=true;enableExport=true;page=1;total;pageChange;pageSize=f;pageSizeOptions=u;pageSizeChange;export;hideOnSinglePage=true;emptyStateHeader=()=>o(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>o(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>o(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=true;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=true;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=false;_ctrlDown=false;_hasCustomFilterSlot=false;_hasCustomActionsSlot=false;_floatingMenuShown=false;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]');this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]');this._setRowSelectionData();this._setLocales();this._parseItems(this.items);this._generateExtraHeaders();this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"d5675ecf7d464628f39cf0656d152d316a3675fc",class:"z-0 flex flex-col"},s("p-table-container",{key:"84e69afe650c47560b62d31ad76a8cb6faae9a6e"},this.enableHeader&&s("p-table-header",{key:"c4b1a5c57e756d96f597b4fa7fb61dc8202a5bb5",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"6fcc35dbbd37ec70a36cf8912d90f6133f4d3bf6",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"9423bcb8027f58f984c3708221adf2f81651b07a",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"fcf40912d68573281c8e18ee4e30b8f6c3e0c3ef",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"b9f2eaeffd25c1f71662ab1de4985805c1c8f708",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:true,class:h({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,false)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>!t.disabled&&!t.loading&&!!t.action&&t.type==="single"?t.action(this.selectedRows[0],false):t.action(this.selectedRows,true)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"b58718c15d1584296b019f554fa6d06938636b79",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await r(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){if(t!=="Control"||this._ctrlDown===true){return}this._ctrlDown=true}keyUp({key:t}){if(t!=="Control"||this._ctrlDown===false){return}this._ctrlDown=false}visibilityChange(){if(document.visibilityState!=="hidden"||this._ctrlDown===false){return}this._ctrlDown=false}_parseItems(t){if(!t){this._items=[];return}if(Array.isArray(t)){this._items=t;return}this._items=JSON.parse(t)}_setRowSelectionData(){if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=setTimeout((()=>{const t=l();const e=Array.from(this._el.querySelectorAll(":scope > p-table-row-action"));this._rowActionsRow=e.filter((t=>t.type==="both"||t.type==="single"));this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&(e.type==="both"||e.type==="multi")||t&&e.type==="single")).map((t=>{if(t.type==="single"){t.disabled=this.selectedRows?.length>1}return t}));let i=this.rowSelectionLimit;if(t&&this._rowActionsFloatingAll?.length&&(i!==undefined&&this.enableRowSelection||!this.enableRowSelection)){i=1}this._rowSelectionLimit=i;let s=this.enableRowSelection;if(t&&this._rowActionsFloatingAll?.length&&!s){s=true}this._enableRowSelection=s;if(this._floatingMenuShown){this._showFloatingMenu()}}),200)}_generateExtraHeaders(){const t=this._el.querySelectorAll("p-table-extra-header");let e=Array.from(t);e=this._parseDefinitions(e);this._extraHeaders=e}_generateColumns(){const t=this._el.querySelectorAll("p-table-column");let e=Array.from(t);e=this._parseDefinitions(e);this._columns=e}_getExtraHeader(){if(!this._extraHeaders?.length){return null}return s("p-table-row",{variant:"header-secondary",isLast:true},this._extraHeaders.map(((t,e)=>s("p-table-cell",{definition:t,variant:"header-secondary",checkboxOffset:e===0&&this._enableRowSelection,index:e},s("b",null,t.name)))))}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:e===0||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){if(this.loading){return Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e))))}if(!this._items.length){return this._getEmptyState()}return this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>e.showFunction?e.showFunction(t):true));if(i?.length&&!l()){return s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":true,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:true,size:"sm",onClick:()=>typeof e.action==="function"&&e.action?.(t,false)})))))}return null}_getRowColumns(t,e){return this._columns.map(((i,n)=>s("p-table-cell",{definition:i,item:t,checkbox:n===0||i.hasCheckbox?this._getCheckbox(e):null,index:n,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:i===0||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length){return}if(e==="loading"){return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"})}if(e==="header"){return s("p-checkbox",{class:c({"opacity-0":this._rowSelectionLimit!==undefined}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:this._rowSelectionLimit!==undefined,onCheckedChange:t=>this._selectAllChange(t)})}const i=this._items[t];const n=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||this._rowSelectionLimit!==undefined&&!n&&this.selectedRows.length===this._rowSelectionLimit,checked:n,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){if(this.query?.length||this.selectedFiltersAmount){return s("p-empty-state",{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()})}return s("p-empty-state",{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(!this._enableRowSelection){return}const i=t?.detail??e??false;const s=e===undefined?i:e;if(s){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if(this.canSelectKey&&!i[this.canSelectKey]){continue}if(this._selectionContains(e)){continue}t.push(i);this.rowSelected.emit(i);if(this._rowSelectionLimit!==undefined&&this.selectedRows.length+t.length===this._rowSelectionLimit){break}}this.selectedRows=[...this.selectedRows,...t];this.selectedRowsChange.emit(this.selectedRows);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t];const i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));if(!i){continue}this.rowDeselected.emit(i)}this.selectedRows=[];this.selectedRowsChange.emit(this.selectedRows)}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection){return}if(t&&this._rowSelectionLimit!==undefined&&this.selectedRows.length>=this._rowSelectionLimit){e.checked=false;return}const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey]){e.checked=false;return}if(t){this.selectedRows=[...this.selectedRows,{...s,index:i}];this.selectedRowsChange.emit(this.selectedRows);this.rowSelected.emit(s);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}const n=this._selectionContains(i,true);const a=[...this.selectedRows];a.splice(n,1);this.selectedRows=a;this.selectedRowsChange.emit(this.selectedRows);this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey?t?.[this.selectionKey]||e:e}_selectionContains(t,e=false){const i=this.selectedRows.findIndex((e=>e.index===t));return!e?i>=0:i}_selectionContainsAll(){let t=true;if(!this._items?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return true}for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(!i){t=false;break}}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return false}let t=0;for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(i){t++}}return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if(i.tagName.toLowerCase()==="input"||i.type==="checkbox"){return}const s=this._findRow(t.target);const n=this._findRowAction(t.target);if(n){return}if(this.enableRowClick){const t=this._items[e];this.rowClick.emit({item:t,ctrlDown:this._ctrlDown});return}if(!this._enableRowSelection){return}const a=s?.querySelector('input[type="checkbox"]');if(!a){return}a.checked=!a.checked;this._checkboxChange(a,e)}_findRow(t){if(!t){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return t}return this._findRow(t?.parentElement)}_findRowAction(t){if(!t){return null}if(t.getAttribute("data-is-action")!==null&&t.getAttribute("data-is-action")!=="false"){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return null}return this._findRowAction(t?.parentElement)}_showFloatingMenu(){let t=this._rowActionsFloatingAll;if(this.rowSelectionLimit===1&&t.findIndex((t=>(t.type==="single"||t.type==="both")&&t.showFunction))>=0){t=t.filter((t=>t.type==="multi"||!t.showFunction||t.showFunction(this.selectedRows[0])))}this._rowActionsFloating=t;this._floatingMenuShown=true}_parseDefinitions(t){return t.map((t=>{t=this._parseDefinitionSizes(t);return t}))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};if(typeof t.sizes==="string"&&!["auto","hidden","full"].includes(t.sizes)){t.sizes=JSON.parse(t.sizes)}for(const[t,s]of a.entries()){if(e.sizes==="auto"||e.sizes==="hidden"||e.sizes==="full"||typeof e.sizes==="number"){i[s]=e.sizes==="auto"?"full":e.sizes;continue}i[s]=e.sizes[s]??i[a[t-1]]}t.parsedSizes=i;return t}static get watchers(){return{items:["_parseItems"],enableRowSelection:["_setRowSelectionData"],rowSelectionLimit:["_setRowSelectionData"],selectedRows:["_setRowSelectionData"]}}};p.style=d;export{p as p_table};
|
|
2
|
+
//# sourceMappingURL=p-28aa7b28.entry.js.map
|