@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.
Files changed (118) hide show
  1. package/components/pds-table-body.js +1 -1
  2. package/components/pds-table-body.js.map +1 -1
  3. package/components/pds-table-cell2.js +2 -2
  4. package/components/pds-table-cell2.js.map +1 -1
  5. package/components/pds-table-head-cell2.js +2 -2
  6. package/components/pds-table-head-cell2.js.map +1 -1
  7. package/components/pds-table-head.js +1 -1
  8. package/components/pds-table-head.js.map +1 -1
  9. package/components/pds-table-row.js +1 -1
  10. package/components/pds-table-row.js.map +1 -1
  11. package/components/pds-table.js +2 -2
  12. package/components/pds-table.js.map +1 -1
  13. package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
  14. package/dist/cjs/pds-table-body.cjs.entry.js.map +1 -1
  15. package/dist/cjs/pds-table-body.entry.cjs.js.map +1 -1
  16. package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
  17. package/dist/cjs/pds-table-cell.cjs.entry.js.map +1 -1
  18. package/dist/cjs/pds-table-cell.entry.cjs.js.map +1 -1
  19. package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -2
  20. package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +1 -1
  21. package/dist/cjs/pds-table-head-cell.entry.cjs.js.map +1 -1
  22. package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
  23. package/dist/cjs/pds-table-head.cjs.entry.js.map +1 -1
  24. package/dist/cjs/pds-table-head.entry.cjs.js.map +1 -1
  25. package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
  26. package/dist/cjs/pds-table-row.cjs.entry.js.map +1 -1
  27. package/dist/cjs/pds-table-row.entry.cjs.js.map +1 -1
  28. package/dist/cjs/pds-table.cjs.entry.js +2 -2
  29. package/dist/cjs/pds-table.cjs.entry.js.map +1 -1
  30. package/dist/cjs/pds-table.entry.cjs.js.map +1 -1
  31. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
  32. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +1 -1
  33. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
  34. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -1
  35. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
  36. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -1
  37. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
  38. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +1 -1
  39. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
  40. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -1
  41. package/dist/collection/components/pds-table/pds-table.js +2 -2
  42. package/dist/collection/components/pds-table/pds-table.js.map +1 -1
  43. package/dist/docs.json +73 -7
  44. package/dist/esm/pds-table-body.entry.js +1 -1
  45. package/dist/esm/pds-table-body.entry.js.map +1 -1
  46. package/dist/esm/pds-table-cell.entry.js +2 -2
  47. package/dist/esm/pds-table-cell.entry.js.map +1 -1
  48. package/dist/esm/pds-table-head-cell.entry.js +2 -2
  49. package/dist/esm/pds-table-head-cell.entry.js.map +1 -1
  50. package/dist/esm/pds-table-head.entry.js +1 -1
  51. package/dist/esm/pds-table-head.entry.js.map +1 -1
  52. package/dist/esm/pds-table-row.entry.js +1 -1
  53. package/dist/esm/pds-table-row.entry.js.map +1 -1
  54. package/dist/esm/pds-table.entry.js +2 -2
  55. package/dist/esm/pds-table.entry.js.map +1 -1
  56. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  57. package/dist/esm-es5/pds-table-body.entry.js.map +1 -1
  58. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  59. package/dist/esm-es5/pds-table-cell.entry.js.map +1 -1
  60. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  61. package/dist/esm-es5/pds-table-head-cell.entry.js.map +1 -1
  62. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  63. package/dist/esm-es5/pds-table-head.entry.js.map +1 -1
  64. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  65. package/dist/esm-es5/pds-table-row.entry.js.map +1 -1
  66. package/dist/esm-es5/pds-table.entry.js +1 -1
  67. package/dist/esm-es5/pds-table.entry.js.map +1 -1
  68. package/dist/pine-core/{p-Dx9XkHH8.system.js.map → p-0TIvNV5c.system.js.map} +1 -1
  69. package/dist/pine-core/{p-28f7c0d8.system.entry.js → p-0de9f8da.system.entry.js} +2 -2
  70. package/dist/pine-core/{p-28f7c0d8.system.entry.js.map → p-0de9f8da.system.entry.js.map} +1 -1
  71. package/dist/pine-core/{p-fc457c65.entry.js → p-44087d1c.entry.js} +2 -2
  72. package/dist/pine-core/{p-fc457c65.entry.js.map → p-44087d1c.entry.js.map} +1 -1
  73. package/dist/pine-core/{p-ab82338f.entry.js → p-464dd476.entry.js} +2 -2
  74. package/dist/pine-core/{p-ab82338f.entry.js.map → p-464dd476.entry.js.map} +1 -1
  75. package/dist/pine-core/{p-2e491c3d.entry.js → p-50c9e865.entry.js} +2 -2
  76. package/dist/pine-core/p-50c9e865.entry.js.map +1 -0
  77. package/dist/pine-core/p-7004d1ea.system.entry.js +2 -0
  78. package/dist/pine-core/p-7004d1ea.system.entry.js.map +1 -0
  79. package/dist/pine-core/{p-a472af99.system.entry.js → p-73158adf.system.entry.js} +2 -2
  80. package/dist/pine-core/{p-a472af99.system.entry.js.map → p-73158adf.system.entry.js.map} +1 -1
  81. package/dist/pine-core/{p-db1956e5.entry.js → p-7cb4f0de.entry.js} +2 -2
  82. package/dist/pine-core/p-7cb4f0de.entry.js.map +1 -0
  83. package/dist/pine-core/{p-3ccb6b0c.system.entry.js → p-8999b63d.system.entry.js} +2 -2
  84. package/dist/pine-core/p-8999b63d.system.entry.js.map +1 -0
  85. package/dist/pine-core/{p-DBw5MRwj.system.js.map → p-BRygGju8.system.js.map} +1 -1
  86. package/dist/pine-core/{p-DZggSEPe.system.js.map → p-CE6b_LzB.system.js.map} +1 -1
  87. package/dist/pine-core/{p-B6Znd6C5.system.js.map → p-CpdNWpfd.system.js.map} +1 -1
  88. package/dist/pine-core/{p-CYiuzbNk.system.js.map → p-DHmJZxQk.system.js.map} +1 -1
  89. package/dist/pine-core/p-De9tROL-.system.js +1 -1
  90. package/dist/pine-core/{p-rBOkvo-C.system.js.map → p-IhWWc2L_.system.js.map} +1 -1
  91. package/dist/pine-core/{p-174506b9.entry.js → p-ac37cf0d.entry.js} +2 -2
  92. package/dist/pine-core/p-ac37cf0d.entry.js.map +1 -0
  93. package/dist/pine-core/p-be939cb0.entry.js +2 -0
  94. package/dist/pine-core/p-be939cb0.entry.js.map +1 -0
  95. package/dist/pine-core/{p-3abc0f49.system.entry.js → p-da367b5e.system.entry.js} +2 -2
  96. package/dist/pine-core/p-da367b5e.system.entry.js.map +1 -0
  97. package/dist/pine-core/{p-7d2c43df.system.entry.js → p-fd091234.system.entry.js} +2 -2
  98. package/dist/pine-core/p-fd091234.system.entry.js.map +1 -0
  99. package/dist/pine-core/pds-table-body.entry.esm.js.map +1 -1
  100. package/dist/pine-core/pds-table-cell.entry.esm.js.map +1 -1
  101. package/dist/pine-core/pds-table-head-cell.entry.esm.js.map +1 -1
  102. package/dist/pine-core/pds-table-head.entry.esm.js.map +1 -1
  103. package/dist/pine-core/pds-table-row.entry.esm.js.map +1 -1
  104. package/dist/pine-core/pds-table.entry.esm.js.map +1 -1
  105. package/dist/pine-core/pine-core.esm.js +1 -1
  106. package/hydrate/index.js +9 -9
  107. package/hydrate/index.mjs +9 -9
  108. package/package.json +2 -2
  109. package/dist/pine-core/p-174506b9.entry.js.map +0 -1
  110. package/dist/pine-core/p-2e491c3d.entry.js.map +0 -1
  111. package/dist/pine-core/p-3abc0f49.system.entry.js.map +0 -1
  112. package/dist/pine-core/p-3ccb6b0c.system.entry.js.map +0 -1
  113. package/dist/pine-core/p-487859a1.system.entry.js +0 -2
  114. package/dist/pine-core/p-487859a1.system.entry.js.map +0 -1
  115. package/dist/pine-core/p-5c0803c3.entry.js +0 -2
  116. package/dist/pine-core/p-5c0803c3.entry.js.map +0 -1
  117. package/dist/pine-core/p-7d2c43df.system.entry.js.map +0 -1
  118. package/dist/pine-core/p-db1956e5.entry.js.map +0 -1
