@paperless/core 2.15.3 → 2.16.0
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/CHANGELOG.md +20 -0
- package/dist/build/index.esm.js +1 -1
- package/dist/{paperless/p-168e8d5c.entry.js → build/p-133e281e.entry.js} +2 -2
- package/dist/build/{p-95d812ef.entry.js → p-2d456ab7.entry.js} +2 -2
- package/dist/build/p-61633f23.entry.js +2 -0
- package/dist/build/p-61633f23.entry.js.map +1 -0
- package/dist/build/p-7c0fb43f.js +2 -0
- package/dist/build/{p-13549fce.entry.js → p-7dc22659.entry.js} +2 -2
- package/dist/build/p-C-WRzhFe.js +2 -0
- package/dist/build/p-C-WRzhFe.js.map +1 -0
- package/dist/build/p-ab66da44.entry.js.map +1 -1
- package/dist/build/p-b94bc701.entry.js +2 -0
- package/dist/build/p-b94bc701.entry.js.map +1 -0
- package/dist/build/p-c59b1d50.entry.js +2 -0
- package/dist/build/p-c59b1d50.entry.js.map +1 -0
- package/dist/build/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/build/p-table-column.entry.esm.js.map +1 -1
- package/dist/build/p-table-extra-header.entry.esm.js.map +1 -0
- package/dist/build/p-table.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/index-Bt6zTh_b.js +4 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-empty-state_8.cjs.entry.js +35 -21
- package/dist/cjs/p-empty-state_8.cjs.entry.js.map +1 -1
- package/dist/cjs/p-listing.cjs.entry.js +2 -2
- package/dist/cjs/p-navbar.cjs.entry.js +1 -1
- package/dist/cjs/p-table-column.cjs.entry.js.map +1 -1
- package/dist/cjs/p-table-column.entry.cjs.js.map +1 -1
- package/dist/cjs/p-table-extra-header.cjs.entry.js +49 -0
- package/dist/cjs/p-table-extra-header.cjs.entry.js.map +1 -0
- package/dist/cjs/p-table-extra-header.entry.cjs.js.map +1 -0
- package/dist/cjs/p-table.cjs.entry.js +20 -4
- package/dist/cjs/p-table.cjs.entry.js.map +1 -1
- package/dist/cjs/p-table.entry.cjs.js.map +1 -1
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/cjs/{table-helpers-DyPa1NIG.js → table-helpers-Du9NM7La.js} +7 -4
- package/dist/cjs/table-helpers-Du9NM7La.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/helpers/table/column/table-column.component.js +2 -2
- package/dist/collection/components/helpers/table/column/table-column.component.js.map +1 -1
- package/dist/collection/components/helpers/table/extra-header/table-extra-header.component.js +189 -0
- package/dist/collection/components/helpers/table/extra-header/table-extra-header.component.js.map +1 -0
- package/dist/collection/components/molecules/table/cell/table-cell.component.css +1 -1
- package/dist/collection/components/molecules/table/cell/table-cell.component.js +29 -5
- package/dist/collection/components/molecules/table/cell/table-cell.component.js.map +1 -1
- package/dist/collection/components/molecules/table/footer/table-footer.component.js +2 -2
- package/dist/collection/components/molecules/table/header/table-header.component.js +4 -4
- package/dist/collection/components/molecules/table/header/table-header.component.js.map +1 -1
- package/dist/collection/components/molecules/table/row/table-row.component.css +1 -1
- package/dist/collection/components/molecules/table/row/table-row.component.js +21 -11
- package/dist/collection/components/molecules/table/row/table-row.component.js.map +1 -1
- package/dist/collection/components/molecules/toast/toast.component.js +1 -1
- package/dist/collection/components/organisms/listing/listing.component.js +2 -2
- package/dist/collection/components/organisms/navbar/navbar.component.js +1 -1
- package/dist/collection/components/organisms/table/table.component.js +20 -3
- package/dist/collection/components/organisms/table/table.component.js.map +1 -1
- package/dist/collection/utils/table-helpers.js +5 -2
- package/dist/collection/utils/table-helpers.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DjVT03PN.js → p-BnFffAKh.js} +4 -4
- package/dist/components/{p-DjVT03PN.js.map → p-BnFffAKh.js.map} +1 -1
- package/dist/components/{p-1KS1K8BB.js → p-CT2cHZ7O.js} +7 -4
- package/dist/components/p-CT2cHZ7O.js.map +1 -0
- package/dist/components/{p-BJ_tiVQ2.js → p-C_WKf2Pq.js} +6 -6
- package/dist/components/{p-BJ_tiVQ2.js.map → p-C_WKf2Pq.js.map} +1 -1
- package/dist/components/p-DuBiYXDO.js +148 -0
- package/dist/components/p-DuBiYXDO.js.map +1 -0
- package/dist/components/p-Dyc4CMNs.js +124 -0
- package/dist/components/p-Dyc4CMNs.js.map +1 -0
- package/dist/components/p-listing.js +2 -2
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-table-cell.js +1 -1
- package/dist/components/p-table-column.js.map +1 -1
- package/dist/components/p-table-extra-header.d.ts +11 -0
- package/dist/components/p-table-extra-header.js +72 -0
- package/dist/components/p-table-extra-header.js.map +1 -0
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table-row.js +1 -1
- package/dist/components/p-table.js +25 -8
- package/dist/components/p-table.js.map +1 -1
- package/dist/components/p-toast.js +1 -1
- package/dist/esm/index-Dpmiv2da.js +4 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.js.map +1 -1
- package/dist/esm/p-empty-state_8.entry.js +35 -21
- package/dist/esm/p-empty-state_8.entry.js.map +1 -1
- package/dist/esm/p-listing.entry.js +2 -2
- package/dist/esm/p-navbar.entry.js +1 -1
- package/dist/esm/p-table-column.entry.js.map +1 -1
- package/dist/esm/p-table-extra-header.entry.js +47 -0
- package/dist/esm/p-table-extra-header.entry.js.map +1 -0
- package/dist/esm/p-table.entry.js +20 -4
- package/dist/esm/p-table.entry.js.map +1 -1
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/esm/{table-helpers-Cx32XkzF.js → table-helpers-DozDU2EV.js} +7 -4
- package/dist/esm/table-helpers-DozDU2EV.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/{build/p-168e8d5c.entry.js → paperless/p-133e281e.entry.js} +2 -2
- package/dist/paperless/{p-95d812ef.entry.js → p-2d456ab7.entry.js} +2 -2
- package/dist/paperless/p-61633f23.entry.js +2 -0
- package/dist/paperless/p-61633f23.entry.js.map +1 -0
- package/dist/paperless/{p-13549fce.entry.js → p-7dc22659.entry.js} +2 -2
- package/dist/paperless/p-C-WRzhFe.js +2 -0
- package/dist/paperless/p-C-WRzhFe.js.map +1 -0
- package/dist/paperless/p-ab66da44.entry.js.map +1 -1
- package/dist/paperless/p-b94bc701.entry.js +2 -0
- package/dist/paperless/p-b94bc701.entry.js.map +1 -0
- package/dist/paperless/p-c59b1d50.entry.js +2 -0
- package/dist/paperless/p-c59b1d50.entry.js.map +1 -0
- package/dist/paperless/p-empty-state.p-floating-menu-container.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/paperless/p-table-column.entry.esm.js.map +1 -1
- package/dist/paperless/p-table-extra-header.entry.esm.js.map +1 -0
- package/dist/paperless/p-table.entry.esm.js.map +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/helpers/table/column/table-column.component.d.ts +1 -1
- package/dist/types/components/helpers/table/extra-header/table-extra-header.component.d.ts +34 -0
- package/dist/types/components/molecules/table/cell/table-cell.component.d.ts +5 -1
- package/dist/types/components/molecules/table/row/table-row.component.d.ts +1 -1
- package/dist/types/components/organisms/table/table.component.d.ts +3 -0
- package/dist/types/components.d.ts +106 -6
- package/dist/types/utils/table-helpers.d.ts +2 -2
- package/package.json +1 -1
- package/dist/build/p-367d1ec2.entry.js +0 -2
- package/dist/build/p-367d1ec2.entry.js.map +0 -1
- package/dist/build/p-3dd76a64.js +0 -2
- package/dist/build/p-D8FNwRNH.js +0 -2
- package/dist/build/p-D8FNwRNH.js.map +0 -1
- package/dist/build/p-a7d047a4.entry.js +0 -2
- package/dist/build/p-a7d047a4.entry.js.map +0 -1
- package/dist/cjs/table-helpers-DyPa1NIG.js.map +0 -1
- package/dist/components/p-1KS1K8BB.js.map +0 -1
- package/dist/components/p-BORmwkco.js +0 -138
- package/dist/components/p-BORmwkco.js.map +0 -1
- package/dist/components/p-Q0QulP11.js +0 -119
- package/dist/components/p-Q0QulP11.js.map +0 -1
- package/dist/esm/table-helpers-Cx32XkzF.js.map +0 -1
- package/dist/paperless/p-367d1ec2.entry.js +0 -2
- package/dist/paperless/p-367d1ec2.entry.js.map +0 -1
- package/dist/paperless/p-D8FNwRNH.js +0 -2
- package/dist/paperless/p-D8FNwRNH.js.map +0 -1
- package/dist/paperless/p-a7d047a4.entry.js +0 -2
- package/dist/paperless/p-a7d047a4.entry.js.map +0 -1
- /package/dist/build/{p-168e8d5c.entry.js.map → p-133e281e.entry.js.map} +0 -0
- /package/dist/build/{p-95d812ef.entry.js.map → p-2d456ab7.entry.js.map} +0 -0
- /package/dist/build/{p-13549fce.entry.js.map → p-7dc22659.entry.js.map} +0 -0
- /package/dist/paperless/{p-168e8d5c.entry.js.map → p-133e281e.entry.js.map} +0 -0
- /package/dist/paperless/{p-95d812ef.entry.js.map → p-2d456ab7.entry.js.map} +0 -0
- /package/dist/paperless/{p-13549fce.entry.js.map → p-7dc22659.entry.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-helpers-DyPa1NIG.js","sources":["src/types/table.ts","src/utils/table-helpers.ts"],"sourcesContent":["export type QuickFilterTextFunction = () => string;\n\nexport interface QuickFilter {\n\tidentifier: string;\n\ttext: string | QuickFilterTextFunction;\n\tcount?: number;\n\tdefault?: boolean;\n}\n\nexport interface RowClickEvent {\n\titem: any;\n\tctrlDown: boolean;\n}\n\nexport interface TableDefinitionData {\n\tvalue: any;\n\titem: any;\n\tindex: number;\n\trowIndex: number;\n}\n\nexport type TableDefinitionTemplateFunc = (data: TableDefinitionData) => any;\n\nexport interface TableColumnSizes {\n\tdefault: number | 'hidden' | 'full';\n\ttablet?: number | 'hidden' | 'full';\n\t'desktop-xs'?: number | 'hidden' | 'full';\n\t'desktop-sm'?: number | 'hidden' | 'full';\n\tdesktop?: number | 'hidden' | 'full';\n\t'desktop-lg'?: number | 'hidden' | 'full';\n\t'desktop-xl'?: number | 'hidden' | 'full';\n}\n\nexport type TableColumnSizesKey =\n\t| 'default'\n\t| 'tablet'\n\t| 'desktop-xs'\n\t| 'desktop-sm'\n\t| 'desktop'\n\t| 'desktop-lg'\n\t| 'desktop-xl';\n\nexport function isTableColumnSizesKey(\n\tx: TableColumnSizes,\n\tk: PropertyKey\n): k is keyof TableColumnSizes {\n\treturn k in x;\n}\n","import { cva } from 'class-variance-authority';\nimport { TableColumn } from '../components/helpers/table/column/table-column.component';\nimport {\n\tisTableColumnSizesKey,\n\tTableColumnSizes,\n\tTableColumnSizesKey,\n} from '../types';\n\nexport const getTableCellColumnClasses = (\n\tdefinition: any | TableColumn,\n\tvariant: 'default' | 'header' | 'loading'\n) => {\n\tconst sizes = definition ? getTableCellSizes(definition, variant) : {};\n\n\treturn {\n\t\t'flex flex-shrink items-center gap-4 pr-4 last-of-type:pr-0': true,\n\t\t'justify-start': !definition?.align || definition?.align === 'start',\n\t\t'justify-center': definition?.align === 'center',\n\t\t'justify-end': definition?.align === 'end',\n\t\t'font-semibold': variant !== 'header' && definition?.variant === 'subject',\n\t\t'text-storm-400 dark:text-hurricane-200': variant === 'header',\n\t\t'text-storm-300 dark:text-hurricane-200':\n\t\t\tvariant !== 'header' &&\n\t\t\tdefinition?.variant !== 'subject' &&\n\t\t\tdefinition?.variant !== 'highlight',\n\t\t'text-storm-500 dark:text-white':\n\t\t\tvariant !== 'header' &&\n\t\t\t(definition?.variant === 'subject' ||\n\t\t\t\tdefinition?.variant === 'highlight'),\n\t\t...sizes,\n\t};\n};\n\nexport const getTableCellSizes = (\n\t{\n\t\tsizes,\n\t}: {\n\t\tsizes: 'auto' | 'hidden' | 'full' | number | TableColumnSizes;\n\t} /* Table Definition */,\n\tvariant: 'default' | 'header' | 'loading' | 'actions'\n) => {\n\tif (sizes === 'auto' || !sizes) {\n\t\treturn {\n\t\t\t'w-auto': true,\n\t\t};\n\t}\n\n\tif (sizes === 'hidden') {\n\t\treturn {\n\t\t\thidden: true,\n\t\t};\n\t}\n\n\tif (typeof sizes === 'object') {\n\t\tsizes = sizes as TableColumnSizes;\n\t\tconst classes: any = {};\n\t\tlet previousSize: TableColumnSizesKey | undefined;\n\n\t\tfor (let size in sizes) {\n\t\t\tif (!isTableColumnSizesKey(sizes, size)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (size === 'default') {\n\t\t\t\tif (sizes.default === 'hidden') {\n\t\t\t\t\tclasses['hidden'] = true;\n\t\t\t\t\tpreviousSize = size;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tclasses[`w-${sizes.default}/12`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = sizes[size];\n\t\t\tconst previousValue = previousSize ? sizes[previousSize] : null;\n\t\t\tif (\n\t\t\t\tcurrentValue !== 'hidden' &&\n\t\t\t\tpreviousValue &&\n\t\t\t\tpreviousValue === 'hidden' &&\n\t\t\t\tvariant !== 'actions'\n\t\t\t) {\n\t\t\t\tclasses[`${size}:flex`] = true;\n\t\t\t}\n\n\t\t\tif (currentValue === 'hidden' && variant !== 'actions') {\n\t\t\t\tclasses[`${size}:hidden`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currentValue === 12 || currentValue === 'full') {\n\t\t\t\tclasses[`${size}:w-full`] = true;\n\t\t\t}\n\n\t\t\tclasses[`${size}:w-${currentValue}/12`] = true;\n\t\t\tpreviousSize = size;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tif (sizes === 12 || sizes === 'full') {\n\t\treturn {\n\t\t\t'w-full': true,\n\t\t};\n\t}\n\n\t// is a number.\n\treturn {\n\t\t[`w-${sizes}/12`]: true,\n\t};\n};\n\nexport const floatingMenuContainerClass = cva(['sticky self-center'], {\n\tvariants: {\n\t\thasFooter: {\n\t\t\ttrue: 'mt-4 -mb-5 bottom-11 z-[3]',\n\t\t\tfalse: 'my-4 bottom-0',\n\t\t},\n\t\tactive: {\n\t\t\tfalse: 'pointer-events-none animate-floating-menu-container-out',\n\t\t\ttrue: 'animate-floating-menu-container-in',\n\t\t},\n\t\tshown: {\n\t\t\tfalse: 'hidden',\n\t\t\ttrue: 'inline-block',\n\t\t},\n\t},\n});\n"],"names":["cva"],"mappings":";;;;AA0CgB,SAAA,qBAAqB,CACpC,CAAmB,EACnB,CAAc,EAAA;IAEd,OAAO,CAAC,IAAI,CAAC;AACd;;MCvCa,yBAAyB,GAAG,CACxC,UAA6B,EAC7B,OAAyC,KACtC;AACH,IAAA,MAAM,KAAK,GAAG,UAAU,GAAG,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE;IAEtE,OAAO;AACN,QAAA,4DAA4D,EAAE,IAAI;QAClE,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,KAAK,OAAO;AACpE,QAAA,gBAAgB,EAAE,UAAU,EAAE,KAAK,KAAK,QAAQ;AAChD,QAAA,aAAa,EAAE,UAAU,EAAE,KAAK,KAAK,KAAK;QAC1C,eAAe,EAAE,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE,OAAO,KAAK,SAAS;QAC1E,wCAAwC,EAAE,OAAO,KAAK,QAAQ;Q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AAA,OAAO,OAAO;;IAGf,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,MAAM,EAAE;QACrC,OAAO;AACN,YAAA,QAAQ,EAAE,IAAI;SACd;;;IAIF,OAAO;AACN,QAAA,CAAC,CAAK,EAAA,EAAA,KAAK,CAAK,GAAA,CAAA,GAAG,IAAI;KACvB;AACF;MAEa,0BAA0B,GAAG,GAAG,CAAC,CAAC,oBAAoB,CAAC,EAAE;AACrE,IAAA,QAAQ,EAAE;AACT,QAAA,SAAS,EAAE;AACV,YAAA,IAAI,EAAE,4BAA4B;AAClC,YAAA,KAAK,EAAE,eAAe;AACtB,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,KAAK,EAAE,yDAAyD;AAChE,YAAA,IAAI,EAAE,oCAAoC;AAC1C,SAAA;AACD,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,IAAI,EAAE,cAAc;AACpB,SAAA;AACD,KAAA;AACD,CAAA;;AClIM,MAAM,eAAe,GAAG,CAC3B,GAAQ,EACR,IAAY,EACZ,YAAY,GAAG,SAAS,KACxB;IACA,MAAM,MAAM,GAAG,CAAC,MAAM,KAClB,MAAM,CAAC,SAAS,CAAC;AACZ,SAAA,IAAI,CAAC,IAAI,EAAE,MAAM;SACjB,MAAM,CAAC,OAAO;AACd,SAAA,MAAM,CACH,CAAC,GAAG,EAAE,GAAG,KACL,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,EACtD,GAAG,CACN;IACT,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC;AACxD,IAAA,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,GAAG,GAAG,YAAY,GAAG,MAAM;AACzE;;;;","names":[],"sources":["src/types/table.ts","src/utils/table-helpers.ts","src/utils/object-get-by-path.ts"],"sourcesContent":["export type QuickFilterTextFunction = () => string;\n\nexport interface QuickFilter {\n\tidentifier: string;\n\ttext: string | QuickFilterTextFunction;\n\tcount?: number;\n\tdefault?: boolean;\n}\n\nexport interface RowClickEvent {\n\titem: any;\n\tctrlDown: boolean;\n}\n\nexport interface TableDefinitionData {\n\tvalue: any;\n\titem: any;\n\tindex: number;\n\trowIndex: number;\n}\n\nexport type TableDefinitionTemplateFunc = (data: TableDefinitionData) => any;\n\nexport interface TableColumnSizes {\n\tdefault: number | 'hidden' | 'full';\n\ttablet?: number | 'hidden' | 'full';\n\t'desktop-xs'?: number | 'hidden' | 'full';\n\t'desktop-sm'?: number | 'hidden' | 'full';\n\tdesktop?: number | 'hidden' | 'full';\n\t'desktop-lg'?: number | 'hidden' | 'full';\n\t'desktop-xl'?: number | 'hidden' | 'full';\n}\n\nexport type TableColumnSizesKey =\n\t| 'default'\n\t| 'tablet'\n\t| 'desktop-xs'\n\t| 'desktop-sm'\n\t| 'desktop'\n\t| 'desktop-lg'\n\t| 'desktop-xl';\n\nexport function isTableColumnSizesKey(\n\tx: TableColumnSizes,\n\tk: PropertyKey\n): k is keyof TableColumnSizes {\n\treturn k in x;\n}\n","import { cva } from 'class-variance-authority';\nimport { TableColumn } from '../components/helpers/table/column/table-column.component';\nimport {\n\tisTableColumnSizesKey,\n\tTableColumnSizes,\n\tTableColumnSizesKey,\n} from '../types';\n\nexport const getTableCellColumnClasses = (\n\tdefinition: any | TableColumn,\n\tvariant: 'default' | 'header' | 'loading'\n) => {\n\tconst sizes = definition ? getTableCellSizes(definition, variant) : {};\n\n\treturn {\n\t\t'flex flex-shrink items-center gap-4 pr-4 last-of-type:pr-0': true,\n\t\t'justify-start': !definition?.align || definition?.align === 'start',\n\t\t'justify-center': definition?.align === 'center',\n\t\t'justify-end': definition?.align === 'end',\n\t\t'font-semibold': variant !== 'header' && definition?.variant === 'subject',\n\t\t'text-storm-400 dark:text-hurricane-200': variant === 'header',\n\t\t'text-storm-300 dark:text-hurricane-200':\n\t\t\tvariant !== 'header' &&\n\t\t\tdefinition?.variant !== 'subject' &&\n\t\t\tdefinition?.variant !== 'highlight',\n\t\t'text-storm-500 dark:text-white':\n\t\t\tvariant !== 'header' &&\n\t\t\t(definition?.variant === 'subject' ||\n\t\t\t\tdefinition?.variant === 'highlight'),\n\t\t...sizes,\n\t};\n};\n\nexport const getTableCellSizes = (\n\t{\n\t\tsizes,\n\t}: {\n\t\tsizes: 'auto' | 'hidden' | 'full' | number | TableColumnSizes;\n\t} /* Table Definition */,\n\tvariant: 'default' | 'header' | 'loading' | 'actions'\n) => {\n\tif (sizes === 'auto' || !sizes) {\n\t\treturn {\n\t\t\t'w-auto': true,\n\t\t};\n\t}\n\n\tif (sizes === 'hidden') {\n\t\treturn {\n\t\t\thidden: true,\n\t\t};\n\t}\n\n\tif (typeof sizes === 'object') {\n\t\tsizes = sizes as TableColumnSizes;\n\t\tconst classes: any = {};\n\t\tlet previousSize: TableColumnSizesKey | undefined;\n\n\t\tfor (let size in sizes) {\n\t\t\tif (!isTableColumnSizesKey(sizes, size)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (size === 'default') {\n\t\t\t\tif (sizes.default === 'hidden') {\n\t\t\t\t\tclasses['hidden'] = true;\n\t\t\t\t\tpreviousSize = size;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tclasses[`w-${sizes.default}/12`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = sizes[size];\n\t\t\tconst previousValue = previousSize ? sizes[previousSize] : null;\n\t\t\tif (\n\t\t\t\tcurrentValue !== 'hidden' &&\n\t\t\t\tpreviousValue &&\n\t\t\t\tpreviousValue === 'hidden' &&\n\t\t\t\tvariant !== 'actions'\n\t\t\t) {\n\t\t\t\tclasses[`${size}:flex`] = true;\n\t\t\t}\n\n\t\t\tif (currentValue === 'hidden' && variant !== 'actions') {\n\t\t\t\tclasses[`${size}:hidden`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currentValue === 12 || currentValue === 'full') {\n\t\t\t\tclasses[`${size}:w-full`] = true;\n\t\t\t}\n\n\t\t\tclasses[`${size}:w-${currentValue}/12`] = true;\n\t\t\tpreviousSize = size;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tif (sizes === 12 || sizes === 'full') {\n\t\treturn {\n\t\t\t'w-full': true,\n\t\t};\n\t}\n\n\t// is a number.\n\treturn {\n\t\t[`w-${sizes}/12`]: true,\n\t};\n};\n\nexport const floatingMenuContainerClass = cva(['sticky self-center'], {\n\tvariants: {\n\t\thasFooter: {\n\t\t\ttrue: 'mt-4 -mb-5 bottom-11 z-[3]',\n\t\t\tfalse: 'my-4 bottom-0',\n\t\t},\n\t\tactive: {\n\t\t\tfalse: 'pointer-events-none animate-floating-menu-container-out',\n\t\t\ttrue: 'animate-floating-menu-container-in',\n\t\t},\n\t\tshown: {\n\t\t\tfalse: 'hidden',\n\t\t\ttrue: 'inline-block',\n\t\t},\n\t},\n});\n","export const objectGetByPath = (\n obj: any,\n path: string,\n defaultValue = undefined\n) => {\n const travel = (regexp) =>\n String.prototype.split\n .call(path, regexp)\n .filter(Boolean)\n .reduce(\n (res, key) =>\n res !== null && res !== undefined ? res[key] : res,\n obj\n );\n const result = travel(/[,[\\]]+?/) || travel(/[,[\\].]+?/);\n return result === undefined || result === obj ? defaultValue : result;\n};\n"],"version":3}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-Dgl2kvBS.js';
|
|
2
|
-
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
-
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
4
|
-
import { T as ThemedHost } from './p-7QA93RrV.js';
|
|
5
|
-
import { d as defineCustomElement$1 } from './p-BoNZCwkk.js';
|
|
6
|
-
|
|
7
|
-
const tableRowComponentCss = ".relative{position:relative!important}*{box-sizing:border-box}:host{--tw-content:\"\";position:relative}.static{position:static!important}.absolute{position:absolute!important}.-right-4{right:-1rem!important}.top-1{top:.25rem!important}.z-\\[2\\]{z-index:2!important}.m-1{margin:.25rem!important}.flex{display:flex!important}.table-row{display:table-row!important}.h-\\[calc\\(100\\%-0\\.5rem\\)\\]{height:calc(100% - .5rem)!important}.min-h-0{min-height:0!important}.min-h-14{min-height:3.5rem!important}.min-w-\\[calc\\(100\\%-0\\.5rem\\)\\]{min-width:calc(100% - .5rem)!important}.min-w-full{min-width:100%!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.justify-between{justify-content:space-between!important}.rounded-lg{border-radius:.5rem!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.py-2{padding-bottom:.5rem!important;padding-top:.5rem!important}.pb-4{padding-bottom:1rem!important}.font-ambit{font-family:Ambit,sans-serif!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-bold{font-weight:700!important}.font-normal{font-weight:400!important}.text-storm-400{--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.opacity-0{opacity:0!important}.transition-colors{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.transition-opacity{transition-duration:.15s!important;transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.empty\\:hidden:empty{display:none!important}.hover\\:cursor-pointer:hover{cursor:pointer!important}.hover\\:bg-off-white-300:hover{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.group:hover .group-hover\\:opacity-100{opacity:1!important}@media (min-width:40rem){.tablet\\:py-4{padding-bottom:1rem!important;padding-top:1rem!important}}.dark\\:bg-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))!important}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-400:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:bg-hurricane-600:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}.dark\\:bg-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))!important}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-400:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:bg-hurricane-600:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))!important}";
|
|
8
|
-
|
|
9
|
-
const row = cva(['flex min-w-[calc(100%-0.5rem)] flex-col', 'group', 'relative'], {
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: ['px-3 m-1', 'text-sm text-storm-500', 'dark:text-white'],
|
|
13
|
-
header: [
|
|
14
|
-
'px-4',
|
|
15
|
-
'text-xs font-normal text-storm-400',
|
|
16
|
-
'dark:text-hurricane-200',
|
|
17
|
-
],
|
|
18
|
-
secondary: [
|
|
19
|
-
'px-4',
|
|
20
|
-
'bg-off-white-300 rounded-lg',
|
|
21
|
-
'dark:bg-hurricane-400',
|
|
22
|
-
'font-ambit text-lg font-bold',
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
enableHover: {
|
|
26
|
-
true: null,
|
|
27
|
-
false: null,
|
|
28
|
-
},
|
|
29
|
-
checked: {
|
|
30
|
-
true: null,
|
|
31
|
-
false: null,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
compoundVariants: [
|
|
35
|
-
{
|
|
36
|
-
variant: 'default',
|
|
37
|
-
enableHover: true,
|
|
38
|
-
class: ['rounded-lg transition-colors', 'hover:cursor-pointer'],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
variant: 'default',
|
|
42
|
-
enableHover: true,
|
|
43
|
-
checked: false,
|
|
44
|
-
class: ['hover:bg-off-white-300', 'dark:hover:bg-hurricane-600'],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
variant: 'default',
|
|
48
|
-
checked: true,
|
|
49
|
-
class: [
|
|
50
|
-
'rounded-lg transition-colors',
|
|
51
|
-
'bg-off-white-300 dark:bg-hurricane-400 dark:hover:bg-hurricane-400',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
});
|
|
56
|
-
const content = cva('relative flex min-w-full flex-nowrap items-center justify-between', {
|
|
57
|
-
variants: {
|
|
58
|
-
variant: {
|
|
59
|
-
default: null,
|
|
60
|
-
secondary: null,
|
|
61
|
-
header: 'min-h-0 pb-4',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
compoundVariants: [
|
|
65
|
-
{
|
|
66
|
-
variant: ['default', 'secondary'],
|
|
67
|
-
class: 'min-h-14 py-2 tablet:py-4',
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
const actions = cva([
|
|
72
|
-
'absolute -right-4 top-1 z-[2]',
|
|
73
|
-
'h-[calc(100%-0.5rem)]',
|
|
74
|
-
'opacity-0 transition-opacity group-hover:opacity-100',
|
|
75
|
-
'empty:hidden',
|
|
76
|
-
]);
|
|
77
|
-
const TableRow = /*@__PURE__*/ proxyCustomElement(class TableRow extends H {
|
|
78
|
-
constructor() {
|
|
79
|
-
super();
|
|
80
|
-
this.__registerHost();
|
|
81
|
-
this.__attachShadow();
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Variant of the header
|
|
85
|
-
*/
|
|
86
|
-
variant = 'default';
|
|
87
|
-
/**
|
|
88
|
-
* Enable hover
|
|
89
|
-
*/
|
|
90
|
-
enableHover = true;
|
|
91
|
-
/**
|
|
92
|
-
* Wether the row is checked
|
|
93
|
-
*/
|
|
94
|
-
checked = false;
|
|
95
|
-
/**
|
|
96
|
-
* Wether the row is the last one
|
|
97
|
-
*/
|
|
98
|
-
isLast = false;
|
|
99
|
-
render() {
|
|
100
|
-
return (h(ThemedHost, { key: '57cefd78545981975ff160405e54a614c52b2d10' }, h("div", { key: '752a97669376b1503b44ee3d53eb6a70fa22dabe', class: 'flex flex-col' }, h("div", { key: 'd764d107929e299979d1c859ae0a6ab571bd1561', class: row({
|
|
101
|
-
variant: this.variant,
|
|
102
|
-
enableHover: this.enableHover,
|
|
103
|
-
checked: this.checked,
|
|
104
|
-
}) }, h("div", { key: '1d695cfc2826074c699f948869f648b165b2d617', class: content({
|
|
105
|
-
variant: this.variant,
|
|
106
|
-
}) }, h("slot", { key: '6195e8107e31ade2831f9bd53408ab03a12ee651' }), h("div", { key: 'fc8b47883f833b5e04fbf59ed1670fe6bca72102', class: actions() }, h("slot", { key: '00574d5c478f7bd740bef1a159a26071e25ffef7', name: 'actions' })))), !asBoolean(this.isLast) && this.variant !== 'secondary' && (h("p-divider", { key: '7b408d711e1e08ab375587d474cfaebd89043276' })))));
|
|
107
|
-
}
|
|
108
|
-
static get style() { return tableRowComponentCss; }
|
|
109
|
-
}, [1, "p-table-row", {
|
|
110
|
-
"variant": [1],
|
|
111
|
-
"enableHover": [4, "enable-hover"],
|
|
112
|
-
"checked": [4],
|
|
113
|
-
"isLast": [4, "is-last"]
|
|
114
|
-
}]);
|
|
115
|
-
function defineCustomElement() {
|
|
116
|
-
if (typeof customElements === "undefined") {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const components = ["p-table-row", "p-divider"];
|
|
120
|
-
components.forEach(tagName => { switch (tagName) {
|
|
121
|
-
case "p-table-row":
|
|
122
|
-
if (!customElements.get(tagName)) {
|
|
123
|
-
customElements.define(tagName, TableRow);
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
case "p-divider":
|
|
127
|
-
if (!customElements.get(tagName)) {
|
|
128
|
-
defineCustomElement$1();
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
} });
|
|
132
|
-
}
|
|
133
|
-
defineCustomElement();
|
|
134
|
-
|
|
135
|
-
export { TableRow as T, defineCustomElement as d };
|
|
136
|
-
//# sourceMappingURL=p-BORmwkco.js.map
|
|
137
|
-
|
|
138
|
-
//# sourceMappingURL=p-BORmwkco.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-BORmwkco.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG,goIAAgoI;;ACK7pI,MAAM,GAAG,GAAG,GAAG,CACd,CAAC,yCAAyC,EAAE,OAAO,EAAE,UAAU,CAAC,EAChE;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,CAAC,UAAU,EAAE,wBAAwB,EAAE,iBAAiB,CAAC;AAClE,YAAA,MAAM,EAAE;gBACP,MAAM;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AAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACb,CACI,CACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/table/row/table-row.component.css?tag=p-table-row&encapsulation=shadow","src/components/molecules/table/row/table-row.component.tsx"],"sourcesContent":[":host {\n\t@apply relative;\n\t--tw-content: '';\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../../utils/as-boolean';\nimport { ThemedHost } from '../../../../internal/themed-host.component';\n\nconst row = cva(\n\t['flex min-w-[calc(100%-0.5rem)] flex-col', 'group', 'relative'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: ['px-3 m-1', 'text-sm text-storm-500', 'dark:text-white'],\n\t\t\t\theader: [\n\t\t\t\t\t'px-4',\n\t\t\t\t\t'text-xs font-normal text-storm-400',\n\t\t\t\t\t'dark:text-hurricane-200',\n\t\t\t\t],\n\t\t\t\tsecondary: [\n\t\t\t\t\t'px-4',\n\t\t\t\t\t'bg-off-white-300 rounded-lg',\n\t\t\t\t\t'dark:bg-hurricane-400',\n\t\t\t\t\t'font-ambit text-lg font-bold',\n\t\t\t\t],\n\t\t\t},\n\t\t\tenableHover: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tchecked: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tenableHover: true,\n\t\t\t\tclass: ['rounded-lg transition-colors', 'hover:cursor-pointer'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tenableHover: true,\n\t\t\t\tchecked: false,\n\t\t\t\tclass: ['hover:bg-off-white-300', 'dark:hover:bg-hurricane-600'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'default',\n\t\t\t\tchecked: true,\n\t\t\t\tclass: [\n\t\t\t\t\t'rounded-lg transition-colors',\n\t\t\t\t\t'bg-off-white-300 dark:bg-hurricane-400 dark:hover:bg-hurricane-400',\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst content = cva(\n\t'relative flex min-w-full flex-nowrap items-center justify-between',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: null,\n\t\t\t\tsecondary: null,\n\t\t\t\theader: 'min-h-0 pb-4',\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tvariant: ['default', 'secondary'],\n\t\t\t\tclass: 'min-h-14 py-2 tablet:py-4',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst actions = cva([\n\t'absolute -right-4 top-1 z-[2]',\n\t'h-[calc(100%-0.5rem)]',\n\t'opacity-0 transition-opacity group-hover:opacity-100',\n\t'empty:hidden',\n]);\n\n@Component({\n\ttag: 'p-table-row',\n\tstyleUrl: 'table-row.component.css',\n\tshadow: true,\n})\nexport class TableRow {\n\t/**\n\t * Variant of the header\n\t */\n\t@Prop() variant: 'default' | 'secondary' | 'header' = 'default';\n\n\t/**\n\t * Enable hover\n\t */\n\t@Prop() enableHover: boolean = true;\n\n\t/**\n\t * Wether the row is checked\n\t */\n\t@Prop() checked: boolean = false;\n\n\t/**\n\t * Wether the row is the last one\n\t */\n\t@Prop() isLast: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<ThemedHost>\n\t\t\t\t<div class='flex flex-col'>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={row({\n\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\tenableHover: this.enableHover,\n\t\t\t\t\t\t\tchecked: this.checked,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={content({\n\t\t\t\t\t\t\t\tvariant: this.variant,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t<div class={actions()}>\n\t\t\t\t\t\t\t\t<slot name='actions' />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t{!asBoolean(this.isLast) && this.variant !== 'secondary' && (\n\t\t\t\t\t\t<p-divider />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-Dgl2kvBS.js';
|
|
2
|
-
import { o as objectGetByPath, g as getTableCellColumnClasses } from './p-1KS1K8BB.js';
|
|
3
|
-
import { c as cn } from './p-CT54OXR2.js';
|
|
4
|
-
import { T as ThemedHost } from './p-7QA93RrV.js';
|
|
5
|
-
import { d as defineCustomElement$1 } from './p-BFbLqg3-.js';
|
|
6
|
-
|
|
7
|
-
const tableCellComponentCss = "*{box-sizing:border-box}.static{position:static!important}.flex{display:flex!important}.table{display:table!important}.table-cell{display:table-cell!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.w-1\\/12{width:8.333333%!important}.w-10\\/12{width:83.333333%!important}.w-11\\/12{width:91.666667%!important}.w-2\\/12{width:16.666667%!important}.w-3\\/12{width:25%!important}.w-4\\/12{width:33.333333%!important}.w-5\\/12{width:41.666667%!important}.w-6\\/12{width:50%!important}.w-7\\/12{width:58.333333%!important}.w-8\\/12{width:66.666667%!important}.w-9\\/12{width:75%!important}.w-\\[calc\\(100\\%-1rem\\)\\]{width:calc(100% - 1rem)!important}.flex-1{flex:1 1 0%!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.pr-0{padding-right:0!important}.pr-4{padding-right:1rem!important}.text-center{text-align:center!important}.text-start{text-align:start!important}.text-end{text-align:end!important}.font-semibold{font-weight:600!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-400{--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.last-of-type\\:pr-0:last-of-type{padding-right:0!important}.group:hover .group-hover\\:flex{display:flex!important}.group:hover .group-hover\\:hidden{display:none!important}@media (min-width:40rem){.tablet\\:flex{display:flex!important}.tablet\\:hidden{display:none!important}.tablet\\:w-1\\/12{width:8.333333%!important}.tablet\\:w-10\\/12{width:83.333333%!important}.tablet\\:w-11\\/12{width:91.666667%!important}.tablet\\:w-2\\/12{width:16.666667%!important}.tablet\\:w-3\\/12{width:25%!important}.tablet\\:w-4\\/12{width:33.333333%!important}.tablet\\:w-5\\/12{width:41.666667%!important}.tablet\\:w-6\\/12{width:50%!important}.tablet\\:w-7\\/12{width:58.333333%!important}.tablet\\:w-8\\/12{width:66.666667%!important}.tablet\\:w-9\\/12{width:75%!important}.tablet\\:pr-0{padding-right:0!important}.tablet\\:pr-4{padding-right:1rem!important}.group:hover .tablet\\:group-hover\\:flex{display:flex!important}.group:hover .tablet\\:group-hover\\:hidden{display:none!important}}@media (min-width:64rem){.desktop-xs\\:flex{display:flex!important}.desktop-xs\\:hidden{display:none!important}.desktop-xs\\:w-1\\/12{width:8.333333%!important}.desktop-xs\\:w-10\\/12{width:83.333333%!important}.desktop-xs\\:w-11\\/12{width:91.666667%!important}.desktop-xs\\:w-2\\/12{width:16.666667%!important}.desktop-xs\\:w-3\\/12{width:25%!important}.desktop-xs\\:w-4\\/12{width:33.333333%!important}.desktop-xs\\:w-5\\/12{width:41.666667%!important}.desktop-xs\\:w-6\\/12{width:50%!important}.desktop-xs\\:w-7\\/12{width:58.333333%!important}.desktop-xs\\:w-8\\/12{width:66.666667%!important}.desktop-xs\\:w-9\\/12{width:75%!important}.desktop-xs\\:pr-0{padding-right:0!important}.desktop-xs\\:pr-4{padding-right:1rem!important}.group:hover .desktop-xs\\:group-hover\\:flex{display:flex!important}.group:hover .desktop-xs\\:group-hover\\:hidden{display:none!important}}@media (min-width:80rem){.desktop-sm\\:flex{display:flex!important}.desktop-sm\\:hidden{display:none!important}.desktop-sm\\:w-1\\/12{width:8.333333%!important}.desktop-sm\\:w-10\\/12{width:83.333333%!important}.desktop-sm\\:w-11\\/12{width:91.666667%!important}.desktop-sm\\:w-2\\/12{width:16.666667%!important}.desktop-sm\\:w-3\\/12{width:25%!important}.desktop-sm\\:w-4\\/12{width:33.333333%!important}.desktop-sm\\:w-5\\/12{width:41.666667%!important}.desktop-sm\\:w-6\\/12{width:50%!important}.desktop-sm\\:w-7\\/12{width:58.333333%!important}.desktop-sm\\:w-8\\/12{width:66.666667%!important}.desktop-sm\\:w-9\\/12{width:75%!important}.desktop-sm\\:pr-0{padding-right:0!important}.desktop-sm\\:pr-4{padding-right:1rem!important}.group:hover .desktop-sm\\:group-hover\\:flex{display:flex!important}.group:hover .desktop-sm\\:group-hover\\:hidden{display:none!important}}@media (min-width:85.375rem){.desktop\\:flex{display:flex!important}.desktop\\:hidden{display:none!important}.desktop\\:w-1\\/12{width:8.333333%!important}.desktop\\:w-10\\/12{width:83.333333%!important}.desktop\\:w-11\\/12{width:91.666667%!important}.desktop\\:w-2\\/12{width:16.666667%!important}.desktop\\:w-3\\/12{width:25%!important}.desktop\\:w-4\\/12{width:33.333333%!important}.desktop\\:w-5\\/12{width:41.666667%!important}.desktop\\:w-6\\/12{width:50%!important}.desktop\\:w-7\\/12{width:58.333333%!important}.desktop\\:w-8\\/12{width:66.666667%!important}.desktop\\:w-9\\/12{width:75%!important}.desktop\\:pr-0{padding-right:0!important}.desktop\\:pr-4{padding-right:1rem!important}.group:hover .desktop\\:group-hover\\:flex{display:flex!important}.group:hover .desktop\\:group-hover\\:hidden{display:none!important}}@media (min-width:90rem){.desktop-lg\\:flex{display:flex!important}.desktop-lg\\:hidden{display:none!important}.desktop-lg\\:w-1\\/12{width:8.333333%!important}.desktop-lg\\:w-10\\/12{width:83.333333%!important}.desktop-lg\\:w-11\\/12{width:91.666667%!important}.desktop-lg\\:w-2\\/12{width:16.666667%!important}.desktop-lg\\:w-3\\/12{width:25%!important}.desktop-lg\\:w-4\\/12{width:33.333333%!important}.desktop-lg\\:w-5\\/12{width:41.666667%!important}.desktop-lg\\:w-6\\/12{width:50%!important}.desktop-lg\\:w-7\\/12{width:58.333333%!important}.desktop-lg\\:w-8\\/12{width:66.666667%!important}.desktop-lg\\:w-9\\/12{width:75%!important}.desktop-lg\\:pr-0{padding-right:0!important}.desktop-lg\\:pr-4{padding-right:1rem!important}.group:hover .desktop-lg\\:group-hover\\:flex{display:flex!important}.group:hover .desktop-lg\\:group-hover\\:hidden{display:none!important}}@media (min-width:120rem){.desktop-xl\\:flex{display:flex!important}.desktop-xl\\:hidden{display:none!important}.desktop-xl\\:w-1\\/12{width:8.333333%!important}.desktop-xl\\:w-10\\/12{width:83.333333%!important}.desktop-xl\\:w-11\\/12{width:91.666667%!important}.desktop-xl\\:w-2\\/12{width:16.666667%!important}.desktop-xl\\:w-3\\/12{width:25%!important}.desktop-xl\\:w-4\\/12{width:33.333333%!important}.desktop-xl\\:w-5\\/12{width:41.666667%!important}.desktop-xl\\:w-6\\/12{width:50%!important}.desktop-xl\\:w-7\\/12{width:58.333333%!important}.desktop-xl\\:w-8\\/12{width:66.666667%!important}.desktop-xl\\:w-9\\/12{width:75%!important}.desktop-xl\\:pr-0{padding-right:0!important}.desktop-xl\\:pr-4{padding-right:1rem!important}.group:hover .desktop-xl\\:group-hover\\:flex{display:flex!important}.group:hover .desktop-xl\\:group-hover\\:hidden{display:none!important}}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
|
|
8
|
-
|
|
9
|
-
const TableCell = /*@__PURE__*/ proxyCustomElement(class TableCell extends H {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The variant of the column
|
|
16
|
-
*/
|
|
17
|
-
variant = 'default';
|
|
18
|
-
/**
|
|
19
|
-
* The index of the column
|
|
20
|
-
*/
|
|
21
|
-
index;
|
|
22
|
-
/**
|
|
23
|
-
* The index of the row
|
|
24
|
-
*/
|
|
25
|
-
rowIndex;
|
|
26
|
-
/**
|
|
27
|
-
* The definition of the table column
|
|
28
|
-
*/
|
|
29
|
-
definition;
|
|
30
|
-
/**
|
|
31
|
-
* The item in question
|
|
32
|
-
*/
|
|
33
|
-
item;
|
|
34
|
-
/**
|
|
35
|
-
* The value of the column
|
|
36
|
-
*/
|
|
37
|
-
value;
|
|
38
|
-
/**
|
|
39
|
-
* The checkbox to show
|
|
40
|
-
*/
|
|
41
|
-
checkbox;
|
|
42
|
-
/**
|
|
43
|
-
* The template to show
|
|
44
|
-
*/
|
|
45
|
-
template = ({ value, }) => value;
|
|
46
|
-
get data() {
|
|
47
|
-
if (this.variant === 'header') {
|
|
48
|
-
return {
|
|
49
|
-
value: this.value,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
value: this.value ?? this.definition?.path
|
|
54
|
-
? objectGetByPath(this.item, this.definition.path)
|
|
55
|
-
: null,
|
|
56
|
-
item: this.item,
|
|
57
|
-
index: this.index,
|
|
58
|
-
rowIndex: this.rowIndex,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return (h(ThemedHost, { key: 'cd757cfb2a27c50feef5127165eb99b071238872', class: this._getColumnClasses() }, this.checkbox, this._getContent(), false));
|
|
63
|
-
}
|
|
64
|
-
_getContent() {
|
|
65
|
-
if (this.variant === 'loading') {
|
|
66
|
-
return (h("p-loader", { variant: 'ghost', class: 'h-6 w-[calc(100%-1rem)] flex-1 rounded' }));
|
|
67
|
-
}
|
|
68
|
-
return (h("div", { class: cn('overflow-hidden text-ellipsis', {
|
|
69
|
-
flex: this.definition.flex,
|
|
70
|
-
'justify-start': this.definition.flex &&
|
|
71
|
-
(this.definition.align === undefined ||
|
|
72
|
-
this.definition.align === 'start'),
|
|
73
|
-
'justify-end': this.definition.flex && this.definition.align === 'end',
|
|
74
|
-
'justify-center': this.definition.flex && this.definition.align === 'end',
|
|
75
|
-
'text-start': !this.definition.flex &&
|
|
76
|
-
(this.definition.align === undefined ||
|
|
77
|
-
this.definition.align === 'start'),
|
|
78
|
-
'text-center': !this.definition.flex && this.definition.align === 'center',
|
|
79
|
-
'text-end': !this.definition.flex && this.definition.align === 'end',
|
|
80
|
-
}) }, this.variant === 'header' ? (this.data.value) : this.definition.useSlot ? (h("slot", null)) : (this.template(this.data))));
|
|
81
|
-
}
|
|
82
|
-
_getColumnClasses() {
|
|
83
|
-
return cn(getTableCellColumnClasses(this.definition, this.variant));
|
|
84
|
-
}
|
|
85
|
-
static get style() { return tableCellComponentCss; }
|
|
86
|
-
}, [4, "p-table-cell", {
|
|
87
|
-
"variant": [1],
|
|
88
|
-
"index": [2],
|
|
89
|
-
"rowIndex": [2, "row-index"],
|
|
90
|
-
"definition": [8],
|
|
91
|
-
"item": [8],
|
|
92
|
-
"value": [8],
|
|
93
|
-
"checkbox": [8],
|
|
94
|
-
"template": [16]
|
|
95
|
-
}]);
|
|
96
|
-
function defineCustomElement() {
|
|
97
|
-
if (typeof customElements === "undefined") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const components = ["p-table-cell", "p-loader"];
|
|
101
|
-
components.forEach(tagName => { switch (tagName) {
|
|
102
|
-
case "p-table-cell":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
customElements.define(tagName, TableCell);
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
case "p-loader":
|
|
108
|
-
if (!customElements.get(tagName)) {
|
|
109
|
-
defineCustomElement$1();
|
|
110
|
-
}
|
|
111
|
-
break;
|
|
112
|
-
} });
|
|
113
|
-
}
|
|
114
|
-
defineCustomElement();
|
|
115
|
-
|
|
116
|
-
export { TableCell as T, defineCustomElement as d };
|
|
117
|
-
//# sourceMappingURL=p-Q0QulP11.js.map
|
|
118
|
-
|
|
119
|
-
//# sourceMappingURL=p-Q0QulP11.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-Q0QulP11.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,kzOAAkzO;;MC+Cn0O,SAAS,iBAAAA,kBAAA,CAAA,MAAA,SAAA,SAAAC,CAAA,CAAA;;;;;AACrB;;AAEG;IACK,OAAO,GAAqC,SAAS;AAE7D;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,QAAQ;AAEhB;;AAEG;AACK,IAAA,UAAU;AAElB;;AAEG;AACK,IAAA,IAAI;AAEZ;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,QAAQ;AAEhB;;AAEG;IACK,QAAQ,GAAgC,CAAC,EAChD,KAAK,GACgB,KAAK,KAAK;AAEhC,IAAA,IAAI,IAAI,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;YAC9B,OAAO;gBACN,KAAK,EAAE,IAAI,CAAC,KAAK;aACjB;;QAGF,OAAO;YACN,KAAK,EACJ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE;AAC9B,kBAAE,eAAe,C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AC,KAAK,KAAK,OAAO,CAAC;AACpC,gBAAA,aAAa,EACZ,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,QAAQ;AAC5D,gBAAA,UAAU,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,KAAK;aACpE,CAAC,EAAA,EAED,IAAI,CAAC,OAAO,KAAK,QAAQ,IACzB,IAAI,CAAC,IAAI,CAAC,KAAK,IACZ,IAAI,CAAC,UAAU,CAAC,OAAO,IAC1B,eAAQ,KAER,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAA2B,CAAC,CAC/C,CACI;;IAIA,iBAAiB,GAAA;AACxB,QAAA,OAAO,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/table/cell/table-cell.component.css?tag=p-table-cell","src/components/molecules/table/cell/table-cell.component.tsx"],"sourcesContent":["","import { Component, Fragment, h, Prop } from '@stencil/core';\nimport {\n\tTableDefinitionData,\n\tTableDefinitionTemplateFunc,\n} from '../../../../types';\nimport { getTableCellColumnClasses, objectGetByPath } from '../../../../utils';\n\nimport { ThemedHost } from '../../../../internal/themed-host.component';\nimport { cn } from '../../../../utils/cn';\nimport { TableColumn } from '../../../helpers/table/column/table-column.component';\n\n/*\n With this, we shall hack the system in ways no one would ever have thought.\n\n\n ⠀⠀⠀⠀⠀⣠⣴⣶⣿⣿⠿⣷⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣷⠿⣿⣿⣶⣦⣀⠀⠀⠀⠀⠀\n ⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣶⣦⣬⡉⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠚⢉⣥⣴⣾⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀\n ⠀⠀⠀⡾⠿⠛⠛⠛⠛⠿⢿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣿⣿⣿⣿⣿⠿⠿⠛⠛⠛⠛⠿⢧⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⣠⣤⠶⠶⠶⠰⠦⣤⣀⠀⠙⣷⠀⠀⠀⠀⠀⠀⠀⢠⡿⠋⢀⣀⣤⢴⠆⠲⠶⠶⣤⣄⠀⠀⠀⠀⠀⠀⠀\n ⠀⠘⣆⠀⠀⢠⣾⣫⣶⣾⣿⣿⣿⣿⣷⣯⣿⣦⠈⠃⡇⠀⠀⠀⠀⢸⠘⢁⣶⣿⣵⣾⣿⣿⣿⣿⣷⣦⣝⣷⡄⠀⠀⡰⠂⠀\n ⠀⠀⣨⣷⣶⣿⣧⣛⣛⠿⠿⣿⢿⣿⣿⣛⣿⡿⠀⠀⡇⠀⠀⠀⠀⢸⠀⠈⢿⣟⣛⠿⢿⡿⢿⢿⢿⣛⣫⣼⡿⣶⣾⣅⡀⠀\n ⢀⡼⠋⠁⠀⠀⠈⠉⠛⠛⠻⠟⠸⠛⠋⠉⠁⠀⠀⢸⡇⠀⠀⠄⠀⢸⡄⠀⠀⠈⠉⠙⠛⠃⠻⠛⠛⠛⠉⠁⠀⠀⠈⠙⢧⡀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡇⢠⠀⠀⠀⢸⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡇⠀⠀⠀⠀⢸⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠟⠁⣿⠇⠀⠀⠀⠀⢸⡇⠙⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠰⣄⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⠖⡾⠁⠀⠀⣿⠀⠀⠀⠀⠀⠘⣿⠀⠀⠙⡇⢸⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠄⠀\n ⠀⠀⢻⣷⡦⣤⣤⣤⡴⠶⠿⠛⠉⠁⠀⢳⠀⢠⡀⢿⣀⠀⠀⠀⠀⣠⡟⢀⣀⢠⠇⠀⠈⠙⠛⠷⠶⢦⣤⣤⣤⢴⣾⡏⠀⠀\n ⠀⠀⠈⣿⣧⠙⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠘⠛⢊⣙⠛⠒⠒⢛⣋⡚⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⡿⠁⣾⡿⠀⠀⠀\n ⠀⠀⠀⠘⣿⣇⠈⢿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⡿⢿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⡟⠁⣼⡿⠁⠀⠀⠀\n ⠀⠀⠀⠀⠘⣿⣦⠀⠻⣿⣷⣦⣤⣤⣶⣶⣶⣿⣿⣿⣿⠏⠀⠀⠻⣿⣿⣿⣿⣶⣶⣶⣦⣤⣴⣿⣿⠏⢀⣼⡿⠁⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠘⢿⣷⣄⠙⠻⠿⠿⠿⠿⠿⢿⣿⣿⣿⣁⣀⣀⣀⣀⣙⣿⣿⣿⠿⠿⠿⠿⠿⠿⠟⠁⣠⣿⡿⠁⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠈⠻⣯⠙⢦⣀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⣠⠴⢋⣾⠟⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠙⢧⡀⠈⠉⠒⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠐⠒⠉⠁⢀⡾⠃⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣠⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⡀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⢀⡴⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n */\n@Component({\n\ttag: 'p-table-cell',\n\tstyleUrl: 'table-cell.component.css',\n})\nexport class TableCell {\n\t/**\n\t * The variant of the column\n\t */\n\t@Prop() variant: 'default' | 'loading' | 'header' = 'default';\n\n\t/**\n\t * The index of the column\n\t */\n\t@Prop() index: number;\n\n\t/**\n\t * The index of the row\n\t */\n\t@Prop() rowIndex: number;\n\n\t/**\n\t * The definition of the table column\n\t */\n\t@Prop() definition?: TableColumn | any;\n\n\t/**\n\t * The item in question\n\t */\n\t@Prop() item: any;\n\n\t/**\n\t * The value of the column\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The checkbox to show\n\t */\n\t@Prop() checkbox: any;\n\n\t/**\n\t * The template to show\n\t */\n\t@Prop() template: TableDefinitionTemplateFunc = ({\n\t\tvalue,\n\t}: TableDefinitionData) => value;\n\n\tget data(): TableDefinitionData | { value: string } {\n\t\tif (this.variant === 'header') {\n\t\t\treturn {\n\t\t\t\tvalue: this.value,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue:\n\t\t\t\tthis.value ?? this.definition?.path\n\t\t\t\t\t? objectGetByPath(this.item, this.definition.path)\n\t\t\t\t\t: null,\n\t\t\titem: this.item,\n\t\t\tindex: this.index,\n\t\t\trowIndex: this.rowIndex,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<ThemedHost class={this._getColumnClasses()}>\n\t\t\t\t{this.checkbox}\n\n\t\t\t\t{this._getContent()}\n\n\t\t\t\t{false && (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<div class='text-storm-300 text-storm-400 text-storm-500 dark:text-hurricane-200 dark:text-white'></div>\n\t\t\t\t\t\t<div class='justify-start justify-end justify-center'></div>\n\t\t\t\t\t\t<div class='font-semibold text-storm-300 text-storm-400 text-storm-500'></div>\n\t\t\t\t\t\t<div class='w-12/12 w-1/12 w-10/12 w-11/12 w-2/12 w-3/12 w-4/12 w-5/12 w-6/12 w-7/12 w-8/12 w-9/12'></div>\n\t\t\t\t\t\t<div class='tablet:w-12/12 tablet:w-1/12 tablet:w-10/12 tablet:w-11/12 tablet:w-2/12 tablet:w-3/12 tablet:w-4/12 tablet:w-5/12 tablet:w-6/12 tablet:w-7/12 tablet:w-8/12 tablet:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop-xs:w-12/12 desktop-xs:w-1/12 desktop-xs:w-10/12 desktop-xs:w-11/12 desktop-xs:w-2/12 desktop-xs:w-3/12 desktop-xs:w-4/12 desktop-xs:w-5/12 desktop-xs:w-6/12 desktop-xs:w-7/12 desktop-xs:w-8/12 desktop-xs:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop-xs:w-12/12 desktop-xs:w-1/12 desktop-xs:w-10/12 desktop-xs:w-11/12 desktop-xs:w-2/12 desktop-xs:w-3/12 desktop-xs:w-4/12 desktop-xs:w-5/12 desktop-xs:w-6/12 desktop-xs:w-7/12 desktop-xs:w-8/12 desktop-xs:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop-sm:w-12/12 desktop-sm:w-1/12 desktop-sm:w-10/12 desktop-sm:w-11/12 desktop-sm:w-2/12 desktop-sm:w-3/12 desktop-sm:w-4/12 desktop-sm:w-5/12 desktop-sm:w-6/12 desktop-sm:w-7/12 desktop-sm:w-8/12 desktop-sm:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop:w-12/12 desktop:w-1/12 desktop:w-10/12 desktop:w-11/12 desktop:w-2/12 desktop:w-3/12 desktop:w-4/12 desktop:w-5/12 desktop:w-6/12 desktop:w-7/12 desktop:w-8/12 desktop:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop-lg:w-12/12 desktop-lg:w-1/12 desktop-lg:w-10/12 desktop-lg:w-11/12 desktop-lg:w-2/12 desktop-lg:w-3/12 desktop-lg:w-4/12 desktop-lg:w-5/12 desktop-lg:w-6/12 desktop-lg:w-7/12 desktop-lg:w-8/12 desktop-lg:w-9/12'></div>\n\t\t\t\t\t\t<div class='desktop-xl:w-12/12 desktop-xl:w-1/12 desktop-xl:w-10/12 desktop-xl:w-11/12 desktop-xl:w-2/12 desktop-xl:w-3/12 desktop-xl:w-4/12 desktop-xl:w-5/12 desktop-xl:w-6/12 desktop-xl:w-7/12 desktop-xl:w-8/12 desktop-xl:w-9/12'></div>\n\t\t\t\t\t\t<div class='flex hidden group-hover:flex group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='tablet:flex tablet:hidden tablet:group-hover:flex tablet:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='desktop-xs:flex desktop-xs:hidden desktop-xs:group-hover:flex desktop-xs:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='desktop-sm:flex desktop-sm:hidden desktop-sm:group-hover:flex desktop-sm:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='desktop:flex desktop:hidden desktop:group-hover:flex desktop:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='desktop-lg:flex desktop-lg:hidden desktop-lg:group-hover:flex desktop-lg:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='desktop-xl:flex desktop-xl:hidden desktop-xl:group-hover:flex desktop-xl:group-hover:hidden'></div>\n\t\t\t\t\t\t<div class='pr-0 pr-4 last-of-type:pr-0'></div>\n\t\t\t\t\t\t<div class='tablet:pr-0 tablet:pr-4'></div>\n\t\t\t\t\t\t<div class='desktop-xs:pr-0 desktop-xs:pr-4'></div>\n\t\t\t\t\t\t<div class='desktop-sm:pr-0 desktop-sm:pr-4'></div>\n\t\t\t\t\t\t<div class='desktop:pr-0 desktop:pr-4'></div>\n\t\t\t\t\t\t<div class='desktop-lg:pr-0 desktop-lg:pr-4'></div>\n\t\t\t\t\t\t<div class='desktop-xl:pr-0 desktop-xl:pr-4'></div>\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t</ThemedHost>\n\t\t);\n\t}\n\n\tprivate _getContent() {\n\t\tif (this.variant === 'loading') {\n\t\t\treturn (\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-[calc(100%-1rem)] flex-1 rounded'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={cn('overflow-hidden text-ellipsis', {\n\t\t\t\t\tflex: this.definition.flex,\n\t\t\t\t\t'justify-start':\n\t\t\t\t\t\tthis.definition.flex &&\n\t\t\t\t\t\t(this.definition.align === undefined ||\n\t\t\t\t\t\t\tthis.definition.align === 'start'),\n\t\t\t\t\t'justify-end':\n\t\t\t\t\t\tthis.definition.flex && this.definition.align === 'end',\n\t\t\t\t\t'justify-center':\n\t\t\t\t\t\tthis.definition.flex && this.definition.align === 'end',\n\t\t\t\t\t'text-start':\n\t\t\t\t\t\t!this.definition.flex &&\n\t\t\t\t\t\t(this.definition.align === undefined ||\n\t\t\t\t\t\t\tthis.definition.align === 'start'),\n\t\t\t\t\t'text-center':\n\t\t\t\t\t\t!this.definition.flex && this.definition.align === 'center',\n\t\t\t\t\t'text-end': !this.definition.flex && this.definition.align === 'end',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.variant === 'header' ? (\n\t\t\t\t\tthis.data.value\n\t\t\t\t) : this.definition.useSlot ? (\n\t\t\t\t\t<slot />\n\t\t\t\t) : (\n\t\t\t\t\tthis.template(this.data as TableDefinitionData)\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _getColumnClasses() {\n\t\treturn cn(getTableCellColumnClasses(this.definition, this.variant));\n\t}\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-helpers-Cx32XkzF.js","sources":["src/types/table.ts","src/utils/table-helpers.ts"],"sourcesContent":["export type QuickFilterTextFunction = () => string;\n\nexport interface QuickFilter {\n\tidentifier: string;\n\ttext: string | QuickFilterTextFunction;\n\tcount?: number;\n\tdefault?: boolean;\n}\n\nexport interface RowClickEvent {\n\titem: any;\n\tctrlDown: boolean;\n}\n\nexport interface TableDefinitionData {\n\tvalue: any;\n\titem: any;\n\tindex: number;\n\trowIndex: number;\n}\n\nexport type TableDefinitionTemplateFunc = (data: TableDefinitionData) => any;\n\nexport interface TableColumnSizes {\n\tdefault: number | 'hidden' | 'full';\n\ttablet?: number | 'hidden' | 'full';\n\t'desktop-xs'?: number | 'hidden' | 'full';\n\t'desktop-sm'?: number | 'hidden' | 'full';\n\tdesktop?: number | 'hidden' | 'full';\n\t'desktop-lg'?: number | 'hidden' | 'full';\n\t'desktop-xl'?: number | 'hidden' | 'full';\n}\n\nexport type TableColumnSizesKey =\n\t| 'default'\n\t| 'tablet'\n\t| 'desktop-xs'\n\t| 'desktop-sm'\n\t| 'desktop'\n\t| 'desktop-lg'\n\t| 'desktop-xl';\n\nexport function isTableColumnSizesKey(\n\tx: TableColumnSizes,\n\tk: PropertyKey\n): k is keyof TableColumnSizes {\n\treturn k in x;\n}\n","import { cva } from 'class-variance-authority';\nimport { TableColumn } from '../components/helpers/table/column/table-column.component';\nimport {\n\tisTableColumnSizesKey,\n\tTableColumnSizes,\n\tTableColumnSizesKey,\n} from '../types';\n\nexport const getTableCellColumnClasses = (\n\tdefinition: any | TableColumn,\n\tvariant: 'default' | 'header' | 'loading'\n) => {\n\tconst sizes = definition ? getTableCellSizes(definition, variant) : {};\n\n\treturn {\n\t\t'flex flex-shrink items-center gap-4 pr-4 last-of-type:pr-0': true,\n\t\t'justify-start': !definition?.align || definition?.align === 'start',\n\t\t'justify-center': definition?.align === 'center',\n\t\t'justify-end': definition?.align === 'end',\n\t\t'font-semibold': variant !== 'header' && definition?.variant === 'subject',\n\t\t'text-storm-400 dark:text-hurricane-200': variant === 'header',\n\t\t'text-storm-300 dark:text-hurricane-200':\n\t\t\tvariant !== 'header' &&\n\t\t\tdefinition?.variant !== 'subject' &&\n\t\t\tdefinition?.variant !== 'highlight',\n\t\t'text-storm-500 dark:text-white':\n\t\t\tvariant !== 'header' &&\n\t\t\t(definition?.variant === 'subject' ||\n\t\t\t\tdefinition?.variant === 'highlight'),\n\t\t...sizes,\n\t};\n};\n\nexport const getTableCellSizes = (\n\t{\n\t\tsizes,\n\t}: {\n\t\tsizes: 'auto' | 'hidden' | 'full' | number | TableColumnSizes;\n\t} /* Table Definition */,\n\tvariant: 'default' | 'header' | 'loading' | 'actions'\n) => {\n\tif (sizes === 'auto' || !sizes) {\n\t\treturn {\n\t\t\t'w-auto': true,\n\t\t};\n\t}\n\n\tif (sizes === 'hidden') {\n\t\treturn {\n\t\t\thidden: true,\n\t\t};\n\t}\n\n\tif (typeof sizes === 'object') {\n\t\tsizes = sizes as TableColumnSizes;\n\t\tconst classes: any = {};\n\t\tlet previousSize: TableColumnSizesKey | undefined;\n\n\t\tfor (let size in sizes) {\n\t\t\tif (!isTableColumnSizesKey(sizes, size)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (size === 'default') {\n\t\t\t\tif (sizes.default === 'hidden') {\n\t\t\t\t\tclasses['hidden'] = true;\n\t\t\t\t\tpreviousSize = size;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tclasses[`w-${sizes.default}/12`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = sizes[size];\n\t\t\tconst previousValue = previousSize ? sizes[previousSize] : null;\n\t\t\tif (\n\t\t\t\tcurrentValue !== 'hidden' &&\n\t\t\t\tpreviousValue &&\n\t\t\t\tpreviousValue === 'hidden' &&\n\t\t\t\tvariant !== 'actions'\n\t\t\t) {\n\t\t\t\tclasses[`${size}:flex`] = true;\n\t\t\t}\n\n\t\t\tif (currentValue === 'hidden' && variant !== 'actions') {\n\t\t\t\tclasses[`${size}:hidden`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currentValue === 12 || currentValue === 'full') {\n\t\t\t\tclasses[`${size}:w-full`] = true;\n\t\t\t}\n\n\t\t\tclasses[`${size}:w-${currentValue}/12`] = true;\n\t\t\tpreviousSize = size;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tif (sizes === 12 || sizes === 'full') {\n\t\treturn {\n\t\t\t'w-full': true,\n\t\t};\n\t}\n\n\t// is a number.\n\treturn {\n\t\t[`w-${sizes}/12`]: true,\n\t};\n};\n\nexport const floatingMenuContainerClass = cva(['sticky self-center'], {\n\tvariants: {\n\t\thasFooter: {\n\t\t\ttrue: 'mt-4 -mb-5 bottom-11 z-[3]',\n\t\t\tfalse: 'my-4 bottom-0',\n\t\t},\n\t\tactive: {\n\t\t\tfalse: 'pointer-events-none animate-floating-menu-container-out',\n\t\t\ttrue: 'animate-floating-menu-container-in',\n\t\t},\n\t\tshown: {\n\t\t\tfalse: 'hidden',\n\t\t\ttrue: 'inline-block',\n\t\t},\n\t},\n});\n"],"names":[],"mappings":";;AA0CgB,SAAA,qBAAqB,CACpC,CAAmB,EACnB,CAAc,EAAA;IAEd,OAAO,CAAC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;;;IAIF,OAAO;AACN,QAAA,CAAC,CAAK,EAAA,EAAA,KAAK,CAAK,GAAA,CAAA,GAAG,IAAI;KACvB;AACF;MAEa,0BAA0B,GAAG,GAAG,CAAC,CAAC,oBAAoB,CAAC,EAAE;AACrE,IAAA,QAAQ,EAAE;AACT,QAAA,SAAS,EAAE;AACV,YAAA,IAAI,EAAE,4BAA4B;AAClC,YAAA,KAAK,EAAE,eAAe;AACtB,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,KAAK,EAAE,yDAAyD;AAChE,YAAA,IAAI,EAAE,oCAAoC;AAC1C,SAAA;AACD,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,IAAI,EAAE,cAAc;AACpB,SAAA;AACD,KAAA;AACD,CAAA;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,g as i,h as s,H as n}from"./p-Dpmiv2da.js";import{t as o}from"./p-DdQ-S2l7.js";import{f as a,g as r}from"./p-DiJj8rmO.js";import{f as h}from"./p-D8FNwRNH.js";import{f as l}from"./p-B3sNjfzc.js";import{c}from"./p-CT54OXR2.js";import{P as u,a as f}from"./p-vyRrSf5s.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const d="*{box-sizing:border-box}.static{position:static!important}.fixed{position:fixed!important}.z-0{z-index:0!important}.my-16{margin-bottom:4rem!important;margin-top:4rem!important}.mb-8{margin-bottom:2rem!important}.flex{display:flex!important}.table{display:table!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-shrink-0{flex-shrink:0!important}.resize{resize:both!important}.flex-col{flex-direction:column!important}.self-center{align-self:center!important}.rounded{border-radius:.25rem!important}.opacity-0{opacity:0!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";const p=class{constructor(i){t(this,i);this.selectedRowsChange=e(this,"selectedRowsChange",3);this.rowClick=e(this,"rowClick",3);this.rowSelected=e(this,"rowSelected",3);this.rowDeselected=e(this,"rowDeselected",3);this.hasRendered=e(this,"hasRendered",3);this.quickFilter=e(this,"quickFilter",3);this.queryChange=e(this,"queryChange",3);this.filter=e(this,"filter",3);this.action=e(this,"action",3);this.pageChange=e(this,"pageChange",3);this.pageSizeChange=e(this,"pageSizeChange",3);this.export=e(this,"export",3);this.emptyStateActionClick=e(this,"emptyStateActionClick",3)}items;loading=false;headerLoading=false;footerLoading=false;amountOfLoadingRows=6;enableRowSelection=true;rowSelectionLimit;enableRowClick=true;selectedRows=[];enableFloatingMenu=true;floatingMenuAmountSelectedTemplate=t=>a((t===1?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=true;quickFilters=[];activeQuickFilterIdentifier;enableSearch=true;query;enableFilter=true;enableFilterDesktop=true;selectedFiltersAmount;filterButtonTemplate;enableAction=false;actionButtonLoading=false;actionButtonEnabled=false;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=true;enablePaginationSize=true;enablePaginationPages=true;enableExport=true;page=1;total;pageChange;pageSize=u;pageSizeOptions=f;pageSizeChange;export;hideOnSinglePage=true;emptyStateHeader=()=>a(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>a(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>a(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=true;emptyStateFilteredHeader=()=>a(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>a(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=true;get _el(){return i(this)}_locales={};_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=false;_ctrlDown=false;_hasCustomFilterSlot=false;_hasCustomActionsSlot=false;_floatingMenuShown=false;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]');this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]');this._setRowSelectionData();this._setLocales();this._parseItems(this.items);this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"5e21e018cfed6d71d2afb1e05be1e47e2092ee4c",class:"z-0 flex flex-col"},s("p-table-container",{key:"ad8edeed8ee696a02e3f4848deddb2e2918fb1fa"},this.enableHeader&&s("p-table-header",{key:"0c93abf0c4bcb1ec0b4ed7251265dae18f56223c",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"14257d67fed9adc5814e80b2ecf96092ecc56612",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"ba3c0c51886c4518739bb57aa474cc81057992b5",name:"custom-actions",slot:"custom-actions"})),this._getHeader(),s("div",{key:"2da4deea5280c3a0d7b37ee23595c3d07ea005ee",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"ceb0bbd73f18f696e94ff05a44319a519ee8652f",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:true,class:h({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,false)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>!t.disabled&&!t.loading&&!!t.action&&t.type==="single"?t.action(this.selectedRows[0],false):t.action(this.selectedRows,true)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"76b41d28147823cff101694aa49e4b8920eb5058",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await r(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){if(t!=="Control"||this._ctrlDown===true){return}this._ctrlDown=true}keyUp({key:t}){if(t!=="Control"||this._ctrlDown===false){return}this._ctrlDown=false}visibilityChange(){if(document.visibilityState!=="hidden"||this._ctrlDown===false){return}this._ctrlDown=false}_parseItems(t){if(!t){this._items=[];return}if(Array.isArray(t)){this._items=t;return}this._items=JSON.parse(t)}_setRowSelectionData(){if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=setTimeout((()=>{const t=l();const e=Array.from(this._el.querySelectorAll(":scope > p-table-row-action"));this._rowActionsRow=e.filter((t=>t.type==="both"||t.type==="single"));this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&(e.type==="both"||e.type==="multi")||t&&e.type==="single")).map((t=>{if(t.type==="single"){t.disabled=this.selectedRows?.length>1}return t}));let i=this.rowSelectionLimit;if(t&&this._rowActionsFloatingAll?.length&&(i!==undefined&&this.enableRowSelection||!this.enableRowSelection)){i=1}this._rowSelectionLimit=i;let s=this.enableRowSelection;if(t&&this._rowActionsFloatingAll?.length&&!s){s=true}this._enableRowSelection=s;if(this._floatingMenuShown){this._showFloatingMenu()}}),200)}_generateColumns(){const t=this._el.querySelectorAll("p-table-column");let e=Array.from(t);e=this._parseDefinitions(e);this._columns=e}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:e===0||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){if(this.loading){return Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e))))}if(!this._items.length){return this._getEmptyState()}return this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>e.showFunction?e.showFunction(t):true));if(i?.length&&!l()){return s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":true,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:true,size:"sm",onClick:()=>typeof e.action==="function"&&e.action?.(t,false)})))))}return null}_getRowColumns(t,e){return this._columns.map(((i,n)=>s("p-table-cell",{definition:i,item:t,checkbox:n===0||i.hasCheckbox?this._getCheckbox(e):null,index:n,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:i===0||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length){return}if(e==="loading"){return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"})}if(e==="header"){return s("p-checkbox",{class:c({"opacity-0":this._rowSelectionLimit!==undefined}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:this._rowSelectionLimit!==undefined,onCheckedChange:t=>this._selectAllChange(t)})}const i=this._items[t];const n=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||this._rowSelectionLimit!==undefined&&!n&&this.selectedRows.length===this._rowSelectionLimit,checked:n,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){if(this.query?.length||this.selectedFiltersAmount){return s("p-empty-state",{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()})}return s("p-empty-state",{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(!this._enableRowSelection){return}const i=t?.detail??e??false;const s=e===undefined?i:e;if(s){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if(this.canSelectKey&&!i[this.canSelectKey]){continue}if(this._selectionContains(e)){continue}t.push(i);this.rowSelected.emit(i);if(this._rowSelectionLimit!==undefined&&this.selectedRows.length+t.length===this._rowSelectionLimit){break}}this.selectedRows=[...this.selectedRows,...t];this.selectedRowsChange.emit(this.selectedRows);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t];const i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));if(!i){continue}this.rowDeselected.emit(i)}this.selectedRows=[];this.selectedRowsChange.emit(this.selectedRows)}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection){return}if(t&&this._rowSelectionLimit!==undefined&&this.selectedRows.length>=this._rowSelectionLimit){e.checked=false;return}const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey]){e.checked=false;return}if(t){this.selectedRows=[...this.selectedRows,{...s,index:i}];this.selectedRowsChange.emit(this.selectedRows);this.rowSelected.emit(s);if(this.enableFloatingMenu&&!this._floatingMenuShown){this._showFloatingMenu()}return}const n=this._selectionContains(i,true);const 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:e}_selectionContains(t,e=false){const i=this.selectedRows.findIndex((e=>e.index===t));return!e?i>=0:i}_selectionContainsAll(){let t=true;if(!this._items?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return true}for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(!i){t=false;break}}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length){return false}if(this._rowSelectionLimit!==undefined&&this.selectedRows.length===this._rowSelectionLimit){return false}let t=0;for(let e=0;e<this._items?.length;e++){const i=this._selectionContains(e);if(i){t++}}return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if(i.tagName.toLowerCase()==="input"||i.type==="checkbox"){return}const s=this._findRow(t.target);const n=this._findRowAction(t.target);if(n){return}if(this.enableRowClick){const t=this._items[e];this.rowClick.emit({item:t,ctrlDown:this._ctrlDown});return}if(!this._enableRowSelection){return}const o=s?.querySelector('input[type="checkbox"]');if(!o){return}o.checked=!o.checked;this._checkboxChange(o,e)}_findRow(t){if(!t){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return t}return this._findRow(t?.parentElement)}_findRowAction(t){if(!t){return null}if(t.getAttribute("data-is-action")!==null&&t.getAttribute("data-is-action")!=="false"){return t}if(t?.tagName?.toLowerCase()==="p-table-row"){return null}return this._findRowAction(t?.parentElement)}_showFloatingMenu(){let t=this._rowActionsFloatingAll;if(this.rowSelectionLimit===1&&t.findIndex((t=>(t.type==="single"||t.type==="both")&&t.showFunction))>=0){t=t.filter((t=>t.type==="multi"||!t.showFunction||t.showFunction(this.selectedRows[0])))}this._rowActionsFloating=t;this._floatingMenuShown=true}_parseDefinitions(t){return t.map((t=>{t=this._parseDefinitionSizes(t);return t}))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};if(typeof t.sizes==="string"&&!["auto","hidden","full"].includes(t.sizes)){t.sizes=JSON.parse(t.sizes)}for(const[t,s]of o.entries()){if(e.sizes==="auto"||e.sizes==="hidden"||e.sizes==="full"||typeof e.sizes==="number"){i[s]=e.sizes==="auto"?"full":e.sizes;continue}i[s]=e.sizes[s]??i[o[t-1]]}t.parsedSizes=i;return t}static get watchers(){return{items:["_parseItems"],enableRowSelection:["_setRowSelectionData"],rowSelectionLimit:["_setRowSelectionData"],selectedRows:["_setRowSelectionData"]}}};p.style=d;export{p as p_table};
|
|
2
|
-
//# sourceMappingURL=p-367d1ec2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["tableComponentCss","Table","items","loading","headerLoading","footerLoading","amountOfLoadingRows","enableRowSelection","rowSelectionLimit","enableRowClick","selectedRows","enableFloatingMenu","floatingMenuAmountSelectedTemplate","amount","formatTranslation","this","_locales","floating_menu","amount_selected","amount_selected_plural","replace","selectedRowsChange","selectionKey","canSelectKey","rowClick","rowSelected","rowDeselected","hasRendered","enableHeader","quickFilters","activeQuickFilterIdentifier","enableSearch","query","enableFilter","enableFilterDesktop","selectedFiltersAmount","filterButtonTemplate","enableAction","actionButtonLoading","actionButtonEnabled","actionButtonIcon","actionButtonText","actionButtonTemplate","quickFilter","queryChange","filter","action","enableFooter","enablePaginationSize","enablePaginationPages","enableExport","page","total","pageChange","pageSize","PAGINATION_DEFAULT_PAGE_SIZE","pageSizeOptions","PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS","pageSizeChange","export","hideOnSinglePage","emptyStateHeader","empty_state","no_filter","header","emptyStateContent","content","emptyStateAction","enableEmptyStateAction","emptyStateFilteredHeader","filtered","emptyStateFilteredContent","emptyStateActionClick","shadow","_columns","_items","_enableRowSelection","_rowSelectionLimit","_rowActionsFloatingAll","_rowActionsFloating","_rowActionsRow","_footerHidden","_ctrlDown","_hasCustomFilterSlot","_hasCustomActionsSlot","_floatingMenuShown","_resizeTimeout","componentWillLoad","_el","querySelector","_setRowSelectionData","_setLocales","_parseItems","_generateColumns","componentDidRender","emit","render","h","Host","key","class","onQuickFilter","detail","onQueryChange","onFilter","actionIcon","actionText","actionLoading","canUseAction","onAction","itemsSelectedAmount","length","onExport","name","slot","_getHeader","_getRows","usedInTable","floatingMenuContainerClass","hasFooter","active","shown","amountSelectedTemplate","enableAmountSelected","onClose","_selectAllChange","map","a","disabled","icon","iconRotate","iconFlip","onClick","type","label","onPageSizeChange","onPageChange","onHiddenChange","tableHeaderHasAction","getLocaleComponentStrings","onTableDefinitionUpdated","keyDown","keyUp","visibilityChange","document","visibilityState","Array","isArray","JSON","parse","clearTimeout","setTimeout","mobile","isMobile","actions","from","querySelectorAll","undefined","_showFloatingMenu","definitions","definitionsArray","_parseDefinitions","variant","col","index","definition","value","checkbox","hasCheckbox","_getCheckbox","_","i","enableHover","isLast","_getLoadingColumns","_getEmptyState","item","checked","_selectionContains","ev","_rowClick","_getRowColumns","_getActions","showFunction","strategy","iconOnly","size","colIndex","rowIndex","cn","_selectionContainsAll","indeterminate","_selectionIndeterminate","onCheckedChange","selectionContains","_checkboxChange","illustration","forceValue","toAdd","row","push","find","d","_getSelectionValue","target","indexOfToRemove","selection","splice","returnIndex","returnValue","findIndex","contains","containsCount","$event","tagName","toLowerCase","_findRow","_findRowAction","ctrlDown","el","parentElement","getAttribute","_parseDefinitionSizes","definitionAny","parsedSizes","default","sizes","includes","tableColumSizesOptions","entries"],"sources":["src/components/organisms/table/table.component.css?tag=p-table","src/components/organisms/table/table.component.tsx"],"sourcesContent":[null,"import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { IconVariant, PCheckboxCustomEvent } from '../../../components';\nimport { tableColumSizesOptions } from '../../../types/constants';\nimport {\n\tQuickFilter,\n\tRowClickEvent,\n\tTableColumnSizes,\n} from '../../../types/table';\nimport {\n\tfloatingMenuContainerClass,\n\tformatTranslation,\n\tgetLocaleComponentStrings,\n\tisMobile,\n} from '../../../utils';\nimport { cn } from '../../../utils/cn';\nimport {\n\tPAGINATION_DEFAULT_PAGE_SIZE,\n\tPAGINATION_DEFAULT_PAGE_SIZE_OPTIONS,\n} from '../../../utils/constants';\nimport { TableColumn } from '../../helpers/table/column/table-column.component';\nimport { TableRowAction } from '../../helpers/table/row-action/table-row-action.component';\nimport { buttonTemplateFunc } from '../../molecules/table/header/table-header.component';\n\nexport type templateFunc = () => string;\nexport type amountSelectedTemplateFunc = (amount: number) => string;\n\n@Component({\n\ttag: 'p-table',\n\tstyleUrl: 'table.component.css',\n})\nexport class Table {\n\t/**\n\t * The items to be fed to the table\n\t */\n\t@Prop() items: string;\n\n\t/**\n\t * Wether data is loading\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether the header should show loading state\n\t */\n\t@Prop() headerLoading: boolean = false;\n\n\t/**\n\t * Wether the footer should show loading state\n\t */\n\t@Prop() footerLoading: boolean = false;\n\n\t/**\n\t * The amount of loading rows to show\n\t */\n\t@Prop() amountOfLoadingRows: number = 6;\n\n\t/**\n\t * Wether to enable selection\n\t */\n\t@Prop() enableRowSelection: boolean = true;\n\n\t/**\n\t * A limit to the amount of rows that can be selected\n\t */\n\t@Prop() rowSelectionLimit: number | undefined;\n\n\t/**\n\t * Wether to enable row clicking\n\t */\n\t@Prop() enableRowClick: boolean = true;\n\n\t/**\n\t * The current selection of items\n\t */\n\t@Prop() selectedRows: any[] = [];\n\n\t/**\n\t * Wether to enable the floating menu\n\t */\n\t@Prop() enableFloatingMenu: boolean = true;\n\n\t/**\n\t * The template for amount selected item in the floating menu\n\t */\n\t@Prop() floatingMenuAmountSelectedTemplate: amountSelectedTemplateFunc = (\n\t\tamount: number\n\t) =>\n\t\tformatTranslation(\n\t\t\t(amount === 1\n\t\t\t\t? this._locales.floating_menu?.amount_selected\n\t\t\t\t: this._locales.floating_menu?.amount_selected_plural\n\t\t\t)?.replace('{{amount}}', amount)\n\t\t);\n\n\t/**\n\t * Event whenever the current selection changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tselectedRowsChange: EventEmitter<any>;\n\n\t/**\n\t * The key to determine if a row is selected\n\t */\n\t@Prop() selectionKey: string;\n\n\t/**\n\t * A key to determine if a row can be selected\n\t */\n\t@Prop() canSelectKey: string;\n\n\t/**\n\t * Event whenever a row is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\trowClick: EventEmitter<RowClickEvent>;\n\n\t/**\n\t * Event whenever a row is selected\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\trowSelected: EventEmitter<any>;\n\n\t/**\n\t * Event whenever a row is deselected\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\trowDeselected: EventEmitter<any>;\n\n\t/**\n\t * Event when the table has rendered\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\thasRendered: EventEmitter<number>;\n\n\t/** START HEADER */\n\n\t/**\n\t * Wether to show the header\n\t */\n\t@Prop() enableHeader: boolean = true;\n\n\t/**\n\t * Quick filters to show\n\t */\n\t@Prop() quickFilters: QuickFilter[] | string = [];\n\n\t/**\n\t * Active quick filter identifier\n\t */\n\t@Prop() activeQuickFilterIdentifier: string;\n\n\t/**\n\t * Wether to show the search input\n\t */\n\t@Prop() enableSearch: boolean = true;\n\n\t/**\n\t * The query to show in the search bar\n\t */\n\t@Prop({ mutable: true }) query: string;\n\n\t/**\n\t * Wether to show the filter button\n\t */\n\t@Prop() enableFilter: boolean = true;\n\n\t/**\n\t * Wether to show the filter button on desktop\n\t */\n\t@Prop() enableFilterDesktop: boolean = true;\n\n\t/**\n\t * The amount of filters being selected\n\t */\n\t@Prop() selectedFiltersAmount: number;\n\n\t/**\n\t * The template for the filter button text\n\t */\n\t@Prop() filterButtonTemplate: templateFunc;\n\n\t/**\n\t * Wether to show the action button\n\t */\n\t@Prop() enableAction: boolean = false;\n\n\t/**\n\t * Wether the action button is loading\n\t */\n\t@Prop() actionButtonLoading: boolean = false;\n\n\t/**\n\t * Wether the action button is enabled\n\t */\n\t@Prop() actionButtonEnabled: boolean = false;\n\n\t/**\n\t * The action button icon\n\t */\n\t@Prop() actionButtonIcon: IconVariant = 'pencil';\n\n\t/**\n\t * The action button text if changed\n\t */\n\t@Prop() actionButtonText: string;\n\n\t/**\n\t * The template for the action button text\n\t */\n\t@Prop() actionButtonTemplate: buttonTemplateFunc;\n\n\t/**\n\t * Event when one of the quick filters is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tquickFilter: EventEmitter<QuickFilter>;\n\n\t/**\n\t * Event when the query changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the filter button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tfilter: EventEmitter<null>;\n\n\t/**\n\t * Event when the action button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\taction: EventEmitter<null>;\n\n\t/** START FOOTER */\n\n\t/**\n\t * Wether to show the header\n\t */\n\t@Prop() enableFooter: boolean = true;\n\n\t/**\n\t * Wether to enable pagination size select\n\t */\n\t@Prop() enablePaginationSize: boolean = true;\n\n\t/**\n\t * Wether to enable pagination pages\n\t */\n\t@Prop() enablePaginationPages: boolean = true;\n\n\t/**\n\t * Wether to enable export\n\t */\n\t@Prop() enableExport: boolean = true;\n\n\t/**\n\t * The current page\n\t */\n\t@Prop({ mutable: true, reflect: true }) page: number = 1;\n\n\t/**\n\t * The total amount of items\n\t */\n\t@Prop() total!: number;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageChange: EventEmitter<number>;\n\n\t/**\n\t * The amount of items per page\n\t */\n\t@Prop() pageSize: number = PAGINATION_DEFAULT_PAGE_SIZE;\n\n\t/**\n\t * The options for the page size\n\t */\n\t@Prop() pageSizeOptions: number[] = PAGINATION_DEFAULT_PAGE_SIZE_OPTIONS;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageSizeChange: EventEmitter<number>;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\texport: EventEmitter<number>;\n\n\t/**\n\t * Wether to hide when there is only 1 page available\n\t */\n\t@Prop() hideOnSinglePage: boolean = true;\n\n\t/* Empty state start */\n\t@Prop() emptyStateHeader: templateFunc = () =>\n\t\tformatTranslation(this._locales.empty_state?.no_filter.header);\n\t@Prop() emptyStateContent: templateFunc = () =>\n\t\tformatTranslation(this._locales.empty_state?.no_filter.content);\n\t@Prop() emptyStateAction: templateFunc = () =>\n\t\tformatTranslation(this._locales.empty_state?.no_filter.action);\n\t/**\n\t * Wether to enable empty state action\n\t */\n\t@Prop() enableEmptyStateAction: boolean = true;\n\n\t@Prop() emptyStateFilteredHeader: templateFunc = () =>\n\t\tformatTranslation(this._locales.empty_state.filtered.header);\n\t@Prop() emptyStateFilteredContent: templateFunc = () =>\n\t\tformatTranslation(this._locales.empty_state.filtered.content);\n\n\t/**\n\t * Event whenever the empty state is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\temptyStateActionClick: EventEmitter<null>;\n\n\t/*\n\t * Wether to show the shadow or not\n\t */\n\t@Prop() shadow: boolean = true;\n\n\t/* Empty state end */\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Locales used for this component\n\t */\n\t@State() private _locales: any = {};\n\n\t@State() private _columns: any[] = [];\n\t@State() private _items: any[] = [];\n\n\t@State() private _enableRowSelection: boolean = this.enableRowSelection;\n\t@State() private _rowSelectionLimit: number | undefined;\n\n\tprivate _rowActionsFloatingAll: TableRowAction[] = [];\n\t@State() private _rowActionsFloating: TableRowAction[] = [];\n\t@State() private _rowActionsRow: TableRowAction[] = [];\n\n\t@State() private _footerHidden: boolean = false;\n\n\tprivate _ctrlDown = false;\n\tprivate _hasCustomFilterSlot = false;\n\tprivate _hasCustomActionsSlot = false;\n\tprivate _floatingMenuShown = false;\n\tprivate _resizeTimeout: NodeJS.Timeout | undefined;\n\n\tcomponentWillLoad() {\n\t\tthis._hasCustomFilterSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-filter\"]'\n\t\t);\n\n\t\tthis._hasCustomActionsSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-actions\"]'\n\t\t);\n\n\t\tthis._setRowSelectionData();\n\n\t\tthis._setLocales();\n\t\tthis._parseItems(this.items);\n\t\tthis._generateColumns();\n\t}\n\n\tcomponentDidRender() {\n\t\tthis.hasRendered.emit();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='z-0 flex flex-col'>\n\t\t\t\t<p-table-container>\n\t\t\t\t\t{this.enableHeader && (\n\t\t\t\t\t\t<p-table-header\n\t\t\t\t\t\t\tclass='mb-8'\n\t\t\t\t\t\t\t// quick filters\n\t\t\t\t\t\t\tquickFilters={this.quickFilters}\n\t\t\t\t\t\t\tactiveQuickFilterIdentifier={this.activeQuickFilterIdentifier}\n\t\t\t\t\t\t\tonQuickFilter={({ detail }) => this.quickFilter.emit(detail)}\n\t\t\t\t\t\t\t// search\n\t\t\t\t\t\t\tenableSearch={this.enableSearch}\n\t\t\t\t\t\t\tquery={this.query}\n\t\t\t\t\t\t\tonQueryChange={({ detail }) => this.queryChange.emit(detail)}\n\t\t\t\t\t\t\t// filter button\n\t\t\t\t\t\t\tenableFilter={this.enableFilter}\n\t\t\t\t\t\t\tenableFilterDesktop={this.enableFilterDesktop}\n\t\t\t\t\t\t\tselectedFiltersAmount={this.selectedFiltersAmount}\n\t\t\t\t\t\t\tfilterButtonTemplate={this.filterButtonTemplate}\n\t\t\t\t\t\t\tonFilter={() => this.filter.emit()}\n\t\t\t\t\t\t\t// action button\n\t\t\t\t\t\t\tenableAction={this.enableAction}\n\t\t\t\t\t\t\tactionIcon={this.actionButtonIcon}\n\t\t\t\t\t\t\tactionText={this.actionButtonText}\n\t\t\t\t\t\t\tactionLoading={this.actionButtonLoading}\n\t\t\t\t\t\t\tcanUseAction={this.actionButtonEnabled}\n\t\t\t\t\t\t\tactionButtonTemplate={this.actionButtonTemplate}\n\t\t\t\t\t\t\tonAction={() => this.action.emit()}\n\t\t\t\t\t\t\titemsSelectedAmount={this.selectedRows?.length}\n\t\t\t\t\t\t\t//export\n\t\t\t\t\t\t\tenableExport={this.enableExport}\n\t\t\t\t\t\t\tonExport={() => this.export.emit()}\n\t\t\t\t\t\t\t//loading\n\t\t\t\t\t\t\tloading={this.headerLoading}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this._hasCustomFilterSlot && (\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\tname='custom-filter'\n\t\t\t\t\t\t\t\t\tslot='custom-filter'\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{this._hasCustomActionsSlot && (\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\tname='custom-actions'\n\t\t\t\t\t\t\t\t\tslot='custom-actions'\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</p-table-header>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this._getHeader()}\n\t\t\t\t\t<div class='flex flex-1 flex-col'>\n\t\t\t\t\t\t{this._getRows()}\n\t\t\t\t\t\t<slot name='custom-rows' />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.enableFloatingMenu && this._enableRowSelection ? (\n\t\t\t\t\t\t<p-floating-menu-container\n\t\t\t\t\t\t\tusedInTable={true}\n\t\t\t\t\t\t\tclass={floatingMenuContainerClass({\n\t\t\t\t\t\t\t\thasFooter: this.enableFooter && !this._footerHidden,\n\t\t\t\t\t\t\t\tactive: !!this.selectedRows?.length,\n\t\t\t\t\t\t\t\tshown: this._floatingMenuShown,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tamountSelectedTemplate={this.floatingMenuAmountSelectedTemplate}\n\t\t\t\t\t\t\tamount={this.selectedRows?.length}\n\t\t\t\t\t\t\tenableAmountSelected={!!this._rowActionsFloating?.length}\n\t\t\t\t\t\t\tonClose={() => this._selectAllChange(null, false)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this._rowActionsFloating?.length &&\n\t\t\t\t\t\t\t\tthis._rowActionsFloating.map(a => (\n\t\t\t\t\t\t\t\t\t<p-floating-menu-item\n\t\t\t\t\t\t\t\t\t\tslot='floating-menu-item'\n\t\t\t\t\t\t\t\t\t\tdisabled={a.disabled}\n\t\t\t\t\t\t\t\t\t\tloading={a.loading}\n\t\t\t\t\t\t\t\t\t\ticon={a.icon}\n\t\t\t\t\t\t\t\t\t\ticonRotate={a.iconRotate}\n\t\t\t\t\t\t\t\t\t\ticonFlip={a.iconFlip}\n\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t!a.disabled &&\n\t\t\t\t\t\t\t\t\t\t\t!a.loading &&\n\t\t\t\t\t\t\t\t\t\t\t!!a.action &&\n\t\t\t\t\t\t\t\t\t\t\ta.type === 'single'\n\t\t\t\t\t\t\t\t\t\t\t\t? a.action(this.selectedRows[0], false)\n\t\t\t\t\t\t\t\t\t\t\t\t: a.action(this.selectedRows, true)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{a.label}\n\t\t\t\t\t\t\t\t\t</p-floating-menu-item>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</p-floating-menu-container>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t''\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.enableFooter && (\n\t\t\t\t\t\t<p-table-footer\n\t\t\t\t\t\t\t// overall\n\t\t\t\t\t\t\thideOnSinglePage={this.hideOnSinglePage}\n\t\t\t\t\t\t\t// page size select\n\t\t\t\t\t\t\tenablePaginationSize={this.enablePaginationSize}\n\t\t\t\t\t\t\tpageSize={this.pageSize}\n\t\t\t\t\t\t\tpageSizeOptions={this.pageSizeOptions}\n\t\t\t\t\t\t\tonPageSizeChange={({ detail }) =>\n\t\t\t\t\t\t\t\tthis.pageSizeChange.emit(detail)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// pagination\n\t\t\t\t\t\t\tenablePaginationPages={this.enablePaginationPages}\n\t\t\t\t\t\t\tpage={this.page}\n\t\t\t\t\t\t\ttotal={this.total}\n\t\t\t\t\t\t\tonPageChange={({ detail }) => this.pageChange.emit(detail)}\n\t\t\t\t\t\t\t//loading\n\t\t\t\t\t\t\tloading={this.footerLoading}\n\t\t\t\t\t\t\tonHiddenChange={({ detail }) => (this._footerHidden = detail)}\n\t\t\t\t\t\t\t// header adjustment\n\t\t\t\t\t\t\ttableHeaderHasAction={\n\t\t\t\t\t\t\t\tthis.enableHeader &&\n\t\t\t\t\t\t\t\tthis.enableAction &&\n\t\t\t\t\t\t\t\tthis.actionButtonEnabled\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t></p-table-footer>\n\t\t\t\t\t)}\n\t\t\t\t</p-table-container>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('localeChanged', { target: 'body' })\n\tprivate async _setLocales(): Promise<void> {\n\t\tthis._locales = await getLocaleComponentStrings(this._el);\n\t}\n\n\t@Listen('tableDefinitionChanged', { target: 'body' })\n\tonTableDefinitionUpdated() {\n\t\tthis._generateColumns();\n\t}\n\n\t@Listen('keydown', { target: 'document' })\n\tkeyDown({ key }) {\n\t\tif (key !== 'Control' || this._ctrlDown === true) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._ctrlDown = true;\n\t}\n\n\t@Listen('keyup', { target: 'document' })\n\tkeyUp({ key }) {\n\t\tif (key !== 'Control' || this._ctrlDown === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._ctrlDown = false;\n\t}\n\n\t@Listen('visibilitychange', { target: 'document' })\n\tvisibilityChange() {\n\t\tif (document.visibilityState !== 'hidden' || this._ctrlDown === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._ctrlDown = false;\n\t}\n\n\t@Watch('items')\n\tprivate _parseItems(items: string) {\n\t\tif (!items) {\n\t\t\tthis._items = [];\n\t\t\treturn;\n\t\t}\n\n\t\tif (Array.isArray(items)) {\n\t\t\tthis._items = items;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._items = JSON.parse(items);\n\t}\n\n\t@Watch('enableRowSelection')\n\t@Watch('rowSelectionLimit')\n\t@Watch('selectedRows')\n\t@Listen('resize', { target: 'window' })\n\tprivate _setRowSelectionData() {\n\t\tif (this._resizeTimeout) {\n\t\t\tclearTimeout(this._resizeTimeout);\n\t\t}\n\n\t\t// We add a timeout here because it's a lot easier on the machine to do these when someone is done\n\t\t// resizing and playing around with their browser\n\t\tthis._resizeTimeout = setTimeout(() => {\n\t\t\tconst mobile = isMobile();\n\n\t\t\t// we hack this to any[] to make it work..\n\t\t\tconst actions = Array.from(\n\t\t\t\tthis._el.querySelectorAll(':scope > p-table-row-action')\n\t\t\t) as any[] as TableRowAction[];\n\t\t\tthis._rowActionsRow = actions.filter(\n\t\t\t\ta => a.type === 'both' || a.type === 'single'\n\t\t\t);\n\t\t\tthis._rowActionsFloatingAll = actions\n\t\t\t\t.filter(\n\t\t\t\t\ta =>\n\t\t\t\t\t\t(this.enableRowSelection &&\n\t\t\t\t\t\t\t(a.type === 'both' || a.type === 'multi')) ||\n\t\t\t\t\t\t(mobile && a.type === 'single')\n\t\t\t\t)\n\t\t\t\t.map(a => {\n\t\t\t\t\tif (a.type === 'single') {\n\t\t\t\t\t\ta.disabled = this.selectedRows?.length > 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn a;\n\t\t\t\t});\n\n\t\t\tlet rowSelectionLimit = this.rowSelectionLimit;\n\t\t\tif (\n\t\t\t\tmobile && // we're mobile\n\t\t\t\tthis._rowActionsFloatingAll?.length && // we have atleast 1 item in _rowActionsFloating\n\t\t\t\t((rowSelectionLimit !== undefined && this.enableRowSelection) ||\n\t\t\t\t\t!this.enableRowSelection)\n\t\t\t) {\n\t\t\t\trowSelectionLimit = 1;\n\t\t\t}\n\n\t\t\tthis._rowSelectionLimit = rowSelectionLimit;\n\n\t\t\tlet enableRowSelection = this.enableRowSelection;\n\t\t\tif (\n\t\t\t\tmobile && // we're mobile\n\t\t\t\tthis._rowActionsFloatingAll?.length && // we have atleast 1 item in _rowActionsFloating\n\t\t\t\t!enableRowSelection\n\t\t\t) {\n\t\t\t\tenableRowSelection = true;\n\t\t\t}\n\n\t\t\tthis._enableRowSelection = enableRowSelection;\n\n\t\t\tif (this._floatingMenuShown) {\n\t\t\t\tthis._showFloatingMenu();\n\t\t\t}\n\t\t}, 200);\n\t}\n\n\tprivate _generateColumns() {\n\t\tconst definitions = this._el.querySelectorAll('p-table-column');\n\t\tlet definitionsArray = Array.from(definitions);\n\n\t\tdefinitionsArray = this._parseDefinitions(definitionsArray);\n\n\t\tthis._columns = definitionsArray;\n\t}\n\n\tprivate _getHeader() {\n\t\treturn (\n\t\t\t<p-table-row variant='header'>\n\t\t\t\t{this._columns.map((col: TableColumn, index) => (\n\t\t\t\t\t<p-table-cell\n\t\t\t\t\t\tdefinition={col}\n\t\t\t\t\t\tvalue={col.name}\n\t\t\t\t\t\tvariant='header'\n\t\t\t\t\t\tcheckbox={\n\t\t\t\t\t\t\tindex === 0 || col.hasCheckbox\n\t\t\t\t\t\t\t\t? this._getCheckbox(null, this.loading ? 'loading' : 'header')\n\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t></p-table-cell>\n\t\t\t\t))}\n\t\t\t</p-table-row>\n\t\t);\n\t}\n\n\tprivate _getRows() {\n\t\tif (this.loading) {\n\t\t\treturn Array.from(\n\t\t\t\t{\n\t\t\t\t\tlength: this.amountOfLoadingRows,\n\t\t\t\t},\n\t\t\t\t(_, i) => (\n\t\t\t\t\t<p-table-row\n\t\t\t\t\t\tenableHover={this._enableRowSelection || this.enableRowClick}\n\t\t\t\t\t\tisLast={i === this.amountOfLoadingRows - 1}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this._getLoadingColumns(i)}\n\t\t\t\t\t</p-table-row>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif (!this._items.length) {\n\t\t\treturn this._getEmptyState();\n\t\t}\n\n\t\treturn this._items.map((item, index) => (\n\t\t\t<p-table-row\n\t\t\t\tenableHover={this._enableRowSelection || this.enableRowClick}\n\t\t\t\tchecked={this._selectionContains(index)}\n\t\t\t\tonClick={ev => this._rowClick(ev, index)}\n\t\t\t\tisLast={index === this._items.length - 1}\n\t\t\t>\n\t\t\t\t{this._getRowColumns(item, index)}\n\t\t\t\t{this._getActions(item, index)}\n\t\t\t</p-table-row>\n\t\t));\n\t}\n\n\tprivate _getActions(item, index) {\n\t\tconst actions = this._rowActionsRow.filter(a =>\n\t\t\ta.showFunction ? a.showFunction(item) : true\n\t\t);\n\n\t\tif (actions?.length && !isMobile()) {\n\t\t\treturn (\n\t\t\t\t<p-table-row-actions-container\n\t\t\t\t\tslot='actions'\n\t\t\t\t\tchecked={this._selectionContains(index)}\n\t\t\t\t>\n\t\t\t\t\t{actions.map(a => (\n\t\t\t\t\t\t<p-tooltip\n\t\t\t\t\t\t\tstrategy='fixed'\n\t\t\t\t\t\t\tcontent={a.label}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tdata-is-action\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\t\ticon={a.icon}\n\t\t\t\t\t\t\t\ticonRotate={a.iconRotate}\n\t\t\t\t\t\t\t\ticonFlip={a.iconFlip}\n\t\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\ttypeof a.action === 'function' && a.action?.(item, false)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t></p-button>\n\t\t\t\t\t\t</p-tooltip>\n\t\t\t\t\t))}\n\t\t\t\t</p-table-row-actions-container>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\tprivate _getRowColumns(item, index) {\n\t\treturn this._columns.map((col: TableColumn, colIndex) => {\n\t\t\treturn (\n\t\t\t\t<p-table-cell\n\t\t\t\t\tdefinition={col}\n\t\t\t\t\titem={item}\n\t\t\t\t\tcheckbox={\n\t\t\t\t\t\tcolIndex === 0 || col.hasCheckbox ? this._getCheckbox(index) : null\n\t\t\t\t\t}\n\t\t\t\t\tindex={colIndex}\n\t\t\t\t\trowIndex={index}\n\t\t\t\t></p-table-cell>\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate _getLoadingColumns(index) {\n\t\treturn this._columns.map((col: TableColumn, colIndex) => {\n\t\t\treturn (\n\t\t\t\t<p-table-cell\n\t\t\t\t\tdefinition={col}\n\t\t\t\t\tvariant='loading'\n\t\t\t\t\tcheckbox={\n\t\t\t\t\t\tcolIndex === 0 || col.hasCheckbox\n\t\t\t\t\t\t\t? this._getCheckbox(index, 'loading')\n\t\t\t\t\t\t\t: null\n\t\t\t\t\t}\n\t\t\t\t\tindex={colIndex}\n\t\t\t\t\trowIndex={index}\n\t\t\t\t></p-table-cell>\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate _getCheckbox(\n\t\trowIndex: number,\n\t\tvariant: 'header' | 'default' | 'loading' = 'default'\n\t) {\n\t\tif (\n\t\t\t!this._enableRowSelection ||\n\t\t\t(!this.selectionKey && !this._rowActionsFloating?.length)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (variant === 'loading') {\n\t\t\treturn (\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-6 rounded'\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'header') {\n\t\t\treturn (\n\t\t\t\t<p-checkbox\n\t\t\t\t\tclass={cn({\n\t\t\t\t\t\t'opacity-0': this._rowSelectionLimit !== undefined,\n\t\t\t\t\t})}\n\t\t\t\t\tchecked={this._selectionContainsAll()}\n\t\t\t\t\tindeterminate={this._selectionIndeterminate()}\n\t\t\t\t\tdisabled={this._rowSelectionLimit !== undefined}\n\t\t\t\t\tonCheckedChange={ev => this._selectAllChange(ev)}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tconst item = this._items[rowIndex];\n\n\t\tconst selectionContains = this._selectionContains(rowIndex);\n\n\t\treturn (\n\t\t\t<p-checkbox\n\t\t\t\tclass='flex-shrink-0'\n\t\t\t\tdisabled={\n\t\t\t\t\t(this.canSelectKey && !item[this.canSelectKey]) ||\n\t\t\t\t\t(this._rowSelectionLimit !== undefined &&\n\t\t\t\t\t\t!selectionContains &&\n\t\t\t\t\t\tthis.selectedRows.length === this._rowSelectionLimit)\n\t\t\t\t}\n\t\t\t\tchecked={selectionContains}\n\t\t\t\tonCheckedChange={ev => this._checkboxChange(ev, rowIndex)}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _getEmptyState() {\n\t\tif (this.query?.length || this.selectedFiltersAmount) {\n\t\t\treturn (\n\t\t\t\t<p-empty-state\n\t\t\t\t\tclass='my-16 self-center'\n\t\t\t\t\tillustration='search'\n\t\t\t\t\theader={this.emptyStateFilteredHeader()}\n\t\t\t\t\tcontent={this.emptyStateFilteredContent()}\n\t\t\t\t></p-empty-state>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<p-empty-state\n\t\t\t\tclass='my-16 self-center'\n\t\t\t\tillustration='table'\n\t\t\t\theader={this.emptyStateHeader()}\n\t\t\t\tcontent={this.emptyStateContent()}\n\t\t\t\tenableAction={this.enableEmptyStateAction}\n\t\t\t\tactionIcon='plus'\n\t\t\t\tactionText={this.emptyStateAction()}\n\t\t\t\tonAction={() => this.enableAction && this.action.emit()}\n\t\t\t></p-empty-state>\n\t\t);\n\t}\n\n\tprivate _selectAllChange(\n\t\tev: PCheckboxCustomEvent<boolean>,\n\t\tforceValue?: boolean\n\t) {\n\t\tif (!this._enableRowSelection) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = ev?.detail ?? forceValue ?? false;\n\n\t\tconst value = forceValue === undefined ? checked : forceValue;\n\t\tif (value) {\n\t\t\tconst toAdd = [];\n\t\t\tfor (let i = 0; i < this._items.length; i++) {\n\t\t\t\tconst row = this._items[i];\n\t\t\t\tif (this.canSelectKey && !row[this.canSelectKey]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this._selectionContains(i)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttoAdd.push(row);\n\t\t\t\tthis.rowSelected.emit(row);\n\n\t\t\t\tif (\n\t\t\t\t\tthis._rowSelectionLimit !== undefined &&\n\t\t\t\t\tthis.selectedRows.length + toAdd.length === this._rowSelectionLimit\n\t\t\t\t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.selectedRows = [...this.selectedRows, ...toAdd];\n\t\t\tthis.selectedRowsChange.emit(this.selectedRows);\n\t\t\tif (this.enableFloatingMenu && !this._floatingMenuShown) {\n\t\t\t\tthis._showFloatingMenu();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0; i < this.selectedRows.length; i++) {\n\t\t\tconst value = this.selectedRows[i];\n\t\t\tconst row = this._items.find(\n\t\t\t\td => this._getSelectionValue(d, i) === this._getSelectionValue(value, i)\n\t\t\t);\n\n\t\t\tif (!row) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.rowDeselected.emit(row);\n\t\t}\n\n\t\tthis.selectedRows = [];\n\t\tthis.selectedRowsChange.emit(this.selectedRows);\n\t}\n\n\tprivate _checkboxChange(\n\t\t{ detail: checked, target }: PCheckboxCustomEvent<boolean>,\n\t\tindex: number\n\t) {\n\t\tif (!this._enableRowSelection) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tchecked &&\n\t\t\tthis._rowSelectionLimit !== undefined &&\n\t\t\tthis.selectedRows.length >= this._rowSelectionLimit\n\t\t) {\n\t\t\ttarget.checked = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst row = this._items[index];\n\n\t\tif (this.canSelectKey && !row[this.canSelectKey]) {\n\t\t\ttarget.checked = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (checked) {\n\t\t\tthis.selectedRows = [\n\t\t\t\t...this.selectedRows,\n\t\t\t\t{\n\t\t\t\t\t...row,\n\t\t\t\t\tindex,\n\t\t\t\t},\n\t\t\t];\n\t\t\tthis.selectedRowsChange.emit(this.selectedRows);\n\t\t\tthis.rowSelected.emit(row);\n\n\t\t\tif (this.enableFloatingMenu && !this._floatingMenuShown) {\n\t\t\t\tthis._showFloatingMenu();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst indexOfToRemove = this._selectionContains(index, true);\n\n\t\t// we need to do this, because splice does not trigger the selection setter.\n\t\tconst selection = [...this.selectedRows];\n\t\tselection.splice(indexOfToRemove, 1);\n\t\tthis.selectedRows = selection;\n\t\tthis.selectedRowsChange.emit(this.selectedRows);\n\t\tthis.rowDeselected.emit(row);\n\t}\n\n\tprivate _getSelectionValue(row: any, index: number) {\n\t\treturn this.selectionKey ? row?.[this.selectionKey] || index : index;\n\t}\n\n\tprivate _selectionContains(index, returnIndex = false): any {\n\t\tconst returnValue = this.selectedRows.findIndex(\n\t\t\titem => item.index === index\n\t\t);\n\t\treturn !returnIndex ? returnValue >= 0 : returnValue;\n\t}\n\n\tprivate _selectionContainsAll() {\n\t\tlet returnValue = true;\n\t\tif (!this._items?.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tthis._rowSelectionLimit !== undefined &&\n\t\t\tthis.selectedRows.length === this._rowSelectionLimit\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (let i = 0; i < this._items?.length; i++) {\n\t\t\tconst contains = this._selectionContains(i);\n\n\t\t\tif (!contains) {\n\t\t\t\treturnValue = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn returnValue;\n\t}\n\n\tprivate _selectionIndeterminate() {\n\t\tif (!this._items?.length || !this.selectedRows?.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tthis._rowSelectionLimit !== undefined &&\n\t\t\tthis.selectedRows.length === this._rowSelectionLimit\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet containsCount = 0;\n\t\tfor (let i = 0; i < this._items?.length; i++) {\n\t\t\tconst contains = this._selectionContains(i);\n\n\t\t\tif (contains) {\n\t\t\t\tcontainsCount++;\n\t\t\t}\n\t\t}\n\n\t\treturn containsCount > 0 && containsCount !== this._items.length;\n\t}\n\n\tprivate _rowClick($event, index) {\n\t\tconst target = $event.target;\n\n\t\tif (\n\t\t\ttarget.tagName.toLowerCase() === 'input' ||\n\t\t\ttarget.type === 'checkbox'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst row = this._findRow($event.target);\n\t\tconst action = this._findRowAction($event.target);\n\n\t\tif (action) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.enableRowClick) {\n\t\t\tconst item = this._items[index];\n\t\t\tthis.rowClick.emit({\n\t\t\t\titem,\n\t\t\t\tctrlDown: this._ctrlDown,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._enableRowSelection) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst checkbox = row?.querySelector('input[type=\"checkbox\"]');\n\n\t\tif (!checkbox) {\n\t\t\treturn;\n\t\t}\n\n\t\tcheckbox.checked = !checkbox.checked;\n\t\tthis._checkboxChange(checkbox, index);\n\t}\n\n\tprivate _findRow(el: HTMLElement) {\n\t\tif (!el) {\n\t\t\treturn el;\n\t\t}\n\n\t\tif (el?.tagName?.toLowerCase() === 'p-table-row') {\n\t\t\treturn el;\n\t\t}\n\n\t\treturn this._findRow(el?.parentElement);\n\t}\n\n\tprivate _findRowAction(el: HTMLElement) {\n\t\tif (!el) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (\n\t\t\tel.getAttribute('data-is-action') !== null &&\n\t\t\tel.getAttribute('data-is-action') !== 'false'\n\t\t) {\n\t\t\treturn el;\n\t\t}\n\n\t\tif (el?.tagName?.toLowerCase() === 'p-table-row') {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._findRowAction(el?.parentElement);\n\t}\n\n\tprivate _showFloatingMenu() {\n\t\tlet actions = this._rowActionsFloatingAll;\n\t\tif (\n\t\t\tthis.rowSelectionLimit === 1 &&\n\t\t\tactions.findIndex(\n\t\t\t\ta => (a.type === 'single' || a.type === 'both') && a.showFunction\n\t\t\t) >= 0\n\t\t) {\n\t\t\tactions = actions.filter(\n\t\t\t\ta =>\n\t\t\t\t\ta.type === 'multi' ||\n\t\t\t\t\t!a.showFunction ||\n\t\t\t\t\ta.showFunction(this.selectedRows[0])\n\t\t\t);\n\t\t}\n\n\t\tthis._rowActionsFloating = actions;\n\t\tthis._floatingMenuShown = true;\n\t}\n\n\tprivate _parseDefinitions(definitionsArray: HTMLPTableColumnElement[]) {\n\t\treturn definitionsArray.map(definition => {\n\t\t\tdefinition = this._parseDefinitionSizes(definition);\n\t\t\treturn definition;\n\t\t});\n\t}\n\n\tprivate _parseDefinitionSizes(definition: HTMLPTableColumnElement) {\n\t\tconst definitionAny = definition as any;\n\t\tlet parsedSizes: TableColumnSizes = { default: 'full' };\n\n\t\tif (\n\t\t\ttypeof definition.sizes === 'string' &&\n\t\t\t!['auto', 'hidden', 'full'].includes(definition.sizes)\n\t\t) {\n\t\t\tdefinition.sizes = JSON.parse(definition.sizes);\n\t\t}\n\n\t\tfor (const [index, size] of tableColumSizesOptions.entries()) {\n\t\t\tif (\n\t\t\t\tdefinitionAny.sizes === 'auto' ||\n\t\t\t\tdefinitionAny.sizes === 'hidden' ||\n\t\t\t\tdefinitionAny.sizes === 'full' ||\n\t\t\t\ttypeof definitionAny.sizes === 'number'\n\t\t\t) {\n\t\t\t\tparsedSizes[size] =\n\t\t\t\t\tdefinitionAny.sizes === 'auto' ? 'full' : definitionAny.sizes;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tparsedSizes[size] =\n\t\t\t\tdefinitionAny.sizes[size] ??\n\t\t\t\tparsedSizes[tableColumSizesOptions[index - 1]];\n\t\t}\n\n\t\tdefinition.parsedSizes = parsedSizes;\n\t\treturn definition;\n\t}\n}\n"],"mappings":"iVAAA,MAAMA,EAAoB,2yB,MCyCbC,EAAK,M,ojBAITC,MAKAC,QAAmB,MAKnBC,cAAyB,MAKzBC,cAAyB,MAKzBC,oBAA8B,EAK9BC,mBAA8B,KAK9BC,kBAKAC,eAA0B,KAK1BC,aAAsB,GAKtBC,mBAA8B,KAK9BC,mCACPC,GAEAC,GACED,IAAW,EACTE,KAAKC,SAASC,eAAeC,gBAC7BH,KAAKC,SAASC,eAAeE,yBAC7BC,QAAQ,aAAcP,IAS3BQ,mBAKQC,aAKAC,aAQRC,SAQAC,YAQAC,cAQAC,YAOQC,aAAwB,KAKxBC,aAAuC,G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AAiBlC,KAAIuC,IAC3BA,EAAatJ,KAAK+M,sBAAsBzD,GACxC,OAAOA,CAAU,G,CAIX,qBAAAyD,CAAsBzD,GAC7B,MAAM0D,EAAgB1D,EACtB,IAAI2D,EAAgC,CAAEC,QAAS,QAE/C,UACQ5D,EAAW6D,QAAU,WAC3B,CAAC,OAAQ,SAAU,QAAQC,SAAS9D,EAAW6D,OAC/C,CACD7D,EAAW6D,MAAQ9E,KAAKC,MAAMgB,EAAW6D,M,CAG1C,IAAK,MAAO9D,EAAOsB,KAAS0C,EAAuBC,UAAW,CAC7D,GACCN,EAAcG,QAAU,QACxBH,EAAcG,QAAU,UACxBH,EAAcG,QAAU,eACjBH,EAAcG,QAAU,SAC9B,CACDF,EAAYtC,GACXqC,EAAcG,QAAU,OAAS,OAASH,EAAcG,MACzD,Q,CAGDF,EAAYtC,GACXqC,EAAcG,MAAMxC,IACpBsC,EAAYI,EAAuBhE,EAAQ,G,CAG7CC,EAAW2D,YAAcA,EACzB,OAAO3D,C","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./p-CBWjHURv.js";function e(t,e){return e in t}const n=(t,e)=>{const n=t?r(t,e):{};return{"flex flex-shrink items-center gap-4 pr-4 last-of-type:pr-0":true,"justify-start":!t?.align||t?.align==="start","justify-center":t?.align==="center","justify-end":t?.align==="end","font-semibold":e!=="header"&&t?.variant==="subject","text-storm-400 dark:text-hurricane-200":e==="header","text-storm-300 dark:text-hurricane-200":e!=="header"&&t?.variant!=="subject"&&t?.variant!=="highlight","text-storm-500 dark:text-white":e!=="header"&&(t?.variant==="subject"||t?.variant==="highlight"),...n}};const r=({sizes:t},n)=>{if(t==="auto"||!t){return{"w-auto":true}}if(t==="hidden"){return{hidden:true}}if(typeof t==="object"){t=t;const r={};let i;for(let u in t){if(!e(t,u)){continue}if(u==="default"){if(t.default==="hidden"){r["hidden"]=true;i=u;continue}r[`w-${t.default}/12`]=true;i=u;continue}const o=t[u];const s=i?t[i]:null;if(o!=="hidden"&&s&&s==="hidden"&&n!=="actions"){r[`${u}:flex`]=true}if(o==="hidden"&&n!=="actions"){r[`${u}:hidden`]=true;i=u;continue}if(o===12||o==="full"){r[`${u}:w-full`]=true}r[`${u}:w-${o}/12`]=true;i=u}return r}if(t===12||t==="full"){return{"w-full":true}}return{[`w-${t}/12`]:true}};const i=t(["sticky self-center"],{variants:{hasFooter:{true:"mt-4 -mb-5 bottom-11 z-[3]",false:"my-4 bottom-0"},active:{false:"pointer-events-none animate-floating-menu-container-out",true:"animate-floating-menu-container-in"},shown:{false:"hidden",true:"inline-block"}}});export{r as a,i as f,n as g,e as i};
|
|
2
|
-
//# sourceMappingURL=p-D8FNwRNH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"p-D8FNwRNH.js","sources":["src/types/table.ts","src/utils/table-helpers.ts"],"sourcesContent":["export type QuickFilterTextFunction = () => string;\n\nexport interface QuickFilter {\n\tidentifier: string;\n\ttext: string | QuickFilterTextFunction;\n\tcount?: number;\n\tdefault?: boolean;\n}\n\nexport interface RowClickEvent {\n\titem: any;\n\tctrlDown: boolean;\n}\n\nexport interface TableDefinitionData {\n\tvalue: any;\n\titem: any;\n\tindex: number;\n\trowIndex: number;\n}\n\nexport type TableDefinitionTemplateFunc = (data: TableDefinitionData) => any;\n\nexport interface TableColumnSizes {\n\tdefault: number | 'hidden' | 'full';\n\ttablet?: number | 'hidden' | 'full';\n\t'desktop-xs'?: number | 'hidden' | 'full';\n\t'desktop-sm'?: number | 'hidden' | 'full';\n\tdesktop?: number | 'hidden' | 'full';\n\t'desktop-lg'?: number | 'hidden' | 'full';\n\t'desktop-xl'?: number | 'hidden' | 'full';\n}\n\nexport type TableColumnSizesKey =\n\t| 'default'\n\t| 'tablet'\n\t| 'desktop-xs'\n\t| 'desktop-sm'\n\t| 'desktop'\n\t| 'desktop-lg'\n\t| 'desktop-xl';\n\nexport function isTableColumnSizesKey(\n\tx: TableColumnSizes,\n\tk: PropertyKey\n): k is keyof TableColumnSizes {\n\treturn k in x;\n}\n","import { cva } from 'class-variance-authority';\nimport { TableColumn } from '../components/helpers/table/column/table-column.component';\nimport {\n\tisTableColumnSizesKey,\n\tTableColumnSizes,\n\tTableColumnSizesKey,\n} from '../types';\n\nexport const getTableCellColumnClasses = (\n\tdefinition: any | TableColumn,\n\tvariant: 'default' | 'header' | 'loading'\n) => {\n\tconst sizes = definition ? getTableCellSizes(definition, variant) : {};\n\n\treturn {\n\t\t'flex flex-shrink items-center gap-4 pr-4 last-of-type:pr-0': true,\n\t\t'justify-start': !definition?.align || definition?.align === 'start',\n\t\t'justify-center': definition?.align === 'center',\n\t\t'justify-end': definition?.align === 'end',\n\t\t'font-semibold': variant !== 'header' && definition?.variant === 'subject',\n\t\t'text-storm-400 dark:text-hurricane-200': variant === 'header',\n\t\t'text-storm-300 dark:text-hurricane-200':\n\t\t\tvariant !== 'header' &&\n\t\t\tdefinition?.variant !== 'subject' &&\n\t\t\tdefinition?.variant !== 'highlight',\n\t\t'text-storm-500 dark:text-white':\n\t\t\tvariant !== 'header' &&\n\t\t\t(definition?.variant === 'subject' ||\n\t\t\t\tdefinition?.variant === 'highlight'),\n\t\t...sizes,\n\t};\n};\n\nexport const getTableCellSizes = (\n\t{\n\t\tsizes,\n\t}: {\n\t\tsizes: 'auto' | 'hidden' | 'full' | number | TableColumnSizes;\n\t} /* Table Definition */,\n\tvariant: 'default' | 'header' | 'loading' | 'actions'\n) => {\n\tif (sizes === 'auto' || !sizes) {\n\t\treturn {\n\t\t\t'w-auto': true,\n\t\t};\n\t}\n\n\tif (sizes === 'hidden') {\n\t\treturn {\n\t\t\thidden: true,\n\t\t};\n\t}\n\n\tif (typeof sizes === 'object') {\n\t\tsizes = sizes as TableColumnSizes;\n\t\tconst classes: any = {};\n\t\tlet previousSize: TableColumnSizesKey | undefined;\n\n\t\tfor (let size in sizes) {\n\t\t\tif (!isTableColumnSizesKey(sizes, size)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (size === 'default') {\n\t\t\t\tif (sizes.default === 'hidden') {\n\t\t\t\t\tclasses['hidden'] = true;\n\t\t\t\t\tpreviousSize = size;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tclasses[`w-${sizes.default}/12`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = sizes[size];\n\t\t\tconst previousValue = previousSize ? sizes[previousSize] : null;\n\t\t\tif (\n\t\t\t\tcurrentValue !== 'hidden' &&\n\t\t\t\tpreviousValue &&\n\t\t\t\tpreviousValue === 'hidden' &&\n\t\t\t\tvariant !== 'actions'\n\t\t\t) {\n\t\t\t\tclasses[`${size}:flex`] = true;\n\t\t\t}\n\n\t\t\tif (currentValue === 'hidden' && variant !== 'actions') {\n\t\t\t\tclasses[`${size}:hidden`] = true;\n\t\t\t\tpreviousSize = size;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (currentValue === 12 || currentValue === 'full') {\n\t\t\t\tclasses[`${size}:w-full`] = true;\n\t\t\t}\n\n\t\t\tclasses[`${size}:w-${currentValue}/12`] = true;\n\t\t\tpreviousSize = size;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tif (sizes === 12 || sizes === 'full') {\n\t\treturn {\n\t\t\t'w-full': true,\n\t\t};\n\t}\n\n\t// is a number.\n\treturn {\n\t\t[`w-${sizes}/12`]: true,\n\t};\n};\n\nexport const floatingMenuContainerClass = cva(['sticky self-center'], {\n\tvariants: {\n\t\thasFooter: {\n\t\t\ttrue: 'mt-4 -mb-5 bottom-11 z-[3]',\n\t\t\tfalse: 'my-4 bottom-0',\n\t\t},\n\t\tactive: {\n\t\t\tfalse: 'pointer-events-none animate-floating-menu-container-out',\n\t\t\ttrue: 'animate-floating-menu-container-in',\n\t\t},\n\t\tshown: {\n\t\t\tfalse: 'hidden',\n\t\t\ttrue: 'inline-block',\n\t\t},\n\t},\n});\n"],"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