@pine-ds/core 3.16.3 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/components/index2.js +1 -1
  2. package/components/index2.js.map +1 -1
  3. package/components/pds-button2.js +18 -6
  4. package/components/pds-button2.js.map +1 -1
  5. package/components/pds-copytext.js +49 -1
  6. package/components/pds-copytext.js.map +1 -1
  7. package/components/pds-multiselect.js +66 -15
  8. package/components/pds-multiselect.js.map +1 -1
  9. package/components/pds-table-cell2.js +36 -3
  10. package/components/pds-table-cell2.js.map +1 -1
  11. package/components/pds-table-head.js +1 -1
  12. package/components/pds-table-head.js.map +1 -1
  13. package/components/pds-table-row.js +3 -3
  14. package/components/pds-table-row.js.map +1 -1
  15. package/components/pds-table.js +12 -4
  16. package/components/pds-table.js.map +1 -1
  17. package/components/pds-text2.js +41 -1
  18. package/components/pds-text2.js.map +1 -1
  19. package/components/truncation-tooltip.js +247 -0
  20. package/components/truncation-tooltip.js.map +1 -0
  21. package/dist/cjs/{index-DkQebouX.js → index-CjhTEk39.js} +3 -3
  22. package/dist/cjs/index-CjhTEk39.js.map +1 -0
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
  25. package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
  26. package/dist/cjs/pds-button.cjs.entry.js +16 -6
  27. package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
  28. package/dist/cjs/pds-checkbox.cjs.entry.js +1 -1
  29. package/dist/cjs/pds-chip.cjs.entry.js +1 -1
  30. package/dist/cjs/pds-copytext.cjs.entry.js +48 -2
  31. package/dist/cjs/pds-copytext.entry.cjs.js.map +1 -1
  32. package/dist/cjs/pds-filter.cjs.entry.js +1 -1
  33. package/dist/cjs/pds-input.cjs.entry.js +1 -1
  34. package/dist/cjs/pds-link.cjs.entry.js +1 -1
  35. package/dist/cjs/pds-multiselect.cjs.entry.js +62 -15
  36. package/dist/cjs/pds-multiselect.entry.cjs.js.map +1 -1
  37. package/dist/cjs/pds-radio-group.cjs.entry.js +1 -1
  38. package/dist/cjs/pds-radio.cjs.entry.js +1 -1
  39. package/dist/cjs/pds-select.cjs.entry.js +1 -1
  40. package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
  41. package/dist/cjs/pds-switch.cjs.entry.js +1 -1
  42. package/dist/cjs/pds-table-cell.cjs.entry.js +35 -3
  43. package/dist/cjs/pds-table-cell.entry.cjs.js.map +1 -1
  44. package/dist/cjs/pds-table-head-cell.cjs.entry.js +1 -1
  45. package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
  46. package/dist/cjs/pds-table-head.entry.cjs.js.map +1 -1
  47. package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
  48. package/dist/cjs/pds-table-row.entry.cjs.js.map +1 -1
  49. package/dist/cjs/pds-table.cjs.entry.js +11 -4
  50. package/dist/cjs/pds-table.entry.cjs.js.map +1 -1
  51. package/dist/cjs/pds-text.cjs.entry.js +40 -1
  52. package/dist/cjs/pds-text.entry.cjs.js.map +1 -1
  53. package/dist/cjs/pds-textarea.cjs.entry.js +1 -1
  54. package/dist/cjs/pine-core.cjs.js +1 -1
  55. package/dist/cjs/truncation-tooltip-BGGnm8SZ.js +249 -0
  56. package/dist/cjs/truncation-tooltip-BGGnm8SZ.js.map +1 -0
  57. package/dist/collection/components/pds-button/pds-button.css +1 -1
  58. package/dist/collection/components/pds-button/pds-button.js +20 -4
  59. package/dist/collection/components/pds-button/pds-button.js.map +1 -1
  60. package/dist/collection/components/pds-copytext/pds-copytext.js +52 -2
  61. package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -1
  62. package/dist/collection/components/pds-multiselect/pds-multiselect.js +155 -14
  63. package/dist/collection/components/pds-multiselect/pds-multiselect.js.map +1 -1
  64. package/dist/collection/components/pds-multiselect/stories/pds-multiselect.stories.js +93 -0
  65. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +1 -1
  66. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +37 -3
  67. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -1
  68. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
  69. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -1
  70. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +3 -3
  71. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -1
  72. package/dist/collection/components/pds-table/pds-table.css +1 -0
  73. package/dist/collection/components/pds-table/pds-table.js +33 -17
  74. package/dist/collection/components/pds-table/pds-table.js.map +1 -1
  75. package/dist/collection/components/pds-table/stories/pds-table.stories.js +58 -0
  76. package/dist/collection/components/pds-text/pds-text.js +43 -2
  77. package/dist/collection/components/pds-text/pds-text.js.map +1 -1
  78. package/dist/collection/components/pds-text/stories/pds-text.stories.js +21 -2
  79. package/dist/collection/utils/truncation-tooltip.js +242 -0
  80. package/dist/collection/utils/truncation-tooltip.js.map +1 -0
  81. package/dist/docs.json +156 -18
  82. package/dist/esm/{index-D094LgxJ.js → index-BFkDH5XU.js} +3 -3
  83. package/dist/esm/index-BFkDH5XU.js.map +1 -0
  84. package/dist/esm/loader.js +1 -1
  85. package/dist/esm/pds-accordion.entry.js +1 -1
  86. package/dist/esm/pds-avatar.entry.js +1 -1
  87. package/dist/esm/pds-button.entry.js +16 -6
  88. package/dist/esm/pds-button.entry.js.map +1 -1
  89. package/dist/esm/pds-checkbox.entry.js +1 -1
  90. package/dist/esm/pds-chip.entry.js +1 -1
  91. package/dist/esm/pds-copytext.entry.js +49 -3
  92. package/dist/esm/pds-copytext.entry.js.map +1 -1
  93. package/dist/esm/pds-filter.entry.js +1 -1
  94. package/dist/esm/pds-input.entry.js +1 -1
  95. package/dist/esm/pds-link.entry.js +1 -1
  96. package/dist/esm/pds-multiselect.entry.js +62 -15
  97. package/dist/esm/pds-multiselect.entry.js.map +1 -1
  98. package/dist/esm/pds-radio-group.entry.js +1 -1
  99. package/dist/esm/pds-radio.entry.js +1 -1
  100. package/dist/esm/pds-select.entry.js +1 -1
  101. package/dist/esm/pds-sortable-item.entry.js +1 -1
  102. package/dist/esm/pds-switch.entry.js +1 -1
  103. package/dist/esm/pds-table-cell.entry.js +35 -3
  104. package/dist/esm/pds-table-cell.entry.js.map +1 -1
  105. package/dist/esm/pds-table-head-cell.entry.js +1 -1
  106. package/dist/esm/pds-table-head.entry.js +1 -1
  107. package/dist/esm/pds-table-head.entry.js.map +1 -1
  108. package/dist/esm/pds-table-row.entry.js +3 -3
  109. package/dist/esm/pds-table-row.entry.js.map +1 -1
  110. package/dist/esm/pds-table.entry.js +11 -4
  111. package/dist/esm/pds-table.entry.js.map +1 -1
  112. package/dist/esm/pds-text.entry.js +40 -1
  113. package/dist/esm/pds-text.entry.js.map +1 -1
  114. package/dist/esm/pds-textarea.entry.js +1 -1
  115. package/dist/esm/pine-core.js +1 -1
  116. package/dist/esm/truncation-tooltip-CTHpMbU3.js +247 -0
  117. package/dist/esm/truncation-tooltip-CTHpMbU3.js.map +1 -0
  118. package/dist/esm-es5/{index-D094LgxJ.js → index-BFkDH5XU.js} +1 -1
  119. package/dist/esm-es5/index-BFkDH5XU.js.map +1 -0
  120. package/dist/esm-es5/loader.js +1 -1
  121. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  122. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  123. package/dist/esm-es5/pds-button.entry.js +1 -1
  124. package/dist/esm-es5/pds-button.entry.js.map +1 -1
  125. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  126. package/dist/esm-es5/pds-chip.entry.js +1 -1
  127. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  128. package/dist/esm-es5/pds-copytext.entry.js.map +1 -1
  129. package/dist/esm-es5/pds-filter.entry.js +1 -1
  130. package/dist/esm-es5/pds-input.entry.js +1 -1
  131. package/dist/esm-es5/pds-link.entry.js +1 -1
  132. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  133. package/dist/esm-es5/pds-multiselect.entry.js.map +1 -1
  134. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  135. package/dist/esm-es5/pds-radio.entry.js +1 -1
  136. package/dist/esm-es5/pds-select.entry.js +1 -1
  137. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  138. package/dist/esm-es5/pds-switch.entry.js +1 -1
  139. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  140. package/dist/esm-es5/pds-table-cell.entry.js.map +1 -1
  141. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  142. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  143. package/dist/esm-es5/pds-table-head.entry.js.map +1 -1
  144. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  145. package/dist/esm-es5/pds-table-row.entry.js.map +1 -1
  146. package/dist/esm-es5/pds-table.entry.js +1 -1
  147. package/dist/esm-es5/pds-table.entry.js.map +1 -1
  148. package/dist/esm-es5/pds-text.entry.js +1 -1
  149. package/dist/esm-es5/pds-text.entry.js.map +1 -1
  150. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  151. package/dist/esm-es5/pine-core.js +1 -1
  152. package/dist/esm-es5/truncation-tooltip-CTHpMbU3.js +2 -0
  153. package/dist/esm-es5/truncation-tooltip-CTHpMbU3.js.map +1 -0
  154. package/dist/pine-core/{p-2aac4495.system.entry.js → p-15ac22bd.system.entry.js} +2 -2
  155. package/dist/pine-core/{p-425144ae.entry.js → p-1cc2fe8d.entry.js} +2 -2
  156. package/dist/pine-core/p-203f6e9e.entry.js +2 -0
  157. package/dist/pine-core/p-203f6e9e.entry.js.map +1 -0
  158. package/dist/pine-core/{p-0ac54273.entry.js → p-276f774a.entry.js} +2 -2
  159. package/dist/pine-core/p-27ccbd3f.entry.js +2 -0
  160. package/dist/pine-core/p-27ccbd3f.entry.js.map +1 -0
  161. package/dist/pine-core/p-2e22a1fc.system.entry.js +2 -0
  162. package/dist/pine-core/p-2e22a1fc.system.entry.js.map +1 -0
  163. package/dist/pine-core/{p-ce069162.entry.js → p-32f65e48.entry.js} +2 -2
  164. package/dist/pine-core/{p-36e5e9f4.system.entry.js → p-3ea301dd.system.entry.js} +2 -2
  165. package/dist/pine-core/p-3ea301dd.system.entry.js.map +1 -0
  166. package/dist/pine-core/p-4189f1be.system.entry.js +2 -0
  167. package/dist/pine-core/p-4189f1be.system.entry.js.map +1 -0
  168. package/dist/pine-core/{p-7d7dce2c.system.entry.js → p-4232520f.system.entry.js} +2 -2
  169. package/dist/pine-core/{p-8e40c9ef.entry.js → p-439e3343.entry.js} +2 -2
  170. package/dist/pine-core/p-439e3343.entry.js.map +1 -0
  171. package/dist/pine-core/{p-b46f66e8.system.entry.js → p-45c1f3ea.system.entry.js} +2 -2
  172. package/dist/pine-core/{p-5abc5d82.system.entry.js → p-49c2e2ce.system.entry.js} +2 -2
  173. package/dist/pine-core/{p-b1a7a0b2.entry.js → p-4de64b1f.entry.js} +2 -2
  174. package/dist/pine-core/{p-94c73d98.entry.js → p-4e015ddd.entry.js} +2 -2
  175. package/dist/pine-core/p-4e015ddd.entry.js.map +1 -0
  176. package/dist/pine-core/{p-0b52923b.system.entry.js → p-52c5ced3.system.entry.js} +2 -2
  177. package/dist/pine-core/{p-3815f565.entry.js → p-593cee44.entry.js} +2 -2
  178. package/dist/pine-core/{p-73bce0bf.entry.js → p-5a7b25d0.entry.js} +2 -2
  179. package/dist/pine-core/p-5hPM5knE.js +2 -0
  180. package/dist/pine-core/p-5hPM5knE.js.map +1 -0
  181. package/dist/pine-core/{p-48ed8147.entry.js → p-632e398f.entry.js} +2 -2
  182. package/dist/pine-core/{p-957647f9.entry.js → p-663abd80.entry.js} +2 -2
  183. package/dist/pine-core/{p-23111b1c.system.entry.js → p-6980edfe.system.entry.js} +2 -2
  184. package/dist/pine-core/{p-BxVkyfaO.system.js → p-6I02BpQf.system.js} +1 -1
  185. package/dist/pine-core/p-6I02BpQf.system.js.map +1 -0
  186. package/dist/pine-core/{p-c9965216.system.entry.js → p-6fbe6be4.system.entry.js} +2 -2
  187. package/dist/pine-core/p-7514a191.entry.js +2 -0
  188. package/dist/pine-core/p-7514a191.entry.js.map +1 -0
  189. package/dist/pine-core/{p-bd18b9bf.system.entry.js → p-77d4f274.system.entry.js} +2 -2
  190. package/dist/pine-core/{p-78246e05.entry.js → p-85ce731b.entry.js} +2 -2
  191. package/dist/pine-core/{p-b1820970.system.entry.js → p-87cee4a0.system.entry.js} +2 -2
  192. package/dist/pine-core/{p-fbd8ae50.entry.js → p-88686193.entry.js} +2 -2
  193. package/dist/pine-core/p-88eb4f6c.entry.js +2 -0
  194. package/dist/pine-core/p-88eb4f6c.entry.js.map +1 -0
  195. package/dist/pine-core/{p-b09bde5c.system.entry.js → p-8ab66dbc.system.entry.js} +2 -2
  196. package/dist/pine-core/p-8be316b4.system.entry.js +2 -0
  197. package/dist/pine-core/p-8be316b4.system.entry.js.map +1 -0
  198. package/dist/pine-core/{p-7a11a6c7.entry.js → p-8f935480.entry.js} +2 -2
  199. package/dist/pine-core/p-9263809e.entry.js +2 -0
  200. package/dist/pine-core/p-9263809e.entry.js.map +1 -0
  201. package/dist/pine-core/{p-3f05d72e.system.entry.js → p-9e3e441c.system.entry.js} +2 -2
  202. package/dist/pine-core/{p-3cd53462.entry.js → p-9e8296fc.entry.js} +2 -2
  203. package/dist/pine-core/{p-BJPmPVaF.system.js.map → p-B3dAc5EW.system.js.map} +1 -1
  204. package/dist/pine-core/p-B48FyOD0.system.js.map +1 -0
  205. package/dist/pine-core/{p-DY97YDUU.system.js.map → p-B5CyjPYU.system.js.map} +1 -1
  206. package/dist/pine-core/{p-8KFA3I5T.system.js.map → p-B8CAflct.system.js.map} +1 -1
  207. package/dist/pine-core/{p-N-jt0_Yl.system.js.map → p-BBJXL9br.system.js.map} +1 -1
  208. package/dist/pine-core/{p-D094LgxJ.js → p-BFkDH5XU.js} +1 -1
  209. package/dist/pine-core/p-BFkDH5XU.js.map +1 -0
  210. package/dist/pine-core/{p-CjQwwLdV.system.js.map → p-Bd3ynCsJ.system.js.map} +1 -1
  211. package/dist/pine-core/{p-D4YdQDsG.system.js.map → p-BiLmvJTd.system.js.map} +1 -1
  212. package/dist/pine-core/{p-PZw10cnm.system.js.map → p-C8y7SAd7.system.js.map} +1 -1
  213. package/dist/pine-core/{p-gcCcHox5.system.js.map → p-CCh7iS6N.system.js.map} +1 -1
  214. package/dist/pine-core/p-CEE11B7K.system.js.map +1 -0
  215. package/dist/pine-core/{p-eT6pKhWF.system.js.map → p-CObf7nrT.system.js.map} +1 -1
  216. package/dist/pine-core/p-CPri5wQG.system.js.map +1 -0
  217. package/dist/pine-core/{p-D3Ug1A-l.system.js.map → p-CbRBe3Eq.system.js.map} +1 -1
  218. package/dist/pine-core/{p-c2oMjk1r.system.js.map → p-Ctc231vq.system.js.map} +1 -1
  219. package/dist/pine-core/p-DXVwADJT.system.js +2 -0
  220. package/dist/pine-core/p-DXVwADJT.system.js.map +1 -0
  221. package/dist/pine-core/p-DenbFuEN.system.js.map +1 -0
  222. package/dist/pine-core/{p-BnJypAy2.system.js.map → p-DhLX7iDs.system.js.map} +1 -1
  223. package/dist/pine-core/p-Dkz0RoFB.system.js.map +1 -0
  224. package/dist/pine-core/p-G3GztZmn.system.js.map +1 -0
  225. package/dist/pine-core/p-JAVnELnm.system.js +1 -1
  226. package/dist/pine-core/{p-15e554ae.entry.js → p-a30edeb1.entry.js} +2 -2
  227. package/dist/pine-core/{p-5O8bhSdk.system.js.map → p-aKHwHZQR.system.js.map} +1 -1
  228. package/dist/pine-core/{p-fce519e3.system.entry.js → p-b416cb4b.system.entry.js} +2 -2
  229. package/dist/pine-core/p-b416cb4b.system.entry.js.map +1 -0
  230. package/dist/pine-core/{p-d2b2caa2.system.entry.js → p-b6f57c0f.system.entry.js} +2 -2
  231. package/dist/pine-core/p-b7f2f9f3.system.entry.js +2 -0
  232. package/dist/pine-core/p-b7f2f9f3.system.entry.js.map +1 -0
  233. package/dist/pine-core/p-c25ea8de.entry.js +2 -0
  234. package/dist/pine-core/p-c25ea8de.entry.js.map +1 -0
  235. package/dist/pine-core/p-e78986ea.system.entry.js +2 -0
  236. package/dist/pine-core/p-e78986ea.system.entry.js.map +1 -0
  237. package/dist/pine-core/{p-13105538.system.entry.js → p-f795d3fe.system.entry.js} +2 -2
  238. package/dist/pine-core/p-f7d9bZ8U.system.js.map +1 -0
  239. package/dist/pine-core/p-f81b0dbb.system.entry.js +2 -0
  240. package/dist/pine-core/p-f81b0dbb.system.entry.js.map +1 -0
  241. package/dist/pine-core/{p-2d21bc31.entry.js → p-f8a2aedd.entry.js} +2 -2
  242. package/dist/pine-core/{p-f0df10c7.system.entry.js → p-fbe793c7.system.entry.js} +2 -2
  243. package/dist/pine-core/{p-CQtQQn3_.system.js.map → p-hL5Id7g5.system.js.map} +1 -1
  244. package/dist/pine-core/{p-BK1BTkTt.system.js.map → p-hzdqYC6e.system.js.map} +1 -1
  245. package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
  246. package/dist/pine-core/pds-copytext.entry.esm.js.map +1 -1
  247. package/dist/pine-core/pds-multiselect.entry.esm.js.map +1 -1
  248. package/dist/pine-core/pds-table-cell.entry.esm.js.map +1 -1
  249. package/dist/pine-core/pds-table-head.entry.esm.js.map +1 -1
  250. package/dist/pine-core/pds-table-row.entry.esm.js.map +1 -1
  251. package/dist/pine-core/pds-table.entry.esm.js.map +1 -1
  252. package/dist/pine-core/pds-text.entry.esm.js.map +1 -1
  253. package/dist/pine-core/pine-core.esm.js +1 -1
  254. package/dist/types/components/pds-button/pds-button.d.ts +4 -0
  255. package/dist/types/components/pds-copytext/pds-copytext.d.ts +10 -0
  256. package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +31 -0
  257. package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +7 -1
  258. package/dist/types/components/pds-table/pds-table-row/pds-table-row.d.ts +1 -1
  259. package/dist/types/components/pds-table/pds-table.d.ts +6 -7
  260. package/dist/types/components/pds-text/pds-text.d.ts +9 -0
  261. package/dist/types/components.d.ts +55 -11
  262. package/dist/types/utils/truncation-tooltip.d.ts +21 -0
  263. package/dist/vscode.html-data.json +33 -5
  264. package/hydrate/index.js +458 -35
  265. package/hydrate/index.mjs +458 -35
  266. package/package.json +2 -2
  267. package/dist/cjs/index-DkQebouX.js.map +0 -1
  268. package/dist/esm/index-D094LgxJ.js.map +0 -1
  269. package/dist/esm-es5/index-D094LgxJ.js.map +0 -1
  270. package/dist/pine-core/p-003884fd.entry.js +0 -2
  271. package/dist/pine-core/p-003884fd.entry.js.map +0 -1
  272. package/dist/pine-core/p-1971d358.entry.js +0 -2
  273. package/dist/pine-core/p-1971d358.entry.js.map +0 -1
  274. package/dist/pine-core/p-23aba538.entry.js +0 -2
  275. package/dist/pine-core/p-23aba538.entry.js.map +0 -1
  276. package/dist/pine-core/p-36e5e9f4.system.entry.js.map +0 -1
  277. package/dist/pine-core/p-3b0a4abe.entry.js +0 -2
  278. package/dist/pine-core/p-3b0a4abe.entry.js.map +0 -1
  279. package/dist/pine-core/p-3c026ec7.system.entry.js +0 -2
  280. package/dist/pine-core/p-3c026ec7.system.entry.js.map +0 -1
  281. package/dist/pine-core/p-49c4f34a.entry.js +0 -2
  282. package/dist/pine-core/p-49c4f34a.entry.js.map +0 -1
  283. package/dist/pine-core/p-6918b378.system.entry.js +0 -2
  284. package/dist/pine-core/p-6918b378.system.entry.js.map +0 -1
  285. package/dist/pine-core/p-8e40c9ef.entry.js.map +0 -1
  286. package/dist/pine-core/p-93d0be59.entry.js +0 -2
  287. package/dist/pine-core/p-93d0be59.entry.js.map +0 -1
  288. package/dist/pine-core/p-94c73d98.entry.js.map +0 -1
  289. package/dist/pine-core/p-BpZTjdau.system.js.map +0 -1
  290. package/dist/pine-core/p-BxVkyfaO.system.js.map +0 -1
  291. package/dist/pine-core/p-CjnIO2Ro.system.js.map +0 -1
  292. package/dist/pine-core/p-D094LgxJ.js.map +0 -1
  293. package/dist/pine-core/p-DJYyo0MJ.system.js.map +0 -1
  294. package/dist/pine-core/p-DZEhYV6y.system.js.map +0 -1
  295. package/dist/pine-core/p-Ri89mw0-.system.js.map +0 -1
  296. package/dist/pine-core/p-ZUqfslIz.system.js.map +0 -1
  297. package/dist/pine-core/p-aeb2f6ac.system.entry.js +0 -2
  298. package/dist/pine-core/p-aeb2f6ac.system.entry.js.map +0 -1
  299. package/dist/pine-core/p-cb8c24ad.system.entry.js +0 -2
  300. package/dist/pine-core/p-cb8c24ad.system.entry.js.map +0 -1
  301. package/dist/pine-core/p-d83d6fce.system.entry.js +0 -2
  302. package/dist/pine-core/p-d83d6fce.system.entry.js.map +0 -1
  303. package/dist/pine-core/p-ef9c539e.system.entry.js +0 -2
  304. package/dist/pine-core/p-ef9c539e.system.entry.js.map +0 -1
  305. package/dist/pine-core/p-fce519e3.system.entry.js.map +0 -1
  306. package/dist/pine-core/p-kYQszSpu.system.js.map +0 -1
  307. /package/dist/pine-core/{p-2aac4495.system.entry.js.map → p-15ac22bd.system.entry.js.map} +0 -0
  308. /package/dist/pine-core/{p-425144ae.entry.js.map → p-1cc2fe8d.entry.js.map} +0 -0
  309. /package/dist/pine-core/{p-0ac54273.entry.js.map → p-276f774a.entry.js.map} +0 -0
  310. /package/dist/pine-core/{p-ce069162.entry.js.map → p-32f65e48.entry.js.map} +0 -0
  311. /package/dist/pine-core/{p-7d7dce2c.system.entry.js.map → p-4232520f.system.entry.js.map} +0 -0
  312. /package/dist/pine-core/{p-b46f66e8.system.entry.js.map → p-45c1f3ea.system.entry.js.map} +0 -0
  313. /package/dist/pine-core/{p-5abc5d82.system.entry.js.map → p-49c2e2ce.system.entry.js.map} +0 -0
  314. /package/dist/pine-core/{p-b1a7a0b2.entry.js.map → p-4de64b1f.entry.js.map} +0 -0
  315. /package/dist/pine-core/{p-0b52923b.system.entry.js.map → p-52c5ced3.system.entry.js.map} +0 -0
  316. /package/dist/pine-core/{p-3815f565.entry.js.map → p-593cee44.entry.js.map} +0 -0
  317. /package/dist/pine-core/{p-73bce0bf.entry.js.map → p-5a7b25d0.entry.js.map} +0 -0
  318. /package/dist/pine-core/{p-48ed8147.entry.js.map → p-632e398f.entry.js.map} +0 -0
  319. /package/dist/pine-core/{p-957647f9.entry.js.map → p-663abd80.entry.js.map} +0 -0
  320. /package/dist/pine-core/{p-23111b1c.system.entry.js.map → p-6980edfe.system.entry.js.map} +0 -0
  321. /package/dist/pine-core/{p-c9965216.system.entry.js.map → p-6fbe6be4.system.entry.js.map} +0 -0
  322. /package/dist/pine-core/{p-bd18b9bf.system.entry.js.map → p-77d4f274.system.entry.js.map} +0 -0
  323. /package/dist/pine-core/{p-78246e05.entry.js.map → p-85ce731b.entry.js.map} +0 -0
  324. /package/dist/pine-core/{p-b1820970.system.entry.js.map → p-87cee4a0.system.entry.js.map} +0 -0
  325. /package/dist/pine-core/{p-fbd8ae50.entry.js.map → p-88686193.entry.js.map} +0 -0
  326. /package/dist/pine-core/{p-b09bde5c.system.entry.js.map → p-8ab66dbc.system.entry.js.map} +0 -0
  327. /package/dist/pine-core/{p-7a11a6c7.entry.js.map → p-8f935480.entry.js.map} +0 -0
  328. /package/dist/pine-core/{p-3f05d72e.system.entry.js.map → p-9e3e441c.system.entry.js.map} +0 -0
  329. /package/dist/pine-core/{p-3cd53462.entry.js.map → p-9e8296fc.entry.js.map} +0 -0
  330. /package/dist/pine-core/{p-15e554ae.entry.js.map → p-a30edeb1.entry.js.map} +0 -0
  331. /package/dist/pine-core/{p-d2b2caa2.system.entry.js.map → p-b6f57c0f.system.entry.js.map} +0 -0
  332. /package/dist/pine-core/{p-13105538.system.entry.js.map → p-f795d3fe.system.entry.js.map} +0 -0
  333. /package/dist/pine-core/{p-2d21bc31.entry.js.map → p-f8a2aedd.entry.js.map} +0 -0
  334. /package/dist/pine-core/{p-f0df10c7.system.entry.js.map → p-fbe793c7.system.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table-cell.entry.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 /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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: middle;\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: var(--pine-z-index-raised);\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":[],"mappings":";;AAAA,MAAM,eAAe,GAAG,mkCAAmkC;;MCO9kC,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,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;;;YAG1E,IAAI,CAAC,mBAAmB,EAAE;;;IAI9B,oBAAoB,G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sulation=shadow","src/components/pds-table/pds-table-cell/pds-table-cell.tsx"],"sourcesContent":[":host {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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: middle;\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: var(--pine-z-index-raised);\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: var(--pds-table-cell-truncate-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, Watch, h } from '@stencil/core';\nimport { setupTruncationTooltip } from '../../../utils/truncation-tooltip';\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 private truncationCleanup: (() => void) | null = null;\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 if (this.truncate) {\n this.initTruncationTooltip();\n }\n }\n\n disconnectedCallback() {\n this.cleanupScrollListener();\n this.destroyTruncationTooltip();\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 and adds an ellipsis.\n * When text overflows, a tooltip showing the full text will appear on hover/focus.\n * Note: When truncate is enabled, the element automatically receives tabindex=\"0\" for keyboard accessibility.\n */\n @Prop() truncate: boolean;\n\n @Watch('truncate')\n handleTruncateChange(newValue: boolean) {\n if (newValue) {\n this.initTruncationTooltip();\n } else {\n this.destroyTruncationTooltip();\n }\n }\n\n /**\n * Determines if the table is currently scrolling.\n * @defaultValue false\n */\n @State() private tableScrolling: boolean = false;\n\n private initTruncationTooltip() {\n this.destroyTruncationTooltip();\n\n this.truncationCleanup = setupTruncationTooltip({\n hostEl: this.hostElement,\n contentEl: this.hostElement,\n getTooltipText: () => this.hostElement.textContent || '',\n });\n }\n\n private destroyTruncationTooltip() {\n if (this.truncationCleanup) {\n this.truncationCleanup();\n this.truncationCleanup = null;\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-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 tabIndex={this.truncate ? 0 : undefined}\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":[],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,6mCAA6mC;;MCQxnC,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAQU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAE1C,QAAA,IAAY,CAAA,YAAA,GAAW,CAAC;AACxB,QAAA,IAAiB,CAAA,iBAAA,GAAwB,IAAI;AAoFrD;;;AAGG;AACc,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;AAyChD;;;;AAIG;AACK,QAAA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;;;"}
@@ -1,2 +1,2 @@
1
- import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as upSmall,d as downSmall}from"./index-D094LgxJ.js";var pdsTableHeadCellCss=":host{--border-head-cell-default:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);--box-shadow-default:3px 3px 6px -2px rgba(0, 0, 0, 0.1);-webkit-border-after:var(--border-head-cell-default);border-block-end:var(--border-head-cell-default);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);padding:var(--pine-dimension-sm);position:relative;text-align:start;vertical-align:inherit}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(.is-fixed.has-head-background){background-color:var(--pine-color-background-subtle)}:host(.has-head-border){-webkit-border-before:var(--border-head-cell-default);border-block-start:var(--border-head-cell-default)}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-default);box-shadow:var(--box-shadow-default)}:host(.is-sortable){cursor:pointer}:host(.is-sortable) pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs);-webkit-padding-before:2px;padding-block-start:2px;position:absolute}:host(.is-sortable:hover),:host(.is-active){color:var(--pine-color-text-strong)}:host(.pds-table-head-cell--align-start){text-align:start}:host(.pds-table-head-cell--align-center){text-align:center}:host(.pds-table-head-cell--align-end){text-align:end}:host(.pds-table-head-cell--align-justify){text-align:justify}";var PdsTableHeadCell=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableSort=createEvent(this,"pdsTableSort");this.scrollContainer=null;this.setupRetries=0;this.sortingDirection="asc";this.tableScrolling=false;this.isSelected=false;this.hasHeadBorder=false;this.hasHeadBackground=false;this.isActive=false;this.handleScroll=function(){if(!e.scrollContainer){return}try{e.tableScrolling=e.scrollContainer.scrollLeft>0}catch(t){console.warn("Scroll handler error:",t)}};this.toggleSort=function(){if(e.sortable){if(!e.tableRef){return}var t=e.hostElement.innerText.trim();e.sortingDirection=e.sortingDirection==="asc"?"desc":"asc";e.tableRef.querySelectorAll("pds-table-head-cell").forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!(t!==this.hostElement))return[3,2];e=t;return[4,e.clearActiveSort()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))}));e.isActive=true;e.hostElement.classList.add("is-active");e.pdsTableSort.emit({column:t,direction:e.sortingDirection})}}}t.prototype.setActiveSort=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.sortable)return[2];this.sortingDirection=t;this.isActive=true;this.hostElement.classList.add("is-active");return[2]}))}))};t.prototype.clearActiveSort=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=false;this.hostElement.classList.remove("is-active");return[2]}))}))};t.prototype.componentWillLoad=function(){this.tableRef=this.hostElement.closest("pds-table");var t=this.hostElement.closest("pds-table-head");if(t){this.hasHeadBorder=t.hasAttribute("border");this.hasHeadBackground=t.hasAttribute("background")}};t.prototype.componentDidLoad=function(){var t=this;if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.setupScrollListener()}var e=this.hostElement.closest("pds-table-head");if(e&&typeof MutationObserver!=="undefined"){if(this.headObserver){this.headObserver.disconnect()}this.headObserver=new MutationObserver((function(){t.hasHeadBorder=e.hasAttribute("border");t.hasHeadBackground=e.hasAttribute("background")}));this.headObserver.observe(e,{attributes:true,attributeFilter:["border","background"]})}};t.prototype.disconnectedCallback=function(){this.cleanupScrollListener();if(this.headObserver){this.headObserver.disconnect()}};t.prototype.setupScrollListener=function(){var t=this;var e;if(!this.tableRef)return;var i=(e=this.tableRef.shadowRoot)===null||e===void 0?void 0:e.querySelector(".pds-table-responsive-container");if(i){this.scrollContainer=i;this.scrollContainer.addEventListener("scroll",this.handleScroll,{passive:true});this.handleScroll();this.setupRetries=0}else{this.setupTimer=window.setTimeout((function(){if(t.scrollContainer)return;t.setupRetries=(t.setupRetries||0)+1;if(t.setupRetries<=50){t.setupScrollListener()}else{console.warn("Failed to find responsive container after 50 attempts")}}),100)}};t.prototype.cleanupScrollListener=function(){if(this.scrollContainer){this.scrollContainer.removeEventListener("scroll",this.handleScroll);this.scrollContainer=null}if(this.setupTimer!==undefined){window.clearTimeout(this.setupTimer);this.setupTimer=undefined}this.setupRetries=0};t.prototype.classNames=function(){var t=[];if(this.tableRef&&this.tableRef.compact){t.push("is-compact")}if(this.cellAlign){t.push("pds-table-head-cell--align-".concat(this.cellAlign))}if(this.sortable){t.push("is-sortable")}if(this.sortable&&this.sortingDirection!==null){t.push("sort-"+this.sortingDirection)}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){t.push("has-scrolled")}if(this.hasHeadBackground){t.push("has-head-background")}if(this.hasHeadBorder){t.push("has-head-border")}return t.join(" ")};t.prototype.render=function(){return h(Host,{key:"a0196e242282574b969375a4767950ffd7a1e5b8",class:this.classNames(),role:"columnheader",onClick:this.toggleSort,part:"head-cell",style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},h("slot",{key:"90f6d190ed912276fb8ff5607a80b592d1884d71"}),this.sortable&&this.isActive&&h("pds-icon",{key:"128bd50d5163ea1690a66a4bef227480a0076f39",icon:this.sortingDirection==="asc"?upSmall:downSmall,part:"sort-icon"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableHeadCell.style=pdsTableHeadCellCss;export{PdsTableHeadCell as pds_table_head_cell};
1
+ import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as upSmall,d as downSmall}from"./index-BFkDH5XU.js";var pdsTableHeadCellCss=":host{--border-head-cell-default:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);--box-shadow-default:3px 3px 6px -2px rgba(0, 0, 0, 0.1);-webkit-border-after:var(--border-head-cell-default);border-block-end:var(--border-head-cell-default);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);padding:var(--pine-dimension-sm);position:relative;text-align:start;vertical-align:inherit}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(.is-fixed.has-head-background){background-color:var(--pine-color-background-subtle)}:host(.has-head-border){-webkit-border-before:var(--border-head-cell-default);border-block-start:var(--border-head-cell-default)}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-default);box-shadow:var(--box-shadow-default)}:host(.is-sortable){cursor:pointer}:host(.is-sortable) pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs);-webkit-padding-before:2px;padding-block-start:2px;position:absolute}:host(.is-sortable:hover),:host(.is-active){color:var(--pine-color-text-strong)}:host(.pds-table-head-cell--align-start){text-align:start}:host(.pds-table-head-cell--align-center){text-align:center}:host(.pds-table-head-cell--align-end){text-align:end}:host(.pds-table-head-cell--align-justify){text-align:justify}";var PdsTableHeadCell=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableSort=createEvent(this,"pdsTableSort");this.scrollContainer=null;this.setupRetries=0;this.sortingDirection="asc";this.tableScrolling=false;this.isSelected=false;this.hasHeadBorder=false;this.hasHeadBackground=false;this.isActive=false;this.handleScroll=function(){if(!e.scrollContainer){return}try{e.tableScrolling=e.scrollContainer.scrollLeft>0}catch(t){console.warn("Scroll handler error:",t)}};this.toggleSort=function(){if(e.sortable){if(!e.tableRef){return}var t=e.hostElement.innerText.trim();e.sortingDirection=e.sortingDirection==="asc"?"desc":"asc";e.tableRef.querySelectorAll("pds-table-head-cell").forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!(t!==this.hostElement))return[3,2];e=t;return[4,e.clearActiveSort()];case 1:i.sent();i.label=2;case 2:return[2]}}))}))}));e.isActive=true;e.hostElement.classList.add("is-active");e.pdsTableSort.emit({column:t,direction:e.sortingDirection})}}}t.prototype.setActiveSort=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.sortable)return[2];this.sortingDirection=t;this.isActive=true;this.hostElement.classList.add("is-active");return[2]}))}))};t.prototype.clearActiveSort=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=false;this.hostElement.classList.remove("is-active");return[2]}))}))};t.prototype.componentWillLoad=function(){this.tableRef=this.hostElement.closest("pds-table");var t=this.hostElement.closest("pds-table-head");if(t){this.hasHeadBorder=t.hasAttribute("border");this.hasHeadBackground=t.hasAttribute("background")}};t.prototype.componentDidLoad=function(){var t=this;if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.setupScrollListener()}var e=this.hostElement.closest("pds-table-head");if(e&&typeof MutationObserver!=="undefined"){if(this.headObserver){this.headObserver.disconnect()}this.headObserver=new MutationObserver((function(){t.hasHeadBorder=e.hasAttribute("border");t.hasHeadBackground=e.hasAttribute("background")}));this.headObserver.observe(e,{attributes:true,attributeFilter:["border","background"]})}};t.prototype.disconnectedCallback=function(){this.cleanupScrollListener();if(this.headObserver){this.headObserver.disconnect()}};t.prototype.setupScrollListener=function(){var t=this;var e;if(!this.tableRef)return;var i=(e=this.tableRef.shadowRoot)===null||e===void 0?void 0:e.querySelector(".pds-table-responsive-container");if(i){this.scrollContainer=i;this.scrollContainer.addEventListener("scroll",this.handleScroll,{passive:true});this.handleScroll();this.setupRetries=0}else{this.setupTimer=window.setTimeout((function(){if(t.scrollContainer)return;t.setupRetries=(t.setupRetries||0)+1;if(t.setupRetries<=50){t.setupScrollListener()}else{console.warn("Failed to find responsive container after 50 attempts")}}),100)}};t.prototype.cleanupScrollListener=function(){if(this.scrollContainer){this.scrollContainer.removeEventListener("scroll",this.handleScroll);this.scrollContainer=null}if(this.setupTimer!==undefined){window.clearTimeout(this.setupTimer);this.setupTimer=undefined}this.setupRetries=0};t.prototype.classNames=function(){var t=[];if(this.tableRef&&this.tableRef.compact){t.push("is-compact")}if(this.cellAlign){t.push("pds-table-head-cell--align-".concat(this.cellAlign))}if(this.sortable){t.push("is-sortable")}if(this.sortable&&this.sortingDirection!==null){t.push("sort-"+this.sortingDirection)}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){t.push("has-scrolled")}if(this.hasHeadBackground){t.push("has-head-background")}if(this.hasHeadBorder){t.push("has-head-border")}return t.join(" ")};t.prototype.render=function(){return h(Host,{key:"a0196e242282574b969375a4767950ffd7a1e5b8",class:this.classNames(),role:"columnheader",onClick:this.toggleSort,part:"head-cell",style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},h("slot",{key:"90f6d190ed912276fb8ff5607a80b592d1884d71"}),this.sortable&&this.isActive&&h("pds-icon",{key:"128bd50d5163ea1690a66a4bef227480a0076f39",icon:this.sortingDirection==="asc"?upSmall:downSmall,part:"sort-icon"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableHeadCell.style=pdsTableHeadCellCss;export{PdsTableHeadCell as pds_table_head_cell};
2
2
  //# sourceMappingURL=pds-table-head-cell.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableHeadCss=":host{--border-head-default:var(--pine-border-width-thin) solid var(--pine-color-background-subtle);border-color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table-header-group;vertical-align:middle}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host pds-table-checkbox-cell{-webkit-border-after:var(--border-head-default);border-block-end:var(--border-head-default)}:host([border]){-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([border]) pds-table-head-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([background]){background-color:var(--pine-color-background-subtle)}:host([background]) pds-table-head-cell{background-color:var(--pine-color-background-subtle)}";var PdsTableHead=function(){function e(e){var r=this;registerInstance(this,e);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.border=false;this.background=false;this.generateUniqueId=function(){var e=Math.random().toString(36).substring(2,8);var r=(new Date).toISOString().replace(/[:.]/g,"-");var t="".concat(e,"-").concat(r);return t};this.handleInput=function(e){r.isSelected=!e.target.checked;r.handleSelect(r.isSelected)};this.handleSelect=function(e){r.indeterminate=false;if(closest("pds-table-head",r.hostElement)){r.pdsTableSelectAll.emit({isSelected:e})}}}e.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var e=this.hostElement.querySelector("pds-table-head-cell:first-child");e===null||e===void 0?void 0:e.classList.add("is-fixed")}};e.prototype.render=function(){return h(Host,{key:"d5d5906bdb23794b911ecd5904a4cc58aa5380d6",role:"row",part:"head"},this.tableRef&&this.tableRef.selectable&&h("pds-table-head-cell",{key:"85df57fb4371e4fba855e16ce62c8329b49e08cf",part:this.tableRef.selectable?"checkbox-cell":""},h("pds-checkbox",{key:"92e95501de3644d068fb015b669329db14a4dd9b",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:"b51c670f2e59fb07d4b97ca201a0d28d5c2c9570"}))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsTableHead.style=pdsTableHeadCss;export{PdsTableHead as pds_table_head};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableHeadCss=":host{--border-head-default:var(--pine-border-width-thin) solid var(--pine-color-background-subtle);border-color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table-header-group;vertical-align:middle}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host pds-table-checkbox-cell{-webkit-border-after:var(--border-head-default);border-block-end:var(--border-head-default)}:host([border]){-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([border]) pds-table-head-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host([background]){background-color:var(--pine-color-background-subtle)}:host([background]) pds-table-head-cell{background-color:var(--pine-color-background-subtle)}";var PdsTableHead=function(){function e(e){var r=this;registerInstance(this,e);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.border=false;this.background=false;this.generateUniqueId=function(){var e=Math.random().toString(36).substring(2,8);var r=(new Date).toISOString().replace(/[:.]/g,"-");var t="".concat(e,"-").concat(r);return t};this.handleInput=function(e){r.isSelected=!e.target.checked;r.handleSelect(r.isSelected)};this.handleSelect=function(e){r.indeterminate=false;if(closest("pds-table-head",r.hostElement)){r.pdsTableSelectAll.emit({isSelected:e})}}}e.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var e=this.hostElement.querySelector("pds-table-head-cell:first-child");e===null||e===void 0?void 0:e.classList.add("is-fixed")}};e.prototype.render=function(){return h(Host,{key:"d5d5906bdb23794b911ecd5904a4cc58aa5380d6",role:"row",part:"head"},this.tableRef&&this.tableRef.selectable&&h("pds-table-head-cell",{key:"85df57fb4371e4fba855e16ce62c8329b49e08cf",part:this.tableRef.selectable?"checkbox-cell":""},!this.tableRef.disableSelectAll&&h("pds-checkbox",{key:"92bd5565463e29d249d1ac71d9dc0d000f3eea79",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:"494dc0395da229a264c38540479f36967601cc26"}))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsTableHead.style=pdsTableHeadCss;export{PdsTableHead as pds_table_head};
2
2
  //# sourceMappingURL=pds-table-head.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table-head.entry.js","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-background-subtle);\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: var(--pine-z-index-raised);\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n\n:host([border]) {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([border]) pds-table-head-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([background]) {\n background-color: var(--pine-color-background-subtle);\n}\n\n:host([background]) pds-table-head-cell {\n background-color: var(--pine-color-background-subtle);\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 * Adds top and bottom borders to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) border = false;\n\n /**\n * Adds a subtle background color to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) background = false;\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"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG,87CAA87C;;MCQz8C,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBE;;;AAGG;AACsB,QAAA,IAAM,CAAA,MAAA,GAAG,KAAK;AAEvC;;;AAGG;AACsB,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK;AAOnC,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,C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AM,EAAA,EACzB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KACxC,CAAqB,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;;;;;;;;"}
1
+ {"version":3,"file":"pds-table-head.entry.js","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-background-subtle);\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: var(--pine-z-index-raised);\n }\n}\n\n:host pds-table-checkbox-cell {\n border-block-end: var(--border-head-default);\n}\n\n:host([border]) {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([border]) pds-table-head-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n border-block-start: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host([background]) {\n background-color: var(--pine-color-background-subtle);\n}\n\n:host([background]) pds-table-head-cell {\n background-color: var(--pine-color-background-subtle);\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 * Adds top and bottom borders to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) border = false;\n\n /**\n * Adds a subtle background color to the table head.\n * @defaultValue false\n */\n @Prop({ reflect: true }) background = false;\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 {!this.tableRef.disableSelectAll && (\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 )}\n </pds-table-head-cell>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG,87CAA87C;;MCQz8C,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBE;;;AAGG;AACsB,QAAA,IAAM,CAAA,MAAA,GAAG,KAAK;AAEvC;;;AAGG;AACsB,QAAA,IAAU,CAAA,UAAA,GAAG,KAAK;AAOnC,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,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;AACpC,SAAC;AAEO,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,UAAmB,KAAI;AAC7C,YAAA,IAAI,CAAC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ACzB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,IAAI,EAAC,qBAAqB,EAC1B,CAAA,CACH,CACmB,CACvB,EACD,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableRowCss=":host{--color-background-interactive:var(--pine-color-background-subtle);border-color:inherit;display:table-row;vertical-align:inherit}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(:hover),:host(:hover)::part(checkbox-cell),:host(:hover) ::slotted(pds-table-cell),:host(.is-selected),:host(.is-selected)::part(checkbox-cell),:host(.is-selected) ::slotted(pds-table-cell){background:var(--color-background-interactive)}:host(.has-divider) ::slotted(pds-table-cell),:host(.has-divider) pds-table-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host(.has-divider.is-last-row) ::slotted(pds-table-cell),:host(.has-divider.is-last-row) pds-table-cell{-webkit-border-after:0;border-block-end:0}";var PdsTableRow=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableRowSelected=createEvent(this,"pdsTableRowSelected");this.observer=null;this.bodyObserver=null;this.hasDivider=false;this.isLastRow=false;this.handleClick=function(){e.isSelected=!e.isSelected;e.handleSelect(e.isSelected)};this.handleSelect=function(t){e.indeterminate=false;if(!closest("pds-table-head",e.hostElement)){var i=Array.from(e.hostElement.parentNode.children).indexOf(e.hostElement);e.pdsTableRowSelected.emit({rowIndex:i,isSelected:t})}};this.generateUniqueId=function(){var t=Math.random().toString(36).substring(2,8);var e=(new Date).toISOString().replace(/[:.]/g,"-");var i="".concat(t,"-").concat(e);return i}}t.prototype.classNames=function(){var t=[];if(this.isSelected){t.push("is-selected")}if(this.hasDivider){t.push("has-divider")}if(this.isLastRow){t.push("is-last-row")}return t.join(" ")};t.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var t=this.hostElement.querySelector("pds-table-cell");t===null||t===void 0?void 0:t.classList.add("is-fixed")}};t.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};t.prototype.connectedCallback=function(){this.tableRef=this.hostElement.closest("pds-table");this.setupObservers();this.updateDividerState()};t.prototype.disconnectedCallback=function(){this.cleanupObservers()};t.prototype.cleanupObservers=function(){if(this.observer){this.observer.disconnect();this.observer=null}if(this.bodyObserver){this.bodyObserver.disconnect();this.bodyObserver=null}};t.prototype.setupObservers=function(){var t=this;this.cleanupObservers();if(this.tableRef&&typeof MutationObserver!=="undefined"){this.observer=new MutationObserver((function(){t.updateDividerState()}));this.observer.observe(this.tableRef,{attributes:true,attributeFilter:["row-dividers"]})}var e=this.hostElement.closest("pds-table-body");if(e&&typeof MutationObserver!=="undefined"){this.bodyObserver=new MutationObserver((function(){t.updateLastRowState()}));this.bodyObserver.observe(e,{childList:true})}};t.prototype.shouldHaveDivider=function(){if(!this.tableRef){this.tableRef=this.hostElement.closest("pds-table")}return!!(this.tableRef&&this.tableRef.rowDividers)};t.prototype.updateDividerState=function(){this.hasDivider=this.shouldHaveDivider();this.updateLastRowState()};t.prototype.updateLastRowState=function(){if(!this.hasDivider){this.isLastRow=false;return}var t=this.hostElement.closest("pds-table-body");if(t){var e=Array.from(t.querySelectorAll("pds-table-row"));this.isLastRow=e[e.length-1]===this.hostElement}else{this.isLastRow=false}};t.prototype.render=function(){return h(Host,{key:"ad282466c93a2f9bc15dd466bdc4c6ac4e408042",class:this.classNames(),role:"row",part:"row"},this.tableRef&&this.tableRef.selectable&&h("pds-table-cell",{key:"19d88e362f07c3ce546356c1abdf7027e6701b3a",part:this.tableRef.fixedColumn?"checkbox-cell":"checkbox-cell",class:this.tableRef.selectable?"has-checkbox":""},h("pds-checkbox",{key:"e65963f7e2e6ac78f911451dd09a3f21e38ead45",componentId:this.generateUniqueId(),onClick:this.handleClick,indeterminate:this.indeterminate,label:"Select Row",hideLabel:true,checked:this.isSelected,part:"row-checkbox"})),h("slot",{key:"c17d0098092adbc45d84b3e497b6023e344eb260"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableRow.style=pdsTableRowCss;export{PdsTableRow as pds_table_row};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{c as closest}from"./closest-DnUJodVd.js";var pdsTableRowCss=":host{--color-background-interactive:var(--pine-color-background-subtle);border-color:inherit;display:table-row;vertical-align:inherit}:host::part(checkbox-cell){background-color:var(--pine-color-background-container);inset-inline-start:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:var(--pine-z-index-raised)}:host(:hover),:host(:hover)::part(checkbox-cell),:host(:hover) ::slotted(pds-table-cell),:host(.is-selected),:host(.is-selected)::part(checkbox-cell),:host(.is-selected) ::slotted(pds-table-cell){background:var(--color-background-interactive)}:host(.has-divider) ::slotted(pds-table-cell),:host(.has-divider) pds-table-cell{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle)}:host(.has-divider.is-last-row) ::slotted(pds-table-cell),:host(.has-divider.is-last-row) pds-table-cell{-webkit-border-after:0;border-block-end:0}";var PdsTableRow=function(){function t(t){var e=this;registerInstance(this,t);this.pdsTableRowSelected=createEvent(this,"pdsTableRowSelected");this.observer=null;this.bodyObserver=null;this.hasDivider=false;this.isLastRow=false;this.handleCheckboxChange=function(t){e.isSelected=t.detail.checked;e.handleSelect(e.isSelected)};this.handleSelect=function(t){e.indeterminate=false;if(!closest("pds-table-head",e.hostElement)){var s=Array.from(e.hostElement.parentNode.children).indexOf(e.hostElement);e.pdsTableRowSelected.emit({rowIndex:s,isSelected:t})}};this.generateUniqueId=function(){var t=Math.random().toString(36).substring(2,8);var e=(new Date).toISOString().replace(/[:.]/g,"-");var s="".concat(t,"-").concat(e);return s}}t.prototype.classNames=function(){var t=[];if(this.isSelected){t.push("is-selected")}if(this.hasDivider){t.push("has-divider")}if(this.isLastRow){t.push("is-last-row")}return t.join(" ")};t.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var t=this.hostElement.querySelector("pds-table-cell");t===null||t===void 0?void 0:t.classList.add("is-fixed")}};t.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};t.prototype.connectedCallback=function(){this.tableRef=this.hostElement.closest("pds-table");this.setupObservers();this.updateDividerState()};t.prototype.disconnectedCallback=function(){this.cleanupObservers()};t.prototype.cleanupObservers=function(){if(this.observer){this.observer.disconnect();this.observer=null}if(this.bodyObserver){this.bodyObserver.disconnect();this.bodyObserver=null}};t.prototype.setupObservers=function(){var t=this;this.cleanupObservers();if(this.tableRef&&typeof MutationObserver!=="undefined"){this.observer=new MutationObserver((function(){t.updateDividerState()}));this.observer.observe(this.tableRef,{attributes:true,attributeFilter:["row-dividers"]})}var e=this.hostElement.closest("pds-table-body");if(e&&typeof MutationObserver!=="undefined"){this.bodyObserver=new MutationObserver((function(){t.updateLastRowState()}));this.bodyObserver.observe(e,{childList:true})}};t.prototype.shouldHaveDivider=function(){if(!this.tableRef){this.tableRef=this.hostElement.closest("pds-table")}return!!(this.tableRef&&this.tableRef.rowDividers)};t.prototype.updateDividerState=function(){this.hasDivider=this.shouldHaveDivider();this.updateLastRowState()};t.prototype.updateLastRowState=function(){if(!this.hasDivider){this.isLastRow=false;return}var t=this.hostElement.closest("pds-table-body");if(t){var e=Array.from(t.querySelectorAll("pds-table-row"));this.isLastRow=e[e.length-1]===this.hostElement}else{this.isLastRow=false}};t.prototype.render=function(){return h(Host,{key:"6bbd8bb7cd1f90de0e418748bf8d3b9240ab0cb8",class:this.classNames(),role:"row",part:"row"},this.tableRef&&this.tableRef.selectable&&h("pds-table-cell",{key:"9a92396654e7cdf819536335ebe95169d4d4c26d",part:this.tableRef.fixedColumn?"checkbox-cell":"checkbox-cell",class:this.tableRef.selectable?"has-checkbox":""},h("pds-checkbox",{key:"bf61a00da4d3c19280aae90d8eaff9515a716c52",componentId:this.generateUniqueId(),onPdsCheckboxChange:this.handleCheckboxChange,indeterminate:this.indeterminate,label:"Select Row",hideLabel:true,checked:this.isSelected,part:"row-checkbox"})),h("slot",{key:"f77887e878913bea5e0ca0a281a639285a65f1c1"}))};Object.defineProperty(t.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTableRow.style=pdsTableRowCss;export{PdsTableRow as pds_table_row};
2
2
  //# sourceMappingURL=pds-table-row.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table-row.entry.js","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-background-subtle);\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: var(--pine-z-index-raised);\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\n:host(.has-divider) ::slotted(pds-table-cell),\n:host(.has-divider) pds-table-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host(.has-divider.is-last-row) ::slotted(pds-table-cell),\n:host(.has-divider.is-last-row) pds-table-cell {\n border-block-end: 0;\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop, State } 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 private observer: MutationObserver | null = null;\n private bodyObserver: MutationObserver | null = null;\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 * Determines if the row should have a divider border.\n * @defaultValue false\n */\n @State() private hasDivider: boolean = false;\n\n /**\n * Determines if this is the last row in the table body.\n * @defaultValue false\n */\n @State() private isLastRow: boolean = false;\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 if (this.hasDivider) {\n classNames.push(\"has-divider\");\n }\n\n if (this.isLastRow) {\n classNames.push(\"is-last-row\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n // Always refresh tableRef to get latest prop values\n // This ensures we pick up changes to parent table props\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 // Handle initial selection state\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n // Note: tableRef, observers, and divider state are set up in connectedCallback\n // which runs before componentWillLoad and also handles row re-attachment after sorting\n }\n\n connectedCallback() {\n // When a row is re-attached to the DOM (e.g., after sorting),\n // we need to re-setup the observers since disconnectedCallback cleared them\n // Note: componentDidLoad only fires once, but connectedCallback fires every time\n // the element is attached to the DOM (including after being moved)\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n this.setupObservers();\n this.updateDividerState();\n }\n\n disconnectedCallback() {\n this.cleanupObservers();\n }\n\n private cleanupObservers() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.bodyObserver) {\n this.bodyObserver.disconnect();\n this.bodyObserver = null;\n }\n }\n\n private setupObservers() {\n // Clean up any existing observers first\n this.cleanupObservers();\n\n // Watch for changes to the parent table's row-dividers attribute\n if (this.tableRef && typeof MutationObserver !== 'undefined') {\n this.observer = new MutationObserver(() => {\n this.updateDividerState();\n });\n\n this.observer.observe(this.tableRef, {\n attributes: true,\n attributeFilter: ['row-dividers']\n });\n }\n\n // Watch for child list changes in table body (e.g., when rows are reordered during sorting)\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody && typeof MutationObserver !== 'undefined') {\n this.bodyObserver = new MutationObserver(() => {\n this.updateLastRowState();\n });\n\n this.bodyObserver.observe(tableBody, {\n childList: true\n });\n }\n }\n\n private shouldHaveDivider(): boolean {\n if (!this.tableRef) {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n // Reads the parent pds-table component's rowDividers property value directly\n return !!(this.tableRef && this.tableRef.rowDividers);\n }\n\n private updateDividerState() {\n this.hasDivider = this.shouldHaveDivider();\n this.updateLastRowState();\n }\n\n private updateLastRowState() {\n if (!this.hasDivider) {\n this.isLastRow = false;\n return;\n }\n\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody) {\n const rows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n this.isLastRow = rows[rows.length - 1] === this.hostElement;\n } else {\n this.isLastRow = false;\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"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,09BAA09B;;MCSp+B,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAQ,CAAA,QAAA,GAA4B,IAAI;AACxC,QAAA,IAAY,CAAA,YAAA,GAA4B,IAAI;AAYpD;;;AAGG;AACc,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAE5C;;;AAGG;AACc,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;AAOnC,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,C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,YAAA,IAAI,CAAC,SAAS,GAAG,KAAK;;;IAY1B,MAAM,GAAA;AACJ,QAAA,QACE,CAAC,CAAA,IAAI,EACH,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,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;;;;;;;;"}
1
+ {"version":3,"file":"pds-table-row.entry.js","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-background-subtle);\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: var(--pine-z-index-raised);\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\n:host(.has-divider) ::slotted(pds-table-cell),\n:host(.has-divider) pds-table-cell {\n border-block-end: var(--pine-border-width-thin) solid var(--pine-color-border-subtle);\n}\n\n:host(.has-divider.is-last-row) ::slotted(pds-table-cell),\n:host(.has-divider.is-last-row) pds-table-cell {\n border-block-end: 0;\n}\n","import { Component, Element, Host, h, Event, EventEmitter, Prop, State } from '@stencil/core';\n\nimport { CheckboxChangeEventDetail } from '../../pds-checkbox/checkbox-interface';\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 private observer: MutationObserver | null = null;\n private bodyObserver: MutationObserver | null = null;\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 * Determines if the row should have a divider border.\n * @defaultValue false\n */\n @State() private hasDivider: boolean = false;\n\n /**\n * Determines if this is the last row in the table body.\n * @defaultValue false\n */\n @State() private isLastRow: boolean = false;\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 handleCheckboxChange = (event: CustomEvent<CheckboxChangeEventDetail>) => {\n this.isSelected = event.detail.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 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 if (this.hasDivider) {\n classNames.push(\"has-divider\");\n }\n\n if (this.isLastRow) {\n classNames.push(\"is-last-row\");\n }\n\n return classNames.join(' ');\n }\n\n componentWillRender() {\n // Always refresh tableRef to get latest prop values\n // This ensures we pick up changes to parent table props\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 // Handle initial selection state\n if (this.isSelected) {\n this.handleSelect(this.isSelected);\n }\n // Note: tableRef, observers, and divider state are set up in connectedCallback\n // which runs before componentWillLoad and also handles row re-attachment after sorting\n }\n\n connectedCallback() {\n // When a row is re-attached to the DOM (e.g., after sorting),\n // we need to re-setup the observers since disconnectedCallback cleared them\n // Note: componentDidLoad only fires once, but connectedCallback fires every time\n // the element is attached to the DOM (including after being moved)\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n this.setupObservers();\n this.updateDividerState();\n }\n\n disconnectedCallback() {\n this.cleanupObservers();\n }\n\n private cleanupObservers() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.bodyObserver) {\n this.bodyObserver.disconnect();\n this.bodyObserver = null;\n }\n }\n\n private setupObservers() {\n // Clean up any existing observers first\n this.cleanupObservers();\n\n // Watch for changes to the parent table's row-dividers attribute\n if (this.tableRef && typeof MutationObserver !== 'undefined') {\n this.observer = new MutationObserver(() => {\n this.updateDividerState();\n });\n\n this.observer.observe(this.tableRef, {\n attributes: true,\n attributeFilter: ['row-dividers']\n });\n }\n\n // Watch for child list changes in table body (e.g., when rows are reordered during sorting)\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody && typeof MutationObserver !== 'undefined') {\n this.bodyObserver = new MutationObserver(() => {\n this.updateLastRowState();\n });\n\n this.bodyObserver.observe(tableBody, {\n childList: true\n });\n }\n }\n\n private shouldHaveDivider(): boolean {\n if (!this.tableRef) {\n this.tableRef = this.hostElement.closest('pds-table') as HTMLPdsTableElement;\n }\n // Reads the parent pds-table component's rowDividers property value directly\n return !!(this.tableRef && this.tableRef.rowDividers);\n }\n\n private updateDividerState() {\n this.hasDivider = this.shouldHaveDivider();\n this.updateLastRowState();\n }\n\n private updateLastRowState() {\n if (!this.hasDivider) {\n this.isLastRow = false;\n return;\n }\n\n const tableBody = this.hostElement.closest('pds-table-body');\n if (tableBody) {\n const rows = Array.from(tableBody.querySelectorAll('pds-table-row'));\n this.isLastRow = rows[rows.length - 1] === this.hostElement;\n } else {\n this.isLastRow = false;\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 onPdsCheckboxChange={this.handleCheckboxChange}\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"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,09BAA09B;;MCUp+B,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAQU,QAAA,IAAQ,CAAA,QAAA,GAA4B,IAAI;AACxC,QAAA,IAAY,CAAA,YAAA,GAA4B,IAAI;AAYpD;;;AAGG;AACc,QAAA,IAAU,CA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AA,EAAA,CAAA,CACR;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";var pdsTableCss='@charset "UTF-8";:host{--color-background-default:var(--pine-color-background-container);background:var(--color-background-default);border-collapse:separate;border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;width:100%}:host(:focus-visible){outline:var(--pine-outline-focus)}:host(.pds-table-responsive-host){border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;max-width:100% !important;overflow:hidden !important;position:relative !important;width:100% !important}.pds-table-responsive-container{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;overflow-x:auto !important;overflow-y:visible !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper .pds-table{display:table !important;min-width:-webkit-max-content !important;min-width:-moz-max-content !important;min-width:max-content !important;table-layout:auto !important;white-space:nowrap !important;width:100% !important}.scroll-shadow-left,.scroll-shadow-right{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;-webkit-transition:opacity 0.1s ease;transition:opacity 0.1s ease;width:4px;z-index:var(--pine-z-index)}.scroll-shadow-left{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);border-bottom-left-radius:inherit;border-top-left-radius:inherit;left:0}.scroll-shadow-right{background:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);border-bottom-right-radius:inherit;border-top-right-radius:inherit;right:0}';var PdsTable=function(){function t(t){registerInstance(this,t);this.pdsTableSelect=createEvent(this,"pdsTableSelect");this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.scrollContainer=null;this._responsiveHandleScroll=null;this._responsiveHandleResize=null;this._responsiveResizeObserver=null;this._teardownResponsive=null;this.rowDividers=false;this.defaultSortDirection="asc";this.sortingColumn=null;this.sortingDirection="asc"}t.prototype.componentDidLoad=function(){var t=this;if(this.responsive){this.setupResponsiveScrolling()}if(this.defaultSortColumn){requestAnimationFrame((function(){void t.applyDefaultSort().catch((function(t){console.warn("Failed to apply default sort.",t)}))}))}};t.prototype.applyDefaultSort=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,r,e,n;var o=this;return __generator(this,(function(s){switch(s.label){case 0:i=this.defaultSortDirection==="desc"?"desc":"asc";r=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));e=r.find((function(t){var i;return((i=t.textContent)!==null&&i!==void 0?i:"").trim()===o.defaultSortColumn}));if(!e)return[3,2];n=((t=e.textContent)!==null&&t!==void 0?t:"").trim();this.sortTable(n,i);this.sortingColumn=n;this.sortingDirection=i;return[4,e.setActiveSort(i)];case 1:s.sent();return[3,3];case 2:console.warn('Default sort column "'.concat(this.defaultSortColumn,'" not found.'));s.label=3;case 3:return[2]}}))}))};t.prototype.disconnectedCallback=function(){if(this._teardownResponsive){this._teardownResponsive();this._teardownResponsive=null}};t.prototype.setupResponsiveScrolling=function(){var t=this;var i,r,e;var n=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector(".pds-table-responsive-container");var o=(r=this.el.shadowRoot)===null||r===void 0?void 0:r.querySelector(".scroll-shadow-left");var s=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".scroll-shadow-right");if(!n||!o||!s)return;this.scrollContainer=n;this._responsiveHandleScroll=function(){if(!t.scrollContainer)return;var i=t.scrollContainer.scrollLeft;var r=t.scrollContainer.scrollWidth-t.scrollContainer.clientWidth;o.style.opacity=i>0&&!t.fixedColumn?"1":"0";s.style.opacity=r>0&&i<r-1?"1":"0"};this.scrollContainer.addEventListener("scroll",this._responsiveHandleScroll,{passive:true});if(typeof window!=="undefined"&&window.ResizeObserver){try{this._responsiveResizeObserver=new ResizeObserver((function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)}));this._responsiveResizeObserver.observe(this.scrollContainer)}catch(t){}}if(typeof window!=="undefined"){this._responsiveHandleResize=function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)};window.addEventListener("resize",this._responsiveHandleResize)}this._teardownResponsive=function(){if(t.scrollContainer&&t._responsiveHandleScroll){t.scrollContainer.removeEventListener("scroll",t._responsiveHandleScroll);t.scrollContainer=null}if(t._responsiveResizeObserver){t._responsiveResizeObserver.disconnect();t._responsiveResizeObserver=null}if(typeof window!=="undefined"&&t._responsiveHandleResize){window.removeEventListener("resize",t._responsiveHandleResize);t._responsiveHandleResize=null}t._responsiveHandleScroll=null};this._responsiveHandleScroll()};t.prototype.classNames=function(){var t=["pds-table"];if(this.compact){t.push("is-compact")}if(this.responsive){t.push("is-responsive")}return t.join(" ")};t.prototype.sortTable=function(t,i){var r=this.el.querySelector("pds-table-body");if(!r)return;var e=Array.from(r.querySelectorAll("pds-table-row"));var n=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));var o=n.find((function(i){return i.innerText.trim()===t}));if(!o){console.warn('Column "'.concat(t,'" not found.'));return}var s=n.indexOf(o);e.sort((function(t,r){var e=t.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();var n=r.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();if(i==="asc"){return e.localeCompare(n,undefined,{sensitivity:"base"})}else{return n.localeCompare(e,undefined,{sensitivity:"base"})}}));r.innerHTML="";e.forEach((function(t){r.appendChild(t)}))};t.prototype.handleTableSort=function(t){if(t.defaultPrevented)return;var i=t.detail.direction;this.sortTable(t.detail.column,i);this.sortingColumn=t.detail.column;this.sortingDirection=i};t.prototype.handleTableSelectAll=function(t){if(t.defaultPrevented)return;var i=this.el.querySelector("pds-table-body");var r=Array.from(i.querySelectorAll("pds-table-row"));r.forEach((function(i){i.isSelected=t.detail.isSelected}))};t.prototype.handleTableSelect=function(t){return __awaiter(this,void 0,void 0,(function(){var i,r,e,n,o;return __generator(this,(function(s){if(t.defaultPrevented)return[2];i=this.el.querySelectorAll("pds-table-row");r=Array.from(i).every((function(t){return t.isSelected}));e=Array.from(i).every((function(t){return!t.isSelected}));n=this.el.querySelector("pds-table-head");if(!n)return[2];o=n.shadowRoot.querySelector("pds-checkbox");o.checked=r;o.indeterminate=!r&&!e;return[2]}))}))};t.prototype.render=function(){if(this.responsive){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)))))}return h(Host,{class:this.classNames(),id:this.componentId,role:"grid",selectable:this.selectable,tabindex:"0",part:"table"},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTable.style=pdsTableCss;export{PdsTable as pds_table};
1
+ import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";var pdsTableCss='@charset "UTF-8";:host{--color-background-default:var(--pine-color-background-container);background:var(--color-background-default);border-collapse:separate;border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;isolation:isolate;width:100%}:host(:focus-visible){outline:var(--pine-outline-focus)}:host(.pds-table-responsive-host){border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;max-width:100% !important;overflow:hidden !important;position:relative !important;width:100% !important}.pds-table-responsive-container{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;overflow-x:auto !important;overflow-y:visible !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper{border-radius:inherit;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;display:block !important;position:relative !important;width:100% !important}.pds-table-responsive-wrapper .pds-table{display:table !important;min-width:-webkit-max-content !important;min-width:-moz-max-content !important;min-width:max-content !important;table-layout:auto !important;white-space:nowrap !important;width:100% !important}.scroll-shadow-left,.scroll-shadow-right{height:100%;opacity:0;pointer-events:none;position:absolute;top:0;-webkit-transition:opacity 0.1s ease;transition:opacity 0.1s ease;width:4px;z-index:var(--pine-z-index)}.scroll-shadow-left{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);border-bottom-left-radius:inherit;border-top-left-radius:inherit;left:0}.scroll-shadow-right{background:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));background:linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);border-bottom-right-radius:inherit;border-top-right-radius:inherit;right:0}';var PdsTable=function(){function t(t){registerInstance(this,t);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll");this.scrollContainer=null;this._responsiveHandleScroll=null;this._responsiveHandleResize=null;this._responsiveResizeObserver=null;this._teardownResponsive=null;this.disableSelectAll=false;this.rowDividers=false;this.defaultSortDirection="asc";this.sortingColumn=null;this.sortingDirection="asc"}t.prototype.componentDidLoad=function(){var t=this;if(this.responsive){this.setupResponsiveScrolling()}if(this.defaultSortColumn){requestAnimationFrame((function(){void t.applyDefaultSort().catch((function(t){console.warn("Failed to apply default sort.",t)}))}))}};t.prototype.applyDefaultSort=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,r,e,n;var o=this;return __generator(this,(function(s){switch(s.label){case 0:i=this.defaultSortDirection==="desc"?"desc":"asc";r=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));e=r.find((function(t){var i;return((i=t.textContent)!==null&&i!==void 0?i:"").trim()===o.defaultSortColumn}));if(!e)return[3,2];n=((t=e.textContent)!==null&&t!==void 0?t:"").trim();this.sortTable(n,i);this.sortingColumn=n;this.sortingDirection=i;return[4,e.setActiveSort(i)];case 1:s.sent();return[3,3];case 2:console.warn('Default sort column "'.concat(this.defaultSortColumn,'" not found.'));s.label=3;case 3:return[2]}}))}))};t.prototype.disconnectedCallback=function(){if(this._teardownResponsive){this._teardownResponsive();this._teardownResponsive=null}};t.prototype.setupResponsiveScrolling=function(){var t=this;var i,r,e;var n=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector(".pds-table-responsive-container");var o=(r=this.el.shadowRoot)===null||r===void 0?void 0:r.querySelector(".scroll-shadow-left");var s=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".scroll-shadow-right");if(!n||!o||!s)return;this.scrollContainer=n;this._responsiveHandleScroll=function(){if(!t.scrollContainer)return;var i=t.scrollContainer.scrollLeft;var r=t.scrollContainer.scrollWidth-t.scrollContainer.clientWidth;o.style.opacity=i>0&&!t.fixedColumn?"1":"0";s.style.opacity=r>0&&i<r-1?"1":"0"};this.scrollContainer.addEventListener("scroll",this._responsiveHandleScroll,{passive:true});if(typeof window!=="undefined"&&window.ResizeObserver){try{this._responsiveResizeObserver=new ResizeObserver((function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)}));this._responsiveResizeObserver.observe(this.scrollContainer)}catch(t){}}if(typeof window!=="undefined"){this._responsiveHandleResize=function(){var i;(i=t._responsiveHandleScroll)===null||i===void 0?void 0:i.call(t)};window.addEventListener("resize",this._responsiveHandleResize)}this._teardownResponsive=function(){if(t.scrollContainer&&t._responsiveHandleScroll){t.scrollContainer.removeEventListener("scroll",t._responsiveHandleScroll);t.scrollContainer=null}if(t._responsiveResizeObserver){t._responsiveResizeObserver.disconnect();t._responsiveResizeObserver=null}if(typeof window!=="undefined"&&t._responsiveHandleResize){window.removeEventListener("resize",t._responsiveHandleResize);t._responsiveHandleResize=null}t._responsiveHandleScroll=null};this._responsiveHandleScroll()};t.prototype.classNames=function(){var t=["pds-table"];if(this.compact){t.push("is-compact")}if(this.responsive){t.push("is-responsive")}return t.join(" ")};t.prototype.sortTable=function(t,i){var r=this.el.querySelector("pds-table-body");if(!r)return;var e=Array.from(r.querySelectorAll("pds-table-row"));var n=Array.from(this.el.querySelectorAll("pds-table-head-cell[sortable]"));var o=n.find((function(i){return i.innerText.trim()===t}));if(!o){console.warn('Column "'.concat(t,'" not found.'));return}var s=n.indexOf(o);e.sort((function(t,r){var e=t.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();var n=r.querySelector("pds-table-cell:nth-child(".concat(s+1,")")).textContent.trim();if(i==="asc"){return e.localeCompare(n,undefined,{sensitivity:"base"})}else{return n.localeCompare(e,undefined,{sensitivity:"base"})}}));r.innerHTML="";e.forEach((function(t){r.appendChild(t)}))};t.prototype.handleTableSort=function(t){if(t.defaultPrevented)return;var i=t.detail.direction;this.sortTable(t.detail.column,i);this.sortingColumn=t.detail.column;this.sortingDirection=i};t.prototype.handleTableSelectAll=function(t){if(t.defaultPrevented)return;var i=this.el.querySelector("pds-table-body");var r=Array.from(i.querySelectorAll("pds-table-row"));r.forEach((function(i){i.isSelected=t.detail.isSelected}))};t.prototype.handleTableSelect=function(t){return __awaiter(this,void 0,void 0,(function(){var i,r,e,n,o;return __generator(this,(function(s){if(t.defaultPrevented)return[2];i=this.el.querySelectorAll("pds-table-row");r=Array.from(i).every((function(t){return t.isSelected}));e=Array.from(i).every((function(t){return!t.isSelected}));n=this.el.querySelector("pds-table-head");if(!n)return[2];o=n.shadowRoot.querySelector("pds-checkbox");if(o){o.checked=r;o.indeterminate=!r&&!e}return[2]}))}))};t.prototype.render=function(){if(this.responsive){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)))))}return h(Host,{class:this.classNames(),id:this.componentId,role:"grid",selectable:this.selectable,tabindex:"0",part:"table"},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PdsTable.style=pdsTableCss;export{PdsTable as pds_table};
2
2
  //# sourceMappingURL=pds-table.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pds-table.entry.js","sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-background-container);\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: var(--pine-z-index);\n}\n\n.scroll-shadow-left {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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 /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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 * Adds divider borders between table rows. The last row will not have a bottom border.\n * @defaultValue false\n */\n @Prop({ reflect: true }) rowDividers: boolean = false;\n\n /**\n * The name of the column to sort by on initial load.\n * Must match the text content of a sortable column header.\n */\n @Prop() defaultSortColumn?: string;\n\n /**\n * The direction to sort the default column on initial load.\n * Only applies if `defaultSortColumn` is set.\n * @defaultValue 'asc'\n */\n @Prop() defaultSortDirection?: 'asc' | 'desc' = 'asc';\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 componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n\n // Apply default sort if specified\n // Use requestAnimationFrame to defer until child components are fully initialized\n if (this.defaultSortColumn) {\n requestAnimationFrame(() => {\n void this.applyDefaultSort().catch((err) => {\n console.warn('Failed to apply default sort.', err);\n });\n });\n }\n }\n\n /**\n * Applies the default sort configuration on initial load.\n * Finds the matching column header and activates its sort state.\n * @private\n */\n private async applyDefaultSort() {\n // Normalize direction to handle invalid HTML attribute values\n const direction: 'asc' | 'desc' = this.defaultSortDirection === 'desc' ? 'desc' : 'asc';\n\n // Find the matching sortable header cell\n const columnHeaderCells = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n ) as HTMLPdsTableHeadCellElement[];\n\n const matchingCell = columnHeaderCells.find(\n (cell) => (cell.textContent ?? '').trim() === this.defaultSortColumn\n );\n\n if (matchingCell) {\n const columnName = (matchingCell.textContent ?? '').trim();\n // Sort the table data\n this.sortTable(columnName, direction);\n this.sortingColumn = columnName;\n this.sortingDirection = direction;\n\n // Activate the visual state on the header cell\n await matchingCell.setActiveSort(direction);\n } else {\n console.warn(`Default sort column \"${this.defaultSortColumn}\" not found.`);\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 // Return early if no table body exists\n if (!tableBody) return;\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 if (event.defaultPrevented) return;\n\n const { direction } = event.detail;\n this.sortTable(event.detail.column, direction);\n this.sortingColumn = event.detail.column;\n this.sortingDirection = direction;\n }\n\n @Listen('pdsTableSelectAll')\n handleTableSelectAll(event: CustomEvent<{ isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const pdsTableBody = this.el.querySelector('pds-table-body');\n const tableRows = Array.from(pdsTableBody.querySelectorAll('pds-table-row'));\n\n tableRows.forEach((row) => {\n row.isSelected = event.detail.isSelected;\n });\n }\n\n @Listen('pdsTableRowSelected')\n async handleTableSelect(event: CustomEvent<{ rowIndex: number; isSelected: boolean }>) {\n if (event.defaultPrevented) return;\n\n const allTableRows = this.el.querySelectorAll('pds-table-row');\n const allSelectedRows = Array.from(allTableRows).every((row) => row.isSelected);\n const noneSelectedRows = Array.from(allTableRows).every((row) => !row.isSelected);\n const pdsTableHead = this.el.querySelector('pds-table-head');\n if (!pdsTableHead) return;\n\n const headerCheckbox = pdsTableHead.shadowRoot.querySelector('pds-checkbox');\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table responsive-table\"\n >\n <div class=\"scroll-shadow-left\" part=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\" part=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\" part=\"responsive-container\">\n <div class=\"pds-table-responsive-wrapper\" part=\"responsive-wrapper\">\n <div class={this.classNames()} part=\"table-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,09DAA09D;;MCOj+D,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;AAOU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAC1C,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAyB,CAAA,yBAAA,GAA0B,IAAI;AACvD,QAAA,IAAmB,CAAA,mBAAA,GAAwB,IAAI;AA2BvD;;;AAGG;AACsB,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAQrD;;;;AAIG;AACK,QAAA,IAAoB,CAAA,oBAAA,GAAoB,KAAK;AAErD;;;AAGG;AACM,QAAA,IAAa,CAAA,aAAA,GAAkB,IAAI;AAE5C;;;AAGG;AACM,QAAA,IAAgB,CAAA,gBAAA,GAAmB,KAAK;AAqSlD;IAxRC,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,wBAAwB,EAAE;;;;AAKjC,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,qBAAqB,CAAC,MAAK;gBACzB,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;AACzC,oBAAA,OAAO,CAAC,IAAI,CAAC,+B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AC,wBAAwB,EAAA,EAE7B,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,oBAAoB,EAAC,IAAI,EAAC,oBAAoB,EAAO,CAAA,EAChE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,qBAAqB,EAAC,IAAI,EAAC,qBAAqB,EAAO,CAAA,EAClE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,gCAAgC,EAAC,IAAI,EAAC,sBAAsB,EAAA,EACrE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAC,IAAI,EAAC,oBAAoB,EAAA,EACjE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,aAAa,EAAA,EAC/C,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,CACF,CACF,CACD;;QAIX,QACE,CAAA,CAAC,IAAI,EAAA,EACH,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAC,GAAG,EACZ,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;"}
1
+ {"version":3,"file":"pds-table.entry.js","sources":["src/components/pds-table/pds-table.scss?tag=pds-table&encapsulation=shadow","src/components/pds-table/pds-table.tsx"],"sourcesContent":[":host {\n --color-background-default: var(--pine-color-background-container);\n\n background: var(--color-background-default);\n border-collapse: separate;\n border-radius: inherit;\n box-sizing: border-box;\n display: table;\n isolation: isolate;\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: var(--pine-z-index);\n}\n\n.scroll-shadow-left {\n /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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 /* stylelint-disable-next-line pine-design-system/no-hardcoded-colors */\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 * Hides the select-all checkbox in the table header while keeping individual row checkboxes functional.\n * Only applies when `selectable` is true.\n * @defaultValue false\n */\n @Prop() disableSelectAll: boolean = false;\n\n /**\n * Adds divider borders between table rows. The last row will not have a bottom border.\n * @defaultValue false\n */\n @Prop({ reflect: true }) rowDividers: boolean = false;\n\n /**\n * The name of the column to sort by on initial load.\n * Must match the text content of a sortable column header.\n */\n @Prop() defaultSortColumn?: string;\n\n /**\n * The direction to sort the default column on initial load.\n * Only applies if `defaultSortColumn` is set.\n * @defaultValue 'asc'\n */\n @Prop() defaultSortDirection?: 'asc' | 'desc' = 'asc';\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 select all checkbox is clicked, carrying the selected value.\n */\n @Event() pdsTableSelectAll: EventEmitter<{ isSelected: boolean }>;\n\n componentDidLoad() {\n if (this.responsive) {\n this.setupResponsiveScrolling();\n }\n\n // Apply default sort if specified\n // Use requestAnimationFrame to defer until child components are fully initialized\n if (this.defaultSortColumn) {\n requestAnimationFrame(() => {\n void this.applyDefaultSort().catch((err) => {\n console.warn('Failed to apply default sort.', err);\n });\n });\n }\n }\n\n /**\n * Applies the default sort configuration on initial load.\n * Finds the matching column header and activates its sort state.\n * @private\n */\n private async applyDefaultSort() {\n // Normalize direction to handle invalid HTML attribute values\n const direction: 'asc' | 'desc' = this.defaultSortDirection === 'desc' ? 'desc' : 'asc';\n\n // Find the matching sortable header cell\n const columnHeaderCells = Array.from(\n this.el.querySelectorAll('pds-table-head-cell[sortable]')\n ) as HTMLPdsTableHeadCellElement[];\n\n const matchingCell = columnHeaderCells.find(\n (cell) => (cell.textContent ?? '').trim() === this.defaultSortColumn\n );\n\n if (matchingCell) {\n const columnName = (matchingCell.textContent ?? '').trim();\n // Sort the table data\n this.sortTable(columnName, direction);\n this.sortingColumn = columnName;\n this.sortingDirection = direction;\n\n // Activate the visual state on the header cell\n await matchingCell.setActiveSort(direction);\n } else {\n console.warn(`Default sort column \"${this.defaultSortColumn}\" not found.`);\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 // Return early if no table body exists\n if (!tableBody) return;\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 if (event.defaultPrevented) return;\n\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 if (headerCheckbox) {\n headerCheckbox.checked = allSelectedRows;\n headerCheckbox.indeterminate = !allSelectedRows && !noneSelectedRows;\n }\n }\n\n render() {\n if (this.responsive) {\n return (\n <Host\n class=\"pds-table is-responsive pds-table-responsive-host\"\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table responsive-table\"\n >\n <div class=\"scroll-shadow-left\" part=\"scroll-shadow-left\"></div>\n <div class=\"scroll-shadow-right\" part=\"scroll-shadow-right\"></div>\n <div class=\"pds-table-responsive-container\" part=\"responsive-container\">\n <div class=\"pds-table-responsive-wrapper\" part=\"responsive-wrapper\">\n <div class={this.classNames()} part=\"table-inner\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host\n class={this.classNames()}\n id={this.componentId}\n role=\"grid\"\n selectable={this.selectable}\n tabindex=\"0\"\n part=\"table\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,4+DAA4+D;;MCOn/D,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOU,QAAA,IAAe,CAAA,eAAA,GAAuB,IAAI;AAC1C,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAuB,CAAA,uBAAA,GAAwB,IAAI;AACnD,QAAA,IAAyB,CAAA,yBAAA,GAA0B,IAAI;AACvD,QAAA,IAAmB,CAAA,mBAAA,G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AE,IAAI,CAAC,UAAU,EAAE,EACxB,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAC,GAAG,EACZ,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACR;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,h,a as getElement}from"./index-DHPhrb5T.js";import{s as setColor}from"./utils-tJa4KYNO.js";var pdsTextCss=":host{display:inline}:host([decoration=underline-dotted])>*{-webkit-text-decoration-color:var(--pine-color-text-tertiary);text-decoration-color:var(--pine-color-text-tertiary);-webkit-text-decoration-line:underline;text-decoration-line:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:12%;text-underline-offset:0.3rem;text-underline-position:under}:host([decoration=strikethrough])>*{text-decoration:line-through}h1{font:var(--pine-typography-heading-1);letter-spacing:var(--pine-letter-spacing-heading-1)}h2{font:var(--pine-typography-heading-2);letter-spacing:var(--pine-letter-spacing-heading-2)}h3{font:var(--pine-typography-heading-3);letter-spacing:var(--pine-letter-spacing-heading-3)}h4{font:var(--pine-typography-heading-4);letter-spacing:var(--pine-letter-spacing-heading-4)}h5{font:var(--pine-typography-heading-5);letter-spacing:var(--pine-letter-spacing-heading-5)}h6{font:var(--pine-typography-heading-6);letter-spacing:var(--pine-letter-spacing-heading-6)}code,em,p,pre,strong{font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing)}code,pre{font-family:monospace;letter-spacing:0;line-height:1}em{font-style:normal}strong{font-weight:bolder}:host([truncate])>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([italic])>*{font-style:italic}.pds-text{color:var(--color, var(--pine-color-text));margin:var(--pine-dimension-none)}.pds-text--size-2xl{font-size:var(--pine-font-size-body-2xl)}.pds-text--size-xl{font-size:var(--pine-font-size-body-xl)}.pds-text--size-lg{font-size:var(--pine-font-size-body-lg)}.pds-text--size-md{font-size:var(--pine-font-size-body-md)}.pds-text--size-sm{font-size:var(--pine-font-size-body-sm)}.pds-text--size-xs{font-size:var(--pine-font-size-body-xs)}.pds-text--size-2xs{font-size:var(--pine-font-size-body-2xs)}.pds-text--size-h1{font-size:var(--pine-font-size-heading-1)}.pds-text--size-h2{font-size:var(--pine-font-size-heading-2)}.pds-text--size-h3{font-size:var(--pine-font-size-heading-3)}.pds-text--size-h4{font-size:var(--pine-font-size-heading-4)}.pds-text--size-h5{font-size:var(--pine-font-size-heading-5)}.pds-text--size-h6{font-size:var(--pine-font-size-heading-6)}.pds-text--weight-extra-light{font-weight:var(--pine-font-weight-extra-light)}.pds-text--weight-light{font-weight:var(--pine-font-weight-light)}.pds-text--weight-regular{font-weight:var(--pine-font-weight-regular)}.pds-text--weight-medium{font-weight:var(--pine-font-weight-medium)}.pds-text--weight-semibold{font-weight:var(--pine-font-weight-semi-bold)}.pds-text--weight-bold{font-weight:var(--pine-font-weight-bold)}.pds-text--gutter-2xl{-webkit-margin-after:var(--pine-dimension-2xl);margin-block-end:var(--pine-dimension-2xl)}.pds-text--gutter-xl{-webkit-margin-after:var(--pine-dimension-xl);margin-block-end:var(--pine-dimension-xl)}.pds-text--gutter-lg{-webkit-margin-after:var(--pine-dimension-lg);margin-block-end:var(--pine-dimension-lg)}.pds-text--gutter-md{-webkit-margin-after:var(--pine-dimension-md);margin-block-end:var(--pine-dimension-md)}.pds-text--gutter-sm{-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-text--gutter-xs{-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-text--gutter-2xs{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-text--align-start{text-align:start}.pds-text--align-center{text-align:center}.pds-text--align-end{text-align:end}.pds-text--align-justify{text-align:justify}";var PdsText=function(){function e(e){registerInstance(this,e);this.tag="p"}e.prototype.render=function(){var e=this.tag;var t="\n pds-text\n ".concat(this.align!==undefined&&this.align.trim()!==""?"pds-text--align-".concat(this.align):"","\n ").concat(this.gutter!==undefined&&this.gutter.trim()!==""?"pds-text--gutter-".concat(this.gutter):"","\n ").concat(this.size!==undefined&&this.size.trim()!==""?"pds-text--size-".concat(this.size):"","\n ").concat(this.weight!==undefined&&this.weight.trim()!==""?"pds-text--weight-".concat(this.weight):"","\n ").concat(this.decoration!==undefined&&this.decoration.trim()!==""?"pds-text--decoration-".concat(this.decoration):"","\n ");return h(e,{key:"3332211f473c2e8eeb79214352939df07a51fec1",style:this.color&&setColor(this.color),class:t,part:"content"},h("slot",{key:"d73ebe8fdf9f78d16aca70161bdc27138286328d"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsText.style=pdsTextCss;export{PdsText as pds_text};
1
+ import{r as registerInstance,h,a as getElement}from"./index-DHPhrb5T.js";import{s as setColor}from"./utils-tJa4KYNO.js";import{s as setupTruncationTooltip}from"./truncation-tooltip-CTHpMbU3.js";import"./floating-ui.dom-BO6p966C.js";var pdsTextCss=":host{display:inline}:host([decoration=underline-dotted])>*{-webkit-text-decoration-color:var(--pine-color-text-tertiary);text-decoration-color:var(--pine-color-text-tertiary);-webkit-text-decoration-line:underline;text-decoration-line:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted;text-decoration-thickness:12%;text-underline-offset:0.3rem;text-underline-position:under}:host([decoration=strikethrough])>*{text-decoration:line-through}h1{font:var(--pine-typography-heading-1);letter-spacing:var(--pine-letter-spacing-heading-1)}h2{font:var(--pine-typography-heading-2);letter-spacing:var(--pine-letter-spacing-heading-2)}h3{font:var(--pine-typography-heading-3);letter-spacing:var(--pine-letter-spacing-heading-3)}h4{font:var(--pine-typography-heading-4);letter-spacing:var(--pine-letter-spacing-heading-4)}h5{font:var(--pine-typography-heading-5);letter-spacing:var(--pine-letter-spacing-heading-5)}h6{font:var(--pine-typography-heading-6);letter-spacing:var(--pine-letter-spacing-heading-6)}code,em,p,pre,strong{font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing)}code,pre{font-family:monospace;letter-spacing:0;line-height:1}em{font-style:normal}strong{font-weight:bolder}:host([truncate])>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([italic])>*{font-style:italic}.pds-text{color:var(--color, var(--pine-color-text));margin:var(--pine-dimension-none)}.pds-text--size-2xl{font-size:var(--pine-font-size-body-2xl)}.pds-text--size-xl{font-size:var(--pine-font-size-body-xl)}.pds-text--size-lg{font-size:var(--pine-font-size-body-lg)}.pds-text--size-md{font-size:var(--pine-font-size-body-md)}.pds-text--size-sm{font-size:var(--pine-font-size-body-sm)}.pds-text--size-xs{font-size:var(--pine-font-size-body-xs)}.pds-text--size-2xs{font-size:var(--pine-font-size-body-2xs)}.pds-text--size-h1{font-size:var(--pine-font-size-heading-1)}.pds-text--size-h2{font-size:var(--pine-font-size-heading-2)}.pds-text--size-h3{font-size:var(--pine-font-size-heading-3)}.pds-text--size-h4{font-size:var(--pine-font-size-heading-4)}.pds-text--size-h5{font-size:var(--pine-font-size-heading-5)}.pds-text--size-h6{font-size:var(--pine-font-size-heading-6)}.pds-text--weight-extra-light{font-weight:var(--pine-font-weight-extra-light)}.pds-text--weight-light{font-weight:var(--pine-font-weight-light)}.pds-text--weight-regular{font-weight:var(--pine-font-weight-regular)}.pds-text--weight-medium{font-weight:var(--pine-font-weight-medium)}.pds-text--weight-semibold{font-weight:var(--pine-font-weight-semi-bold)}.pds-text--weight-bold{font-weight:var(--pine-font-weight-bold)}.pds-text--gutter-2xl{-webkit-margin-after:var(--pine-dimension-2xl);margin-block-end:var(--pine-dimension-2xl)}.pds-text--gutter-xl{-webkit-margin-after:var(--pine-dimension-xl);margin-block-end:var(--pine-dimension-xl)}.pds-text--gutter-lg{-webkit-margin-after:var(--pine-dimension-lg);margin-block-end:var(--pine-dimension-lg)}.pds-text--gutter-md{-webkit-margin-after:var(--pine-dimension-md);margin-block-end:var(--pine-dimension-md)}.pds-text--gutter-sm{-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-text--gutter-xs{-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-text--gutter-2xs{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-text--align-start{text-align:start}.pds-text--align-center{text-align:center}.pds-text--align-end{text-align:end}.pds-text--align-justify{text-align:justify}";var PdsText=function(){function t(t){registerInstance(this,t);this.truncationCleanup=null;this.tag="p"}t.prototype.handleTruncateChange=function(t){if(t){this.initTruncationTooltip()}else{this.destroyTruncationTooltip()}};t.prototype.componentDidLoad=function(){if(this.truncate){this.initTruncationTooltip()}};t.prototype.disconnectedCallback=function(){this.destroyTruncationTooltip()};t.prototype.initTruncationTooltip=function(){var t=this;this.destroyTruncationTooltip();if(this.contentEl){this.truncationCleanup=setupTruncationTooltip({hostEl:this.el,contentEl:this.contentEl,getTooltipText:function(){return t.el.textContent||""}})}};t.prototype.destroyTruncationTooltip=function(){if(this.truncationCleanup){this.truncationCleanup();this.truncationCleanup=null}};t.prototype.render=function(){var t=this;var e=this.tag;var i="\n pds-text\n ".concat(this.align!==undefined&&this.align.trim()!==""?"pds-text--align-".concat(this.align):"","\n ").concat(this.gutter!==undefined&&this.gutter.trim()!==""?"pds-text--gutter-".concat(this.gutter):"","\n ").concat(this.size!==undefined&&this.size.trim()!==""?"pds-text--size-".concat(this.size):"","\n ").concat(this.weight!==undefined&&this.weight.trim()!==""?"pds-text--weight-".concat(this.weight):"","\n ").concat(this.decoration!==undefined&&this.decoration.trim()!==""?"pds-text--decoration-".concat(this.decoration):"","\n ");return h(e,{key:"e5d4fa802fbc1a66c21d6e959fb2228f8cac1902",ref:function(e){return t.contentEl=e},style:this.color&&setColor(this.color),class:i,part:"content",tabIndex:this.truncate?0:undefined},h("slot",{key:"4ff0b2cb3a185fd97ef296262790379df832b7b8"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{truncate:["handleTruncateChange"]}},enumerable:false,configurable:true});return t}();PdsText.style=pdsTextCss;export{PdsText as pds_text};
2
2
  //# sourceMappingURL=pds-text.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pds-text.entry.js","sources":["src/components/pds-text/pds-text.scss?tag=pds-text&encapsulation=shadow","src/components/pds-text/pds-text.tsx"],"sourcesContent":[":host {\n display: inline;\n}\n\n:host([decoration=\"underline-dotted\"]) > * {\n text-decoration-color: var(--pine-color-text-tertiary);\n text-decoration-line: underline;\n text-decoration-style: dotted;\n text-decoration-thickness: 12%;\n text-underline-offset: 0.3rem;\n text-underline-position: under;\n}\n\n:host([decoration=\"strikethrough\"])>* {\n text-decoration: line-through;\n}\n\n/* stylelint-disable */\nh1 {\n font: var(--pine-typography-heading-1);\n letter-spacing: var(--pine-letter-spacing-heading-1);\n}\n\nh2 {\n font: var(--pine-typography-heading-2);\n letter-spacing: var(--pine-letter-spacing-heading-2);\n}\n\nh3 {\n font: var(--pine-typography-heading-3);\n letter-spacing: var(--pine-letter-spacing-heading-3);\n}\n\nh4 {\n font: var(--pine-typography-heading-4);\n letter-spacing: var(--pine-letter-spacing-heading-4);\n}\n\nh5 {\n font: var(--pine-typography-heading-5);\n letter-spacing: var(--pine-letter-spacing-heading-5);\n}\n\nh6 {\n font: var(--pine-typography-heading-6);\n letter-spacing: var(--pine-letter-spacing-heading-6);\n}\n\ncode, em, p, pre, strong {\n font: var(--pine-typography-body);\n letter-spacing: var(--pine-letter-spacing);\n}\n/* stylelint-enable */\n\ncode, pre {\n font-family: monospace;\n letter-spacing: 0;\n line-height: 1;\n}\n\nem {\n font-style: normal;\n}\n\nstrong {\n font-weight: bolder;\n}\n\n:host([truncate]) > * {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host([italic]) > * {\n font-style: italic;\n}\n\n// Colors/Variants/Sentiment\n\n// Variable is set in TSX\n// If color prop value isn't valid, will default to body text color\n.pds-text {\n color: var(--color, var(--pine-color-text));\n margin: var(--pine-dimension-none);\n}\n\n// Font Sizes\n$type-sizes: (\n 2xl: var(--pine-font-size-body-2xl),\n xl: var(--pine-font-size-body-xl),\n lg: var(--pine-font-size-body-lg),\n md: var(--pine-font-size-body-md),\n sm: var(--pine-font-size-body-sm),\n xs: var(--pine-font-size-body-xs),\n 2xs: var(--pine-font-size-body-2xs),\n h1: var(--pine-font-size-heading-1),\n h2: var(--pine-font-size-heading-2),\n h3: var(--pine-font-size-heading-3),\n h4: var(--pine-font-size-heading-4),\n h5: var(--pine-font-size-heading-5),\n h6: var(--pine-font-size-heading-6),\n);\n\n@mixin generate-type-sizes($type-sizes) {\n @each $key, $value in $type-sizes {\n .pds-text--size-#{$key} {\n font-size: $value;\n }\n }\n}\n\n@include generate-type-sizes($type-sizes);\n\n// Font Weights\n$type-weights: (\n extra-light: var(--pine-font-weight-extra-light),\n light: var(--pine-font-weight-light),\n regular: var(--pine-font-weight-regular),\n medium: var(--pine-font-weight-medium),\n semibold: var(--pine-font-weight-semi-bold),\n bold: var(--pine-font-weight-bold),\n);\n\n@mixin generate-type-weights($type-weights) {\n @each $key, $value in $type-weights {\n .pds-text--weight-#{$key} {\n font-weight: $value;\n }\n }\n}\n\n@include generate-type-weights($type-weights);\n\n// Gutter Sizes\n$type-gutters: (\n 2xl: var(--pine-dimension-2xl),\n xl: var(--pine-dimension-xl),\n lg: var(--pine-dimension-lg),\n md: var(--pine-dimension-md),\n sm: var(--pine-dimension-sm),\n xs: var(--pine-dimension-xs),\n 2xs: var(--pine-dimension-2xs),\n);\n\n@mixin generate-type-gutters($type-gutters) {\n @each $key, $value in $type-gutters {\n .pds-text--gutter-#{$key} {\n margin-block-end: $value;\n }\n }\n}\n\n@include generate-type-gutters($type-gutters);\n\n// Text Alignment\n$type-alignments: (\n start: start,\n center: center,\n end: end,\n justify: justify,\n);\n\n@mixin generate-type-alignments($type-alignments) {\n @each $key, $value in $type-alignments {\n .pds-text--align-#{$key} {\n text-align: $value;\n }\n }\n}\n\n@include generate-type-alignments($type-alignments);\n","import { Component, h, Prop, Element } from '@stencil/core';\nimport { setColor } from '../../utils/utils';\n\n/**\n * @part content - The text content container\n */\n@Component({\n tag: 'pds-text',\n styleUrl: 'pds-text.scss',\n shadow: true,\n})\nexport class PdsText {\n @Element() el: HTMLPdsTextElement;\n /**\n * Sets the text alignment.\n */\n @Prop() align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Sets the text color.\n */\n @Prop() color?: string;\n\n /**\n * Sets the text decoration.\n */\n @Prop() decoration?:\n | 'strikethrough'\n | 'underline-dotted';\n\n /**\n * Set the bottom margin for the text.\n */\n @Prop() gutter?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs';\n\n /**\n * If set or `true`, the text will be italic.\n */\n @Prop() italic?: boolean;\n\n /**\n * Sets the font size.\n */\n @Prop() size?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6';\n\n /**\n * Sets the font weight.\n */\n @Prop() weight?:\n | 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold';\n\n /**\n * Determines what semantic text tag to render.\n */\n @Prop() tag:\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em' = \"p\";\n\n /**\n * If set or `true`, the text will be truncated. Must add a `width` to the element.\n */\n @Prop({ reflect: true }) truncate?: boolean;\n\n render() {\n const Tag = this.tag;\n\n const typeClasses = `\n pds-text\n ${this.align !== undefined && this.align.trim() !== '' ? `pds-text--align-${this.align}` : ''}\n ${this.gutter !== undefined && this.gutter.trim() !== '' ? `pds-text--gutter-${this.gutter}` : ''}\n ${this.size !== undefined && this.size.trim() !== '' ? `pds-text--size-${this.size}` : ''}\n ${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}\n ${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}\n `;\n\n return (\n <Tag style={this.color && setColor(this.color)} class={typeClasses} part=\"content\">\n <slot />\n </Tag>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,6+GAA6+G;;MCWn/G,OAAO,GAAA,MAAA;AALpB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAsEE;;AAEG;AACK,QAAA,IAAG,CAAA,GAAA,GAWF,GAAG;AAyBb;IAlBC,MAAM,GAAA;AACJ,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG;AAEpB,QAAA,MAAM,WAAW,GAAG;;QAEhB,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,gBAAA,EAAmB,IAAI,CAAC,KAAK,CAAE,CAAA,GAAG,EAAE;QAC3F,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,MAAM,CAAE,CAAA,GAAG,EAAE;QAC/F,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,eAAA,EAAkB,IAAI,CAAC,IAAI,CAAE,CAAA,GAAG,EAAE;QACvF,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,MAAM,CAAE,CAAA,GAAG,EAAE;QAC/F,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,qBAAA,EAAwB,IAAI,CAAC,UAAU,CAAE,CAAA,GAAG,EAAE;KAClH;QAED,QACE,EAAC,GAAG,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAC,SAAS,EAAA,EAChF,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;"}
1
+ {"version":3,"file":"pds-text.entry.js","sources":["src/components/pds-text/pds-text.scss?tag=pds-text&encapsulation=shadow","src/components/pds-text/pds-text.tsx"],"sourcesContent":[":host {\n display: inline;\n}\n\n:host([decoration=\"underline-dotted\"]) > * {\n text-decoration-color: var(--pine-color-text-tertiary);\n text-decoration-line: underline;\n text-decoration-style: dotted;\n text-decoration-thickness: 12%;\n text-underline-offset: 0.3rem;\n text-underline-position: under;\n}\n\n:host([decoration=\"strikethrough\"])>* {\n text-decoration: line-through;\n}\n\n/* stylelint-disable */\nh1 {\n font: var(--pine-typography-heading-1);\n letter-spacing: var(--pine-letter-spacing-heading-1);\n}\n\nh2 {\n font: var(--pine-typography-heading-2);\n letter-spacing: var(--pine-letter-spacing-heading-2);\n}\n\nh3 {\n font: var(--pine-typography-heading-3);\n letter-spacing: var(--pine-letter-spacing-heading-3);\n}\n\nh4 {\n font: var(--pine-typography-heading-4);\n letter-spacing: var(--pine-letter-spacing-heading-4);\n}\n\nh5 {\n font: var(--pine-typography-heading-5);\n letter-spacing: var(--pine-letter-spacing-heading-5);\n}\n\nh6 {\n font: var(--pine-typography-heading-6);\n letter-spacing: var(--pine-letter-spacing-heading-6);\n}\n\ncode, em, p, pre, strong {\n font: var(--pine-typography-body);\n letter-spacing: var(--pine-letter-spacing);\n}\n/* stylelint-enable */\n\ncode, pre {\n font-family: monospace;\n letter-spacing: 0;\n line-height: 1;\n}\n\nem {\n font-style: normal;\n}\n\nstrong {\n font-weight: bolder;\n}\n\n:host([truncate]) > * {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host([italic]) > * {\n font-style: italic;\n}\n\n// Colors/Variants/Sentiment\n\n// Variable is set in TSX\n// If color prop value isn't valid, will default to body text color\n.pds-text {\n color: var(--color, var(--pine-color-text));\n margin: var(--pine-dimension-none);\n}\n\n// Font Sizes\n$type-sizes: (\n 2xl: var(--pine-font-size-body-2xl),\n xl: var(--pine-font-size-body-xl),\n lg: var(--pine-font-size-body-lg),\n md: var(--pine-font-size-body-md),\n sm: var(--pine-font-size-body-sm),\n xs: var(--pine-font-size-body-xs),\n 2xs: var(--pine-font-size-body-2xs),\n h1: var(--pine-font-size-heading-1),\n h2: var(--pine-font-size-heading-2),\n h3: var(--pine-font-size-heading-3),\n h4: var(--pine-font-size-heading-4),\n h5: var(--pine-font-size-heading-5),\n h6: var(--pine-font-size-heading-6),\n);\n\n@mixin generate-type-sizes($type-sizes) {\n @each $key, $value in $type-sizes {\n .pds-text--size-#{$key} {\n font-size: $value;\n }\n }\n}\n\n@include generate-type-sizes($type-sizes);\n\n// Font Weights\n$type-weights: (\n extra-light: var(--pine-font-weight-extra-light),\n light: var(--pine-font-weight-light),\n regular: var(--pine-font-weight-regular),\n medium: var(--pine-font-weight-medium),\n semibold: var(--pine-font-weight-semi-bold),\n bold: var(--pine-font-weight-bold),\n);\n\n@mixin generate-type-weights($type-weights) {\n @each $key, $value in $type-weights {\n .pds-text--weight-#{$key} {\n font-weight: $value;\n }\n }\n}\n\n@include generate-type-weights($type-weights);\n\n// Gutter Sizes\n$type-gutters: (\n 2xl: var(--pine-dimension-2xl),\n xl: var(--pine-dimension-xl),\n lg: var(--pine-dimension-lg),\n md: var(--pine-dimension-md),\n sm: var(--pine-dimension-sm),\n xs: var(--pine-dimension-xs),\n 2xs: var(--pine-dimension-2xs),\n);\n\n@mixin generate-type-gutters($type-gutters) {\n @each $key, $value in $type-gutters {\n .pds-text--gutter-#{$key} {\n margin-block-end: $value;\n }\n }\n}\n\n@include generate-type-gutters($type-gutters);\n\n// Text Alignment\n$type-alignments: (\n start: start,\n center: center,\n end: end,\n justify: justify,\n);\n\n@mixin generate-type-alignments($type-alignments) {\n @each $key, $value in $type-alignments {\n .pds-text--align-#{$key} {\n text-align: $value;\n }\n }\n}\n\n@include generate-type-alignments($type-alignments);\n","import { Component, h, Prop, Element, Watch } from '@stencil/core';\nimport { setColor } from '../../utils/utils';\nimport { setupTruncationTooltip } from '../../utils/truncation-tooltip';\n\n/**\n * @part content - The text content container\n */\n@Component({\n tag: 'pds-text',\n styleUrl: 'pds-text.scss',\n shadow: true,\n})\nexport class PdsText {\n @Element() el: HTMLPdsTextElement;\n private contentEl: HTMLElement;\n private truncationCleanup: (() => void) | null = null;\n /**\n * Sets the text alignment.\n */\n @Prop() align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Sets the text color.\n */\n @Prop() color?: string;\n\n /**\n * Sets the text decoration.\n */\n @Prop() decoration?:\n | 'strikethrough'\n | 'underline-dotted';\n\n /**\n * Set the bottom margin for the text.\n */\n @Prop() gutter?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs';\n\n /**\n * If set or `true`, the text will be italic.\n */\n @Prop() italic?: boolean;\n\n /**\n * Sets the font size.\n */\n @Prop() size?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6';\n\n /**\n * Sets the font weight.\n */\n @Prop() weight?:\n | 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold';\n\n /**\n * Determines what semantic text tag to render.\n */\n @Prop() tag:\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em' = \"p\";\n\n /**\n * If set or `true`, the text will be truncated. Must add a `width` to the element.\n * When text overflows, a tooltip showing the full text will appear on hover/focus.\n * Note: When truncate is enabled, the element automatically receives tabindex=\"0\" for keyboard accessibility.\n */\n @Prop({ reflect: true }) truncate?: boolean;\n\n @Watch('truncate')\n handleTruncateChange(newValue: boolean) {\n if (newValue) {\n this.initTruncationTooltip();\n } else {\n this.destroyTruncationTooltip();\n }\n }\n\n componentDidLoad() {\n if (this.truncate) {\n this.initTruncationTooltip();\n }\n }\n\n disconnectedCallback() {\n this.destroyTruncationTooltip();\n }\n\n private initTruncationTooltip() {\n // Clean up any existing tooltip before setting up a new one\n this.destroyTruncationTooltip();\n\n if (this.contentEl) {\n this.truncationCleanup = setupTruncationTooltip({\n hostEl: this.el,\n contentEl: this.contentEl,\n getTooltipText: () => this.el.textContent || '',\n });\n }\n }\n\n private destroyTruncationTooltip() {\n if (this.truncationCleanup) {\n this.truncationCleanup();\n this.truncationCleanup = null;\n }\n }\n\n render() {\n const Tag = this.tag;\n\n const typeClasses = `\n pds-text\n ${this.align !== undefined && this.align.trim() !== '' ? `pds-text--align-${this.align}` : ''}\n ${this.gutter !== undefined && this.gutter.trim() !== '' ? `pds-text--gutter-${this.gutter}` : ''}\n ${this.size !== undefined && this.size.trim() !== '' ? `pds-text--size-${this.size}` : ''}\n ${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}\n ${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}\n `;\n\n return (\n <Tag\n ref={(el) => this.contentEl = el}\n style={this.color && setColor(this.color)}\n class={typeClasses}\n part=\"content\"\n tabIndex={this.truncate ? 0 : undefined}\n >\n <slot />\n </Tag>\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAAA,MAAM,UAAU,GAAG,6+GAA6+G;;MCYn/G,OAAO,GAAA,MAAA;AALpB,IAAA,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,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,MAAM,CAAE,CAAA,GAAG,EAAE;QAC/F,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,eAAA,EAAkB,IAAI,CAAC,IAAI,CAAE,CAAA,GAAG,EAAE;QACvF,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,MAAM,CAAE,CAAA,GAAG,EAAE;QAC/F,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAA,qBAAA,EAAwB,IAAI,CAAC,UAAU,CAAE,CAAA,GAAG,EAAE;KAClH;AAED,QAAA,QACE,EAAC,GAAG,EAAA,EAAA,GAAA,EAAA,0CAAA,EACF,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAE,EAChC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EACzC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAC,SAAS,EACd,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,SAAS,EAAA,EAEvC,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as isRequired,e as exposeTypeProperty,a as assignDescription,m as messageId}from"./form-CN-lL5QG.js";import{d as debounceEvent}from"./utils-tJa4KYNO.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./attributes-C0M1gTKv.js";import{b as danger}from"./index-D094LgxJ.js";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsInputTokensCss=":host{--pine-input-color-background-danger:var(--pine-color-red-050)}";var pdsTextareaCss=":host{display:inline-block;width:100%}:host([aria-readonly=true]) textarea{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid){background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-accent);color:var(--pine-color-text-accent)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid):hover{border-color:var(--pine-color-accent-hover)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid):focus-visible{outline-color:var(--pine-color-focus-ring)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid)~.pds-textarea__character-counter{background:color-mix(in srgb, var(--pine-color-accent-disabled) 80%, transparent);color:var(--pine-color-text-accent)}.pds-textarea{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-textarea__label-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.pds-textarea__action{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}label{display:block;-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-textarea__label-wrapper label{-webkit-margin-after:0;margin-block-end:0}.pds-textarea__helper-message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-textarea__error-message{color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;font:var(--pine-typography-body-sm-medium);gap:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-textarea__error-message pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.pds-textarea__field-wrapper{display:inline-block;position:relative;width:100%}.pds-textarea__field{background-color:var(--pine-color-background-container);border:var(--pine-border);border-radius:calc(var(--pine-dimension-xs) * 1.25);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-height:calc(var(--pine-dimension-xl) * 2);min-width:calc(var(--pine-dimension-xl) * 2);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);resize:both;width:100%}:host([max-length]) .pds-textarea__field{padding-bottom:calc(var(--pine-dimension-xs) + var(--pine-dimension-md))}.pds-textarea__field:hover:not(:disabled,.is-invalid){border:var(--pine-border-hover)}.pds-textarea__field:disabled{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-textarea__field:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-textarea__field::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field.is-invalid{background-color:var(--pine-input-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) .pds-textarea__field.is-invalid{background-color:var(--pine-color-red-950)}.pds-textarea__field.is-invalid:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-textarea__character-counter{background:color-mix(in srgb, var(--pine-color-background-container) 80%, transparent);border-radius:calc(var(--pine-dimension-2xs) * 0.5);color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);padding:calc(var(--pine-dimension-2xs) * 0.5) var(--pine-dimension-2xs);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:var(--pine-z-index)}:host([aria-disabled=true]) .pds-textarea__character-counter{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-disabled)}:host([aria-readonly=true]) .pds-textarea__character-counter{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}.pds-textarea__field.is-invalid~.pds-textarea__character-counter{background-color:var(--pine-input-color-background-danger)}:host-context([data-theme=dark]) .pds-textarea__field.is-invalid~.pds-textarea__character-counter{background-color:var(--pine-color-red-950)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";var PdsTextarea=function(){function e(e){var i=this;registerInstance(this,e);this.pdsBlur=createEvent(this,"pdsBlur");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsInput=createEvent(this,"pdsInput");this.pdsTextareaChange=createEvent(this,"pdsTextareaChange");this.pdsKeyDown=createEvent(this,"pdsKeyDown");this.inheritedAttributes={};this._type="textarea";this.disabled=false;this.invalid=false;this.name=this.componentId;this.readonly=false;this.required=false;this.value="";this.hasFocus=false;this.hasAction=false;this.onBlur=function(e){i.hasFocus=false;if(i.focusedValue!==i.value){i.emitValueChange(e)}i.pdsBlur.emit(e)};this.onFocus=function(e){i.hasFocus=true;i.focusedValue=i.value;i.pdsFocus.emit(e)};this.onInput=function(e){var t=e.target;if(t){if(i.maxLength&&t.value.length>i.maxLength){t.value=t.value.substring(0,i.maxLength)}i.value=t.value||""}i.emitInputChange(e);if(i.maxLength&&typeof ResizeObserver!=="undefined"){requestAnimationFrame((function(){i.updateCharacterCounterPosition()}))}};this.onTextareaChange=function(e){i.emitValueChange(e)};this.onKeyDown=function(e){i.pdsKeyDown.emit(e)}}e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeTextarea){this.nativeTextarea.focus()}return[2]}))}))};e.prototype.debounceChanged=function(){var e=this,i=e.pdsInput,t=e.debounce,a=e.originalPdsInput;this.pdsInput=t===undefined?a!==null&&a!==void 0?a:i:debounceEvent(i,t)};e.prototype.valueChanged=function(){var e=this.nativeTextarea;var i=this.getValue();if(e&&e.value!==i){e.value=i}this.updateFormValue();if(this.maxLength&&typeof ResizeObserver!=="undefined"){this.updateCharacterCounterPosition()}};e.prototype.maxLengthChanged=function(){if(this.resizeObserver){this.resizeObserver.disconnect()}if(this.maxLength&&this.nativeTextarea){this.setupResizeObserver()}if(this.internals&&this.internals.setValidity&&this.nativeTextarea){var e=this.nativeTextarea.value.length>(this.maxLength||0);this.internals.setValidity({tooLong:e},e?"Value exceeds maxLength":"",this.nativeTextarea)}};e.prototype.emitInputChange=function(e){var i=this.value;this.pdsInput.emit({value:i,event:e})};e.prototype.emitValueChange=function(e){var i=e.target;isRequired(i,this);var t=i.value;var a=t==null?t:t.toString();this.focusedValue=a;this.pdsTextareaChange.emit({value:a,event:e})};e.prototype.getValue=function(){return this.value||""};e.prototype.textareaClassNames=function(){var e=["pds-textarea__field"];if(this.invalid&&this.invalid===true){e.push("is-invalid")}return e.join(" ")};e.prototype.connectedCallback=function(){this.debounceChanged();if(this.el.attachInternals&&!this.internals){this.internals=this.el.attachInternals()}};e.prototype.disconnectedCallback=function(){if(this.resizeObserver){this.resizeObserver.disconnect()}};e.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign(Object.assign({},inheritAriaAttributes(this.el)),inheritAttributes(this.el));this.hasAction=this.el.querySelector('[slot="action"]')!==null};e.prototype.componentDidLoad=function(){var e=this;this.originalPdsInput=this.pdsInput;this.updateFormValue();this.setupResizeObserver();exposeTypeProperty(this.el,(function(){return e._type}))};e.prototype.setupResizeObserver=function(){var e=this;if(!this.maxLength||!this.nativeTextarea)return;if(typeof ResizeObserver!=="undefined"){this.resizeObserver=new ResizeObserver((function(){requestAnimationFrame((function(){e.updateCharacterCounterPosition()}))}));this.resizeObserver.observe(this.nativeTextarea);requestAnimationFrame((function(){e.updateCharacterCounterPosition()}))}};e.prototype.updateCharacterCounterPosition=function(){if(!this.characterCounter||!this.nativeTextarea)return;if(typeof ResizeObserver==="undefined")return;if(this.characterCounter.offsetWidth===0||this.characterCounter.offsetHeight===0){return}var e=this.nativeTextarea.offsetWidth;var i=this.nativeTextarea.offsetHeight;var t=this.characterCounter.offsetWidth;var a=this.characterCounter.offsetHeight;var r=e-t-8;var s=i-a-8;var n=Math.max(8,Math.min(r,e-t-8));var o=Math.max(8,Math.min(s,i-a-8));this.characterCounter.style.position="absolute";this.characterCounter.style.left="".concat(n,"px");this.characterCounter.style.top="".concat(o,"px");this.characterCounter.style.right="auto";this.characterCounter.style.bottom="auto"};e.prototype.renderCharacterCounter=function(){var e=this;if(!this.maxLength){return null}var i=this.getValue().length;return h("div",{class:"pds-textarea__character-counter",ref:function(i){return e.characterCounter=i},role:"status","aria-live":"polite","aria-label":"".concat(i," of ").concat(this.maxLength," characters")},i," / ",this.maxLength)};e.prototype.renderAction=function(){var e=this.el.querySelector('[slot="action"]')!==null;if(e){return h("div",{class:"pds-textarea__action",part:"action"},h("slot",{name:"action"}))}return null};e.prototype.updateFormValue=function(){if(this.internals&&this.internals.setFormValue){var e=this.getValue();this.internals.setFormValue(e||null);if(this.nativeTextarea&&this.internals&&this.internals.setValidity){this.internals.setValidity(this.nativeTextarea.validity,this.nativeTextarea.validationMessage,this.nativeTextarea)}}};e.prototype.formResetCallback=function(){this.value="";this.updateFormValue()};e.prototype.formDisabledCallback=function(e){this.disabled=e};e.prototype.formStateRestoreCallback=function(e){if(typeof e==="string"){this.value=e}else if(e instanceof FormData&&this.name){var i=e.get(this.name);if(typeof i==="string"){this.value=i}}};e.prototype.render=function(){var e=this;var i=this.getValue();return h(Host,{key:"3930616df94105a62fc1d837bda9a03526ab1f8d","aria-disabled":this.disabled?"true":null,"aria-readonly":this.readonly?"true":null,"has-action":this.hasAction&&!this.hideLabel?"true":null},h("div",{key:"da1befdef1050646ebcd8dd27b93d8dc8d777a15",class:"pds-textarea"},this.label&&h("div",{key:"4140a3852e9f3f7d490457b9c8d0d15ab04ea4c2",class:"pds-textarea__label-wrapper"},h("label",{key:"7a38d1b5f394e0304252827c11ca5fc89c22abf9",htmlFor:this.componentId},h("span",{key:"da9a2cff7f0cf25d027de8cf05feae97a89e38d9",class:this.hideLabel?"visually-hidden":""},this.label)),!this.hideLabel&&this.renderAction()),h("div",{key:"443e7d2fc01781ae0808c4212ba29887545c1225",class:"pds-textarea__field-wrapper"},h("textarea",Object.assign({key:"41c0cb685f60fec270102fb67a73d4c341033c6e",ref:function(i){return e.nativeTextarea=i},"aria-describedby":assignDescription(this.componentId,this.invalid,this.helperMessage),"aria-invalid":this.invalid?"true":undefined,autocomplete:this.autocomplete,class:this.textareaClassNames(),disabled:this.disabled,id:this.componentId,maxlength:this.maxLength,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,rows:this.rows,onBlur:this.onBlur,onChange:this.onTextareaChange,onFocus:this.onFocus,onInput:this.onInput,onKeyDown:this.onKeyDown},this.inheritedAttributes),i),this.renderCharacterCounter()),this.helperMessage&&h("p",{key:"3bfc2cc6ff60ef1e54feec57c3b1194342ec6d45",class:"pds-textarea__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage),this.invalid&&h("p",{key:"cb288096c3398103b8458b09576fabb7154c9867","aria-live":"assertive",class:"pds-textarea__error-message",id:messageId(this.componentId,"error")},h("pds-icon",{key:"3274739f2dcea054a9df861f8ac5dd97f8267b4c",icon:danger,size:"small"}),this.errorMessage)))};Object.defineProperty(e,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"],maxLength:["maxLengthChanged"]}},enumerable:false,configurable:true});return e}();PdsTextarea.style=labelCss+(pdsInputTokensCss+pdsTextareaCss);export{PdsTextarea as pds_textarea};
1
+ import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-DHPhrb5T.js";import{i as isRequired,e as exposeTypeProperty,a as assignDescription,m as messageId}from"./form-CN-lL5QG.js";import{d as debounceEvent}from"./utils-tJa4KYNO.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./attributes-C0M1gTKv.js";import{b as danger}from"./index-BFkDH5XU.js";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsInputTokensCss=":host{--pine-input-color-background-danger:var(--pine-color-red-050)}";var pdsTextareaCss=":host{display:inline-block;width:100%}:host([aria-readonly=true]) textarea{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid){background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-accent);color:var(--pine-color-text-accent)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid):hover{border-color:var(--pine-color-accent-hover)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid):focus-visible{outline-color:var(--pine-color-focus-ring)}:host([highlight]:not([disabled]):not([aria-disabled=true]):not([aria-readonly=true])) .pds-textarea__field:not(.is-invalid)~.pds-textarea__character-counter{background:color-mix(in srgb, var(--pine-color-accent-disabled) 80%, transparent);color:var(--pine-color-text-accent)}.pds-textarea{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-textarea__label-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.pds-textarea__action{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-webkit-margin-start:var(--pine-dimension-xs);margin-inline-start:var(--pine-dimension-xs)}label{display:block;-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-textarea__label-wrapper label{-webkit-margin-after:0;margin-block-end:0}.pds-textarea__helper-message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-textarea__error-message{color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;font:var(--pine-typography-body-sm-medium);gap:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-textarea__error-message pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.pds-textarea__field-wrapper{display:inline-block;position:relative;width:100%}.pds-textarea__field{background-color:var(--pine-color-background-container);border:var(--pine-border);border-radius:calc(var(--pine-dimension-xs) * 1.25);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-height:calc(var(--pine-dimension-xl) * 2);min-width:calc(var(--pine-dimension-xl) * 2);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);resize:both;width:100%}:host([max-length]) .pds-textarea__field{padding-bottom:calc(var(--pine-dimension-xs) + var(--pine-dimension-md))}.pds-textarea__field:hover:not(:disabled,.is-invalid){border:var(--pine-border-hover)}.pds-textarea__field:disabled{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-textarea__field:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-textarea__field::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field.is-invalid{background-color:var(--pine-input-color-background-danger);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) .pds-textarea__field.is-invalid{background-color:var(--pine-color-red-950)}.pds-textarea__field.is-invalid:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-textarea__character-counter{background:color-mix(in srgb, var(--pine-color-background-container) 80%, transparent);border-radius:calc(var(--pine-dimension-2xs) * 0.5);color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);padding:calc(var(--pine-dimension-2xs) * 0.5) var(--pine-dimension-2xs);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:var(--pine-z-index)}:host([aria-disabled=true]) .pds-textarea__character-counter{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-disabled)}:host([aria-readonly=true]) .pds-textarea__character-counter{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}.pds-textarea__field.is-invalid~.pds-textarea__character-counter{background-color:var(--pine-input-color-background-danger)}:host-context([data-theme=dark]) .pds-textarea__field.is-invalid~.pds-textarea__character-counter{background-color:var(--pine-color-red-950)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";var PdsTextarea=function(){function e(e){var i=this;registerInstance(this,e);this.pdsBlur=createEvent(this,"pdsBlur");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsInput=createEvent(this,"pdsInput");this.pdsTextareaChange=createEvent(this,"pdsTextareaChange");this.pdsKeyDown=createEvent(this,"pdsKeyDown");this.inheritedAttributes={};this._type="textarea";this.disabled=false;this.invalid=false;this.name=this.componentId;this.readonly=false;this.required=false;this.value="";this.hasFocus=false;this.hasAction=false;this.onBlur=function(e){i.hasFocus=false;if(i.focusedValue!==i.value){i.emitValueChange(e)}i.pdsBlur.emit(e)};this.onFocus=function(e){i.hasFocus=true;i.focusedValue=i.value;i.pdsFocus.emit(e)};this.onInput=function(e){var t=e.target;if(t){if(i.maxLength&&t.value.length>i.maxLength){t.value=t.value.substring(0,i.maxLength)}i.value=t.value||""}i.emitInputChange(e);if(i.maxLength&&typeof ResizeObserver!=="undefined"){requestAnimationFrame((function(){i.updateCharacterCounterPosition()}))}};this.onTextareaChange=function(e){i.emitValueChange(e)};this.onKeyDown=function(e){i.pdsKeyDown.emit(e)}}e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeTextarea){this.nativeTextarea.focus()}return[2]}))}))};e.prototype.debounceChanged=function(){var e=this,i=e.pdsInput,t=e.debounce,a=e.originalPdsInput;this.pdsInput=t===undefined?a!==null&&a!==void 0?a:i:debounceEvent(i,t)};e.prototype.valueChanged=function(){var e=this.nativeTextarea;var i=this.getValue();if(e&&e.value!==i){e.value=i}this.updateFormValue();if(this.maxLength&&typeof ResizeObserver!=="undefined"){this.updateCharacterCounterPosition()}};e.prototype.maxLengthChanged=function(){if(this.resizeObserver){this.resizeObserver.disconnect()}if(this.maxLength&&this.nativeTextarea){this.setupResizeObserver()}if(this.internals&&this.internals.setValidity&&this.nativeTextarea){var e=this.nativeTextarea.value.length>(this.maxLength||0);this.internals.setValidity({tooLong:e},e?"Value exceeds maxLength":"",this.nativeTextarea)}};e.prototype.emitInputChange=function(e){var i=this.value;this.pdsInput.emit({value:i,event:e})};e.prototype.emitValueChange=function(e){var i=e.target;isRequired(i,this);var t=i.value;var a=t==null?t:t.toString();this.focusedValue=a;this.pdsTextareaChange.emit({value:a,event:e})};e.prototype.getValue=function(){return this.value||""};e.prototype.textareaClassNames=function(){var e=["pds-textarea__field"];if(this.invalid&&this.invalid===true){e.push("is-invalid")}return e.join(" ")};e.prototype.connectedCallback=function(){this.debounceChanged();if(this.el.attachInternals&&!this.internals){this.internals=this.el.attachInternals()}};e.prototype.disconnectedCallback=function(){if(this.resizeObserver){this.resizeObserver.disconnect()}};e.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign(Object.assign({},inheritAriaAttributes(this.el)),inheritAttributes(this.el));this.hasAction=this.el.querySelector('[slot="action"]')!==null};e.prototype.componentDidLoad=function(){var e=this;this.originalPdsInput=this.pdsInput;this.updateFormValue();this.setupResizeObserver();exposeTypeProperty(this.el,(function(){return e._type}))};e.prototype.setupResizeObserver=function(){var e=this;if(!this.maxLength||!this.nativeTextarea)return;if(typeof ResizeObserver!=="undefined"){this.resizeObserver=new ResizeObserver((function(){requestAnimationFrame((function(){e.updateCharacterCounterPosition()}))}));this.resizeObserver.observe(this.nativeTextarea);requestAnimationFrame((function(){e.updateCharacterCounterPosition()}))}};e.prototype.updateCharacterCounterPosition=function(){if(!this.characterCounter||!this.nativeTextarea)return;if(typeof ResizeObserver==="undefined")return;if(this.characterCounter.offsetWidth===0||this.characterCounter.offsetHeight===0){return}var e=this.nativeTextarea.offsetWidth;var i=this.nativeTextarea.offsetHeight;var t=this.characterCounter.offsetWidth;var a=this.characterCounter.offsetHeight;var r=e-t-8;var s=i-a-8;var n=Math.max(8,Math.min(r,e-t-8));var o=Math.max(8,Math.min(s,i-a-8));this.characterCounter.style.position="absolute";this.characterCounter.style.left="".concat(n,"px");this.characterCounter.style.top="".concat(o,"px");this.characterCounter.style.right="auto";this.characterCounter.style.bottom="auto"};e.prototype.renderCharacterCounter=function(){var e=this;if(!this.maxLength){return null}var i=this.getValue().length;return h("div",{class:"pds-textarea__character-counter",ref:function(i){return e.characterCounter=i},role:"status","aria-live":"polite","aria-label":"".concat(i," of ").concat(this.maxLength," characters")},i," / ",this.maxLength)};e.prototype.renderAction=function(){var e=this.el.querySelector('[slot="action"]')!==null;if(e){return h("div",{class:"pds-textarea__action",part:"action"},h("slot",{name:"action"}))}return null};e.prototype.updateFormValue=function(){if(this.internals&&this.internals.setFormValue){var e=this.getValue();this.internals.setFormValue(e||null);if(this.nativeTextarea&&this.internals&&this.internals.setValidity){this.internals.setValidity(this.nativeTextarea.validity,this.nativeTextarea.validationMessage,this.nativeTextarea)}}};e.prototype.formResetCallback=function(){this.value="";this.updateFormValue()};e.prototype.formDisabledCallback=function(e){this.disabled=e};e.prototype.formStateRestoreCallback=function(e){if(typeof e==="string"){this.value=e}else if(e instanceof FormData&&this.name){var i=e.get(this.name);if(typeof i==="string"){this.value=i}}};e.prototype.render=function(){var e=this;var i=this.getValue();return h(Host,{key:"3930616df94105a62fc1d837bda9a03526ab1f8d","aria-disabled":this.disabled?"true":null,"aria-readonly":this.readonly?"true":null,"has-action":this.hasAction&&!this.hideLabel?"true":null},h("div",{key:"da1befdef1050646ebcd8dd27b93d8dc8d777a15",class:"pds-textarea"},this.label&&h("div",{key:"4140a3852e9f3f7d490457b9c8d0d15ab04ea4c2",class:"pds-textarea__label-wrapper"},h("label",{key:"7a38d1b5f394e0304252827c11ca5fc89c22abf9",htmlFor:this.componentId},h("span",{key:"da9a2cff7f0cf25d027de8cf05feae97a89e38d9",class:this.hideLabel?"visually-hidden":""},this.label)),!this.hideLabel&&this.renderAction()),h("div",{key:"443e7d2fc01781ae0808c4212ba29887545c1225",class:"pds-textarea__field-wrapper"},h("textarea",Object.assign({key:"41c0cb685f60fec270102fb67a73d4c341033c6e",ref:function(i){return e.nativeTextarea=i},"aria-describedby":assignDescription(this.componentId,this.invalid,this.helperMessage),"aria-invalid":this.invalid?"true":undefined,autocomplete:this.autocomplete,class:this.textareaClassNames(),disabled:this.disabled,id:this.componentId,maxlength:this.maxLength,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,rows:this.rows,onBlur:this.onBlur,onChange:this.onTextareaChange,onFocus:this.onFocus,onInput:this.onInput,onKeyDown:this.onKeyDown},this.inheritedAttributes),i),this.renderCharacterCounter()),this.helperMessage&&h("p",{key:"3bfc2cc6ff60ef1e54feec57c3b1194342ec6d45",class:"pds-textarea__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage),this.invalid&&h("p",{key:"cb288096c3398103b8458b09576fabb7154c9867","aria-live":"assertive",class:"pds-textarea__error-message",id:messageId(this.componentId,"error")},h("pds-icon",{key:"3274739f2dcea054a9df861f8ac5dd97f8267b4c",icon:danger,size:"small"}),this.errorMessage)))};Object.defineProperty(e,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"],maxLength:["maxLengthChanged"]}},enumerable:false,configurable:true});return e}();PdsTextarea.style=labelCss+(pdsInputTokensCss+pdsTextareaCss);export{PdsTextarea as pds_textarea};
2
2
  //# sourceMappingURL=pds-textarea.entry.js.map