@@ -9,7 +9,7 @@ const PdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class PdsTableBody exten
9
9
  this.__attachShadow();
10
10
  }
11
11
  render() {
12
- return (h(Host, { key: 'ec495e4227d7fb7defc4b4abf0afb8010f7ea984', role: "rowgroup" }, h("slot", { key: 'f9c42d628c86ed6098a42cc864122028711e3f15' })));
12
+ return (h(Host, { key: '7aa581f9cd4c798a5699664ca9639ec7e412a891', role: "rowgroup", part: "body" }, h("slot", { key: 'c06f2431044e64d934ee302e5c6fffbdaf0051c7' })));
13
13
  }
14
14
  static get style() { return pdsTableBodyCss; }
15
15
  }, [1, "pds-table-body"]);
@@ -1 +1 @@
1
- {"file":"pds-table-body.js","mappings":";;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtFA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;;;;;;IAEvB,MAAM,GAAA;QACJ,QACE,CAAC,CAAA,IAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAA,EACnB,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableBody","__stencil_proxyCustomElement"],"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"],"version":3}
1
+ {"file":"pds-table-body.js","mappings":";;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtFA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;;;;;;IAEvB,MAAM,GAAA;AACJ,QAAA,QACE,CAAC,CAAA,IAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAA,EAC/B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableBody","__stencil_proxyCustomElement"],"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\" part=\"body\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -100,11 +100,11 @@ const PdsTableCell = /*@__PURE__*/ proxyCustomElement(class PdsTableCell extends
100
100
  return classNames.join(' ');
