@paperless/core 3.17.2 → 3.17.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/index.esm.js +1 -1
- package/dist/build/{p-c6008b10.js → p-05f7279a.js} +1 -1
- package/dist/build/p-CzUyWlXA.js +1 -0
- package/dist/{paperless/p-386c86f6.entry.js → build/p-cfb68485.entry.js} +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/index.cjs.js +7 -1
- package/dist/cjs/is-platform-byJrxYJO.js +44 -0
- package/dist/cjs/p-table.cjs.entry.js +9 -9
- package/dist/collection/components/organisms/table/table.component.js +9 -9
- package/dist/collection/utils/is-platform.js +34 -10
- package/dist/components/index.js +1 -1
- package/dist/components/p-CzUyWlXA.js +1 -0
- package/dist/components/p-table.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/is-platform-CzUyWlXA.js +36 -0
- package/dist/esm/p-table.entry.js +9 -9
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/paperless/p-CzUyWlXA.js +1 -0
- package/dist/{build/p-386c86f6.entry.js → paperless/p-cfb68485.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/utils/is-platform.d.ts +6 -0
- package/hydrate/index.js +37 -18
- package/hydrate/index.mjs +37 -18
- package/package.json +1 -1
- package/dist/build/p-17aZBUHj.js +0 -1
- package/dist/cjs/is-platform-DrUncDjO.js +0 -14
- package/dist/components/p-17aZBUHj.js +0 -1
- package/dist/esm/is-platform-17aZBUHj.js +0 -12
- package/dist/paperless/p-17aZBUHj.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
|
-
import { floatingMenuContainerClass, formatTranslation, getLocaleComponentStrings,
|
|
2
|
+
import { floatingMenuContainerClass, formatTranslation, getLocaleComponentStrings, isApple, isMobile, } from "../../../utils";
|
|
3
3
|
import { cn } from "../../../utils/cn";
|
|
4
4
|
import { PAGINATION_DEFAULT_PAGE_SIZE, PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS, TABLE_COLUMN_SIZES, } from "../../../utils/constants";
|
|
5
5
|
export class Table {
|
|
@@ -257,7 +257,7 @@ export class Table {
|
|
|
257
257
|
this.hasRendered.emit();
|
|
258
258
|
}
|
|
259
259
|
render() {
|
|
260
|
-
return (h(Host, { key: '
|
|
260
|
+
return (h(Host, { key: '425442ed379af6ed510015af1c215a243d14a709', class: 'z-0 flex flex-col' }, h("p-table-container", { key: 'f4a76f0df1ff84f4cef210c3721e32f160df7e3b' }, this.enableHeader && (h("p-table-header", { key: 'f621cdc3fce191ec8a921a1bbba6f67212fda95b', 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 }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (h("slot", { key: '6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (h("slot", { key: '1a5aeaa7135c9a91fb624e46bb66a281bff81735', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), h("div", { key: '02e8e776a8f52f98eac3524fac5099d3ce59a43f', class: 'flex flex-1 flex-col' }, this._getRows(), h("slot", { key: '4682df30035958e2c07533eb9103d827c60e2ecf', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (h("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
|
|
261
261
|
hasFooter: this.enableFooter && !this._footerHidden,
|
|
262
262
|
active: !!this.selectedRows?.length,
|
|
263
263
|
shown: this._floatingMenuShown,
|
|
@@ -267,7 +267,7 @@ export class Table {
|
|
|
267
267
|
!!a.action &&
|
|
268
268
|
a.type === 'single'
|
|
269
269
|
? a.action(this.selectedRows[0], false)
|
|
270
|
-
: a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (h("p-table-footer", { key: '
|
|
270
|
+
: a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (h("p-table-footer", { key: '28611ac3b55ea811d39a349edf7698b19b48b264', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
|
|
271
271
|
this.enableAction &&
|
|
272
272
|
this.actionButtonEnabled, total: this.total, onHiddenChange: ({ detail }) => (this._footerHidden = detail), onPageChange: ({ detail }) => this.pageChange.emit(detail), onPageSizeChange: ({ detail }) => this.pageSizeChange.emit(detail) })))));
|
|
273
273
|
}
|
|
@@ -278,18 +278,18 @@ export class Table {
|
|
|
278
278
|
this._generateColumns();
|
|
279
279
|
}
|
|
280
280
|
keyDown({ ctrlKey, metaKey }) {
|
|
281
|
-
const
|
|
282
|
-
const isMeta = metaKey &&
|
|
283
|
-
const isCtrl = ctrlKey && !
|
|
281
|
+
const apple = isApple();
|
|
282
|
+
const isMeta = metaKey && apple;
|
|
283
|
+
const isCtrl = ctrlKey && !apple;
|
|
284
284
|
if ((!isMeta && !isCtrl) || this._ctrlDown === true) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
this._ctrlDown = true;
|
|
288
288
|
}
|
|
289
289
|
keyUp({ code }) {
|
|
290
|
-
const
|
|
291
|
-
const isMeta = ['MetaLeft', 'MetaRight'].includes(code) &&
|
|
292
|
-
const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !
|
|
290
|
+
const apple = isApple();
|
|
291
|
+
const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && apple;
|
|
292
|
+
const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !apple;
|
|
293
293
|
if ((!isMeta && !isCtrl) || this._ctrlDown === false) {
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export const getOS = () => {
|
|
2
|
+
const userAgent = navigator.userAgent;
|
|
3
|
+
const platform =
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
navigator?.userAgentData?.platform || navigator.platform;
|
|
6
|
+
const macosPlatforms = ['macintosh', 'macintel', 'macppc', 'mac68k', 'macos'];
|
|
7
|
+
const windowsPlatforms = ['win32', 'win64', 'windows', 'wince'];
|
|
8
|
+
const iosPlatforms = ['iphone', 'ipad', 'ipod'];
|
|
9
|
+
if (macosPlatforms.includes(platform.toLowerCase())) {
|
|
10
|
+
return 'MacOS';
|
|
11
|
+
}
|
|
12
|
+
if (iosPlatforms.includes(platform.toLowerCase())) {
|
|
13
|
+
return 'iOS';
|
|
14
|
+
}
|
|
15
|
+
if (windowsPlatforms.includes(platform.toLowerCase())) {
|
|
16
|
+
return 'Windows';
|
|
17
|
+
}
|
|
18
|
+
if (/Android/.test(userAgent)) {
|
|
19
|
+
return 'Android';
|
|
20
|
+
}
|
|
21
|
+
if (/Linux/.test(platform)) {
|
|
22
|
+
return 'Linux';
|
|
23
|
+
}
|
|
24
|
+
return 'Unkown';
|
|
25
|
+
};
|
|
26
|
+
export const isApple = () => {
|
|
27
|
+
const os = getOS();
|
|
28
|
+
return os === 'MacOS' || os === 'iOS';
|
|
29
|
+
};
|
|
30
|
+
export const isMac = () => getOS() === 'MacOS';
|
|
31
|
+
export const isIOS = () => getOS() === 'iOS';
|
|
32
|
+
export const isWindows = () => getOS() === 'Windows';
|
|
33
|
+
export const isLinux = () => getOS() === 'Linux';
|
|
34
|
+
export const isAndroid = () => getOS() === 'Android';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-CySg37XO.js";import{s as t}from"./p-CWO2YJCh.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-CWO2YJCh.js";export{i as initTheme,o as onStateChange,s as state,a as stateLocaleOptions,b as stateThemeOptions}from"./p-BBiGYjKk.js";export{c as childOf,a as childOfComposed}from"./p-TyZ7uPES.js";export{c as categorized,i as icons}from"./p-C8Ju8eG_.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-CwQG70_4.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes,o as objectGetByPath}from"./p-WEZng7dj.js";export{i as isMobileBrowser}from"./p-DPc49L2n.js";export{i as isIOS}from"./p-17aZBUHj.js";export{c as cn}from"./p-xs4N_Y-0.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS,T as TABLE_COLUMN_SIZES}from"./p-CEaB2BT0.js";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,m,p,v,u,x,F={},w={};function E(){return m||(m=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const a=t((l||(l=1,function(e){function a(e,a){return{handler:e,config:a}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),a.withOptions=function(e,a=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:a(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=a,t};const t=a}(w)),w));function t(e){return e&&e.__esModule?e:{default:e}}const r=a.default}(F)),F}function C(){if(v)return p;v=1;let e=E();return p=(e.__esModule?e:{default:e}).default}var B,D,O=function(){if(x)return u;x=1;const e=C(),a={position:"relative",paddingBottom:"calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)"},t={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"},r={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}},s=e((function({addComponents:e,matchComponents:s,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(s)return s({"aspect-w":e=>[{...a,"--tw-aspect-w":e},{"> *":t}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l}),void e(r);const f=Object.entries(l).map((([e,a])=>"."+i("aspect-w-"+e))).join(",\n"),m=Object.entries(l).map((([e,a])=>`.${i("aspect-w-"+e)} > *`)).join(",\n");e([{[f]:a,[m]:t},r,Object.entries(l).map((([e,a])=>({["."+i("aspect-w-"+e)]:{"--tw-aspect-w":a}}))),Object.entries(l).map((([e,a])=>({["."+i("aspect-h-"+e)]:{"--tw-aspect-h":a}})))],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"]}});return u=s}(),y=n(O),A=n(function(){if(D)return B;D=1;const e=C()((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"])}));return B=e}()),I=n(C());const Y=({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)"])},_=({addUtilities:e})=>{e({".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)))"}})};var L={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)"}}}};const R={};for(let e=1;e<360;e++)R[""+e]=e+"deg",R["-"+e]=`-${e}deg`;var k={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"},X={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"}};const M=I((e=>{_(e),Y(e)}),{theme:{colors:{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"}},boxShadow:k,dropShadow:k,extend:{animation:L.animation,keyframes:L.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:{flip:"-1"},rotate:R,fontSize:X.fontSize,lineHeight:X.lineHeight,zIndex:{"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"},screens:t,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"},height:{unset:"unset",inherit:"inherit"},spacing:{"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"},aspectRatio:{branding:"23/24"}}},plugins:[y,A,_,Y]}),z=e=>e.replaceAll(/[A-Z]/g,(e=>"_"+e.toLowerCase())),G=e=>e.toLowerCase().replaceAll(/([_-][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),N=e=>e.replaceAll("-"," "),U=e=>e.replaceAll(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));export{z as camelToSnakeCase,N as kebabToSpaces,M as paperless,G as snakeToCamelCase,U as titleCase}
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-CySg37XO.js";import{s as t}from"./p-CWO2YJCh.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-CWO2YJCh.js";export{i as initTheme,o as onStateChange,s as state,a as stateLocaleOptions,b as stateThemeOptions}from"./p-BBiGYjKk.js";export{c as childOf,a as childOfComposed}from"./p-TyZ7uPES.js";export{c as categorized,i as icons}from"./p-C8Ju8eG_.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-CwQG70_4.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes,o as objectGetByPath}from"./p-WEZng7dj.js";export{i as isMobileBrowser}from"./p-DPc49L2n.js";export{g as getOS,e as isAndroid,i as isApple,b as isIOS,d as isLinux,a as isMac,c as isWindows}from"./p-CzUyWlXA.js";export{c as cn}from"./p-xs4N_Y-0.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS,T as TABLE_COLUMN_SIZES}from"./p-CEaB2BT0.js";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,m,p,v,u,x,F={},w={};function E(){return m||(m=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});const a=t((l||(l=1,function(e){function a(e,a){return{handler:e,config:a}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),a.withOptions=function(e,a=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:a(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=a,t};const t=a}(w)),w));function t(e){return e&&e.__esModule?e:{default:e}}const s=a.default}(F)),F}function C(){if(v)return p;v=1;let e=E();return p=(e.__esModule?e:{default:e}).default}var O,A,B=function(){if(x)return u;x=1;const e=C(),a={position:"relative",paddingBottom:"calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)"},t={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"},s={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}},r=e((function({addComponents:e,matchComponents:r,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(r)return r({"aspect-w":e=>[{...a,"--tw-aspect-w":e},{"> *":t}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l}),void e(s);const f=Object.entries(l).map((([e,a])=>"."+i("aspect-w-"+e))).join(",\n"),m=Object.entries(l).map((([e,a])=>`.${i("aspect-w-"+e)} > *`)).join(",\n");e([{[f]:a,[m]:t},s,Object.entries(l).map((([e,a])=>({["."+i("aspect-w-"+e)]:{"--tw-aspect-w":a}}))),Object.entries(l).map((([e,a])=>({["."+i("aspect-h-"+e)]:{"--tw-aspect-h":a}})))],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"]}});return u=r}(),D=n(B),y=n(function(){if(A)return O;A=1;const e=C()((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"])}));return O=e}()),I=n(C());const Y=({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)"])},_=({addUtilities:e})=>{e({".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)))"}})};var L={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)"}}}};const R={};for(let e=1;e<360;e++)R[""+e]=e+"deg",R["-"+e]=`-${e}deg`;var k={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"},X={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"}};const M=I((e=>{_(e),Y(e)}),{theme:{colors:{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"}},boxShadow:k,dropShadow:k,extend:{animation:L.animation,keyframes:L.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:{flip:"-1"},rotate:R,fontSize:X.fontSize,lineHeight:X.lineHeight,zIndex:{"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"},screens:t,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"},height:{unset:"unset",inherit:"inherit"},spacing:{"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"},aspectRatio:{branding:"23/24"}}},plugins:[D,y,_,Y]}),z=e=>e.replaceAll(/[A-Z]/g,(e=>"_"+e.toLowerCase())),G=e=>e.toLowerCase().replaceAll(/([_-][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),W=e=>e.replaceAll("-"," "),N=e=>e.replaceAll(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));export{z as camelToSnakeCase,W as kebabToSpaces,M as paperless,G as snakeToCamelCase,N as titleCase}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=()=>{const n=navigator.userAgent,i=navigator?.userAgentData?.platform||navigator.platform;return["macintosh","macintel","macppc","mac68k","macos"].includes(i.toLowerCase())?"MacOS":["iphone","ipad","ipod"].includes(i.toLowerCase())?"iOS":["win32","win64","windows","wince"].includes(i.toLowerCase())?"Windows":/Android/.test(n)?"Android":/Linux/.test(i)?"Linux":"Unkown"},i=()=>{const i=n();return"MacOS"===i||"iOS"===i},a=()=>"MacOS"===n(),o=()=>"iOS"===n(),s=()=>"Windows"===n(),c=()=>"Linux"===n(),d=()=>"Android"===n();export{a,o as b,s as c,c as d,d as e,n as g,i}
|
|
@@ -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 c}from"./p-CWO2YJCh.js";import{i as h}from"./p-17aZBUHj.js";import{c as p}from"./p-xs4N_Y-0.js";import{P as m,a as d,T as u}from"./p-CEaB2BT0.js";import{d as b}from"./p-1HCkK9Pf.js";import{d as f}from"./p-D6g8cYWI.js";import{d as g}from"./p-BEo__1-X.js";import{d as w}from"./p-BANLejQ8.js";import{d as k}from"./p-DU-stXqd.js";import{d as y}from"./p-BNMkjAgS.js";import{d as S}from"./p-B91CxVcz.js";import{d as _}from"./p-wYHaAjO_.js";import{d as x}from"./p-xkXCC7GI.js";import{d as C}from"./p-SUrtpFuE.js";import{d as E}from"./p-CQ6JEZg6.js";import{d as v}from"./p-7-twKt34.js";import{d as j}from"./p-CTI55iY5.js";import{d as R}from"./p-BOJwTddb.js";import{d as A}from"./p-CEcyKdij.js";import{d as F}from"./p-D8faiybE.js";import{d as B}from"./p-B6hIbVwt.js";import{d as D}from"./p-DM-VvZXT.js";import{d as z}from"./p-C-ljhNrW.js";import{d as T}from"./p-Bk5wUwrW.js";import{d as L}from"./p-B-YBFRbB.js";import{d as H}from"./p-COuYu8I6.js";import{d as I}from"./p-DpmybwXO.js";import{d as O}from"./p-Hk7avBWN.js";import{d as P}from"./p-Dkr0Ta5m.js";import{d as q}from"./p-C0cLQxQE.js";import{d as Y}from"./p-BO7NYfW5.js";import{d as M}from"./p-C9B5DTYx.js";import{d as Q}from"./p-GYxEYTaZ.js";const K=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=m;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return o(a,{key:"3b12dc119714044252913dcbcd90a131e5b46608",class:"z-0 flex flex-col"},o("p-table-container",{key:"0f924438556a3a035672270ae88208fbcc8f1319"},this.enableHeader&&o("p-table-header",{key:"0eb96826bf1b2b18281cf4e75e7e6c2100071678",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:"059f2a7e21d36f0d45ca644fddfe10d6ec897662",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"493b58b1674665f8020bd160efe2e1eabcca5aa1",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"a245efe796c78f59419f14193f27753a4aa36180",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"080691433b5037f3d809075cf2ccdadb86dc9fcd",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:"9b9ee0b74fd7691bed78fa064c745ead40b5a2c1",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({ctrlKey:t,metaKey:e}){const i=h();(e&&i||t&&!i)&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({code:t}){const e=h();(["MetaLeft","MetaRight"].includes(t)&&e||["ControlLeft","ControlRight"].includes(t)&&!e)&&!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?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&&!c()?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:p({"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 u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function U(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),K);break;case"p-badge":customElements.get(t(e))||b();break;case"p-button":customElements.get(t(e))||f();break;case"p-checkbox":customElements.get(t(e))||g();break;case"p-divider":customElements.get(t(e))||w();break;case"p-dropdown":customElements.get(t(e))||k();break;case"p-dropdown-menu-container":customElements.get(t(e))||y();break;case"p-dropdown-menu-item":customElements.get(t(e))||S();break;case"p-empty-state":customElements.get(t(e))||_();break;case"p-field":customElements.get(t(e))||x();break;case"p-field-container":customElements.get(t(e))||C();break;case"p-floating-menu-container":customElements.get(t(e))||E();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||j();break;case"p-icon":customElements.get(t(e))||R();break;case"p-illustration":customElements.get(t(e))||A();break;case"p-loader":customElements.get(t(e))||F();break;case"p-pagination":customElements.get(t(e))||B();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))||T();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))||I();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))||Y();break;case"p-table-row-actions-container":customElements.get(t(e))||M();break;case"p-tooltip":customElements.get(t(e))||Q()}}))}U();const N=K,W=U;export{N as PTable,W as defineCustomElement}
|
|
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 c}from"./p-CWO2YJCh.js";import{i as h}from"./p-CzUyWlXA.js";import{c as p}from"./p-xs4N_Y-0.js";import{P as m,a as d,T as u}from"./p-CEaB2BT0.js";import{d as b}from"./p-1HCkK9Pf.js";import{d as f}from"./p-D6g8cYWI.js";import{d as g}from"./p-BEo__1-X.js";import{d as w}from"./p-BANLejQ8.js";import{d as k}from"./p-DU-stXqd.js";import{d as y}from"./p-BNMkjAgS.js";import{d as S}from"./p-B91CxVcz.js";import{d as _}from"./p-wYHaAjO_.js";import{d as x}from"./p-xkXCC7GI.js";import{d as C}from"./p-SUrtpFuE.js";import{d as E}from"./p-CQ6JEZg6.js";import{d as v}from"./p-7-twKt34.js";import{d as j}from"./p-CTI55iY5.js";import{d as A}from"./p-BOJwTddb.js";import{d as R}from"./p-CEcyKdij.js";import{d as F}from"./p-D8faiybE.js";import{d as D}from"./p-B6hIbVwt.js";import{d as B}from"./p-DM-VvZXT.js";import{d as z}from"./p-C-ljhNrW.js";import{d as T}from"./p-Bk5wUwrW.js";import{d as L}from"./p-B-YBFRbB.js";import{d as H}from"./p-COuYu8I6.js";import{d as I}from"./p-DpmybwXO.js";import{d as O}from"./p-Hk7avBWN.js";import{d as P}from"./p-Dkr0Ta5m.js";import{d as q}from"./p-C0cLQxQE.js";import{d as Y}from"./p-BO7NYfW5.js";import{d as M}from"./p-C9B5DTYx.js";import{d as Q}from"./p-GYxEYTaZ.js";const K=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=m;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return o(a,{key:"425442ed379af6ed510015af1c215a243d14a709",class:"z-0 flex flex-col"},o("p-table-container",{key:"f4a76f0df1ff84f4cef210c3721e32f160df7e3b"},this.enableHeader&&o("p-table-header",{key:"f621cdc3fce191ec8a921a1bbba6f67212fda95b",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:"6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"1a5aeaa7135c9a91fb624e46bb66a281bff81735",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"02e8e776a8f52f98eac3524fac5099d3ce59a43f",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"4682df30035958e2c07533eb9103d827c60e2ecf",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:"28611ac3b55ea811d39a349edf7698b19b48b264",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({ctrlKey:t,metaKey:e}){const i=h();(e&&i||t&&!i)&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({code:t}){const e=h();(["MetaLeft","MetaRight"].includes(t)&&e||["ControlLeft","ControlRight"].includes(t)&&!e)&&!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?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&&!c()?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:p({"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 u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function U(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),K);break;case"p-badge":customElements.get(t(e))||b();break;case"p-button":customElements.get(t(e))||f();break;case"p-checkbox":customElements.get(t(e))||g();break;case"p-divider":customElements.get(t(e))||w();break;case"p-dropdown":customElements.get(t(e))||k();break;case"p-dropdown-menu-container":customElements.get(t(e))||y();break;case"p-dropdown-menu-item":customElements.get(t(e))||S();break;case"p-empty-state":customElements.get(t(e))||_();break;case"p-field":customElements.get(t(e))||x();break;case"p-field-container":customElements.get(t(e))||C();break;case"p-floating-menu-container":customElements.get(t(e))||E();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||j();break;case"p-icon":customElements.get(t(e))||A();break;case"p-illustration":customElements.get(t(e))||R();break;case"p-loader":customElements.get(t(e))||F();break;case"p-pagination":customElements.get(t(e))||D();break;case"p-pagination-pages":customElements.get(t(e))||B();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||T();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))||I();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))||Y();break;case"p-table-row-actions-container":customElements.get(t(e))||M();break;case"p-tooltip":customElements.get(t(e))||Q()}}))}U();const W=K,N=U;export{W as PTable,N as defineCustomElement}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { f as formatTranslation, g as getLocaleComponentStrings } from './locali
|
|
|
7
7
|
export { f as floatingMenuContainerClass, g as getTableCellColumnClasses, a as getTableCellSizes } from './table-helpers-Bvtfm-ta.js';
|
|
8
8
|
export { o as objectGetByPath } from './object-get-by-path-CLLU0oUD.js';
|
|
9
9
|
export { i as isMobileBrowser } from './is-mobile-browser-DPc49L2n.js';
|
|
10
|
-
export { i as isIOS } from './is-platform-
|
|
10
|
+
export { g as getOS, e as isAndroid, i as isApple, b as isIOS, d as isLinux, a as isMac, c as isWindows } from './is-platform-CzUyWlXA.js';
|
|
11
11
|
export { c as cn } from './cn-CsNqHcjL.js';
|
|
12
12
|
export { P as PAGINATION_DEFAULT_PAGE_SIZE, a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS, S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS, T as TABLE_COLUMN_SIZES } from './constants-CEaB2BT0.js';
|
|
13
13
|
import './index-yFtRjnrU.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const getOS = () => {
|
|
2
|
+
const userAgent = navigator.userAgent;
|
|
3
|
+
const platform =
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
navigator?.userAgentData?.platform || navigator.platform;
|
|
6
|
+
const macosPlatforms = ['macintosh', 'macintel', 'macppc', 'mac68k', 'macos'];
|
|
7
|
+
const windowsPlatforms = ['win32', 'win64', 'windows', 'wince'];
|
|
8
|
+
const iosPlatforms = ['iphone', 'ipad', 'ipod'];
|
|
9
|
+
if (macosPlatforms.includes(platform.toLowerCase())) {
|
|
10
|
+
return 'MacOS';
|
|
11
|
+
}
|
|
12
|
+
if (iosPlatforms.includes(platform.toLowerCase())) {
|
|
13
|
+
return 'iOS';
|
|
14
|
+
}
|
|
15
|
+
if (windowsPlatforms.includes(platform.toLowerCase())) {
|
|
16
|
+
return 'Windows';
|
|
17
|
+
}
|
|
18
|
+
if (/Android/.test(userAgent)) {
|
|
19
|
+
return 'Android';
|
|
20
|
+
}
|
|
21
|
+
if (/Linux/.test(platform)) {
|
|
22
|
+
return 'Linux';
|
|
23
|
+
}
|
|
24
|
+
return 'Unkown';
|
|
25
|
+
};
|
|
26
|
+
const isApple = () => {
|
|
27
|
+
const os = getOS();
|
|
28
|
+
return os === 'MacOS' || os === 'iOS';
|
|
29
|
+
};
|
|
30
|
+
const isMac = () => getOS() === 'MacOS';
|
|
31
|
+
const isIOS = () => getOS() === 'iOS';
|
|
32
|
+
const isWindows = () => getOS() === 'Windows';
|
|
33
|
+
const isLinux = () => getOS() === 'Linux';
|
|
34
|
+
const isAndroid = () => getOS() === 'Android';
|
|
35
|
+
|
|
36
|
+
export { isMac as a, isIOS as b, isWindows as c, isLinux as d, isAndroid as e, getOS as g, isApple as i };
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, a as createEvent, d as getElement, h, e as Host
|
|
|
2
2
|
import { f as formatTranslation, g as getLocaleComponentStrings } from './localization-CwQG70_4.js';
|
|
3
3
|
import { f as floatingMenuContainerClass } from './table-helpers-Bvtfm-ta.js';
|
|
4
4
|
import { f as isMobile } from './screens-CWO2YJCh.js';
|
|
5
|
-
import { i as
|
|
5
|
+
import { i as isApple } from './is-platform-CzUyWlXA.js';
|
|
6
6
|
import { c as cn } from './cn-CsNqHcjL.js';
|
|
7
7
|
import { P as PAGINATION_DEFAULT_PAGE_SIZE, a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS, T as TABLE_COLUMN_SIZES } from './constants-CEaB2BT0.js';
|
|
8
8
|
import './index-CO0T2jO4.js';
|
|
@@ -277,7 +277,7 @@ const Table = class {
|
|
|
277
277
|
this.hasRendered.emit();
|
|
278
278
|
}
|
|
279
279
|
render() {
|
|
280
|
-
return (h(Host, { key: '
|
|
280
|
+
return (h(Host, { key: '425442ed379af6ed510015af1c215a243d14a709', class: 'z-0 flex flex-col' }, h("p-table-container", { key: 'f4a76f0df1ff84f4cef210c3721e32f160df7e3b' }, this.enableHeader && (h("p-table-header", { key: 'f621cdc3fce191ec8a921a1bbba6f67212fda95b', 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 }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (h("slot", { key: '6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (h("slot", { key: '1a5aeaa7135c9a91fb624e46bb66a281bff81735', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), h("div", { key: '02e8e776a8f52f98eac3524fac5099d3ce59a43f', class: 'flex flex-1 flex-col' }, this._getRows(), h("slot", { key: '4682df30035958e2c07533eb9103d827c60e2ecf', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (h("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
|
|
281
281
|
hasFooter: this.enableFooter && !this._footerHidden,
|
|
282
282
|
active: !!this.selectedRows?.length,
|
|
283
283
|
shown: this._floatingMenuShown,
|
|
@@ -287,7 +287,7 @@ const Table = class {
|
|
|
287
287
|
!!a.action &&
|
|
288
288
|
a.type === 'single'
|
|
289
289
|
? a.action(this.selectedRows[0], false)
|
|
290
|
-
: a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (h("p-table-footer", { key: '
|
|
290
|
+
: a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (h("p-table-footer", { key: '28611ac3b55ea811d39a349edf7698b19b48b264', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
|
|
291
291
|
this.enableAction &&
|
|
292
292
|
this.actionButtonEnabled, total: this.total, onHiddenChange: ({ detail }) => (this._footerHidden = detail), onPageChange: ({ detail }) => this.pageChange.emit(detail), onPageSizeChange: ({ detail }) => this.pageSizeChange.emit(detail) })))));
|
|
293
293
|
}
|
|
@@ -298,18 +298,18 @@ const Table = class {
|
|
|
298
298
|
this._generateColumns();
|
|
299
299
|
}
|
|
300
300
|
keyDown({ ctrlKey, metaKey }) {
|
|
301
|
-
const
|
|
302
|
-
const isMeta = metaKey &&
|
|
303
|
-
const isCtrl = ctrlKey && !
|
|
301
|
+
const apple = isApple();
|
|
302
|
+
const isMeta = metaKey && apple;
|
|
303
|
+
const isCtrl = ctrlKey && !apple;
|
|
304
304
|
if ((!isMeta && !isCtrl) || this._ctrlDown === true) {
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
307
|
this._ctrlDown = true;
|
|
308
308
|
}
|
|
309
309
|
keyUp({ code }) {
|
|
310
|
-
const
|
|
311
|
-
const isMeta = ['MetaLeft', 'MetaRight'].includes(code) &&
|
|
312
|
-
const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !
|
|
310
|
+
const apple = isApple();
|
|
311
|
+
const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && apple;
|
|
312
|
+
const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !apple;
|
|
313
313
|
if ((!isMeta && !isCtrl) || this._ctrlDown === false) {
|
|
314
314
|
return;
|
|
315
315
|
}
|
package/dist/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-05f7279a.js"><link rel="modulepreload" href="/build/p-6XOzWrsN.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-C8Ju8eG_.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CSySY6aC.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-xs4N_Y-0.js"><link rel="modulepreload" href="/build/p-yFtRjnrU.js"><script type="module" src="/build/p-05f7279a.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <link href="/build/p-ea6cc0bf.css" rel="stylesheet"> </head> <body> <p-button>Test</p-button> <script data-build="2026-07-23T14:52:46">
|
|
2
2
|
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
|
|
3
3
|
window.addEventListener('load', function() {
|
|
4
4
|
navigator.serviceWorker.register('/sw.js')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t}from"./p-CWO2YJCh.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-CWO2YJCh.js";export{i as initTheme,o as onStateChange,s as state,a as stateLocaleOptions,b as stateThemeOptions}from"./p-6XOzWrsN.js";export{c as childOf,a as childOfComposed}from"./p-TyZ7uPES.js";export{c as categorized,i as icons}from"./p-C8Ju8eG_.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-CwQG70_4.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes}from"./p-DeWIZIsV.js";export{o as objectGetByPath}from"./p-CLLU0oUD.js";export{i as isMobileBrowser}from"./p-DPc49L2n.js";export{i as isIOS}from"./p-17aZBUHj.js";export{c as cn}from"./p-xs4N_Y-0.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS,T as TABLE_COLUMN_SIZES}from"./p-CEaB2BT0.js";import"./p-yFtRjnrU.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,l,m,p,v,u,x={},F={};function w(){return l||(l=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const a=t((n||(n=1,function(e){function a(e,a){return{handler:e,config:a}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),a.withOptions=function(e,a=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:a(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=a,t};const t=a}(F)),F));function t(e){return e&&e.__esModule?e:{default:e}}const r=a.default}(x)),x}function E(){if(p)return m;p=1;let e=w();return m=(e.__esModule?e:{default:e}).default}var C,D,B=function(){if(u)return v;u=1;const e=E(),a={position:"relative",paddingBottom:"calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)"},t={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"},r={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}},s=e((function({addComponents:e,matchComponents:s,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(s)return s({"aspect-w":e=>[{...a,"--tw-aspect-w":e},{"> *":t}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l}),void e(r);const m=Object.entries(l).map((([e,a])=>`.${i(`aspect-w-${e}`)}`)).join(",\n"),f=Object.entries(l).map((([e,a])=>`.${i(`aspect-w-${e}`)} > *`)).join(",\n");e([{[m]:a,[f]:t},r,Object.entries(l).map((([e,a])=>({[`.${i(`aspect-w-${e}`)}`]:{"--tw-aspect-w":a}}))),Object.entries(l).map((([e,a])=>({[`.${i(`aspect-h-${e}`)}`]:{"--tw-aspect-h":a}})))],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"]}});return v=s}(),O=r(B),y=r(function(){if(D)return C;D=1;const e=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"])}));return C=e}()),I=r(E());const A=({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)"])},Y=({addUtilities:e})=>{e({".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)))"}})};var L={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)"}}}};const _={};for(let e=1;e<360;e++)_[`${e}`]=`${e}deg`,_[`-${e}`]=`-${e}deg`;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"},k={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"}};const X=I((e=>{Y(e),A(e)}),{theme:{colors:{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"}},boxShadow:R,dropShadow:R,extend:{animation:L.animation,keyframes:L.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:{flip:"-1"},rotate:_,fontSize:k.fontSize,lineHeight:k.lineHeight,zIndex:{"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"},screens:t,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"},height:{unset:"unset",inherit:"inherit"},spacing:{"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"},aspectRatio:{branding:"23/24"}}},plugins:[O,y,Y,A]}),$=e=>e.replaceAll(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),M=e=>e.toLowerCase().replaceAll(/([_-][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),U=e=>e.replaceAll("-"," "),z=e=>e.replaceAll(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));export{$ as camelToSnakeCase,U as kebabToSpaces,X as paperless,M as snakeToCamelCase,z as titleCase}
|
|
1
|
+
import{s as t}from"./p-CWO2YJCh.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-CWO2YJCh.js";export{i as initTheme,o as onStateChange,s as state,a as stateLocaleOptions,b as stateThemeOptions}from"./p-6XOzWrsN.js";export{c as childOf,a as childOfComposed}from"./p-TyZ7uPES.js";export{c as categorized,i as icons}from"./p-C8Ju8eG_.js";export{f as formatTranslation,g as getLocaleComponentStrings}from"./p-CwQG70_4.js";export{f as floatingMenuContainerClass,g as getTableCellColumnClasses,a as getTableCellSizes}from"./p-DeWIZIsV.js";export{o as objectGetByPath}from"./p-CLLU0oUD.js";export{i as isMobileBrowser}from"./p-DPc49L2n.js";export{g as getOS,e as isAndroid,i as isApple,b as isIOS,d as isLinux,a as isMac,c as isWindows}from"./p-CzUyWlXA.js";export{c as cn}from"./p-xs4N_Y-0.js";export{P as PAGINATION_DEFAULT_PAGE_SIZE,a as PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,S as SELECT_DEFAULT_MAX_DISPLAYED_ITEMS,T as TABLE_COLUMN_SIZES}from"./p-CEaB2BT0.js";import"./p-yFtRjnrU.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,l,m,p,v,u,x={},F={};function w(){return l||(l=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});const a=t((n||(n=1,function(e){function a(e,a){return{handler:e,config:a}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),a.withOptions=function(e,a=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:a(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=a,t};const t=a}(F)),F));function t(e){return e&&e.__esModule?e:{default:e}}const s=a.default}(x)),x}function E(){if(p)return m;p=1;let e=w();return m=(e.__esModule?e:{default:e}).default}var C,D,O=function(){if(u)return v;u=1;const e=E(),a={position:"relative",paddingBottom:"calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)"},t={position:"absolute",height:"100%",width:"100%",top:"0",right:"0",bottom:"0",left:"0"},s={".aspect-none":{position:"static",paddingBottom:"0"},".aspect-none > *":{position:"static",height:"auto",width:"auto",top:"auto",right:"auto",bottom:"auto",left:"auto"}},r=e((function({addComponents:e,matchComponents:r,theme:n,variants:o,e:i}){const l=n("aspectRatio");if(r)return r({"aspect-w":e=>[{...a,"--tw-aspect-w":e},{"> *":t}],"aspect-h":e=>({"--tw-aspect-h":e})},{values:l}),void e(s);const m=Object.entries(l).map((([e,a])=>`.${i(`aspect-w-${e}`)}`)).join(",\n"),f=Object.entries(l).map((([e,a])=>`.${i(`aspect-w-${e}`)} > *`)).join(",\n");e([{[m]:a,[f]:t},s,Object.entries(l).map((([e,a])=>({[`.${i(`aspect-w-${e}`)}`]:{"--tw-aspect-w":a}}))),Object.entries(l).map((([e,a])=>({[`.${i(`aspect-h-${e}`)}`]:{"--tw-aspect-h":a}})))],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"]}});return v=r}(),B=r(O),y=r(function(){if(D)return C;D=1;const e=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"])}));return C=e}()),A=r(E());const I=({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)"])},L=({addUtilities:e})=>{e({".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)))"}})};var Y={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)"}}}};const _={};for(let e=1;e<360;e++)_[`${e}`]=`${e}deg`,_[`-${e}`]=`-${e}deg`;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"},X={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"}};const k=A((e=>{L(e),I(e)}),{theme:{colors:{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"}},boxShadow:R,dropShadow:R,extend:{animation:Y.animation,keyframes:Y.keyframes,fontFamily:{geist:["Geist","serif"],ambit:["Ambit","sans-serif"]},scale:{flip:"-1"},rotate:_,fontSize:X.fontSize,lineHeight:X.lineHeight,zIndex:{"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"},screens:t,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"},height:{unset:"unset",inherit:"inherit"},spacing:{"content-mobile-x":"1rem","content-mobile-y":"1.5rem","content-desktop-x":"2rem","content-desktop-y":"2rem",18:"4.5rem"},aspectRatio:{branding:"23/24"}}},plugins:[B,y,L,I]}),M=e=>e.replaceAll(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),$=e=>e.toLowerCase().replaceAll(/([_-][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),U=e=>e.replaceAll("-"," "),z=e=>e.replaceAll(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));export{M as camelToSnakeCase,U as kebabToSpaces,k as paperless,$ as snakeToCamelCase,z as titleCase}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=()=>{const n=navigator.userAgent,i=navigator?.userAgentData?.platform||navigator.platform;return["macintosh","macintel","macppc","mac68k","macos"].includes(i.toLowerCase())?"MacOS":["iphone","ipad","ipod"].includes(i.toLowerCase())?"iOS":["win32","win64","windows","wince"].includes(i.toLowerCase())?"Windows":/Android/.test(n)?"Android":/Linux/.test(i)?"Linux":"Unkown"},i=()=>{const i=n();return"MacOS"===i||"iOS"===i},a=()=>"MacOS"===n(),o=()=>"iOS"===n(),s=()=>"Windows"===n(),c=()=>"Linux"===n(),d=()=>"Android"===n();export{a,o as b,s as c,c as d,d as e,n as g,i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,a as e,d as i,h as s,e as n}from"./p-yFtRjnrU.js";import{f as o,g as a}from"./p-CwQG70_4.js";import{f as h}from"./p-DeWIZIsV.js";import{f as l}from"./p-CWO2YJCh.js";import{i as r}from"./p-17aZBUHj.js";import{c}from"./p-xs4N_Y-0.js";import{P as d,a as u,T as f}from"./p-CEaB2BT0.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";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=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>o((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=d;pageSizeOptions=u;pageSizeChange;export;hideOnSinglePage=!0;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=!0;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"3b12dc119714044252913dcbcd90a131e5b46608",class:"z-0 flex flex-col"},s("p-table-container",{key:"0f924438556a3a035672270ae88208fbcc8f1319"},this.enableHeader&&s("p-table-header",{key:"0eb96826bf1b2b18281cf4e75e7e6c2100071678",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&&s("slot",{key:"059f2a7e21d36f0d45ca644fddfe10d6ec897662",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"493b58b1674665f8020bd160efe2e1eabcca5aa1",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"a245efe796c78f59419f14193f27753a4aa36180",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"080691433b5037f3d809075cf2ccdadb86dc9fcd",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:h({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=>s("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&&s("p-table-footer",{key:"9b9ee0b74fd7691bed78fa064c745ead40b5a2c1",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 a(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({ctrlKey:t,metaKey:e}){const i=r();(e&&i||t&&!i)&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({code:t}){const e=r(),i=["MetaLeft","MetaRight"].includes(t)&&e,s=["ControlLeft","ControlRight"].includes(t)&&!e;(i||s)&&!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=l(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>s("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("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)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{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&&!l()?s("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>s("p-tooltip",{content:e.label,strategy:"fixed"},s("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,n)=>s("p-table-cell",{checkbox:0===n||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:n,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("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 s("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return s("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],n=this._selectionContains(t);return s("p-checkbox",{checked:n,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!n&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("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 n=this._selectionContains(i,!0),o=[...this.selectedRows];o.splice(n,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 n=s?.querySelector('input[type="checkbox"]');n&&(n.checked=!n.checked,this._checkboxChange(n,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 f.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[f[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}]}}};p.style="*{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)}";export{p as p_table}
|
|
1
|
+
import{r as t,a as e,d as i,h as s,e as n}from"./p-yFtRjnrU.js";import{f as o,g as a}from"./p-CwQG70_4.js";import{f as h}from"./p-DeWIZIsV.js";import{f as l}from"./p-CWO2YJCh.js";import{i as r}from"./p-CzUyWlXA.js";import{c}from"./p-xs4N_Y-0.js";import{P as d,a as u,T as f}from"./p-CEaB2BT0.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";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=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>o((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=d;pageSizeOptions=u;pageSizeChange;export;hideOnSinglePage=!0;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=!0;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"425442ed379af6ed510015af1c215a243d14a709",class:"z-0 flex flex-col"},s("p-table-container",{key:"f4a76f0df1ff84f4cef210c3721e32f160df7e3b"},this.enableHeader&&s("p-table-header",{key:"f621cdc3fce191ec8a921a1bbba6f67212fda95b",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&&s("slot",{key:"6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"1a5aeaa7135c9a91fb624e46bb66a281bff81735",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"02e8e776a8f52f98eac3524fac5099d3ce59a43f",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"4682df30035958e2c07533eb9103d827c60e2ecf",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:h({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=>s("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&&s("p-table-footer",{key:"28611ac3b55ea811d39a349edf7698b19b48b264",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 a(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({ctrlKey:t,metaKey:e}){const i=r();(e&&i||t&&!i)&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({code:t}){const e=r(),i=["MetaLeft","MetaRight"].includes(t)&&e,s=["ControlLeft","ControlRight"].includes(t)&&!e;(i||s)&&!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=l(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>s("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("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)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{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&&!l()?s("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>s("p-tooltip",{content:e.label,strategy:"fixed"},s("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,n)=>s("p-table-cell",{checkbox:0===n||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:n,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("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 s("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return s("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],n=this._selectionContains(t);return s("p-checkbox",{checked:n,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!n&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("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 n=this._selectionContains(i,!0),o=[...this.selectedRows];o.splice(n,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 n=s?.querySelector('input[type="checkbox"]');n&&(n.checked=!n.checked,this._checkboxChange(n,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 f.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[f[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}]}}};p.style="*{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)}";export{p as p_table}
|