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