101
101
  }
102
102
  render() {
103
- return (h(Host, { key: 'cc149f3d36c253ddd9c37ff435056be14ab8012d', class: this.classNames(), role: "gridcell", style: this.tableRef &&
103
+ return (h(Host, { key: 'eb6a58e7e294593a35b77f00d787fee3b2b03661', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
104
104
  this.tableRef.fixedColumn &&
105
105
  this.tableRef.selectable
106
106
  ? { '--fixed-cell-position': '40px' }
107
- : {} }, h("slot", { key: '5095b0541afada3a73422adcd8992f26b4e59235' })));
107
+ : {} }, h("slot", { key: 'c83fc4dda70196bf1032544353af058bc1a0decf' })));
108
108
  }
109
109
  get hostElement() { return this; }
110
110
  static get style() { return pdsTableCellCss; }
@@ -1 +1 @@
1
- {"file":"pds-table-cell2.js","mappings":";;AAAA,MAAM,eAAe,GAAG,2iCAA2iC;;MCOtjC,YAAY,iBAAAA,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAmBF;IAhIC,mBAAmB,GAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAwB;;IAG9E,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;;;YAG1E,IAAI,CAAC,mBAAmB,EAAE;;;IAI9B,oBAAoB,GAAA;QAClB,IAAI,CAAC,qBAAqB,EAAE;;IAGtB,mBAAmB,GAAA;;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE;;AAGpB,QAAA,MAAM,SAAS,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,C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AI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;AAC1C,YAAA,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;;AAG/B,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,UAAU,CAAC,IAAI,CAAC,CAAA,sBAAA,EAAyB,IAAI,CAAC,SAAS,CAAE,CAAA,CAAC;;AAG5D,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,cAAc,EAAE;AACrE,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;IAoB7B,MAAM,GAAA;QACJ,QACE,CAAC,CAAA,IAAI,qDACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,UAAU,EACf,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"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 :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AAI,CAAC,YAAY,CAAC;;AAG/B,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,UAAU,CAAC,IAAI,CAAC,CAAA,sBAAA,EAAyB,IAAI,CAAC,SAAS,CAAE,CAAA,CAAC;;AAG5D,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,cAAc,EAAE;AACrE,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;IAoB7B,MAAM,GAAA;AACJ,QAAA,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,MAAM,EACX,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"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 part=\"cell\"\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"],"version":3}
@@ -126,11 +126,11 @@ const PdsTableHeadCell = /*@__PURE__*/ proxyCustomElement(class PdsTableHeadCell
126
126
  return classNames.join(' ');
127
127
  }
128
128
  render() {
129
- return (h(Host, { key: '037d0c1d3cf8122132bee6887bcaceb29ac33cc0', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, style: this.tableRef &&
129
+ return (h(Host, { key: 'f3b04da28997f6f471f6945e0cfac098dc1a6428', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, part: "head-cell", style: this.tableRef &&
130
130
  this.tableRef.fixedColumn &&
131
131
  this.tableRef.selectable
132
132
  ? { '--fixed-cell-position': '40px' }
133
- : {} }, h("slot", { key: 'ccfc2ea9a8301783834bda8c627afd652c22405e' }), this.sortable && (h("pds-icon", { key: 'de8a980b54bde4994f0339af5d7f3165ed35123b', icon: this.sortingDirection === 'asc' ? upSmall : downSmall }))));
133
+ : {} }, h("slot", { key: '832373d831d5f250f7427bf0a1f2756e0ce56ea9' }), this.sortable && (h("pds-icon", { key: '1886880fa50da3415b80a0abd8d571ca7350ca23', icon: this.sortingDirection === 'asc' ? upSmall : downSmall, part: "sort-icon" }))));
134
134
  }
135
135
  get hostElement() { return this; }
136
136
  static get style() { return pdsTableHeadCellCss; }
@@ -1 +1 @@
1
- {"file":"pds-table-head-cell2.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,u4CAAu4C;;MCSt5C,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAA,WAAA,CAAA;AAL7B,IAAA,WAAA,GAAA;;;;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAiBhC;;AAEG;AACc,QAAA,IAAgB,CAAA,gBAAA,GAAmB,KAAK;AAEzD;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAEhD;;;AAGG;AACM,QAAA,IAAU,CAAA,UAAA,G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jC,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,QAAQ,KACZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAE,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAAG,OAAO,GAAG,SAAS,EAAI,CAAA,CAC1E,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"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"],"version":3}
1
+ {"file":"pds-table-head-cell2.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,u4CAAu4C;;MCSt5C,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAA,WAAA,CAAA;AAL7B,IAAA,WAAA,GAAA;;;;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAiBhC;;AAEG;AACc,QAAA,IAAgB,CAAA,gBAAA,GAAmB,KAAK;AAEzD;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAEhD;;;AAGG;AACM,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AA0DpC;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAEO,QAAA,IAAU,CAAA,UAAA,GAAG,MAAK;AACxB,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE;AAChD,gBAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK;AAExE,gBAAA,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAA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,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC;;AAGlD,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,cAAc,EAAE;AACrE,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;IAG7B,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,WAAW,EAChB,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;kBACjC,EAAE,EAAA,EAGR,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,QAAQ,KACZ,CAAU,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAAG,OAAO,GAAG,SAAS,EAAE,IAAI,EAAC,WAAW,EAAG,CAAA,CAC3F,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"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 part=\"head-cell\"\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} part=\"sort-icon\" />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -42,7 +42,7 @@ const PdsTableHead$1 = /*@__PURE__*/ proxyCustomElement(class PdsTableHead exten
42
42
  }
43
43
  }
