@sellmate/design-system 1.27.1 → 1.29.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 (378) hide show
  1. package/dist/cjs/{component.datepicker-CUQbDSku.js → component.datepicker-zFTQQKMH.js} +1 -2
  2. package/dist/cjs/component.listBox-MHAv4Yy7.js +15 -0
  3. package/dist/cjs/{component.listItem-Bnh0r_CA.js → component.listItem-cAO_ppOz.js} +0 -7
  4. package/dist/cjs/design-system.cjs.js +2 -2
  5. package/dist/cjs/{index-DsYLSqCp.js → index-iiJZMzVM.js} +1 -15
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/sd-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
  10. package/dist/cjs/sd-button_2.cjs.entry.js +1 -1
  11. package/dist/cjs/sd-calendar_2.cjs.entry.js +6 -6
  12. package/dist/cjs/sd-callout.cjs.entry.js +1 -1
  13. package/dist/cjs/sd-card.cjs.entry.js +1 -1
  14. package/dist/cjs/sd-checkbox.cjs.entry.js +2 -3
  15. package/dist/cjs/sd-chip-input.cjs.entry.js +5 -4
  16. package/dist/cjs/sd-chip.cjs.entry.js +1 -1
  17. package/dist/cjs/sd-circle-progress.cjs.entry.js +6 -4
  18. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +37 -37
  19. package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
  20. package/dist/cjs/{sd-date-picker.config-De7ahWIs.js → sd-date-picker.config-Chrd8c4v.js} +1 -1
  21. package/dist/cjs/{sd-date-picker_7.cjs.entry.js → sd-date-picker_8.cjs.entry.js} +381 -19
  22. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +4 -4
  23. package/dist/cjs/sd-divider.cjs.entry.js +3 -3
  24. package/dist/cjs/sd-dropdown-button.cjs.entry.js +2 -2
  25. package/dist/cjs/sd-field_3.cjs.entry.js +10 -10
  26. package/dist/cjs/sd-form.cjs.entry.js +1 -1
  27. package/dist/cjs/sd-ghost-button_3.cjs.entry.js +4 -5
  28. package/dist/cjs/sd-guide.cjs.entry.js +5 -10
  29. package/dist/cjs/sd-key-value-table.cjs.entry.js +88 -18
  30. package/dist/cjs/sd-linear-progress.cjs.entry.js +3 -3
  31. package/dist/cjs/sd-loading-container.cjs.entry.js +3 -3
  32. package/dist/cjs/sd-modal-container.cjs.entry.js +16 -2
  33. package/dist/cjs/sd-pagination.cjs.entry.js +173 -0
  34. package/dist/cjs/sd-popover.cjs.entry.js +2 -2
  35. package/dist/cjs/sd-popup.cjs.entry.js +3 -3
  36. package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/sd-radio.cjs.entry.js +2 -3
  38. package/dist/cjs/{sd-select_3.cjs.entry.js → sd-select-list-item_4.cjs.entry.js} +294 -314
  39. package/dist/cjs/sd-switch.cjs.entry.js +2 -2
  40. package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
  41. package/dist/cjs/sd-text-link.cjs.entry.js +1 -1
  42. package/dist/cjs/sd-toast-container.cjs.entry.js +2 -2
  43. package/dist/cjs/sd-toast.cjs.entry.js +3 -3
  44. package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
  45. package/dist/cjs/{system-MjrAugX-.js → system-B4KkVpu2.js} +1 -7
  46. package/dist/cjs/{tooltipArrow-FLiD3ceS.js → tooltipArrow-DOOcBlLp.js} +1 -1
  47. package/dist/cjs/{useDatePicker-iMd6WToc.js → useDatePicker-CgpIfwLA.js} +1 -1
  48. package/dist/collection/collection-manifest.json +0 -5
  49. package/dist/collection/components/sd-circle-progress/sd-circle-progress.css +13 -0
  50. package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +23 -1
  51. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +3 -0
  52. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +35 -59
  53. package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
  54. package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
  55. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
  56. package/dist/collection/components/sd-divider/sd-divider.js +1 -1
  57. package/dist/collection/components/sd-field/sd-field.js +4 -4
  58. package/dist/collection/components/sd-file-picker/sd-file-picker.config.js +9 -0
  59. package/dist/collection/components/sd-file-picker/sd-file-picker.css +18 -0
  60. package/dist/collection/components/sd-file-picker/sd-file-picker.js +73 -7
  61. package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +1 -1
  62. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  63. package/dist/collection/components/sd-guide/sd-guide.config.js +0 -1
  64. package/dist/collection/components/sd-guide/sd-guide.css +0 -3
  65. package/dist/collection/components/sd-guide/sd-guide.js +2 -3
  66. package/dist/collection/components/sd-input/sd-input.js +2 -2
  67. package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +2 -0
  68. package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +5 -1
  69. package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +65 -15
  70. package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
  71. package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
  72. package/dist/collection/components/sd-loading-modal/sd-loading-modal.css +7 -0
  73. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +18 -1
  74. package/dist/collection/components/sd-modal-container/sd-modal-container.js +15 -1
  75. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  76. package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
  77. package/dist/collection/components/sd-popup/sd-popup.js +1 -1
  78. package/dist/collection/components/sd-radio-group/sd-radio-group.css +2 -2
  79. package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
  80. package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
  81. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
  82. package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
  83. package/dist/collection/components/sd-select/sd-select.js +4 -4
  84. package/dist/collection/components/sd-switch/sd-switch.js +1 -1
  85. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  86. package/dist/collection/components/sd-tag/sd-tag.js +2 -2
  87. package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
  88. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  89. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  90. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  91. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  92. package/dist/components/index.js +1 -1
  93. package/dist/components/p-4S0_Ykmo.js +1 -0
  94. package/dist/components/{p-Dy6LmOzw.js → p-9Ap2W-Mi.js} +1 -1
  95. package/dist/components/{p-NeXvaRu7.js → p-BFVfSW9t.js} +1 -1
  96. package/dist/components/{p-Du_Yc-lW.js → p-BHjezpAC.js} +1 -1
  97. package/dist/components/{p-DnxEeX9I.js → p-BIEPMPWA.js} +1 -1
  98. package/dist/components/{p--AZbwi7P.js → p-BKu0I6Io.js} +1 -1
  99. package/dist/components/{p-DTb2c83G.js → p-B_Zwr4Et.js} +1 -1
  100. package/dist/components/{p-BysikR_g.js → p-Bpv90tfa.js} +1 -1
  101. package/dist/components/p-Bth2l1cy.js +1 -0
  102. package/dist/components/{p-Cok_EW_N.js → p-C7mC7a1z.js} +1 -1
  103. package/dist/components/{p-CIPPETF-.js → p-CBoDoYDO.js} +1 -1
  104. package/dist/components/p-CErFctrV.js +1 -0
  105. package/dist/components/{p-SROa9QCy.js → p-CFTyEfB9.js} +1 -1
  106. package/dist/components/{p-BaRjXqSM.js → p-CSr33M9s.js} +1 -1
  107. package/dist/components/p-CYMMLsGt.js +1 -0
  108. package/dist/components/{p-CvSPsoRb.js → p-C_SG4M4z.js} +1 -1
  109. package/dist/components/{p-BV4cnHWn.js → p-C_in6AVN.js} +1 -1
  110. package/dist/components/{p-DsQQFJ8o.js → p-CbS69IvC.js} +1 -1
  111. package/dist/components/{p-BOJALVxB.js → p-CgSXYw_0.js} +1 -1
  112. package/dist/components/{p-DVq9oE_p.js → p-CmRF12Fy.js} +1 -1
  113. package/dist/components/p-CnRfET5y.js +1 -0
  114. package/dist/components/{p-BFy8txYj.js → p-Cvsrc0be.js} +1 -1
  115. package/dist/components/{p-PvltLPHp.js → p-DJ8z7_EG.js} +1 -1
  116. package/dist/components/{p-CwwJD-NF.js → p-DJmxpVkK.js} +1 -1
  117. package/dist/components/{p-D7XGOtx0.js → p-DMoFncVl.js} +1 -1
  118. package/dist/components/{p-BxphFsxh.js → p-DN7MAx-q.js} +1 -1
  119. package/dist/components/{p-hP1aeMuZ.js → p-DS6NVBvu.js} +1 -1
  120. package/dist/components/{p-Bk6aI8rL.js → p-D_56BjcD.js} +1 -1
  121. package/dist/components/{p-DMrzTImA.js → p-Dg1UrMqI.js} +1 -1
  122. package/dist/components/{p-BU1H7ElF.js → p-Di1q4f5E.js} +1 -1
  123. package/dist/components/p-DlJaYVWf.js +1 -0
  124. package/dist/components/p-OO7xxhkC.js +1 -0
  125. package/dist/components/{p-DYp8I4VH.js → p-R-Sdglj0.js} +1 -1
  126. package/dist/components/p-Uh9emYrV.js +1 -0
  127. package/dist/components/{p-DkaajrxX.js → p-f0aBxUBG.js} +1 -1
  128. package/dist/components/{p-DT-e9J59.js → p-idG6CMO0.js} +1 -1
  129. package/dist/components/p-oYbVr-z0.js +1 -0
  130. package/dist/components/p-x9AWBHPy.js +1 -0
  131. package/dist/components/sd-action-modal.js +1 -1
  132. package/dist/components/sd-badge.js +1 -1
  133. package/dist/components/sd-barcode-input.js +1 -1
  134. package/dist/components/sd-button.js +1 -1
  135. package/dist/components/sd-calendar.js +1 -1
  136. package/dist/components/sd-callout.js +1 -1
  137. package/dist/components/sd-card.js +1 -1
  138. package/dist/components/sd-checkbox.js +1 -1
  139. package/dist/components/sd-chip-input.js +1 -1
  140. package/dist/components/sd-chip.js +1 -1
  141. package/dist/components/sd-circle-progress.js +1 -1
  142. package/dist/components/sd-confirm-modal.js +1 -1
  143. package/dist/components/sd-date-box.js +1 -1
  144. package/dist/components/sd-date-picker-trigger.js +1 -1
  145. package/dist/components/sd-date-picker.js +1 -1
  146. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  147. package/dist/components/sd-date-range-picker.js +1 -1
  148. package/dist/components/sd-divider.js +1 -1
  149. package/dist/components/sd-dropdown-button.js +1 -1
  150. package/dist/components/sd-field.js +1 -1
  151. package/dist/components/sd-file-picker.js +1 -1
  152. package/dist/components/sd-floating-portal.js +1 -1
  153. package/dist/components/sd-form.js +1 -1
  154. package/dist/components/sd-ghost-button.js +1 -1
  155. package/dist/components/sd-guide.js +1 -1
  156. package/dist/components/sd-icon.js +1 -1
  157. package/dist/components/sd-input.js +1 -1
  158. package/dist/components/sd-key-value-table.js +1 -1
  159. package/dist/components/sd-linear-progress.js +1 -1
  160. package/dist/components/sd-loading-container.js +1 -1
  161. package/dist/components/sd-loading-modal.js +1 -1
  162. package/dist/components/sd-modal-container.js +1 -1
  163. package/dist/components/sd-number-input.js +1 -1
  164. package/dist/components/sd-pagination.js +1 -1
  165. package/dist/components/sd-popover.js +1 -1
  166. package/dist/components/sd-popup.js +1 -1
  167. package/dist/components/sd-portal.js +1 -1
  168. package/dist/components/sd-radio-button.js +1 -1
  169. package/dist/components/sd-radio-group.js +1 -1
  170. package/dist/components/sd-radio.js +1 -1
  171. package/dist/components/sd-select-list-item-search.js +1 -1
  172. package/dist/components/sd-select-list-item.js +1 -1
  173. package/dist/components/sd-select-listbox.js +1 -1
  174. package/dist/components/sd-select-trigger.js +1 -1
  175. package/dist/components/sd-select.js +1 -1
  176. package/dist/components/sd-switch.js +1 -1
  177. package/dist/components/sd-tabs.js +1 -1
  178. package/dist/components/sd-tag.js +1 -1
  179. package/dist/components/sd-text-link.js +1 -1
  180. package/dist/components/sd-textarea.js +1 -1
  181. package/dist/components/sd-toast-container.js +1 -1
  182. package/dist/components/sd-toast.js +1 -1
  183. package/dist/components/sd-toggle.js +1 -1
  184. package/dist/components/sd-tooltip.js +1 -1
  185. package/dist/design-system/design-system.css +1 -1
  186. package/dist/design-system/design-system.esm.js +1 -1
  187. package/dist/design-system/{p-ddb9a2c4.entry.js → p-02f0b906.entry.js} +1 -1
  188. package/dist/design-system/{p-a4e1dd8c.entry.js → p-0c1d1a15.entry.js} +1 -1
  189. package/dist/design-system/{p-cb0cbcb0.entry.js → p-0e014b76.entry.js} +1 -1
  190. package/dist/design-system/{p-49b1636a.entry.js → p-1b5fcf7b.entry.js} +1 -1
  191. package/dist/design-system/{p-5aa5aec3.entry.js → p-1ed1bfa1.entry.js} +1 -1
  192. package/dist/design-system/{p-8c1a9374.entry.js → p-246aafb9.entry.js} +1 -1
  193. package/dist/design-system/p-26a27312.entry.js +1 -0
  194. package/dist/design-system/{p-d790fbb8.entry.js → p-2a4d2ee0.entry.js} +1 -1
  195. package/dist/design-system/{p-270c8529.entry.js → p-2d6a7d7b.entry.js} +1 -1
  196. package/dist/design-system/{p-947dcc28.entry.js → p-3595cafb.entry.js} +1 -1
  197. package/dist/design-system/p-3cd2751a.entry.js +1 -0
  198. package/dist/design-system/p-4S0_Ykmo.js +1 -0
  199. package/dist/design-system/p-4b474538.entry.js +1 -0
  200. package/dist/design-system/{p-e63bf0e1.entry.js → p-4c85f6f6.entry.js} +1 -1
  201. package/dist/design-system/{p-55c8ce37.entry.js → p-53fe2741.entry.js} +1 -1
  202. package/dist/design-system/{p-06b56059.entry.js → p-55c0be7d.entry.js} +1 -1
  203. package/dist/design-system/p-5a257ed9.entry.js +1 -0
  204. package/dist/design-system/{p-459a408f.entry.js → p-840006b1.entry.js} +1 -1
  205. package/dist/design-system/{p-dae6914d.entry.js → p-86329ae3.entry.js} +1 -1
  206. package/dist/design-system/{p-8ac340db.entry.js → p-8de3b502.entry.js} +1 -1
  207. package/dist/design-system/{p-9603971e.entry.js → p-8ed1d470.entry.js} +1 -1
  208. package/dist/design-system/{p-D2S9Zafz.js → p-B91K50wC.js} +1 -1
  209. package/dist/design-system/{p-BqWuC4-J.js → p-BPKiBSGr.js} +1 -1
  210. package/dist/design-system/p-BhcvMs8c.js +1 -0
  211. package/dist/design-system/p-Bth2l1cy.js +1 -0
  212. package/dist/design-system/p-DlJaYVWf.js +1 -0
  213. package/dist/design-system/p-Dz490Ukt.js +2 -0
  214. package/dist/design-system/{p-761c008c.entry.js → p-a631cd78.entry.js} +1 -1
  215. package/dist/design-system/p-adf2f398.entry.js +1 -0
  216. package/dist/design-system/{p-26297c6e.entry.js → p-b585f94b.entry.js} +1 -1
  217. package/dist/design-system/p-be54fd3a.entry.js +1 -0
  218. package/dist/design-system/{p-7540f591.entry.js → p-c1066f40.entry.js} +1 -1
  219. package/dist/design-system/{p-b86a69ce.entry.js → p-c5cffcc6.entry.js} +1 -1
  220. package/dist/design-system/p-c7d2c195.entry.js +1 -0
  221. package/dist/design-system/{p-839e6b5a.entry.js → p-cb6ab65c.entry.js} +1 -1
  222. package/dist/design-system/{p-07755193.entry.js → p-d204cac5.entry.js} +1 -1
  223. package/dist/design-system/p-d2ce01ac.entry.js +1 -0
  224. package/dist/design-system/p-d51f4170.entry.js +1 -0
  225. package/dist/design-system/{p-dfa16f49.entry.js → p-d9f33192.entry.js} +1 -1
  226. package/dist/design-system/{p-b9387621.entry.js → p-e7740a5f.entry.js} +1 -1
  227. package/dist/design-system/p-e85bf462.entry.js +1 -0
  228. package/dist/design-system/{p-9c0d3011.entry.js → p-ea008087.entry.js} +1 -1
  229. package/dist/design-system/{p-5142cd06.entry.js → p-ec4ad48c.entry.js} +1 -1
  230. package/dist/design-system/{p-5f1dae23.entry.js → p-f962e5d2.entry.js} +1 -1
  231. package/dist/esm/{component.datepicker-laVsm9VM.js → component.datepicker-BOxGhKKP.js} +1 -2
  232. package/dist/esm/component.listBox-DlJaYVWf.js +13 -0
  233. package/dist/esm/{component.listItem-U8VaRj9c.js → component.listItem-4S0_Ykmo.js} +1 -7
  234. package/dist/esm/design-system.js +3 -3
  235. package/dist/esm/{index-BZg-6aSz.js → index-Dz490Ukt.js} +2 -14
  236. package/dist/esm/loader.js +3 -3
  237. package/dist/esm/sd-action-modal.entry.js +1 -1
  238. package/dist/esm/sd-badge.entry.js +1 -1
  239. package/dist/esm/sd-barcode-input.entry.js +1 -1
  240. package/dist/esm/sd-button_2.entry.js +1 -1
  241. package/dist/esm/sd-calendar_2.entry.js +6 -6
  242. package/dist/esm/sd-callout.entry.js +1 -1
  243. package/dist/esm/sd-card.entry.js +1 -1
  244. package/dist/esm/sd-checkbox.entry.js +2 -3
  245. package/dist/esm/sd-chip-input.entry.js +4 -3
  246. package/dist/esm/sd-chip.entry.js +1 -1
  247. package/dist/esm/sd-circle-progress.entry.js +6 -4
  248. package/dist/esm/sd-confirm-modal_2.entry.js +37 -37
  249. package/dist/esm/sd-date-box.entry.js +1 -1
  250. package/dist/esm/{sd-date-picker.config-D-ks6qNf.js → sd-date-picker.config-krRuSUsA.js} +1 -1
  251. package/dist/esm/{sd-date-picker_7.entry.js → sd-date-picker_8.entry.js} +381 -20
  252. package/dist/esm/sd-date-range-picker-calendar.entry.js +4 -4
  253. package/dist/esm/sd-divider.entry.js +3 -3
  254. package/dist/esm/sd-dropdown-button.entry.js +2 -2
  255. package/dist/esm/sd-field_3.entry.js +10 -10
  256. package/dist/esm/sd-form.entry.js +1 -1
  257. package/dist/esm/sd-ghost-button_3.entry.js +4 -5
  258. package/dist/esm/sd-guide.entry.js +5 -10
  259. package/dist/esm/sd-key-value-table.entry.js +87 -17
  260. package/dist/esm/sd-linear-progress.entry.js +3 -3
  261. package/dist/esm/sd-loading-container.entry.js +3 -3
  262. package/dist/esm/sd-modal-container.entry.js +16 -2
  263. package/dist/esm/sd-pagination.entry.js +171 -0
  264. package/dist/esm/sd-popover.entry.js +2 -2
  265. package/dist/esm/sd-popup.entry.js +3 -3
  266. package/dist/esm/sd-radio-button.entry.js +1 -1
  267. package/dist/esm/sd-radio.entry.js +2 -3
  268. package/dist/esm/{sd-select_3.entry.js → sd-select-list-item_4.entry.js} +277 -298
  269. package/dist/esm/sd-switch.entry.js +2 -2
  270. package/dist/esm/sd-tabs.entry.js +2 -2
  271. package/dist/esm/sd-text-link.entry.js +1 -1
  272. package/dist/esm/sd-toast-container.entry.js +2 -2
  273. package/dist/esm/sd-toast.entry.js +3 -3
  274. package/dist/esm/sd-toggle.entry.js +2 -2
  275. package/dist/esm/{system-BJfiMC9H.js → system-Bth2l1cy.js} +1 -7
  276. package/dist/esm/{tooltipArrow-BAi-pktU.js → tooltipArrow-CEHVt90h.js} +1 -1
  277. package/dist/esm/{useDatePicker-DoUg--aq.js → useDatePicker-BG0lUGJG.js} +1 -1
  278. package/dist/types/components/sd-circle-progress/sd-circle-progress.d.ts +2 -0
  279. package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +10 -10
  280. package/dist/types/components/sd-file-picker/sd-file-picker.config.d.ts +6 -0
  281. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +10 -0
  282. package/dist/types/components/sd-guide/sd-guide.config.d.ts +0 -1
  283. package/dist/types/components/sd-key-value-table/sd-key-value-table.config.d.ts +22 -3
  284. package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +9 -1
  285. package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +2 -0
  286. package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +3 -0
  287. package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +2 -0
  288. package/dist/types/components.d.ts +44 -696
  289. package/dist/types/index.d.ts +0 -1
  290. package/hydrate/index.js +254 -2235
  291. package/hydrate/index.mjs +254 -2235
  292. package/package.json +1 -1
  293. package/dist/cjs/component.table-BrI3b--h.js +0 -71
  294. package/dist/cjs/constants-DJRV1upE.js +0 -5
  295. package/dist/cjs/sd-pagination_4.cjs.entry.js +0 -856
  296. package/dist/cjs/sd-select-list-item_2.cjs.entry.js +0 -172
  297. package/dist/cjs/sd-select.config-C9Ohe1QA.js +0 -143
  298. package/dist/cjs/sd-table.cjs.entry.js +0 -956
  299. package/dist/cjs/sd-table.config-DzC55sap.js +0 -82
  300. package/dist/cjs/sd-td.cjs.entry.js +0 -201
  301. package/dist/collection/components/sd-table/constants.js +0 -1
  302. package/dist/collection/components/sd-table/sd-table.config.js +0 -87
  303. package/dist/collection/components/sd-table/sd-table.css +0 -180
  304. package/dist/collection/components/sd-table/sd-table.js +0 -1709
  305. package/dist/collection/components/sd-table/sd-table.stories.helpers.js +0 -242
  306. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.css +0 -10
  307. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +0 -110
  308. package/dist/collection/components/sd-table/sd-td/sd-td.css +0 -15
  309. package/dist/collection/components/sd-table/sd-td/sd-td.js +0 -381
  310. package/dist/collection/components/sd-table/sd-thead/sd-thead.css +0 -186
  311. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +0 -629
  312. package/dist/collection/components/sd-table/sd-tr/sd-tr.css +0 -145
  313. package/dist/collection/components/sd-table/sd-tr/sd-tr.js +0 -528
  314. package/dist/components/p-BHNytAtJ.js +0 -1
  315. package/dist/components/p-BJfiMC9H.js +0 -1
  316. package/dist/components/p-BQqXWtI6.js +0 -1
  317. package/dist/components/p-BXcizROm.js +0 -1
  318. package/dist/components/p-BZdgdRXJ.js +0 -1
  319. package/dist/components/p-CJcs7kNH.js +0 -1
  320. package/dist/components/p-CV5LiFKt.js +0 -1
  321. package/dist/components/p-CiTn4ZiI.js +0 -1
  322. package/dist/components/p-CmK45nj3.js +0 -1
  323. package/dist/components/p-D9tQwTWy.js +0 -1
  324. package/dist/components/p-DeXLIS7e.js +0 -1
  325. package/dist/components/p-DmC83_E9.js +0 -1
  326. package/dist/components/p-DvvGi4J_.js +0 -1
  327. package/dist/components/p-U8VaRj9c.js +0 -1
  328. package/dist/components/p-jwusYvH0.js +0 -1
  329. package/dist/components/p-sZMi_32I.js +0 -1
  330. package/dist/components/sd-table.d.ts +0 -11
  331. package/dist/components/sd-table.js +0 -1
  332. package/dist/components/sd-tbody.d.ts +0 -11
  333. package/dist/components/sd-tbody.js +0 -1
  334. package/dist/components/sd-td.d.ts +0 -11
  335. package/dist/components/sd-td.js +0 -1
  336. package/dist/components/sd-thead.d.ts +0 -11
  337. package/dist/components/sd-thead.js +0 -1
  338. package/dist/components/sd-tr.d.ts +0 -11
  339. package/dist/components/sd-tr.js +0 -1
  340. package/dist/design-system/p-147e0413.entry.js +0 -1
  341. package/dist/design-system/p-51c7839c.entry.js +0 -1
  342. package/dist/design-system/p-5f5f2fbe.entry.js +0 -1
  343. package/dist/design-system/p-65285327.entry.js +0 -1
  344. package/dist/design-system/p-6aec5853.entry.js +0 -1
  345. package/dist/design-system/p-80abdfe7.entry.js +0 -1
  346. package/dist/design-system/p-9825e76c.entry.js +0 -1
  347. package/dist/design-system/p-B-LOf2aM.js +0 -1
  348. package/dist/design-system/p-BJfiMC9H.js +0 -1
  349. package/dist/design-system/p-BXcizROm.js +0 -1
  350. package/dist/design-system/p-BZg-6aSz.js +0 -2
  351. package/dist/design-system/p-CAFz8W8_.js +0 -1
  352. package/dist/design-system/p-D9tQwTWy.js +0 -1
  353. package/dist/design-system/p-U8VaRj9c.js +0 -1
  354. package/dist/design-system/p-b84f5550.entry.js +0 -1
  355. package/dist/design-system/p-edfb5c83.entry.js +0 -1
  356. package/dist/design-system/p-efc55114.entry.js +0 -1
  357. package/dist/design-system/p-fd671afe.entry.js +0 -1
  358. package/dist/design-system/p-fe2b853f.entry.js +0 -1
  359. package/dist/design-system/p-ff9ccbf6.entry.js +0 -1
  360. package/dist/design-system/p-sZMi_32I.js +0 -1
  361. package/dist/esm/component.table-D9tQwTWy.js +0 -69
  362. package/dist/esm/constants-sZMi_32I.js +0 -3
  363. package/dist/esm/sd-pagination_4.entry.js +0 -851
  364. package/dist/esm/sd-select-list-item_2.entry.js +0 -169
  365. package/dist/esm/sd-select.config-D6ktrl7E.js +0 -128
  366. package/dist/esm/sd-table.config-BbIWNUE2.js +0 -69
  367. package/dist/esm/sd-table.entry.js +0 -954
  368. package/dist/esm/sd-td.entry.js +0 -199
  369. package/dist/types/components/sd-table/constants.d.ts +0 -50
  370. package/dist/types/components/sd-table/sd-table.config.d.ts +0 -70
  371. package/dist/types/components/sd-table/sd-table.d.ts +0 -199
  372. package/dist/types/components/sd-table/sd-table.stories.helpers.d.ts +0 -39
  373. package/dist/types/components/sd-table/sd-tbody/sd-tbody.d.ts +0 -15
  374. package/dist/types/components/sd-table/sd-td/sd-td.d.ts +0 -38
  375. package/dist/types/components/sd-table/sd-thead/sd-thead.d.ts +0 -62
  376. package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +0 -54
  377. /package/dist/components/{p-laVsm9VM.js → p-BOxGhKKP.js} +0 -0
  378. /package/dist/design-system/{p-laVsm9VM.js → p-BOxGhKKP.js} +0 -0
