@pine-ds/core 3.5.0 → 3.5.1
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/components/pds-table-body.js +1 -1
- package/components/pds-table-body.js.map +1 -1
- package/components/pds-table-cell2.js +2 -2
- package/components/pds-table-cell2.js.map +1 -1
- package/components/pds-table-head-cell2.js +2 -2
- package/components/pds-table-head-cell2.js.map +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-head.js.map +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-table-row.js.map +1 -1
- package/components/pds-table.js +2 -2
- package/components/pds-table.js.map +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-body.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-body.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-head.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-head.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +2 -2
- package/dist/cjs/pds-table.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-table.entry.cjs.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -1
- package/dist/collection/components/pds-table/pds-table.js +2 -2
- package/dist/collection/components/pds-table/pds-table.js.map +1 -1
- package/dist/docs.json +73 -7
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-body.entry.js.map +1 -1
- package/dist/esm/pds-table-cell.entry.js +2 -2
- package/dist/esm/pds-table-cell.entry.js.map +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +2 -2
- package/dist/esm/pds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-head.entry.js.map +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js.map +1 -1
- package/dist/esm/pds-table.entry.js +2 -2
- package/dist/esm/pds-table.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js.map +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js.map +1 -1
- package/dist/pine-core/{p-Dx9XkHH8.system.js.map → p-0TIvNV5c.system.js.map} +1 -1
- package/dist/pine-core/{p-28f7c0d8.system.entry.js → p-0de9f8da.system.entry.js} +2 -2
- package/dist/pine-core/{p-28f7c0d8.system.entry.js.map → p-0de9f8da.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-fc457c65.entry.js → p-44087d1c.entry.js} +2 -2
- package/dist/pine-core/{p-fc457c65.entry.js.map → p-44087d1c.entry.js.map} +1 -1
- package/dist/pine-core/{p-ab82338f.entry.js → p-464dd476.entry.js} +2 -2
- package/dist/pine-core/{p-ab82338f.entry.js.map → p-464dd476.entry.js.map} +1 -1
- package/dist/pine-core/{p-2e491c3d.entry.js → p-50c9e865.entry.js} +2 -2
- package/dist/pine-core/p-50c9e865.entry.js.map +1 -0
- package/dist/pine-core/p-7004d1ea.system.entry.js +2 -0
- package/dist/pine-core/p-7004d1ea.system.entry.js.map +1 -0
- package/dist/pine-core/{p-a472af99.system.entry.js → p-73158adf.system.entry.js} +2 -2
- package/dist/pine-core/{p-a472af99.system.entry.js.map → p-73158adf.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-db1956e5.entry.js → p-7cb4f0de.entry.js} +2 -2
- package/dist/pine-core/p-7cb4f0de.entry.js.map +1 -0
- package/dist/pine-core/{p-3ccb6b0c.system.entry.js → p-8999b63d.system.entry.js} +2 -2
- package/dist/pine-core/p-8999b63d.system.entry.js.map +1 -0
- package/dist/pine-core/{p-DBw5MRwj.system.js.map → p-BRygGju8.system.js.map} +1 -1
- package/dist/pine-core/{p-DZggSEPe.system.js.map → p-CE6b_LzB.system.js.map} +1 -1
- package/dist/pine-core/{p-B6Znd6C5.system.js.map → p-CpdNWpfd.system.js.map} +1 -1
- package/dist/pine-core/{p-CYiuzbNk.system.js.map → p-DHmJZxQk.system.js.map} +1 -1
- package/dist/pine-core/p-De9tROL-.system.js +1 -1
- package/dist/pine-core/{p-rBOkvo-C.system.js.map → p-IhWWc2L_.system.js.map} +1 -1
- package/dist/pine-core/{p-174506b9.entry.js → p-ac37cf0d.entry.js} +2 -2
- package/dist/pine-core/p-ac37cf0d.entry.js.map +1 -0
- package/dist/pine-core/p-be939cb0.entry.js +2 -0
- package/dist/pine-core/p-be939cb0.entry.js.map +1 -0
- package/dist/pine-core/{p-3abc0f49.system.entry.js → p-da367b5e.system.entry.js} +2 -2
- package/dist/pine-core/p-da367b5e.system.entry.js.map +1 -0
- package/dist/pine-core/{p-7d2c43df.system.entry.js → p-fd091234.system.entry.js} +2 -2
- package/dist/pine-core/p-fd091234.system.entry.js.map +1 -0
- package/dist/pine-core/pds-table-body.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-cell.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-head-cell.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-head.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table-row.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-table.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/hydrate/index.js +9 -9
- package/hydrate/index.mjs +9 -9
- package/package.json +2 -2
- package/dist/pine-core/p-174506b9.entry.js.map +0 -1
- package/dist/pine-core/p-2e491c3d.entry.js.map +0 -1
- package/dist/pine-core/p-3abc0f49.system.entry.js.map +0 -1
- package/dist/pine-core/p-3ccb6b0c.system.entry.js.map +0 -1
- package/dist/pine-core/p-487859a1.system.entry.js +0 -2
- package/dist/pine-core/p-487859a1.system.entry.js.map +0 -1
- package/dist/pine-core/p-5c0803c3.entry.js +0 -2
- package/dist/pine-core/p-5c0803c3.entry.js.map +0 -1
- package/dist/pine-core/p-7d2c43df.system.entry.js.map +0 -1
- package/dist/pine-core/p-db1956e5.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-table.entry.esm.js","sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-white);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: 10;\n}\n\n.scroll-shadow-left {\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the rowIndex and selected value.\n */\n @Event() pdsTableSelect: EventEmitter<{ rowIndex: number; isSelected: boolean }>;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentWillLoad() {\n this.sortingColumn = null;\n }\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n >\n <div class=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\">\n <div class=\"pds-table-responsive-wrapper\">\n <div class={this.classNames()}>\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n >\n <slot></slot>\n </Host>\n );\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AAW,EACpB,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAC,GAAG,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pds-table.entry.esm.js","sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-white);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: 10;\n}\n\n.scroll-shadow-left {\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the rowIndex and selected value.\n */\n @Event() pdsTableSelect: EventEmitter<{ rowIndex: number; isSelected: boolean }>;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentWillLoad() {\n this.sortingColumn = null;\n }\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table responsive-table\"\n >\n <div class=\"scroll-shadow-left\" part=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\" part=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\" part=\"responsive-container\">\n <div class=\"pds-table-responsive-wrapper\" part=\"responsive-wrapper\">\n <div class={this.classNames()} part=\"table-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,07DAA07D;;MCOj8D,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;AAOU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAC1C,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAyB,CAAA,yBAAA,GAA0B,IAAI;AACvD,QAAA,IAAmB,CAAA,mBAAA,GAAwB,IAAI;AA2BvD;;;AAGG;AACM,QAAA,IAAa,CAAA,aAAA,GAAkB,IAAI;AAE5C;;;AAGG;AACM,QAAA,IAAgB,CAAA,gBAAA,GAAmB,KAAK;AA0PlD;IA7OC,iBAAiB,GAAA;AACf,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI;;IAG3B,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,wBAAwB,EAAE;;;IAInC,oBAAoB,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC5B,IAAI,CAAC,mBAAmB,EAAE;AAC1B,YAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI;;;AAInC;;;;;;;;;;;;;;;AAeG;IACK,wBAAwB,GAAA;;AAC9B,QAAA,MAAM,SAAS,GAAG,CAAA,EAAA,GAAA,IA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B,EAAC,IAAI,EAAC,qBAAqB,EAAO,CAAA,EAClE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,gCAAgC,EAAC,IAAI,EAAC,sBAAsB,EAAA,EACrE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAC,IAAI,EAAC,oBAAoB,EAAA,EACjE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,aAAa,EAAA,EAC/C,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,CACF,CACF,CACD;;QAIX,QACE,CAAA,CAAC,IAAI,EAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAC,GAAG,EACZ,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as n}from"./p-BVCWKPy3.js";export{s as setNonce}from"./p-BVCWKPy3.js";import{g as o}from"./p-DQuL1Twl.js";var a=()=>{const n=import.meta.url;const o={};if(n!==""){o.resourcesUrl=new URL(".",n).href}return e(o)};a().then((async e=>{await o();return n([["p-5a709348",[[1,"pds-alert",{componentId:[1,"component-id"],heading:[1],small:[4],dismissible:[4],variant:[1],hasActionsContent:[32]}]]],["p-503cab1f",[[1,"pds-copytext",{border:[516],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]}]]],["p-
|
|
1
|
+
import{p as e,b as n}from"./p-BVCWKPy3.js";export{s as setNonce}from"./p-BVCWKPy3.js";import{g as o}from"./p-DQuL1Twl.js";var a=()=>{const n=import.meta.url;const o={};if(n!==""){o.resourcesUrl=new URL(".",n).href}return e(o)};a().then((async e=>{await o();return n([["p-5a709348",[[1,"pds-alert",{componentId:[1,"component-id"],heading:[1],small:[4],dismissible:[4],variant:[1],hasActionsContent:[32]}]]],["p-503cab1f",[[1,"pds-copytext",{border:[516],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]}]]],["p-464dd476",[[1,"pds-table-head",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["p-44087d1c",[[1,"pds-table-row",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["p-47670150",[[1,"pds-combobox",{componentId:[1,"component-id"],customOptionLayouts:[4,"custom-option-layouts"],customTriggerContent:[4,"custom-trigger-content"],disabled:[4],dropdownPlacement:[1,"dropdown-placement"],dropdownWidth:[1,"dropdown-width"],hideLabel:[4,"hide-label"],label:[1],maxHeight:[1,"max-height"],mode:[1],placeholder:[1],trigger:[1],triggerWidth:[1,"trigger-width"],triggerVariant:[1,"trigger-variant"],value:[1025],filteredOptions:[32],highlightedIndex:[32],isOpen:[32],selectedOption:[32],selectedOptionLayoutContent:[32],setFocus:[64],getSelectedValue:[64]},null,{value:["handleValueChange"],selectedOption:["handleSelectedOptionChange"]}]]],["p-e8d76117",[[1,"pds-dropdown-menu-item",{componentId:[1,"component-id"],destructive:[4],disabled:[4],href:[1],hasFocus:[32],clickItem:[64]}]]],["p-5708f95a",[[1,"pds-property",{componentId:[1,"component-id"],icon:[1]}]]],["p-5e8badb9",[[1,"pds-accordion",{componentId:[1,"component-id"],isOpen:[1540,"open"]},null,{isOpen:["handleOpenState"]}]]],["p-c8122bea",[[1,"pds-avatar",{alt:[1],badge:[4],componentId:[1,"component-id"],dropdown:[4],image:[1],size:[513],variant:[513]}]]],["p-4deb7b8c",[[1,"pds-chip",{componentId:[1,"component-id"],dot:[4],icon:[1],large:[4],sentiment:[1],variant:[1]}]]],["p-8d7abc83",[[1,"pds-dropdown-menu",{componentId:[1,"component-id"],placement:[1],currentFocusIndex:[32]},[[8,"keydown","handleKeyDown"],[8,"click","handleWindowClick"]]]]],["p-4bbf3e31",[[65,"pds-input",{autocomplete:[1],componentId:[1,"component-id"],debounce:[2],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],hideLabel:[4,"hide-label"],max:[1],maxlength:[1],min:[1],minlength:[1],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],step:[1],type:[1],value:[1032],fullWidth:[4,"full-width"],hasPrefix:[32],hasSuffix:[32],hasPrepend:[32],hasAppend:[32],hasAction:[32],hasFocus:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["p-98fe56d9",[[2,"pds-radio",{checked:[4],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]}]]],["p-00616fc9",[[65,"pds-select",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],hideLabel:[4,"hide-label"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],multiple:[4],name:[1],required:[4],value:[1025]},null,{value:["valueChanged"]}]]],["p-52d37cc1",[[6,"pds-sortable-item",{enableActions:[4,"enable-actions"],componentId:[1,"component-id"],showHandle:[1028,"show-handle"]}]]],["p-ba187a35",[[65,"pds-switch",{componentId:[1,"component-id"],checked:[1028],disabled:[4],errorMessage:[1,"error-message"],hideLabel:[4,"hide-label"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],name:[1],required:[4],value:[1]},null,{checked:["checkedChanged"]}]]],["p-e5ca5b8e",[[65,"pds-textarea",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],debounce:[2],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[1028],label:[1],hideLabel:[4,"hide-label"],name:[1],placeholder:[1],readonly:[4],required:[4],rows:[2],value:[1025],hasFocus:[32],hasAction:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["p-11d4036e",[[1,"pds-toast",{componentId:[1,"component-id"],dismissible:[4],duration:[2],icon:[1],type:[1],isVisible:[32],isAnimatingOut:[32],dismiss:[64]},null,{duration:["handleDurationChange"]}]]],["p-fb4058e6",[[4,"mock-pds-modal",{componentId:[1,"component-id"],size:[1],backdropDismiss:[4,"backdrop-dismiss"],open:[1028],showModal:[64],hideModal:[64]}]]],["p-0066d249",[[1,"pds-divider",{componentId:[1,"component-id"],offset:[1],vertical:[4]}]]],["p-a54f1d9e",[[1,"pds-dropdown-menu-separator",{componentId:[1,"component-id"],disabled:[4]}]]],["p-66b10d29",[[1,"pds-image",{alt:[1],componentId:[1,"component-id"],height:[2],loading:[1],sizes:[1],src:[1],srcset:[1],width:[2]}]]],["p-a24c46e4",[[4,"pds-modal",{backdropDismiss:[4,"backdrop-dismiss"],componentId:[1,"component-id"],open:[1028],size:[1],focusableElementsArray:[32],showModal:[64],hideModal:[64]},null,{open:["handleOpenChange"]}]]],["p-c6badcf8",[[4,"pds-modal-content",{border:[513],contentMaxHeight:[32]}]]],["p-232a2043",[[4,"pds-modal-footer"]]],["p-efa788ea",[[4,"pds-modal-header"]]],["p-6f4a6d0b",[[1,"pds-popover",{popoverTargetAction:[1,"popover-target-action"],popoverType:[1,"popover-type"],componentId:[1,"component-id"],text:[1],maxWidth:[2,"max-width"],placement:[513],active:[32]},[[2,"click","handleClick"],[11,"scroll","handleScroll"]]]]],["p-b6ea3332",[[1,"pds-progress",{animated:[4],componentId:[1,"component-id"],fillColor:[1,"fill-color"],label:[1],percent:[2],showPercent:[4,"show-percent"]}]]],["p-79e2782b",[[0,"pds-row",{alignItems:[1,"align-items"],border:[4],colGap:[1,"col-gap"],componentId:[1,"component-id"],justifyContent:[1,"justify-content"],minHeight:[1,"min-height"],noWrap:[4,"no-wrap"]}]]],["p-72053224",[[6,"pds-sortable",{border:[516],componentId:[1,"component-id"],dividers:[516],handleType:[1,"handle-type"]}]]],["p-77336705",[[4,"pds-tab",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],index:[2],selected:[4]}]]],["p-ac37cf0d",[[1,"pds-table",{compact:[4],componentId:[1,"component-id"],responsive:[4],fixedColumn:[4,"fixed-column"],selectable:[4],sortingColumn:[32],sortingDirection:[32]},[[0,"pdsTableSort","handleTableSort"],[0,"pdsTableSelectAll","handleTableSelectAll"],[0,"pdsTableRowSelected","handleTableSelect"]]]]],["p-be939cb0",[[1,"pds-table-body"]]],["p-f880adaa",[[4,"pds-tabpanel",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],selected:[1028]}]]],["p-651861ff",[[1,"pds-tabs",{tablistLabel:[1,"tablist-label"],componentId:[1,"component-id"],variant:[1],activeTabName:[1025,"active-tab-name"],activeTabIndex:[1026,"active-tab-index"]},[[16,"pdsTabClick","tabClickHandler"],[0,"keydown","handleKeyDown"]]]]],["p-02326ac3",[[4,"pds-tooltip",{content:[1],componentId:[1,"component-id"],hasArrow:[4,"has-arrow"],htmlContent:[4,"html-content"],placement:[513],maxWidth:[1,"max-width"],opened:[1540],_isInteractiveOpen:[32],showTooltip:[64],hideTooltip:[64]},null,{opened:["handleOpenToggle"]}]]],["p-68b5665a",[[1,"pds-button",{componentId:[1,"component-id"],disabled:[4],fullWidth:[4,"full-width"],href:[1],icon:[1],iconOnly:[4,"icon-only"],loading:[4],name:[1],target:[1],type:[1],value:[1],variant:[1]}]]],["p-349a8869",[[1,"pds-link",{color:[1],componentId:[1,"component-id"],external:[4],variant:[1],fontSize:[1,"font-size"],href:[1]}]]],["p-7cb4f0de",[[1,"pds-table-head-cell",{cellAlign:[1,"cell-align"],sortable:[4],sortingDirection:[32],tableScrolling:[32],isSelected:[32]}]]],["p-50c9e865",[[1,"pds-table-cell",{cellAlign:[1,"cell-align"],truncate:[4],tableScrolling:[32]}]]],["p-e2887e78",[[1,"pds-text",{align:[1],color:[1],decoration:[1],gutter:[1],italic:[4],size:[1],weight:[1],tag:[1],truncate:[516]}]]],["p-25190921",[[65,"pds-checkbox",{checked:[1028],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],indeterminate:[1028],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]},null,{checked:["updateIndeterminate","checkedChanged"]}]]],["p-f583e5d4",[[1,"pds-loader",{isLoading:[4,"is-loading"],showLabel:[4,"show-label"],size:[513],variant:[1]}]]],["p-0d9e28a2",[[0,"pds-box",{alignItems:[1,"align-items"],alignSelf:[1,"align-self"],auto:[4],backgroundColor:[1,"background-color"],border:[4],borderColor:[1,"border-color"],borderRadius:[1,"border-radius"],direction:[1],display:[1],fit:[4],gap:[1],wrap:[4],flex:[1],justifyContent:[1,"justify-content"],marginBlockStart:[1,"margin-block-start"],marginInlineStart:[1,"margin-inline-start"],marginInlineEnd:[1,"margin-inline-end"],marginBlockEnd:[1,"margin-block-end"],minHeight:[1,"min-height"],minWidth:[1,"min-width"],offset:[1],offsetXs:[1,"offset-xs"],offsetSm:[1,"offset-sm"],offsetMd:[1,"offset-md"],offsetLg:[1,"offset-lg"],offsetXl:[1,"offset-xl"],padding:[1],paddingBlockStart:[1,"padding-block-start"],paddingBlockEnd:[1,"padding-block-end"],paddingInlineStart:[1,"padding-inline-start"],paddingInlineEnd:[1,"padding-inline-end"],shadow:[1],size:[1],sizeXs:[1,"size-xs"],sizeSm:[1,"size-sm"],sizeMd:[1,"size-md"],sizeLg:[1,"size-lg"],sizeXl:[1,"size-xl"]}]]],["p-075eecf9",[[1,"pds-icon",{color:[1],flipRtl:[4,"flip-rtl"],icon:[8],name:[513],size:[513],src:[1],ariaLabel:[32],isVisible:[32],svgContent:[32]},null,{size:["updateStyles"],color:["updateStyles"],name:["onIconPropertyChange"],src:["onIconPropertyChange"],icon:["onIconPropertyChange"]}]]]],e)}));
|
|
2
2
|
//# sourceMappingURL=pine-core.esm.js.map
|
package/hydrate/index.js
CHANGED
|
@@ -12800,9 +12800,9 @@ class PdsTable {
|
|
|
12800
12800
|
}
|
|
12801
12801
|
render() {
|
|
12802
12802
|
if (this.responsive) {
|
|
12803
|
-
return (hAsync(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, hAsync("div", { class: "scroll-shadow-left" }), hAsync("div", { class: "scroll-shadow-right" }), hAsync("div", { class: "pds-table-responsive-container" }, hAsync("div", { class: "pds-table-responsive-wrapper" }, hAsync("div", { class: this.classNames() }, hAsync("slot", null))))));
|
|
12803
|
+
return (hAsync(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table responsive-table" }, hAsync("div", { class: "scroll-shadow-left", part: "scroll-shadow-left" }), hAsync("div", { class: "scroll-shadow-right", part: "scroll-shadow-right" }), hAsync("div", { class: "pds-table-responsive-container", part: "responsive-container" }, hAsync("div", { class: "pds-table-responsive-wrapper", part: "responsive-wrapper" }, hAsync("div", { class: this.classNames(), part: "table-inner" }, hAsync("slot", null))))));
|
|
12804
12804
|
}
|
|
12805
|
-
return (hAsync(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, hAsync("slot", null)));
|
|
12805
|
+
return (hAsync(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table" }, hAsync("slot", null)));
|
|
12806
12806
|
}
|
|
12807
12807
|
get el() { return getElement(this); }
|
|
12808
12808
|
static get style() { return pdsTableCss; }
|
|
@@ -12831,7 +12831,7 @@ class PdsTableBody {
|
|
|
12831
12831
|
registerInstance(this, hostRef);
|
|
12832
12832
|
}
|
|
12833
12833
|
render() {
|
|
12834
|
-
return (hAsync(Host, { key: '
|
|
12834
|
+
return (hAsync(Host, { key: '7aa581f9cd4c798a5699664ca9639ec7e412a891', role: "rowgroup", part: "body" }, hAsync("slot", { key: 'c06f2431044e64d934ee302e5c6fffbdaf0051c7' })));
|
|
12835
12835
|
}
|
|
12836
12836
|
static get style() { return pdsTableBodyCss; }
|
|
12837
12837
|
static get cmpMeta() { return {
|
|
@@ -12942,11 +12942,11 @@ class PdsTableCell {
|
|
|
12942
12942
|
return classNames.join(' ');
|
|
12943
12943
|
}
|
|
12944
12944
|
render() {
|
|
12945
|
-
return (hAsync(Host, { key: '
|
|
12945
|
+
return (hAsync(Host, { key: 'eb6a58e7e294593a35b77f00d787fee3b2b03661', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
|
|
12946
12946
|
this.tableRef.fixedColumn &&
|
|
12947
12947
|
this.tableRef.selectable
|
|
12948
12948
|
? { '--fixed-cell-position': '40px' }
|
|
12949
|
-
: {} }, hAsync("slot", { key: '
|
|
12949
|
+
: {} }, hAsync("slot", { key: 'c83fc4dda70196bf1032544353af058bc1a0decf' })));
|
|
12950
12950
|
}
|
|
12951
12951
|
get hostElement() { return getElement(this); }
|
|
12952
12952
|
static get style() { return pdsTableCellCss; }
|
|
@@ -13008,7 +13008,7 @@ class PdsTableHead {
|
|
|
13008
13008
|
}
|
|
13009
13009
|
}
|
|
13010
13010
|
render() {
|
|
13011
|
-
return (hAsync(Host, { key: '
|
|
13011
|
+
return (hAsync(Host, { key: 'dda71d591ccce76bdb055820c1c97358e545b522', role: "row", part: "head" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-head-cell", { key: '79bf1bd06b8e1ef05c9354c178787b4cff139e07', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, hAsync("pds-checkbox", { key: '1ce038a3f3b9e038441fdf4b1d1fe4689f575604', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected, part: "select-all-checkbox" }))), hAsync("slot", { key: 'f81d3922f892faa65abee99fd5af0d3232a25e9a' })));
|
|
13012
13012
|
}
|
|
13013
13013
|
get hostElement() { return getElement(this); }
|
|
13014
13014
|
static get style() { return pdsTableHeadCss; }
|
|
@@ -13147,11 +13147,11 @@ class PdsTableHeadCell {
|
|
|
13147
13147
|
return classNames.join(' ');
|
|
13148
13148
|
}
|
|
13149
13149
|
render() {
|
|
13150
|
-
return (hAsync(Host, { key: '
|
|
13150
|
+
return (hAsync(Host, { key: 'f3b04da28997f6f471f6945e0cfac098dc1a6428', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, part: "head-cell", style: this.tableRef &&
|
|
13151
13151
|
this.tableRef.fixedColumn &&
|
|
13152
13152
|
this.tableRef.selectable
|
|
13153
13153
|
? { '--fixed-cell-position': '40px' }
|
|
13154
|
-
: {} }, hAsync("slot", { key: '
|
|
13154
|
+
: {} }, hAsync("slot", { key: '832373d831d5f250f7427bf0a1f2756e0ce56ea9' }), this.sortable && (hAsync("pds-icon", { key: '1886880fa50da3415b80a0abd8d571ca7350ca23', icon: this.sortingDirection === 'asc' ? upSmall : downSmall, part: "sort-icon" }))));
|
|
13155
13155
|
}
|
|
13156
13156
|
get hostElement() { return getElement(this); }
|
|
13157
13157
|
static get style() { return pdsTableHeadCellCss; }
|
|
@@ -13218,7 +13218,7 @@ class PdsTableRow {
|
|
|
13218
13218
|
}
|
|
13219
13219
|
}
|
|
13220
13220
|
render() {
|
|
13221
|
-
return (hAsync(Host, { key: '
|
|
13221
|
+
return (hAsync(Host, { key: '45de7019e5fe44cd27a02450205cf96429072db3', class: this.classNames(), role: "row", part: "row" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-cell", { key: '770cf9bcfff13b8de986d42f6ad6c249b4259191', part: this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell', class: this.tableRef.selectable ? 'has-checkbox' : '' }, hAsync("pds-checkbox", { key: '5a1e28f23dda779862a310d83308396e14a839d6', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected, part: "row-checkbox" }))), hAsync("slot", { key: '7dd5716693ad855d1f072f0af9013ca4383bab5e' })));
|
|
13222
13222
|
}
|
|
13223
13223
|
get hostElement() { return getElement(this); }
|
|
13224
13224
|
static get style() { return pdsTableRowCss; }
|
package/hydrate/index.mjs
CHANGED
|
@@ -12798,9 +12798,9 @@ class PdsTable {
|
|
|
12798
12798
|
}
|
|
12799
12799
|
render() {
|
|
12800
12800
|
if (this.responsive) {
|
|
12801
|
-
return (hAsync(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, hAsync("div", { class: "scroll-shadow-left" }), hAsync("div", { class: "scroll-shadow-right" }), hAsync("div", { class: "pds-table-responsive-container" }, hAsync("div", { class: "pds-table-responsive-wrapper" }, hAsync("div", { class: this.classNames() }, hAsync("slot", null))))));
|
|
12801
|
+
return (hAsync(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table responsive-table" }, hAsync("div", { class: "scroll-shadow-left", part: "scroll-shadow-left" }), hAsync("div", { class: "scroll-shadow-right", part: "scroll-shadow-right" }), hAsync("div", { class: "pds-table-responsive-container", part: "responsive-container" }, hAsync("div", { class: "pds-table-responsive-wrapper", part: "responsive-wrapper" }, hAsync("div", { class: this.classNames(), part: "table-inner" }, hAsync("slot", null))))));
|
|
12802
12802
|
}
|
|
12803
|
-
return (hAsync(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, hAsync("slot", null)));
|
|
12803
|
+
return (hAsync(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table" }, hAsync("slot", null)));
|
|
12804
12804
|
}
|
|
12805
12805
|
get el() { return getElement(this); }
|
|
12806
12806
|
static get style() { return pdsTableCss; }
|
|
@@ -12829,7 +12829,7 @@ class PdsTableBody {
|
|
|
12829
12829
|
registerInstance(this, hostRef);
|
|
12830
12830
|
}
|
|
12831
12831
|
render() {
|
|
12832
|
-
return (hAsync(Host, { key: '
|
|
12832
|
+
return (hAsync(Host, { key: '7aa581f9cd4c798a5699664ca9639ec7e412a891', role: "rowgroup", part: "body" }, hAsync("slot", { key: 'c06f2431044e64d934ee302e5c6fffbdaf0051c7' })));
|
|
12833
12833
|
}
|
|
12834
12834
|
static get style() { return pdsTableBodyCss; }
|
|
12835
12835
|
static get cmpMeta() { return {
|
|
@@ -12940,11 +12940,11 @@ class PdsTableCell {
|
|
|
12940
12940
|
return classNames.join(' ');
|
|
12941
12941
|
}
|
|
12942
12942
|
render() {
|
|
12943
|
-
return (hAsync(Host, { key: '
|
|
12943
|
+
return (hAsync(Host, { key: 'eb6a58e7e294593a35b77f00d787fee3b2b03661', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
|
|
12944
12944
|
this.tableRef.fixedColumn &&
|
|
12945
12945
|
this.tableRef.selectable
|
|
12946
12946
|
? { '--fixed-cell-position': '40px' }
|
|
12947
|
-
: {} }, hAsync("slot", { key: '
|
|
12947
|
+
: {} }, hAsync("slot", { key: 'c83fc4dda70196bf1032544353af058bc1a0decf' })));
|
|
12948
12948
|
}
|
|
12949
12949
|
get hostElement() { return getElement(this); }
|
|
12950
12950
|
static get style() { return pdsTableCellCss; }
|
|
@@ -13006,7 +13006,7 @@ class PdsTableHead {
|
|
|
13006
13006
|
}
|
|
13007
13007
|
}
|
|
13008
13008
|
render() {
|
|
13009
|
-
return (hAsync(Host, { key: '
|
|
13009
|
+
return (hAsync(Host, { key: 'dda71d591ccce76bdb055820c1c97358e545b522', role: "row", part: "head" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-head-cell", { key: '79bf1bd06b8e1ef05c9354c178787b4cff139e07', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, hAsync("pds-checkbox", { key: '1ce038a3f3b9e038441fdf4b1d1fe4689f575604', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected, part: "select-all-checkbox" }))), hAsync("slot", { key: 'f81d3922f892faa65abee99fd5af0d3232a25e9a' })));
|
|
13010
13010
|
}
|
|
13011
13011
|
get hostElement() { return getElement(this); }
|
|
13012
13012
|
static get style() { return pdsTableHeadCss; }
|
|
@@ -13145,11 +13145,11 @@ class PdsTableHeadCell {
|
|
|
13145
13145
|
return classNames.join(' ');
|
|
13146
13146
|
}
|
|
13147
13147
|
render() {
|
|
13148
|
-
return (hAsync(Host, { key: '
|
|
13148
|
+
return (hAsync(Host, { key: 'f3b04da28997f6f471f6945e0cfac098dc1a6428', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, part: "head-cell", style: this.tableRef &&
|
|
13149
13149
|
this.tableRef.fixedColumn &&
|
|
13150
13150
|
this.tableRef.selectable
|
|
13151
13151
|
? { '--fixed-cell-position': '40px' }
|
|
13152
|
-
: {} }, hAsync("slot", { key: '
|
|
13152
|
+
: {} }, hAsync("slot", { key: '832373d831d5f250f7427bf0a1f2756e0ce56ea9' }), this.sortable && (hAsync("pds-icon", { key: '1886880fa50da3415b80a0abd8d571ca7350ca23', icon: this.sortingDirection === 'asc' ? upSmall : downSmall, part: "sort-icon" }))));
|
|
13153
13153
|
}
|
|
13154
13154
|
get hostElement() { return getElement(this); }
|
|
13155
13155
|
static get style() { return pdsTableHeadCellCss; }
|
|
@@ -13216,7 +13216,7 @@ class PdsTableRow {
|
|
|
13216
13216
|
}
|
|
13217
13217
|
}
|
|
13218
13218
|
render() {
|
|
13219
|
-
return (hAsync(Host, { key: '
|
|
13219
|
+
return (hAsync(Host, { key: '45de7019e5fe44cd27a02450205cf96429072db3', class: this.classNames(), role: "row", part: "row" }, this.tableRef && this.tableRef.selectable && (hAsync("pds-table-cell", { key: '770cf9bcfff13b8de986d42f6ad6c249b4259191', part: this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell', class: this.tableRef.selectable ? 'has-checkbox' : '' }, hAsync("pds-checkbox", { key: '5a1e28f23dda779862a310d83308396e14a839d6', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected, part: "row-checkbox" }))), hAsync("slot", { key: '7dd5716693ad855d1f072f0af9013ca4383bab5e' })));
|
|
13220
13220
|
}
|
|
13221
13221
|
get hostElement() { return getElement(this); }
|
|
13222
13222
|
static get style() { return pdsTableRowCss; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pine-ds/core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Base components for Pine Design System",
|
|
6
6
|
"author": "Kajabi Design System Services",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@babel/core": "^7.19.3",
|
|
69
69
|
"@babel/preset-env": "^7.22.10",
|
|
70
70
|
"@chromatic-com/storybook": "^3.2.2",
|
|
71
|
-
"@pine-ds/doc-components": "^3.5.
|
|
71
|
+
"@pine-ds/doc-components": "^3.5.1",
|
|
72
72
|
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
73
73
|
"@stencil-community/eslint-plugin": "^0.5.0",
|
|
74
74
|
"@stencil/react-output-target": "^0.5.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableCss","PdsTable","constructor","hostRef","this","scrollContainer","_responsiveHandleScroll","_responsiveHandleResize","_responsiveResizeObserver","_teardownResponsive","sortingColumn","sortingDirection","componentWillLoad","componentDidLoad","responsive","setupResponsiveScrolling","disconnectedCallback","container","_a","el","shadowRoot","querySelector","leftShadow","_b","rightShadow","_c","scrollLeft","maxScrollLeft","scrollWidth","clientWidth","style","opacity","fixedColumn","addEventListener","passive","window","ResizeObserver","call","observe","error","removeEventListener","disconnect","classNames","compact","push","join","sortTable","column","direction","tableBody","tableRows","Array","from","querySelectorAll","columnHeaderCells","columnHeaderCell","find","cell","innerText","trim","console","warn","columnIndex","indexOf","sort","a","b","valueA","textContent","valueB","localeCompare","undefined","sensitivity","innerHTML","forEach","row","appendChild","handleTableSort","event","detail","handleTableSelectAll","defaultPrevented","pdsTableBody","isSelected","handleTableSelect","allTableRows","allSelectedRows","every","noneSelectedRows","pdsTableHead","headerCheckbox","checked","indeterminate","render","h","Host","class","id","componentId","role","selectable","tabindex"],"sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-white);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: 10;\n}\n\n.scroll-shadow-left {\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the rowIndex and selected value.\n */\n @Event() pdsTableSelect: EventEmitter<{ rowIndex: number; isSelected: boolean }>;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentWillLoad() {\n this.sortingColumn = null;\n }\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n >\n <div class=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\">\n <div class=\"pds-table-responsive-wrapper\">\n <div class={this.classNames()}>\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAc,y7D,MCOPC,EAAQ,MALrB,WAAAC,CAAAC,G,0GAOUC,KAAeC,gBAAuB,KACtCD,KAAuBE,wBAAwB,KAC/CF,KAAuBG,wBAAwB,KAC/CH,KAAyBI,0BAA0B,KACnDJ,KAAmBK,oBAAwB,KA+B1CL,KAAaM,cAAkB,KAM/BN,KAAgBO,iBAAmB,KAwP7C,CA3OC,iBAAAC,GACER,KAAKM,cAAgB,I,CAGvB,gBAAAG,GACE,GAAIT,KAAKU,WAAY,CACnBV,KAAKW,0B,EAIT,oBAAAC,GACE,GAAIZ,KAAKK,oBAAqB,CAC5BL,KAAKK,sBACLL,KAAKK,oBAAsB,I,EAoBvB,wBAAAM,G,UACN,MAAME,GAAYC,EAAAd,KAAKe,GAAGC,cAAY,MAAAF,SAAA,SAAAA,EAAAG,cAAc,mCACpD,MAAMC,GAAaC,EAAAnB,KAAKe,GAAGC,cAAY,MAAAG,SAAA,SAAAA,EAAAF,cAAc,uBACrD,MAAMG,GAAcC,EAAArB,KAAKe,GAAGC,cAAY,MAAAK,SAAA,SAAAA,EAAAJ,cAAc,wBAEtD,IAAKJ,IAAcK,IAAeE,EAAa,OAG/CpB,KAAKC,gBAAkBY,EAOvBb,KAAKE,wBAA0B,KAC7B,IAAKF,KAAKC,gBAAiB,OAE3B,MAAMqB,EAAatB,KAAKC,gBAAgBqB,WACxC,MAAMC,EAAgBvB,KAAKC,gBAAgBuB,YAAcxB,KAAKC,gBAAgBwB,YAG9EP,EAAWQ,MAAMC,QAAWL,EAAa,IAAMtB,KAAK4B,YAAe,IAAM,IAGzER,EAAYM,MAAMC,QAAWJ,EAAgB,GAAKD,EAAaC,EAAgB,EAAK,IAAM,GAAG,EAI/FvB,KAAKC,g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KoE,EAAc,OAEnB,MAAMC,EAAiBD,EAAarE,WAAWC,cAAc,gBAC7DqE,EAAeC,QAAUL,EACzBI,EAAeE,eAAiBN,IAAoBE,C,CAGtD,MAAAK,GACE,GAAIzF,KAAKU,WAAY,CACnB,OACEgF,EAACC,EACC,CAAAC,MAAM,oDACNC,GAAI7F,KAAK8F,YACTC,KAAK,OACLC,WAAYhG,KAAKgG,WACjBC,SAAS,KAETP,EAAK,OAAAE,MAAM,uBACXF,EAAK,OAAAE,MAAM,wBACXF,EAAK,OAAAE,MAAM,kCACTF,EAAK,OAAAE,MAAM,gCACTF,EAAA,OAAKE,MAAO5F,KAAKsC,cACfoD,EAAA,gB,CAQZ,OACEA,EAACC,EAAI,CACHC,MAAO5F,KAAKsC,aACZuD,GAAI7F,KAAK8F,YACTC,KAAK,OACLC,WAAYhG,KAAKgG,WACjBC,SAAS,KAETP,EAAa,a","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableCellCss","PdsTableCell","constructor","hostRef","this","scrollContainer","setupRetries","tableScrolling","handleScroll","scrollLeft","error","console","warn","componentWillRender","tableRef","hostElement","closest","componentDidLoad","responsive","fixedColumn","setupScrollListener","disconnectedCallback","cleanupScrollListener","container","_a","shadowRoot","querySelector","addEventListener","passive","setupTimer","window","setTimeout","removeEventListener","undefined","clearTimeout","classNames","compact","push","cellAlign","truncate","join","render","h","Host","key","class","role","style","selectable"],"sources":["src/components/pds-table/pds-table-cell/pds-table-cell.scss?tag=pds-table-cell&encapsulation=shadow","src/components/pds-table/pds-table-cell/pds-table-cell.tsx"],"sourcesContent":[":host {\n --box-shadow-fixed: 3px 3px 6px -2px rgba(0, 0, 0, 0.2);\n\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n inset-inline-start: var(--pine-dimension-none);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-sm);\n vertical-align: inherit;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: 0;\n position: sticky;\n z-index: 1;\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-fixed);\n}\n\n:host(.is-truncated) {\n max-width: 100px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host(.has-checkbox) {\n vertical-align: middle;\n width: 16px;\n}\n\n// Text Alignment\n:host(.pds-table-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-table-cell',\n styleUrls: ['pds-table-cell.scss'],\n shadow: true,\n})\nexport class PdsTableCell {\n @Element() hostElement: HTMLPdsTableCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Sets the text alignment within the cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Truncates content to a max width of 100px and adds an ellipsis.\n */\n @Prop() truncate: boolean;\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-cell--align-${this.cellAlign}`);\n }\n\n if (this.truncate) {\n classNames.push('is-truncated');\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"gridcell\"\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,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MAAMA,EAAa,GAEnB,GAAI/B,KAAKU,UAAYV,KAAKU,SAASsB,QAAS,CAC1CD,EAAWE,KAAK,a,CAGlB,GAAIjC,KAAKkC,UAAW,CAClBH,EAAWE,KAAK,yBAAyBjC,KAAKkC,Y,CAGhD,GAAIlC,KAAKmC,SAAU,CACjBJ,EAAWE,KAAK,e,CAGlB,GAAIjC,KAAKU,UAAYV,KAAKU,SAASK,aAAef,KAAKG,eAAgB,CACrE4B,EAAWE,KAAK,e,CAGlB,OAAOF,EAAWK,KAAK,I,CAoBzB,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAOzC,KAAK+B,aACZW,KAAK,WACLC,MACE3C,KAAKU,UACLV,KAAKU,SAASK,aACdf,KAAKU,SAASkC,WACV,CAAE,wBAAyB,QAC3B,IAGNN,EAAa,QAAAE,IAAA,6C","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableCellCss","PdsTableCell","exports","class_1","hostRef","_this","this","scrollContainer","setupRetries","tableScrolling","handleScroll","scrollLeft","error","console","warn","prototype","componentWillRender","tableRef","hostElement","closest","componentDidLoad","responsive","fixedColumn","setupScrollListener","disconnectedCallback","cleanupScrollListener","container","_a","shadowRoot","querySelector","addEventListener","passive","setupTimer","window","setTimeout","removeEventListener","undefined","clearTimeout","classNames","compact","push","cellAlign","concat","truncate","join","render","h","Host","key","class","role","style","selectable"],"sources":["src/components/pds-table/pds-table-cell/pds-table-cell.scss?tag=pds-table-cell&encapsulation=shadow","src/components/pds-table/pds-table-cell/pds-table-cell.tsx"],"sourcesContent":[":host {\n --box-shadow-fixed: 3px 3px 6px -2px rgba(0, 0, 0, 0.2);\n\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n inset-inline-start: var(--pine-dimension-none);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-sm);\n vertical-align: inherit;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: 0;\n position: sticky;\n z-index: 1;\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-fixed);\n}\n\n:host(.is-truncated) {\n max-width: 100px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host(.has-checkbox) {\n vertical-align: middle;\n width: 16px;\n}\n\n// Text Alignment\n:host(.pds-table-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-table-cell',\n styleUrls: ['pds-table-cell.scss'],\n shadow: true,\n})\nexport class PdsTableCell {\n @Element() hostElement: HTMLPdsTableCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Sets the text alignment within the cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Truncates content to a max width of 100px and adds an ellipsis.\n */\n @Prop() truncate: boolean;\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-cell--align-${this.cellAlign}`);\n }\n\n if (this.truncate) {\n classNames.push('is-truncated');\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"gridcell\"\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"0JAAA,IAA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,aAAeI,UAAW,CACjCH,OAAOI,aAAa/B,KAAK0B,YACzB1B,KAAK0B,WAAaI,S,CAGpB9B,KAAKE,aAAe,C,EAmBdL,EAAAY,UAAAuB,WAAA,WACN,IAAMA,EAAa,GAEnB,GAAIhC,KAAKW,UAAYX,KAAKW,SAASsB,QAAS,CAC1CD,EAAWE,KAAK,a,CAGlB,GAAIlC,KAAKmC,UAAW,CAClBH,EAAWE,KAAK,yBAAAE,OAAyBpC,KAAKmC,W,CAGhD,GAAInC,KAAKqC,SAAU,CACjBL,EAAWE,KAAK,e,CAGlB,GAAIlC,KAAKW,UAAYX,KAAKW,SAASK,aAAehB,KAAKG,eAAgB,CACrE6B,EAAWE,KAAK,e,CAGlB,OAAOF,EAAWM,KAAK,I,EAoBzBzC,EAAAY,UAAA8B,OAAA,WACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO3C,KAAKgC,aACZY,KAAK,WACLC,MACE7C,KAAKW,UACLX,KAAKW,SAASK,aACdhB,KAAKW,SAASmC,WACV,CAAE,wBAAyB,QAC3B,IAGNN,EAAa,QAAAE,IAAA,6C,gIAnII,I","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableHeadCellCss","PdsTableHeadCell","exports","class_1","hostRef","_this","this","scrollContainer","setupRetries","sortingDirection","tableScrolling","isSelected","handleScroll","scrollLeft","error","console","warn","toggleSort","sortable","column","hostElement","innerText","trim","tableRef","querySelectorAll","forEach","headCell","classList","remove","toggle","pdsTableSort","emit","direction","prototype","componentWillRender","closest","componentDidLoad","responsive","fixedColumn","setupScrollListener","disconnectedCallback","cleanupScrollListener","container","_a","shadowRoot","querySelector","addEventListener","passive","setupTimer","window","setTimeout","removeEventListener","undefined","clearTimeout","classNames","compact","push","cellAlign","concat","join","render","h","Host","key","class","role","onClick","style","selectable","icon","upSmall","downSmall"],"sources":["src/components/pds-table/pds-table-head-cell/pds-table-head-cell.scss?tag=pds-table-head-cell&encapsulation=shadow","src/components/pds-table/pds-table-head-cell/pds-table-head-cell.tsx"],"sourcesContent":[":host {\n --border-head-cell-default: var(--pine-border-width-thin) solid var(--pine-color-grey-100);\n\n --box-shadow-default: 3px 3px 6px -2px rgba(0, 0, 0, 0.1);\n\n border-block-end: var(--border-head-cell-default);\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-150);\n position: relative;\n text-align: start;\n vertical-align: inherit;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-default);\n}\n\n:host(.is-sortable) {\n cursor: pointer;\n\n pds-icon {\n margin-inline-start: var(--pine-dimension-2xs);\n padding-block-start: 2px;\n position: absolute;\n }\n}\n\n:host(.is-sortable:hover),\n:host(.is-active) {\n color: var(--pine-color-text-active);\n}\n\n// Text Alignment\n:host(.pds-table-head-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-head-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-head-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-head-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\nimport { downSmall, upSmall } from '@pine-ds/icons/icons';\n\n@Component({\n tag: 'pds-table-head-cell',\n styleUrls: ['pds-table-head-cell.scss'],\n shadow: true,\n})\nexport class PdsTableHeadCell {\n @Element() hostElement: HTMLPdsTableHeadCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n\n /**\n * Sets the text alignment within the head cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Determines whether the table column is sortable when set to `true`.\n */\n @Prop() sortable: boolean;\n\n /**\n * Event emitted to signal that a table column header has been sorted, providing information about the sorted column's name and sorting direction.\n */\n @Event() pdsTableSort: EventEmitter<{ column: string; direction: string }>;\n\n /**\n * The direction of sorting.\n */\n @State() private sortingDirection: 'asc' | 'desc' = 'asc';\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @State() isSelected: boolean = false;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column header to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n private toggleSort = () => {\n if (this.sortable) {\n const column = this.hostElement.innerText.trim();\n this.sortingDirection = this.sortingDirection === 'asc' ? 'desc' : 'asc';\n\n this.tableRef.querySelectorAll('pds-table-head-cell').forEach((headCell) => {\n headCell.classList.remove('is-active');\n });\n\n this.hostElement.classList.toggle('is-active');\n this.pdsTableSort.emit({ column, direction: this.sortingDirection });\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-head-cell--align-${this.cellAlign}`);\n }\n\n if (this.sortable) {\n classNames.push('is-sortable');\n }\n\n if (this.sortable && this.sortingDirection !== null) {\n classNames.push('sort-' + this.sortingDirection);\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"columnheader\"\n onClick={this.toggleSort}\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n {this.sortable && (\n <pds-icon icon={this.sortingDirection === 'asc' ? upSmall : downSmall} />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"wNAAA,IAAMA,EAAsB,w4C,ICSfC,EAAgBC,EAAA,iCAL7B,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,K,mDAQUA,KAAeC,gBAAuB,KAEtCD,KAAYE,aAAW,EAoBdF,KAAgBG,iBAAmB,MAMnCH,KAAcI,eAAY,MAMlCJ,KAAUK,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],(function(e){"use strict";var t,r,n;return{setters:[function(e){t=e.r;r=e.h;n=e.H}],execute:function(){var o=":host{border-color:inherit;display:table-row-group;vertical-align:middle}";var c=e("pds_table_body",function(){function e(e){t(this,e)}e.prototype.render=function(){return r(n,{key:"ec495e4227d7fb7defc4b4abf0afb8010f7ea984",role:"rowgroup"},r("slot",{key:"f9c42d628c86ed6098a42cc864122028711e3f15"}))};return e}());c.style=o}}}));
|
|
2
|
-
//# sourceMappingURL=p-487859a1.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableBodyCss","PdsTableBody","exports","class_1","prototype","render","h","Host","key","role"],"sources":["src/components/pds-table/pds-table-body/pds-table-body.scss?tag=pds-table-body&encapsulation=shadow","src/components/pds-table/pds-table-body/pds-table-body.tsx"],"sourcesContent":[":host {\n border-color: inherit;\n display: table-row-group;\n vertical-align: middle;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-table-body',\n styleUrls: ['pds-table-body.scss'],\n shadow: true,\n})\nexport class PdsTableBody {\n\n render() {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"kJAAA,IAAMA,EAAkB,4E,ICOXC,EAAYC,EAAA,4B,wBAEvBC,EAAAC,UAAAC,OAAA,WACE,OACEC,EAACC,EAAK,CAAAC,IAAA,2CAAAC,KAAK,YACTH,EAAa,QAAAE,IAAA,6C,WALI,I","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r,h as e,H as o}from"./p-BVCWKPy3.js";const s=":host{border-color:inherit;display:table-row-group;vertical-align:middle}";const t=class{constructor(e){r(this,e)}render(){return e(o,{key:"ec495e4227d7fb7defc4b4abf0afb8010f7ea984",role:"rowgroup"},e("slot",{key:"f9c42d628c86ed6098a42cc864122028711e3f15"}))}};t.style=s;export{t as pds_table_body};
|
|
2
|
-
//# sourceMappingURL=p-5c0803c3.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableBodyCss","PdsTableBody","render","h","Host","key","role"],"sources":["src/components/pds-table/pds-table-body/pds-table-body.scss?tag=pds-table-body&encapsulation=shadow","src/components/pds-table/pds-table-body/pds-table-body.tsx"],"sourcesContent":[":host {\n border-color: inherit;\n display: table-row-group;\n vertical-align: middle;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-table-body',\n styleUrls: ['pds-table-body.scss'],\n shadow: true,\n})\nexport class PdsTableBody {\n\n render() {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"6CAAA,MAAMA,EAAkB,4E,MCOXC,EAAY,M,yBAEvB,MAAAC,GACE,OACEC,EAACC,EAAK,CAAAC,IAAA,2CAAAC,KAAK,YACTH,EAAa,QAAAE,IAAA,6C","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableCss","PdsTable","exports","class_1","hostRef","this","scrollContainer","_responsiveHandleScroll","_responsiveHandleResize","_responsiveResizeObserver","_teardownResponsive","sortingColumn","sortingDirection","prototype","componentWillLoad","componentDidLoad","responsive","setupResponsiveScrolling","disconnectedCallback","_this","container","_a","el","shadowRoot","querySelector","leftShadow","_b","rightShadow","_c","scrollLeft","maxScrollLeft","scrollWidth","clientWidth","style","opacity","fixedColumn","addEventListener","passive","window","ResizeObserver","call","observe","error","removeEventListener","disconnect","classNames","compact","push","join","sortTable","column","direction","tableBody","tableRows","Array","from","querySelectorAll","columnHeaderCells","columnHeaderCell","find","cell","innerText","trim","console","warn","concat","columnIndex","indexOf","sort","a","b","valueA","textContent","valueB","localeCompare","undefined","sensitivity","innerHTML","forEach","row","appendChild","handleTableSort","event","detail","handleTableSelectAll","defaultPrevented","pdsTableBody","isSelected","handleTableSelect","allTableRows","allSelectedRows","every","noneSelectedRows","pdsTableHead","headerCheckbox","checked","indeterminate","render","h","Host","class","id","componentId","role","selectable","tabindex"],"sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-white);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n width: 100%;\n}\n\n:host(:focus-visible) {\n outline: var(--pine-outline-focus);\n}\n\n/*\n * Responsive Table Architecture\n *\n * When responsive=true, the table uses a nested structure to provide horizontal scrolling\n * while maintaining proper width behavior and scroll shadows:\n *\n * Host (.pds-table-responsive-host)\n * ├── Shadow Left (positioned fixed to left edge)\n * ├── Shadow Right (positioned fixed to right edge)\n * └── Container (.pds-table-responsive-container)\n * └── Wrapper (.pds-table-responsive-wrapper)\n * └── Table (.pds-table)\n *\n * - Host: Constrains everything to parent width, clips shadows to border-radius\n * - Shadows: Stay fixed during scroll, provide visual scroll indicators\n * - Container: Handles horizontal scrolling (overflow-x: auto)\n * - Table: Expands to full width or scrolls based on content\n */\n:host(.pds-table-responsive-host) {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n max-width: 100% !important;\n overflow: hidden !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-container {\n border-radius: inherit;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: visible !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper {\n border-radius: inherit;\n box-sizing: border-box !important;\n display: block !important;\n position: relative !important;\n width: 100% !important;\n}\n\n.pds-table-responsive-wrapper .pds-table {\n display: table !important;\n min-width: max-content !important;\n table-layout: auto !important;\n white-space: nowrap !important;\n width: 100% !important;\n}\n\n/* Shadows positioned relative to host (non-scrolling), covering container edges */\n.scroll-shadow-left,\n.scroll-shadow-right {\n height: 100%;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n transition: opacity 0.1s ease;\n width: 4px;\n z-index: 10;\n}\n\n.scroll-shadow-left {\n background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-left-radius: inherit;\n border-top-left-radius: inherit;\n left: 0;\n}\n\n.scroll-shadow-right {\n background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);\n border-bottom-right-radius: inherit;\n border-top-right-radius: inherit;\n right: 0;\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'pds-table',\n styleUrls: ['pds-table.scss'],\n shadow: true,\n})\nexport class PdsTable {\n @Element() el: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private _responsiveHandleScroll: (() => void) | null = null;\n private _responsiveHandleResize: (() => void) | null = null;\n private _responsiveResizeObserver: ResizeObserver | null = null;\n private _teardownResponsive: (() => void) | null = null;\n\n /**\n * Determines if the table displays with reduced table cell padding.\n */\n @Prop() compact: boolean;\n\n /**\n * A unique identifier used for the table `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Enables the table to be responsive by horizontally scrolling on smaller screens.\n */\n @Prop() responsive: boolean;\n\n /**\n * Determines if the should display a fixed first column.\n */\n @Prop() fixedColumn: boolean;\n\n /**\n * Determines if the table displays checkboxes for selectable rows.\n */\n @Prop() selectable: boolean;\n\n /**\n * The name of the column being sorted.\n * @defaultValue null\n */\n @State() sortingColumn: string | null = null;\n\n /**\n * The direction of sorting.\n * @defaultValue 'asc'\n */\n @State() sortingDirection: 'asc' | 'desc' = 'asc';\n\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the rowIndex and selected value.\n */\n @Event() pdsTableSelect: EventEmitter<{ rowIndex: number; isSelected: boolean }>;\n\n /**\n * Event that is emitted when the select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentWillLoad() {\n this.sortingColumn = null;\n }\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n }\n\n disconnectedCallback() {\n if (this._teardownResponsive) {\n this._teardownResponsive();\n this._teardownResponsive = null;\n }\n }\n\n /**\n * Sets up responsive scrolling behavior for the table.\n *\n * This method creates a horizontal scrolling system where:\n * - The table content can scroll horizontally when it exceeds the container width\n * - Scroll shadows appear at the left/right edges to indicate scrollable content\n * - Fixed columns remain sticky during horizontal scrolling\n * - Shadows respect border-radius and don't appear when there's nothing to scroll\n *\n * Architecture:\n * - Host element: Contains everything, respects parent constraints\n * - Container element: Handles horizontal scrolling (overflow-x: auto)\n * - Shadow elements: Positioned fixed relative to host, show scroll indicators\n *\n * @private\n */\n private setupResponsiveScrolling() {\n const container = this.el.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n const leftShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-left') as HTMLElement;\n const rightShadow = this.el.shadowRoot?.querySelector('.scroll-shadow-right') as HTMLElement;\n\n if (!container || !leftShadow || !rightShadow) return;\n\n // Store container reference for cleanup\n this.scrollContainer = container;\n\n /**\n * Updates the visibility of scroll shadows based on current scroll position.\n * Left shadow: Shows when scrolled away from start (hidden if fixedColumn is enabled)\n * Right shadow: Shows when there's content to scroll and not at the end\n */\n this._responsiveHandleScroll = () => {\n if (!this.scrollContainer) return;\n\n const scrollLeft = this.scrollContainer.scrollLeft;\n const maxScrollLeft = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth;\n\n // Show left shadow when scrolled away from start, but not if there's a fixed column\n leftShadow.style.opacity = (scrollLeft > 0 && !this.fixedColumn) ? '1' : '0';\n\n // Show right shadow only if there's content to scroll AND not at end\n rightShadow.style.opacity = (maxScrollLeft > 0 && scrollLeft < maxScrollLeft - 1) ? '1' : '0';\n };\n\n // Add scroll event listener to container element\n this.scrollContainer.addEventListener('scroll', this._responsiveHandleScroll, { passive: true });\n\n // Add resize observer to update shadows when container size changes\n if (typeof window !== 'undefined' && window.ResizeObserver) {\n try {\n this._responsiveResizeObserver = new ResizeObserver(() => {\n this._responsiveHandleScroll?.();\n });\n this._responsiveResizeObserver.observe(this.scrollContainer);\n } catch (error) {\n // ResizeObserver not available in some environments (e.g., tests)\n // Fall back to window resize listener only\n }\n }\n\n // Listen for window resize as fallback\n if (typeof window !== 'undefined') {\n this._responsiveHandleResize = () => {\n this._responsiveHandleScroll?.();\n };\n window.addEventListener('resize', this._responsiveHandleResize);\n }\n\n // Create teardown function for cleanup\n this._teardownResponsive = () => {\n if (this.scrollContainer && this._responsiveHandleScroll) {\n this.scrollContainer.removeEventListener('scroll', this._responsiveHandleScroll);\n this.scrollContainer = null;\n }\n\n if (this._responsiveResizeObserver) {\n this._responsiveResizeObserver.disconnect();\n this._responsiveResizeObserver = null;\n }\n\n if (typeof window !== 'undefined' && this._responsiveHandleResize) {\n window.removeEventListener('resize', this._responsiveHandleResize);\n this._responsiveHandleResize = null;\n }\n\n this._responsiveHandleScroll = null;\n };\n\n // Initial check after setup\n this._responsiveHandleScroll();\n }\n\n\n private classNames() {\n const classNames = ['pds-table'];\n\n if (this.compact) {\n classNames.push('is-compact');\n }\n\n if (this.responsive) {\n classNames.push('is-responsive');\n }\n\n return classNames.join(' ');\n }\n\n private sortTable(column: string, direction: 'asc' | 'desc') {\n const tableBody = this.el.querySelector('pds-table-body');\n\n // Get the rows in the table body\n const tableRows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n\n // Find the column index based on the column name\n const columnHeaderCells: HTMLElement[] = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n );\n\n const columnHeaderCell = columnHeaderCells.find(\n (cell) => cell.innerText.trim() === column\n );\n\n if (!columnHeaderCell) {\n console.warn(`Column \"${column}\" not found.`);\n return;\n }\n\n const columnIndex = columnHeaderCells.indexOf(columnHeaderCell);\n\n // Sort the rows based on the content of the specified column\n tableRows.sort((a, b) => {\n const valueA = a.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n const valueB = b.querySelector(`pds-table-cell:nth-child(${columnIndex + 1})`).textContent.trim();\n\n if (direction === 'asc') {\n return valueA.localeCompare(valueB, undefined, { sensitivity: 'base' });\n } else {\n return valueB.localeCompare(valueA, undefined, { sensitivity: 'base' });\n }\n });\n\n // Clear and append the sorted rows back to the table body\n tableBody.innerHTML = '';\n tableRows.forEach((row) => {\n tableBody.appendChild(row);\n });\n }\n\n @Listen('pdsTableSort')\n handleTableSort(event: CustomEvent<{ column: string; direction: 'asc' | 'desc' }>) {\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n >\n <div class=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\">\n <div class=\"pds-table-responsive-wrapper\">\n <div class={this.classNames()}>\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\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kC,GAAcE,OAAM,SAACZ,GAAQ,OAAAA,EAAIQ,UAAJ,IAC1DK,EAAmBtC,MAAMC,KAAKkC,GAAcE,OAAM,SAACZ,GAAQ,OAACA,EAAIQ,UAAL,IAC3DM,EAAexF,KAAKiB,GAAGE,cAAc,kBAC3C,IAAKqE,EAAc,UAEbC,EAAiBD,EAAatE,WAAWC,cAAc,gBAC7DsE,EAAeC,QAAUL,EACzBI,EAAeE,eAAiBN,IAAoBE,E,iBAGtDzF,EAAAU,UAAAoF,OAAA,WACE,GAAI5F,KAAKW,WAAY,CACnB,OACEkF,EAACC,EACC,CAAAC,MAAM,oDACNC,GAAIhG,KAAKiG,YACTC,KAAK,OACLC,WAAYnG,KAAKmG,WACjBC,SAAS,KAETP,EAAK,OAAAE,MAAM,uBACXF,EAAK,OAAAE,MAAM,wBACXF,EAAK,OAAAE,MAAM,kCACTF,EAAK,OAAAE,MAAM,gCACTF,EAAA,OAAKE,MAAO/F,KAAKwC,cACfqD,EAAA,gB,CAQZ,OACEA,EAACC,EAAI,CACHC,MAAO/F,KAAKwC,aACZwD,GAAIhG,KAAKiG,YACTC,KAAK,OACLC,WAAYnG,KAAKmG,WACjBC,SAAS,KAETP,EAAa,a,uHA/RA,I","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pdsTableHeadCellCss","PdsTableHeadCell","constructor","hostRef","this","scrollContainer","setupRetries","sortingDirection","tableScrolling","isSelected","handleScroll","scrollLeft","error","console","warn","toggleSort","sortable","column","hostElement","innerText","trim","tableRef","querySelectorAll","forEach","headCell","classList","remove","toggle","pdsTableSort","emit","direction","componentWillRender","closest","componentDidLoad","responsive","fixedColumn","setupScrollListener","disconnectedCallback","cleanupScrollListener","container","_a","shadowRoot","querySelector","addEventListener","passive","setupTimer","window","setTimeout","removeEventListener","undefined","clearTimeout","classNames","compact","push","cellAlign","join","render","h","Host","key","class","role","onClick","style","selectable","icon","upSmall","downSmall"],"sources":["src/components/pds-table/pds-table-head-cell/pds-table-head-cell.scss?tag=pds-table-head-cell&encapsulation=shadow","src/components/pds-table/pds-table-head-cell/pds-table-head-cell.tsx"],"sourcesContent":[":host {\n --border-head-cell-default: var(--pine-border-width-thin) solid var(--pine-color-grey-100);\n\n --box-shadow-default: 3px 3px 6px -2px rgba(0, 0, 0, 0.1);\n\n border-block-end: var(--border-head-cell-default);\n color: var(--pine-color-text);\n display: table-cell;\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size);\n font-weight: var(--pine-font-weight-regular);\n line-height: var(--pine-line-height-body);\n padding: var(--pine-dimension-150);\n position: relative;\n text-align: start;\n vertical-align: inherit;\n}\n\n:host(.is-compact) {\n padding-block: var(--pine-dimension-2xs)\n}\n\n:host(.is-fixed) {\n background: var(--pine-color-background-container);\n left: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n}\n\n// box shadow when table has scrolled and cell is fixed\n:host(.has-scrolled.is-fixed) {\n box-shadow: var(--box-shadow-default);\n}\n\n:host(.is-sortable) {\n cursor: pointer;\n\n pds-icon {\n margin-inline-start: var(--pine-dimension-2xs);\n padding-block-start: 2px;\n position: absolute;\n }\n}\n\n:host(.is-sortable:hover),\n:host(.is-active) {\n color: var(--pine-color-text-active);\n}\n\n// Text Alignment\n:host(.pds-table-head-cell--align-start) {\n text-align: start;\n}\n\n:host(.pds-table-head-cell--align-center) {\n text-align: center;\n}\n\n:host(.pds-table-head-cell--align-end) {\n text-align: end;\n}\n\n:host(.pds-table-head-cell--align-justify) {\n text-align: justify;\n}\n","import { Component, Element, Host, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\nimport { downSmall, upSmall } from '@pine-ds/icons/icons';\n\n@Component({\n tag: 'pds-table-head-cell',\n styleUrls: ['pds-table-head-cell.scss'],\n shadow: true,\n})\nexport class PdsTableHeadCell {\n @Element() hostElement: HTMLPdsTableHeadCellElement;\n private tableRef: HTMLPdsTableElement;\n private scrollContainer: HTMLElement | null = null;\n private setupTimer: number | undefined;\n private setupRetries: number = 0;\n\n /**\n * Sets the text alignment within the head cell.\n */\n @Prop() cellAlign?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Determines whether the table column is sortable when set to `true`.\n */\n @Prop() sortable: boolean;\n\n /**\n * Event emitted to signal that a table column header has been sorted, providing information about the sorted column's name and sorting direction.\n */\n @Event() pdsTableSort: EventEmitter<{ column: string; direction: string }>;\n\n /**\n * The direction of sorting.\n */\n @State() private sortingDirection: 'asc' | 'desc' = 'asc';\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @State() isSelected: boolean = false;\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n\n componentDidLoad() {\n if (this.tableRef && this.tableRef.responsive && this.tableRef.fixedColumn) {\n // For responsive tables with fixed columns, set up scroll detection\n // This enables the first column header to show a shadow when the table is scrolled horizontally\n this.setupScrollListener();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n }\n\n private setupScrollListener() {\n if (!this.tableRef) return;\n\n // Query shadowRoot once and cache the container\n const container = this.tableRef.shadowRoot?.querySelector('.pds-table-responsive-container') as HTMLElement;\n\n if (container) {\n // Container available immediately\n this.scrollContainer = container;\n this.scrollContainer.addEventListener('scroll', this.handleScroll, { passive: true });\n this.handleScroll(); // Initial check\n this.setupRetries = 0; // Reset counter on success\n } else {\n // Container not ready, set up timer for retry with bounds\n this.setupTimer = window.setTimeout(() => {\n if (this.scrollContainer) return; // Already found\n this.setupRetries = (this.setupRetries || 0) + 1;\n if (this.setupRetries <= 50) {\n this.setupScrollListener();\n } else {\n console.warn('Failed to find responsive container after 50 attempts');\n }\n }, 100);\n }\n }\n\n private cleanupScrollListener() {\n if (this.scrollContainer) {\n this.scrollContainer.removeEventListener('scroll', this.handleScroll);\n this.scrollContainer = null;\n }\n\n if (this.setupTimer !== undefined) {\n window.clearTimeout(this.setupTimer);\n this.setupTimer = undefined;\n }\n\n this.setupRetries = 0; // Reset retry counter\n }\n\n /**\n * Handles scroll events to update fixed column shadow state.\n * Updates the tableScrolling state to control CSS classes for fixed column shadows.\n * @private\n */\n private handleScroll = () => {\n if (!this.scrollContainer) {\n return;\n }\n\n try {\n this.tableScrolling = this.scrollContainer.scrollLeft > 0;\n } catch (error) {\n console.warn('Scroll handler error:', error);\n }\n };\n\n private toggleSort = () => {\n if (this.sortable) {\n const column = this.hostElement.innerText.trim();\n this.sortingDirection = this.sortingDirection === 'asc' ? 'desc' : 'asc';\n\n this.tableRef.querySelectorAll('pds-table-head-cell').forEach((headCell) => {\n headCell.classList.remove('is-active');\n });\n\n this.hostElement.classList.toggle('is-active');\n this.pdsTableSort.emit({ column, direction: this.sortingDirection });\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.tableRef && this.tableRef.compact) {\n classNames.push('is-compact');\n }\n\n if (this.cellAlign) {\n classNames.push(`pds-table-head-cell--align-${this.cellAlign}`);\n }\n\n if (this.sortable) {\n classNames.push('is-sortable');\n }\n\n if (this.sortable && this.sortingDirection !== null) {\n classNames.push('sort-' + this.sortingDirection);\n }\n\n if (this.tableRef && this.tableRef.fixedColumn && this.tableScrolling) {\n classNames.push('has-scrolled');\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"columnheader\"\n onClick={this.toggleSort}\n style={\n this.tableRef &&\n this.tableRef.fixedColumn &&\n this.tableRef.selectable\n ? { '--fixed-cell-position': '40px' }\n : {}\n }\n >\n <slot></slot>\n {this.sortable && (\n <pds-icon icon={this.sortingDirection === 'asc' ? upSmall : downSmall} />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAsB,w4C,MCSfC,EAAgB,MAL7B,WAAAC,CAAAC,G,mDAQUC,KAAeC,gBAAuB,KAEtCD,KAAYE,aAAW,EAoBdF,KAAgBG,iBAAmB,MAMnCH,KAAcI,eAAY,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