44
44
  render() {
45
- return (h(Host, { key: 'ffa2760e5512a41cc8882722ea7ad7e5650de50f', role: "row" }, this.tableRef && this.tableRef.selectable && (h("pds-table-head-cell", { key: 'ba2e2ef60d570d739f5e582c0affe481ebed578d', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, h("pds-checkbox", { key: '4db057d54fbda8dccc49451ffb23ea1133fea53f', componentId: this.generateUniqueId(), indeterminate: this.indeterminate, onInput: this.handleInput, label: "Select All Rows", hideLabel: true, checked: this.isSelected }))), h("slot", { key: '1f9167ccf1186c92033fa95b7e4a121b98d7c0ea' })));
45
+ return (h(Host, { key: 'dda71d591ccce76bdb055820c1c97358e545b522', role: "row", part: "head" }, this.tableRef && this.tableRef.selectable && (h("pds-table-head-cell", { key: '79bf1bd06b8e1ef05c9354c178787b4cff139e07', part: this.tableRef.selectable ? 'checkbox-cell' : '' }, h("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" }))), h("slot", { key: 'f81d3922f892faa65abee99fd5af0d3232a25e9a' })));
46
46
  }
47
47
  get hostElement() { return this; }
48
48
  static get style() { return pdsTableHeadCss; }