@@ -1,954 +0,0 @@
1
- import { r as registerInstance, c as createEvent, a as getElement, d as readTask, f as forceUpdate, h, H as Host } from './index-BZg-6aSz.js';
2
- import { T as TABLE_ID_ATTR } from './constants-sZMi_32I.js';
3
- import { T as TABLE_BODY_LAYOUT, a as TABLE_SELECTABLE_COLUMN_WIDTH, b as TABLE_BODY_TYPOGRAPHY, c as TABLE_BORDER, d as TABLE_RADIUS } from './sd-table.config-BbIWNUE2.js';
4
- import './component.table-D9tQwTWy.js';
5
- import './system-BJfiMC9H.js';
6
-
7
- let urlAlphabet =
8
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
9
-
10
- /* @ts-self-types="./index.d.ts" */
11
- let nanoid = (size = 21) => {
12
- let id = '';
13
- let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
14
- while (size--) {
15
- id += urlAlphabet[bytes[size] & 63];
16
- }
17
- return id
18
- };
19
-
20
- const sdTableCss = () => `sd-table,:host{display:block;width:100%;height:var(--table-host-height);max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:100%;width:var(--table-width, 100%);max-width:100%;min-width:0;color:#222222;display:flex;flex-direction:column}.sd-table__wrapper{width:100%;min-width:0;height:calc(100% - var(--pagination-height, 0px));border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--radius-useTop{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.sd-table__wrapper--radius-full{border-radius:0}.sd-table__scroll-container{width:100%;height:100%;display:flex;flex-direction:column;position:relative;font-family:var(--table-body-font-family, inherit);font-weight:var(--table-body-font-weight, 400);font-size:var(--table-body-font-size, 12px);line-height:var(--table-body-line-height, 20px);text-decoration:var(--table-body-text-decoration, none);overflow:auto;background:#FFFFFF}.sd-table__scroll-container::-webkit-scrollbar{opacity:0;width:8px;background:#E5E5E5}.sd-table__scroll-container::-webkit-scrollbar:horizontal{height:8px}.sd-table__scroll-container::-webkit-scrollbar-thumb{height:80px;background-color:#CCCCCC;border-radius:4px}.sd-table__scroll-container::-webkit-scrollbar-track{background-color:#E5E5E5}.sd-table__scroll-container--loading{overflow:hidden !important;pointer-events:none}.sd-table__scroll-container--no-data{overflow:hidden;pointer-events:none}.sd-table__no-data{position:absolute;top:36px;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;font-size:var(--table-body-font-size, 12px);color:#888888;pointer-events:none;z-index:200;background:rgba(255, 255, 255, 0.6)}.sd-table__no-data-header-overlay{position:absolute;top:0;left:0;right:0;height:36px;background:rgba(255, 255, 255, 0.6);z-index:210;pointer-events:none}.sd-table__no-data-content{pointer-events:auto;min-height:60px;width:100%;display:flex;align-items:center;justify-content:center}.sd-table__loading{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center;pointer-events:none}.sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table--selectable sd-thead,.sd-table--selectable sd-tbody{--selectable:true}.sd-table--sticky-header sd-thead thead{position:sticky;top:0;z-index:120}.sd-table--sticky-column sd-thead,.sd-table--sticky-column sd-tbody{--sticky-column:true}.sd-table--scrolled-left sd-thead,.sd-table--scrolled-left sd-tbody{--scrolled-left:true}.sd-table--scrolled-right sd-thead,.sd-table--scrolled-right sd-tbody{--scrolled-right:true}.sd-table--resizable sd-thead{--resizable:true}.sd-table--no-data sd-thead{opacity:0.4}.sd-table__pagination{position:relative;background:#F9F9F9;height:48px;display:flex;align-items:center;justify-content:center;border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);margin-top:-1px;border-radius:var(--table-radius, 8px)}.sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}`;
21
-
22
- const SdTable = class {
23
- constructor(hostRef) {
24
- registerInstance(this, hostRef);
25
- this.sdSelectChange = createEvent(this, "sdSelectChange", 7);
26
- this.sdPageChange = createEvent(this, "sdPageChange", 7);
27
- this.sdRowsPerPageChange = createEvent(this, "sdRowsPerPageChange", 7);
28
- this.sdVirtualUpdate = createEvent(this, "sdVirtualUpdate", 7);
29
- this.sdVirtualReachEnd = createEvent(this, "sdVirtualReachEnd", 7);
30
- }
31
- static DEFAULT_NO_DATA_LABEL = '데이터가 없습니다.';
32
- get el() { return getElement(this); }
33
- /** 테이블 고유 ID (자식 슬롯 매핑에 사용) */
34
- tableId = nanoid(8);
35
- fallbackTableId = nanoid(8);
36
- /** 컬럼 정의 목록 */
37
- columns = [];
38
- /** 행 데이터 배열 */
39
- rows;
40
- /** 현재 선택된 행 목록 */
41
- selected = [];
42
- /** 행 고유 식별 필드명 */
43
- rowKey = 'id';
44
- /** 행 선택(체크박스) 기능 활성화 여부 */
45
- selectable = false;
46
- /** 컬럼 너비 조절 기능 활성화 여부 */
47
- resizable = false;
48
- /** 테이블 너비 */
49
- width;
50
- /** 테이블 높이 */
51
- height;
52
- /** 헤더 고정(sticky) 여부 */
53
- stickyHeader = false;
54
- /** 고정할 좌우 컬럼 수 */
55
- stickyColumn = { left: 0, right: 0 };
56
- /** border-radius 제어 */
57
- radius = 'default';
58
- /** 데이터 없을 때 표시할 메시지 */
59
- noDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
60
- resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
61
- /** 로딩 스피너 표시 여부 */
62
- isLoading = false;
63
- /** 페이지네이션 옵션 */
64
- pagination;
65
- /** 테이블 내부에서 페이지네이션을 직접 관리할지 여부 */
66
- useInternalPagination = false;
67
- /** 페이지당 행 수 선택 셀렉트 표시 여부 */
68
- useRowsPerPageSelect = false;
69
- /** 행 높이를 줄인 조밀 모드 여부 */
70
- dense = false;
71
- // ─── Virtual Scroll ───────────────────────────────────────────────
72
- /** 가상 스크롤 사용 여부 */
73
- useVirtualScroll = false;
74
- /** 가상 스크롤 행 높이 (px, 없으면 dense 여부에 따라 자동) */
75
- rowHeight;
76
- get effectiveRowHeight() {
77
- if (this.rowHeight != null)
78
- return this.rowHeight;
79
- return this.dense
80
- ? Number(TABLE_BODY_LAYOUT.dense.height)
81
- : Number(TABLE_BODY_LAYOUT.default.height);
82
- }
83
- /** 가상 스크롤 상하 버퍼 행 수 */
84
- virtualBuffer = 5;
85
- /** 가상 스크롤 끝 도달 감지 임계값 (마지막 N행 이내에 들어오면 이벤트 발생) */
86
- virtualEndThreshold = 10;
87
- // ─────────────────────────────────────────────────────────────────
88
- /** 페이지당 행 수 선택 옵션 목록 */
89
- rowsPerPageOption = [
90
- { label: '10개씩 보기', value: 10 },
91
- { label: '25개씩 보기', value: 25 },
92
- { label: '50개씩 보기', value: 50 },
93
- { label: '100개씩 보기', value: 100 },
94
- ];
95
- /** 행 선택 상태가 변경될 때 선택된 행 목록을 전달합니다. */
96
- sdSelectChange;
97
- /** 페이지가 변경될 때 새 페이지 번호를 전달합니다. */
98
- sdPageChange;
99
- /** 페이지당 행 수가 변경될 때 발생합니다. */
100
- sdRowsPerPageChange;
101
- /** 가상 스크롤 가시 범위가 변경될 때 발생합니다. */
102
- sdVirtualUpdate;
103
- /** 가상 스크롤이 끝 임계값에 도달할 때 발생합니다. */
104
- sdVirtualReachEnd;
105
- currentPage = 1;
106
- innerRowsPerPage = 10;
107
- innerSelected = new Set();
108
- columnWidths = [];
109
- scrolledLeft = false;
110
- scrolledRight = false;
111
- rowCount = 0;
112
- loadingScrollTop = 0;
113
- noDataBodyHeight = 60;
114
- // light DOM에 sd-thead / sd-tbody 자식이 없으면 sd-table이 직접 렌더해야 함을 알리는 플래그.
115
- // componentWillLoad에서 한 번 결정되며, 이후 동적 토글은 지원하지 않는다.
116
- autoThead = false;
117
- autoTbody = false;
118
- vsStart = 0;
119
- vsEnd = 0;
120
- lastReachEndNotifiedRowCount = -1;
121
- scrollContainer = null;
122
- noDataContentEl = null;
123
- noDataContentResizeObserver;
124
- onScroll;
125
- // 키: `${rowKey}::${field}` → { rowspan, colspan }
126
- spanRegistry = new Map();
127
- // rowKey → Set<field>: useFrame=true인 sd-td가 있는 행을 추적한다.
128
- // 하나라도 등록되면 해당 행은 dense를 무시하고 default 레이아웃으로 렌더된다.
129
- useFrameRegistry = new Map();
130
- // 키: `${rowKey}::${field}` → sd-td의 sdClass 문자열
131
- // sd-tr가 td를 그릴 때 머지해서 셀-단위 커스텀 클래스를 적용한다.
132
- cellClassRegistry = new Map();
133
- // rowKey 문자열 → rows 배열에서의 visual index.
134
- // rowspan 위쪽 행 스캔에서 "내 위에 있느냐"를 판정하기 위한 시각적 순서 소스.
135
- // rows prop이 있으면 채워지고, 없으면 비어 있어 Number(rowKey) fallback이 사용된다.
136
- rowIndexMap = new Map();
137
- rebuildRowIndexMap() {
138
- this.rowIndexMap.clear();
139
- if (!Array.isArray(this.rows))
140
- return;
141
- const field = this.rowKey;
142
- this.rows.forEach((r, i) => {
143
- const k = r?.[field];
144
- if (k == null)
145
- return;
146
- this.rowIndexMap.set(String(k), i);
147
- });
148
- }
149
- // rowKey의 시각적 행 인덱스를 돌려준다.
150
- // 1) rows 기반 맵에 있으면 그 값 (임의 문자열 rowKey 지원)
151
- // 2) 없으면 Number(rowKey) fallback (rows prop 없이 슬롯-온리 + 숫자 rowKey 사용 패턴)
152
- // 3) 둘 다 안 되면 null — rowspan 평가 스킵
153
- resolveRowIndex(rowKey) {
154
- const fromMap = this.rowIndexMap.get(rowKey);
155
- if (fromMap !== undefined)
156
- return fromMap;
157
- const n = Number(rowKey);
158
- return Number.isFinite(n) ? n : null;
159
- }
160
- toFiniteNumber(value, fallback) {
161
- const n = typeof value === 'number' ? value : Number(value);
162
- return Number.isFinite(n) ? n : fallback;
163
- }
164
- isRowsPerPageValue(value) {
165
- return value === null || typeof value === 'string' || typeof value === 'number';
166
- }
167
- isValidTableId(value) {
168
- return (typeof value === 'string' &&
169
- value.trim().length > 0 &&
170
- value !== 'undefined' &&
171
- value !== 'null');
172
- }
173
- getResolvedTableId() {
174
- if (this.isValidTableId(this.tableId))
175
- return this.tableId;
176
- const attrId = this.el?.getAttribute(TABLE_ID_ATTR);
177
- if (this.isValidTableId(attrId))
178
- return attrId;
179
- return this.fallbackTableId;
180
- }
181
- syncTableIdAttribute() {
182
- const resolvedTableId = this.getResolvedTableId();
183
- if (this.el?.getAttribute(TABLE_ID_ATTR) !== resolvedTableId) {
184
- this.el.setAttribute(TABLE_ID_ATTR, resolvedTableId);
185
- }
186
- }
187
- handleIsLoadingChange(newVal) {
188
- if (newVal) {
189
- this.loadingScrollTop = this.scrollContainer?.scrollTop ?? 0;
190
- }
191
- this.syncNoDataContentObserver();
192
- }
193
- handleUseVirtualScrollChange(newVal) {
194
- if (newVal) {
195
- // DOM이 새 --table-container-height로 업데이트된 후 계산해야 정확함
196
- readTask(() => this.propagateVirtualUpdate());
197
- }
198
- }
199
- handleColumnsChange(newCols) {
200
- this.columnWidths = newCols.map(c => (c.autoWidth ? 0 : parseInt(c.width || '120', 10)));
201
- this.refreshChildrenConfig();
202
- }
203
- handleRowsChange(newRows) {
204
- if (!Array.isArray(newRows))
205
- return;
206
- this.rowCount = newRows.length;
207
- this.rebuildRowIndexMap();
208
- if (this.useVirtualScroll)
209
- this.propagateVirtualUpdate(true);
210
- this.pushRowsToChildren(newRows);
211
- this.syncNoDataContentObserver();
212
- }
213
- handleRowKeyChange() {
214
- this.rebuildRowIndexMap();
215
- }
216
- handleTableIdChange() {
217
- this.syncTableIdAttribute();
218
- }
219
- handleNoDataLabelChange(newLabel) {
220
- if (typeof newLabel === 'string' &&
221
- newLabel.trim().length > 0 &&
222
- newLabel !== 'undefined' &&
223
- newLabel !== 'null') {
224
- this.resolvedNoDataLabel = newLabel;
225
- }
226
- else {
227
- this.resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
228
- }
229
- }
230
- handleConfigChange() {
231
- this.refreshChildrenConfig();
232
- }
233
- handleSelectedChange(newSelected) {
234
- this.innerSelected = new Set(newSelected);
235
- }
236
- handlePaginationChange(newVal) {
237
- if (newVal?.page != null && newVal.page !== this.currentPage) {
238
- this.currentPage = newVal.page;
239
- }
240
- if (newVal?.rowsPerPage != null && newVal.rowsPerPage !== this.innerRowsPerPage) {
241
- this.innerRowsPerPage = newVal.rowsPerPage;
242
- }
243
- }
244
- detectChildren() {
245
- const hasThead = !!this.el.querySelector(':scope > sd-thead');
246
- const hasTbody = !!this.el.querySelector(':scope > sd-tbody');
247
- this.autoThead = !hasThead;
248
- this.autoTbody = !hasTbody;
249
- }
250
- componentWillLoad() {
251
- this.syncTableIdAttribute();
252
- this.handleNoDataLabelChange(this.noDataLabel);
253
- this.detectChildren();
254
- this.innerSelected = new Set(this.selected || []);
255
- this.columnWidths = (this.columns || []).map(c => c.autoWidth ? 0 : parseInt(c.width || '120', 10));
256
- this.rebuildRowIndexMap();
257
- if (this.pagination?.page != null) {
258
- this.currentPage = this.pagination.page;
259
- }
260
- if (this.pagination?.rowsPerPage != null) {
261
- this.innerRowsPerPage = this.pagination.rowsPerPage;
262
- }
263
- // host element 에 자식 컴포넌트(sd-thead/sd-tbody/sd-tr) 가 직접 접근하는 internal sync helpers 를 monkey-patch.
264
- // 28개 메서드 전체를 typed interface 로 노출하면 코드 비용이 크고, 어차피 internal 이라 외부 사용자가 호출하지 않는다.
265
- // 정식 @Method 노출로 옮기는 작업은 별도 이슈로 분리.
266
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
267
- const el = this.el;
268
- el.isRowSelectedSync = this.isRowSelectedSync.bind(this);
269
- el.updateRowSelectSync = this.updateRowSelectSync.bind(this);
270
- el.toggleSelectAllSync = this.toggleSelectAllSync.bind(this);
271
- el.getIsAllCheckedSync = this.getIsAllCheckedSync.bind(this);
272
- el.getStickyStyleSync = this.getStickyStyleSync.bind(this);
273
- el.setRowCountSync = this.setRowCountSync.bind(this);
274
- el.handleResize = this.handleResize.bind(this);
275
- el.getPaginationInfoSync = this.getPaginationInfoSync.bind(this);
276
- el.getVirtualScrollRangeSync = this.getVirtualScrollRangeSync.bind(this);
277
- el.getConfigSync = this.getConfigSync.bind(this);
278
- el.getTableIdSync = () => this.getResolvedTableId();
279
- el.getVirtualScrollConfigSync = this.getVirtualScrollConfigSync.bind(this);
280
- el.calculateVisibleRange = this.calculateVisibleRange.bind(this);
281
- el.registerSpanSync = this.registerSpanSync.bind(this);
282
- el.unregisterSpanSync = this.unregisterSpanSync.bind(this);
283
- el.getSpanSync = this.getSpanSync.bind(this);
284
- el.isCoveredSync = this.isCoveredSync.bind(this);
285
- el.hasRowspanSync = this.hasRowspanSync.bind(this);
286
- el.registerCellClassSync = this.registerCellClassSync.bind(this);
287
- el.unregisterCellClassSync = this.unregisterCellClassSync.bind(this);
288
- el.getCellClassSync = this.getCellClassSync.bind(this);
289
- el.registerUseFrameSync = this.registerUseFrameSync.bind(this);
290
- el.unregisterUseFrameSync = this.unregisterUseFrameSync.bind(this);
291
- el.hasUseFrameInRowSync = this.hasUseFrameInRowSync.bind(this);
292
- el.isCellUseFrameSync = this.isCellUseFrameSync.bind(this);
293
- if (Array.isArray(this.rows)) {
294
- this.rowCount = this.rows.length;
295
- this.pushRowsToChildren(this.rows);
296
- }
297
- }
298
- componentDidLoad() {
299
- if (Array.isArray(this.rows)) {
300
- this.pushRowsToChildren(this.rows);
301
- }
302
- readTask(() => {
303
- const wrapper = this.el.shadowRoot?.querySelector('.sd-table__scroll-container');
304
- if (!wrapper)
305
- return;
306
- let rafPending = false;
307
- this.onScroll = () => {
308
- // 가로 스크롤 그림자
309
- const scrollLeft = wrapper.scrollLeft;
310
- const scrollWidth = wrapper.scrollWidth;
311
- const clientWidth = wrapper.clientWidth;
312
- const newScrolledLeft = scrollLeft > 0;
313
- const newScrolledRight = scrollLeft + clientWidth < scrollWidth;
314
- if (this.scrolledLeft !== newScrolledLeft || this.scrolledRight !== newScrolledRight) {
315
- this.scrolledLeft = newScrolledLeft;
316
- this.scrolledRight = newScrolledRight;
317
- this.refreshChildrenConfig();
318
- }
319
- // 세로 가상 스크롤 — RAF로 프레임당 1회만 처리
320
- if (this.useVirtualScroll && !rafPending) {
321
- rafPending = true;
322
- requestAnimationFrame(() => {
323
- rafPending = false;
324
- this.propagateVirtualUpdate();
325
- });
326
- }
327
- };
328
- this.scrollContainer = wrapper;
329
- wrapper.addEventListener('scroll', this.onScroll, { passive: true });
330
- this.onScroll();
331
- if (this.useVirtualScroll) {
332
- this.propagateVirtualUpdate(); // 초기 렌더
333
- }
334
- });
335
- this.syncNoDataContentObserver();
336
- }
337
- disconnectedCallback() {
338
- if (this.scrollContainer && this.onScroll) {
339
- this.scrollContainer.removeEventListener('scroll', this.onScroll);
340
- }
341
- this.noDataContentResizeObserver?.disconnect();
342
- this.noDataContentResizeObserver = undefined;
343
- }
344
- syncNoDataContentObserver() {
345
- const isNoData = this.rowCount === 0 && !this.isLoading;
346
- if (!isNoData) {
347
- this.noDataContentResizeObserver?.disconnect();
348
- this.noDataContentResizeObserver = undefined;
349
- this.noDataBodyHeight = 60;
350
- return;
351
- }
352
- this.observeNoDataContentHeight();
353
- }
354
- // observer를 붙이고 콘텐츠 높이를 측정해 noDataBodyHeight를 갱신하는 함수
355
- observeNoDataContentHeight() {
356
- if (typeof ResizeObserver === 'undefined')
357
- return;
358
- const target = this.noDataContentEl;
359
- if (!target)
360
- return;
361
- this.noDataContentResizeObserver?.disconnect();
362
- this.noDataContentResizeObserver = new ResizeObserver(() => {
363
- const measured = Math.ceil(target.scrollHeight);
364
- const nextHeight = Math.max(60, measured);
365
- if (nextHeight !== this.noDataBodyHeight) {
366
- this.noDataBodyHeight = nextHeight;
367
- }
368
- });
369
- this.noDataContentResizeObserver.observe(target);
370
- readTask(() => {
371
- if (!this.noDataContentEl)
372
- return;
373
- const measured = Math.ceil(this.noDataContentEl.scrollHeight);
374
- const next = Math.max(60, measured);
375
- if (next !== this.noDataBodyHeight) {
376
- this.noDataBodyHeight = next;
377
- }
378
- });
379
- }
380
- queryChildEl(selector) {
381
- return (this.el.querySelector(selector) ??
382
- this.el.shadowRoot?.querySelector(selector) ??
383
- null);
384
- }
385
- queryAllTr() {
386
- const light = Array.from(this.el.querySelectorAll('sd-tr'));
387
- const shadow = Array.from(this.el.shadowRoot?.querySelectorAll('sd-tr') ?? []);
388
- return [...light, ...shadow];
389
- }
390
- pushRowsToChildren(rows) {
391
- const tbody = this.queryChildEl('sd-tbody');
392
- if (tbody)
393
- tbody.rows = rows;
394
- const thead = this.queryChildEl('sd-thead');
395
- if (thead)
396
- thead.rows = rows;
397
- }
398
- handleStructureSlotChange = () => {
399
- if (Array.isArray(this.rows)) {
400
- this.pushRowsToChildren(this.rows);
401
- }
402
- this.refreshChildrenConfig();
403
- };
404
- refreshChildrenSelection() {
405
- const thead = this.queryChildEl('sd-thead');
406
- thead?.refreshSelection?.();
407
- this.queryAllTr().forEach(tr => tr.refreshSelection?.());
408
- }
409
- refreshChildrenConfig() {
410
- const thead = this.queryChildEl('sd-thead');
411
- thead?.refreshConfig?.();
412
- this.queryAllTr().forEach(tr => tr.refreshConfig?.());
413
- }
414
- maybeEmitVirtualReachEnd(start, end) {
415
- const threshold = Math.max(1, this.virtualEndThreshold);
416
- const nearEnd = end >= Math.max(0, this.rowCount - threshold);
417
- if (!nearEnd)
418
- return;
419
- if (this.lastReachEndNotifiedRowCount === this.rowCount)
420
- return;
421
- this.lastReachEndNotifiedRowCount = this.rowCount;
422
- this.sdVirtualReachEnd.emit({
423
- from: start,
424
- to: end,
425
- rowCount: this.rowCount,
426
- threshold,
427
- });
428
- }
429
- propagateVirtualUpdate(forceSpacerUpdate = false) {
430
- if (!this.scrollContainer || !this.useVirtualScroll)
431
- return;
432
- const scrollTop = this.toFiniteNumber(this.scrollContainer.scrollTop, 0);
433
- const containerHeight = this.toFiniteNumber(this.scrollContainer.clientHeight, 0);
434
- const { start, end } = this.calculateVisibleRange(scrollTop, containerHeight);
435
- if (!Number.isFinite(start) || !Number.isFinite(end))
436
- return;
437
- const rangeChanged = this.vsStart !== start || this.vsEnd !== end;
438
- if (!rangeChanged && !forceSpacerUpdate)
439
- return;
440
- this.vsStart = start;
441
- this.vsEnd = end;
442
- const topHeight = start * this.effectiveRowHeight;
443
- const bottomHeight = Math.max(0, (this.rowCount - end) * this.effectiveRowHeight);
444
- // setSpacersSync 는 sd-tbody 가 host element 에 monkey-patch 하는 internal sync helper.
445
- const tbody = this.queryChildEl('sd-tbody');
446
- tbody?.setSpacersSync?.(topHeight, bottomHeight);
447
- if (rangeChanged) {
448
- this.sdVirtualUpdate.emit({
449
- from: start,
450
- to: end,
451
- });
452
- }
453
- this.maybeEmitVirtualReachEnd(start, end);
454
- }
455
- getVirtualScrollConfigSync() {
456
- return {
457
- useVirtualScroll: this.useVirtualScroll,
458
- rowHeight: this.effectiveRowHeight,
459
- virtualBuffer: this.virtualBuffer,
460
- vsStart: this.vsStart,
461
- vsEnd: this.vsEnd,
462
- rowCount: this.rowCount,
463
- };
464
- }
465
- getConfigSync() {
466
- return {
467
- columns: this.columns,
468
- selectable: this.selectable,
469
- resizable: this.resizable,
470
- stickyColumn: this.stickyColumn,
471
- stickyHeader: this.stickyHeader,
472
- scrolledLeft: this.scrolledLeft,
473
- scrolledRight: this.scrolledRight,
474
- columnWidths: this.columnWidths,
475
- dense: this.dense,
476
- };
477
- }
478
- registerUseFrameSync(rowKey, field) {
479
- if (rowKey == null || field === '')
480
- return;
481
- let fields = this.useFrameRegistry.get(rowKey);
482
- if (!fields) {
483
- fields = new Set();
484
- this.useFrameRegistry.set(rowKey, fields);
485
- }
486
- fields.add(field);
487
- }
488
- unregisterUseFrameSync(rowKey, field) {
489
- if (rowKey == null || field === '')
490
- return;
491
- const fields = this.useFrameRegistry.get(rowKey);
492
- if (!fields)
493
- return;
494
- fields.delete(field);
495
- if (fields.size === 0)
496
- this.useFrameRegistry.delete(rowKey);
497
- }
498
- hasUseFrameInRowSync(rowKey) {
499
- const fields = this.useFrameRegistry.get(rowKey);
500
- return fields != null && fields.size > 0;
501
- }
502
- isCellUseFrameSync(rowKey, field) {
503
- return this.useFrameRegistry.get(rowKey)?.has(field) ?? false;
504
- }
505
- isRowSelectedSync(row) {
506
- return Array.from(this.innerSelected).some(r => r[this.rowKey ?? 'id'] === row[this.rowKey ?? 'id']);
507
- }
508
- /** 행이 선택되어 있는지 확인합니다. */
509
- async isRowSelected(row) {
510
- return this.isRowSelectedSync(row);
511
- }
512
- updateRowSelectSync(row) {
513
- const selectedArray = Array.from(this.innerSelected);
514
- const exists = this.isRowSelectedSync(row);
515
- const newSelected = exists
516
- ? selectedArray.filter(r => r[this.rowKey ?? 'id'] !== row[this.rowKey ?? 'id'])
517
- : [...selectedArray, row];
518
- if (newSelected.length === selectedArray.length)
519
- return;
520
- this.innerSelected = new Set(newSelected);
521
- this.selected = Array.from(this.innerSelected);
522
- this.sdSelectChange.emit(Array.from(this.innerSelected));
523
- this.refreshChildrenSelection();
524
- }
525
- /** 행 선택 상태를 토글합니다. */
526
- async updateRowSelect(row) {
527
- this.updateRowSelectSync(row);
528
- }
529
- toggleSelectAllSync(checked, rows) {
530
- if (checked) {
531
- const pageRows = new Set([...rows]);
532
- this.innerSelected = new Set([...this.innerSelected, ...pageRows]);
533
- }
534
- else {
535
- const currentPageKeys = rows.map(r => r[this.rowKey ?? 'id']);
536
- this.innerSelected = new Set([...this.innerSelected].filter(r => !currentPageKeys.includes(r[this.rowKey ?? 'id'])));
537
- }
538
- this.selected = Array.from(this.innerSelected);
539
- this.sdSelectChange.emit(Array.from(this.innerSelected));
540
- this.refreshChildrenSelection();
541
- }
542
- /** 전체 행 선택/해제를 처리합니다. */
543
- async toggleSelectAll(checked, rows) {
544
- this.toggleSelectAllSync(checked, rows);
545
- }
546
- getIsAllCheckedSync(rows) {
547
- const total = rows.length;
548
- const selectedCount = rows.filter(row => Array.from(this.innerSelected).some(selectedRow => selectedRow[this.rowKey ?? 'id'] === row[this.rowKey ?? 'id'])).length;
549
- if (selectedCount === 0)
550
- return false;
551
- if (selectedCount === total)
552
- return true;
553
- return null; // indeterminate
554
- }
555
- /** 전체 선택 체크 상태를 반환합니다 (true/false/null=indeterminate). */
556
- async getIsAllChecked(rows) {
557
- return this.getIsAllCheckedSync(rows);
558
- }
559
- changePage(page) {
560
- if (!this.useInternalPagination) {
561
- this.sdPageChange.emit(page);
562
- return;
563
- }
564
- this.currentPage = page;
565
- this.sdPageChange.emit(this.currentPage);
566
- this.updateRowsVisibility();
567
- }
568
- updateRowsVisibility() {
569
- this.queryAllTr().forEach(tr => tr.updateVisibility?.());
570
- }
571
- changeRowsPerPage(perPage) {
572
- const changedRowsPerPage = perPage != null && perPage !== '' ? Number(perPage) : 0;
573
- if (!this.useInternalPagination) {
574
- this.sdRowsPerPageChange.emit(changedRowsPerPage);
575
- return;
576
- }
577
- this.innerRowsPerPage = changedRowsPerPage;
578
- const newLastPage = Math.max(1, Math.ceil(this.rowCount / changedRowsPerPage));
579
- if (this.currentPage > newLastPage) {
580
- this.currentPage = newLastPage;
581
- }
582
- this.sdRowsPerPageChange.emit(changedRowsPerPage);
583
- this.updateRowsVisibility();
584
- }
585
- get lastPageNumber() {
586
- if (this.useInternalPagination) {
587
- return Math.max(1, Math.ceil(this.rowCount / this.innerRowsPerPage));
588
- }
589
- const { lastPage, rowsPerPage = 10 } = this.pagination || {};
590
- return lastPage ?? Math.max(1, Math.ceil(this.rowCount / rowsPerPage));
591
- }
592
- handleResize(index, event, reversed = false) {
593
- if (typeof document === 'undefined')
594
- return;
595
- const startX = event.clientX;
596
- const startWidth = this.columnWidths[index];
597
- const handleMouseMove = (moveEvent) => {
598
- const col = this.columns[index];
599
- if (col == null)
600
- return;
601
- const minWidth = col.minWidth || 50;
602
- const maxWidth = col.maxWidth || 9999;
603
- const delta = moveEvent.clientX - startX;
604
- const newWidth = Math.min(Math.max(startWidth + (reversed ? -delta : delta), minWidth), maxWidth);
605
- this.columnWidths = this.columnWidths.map((width, idx) => (idx === index ? newWidth : width));
606
- const thead = this.queryChildEl('sd-thead');
607
- thead?.setColumnWidths?.(this.columnWidths);
608
- this.queryAllTr().forEach(tr => tr.setColumnWidths?.(this.columnWidths));
609
- const stickyRightCount = this.stickyColumn?.right || 0;
610
- const visibleColCount = this.columns.filter(c => c.visible !== false).length;
611
- const isRightStickyEdgeResizer = stickyRightCount > 0 && index === visibleColCount - stickyRightCount;
612
- if (isRightStickyEdgeResizer) {
613
- requestAnimationFrame(() => {
614
- this.onScroll?.();
615
- });
616
- }
617
- };
618
- const handleMouseUp = () => {
619
- document.removeEventListener('mousemove', handleMouseMove);
620
- document.removeEventListener('mouseup', handleMouseUp);
621
- };
622
- document.addEventListener('mousemove', handleMouseMove);
623
- document.addEventListener('mouseup', handleMouseUp);
624
- }
625
- getStickyStyleSync(colIdx) {
626
- const leftOffset = this.columnWidths
627
- .slice(0, colIdx)
628
- .reduce((a, b) => a + b, this.selectable ? TABLE_SELECTABLE_COLUMN_WIDTH : 0);
629
- const rightOffset = this.columnWidths
630
- .filter((_, i) => i >=
631
- this.columns.filter(c => c.visible !== false).length -
632
- (this.stickyColumn?.right || 0) && i > colIdx)
633
- .reduce((a, b) => a + b, 0);
634
- const visibleCol = this.columns.filter(c => c.visible !== false)[colIdx];
635
- const base = {
636
- '--sticky-left-offset': `${leftOffset}px`,
637
- '--sticky-right-offset': `${rightOffset}px`,
638
- };
639
- if (!visibleCol?.autoWidth) {
640
- base['width'] = `${this.columnWidths[colIdx]}px`;
641
- base['minWidth'] = `${this.columnWidths[colIdx]}px`;
642
- base['maxWidth'] = `${this.columnWidths[colIdx]}px`;
643
- }
644
- return base;
645
- }
646
- /** 지정한 컬럼 인덱스의 sticky 스타일 객체를 반환합니다. */
647
- async getStickyStyle(colIdx) {
648
- return this.getStickyStyleSync(colIdx);
649
- }
650
- // ─── rowspan / colspan registry ─────────────────────────────────
651
- // sd-td가 mount/unmount 시 자기 (rowKey, field)와 span을 등록한다.
652
- // sd-tr는 render마다 isCoveredSync로 자신의 셀 위치가 다른 셀의 span에
653
- // 덮였는지 판정해 <td>를 그릴지 결정한다.
654
- spanKey(rowKey, field) {
655
- return `${rowKey}::${field}`;
656
- }
657
- // span 등록은 sd-td의 lifecycle에서 비동기적으로 일어나므로,
658
- // 등록/해제 직후 형제 sd-tr들이 새 레지스트리 상태로 다시 그려져야
659
- // 덮인 셀이 사라지거나 다시 나타난다.
660
- // forceUpdate는 React 래퍼 환경에서 prop 동기화 사이클과 부딪혀 누락되는
661
- // 경우가 있어, sd-tr의 @State (spansVersion)을 통해 재렌더를 강제한다.
662
- requestAllTrUpdate() {
663
- this.queryAllTr().forEach(tr => {
664
- if (typeof tr.bumpSpansVersion === 'function') {
665
- tr.bumpSpansVersion();
666
- }
667
- else {
668
- forceUpdate(tr);
669
- }
670
- });
671
- }
672
- registerSpanSync(rowKey, field, rowspan, colspan) {
673
- if (rowKey == null || field === '')
674
- return;
675
- const safeRowspan = Math.max(1, Math.floor(rowspan || 1));
676
- const safeColspan = Math.max(1, Math.floor(colspan || 1));
677
- const key = this.spanKey(rowKey, field);
678
- const prev = this.spanRegistry.get(key);
679
- if (safeRowspan === 1 && safeColspan === 1) {
680
- if (!prev)
681
- return;
682
- this.spanRegistry.delete(key);
683
- this.requestAllTrUpdate();
684
- return;
685
- }
686
- if (prev && prev.rowspan === safeRowspan && prev.colspan === safeColspan)
687
- return;
688
- this.spanRegistry.set(key, { rowspan: safeRowspan, colspan: safeColspan });
689
- this.requestAllTrUpdate();
690
- }
691
- unregisterSpanSync(rowKey, field) {
692
- if (rowKey == null || field === '')
693
- return;
694
- const key = this.spanKey(rowKey, field);
695
- if (!this.spanRegistry.has(key))
696
- return;
697
- this.spanRegistry.delete(key);
698
- this.requestAllTrUpdate();
699
- }
700
- getSpanSync(rowKey, field) {
701
- return this.spanRegistry.get(this.spanKey(rowKey, field));
702
- }
703
- // sd-td의 sdClass 등록. 빈/공백만 있는 값은 해제로 취급.
704
- // span과 달리 다른 셀에 영향이 없으므로 형제 sd-tr 전체를 재렌더하지 않고,
705
- // sd-td 쪽에서 자기 부모 tr만 bumpSpansVersion으로 새로 그린다.
706
- registerCellClassSync(rowKey, field, cls) {
707
- if (rowKey == null || field === '')
708
- return;
709
- const key = this.spanKey(rowKey, field);
710
- const safe = (cls ?? '').trim();
711
- if (safe === '') {
712
- this.cellClassRegistry.delete(key);
713
- return;
714
- }
715
- this.cellClassRegistry.set(key, safe);
716
- }
717
- unregisterCellClassSync(rowKey, field) {
718
- if (rowKey == null || field === '')
719
- return;
720
- this.cellClassRegistry.delete(this.spanKey(rowKey, field));
721
- }
722
- getCellClassSync(rowKey, field) {
723
- return this.cellClassRegistry.get(this.spanKey(rowKey, field));
724
- }
725
- // 레지스트리에 rowspan>1 항목이 하나라도 있으면 true.
726
- // hover 동작을 끌지 결정하는 데 사용 — colspan만 있는 경우는 그대로 hover 유지.
727
- hasRowspanSync() {
728
- for (const span of this.spanRegistry.values()) {
729
- if (span.rowspan > 1)
730
- return true;
731
- }
732
- return false;
733
- }
734
- isCoveredSync(rowKey, colIdx, columns) {
735
- if (this.spanRegistry.size === 0)
736
- return false;
737
- const visibleCols = columns.filter(c => c.visible !== false);
738
- // 1. 같은 행 왼쪽 스캔 — colspan으로 이 위치를 덮는 셀이 있는가
739
- for (let i = 0; i < colIdx; i++) {
740
- const c = visibleCols[i];
741
- if (c == null)
742
- continue;
743
- const field = typeof c.field === 'string' ? c.field : c.name;
744
- const span = this.spanRegistry.get(this.spanKey(rowKey, field));
745
- if (!span)
746
- continue;
747
- if (i + span.colspan > colIdx)
748
- return true;
749
- }
750
- // 2. 위쪽 행 스캔 — rows 기반 visual index로 "내 위에 있느냐" 판정
751
- // rows prop이 있으면 rowIndexMap로 임의 문자열 rowKey 지원,
752
- // 없으면 Number(rowKey) fallback (resolveRowIndex가 처리)
753
- const myRowIdx = this.resolveRowIndex(rowKey);
754
- if (myRowIdx == null)
755
- return false;
756
- for (const [key, span] of this.spanRegistry) {
757
- if (span.rowspan <= 1)
758
- continue;
759
- const sepIdx = key.indexOf('::');
760
- if (sepIdx < 0)
761
- continue;
762
- const otherRowKey = key.slice(0, sepIdx);
763
- const otherField = key.slice(sepIdx + 2);
764
- const otherRowIdx = this.resolveRowIndex(otherRowKey);
765
- if (otherRowIdx == null)
766
- continue;
767
- if (otherRowIdx >= myRowIdx)
768
- continue;
769
- if (otherRowIdx + span.rowspan <= myRowIdx)
770
- continue;
771
- const otherColIdx = visibleCols.findIndex(c => (typeof c.field === 'string' ? c.field : c.name) === otherField);
772
- if (otherColIdx < 0)
773
- continue;
774
- if (otherColIdx <= colIdx && otherColIdx + span.colspan > colIdx)
775
- return true;
776
- }
777
- return false;
778
- }
779
- setRowCountSync(count) {
780
- const safeCount = Math.max(0, Math.floor(this.toFiniteNumber(count, 0)));
781
- if (safeCount !== this.rowCount) {
782
- this.lastReachEndNotifiedRowCount = -1;
783
- }
784
- this.rowCount = safeCount;
785
- if (this.useVirtualScroll) {
786
- this.propagateVirtualUpdate(true);
787
- }
788
- }
789
- /** 가상 스크롤 총 행 수를 설정합니다. */
790
- async setRowCount(count) {
791
- this.setRowCountSync(count);
792
- }
793
- calculateVisibleRange(scrollTop, containerHeight) {
794
- const safeRowHeight = Math.max(1, this.toFiniteNumber(this.effectiveRowHeight, 40));
795
- const safeBuffer = Math.max(0, Math.floor(this.toFiniteNumber(this.virtualBuffer, 5)));
796
- const safeScrollTop = Math.max(0, this.toFiniteNumber(scrollTop, 0));
797
- const safeContainerHeight = Math.max(0, this.toFiniteNumber(containerHeight, 0));
798
- const safeRowCount = Math.max(0, Math.floor(this.toFiniteNumber(this.rowCount, 0)));
799
- const firstVisible = Math.floor(safeScrollTop / safeRowHeight);
800
- const visibleCount = Math.ceil(safeContainerHeight / safeRowHeight);
801
- const start = Math.max(0, firstVisible - safeBuffer);
802
- const end = Math.min(safeRowCount, firstVisible + visibleCount + safeBuffer);
803
- return { start, end };
804
- }
805
- getPaginationInfoSync() {
806
- if (!this.useInternalPagination || !this.pagination)
807
- return null;
808
- const startIndex = (this.currentPage - 1) * this.innerRowsPerPage;
809
- const endIndex = startIndex + this.innerRowsPerPage;
810
- return {
811
- startIndex,
812
- endIndex,
813
- currentPage: this.currentPage,
814
- rowsPerPage: this.innerRowsPerPage,
815
- };
816
- }
817
- /** 현재 페이지네이션 상태(startIndex, endIndex, currentPage, rowsPerPage)를 반환합니다. */
818
- async getPaginationInfo() {
819
- return this.getPaginationInfoSync();
820
- }
821
- getVirtualScrollRangeSync() {
822
- if (!this.useVirtualScroll)
823
- return null;
824
- if (!(this.vsEnd > 0))
825
- return null;
826
- return { from: this.vsStart, to: this.vsEnd };
827
- }
828
- // autoTbody fallback에서 sd-table이 직접 sd-tr을 만들어내는 경로.
829
- // 가상 스크롤은 사용자가 직접 SdTbody+SdTr을 작성해야 하므로 빈 배열을 반환한다.
830
- renderAutoRows() {
831
- if (this.useVirtualScroll)
832
- return null;
833
- const allRows = this.rows ?? [];
834
- const pageInfo = this.getPaginationInfoSync();
835
- const startIdx = pageInfo?.startIndex ?? 0;
836
- const displayed = pageInfo ? allRows.slice(pageInfo.startIndex, pageInfo.endIndex) : allRows;
837
- return displayed.map((row, i) => {
838
- const absoluteIdx = startIdx + i;
839
- return h("sd-tr", { key: absoluteIdx, "row-key": String(absoluteIdx), row: row });
840
- });
841
- }
842
- get tableClasses() {
843
- return [
844
- 'sd-table',
845
- this.stickyHeader && 'sd-table--sticky-header',
846
- this.selectable && 'sd-table--selectable',
847
- this.resizable && 'sd-table--resizable',
848
- (this.selectable ||
849
- (this.stickyColumn?.left ?? 0) > 0 ||
850
- (this.stickyColumn?.right ?? 0) > 0) &&
851
- 'sd-table--sticky-column',
852
- this.scrolledLeft && 'sd-table--scrolled-left',
853
- this.scrolledRight && 'sd-table--scrolled-right',
854
- this.rowCount === 0 && !this.isLoading && 'sd-table--no-data',
855
- ]
856
- .filter(Boolean)
857
- .join(' ');
858
- }
859
- render() {
860
- const resolvedTableId = this.getResolvedTableId();
861
- const isNoData = this.rowCount === 0 && !this.isLoading;
862
- const paginationHeight = this.pagination && this.rowCount > 0 && !this.useVirtualScroll ? 48 : 0;
863
- const noDataTotalHeight = 36 + this.noDataBodyHeight;
864
- const hostHeight = isNoData
865
- ? this.height !== undefined
866
- ? `max(${this.height}, ${noDataTotalHeight}px)`
867
- : `max(${noDataTotalHeight}px, 100%)`
868
- : (this.height ?? '100%');
869
- const hostStyle = {
870
- '--table-radius': `${TABLE_RADIUS}px`,
871
- '--table-border-color': TABLE_BORDER.color,
872
- '--table-border-width': `${TABLE_BORDER.width}px`,
873
- '--table-body-font-family': TABLE_BODY_TYPOGRAPHY.fontFamily,
874
- '--table-body-font-weight': TABLE_BODY_TYPOGRAPHY.fontWeight,
875
- '--table-body-font-size': `${TABLE_BODY_TYPOGRAPHY.fontSize}px`,
876
- '--table-body-line-height': `${TABLE_BODY_TYPOGRAPHY.lineHeight}px`,
877
- '--table-body-text-decoration': TABLE_BODY_TYPOGRAPHY.textDecoration,
878
- '--table-selectable-width': `${TABLE_SELECTABLE_COLUMN_WIDTH}px`,
879
- '--table-host-height': hostHeight,
880
- };
881
- return (h(Host, { key: 'b90b9865f78c2b42c3c13ad27ed968dd97827eb6', style: hostStyle }, h("div", { key: '2eb291b03b219a3abb4da5967c6d0f43195b458e', class: "sd-table__container", style: {
882
- '--table-width': this.width,
883
- '--pagination-height': `${paginationHeight}px`,
884
- } }, h("div", { key: '999feaffbf82db9233416a1d66974e8859b9b3a0', class: {
885
- 'sd-table__wrapper': true,
886
- 'sd-table__wrapper--radius-useTop': this.radius === 'useTop',
887
- 'sd-table__wrapper--radius-full': this.radius === 'full',
888
- } }, h("div", { key: 'ff0a04325ab9fe1ba5e6b25f52bb8265226fbba4', class: {
889
- 'sd-table__scroll-container': true,
890
- 'sd-table__scroll-container--loading': this.isLoading,
891
- 'sd-table__scroll-container--no-data': isNoData,
892
- } }, this.isLoading && (h("div", { key: '1a4dbf4a721240b3395230997c18c8ef989bbffc', class: "sd-table__loading", style: { top: `${this.loadingScrollTop}px` } }, h("sd-circle-progress", { key: '793a6772ef4c792e7f50c2ad90d43bdfbdde11a0', indeterminate: true }))), isNoData && (h(h.Fragment, null, h("div", { key: '13b76f695edddfa3d4a13bcb1091f95cafb1ae17', class: "sd-table__no-data-header-overlay" }), h("div", { key: 'f271bfa20d06cba0cc6c5fe6b5af5c874c1e0682', class: "sd-table__no-data" }, h("div", { key: '6791f70e0b4cd1226bdcc16414249ad178b70396', class: "sd-table__no-data-content", ref: el => {
893
- this.noDataContentEl = el;
894
- if (el)
895
- this.syncNoDataContentObserver();
896
- } }, h("slot", { key: '9cba0ff5c5ea3b4c78ccdb961de9cfe3ef2ac1e9', name: "no-data" }, h("span", { key: '1022372f37f1564b0d636c888a17cb5ab5ac2e35' }, this.resolvedNoDataLabel)))))), h("table", { key: 'e3d8c7dec8b3c76896b3063266dd5450bbfa7c13', class: this.tableClasses }, this.autoThead ? (h("slot", { name: `${resolvedTableId}-head`, onSlotchange: this.handleStructureSlotChange }, h("sd-thead", { rows: this.rows ?? [] }))) : (h("slot", { name: `${resolvedTableId}-head`, onSlotchange: this.handleStructureSlotChange })), this.autoTbody ? (h("slot", { name: `${resolvedTableId}-body`, onSlotchange: this.handleStructureSlotChange }, h("sd-tbody", { rows: this.rows ?? [] }, this.renderAutoRows()))) : (h("slot", { name: `${resolvedTableId}-body`, onSlotchange: this.handleStructureSlotChange }))))), this.pagination &&
897
- this.pagination.rowsPerPage > 0 &&
898
- this.rowCount > 0 &&
899
- !this.useVirtualScroll && (h("div", { key: '5410b53a9182f97406a0992464bc3435eb8439b1', class: "sd-table__pagination" }, h("sd-pagination", { key: 'aa237fe475797dd626856f5335395bdfa870f6db', currentPage: !this.useInternalPagination ? this.pagination.page : this.currentPage, lastPage: !this.useInternalPagination ? this.pagination.lastPage : this.lastPageNumber, onSdPageChange: (e) => this.changePage(e.detail) }), this.useRowsPerPageSelect && (h("sd-select", { key: 'd2b98c053c6d63f0bbea73d66779dfa5c1828b5a', value: this.useInternalPagination
900
- ? this.innerRowsPerPage
901
- : this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", emitValue: true, onSdUpdate: e => {
902
- if (!this.isRowsPerPageValue(e.detail))
903
- return;
904
- this.changeRowsPerPage(e.detail);
905
- } })))))));
906
- }
907
- static get watchers() { return {
908
- "isLoading": [{
909
- "handleIsLoadingChange": 0
910
- }],
911
- "useVirtualScroll": [{
912
- "handleUseVirtualScrollChange": 0
913
- }],
914
- "columns": [{
915
- "handleColumnsChange": 0
916
- }],
917
- "rows": [{
918
- "handleRowsChange": 0
919
- }],
920
- "rowKey": [{
921
- "handleRowKeyChange": 0
922
- }],
923
- "tableId": [{
924
- "handleTableIdChange": 0
925
- }],
926
- "noDataLabel": [{
927
- "handleNoDataLabelChange": 0
928
- }],
929
- "selectable": [{
930
- "handleConfigChange": 0
931
- }],
932
- "resizable": [{
933
- "handleConfigChange": 0
934
- }],
935
- "stickyColumn": [{
936
- "handleConfigChange": 0
937
- }],
938
- "stickyHeader": [{
939
- "handleConfigChange": 0
940
- }],
941
- "dense": [{
942
- "handleConfigChange": 0
943
- }],
944
- "selected": [{
945
- "handleSelectedChange": 0
946
- }],
947
- "pagination": [{
948
- "handlePaginationChange": 0
949
- }]
950
- }; }
951
- };
952
- SdTable.style = sdTableCss();
953
-
954
- export { SdTable as sd_table };