@@ -1 +1 @@
1
- {"file":"pds-table-head.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,ogBAAogB;;MCQ/gBA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;;AAyBU,QAAA,IAAgB,CAAA,gBAAA,GAAG,MAAK;AAC9B,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/D,YAAA,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AAChE,YAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,YAAY,CAAI,CAAA,EAAA,SAAS,EAAE;AAE/C,YAAA,OAAO,QAAQ;AACjB,SAAC;AAEO,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,EAAS,KAAI;YAClC,IAAI,CAAC,UAAU,GAAG,CAAE,EAAE,CAAC,MAA2B,CAAC,OAAO;AAC1D,YAAA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a,EAAE,IAAI,CAAC,aAAa,EACjC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EAAA,CACxB,CACkB,CACvB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableHead","__stencil_proxyCustomElement"],"sources":["src/components/pds-table/pds-table-head/pds-table-head.scss?tag=pds-table-head&encapsulation=shadow","src/components/pds-table/pds-table-head/pds-table-head.tsx"],"sourcesContent":[":host {\n --border-head-default: var(--pine-border-width-thin) solid var(--pine-color-grey-100);\n\n border-color: inherit;\n box-sizing: border-box;\n display: table-header-group;\n vertical-align: middle;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { closest } from '@utils/closest';\n\n@Component({\n tag: 'pds-table-head',\n styleUrls: ['pds-table-head.scss'],\n shadow: true,\n})\nexport class PdsTableHead {\n @Element() hostElement: HTMLPdsTableHeadElement;\n private tableRef: HTMLPdsTableElement\n\n /**\n * Determines if the select all checkbox is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @Prop({mutable: true}) 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 private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n private handleInput = (ev: Event) => {\n this.isSelected = !(ev.target as HTMLInputElement).checked\n this.handleSelect(this.isSelected)\n };\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false\n\n if ( closest('pds-table-head', this.hostElement) ) {\n this.pdsTableSelectAll.emit({ isSelected });\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected)\n }\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-head-cell:first-child');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n render() {\n return (\n <Host role=\"row\">\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-head-cell part={this.tableRef.selectable ? 'checkbox-cell' : ''}>\n <pds-checkbox\n componentId={this.generateUniqueId()}\n indeterminate={this.indeterminate}\n onInput={this.handleInput}\n label={\"Select All Rows\"}\n hideLabel={true}\n checked={this.isSelected}\n />\n </pds-table-head-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pds-table-head.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,ogBAAogB;;MCQ/gBA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;;AAyBU,QAAA,IAAgB,CAAA,gBAAA,GAAG,MAAK;AAC9B,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/D,YAAA,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AAChE,YAAA,MAAM,QAAQ,GAAG,CAAA,EAA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qB,CAAA,qBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,eAAe,GAAG,EAAE,EAAA,EACxE,CAAA,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EACpC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,qBAAqB,EAAA,CAC1B,CACkB,CACvB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableHead","__stencil_proxyCustomElement"],"sources":["src/components/pds-table/pds-table-head/pds-table-head.scss?tag=pds-table-head&encapsulation=shadow","src/components/pds-table/pds-table-head/pds-table-head.tsx"],"sourcesContent":[":host {\n --border-head-default: var(--pine-border-width-thin) solid var(--pine-color-grey-100);\n\n border-color: inherit;\n box-sizing: border-box;\n display: table-header-group;\n vertical-align: middle;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { closest } from '@utils/closest';\n\n@Component({\n tag: 'pds-table-head',\n styleUrls: ['pds-table-head.scss'],\n shadow: true,\n})\nexport class PdsTableHead {\n @Element() hostElement: HTMLPdsTableHeadElement;\n private tableRef: HTMLPdsTableElement\n\n /**\n * Determines if the select all checkbox is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n * @defaultValue false\n */\n @Prop({mutable: true}) 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 private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n private handleInput = (ev: Event) => {\n this.isSelected = !(ev.target as HTMLInputElement).checked\n this.handleSelect(this.isSelected)\n };\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false\n\n if ( closest('pds-table-head', this.hostElement) ) {\n this.pdsTableSelectAll.emit({ isSelected });\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected)\n }\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-head-cell:first-child');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n render() {\n return (\n <Host role=\"row\" part=\"head\">\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-head-cell part={this.tableRef.selectable ? 'checkbox-cell' : ''}>\n <pds-checkbox\n componentId={this.generateUniqueId()}\n indeterminate={this.indeterminate}\n onInput={this.handleInput}\n label={\"Select All Rows\"}\n hideLabel={true}\n checked={this.isSelected}\n part=\"select-all-checkbox\"\n />\n </pds-table-head-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -53,7 +53,7 @@ const PdsTableRow$1 = /*@__PURE__*/ proxyCustomElement(class PdsTableRow extends
53
53
  }
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: '05fb5cf3a7bc10dbe451f6df0e338efe74f9d40e', class: this.classNames(), role: "row" }, this.tableRef && this.tableRef.selectable && (h("pds-table-cell", { key: '13f61eb4c6503a488e5307de41718bd1c03a2613', part: this.tableRef.fixedColumn ? 'checkbox-cell' : '', class: this.tableRef.selectable ? 'has-checkbox' : '' }, h("pds-checkbox", { key: 'f17a2377913a8a6285e1eaee76700246c7861e9f', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected }))), h("slot", { key: 'c84de0c7125f6892bc88aae69b367994f48281b1' })));
56
+ return (h(Host, { key: '45de7019e5fe44cd27a02450205cf96429072db3', class: this.classNames(), role: "row", part: "row" }, this.tableRef && this.tableRef.selectable && (h("pds-table-cell", { key: '770cf9bcfff13b8de986d42f6ad6c249b4259191', part: this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell', class: this.tableRef.selectable ? 'has-checkbox' : '' }, h("pds-checkbox", { key: '5a1e28f23dda779862a310d83308396e14a839d6', componentId: this.generateUniqueId(), onClick: this.handleClick, indeterminate: this.indeterminate, label: "Select Row", hideLabel: true, checked: this.isSelected, part: "row-checkbox" }))), h("slot", { key: '7dd5716693ad855d1f072f0af9013ca4383bab5e' })));
57
57
  }
58
58
  get hostElement() { return this; }
59
59
  static get style() { return pdsTableRowCss; }
@@ -1 +1 @@
1
- {"file":"pds-table-row.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,siBAAsiB;;MCShjBA,aAAW,iBAAAC,kBAAA,CAAA,MAAA,WAAA,SAAA,WAAA,CAAA;AALxB,IAAA,WAAA,GAAA;;;;;AAwBU,QAAA,IAAW,CAAA,WAAA,GAAG,MAAK;YACzB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;AACnC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;AACpC,SAAC;AAEO,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,UAAmB,KAAI;AAC7C,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK;YAE1B,IAAI,CAAC,OAA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,SAAS,CAAE,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC;;;IAIxC,iBAAiB,GAAA;AACf,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACnB,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;;;IAYtC,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,KAAK,EAAA,EAET,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KACxC,CAAA,CAAA,gBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAgB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,eAAe,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,cAAc,GAAG,EAAE,EAAA,EAC3H,CAAA,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EACpC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EAAA,CACxB,CACa,CAClB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableRow","__stencil_proxyCustomElement"],"sources":["src/components/pds-table/pds-table-row/pds-table-row.scss?tag=pds-table-row&encapsulation=shadow","src/components/pds-table/pds-table-row/pds-table-row.tsx"],"sourcesContent":[":host {\n --color-background-interactive: var(--pine-color-grey-200);\n\n border-color: inherit;\n display: table-row;\n vertical-align: inherit;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n }\n}\n\n:host(:hover),\n:host(:hover)::part(checkbox-cell),\n:host(:hover) ::slotted(pds-table-cell),\n:host(.is-selected),\n:host(.is-selected)::part(checkbox-cell),\n:host(.is-selected) ::slotted(pds-table-cell) {\n background: var(--color-background-interactive);\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop } from '@stencil/core';\n\nimport { closest } from '../../../utils/closest';\n\n@Component({\n tag: 'pds-table-row',\n styleUrls: ['pds-table-row.scss'],\n shadow: true,\n})\nexport class PdsTableRow {\n @Element() hostElement: HTMLPdsTableRowElement;\n private tableRef: HTMLPdsTableElement;\n\n /**\n * Determines if the row selected is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n */\n @Prop({ mutable: true }) isSelected?: boolean;\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableRowSelected: EventEmitter<{ rowIndex: number; isSelected: boolean; }>;\n\n private handleClick = () => {\n this.isSelected = !this.isSelected; // Toggle the selected state\n this.handleSelect(this.isSelected);\n }\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false;\n\n if (!closest('pds-table-head', this.hostElement)) {\n const rowIndex = Array.from(this.hostElement.parentNode.children).indexOf(this.hostElement)\n this.pdsTableRowSelected.emit({\n rowIndex,\n isSelected,\n })\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.isSelected) {\n classNames.push(\"is-selected\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-cell');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n }\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"row\"\n >\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-cell part={this.tableRef.fixedColumn ? 'checkbox-cell' : ''} class={this.tableRef.selectable ? 'has-checkbox' : ''} >\n <pds-checkbox\n componentId={this.generateUniqueId()}\n onClick={this.handleClick}\n indeterminate={this.indeterminate}\n label={\"Select Row\"}\n hideLabel={true}\n checked={this.isSelected}\n />\n </pds-table-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pds-table-row.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,siBAAsiB;;MCShjBA,aAAW,iBAAAC,kBAAA,CAAA,MAAA,WAAA,SAAA,WAAA,CAAA;AALxB,IAAA,WAAA,GAAA;;;;;AAwBU,QAAA,IAAW,CAAA,WAAA,GAAG,MAAK;YACzB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;AACnC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;AACpC,SAAC;AAEO,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,UAAmB,KAAI;AAC7C,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK;YAE1B,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;AAC3F,gBAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;oBAC5B,QAAQ;oBACR,UAAU;AACX,iBAAA,CAAC;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AU,EAAE,EACxB,IAAI,EAAC,KAAK,EACV,IAAI,EAAC,KAAK,EAAA,EAET,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KACxC,CAAA,CAAA,gBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAgB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,eAAe,GAAG,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,cAAc,GAAG,EAAE,EAAA,EACxI,CAAA,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EACpC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,cAAc,EAAA,CACnB,CACa,CAClB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTableRow","__stencil_proxyCustomElement"],"sources":["src/components/pds-table/pds-table-row/pds-table-row.scss?tag=pds-table-row&encapsulation=shadow","src/components/pds-table/pds-table-row/pds-table-row.tsx"],"sourcesContent":[":host {\n --color-background-interactive: var(--pine-color-grey-200);\n\n border-color: inherit;\n display: table-row;\n vertical-align: inherit;\n\n // used for pds-checkbox-cell\n // because it is in the ShadowDom\n &::part(checkbox-cell) {\n background-color: var(--pine-color-background-container);\n inset-inline-start: var(--pine-dimension-none);\n position: sticky;\n z-index: 1;\n }\n}\n\n:host(:hover),\n:host(:hover)::part(checkbox-cell),\n:host(:hover) ::slotted(pds-table-cell),\n:host(.is-selected),\n:host(.is-selected)::part(checkbox-cell),\n:host(.is-selected) ::slotted(pds-table-cell) {\n background: var(--color-background-interactive);\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop } from '@stencil/core';\n\nimport { closest } from '../../../utils/closest';\n\n@Component({\n tag: 'pds-table-row',\n styleUrls: ['pds-table-row.scss'],\n shadow: true,\n})\nexport class PdsTableRow {\n @Element() hostElement: HTMLPdsTableRowElement;\n private tableRef: HTMLPdsTableElement;\n\n /**\n * Determines if the row selected is in an indeterminate state.\n */\n @Prop({ mutable: true }) indeterminate?: boolean;\n\n /**\n * Determines if the table row is currently selected.\n */\n @Prop({ mutable: true }) isSelected?: boolean;\n\n /**\n * Event that is emitted when the checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableRowSelected: EventEmitter<{ rowIndex: number; isSelected: boolean; }>;\n\n private handleClick = () => {\n this.isSelected = !this.isSelected; // Toggle the selected state\n this.handleSelect(this.isSelected);\n }\n\n private handleSelect = (isSelected: boolean) => {\n this.indeterminate = false;\n\n if (!closest('pds-table-head', this.hostElement)) {\n const rowIndex = Array.from(this.hostElement.parentNode.children).indexOf(this.hostElement)\n this.pdsTableRowSelected.emit({\n rowIndex,\n isSelected,\n })\n }\n }\n\n private classNames() {\n const classNames = [];\n\n if (this.isSelected) {\n classNames.push(\"is-selected\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n\n if (this.tableRef && this.tableRef.fixedColumn) {\n const tableCell = this.hostElement.querySelector('pds-table-cell');\n tableCell?.classList.add(\"is-fixed\");\n }\n }\n\n componentWillLoad() {\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n }\n\n private generateUniqueId = () => {\n const randomString = Math.random().toString(36).substring(2, 8);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const uniqueId = `${randomString}-${timestamp}`;\n\n return uniqueId;\n }\n\n render() {\n return (\n <Host\n class={this.classNames()}\n role=\"row\"\n part=\"row\"\n >\n {this.tableRef && this.tableRef.selectable && (\n <pds-table-cell part={this.tableRef.fixedColumn ? 'checkbox-cell' : 'checkbox-cell'} class={this.tableRef.selectable ? 'has-checkbox' : ''} >\n <pds-checkbox\n componentId={this.generateUniqueId()}\n onClick={this.handleClick}\n indeterminate={this.indeterminate}\n label={\"Select Row\"}\n hideLabel={true}\n checked={this.isSelected}\n part=\"row-checkbox\"\n />\n </pds-table-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -191,9 +191,9 @@ const PdsTable$1 = /*@__PURE__*/ proxyCustomElement(class PdsTable extends HTMLE
191
191
  }
192
192
  render() {
193
193
  if (this.responsive) {
194
- return (h(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, h("div", { class: "scroll-shadow-left" }), h("div", { class: "scroll-shadow-right" }), h("div", { class: "pds-table-responsive-container" }, h("div", { class: "pds-table-responsive-wrapper" }, h("div", { class: this.classNames() }, h("slot", null))))));
194
+ return (h(Host, { class: "pds-table is-responsive pds-table-responsive-host", id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table responsive-table" }, h("div", { class: "scroll-shadow-left", part: "scroll-shadow-left" }), h("div", { class: "scroll-shadow-right", part: "scroll-shadow-right" }), h("div", { class: "pds-table-responsive-container", part: "responsive-container" }, h("div", { class: "pds-table-responsive-wrapper", part: "responsive-wrapper" }, h("div", { class: this.classNames(), part: "table-inner" }, h("slot", null))))));
195
195
  }
196
- return (h(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0" }, h("slot", null)));
196
+ return (h(Host, { class: this.classNames(), id: this.componentId, role: "grid", selectable: this.selectable, tabindex: "0", part: "table" }, h("slot", null)));
197
197
  }
198
198
  get el() { return this; }
199
199
  static get style() { return pdsTableCss; }
@@ -1 +1 @@
1
- {"file":"pds-table.js","mappings":";;AAAA,MAAM,WAAW,GAAG,07DAA07D;;MCOj8DA,UAAQ,iBAAAC,kBAAA,CAAA,MAAA,QAAA,SAAA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,GAAG,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTable","__stencil_proxyCustomElement"],"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"],"version":3}
1
+ {"file":"pds-table.js","mappings":";;AAAA,MAAM,WAAW,GAAG,07DAA07D;;MCOj8DA,UAAQ,iBAAAC,kBAAA,CAAA,MAAA,QAAA,SAAA,WAAA,CAAA;AALrB,IAAA,WAAA,GAAA;;;;;;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,IAAI,CAAC,EAAE,CAAC,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,aAAa,CAAC,iCAAiC,CAAgB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sB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsTable","__stencil_proxyCustomElement"],"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"],"version":3}
@@ -9,7 +9,7 @@ const PdsTableBody = class {
9
9
  index.registerInstance(this, hostRef);
10
10
  }
11
11
  render() {
12
- return (index.h(index.Host, { key: 'ec495e4227d7fb7defc4b4abf0afb8010f7ea984', role: "rowgroup" }, index.h("slot", { key: 'f9c42d628c86ed6098a42cc864122028711e3f15' })));
12
+ return (index.h(index.Host, { key: '7aa581f9cd4c798a5699664ca9639ec7e412a891', role: "rowgroup", part: "body" }, index.h("slot", { key: 'c06f2431044e64d934ee302e5c6fffbdaf0051c7' })));
13
13
  }
14
14
  };
15
15
  PdsTableBody.style = pdsTableBodyCss;
@@ -1 +1 @@
1
- {"file":"pds-table-body.entry.cjs.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtF,YAAY,GAAA,MAAA;;;;IAEvB,MAAM,GAAA;QACJ,QACEA,OAAC,CAAAC,UAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAA,EACnBD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;","names":["h","Host"],"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"],"version":3}
1
+ {"file":"pds-table-body.entry.cjs.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtF,YAAY,GAAA,MAAA;;;;IAEvB,MAAM,GAAA;AACJ,QAAA,QACEA,OAAC,CAAAC,UAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAA,EAC/BD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;","names":["h","Host"],"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\" part=\"body\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table-body.entry.cjs.js","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"],"names":["h","Host"],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtF,YAAY,GAAA,MAAA;;;;IAEvB,MAAM,GAAA;QACJ,QACEA,OAAC,CAAAC,UAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAA,EACnBD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;"}
1
+ {"version":3,"file":"pds-table-body.entry.cjs.js","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\" part=\"body\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":["h","Host"],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,2EAA2E;;MCOtF,YAAY,GAAA,MAAA;;;;IAEvB,MAAM,GAAA;AACJ,QAAA,QACEA,OAAC,CAAAC,UAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAA,EAC/BD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;"}
@@ -100,11 +100,11 @@ const PdsTableCell = class {
100
100
  return classNames.join(' ');
101
101
  }
102
102
  render() {
103
- return (index.h(index.Host, { key: 'cc149f3d36c253ddd9c37ff435056be14ab8012d', class: this.classNames(), role: "gridcell", style: this.tableRef &&
103
+ return (index.h(index.Host, { key: 'eb6a58e7e294593a35b77f00d787fee3b2b03661', class: this.classNames(), role: "gridcell", part: "cell", style: this.tableRef &&
104
104
  this.tableRef.fixedColumn &&
105
105
  this.tableRef.selectable
106
106
  ? { '--fixed-cell-position': '40px' }
107
- : {} }, index.h("slot", { key: '5095b0541afada3a73422adcd8992f26b4e59235' })));
107
+ : {} }, index.h("slot", { key: 'c83fc4dda70196bf1032544353af058bc1a0decf' })));
108
108
  }
109
109
  get hostElement() { return index.getElement(this); }
110
110
  };
@@ -1 +1 @@
1
- {"file":"pds-table-cell.entry.cjs.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,2iCAA2iC;;MCOtjC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAmBF;IAhIC,mBAAmB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,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGRD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;","names":["h","Host"],"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"],"version":3}
1
+ {"file":"pds-table-cell.entry.cjs.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,2iCAA2iC;;MCOtjC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAoBF;IAjIC,mBAAmB,GAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAwB;;IAG9E,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,C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AA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;","names":["h","Host"],"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 part=\"cell\"\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"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table-cell.entry.cjs.js","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"],"names":["h","Host"],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,2iCAA2iC;;MCOtjC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAA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UAAU,EAAE,EACxB,IAAI,EAAC,UAAU,EACf,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGRD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
1
+ {"version":3,"file":"pds-table-cell.entry.cjs.js","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 part=\"cell\"\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"],"names":["h","Host"],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,2iCAA2iC;;MCOtjC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAoEhC;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAwBhD;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAA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;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;AACnC,kBAAE,EAAE,EAAA,EAGRD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
@@ -125,11 +125,11 @@ const PdsTableHeadCell = class {
125
125
  return classNames.join(' ');
126
126
  }
127
127
  render() {
128
- return (index.h(index.Host, { key: '037d0c1d3cf8122132bee6887bcaceb29ac33cc0', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, style: this.tableRef &&
128
+ return (index.h(index.Host, { key: 'f3b04da28997f6f471f6945e0cfac098dc1a6428', class: this.classNames(), role: "columnheader", onClick: this.toggleSort, part: "head-cell", style: this.tableRef &&
129
129
  this.tableRef.fixedColumn &&
130
130
  this.tableRef.selectable
131
131
  ? { '--fixed-cell-position': '40px' }
132
- : {} }, index.h("slot", { key: 'ccfc2ea9a8301783834bda8c627afd652c22405e' }), this.sortable && (index.h("pds-icon", { key: 'de8a980b54bde4994f0339af5d7f3165ed35123b', icon: this.sortingDirection === 'asc' ? index$1.upSmall : index$1.downSmall }))));
132
+ : {} }, index.h("slot", { key: '832373d831d5f250f7427bf0a1f2756e0ce56ea9' }), this.sortable && (index.h("pds-icon", { key: '1886880fa50da3415b80a0abd8d571ca7350ca23', icon: this.sortingDirection === 'asc' ? index$1.upSmall : index$1.downSmall, part: "sort-icon" }))));
133
133
  }
134
134
  get hostElement() { return index.getElement(this); }
135
135
  };
@@ -1 +1 @@
1
- {"file":"pds-table-head-cell.entry.cjs.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,u4CAAu4C;;MCSt5C,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAi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CAAC,UAAU,EACxB,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;kBACjC,EAAE,EAAA,EAGRD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,QAAQ,KACZA,OAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAE,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAAGE,eAAO,GAAGC,iBAAS,EAAI,CAAA,CAC1E,CACI;;;;;;;;","names":["h","Host","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"],"version":3}
1
+ {"file":"pds-table-head-cell.entry.cjs.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,u4CAAu4C;;MCSt5C,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AAiBhC;;AAEG;AACc,QAAA,IAAgB,CAAA,gBAAA,GAAmB,KAAK;AAEzD;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAEhD;;;AAGG;AACM,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AA0DpC;;;;AAIG;AACK,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;AAC1B,YAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB;;AAGF,YAAA,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC;;YACzD,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC;;AAEhD,SAAC;AAEO,QAAA,IAAU,CAAA,UAAA,GAAG,MAAK;AACxB,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE;AAChD,gBAAA,IAAI,CAAC,gBAAg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C,IAAI,CAAC,aAAa,CAAC;;QAGhC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,KAAK,IAAI,EAAE;YACnD,UAAU,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC;;AAGlD,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,cAAc,EAAE;AACrE,YAAA,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC;;AAGjC,QAAA,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;IAG7B,MAAM,GAAA;AACJ,QAAA,QACEA,OAAA,CAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,WAAW,EAChB,KAAK,EACH,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,CAAC,WAAW;gBACzB,IAAI,CAAC,QAAQ,CAAC;AACZ,kBAAE,EAAE,uBAAuB,EAAE,MAAM;kBACjC,EAAE,EAAA,EAGRD,OAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,QAAQ,KACZA,OAAU,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAAGE,eAAO,GAAGC,iBAAS,EAAE,IAAI,EAAC,WAAW,EAAG,CAAA,CAC3F,CACI;;;;;;;;","names":["h","Host","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 part=\"head-cell\"\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} part=\"sort-icon\" />\n )}\n </Host>\n );\n }\n}\n"],"version":3}