@sellmate/design-system 1.0.62 → 1.0.64

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 (527) hide show
  1. package/dist/cjs/{component.modal-DmQUWbve.js → component.modal-BFelrSMx.js} +14 -0
  2. package/dist/cjs/constants-DJRV1upE.js +5 -0
  3. package/dist/cjs/design-system.cjs.js +3 -4
  4. package/dist/cjs/{index-BQt-JC6r.js → index-nsQP24mV.js} +130 -9
  5. package/dist/cjs/index.cjs.js +103 -32
  6. package/dist/cjs/loader.cjs.js +3 -4
  7. package/dist/cjs/sd-action-modal.cjs.entry.js +3 -3
  8. package/dist/cjs/sd-badge.cjs.entry.js +2 -2
  9. package/dist/cjs/sd-barcode-input.cjs.entry.js +4 -3
  10. package/dist/cjs/sd-button-v2_2.cjs.entry.js +9 -8
  11. package/dist/cjs/sd-button_4.cjs.entry.js +62 -18
  12. package/dist/cjs/sd-calendar.cjs.entry.js +1 -1
  13. package/dist/cjs/sd-card.cjs.entry.js +2 -2
  14. package/dist/cjs/sd-checkbox.cjs.entry.js +30 -5
  15. package/dist/cjs/sd-circle-progress.cjs.entry.js +71 -0
  16. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +186 -0
  17. package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
  18. package/dist/cjs/sd-date-picker-calendar.cjs.entry.js +3 -3
  19. package/dist/cjs/sd-date-picker-trigger.cjs.entry.js +4 -4
  20. package/dist/cjs/sd-date-picker.cjs.entry.js +5 -4
  21. package/dist/cjs/{sd-date-picker.config-DWC_aiD2.js → sd-date-picker.config-D8xSALVj.js} +3 -3
  22. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +3 -3
  23. package/dist/cjs/sd-date-range-picker.cjs.entry.js +5 -4
  24. package/dist/cjs/sd-dropdown-button.cjs.entry.js +10 -5
  25. package/dist/cjs/sd-file-picker.cjs.entry.js +3 -2
  26. package/dist/cjs/sd-form.cjs.entry.js +1 -1
  27. package/dist/cjs/sd-ghost-button.cjs.entry.js +15 -6
  28. package/dist/cjs/sd-guide.cjs.entry.js +2 -2
  29. package/dist/cjs/sd-input_2.cjs.entry.js +8 -7
  30. package/dist/cjs/sd-loading-container.cjs.entry.js +29 -0
  31. package/dist/cjs/sd-modal-container.cjs.entry.js +45 -2
  32. package/dist/cjs/sd-number-input.cjs.entry.js +6 -10
  33. package/dist/cjs/{sd-select-v2.cjs.entry.js → sd-pagination_2.cjs.entry.js} +91 -4
  34. package/dist/cjs/sd-popover.cjs.entry.js +4 -4
  35. package/dist/cjs/sd-portal.cjs.entry.js +2 -2
  36. package/dist/cjs/sd-progress.cjs.entry.js +3 -3
  37. package/dist/cjs/sd-radio-button.cjs.entry.js +182 -0
  38. package/dist/cjs/sd-radio-group.cjs.entry.js +1 -1
  39. package/dist/cjs/sd-radio.cjs.entry.js +6 -6
  40. package/dist/cjs/sd-select-dropdown_2.cjs.entry.js +4 -4
  41. package/dist/cjs/sd-select-group.cjs.entry.js +4 -3
  42. package/dist/cjs/sd-select-multiple-group.cjs.entry.js +4 -3
  43. package/dist/cjs/sd-select-multiple.cjs.entry.js +4 -3
  44. package/dist/cjs/sd-select-option-group.cjs.entry.js +4 -4
  45. package/dist/cjs/sd-select-v2-list-item_4.cjs.entry.js +661 -0
  46. package/dist/cjs/sd-select.cjs.entry.js +180 -0
  47. package/dist/cjs/sd-switch.cjs.entry.js +110 -0
  48. package/dist/cjs/sd-table.cjs.entry.js +424 -651
  49. package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
  50. package/dist/cjs/sd-tag.cjs.entry.js +6 -5
  51. package/dist/cjs/sd-tbody.cjs.entry.js +66 -0
  52. package/dist/cjs/sd-td.cjs.entry.js +58 -0
  53. package/dist/cjs/sd-text-link.cjs.entry.js +10 -12
  54. package/dist/cjs/sd-textarea.cjs.entry.js +3 -2
  55. package/dist/cjs/sd-thead.cjs.entry.js +179 -0
  56. package/dist/cjs/sd-toast-container.cjs.entry.js +2 -2
  57. package/dist/cjs/sd-toast.cjs.entry.js +3 -3
  58. package/dist/cjs/sd-toggle.cjs.entry.js +96 -13
  59. package/dist/cjs/sd-tr.cjs.entry.js +171 -0
  60. package/dist/cjs/table-test.cjs.entry.js +96 -0
  61. package/dist/cjs/{tooltipArrow-CRCpqOYA.js → tooltipArrow-DhevfDPX.js} +1 -1
  62. package/dist/collection/__mocks__/nanoid-non-secure.js +13 -0
  63. package/dist/collection/__mocks__/nanoid.js +1 -0
  64. package/dist/collection/collection-manifest.json +11 -4
  65. package/dist/collection/components/sd-action-modal/sd-action-modal.js +1 -1
  66. package/dist/collection/components/sd-badge/sd-badge.js +1 -1
  67. package/dist/collection/components/sd-barcode-input/sd-barcode-input.css +3 -0
  68. package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +22 -1
  69. package/dist/collection/components/sd-button/sd-button.css +37 -37
  70. package/dist/collection/components/sd-button-v2/sd-button-v2.css +44 -44
  71. package/dist/collection/components/sd-button-v2/sd-button-v2.js +31 -6
  72. package/dist/collection/components/sd-card/sd-card.js +1 -1
  73. package/dist/collection/components/sd-checkbox/sd-checkbox.config.js +3 -0
  74. package/dist/collection/components/sd-checkbox/sd-checkbox.css +15 -0
  75. package/dist/collection/components/sd-checkbox/sd-checkbox.js +36 -2
  76. package/dist/collection/components/sd-circle-progress/sd-circle-progress.config.js +24 -0
  77. package/dist/collection/components/sd-circle-progress/sd-circle-progress.css +53 -0
  78. package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +109 -0
  79. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +2 -2
  80. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
  81. package/dist/collection/components/sd-date-picker/sd-date-picker-calendar/sd-date-picker-calendar.js +1 -1
  82. package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
  83. package/dist/collection/components/sd-date-picker/sd-date-picker.config.js +1 -1
  84. package/dist/collection/components/sd-date-picker/sd-date-picker.js +26 -5
  85. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
  86. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +26 -5
  87. package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +5 -0
  88. package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +46 -36
  89. package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +4 -4
  90. package/dist/collection/components/sd-field/sd-field.config.js +21 -0
  91. package/dist/collection/components/sd-field/sd-field.css +26 -16
  92. package/dist/collection/components/sd-field/sd-field.js +72 -11
  93. package/dist/collection/components/sd-file-picker/sd-file-picker.js +27 -6
  94. package/dist/collection/components/sd-ghost-button/sd-ghost-button.config.js +7 -1
  95. package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +3 -3
  96. package/dist/collection/components/sd-guide/sd-guide.css +37 -37
  97. package/dist/collection/components/sd-input/sd-input.css +3 -0
  98. package/dist/collection/components/sd-input/sd-input.js +23 -2
  99. package/dist/collection/components/sd-loading-container/sd-loading-container.config.js +1 -0
  100. package/dist/collection/components/sd-loading-container/sd-loading-container.css +40 -0
  101. package/dist/collection/components/sd-loading-container/sd-loading-container.js +83 -0
  102. package/dist/collection/components/sd-loading-modal/sd-loading-modal.config.js +31 -0
  103. package/dist/collection/components/sd-loading-modal/sd-loading-modal.css +37 -0
  104. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +184 -0
  105. package/dist/collection/components/sd-modal-container/sd-modal-container.js +89 -3
  106. package/dist/collection/components/sd-number-input/sd-number-input.config.js +0 -2
  107. package/dist/collection/components/sd-number-input/sd-number-input.css +0 -1
  108. package/dist/collection/components/sd-number-input/sd-number-input.js +24 -4
  109. package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
  110. package/dist/collection/components/sd-popover/sd-popover.js +2 -2
  111. package/dist/collection/components/sd-portal/sd-portal.js +1 -1
  112. package/dist/collection/components/sd-progress/sd-progress.js +2 -2
  113. package/dist/collection/components/sd-radio/sd-radio.config.js +1 -1
  114. package/dist/collection/components/sd-radio-button/sd-radio-button.config.js +45 -0
  115. package/dist/collection/components/sd-radio-button/sd-radio-button.css +71 -0
  116. package/dist/collection/components/{sd-radio-button-group/sd-radio-button-group.js → sd-radio-button/sd-radio-button.js} +49 -18
  117. package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
  118. package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
  119. package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
  120. package/dist/collection/components/sd-select/sd-select.css +4 -0
  121. package/dist/collection/components/sd-select/sd-select.js +22 -1
  122. package/dist/collection/components/sd-select-group/sd-select-group.css +4 -0
  123. package/dist/collection/components/sd-select-group/sd-select-group.js +22 -1
  124. package/dist/collection/components/sd-select-multiple/sd-select-multiple.css +4 -0
  125. package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +22 -1
  126. package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.css +4 -0
  127. package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js +22 -1
  128. package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
  129. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
  130. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.css +4 -0
  131. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +6 -3
  132. package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.css +2 -3
  133. package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +2 -1
  134. package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
  135. package/dist/collection/components/sd-select-v2/sd-select-v2.config.js +1 -0
  136. package/dist/collection/components/sd-select-v2/sd-select-v2.js +24 -3
  137. package/dist/collection/components/sd-switch/sd-switch.config.js +23 -0
  138. package/dist/collection/components/sd-switch/sd-switch.css +54 -0
  139. package/dist/collection/components/{sd-toggle-button/sd-toggle-button.js → sd-switch/sd-switch.js} +30 -27
  140. package/dist/collection/components/sd-table/constants.js +1 -0
  141. package/dist/collection/components/sd-table/sd-table.css +76 -248
  142. package/dist/collection/components/sd-table/sd-table.js +705 -700
  143. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.css +18 -0
  144. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +105 -0
  145. package/dist/collection/components/sd-table/sd-td/sd-td.css +15 -0
  146. package/dist/collection/components/sd-table/sd-td/sd-td.js +121 -0
  147. package/dist/collection/components/sd-table/sd-thead/sd-thead.css +147 -0
  148. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +442 -0
  149. package/dist/collection/components/sd-table/sd-tr/sd-tr.css +111 -0
  150. package/dist/collection/components/sd-table/sd-tr/sd-tr.js +376 -0
  151. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  152. package/dist/collection/components/sd-tag/sd-tag.js +2 -2
  153. package/dist/collection/components/sd-text-link/sd-text-link.css +1 -0
  154. package/dist/collection/components/sd-text-link/sd-text-link.js +7 -13
  155. package/dist/collection/components/sd-textarea/sd-textarea.js +22 -1
  156. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  157. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  158. package/dist/collection/components/sd-toggle/sd-toggle.config.js +33 -0
  159. package/dist/collection/components/sd-toggle/sd-toggle.css +38 -50
  160. package/dist/collection/components/sd-toggle/sd-toggle.js +29 -12
  161. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  162. package/dist/collection/components/table-test/table-test.css +59 -0
  163. package/dist/collection/components/table-test/table-test.js +316 -0
  164. package/dist/collection/index.js +1 -0
  165. package/dist/collection/utils/loading.js +43 -0
  166. package/dist/collection/utils/modal.js +26 -0
  167. package/dist/components/index.js +1 -1
  168. package/dist/components/p-6LkBUj0w.js +1 -0
  169. package/dist/components/{p-DlujHEXS.js → p-6cueWz-l.js} +1 -1
  170. package/dist/components/{p-D0wZv01W.js → p-AKpbKrkW.js} +1 -1
  171. package/dist/components/p-B1S4ybd6.js +1 -0
  172. package/dist/components/{p-D93Cb_Vw.js → p-B6OgnOKC.js} +1 -1
  173. package/dist/components/{p-lKwhftf9.js → p-B6RvTdqt.js} +1 -1
  174. package/dist/components/p-BLC3AWW8.js +1 -0
  175. package/dist/components/{p-BUAwjF_Z.js → p-BZ7V5xV5.js} +1 -1
  176. package/dist/components/{p-BWgJ9XTj.js → p-BdsI1E5l.js} +1 -1
  177. package/dist/components/{p-DdBIc8AE.js → p-BgRPWxrz.js} +1 -1
  178. package/dist/components/{p-DCv5afjJ.js → p-Bh548Ckv.js} +1 -1
  179. package/dist/components/p-BjjrNz4C.js +1 -0
  180. package/dist/components/{p-BVBMsoZP.js → p-BkUclgga.js} +1 -1
  181. package/dist/components/p-C2r48NLP.js +1 -0
  182. package/dist/components/{p-BtH5wWA5.js → p-CGXwtYAv.js} +1 -1
  183. package/dist/components/p-CGssy8eb.js +1 -0
  184. package/dist/components/p-CKU8CeW3.js +1 -0
  185. package/dist/components/{p-BHQirDZt.js → p-CRl8Anfr.js} +1 -1
  186. package/dist/components/p-CU095QAR.js +1 -0
  187. package/dist/components/p-CpclstHV.js +1 -0
  188. package/dist/components/{p-C2Yw3PoX.js → p-Cpu_hXwN.js} +1 -1
  189. package/dist/components/{p-gTPCqs3t.js → p-Cr_74QR7.js} +1 -1
  190. package/dist/components/{p-BsJy4pgR.js → p-D9FDutsj.js} +1 -1
  191. package/dist/components/p-DBnszF5F.js +1 -0
  192. package/dist/components/p-DC9KYl3L.js +1 -0
  193. package/dist/components/p-DOXMJi-V.js +1 -0
  194. package/dist/components/p-DRY8HJ-T.js +1 -0
  195. package/dist/components/{p-98NWgkAU.js → p-DpsDTjcN.js} +1 -1
  196. package/dist/components/p-DuYi4aqj.js +1 -0
  197. package/dist/components/{p-AdSqif48.js → p-DxzgCf_d.js} +1 -1
  198. package/dist/components/p-TMuoVuhE.js +1 -0
  199. package/dist/components/{p-CE1Hmoij.js → p-VXLJLI30.js} +1 -1
  200. package/dist/components/p-bYCOh35g.js +1 -0
  201. package/dist/components/p-kZ5N_lFC.js +1 -0
  202. package/dist/components/{p-CqU3a1re.js → p-puZ1xlrr.js} +1 -1
  203. package/dist/components/p-sZMi_32I.js +1 -0
  204. package/dist/components/{p-Ci3yfjxH.js → p-xmvTLf74.js} +1 -1
  205. package/dist/components/sd-action-modal.js +1 -1
  206. package/dist/components/sd-badge.js +1 -1
  207. package/dist/components/sd-barcode-input.js +1 -1
  208. package/dist/components/sd-button-v2.js +1 -1
  209. package/dist/components/sd-button.js +1 -1
  210. package/dist/components/sd-calendar.js +1 -1
  211. package/dist/components/sd-card.js +1 -1
  212. package/dist/components/sd-checkbox.js +1 -1
  213. package/dist/components/{sd-loading-spinner.d.ts → sd-circle-progress.d.ts} +4 -4
  214. package/dist/components/sd-circle-progress.js +1 -0
  215. package/dist/components/sd-confirm-modal.js +1 -1
  216. package/dist/components/sd-date-box.js +1 -1
  217. package/dist/components/sd-date-picker-calendar.js +1 -1
  218. package/dist/components/sd-date-picker-trigger.js +1 -1
  219. package/dist/components/sd-date-picker.js +1 -1
  220. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  221. package/dist/components/sd-date-range-picker.js +1 -1
  222. package/dist/components/sd-dropdown-button.js +1 -1
  223. package/dist/components/sd-field.js +1 -1
  224. package/dist/components/sd-file-picker.js +1 -1
  225. package/dist/components/sd-floating-portal.js +1 -1
  226. package/dist/components/sd-form.js +1 -1
  227. package/dist/components/sd-ghost-button.js +1 -1
  228. package/dist/components/sd-guide.js +1 -1
  229. package/dist/components/sd-icon.js +1 -1
  230. package/dist/components/sd-input.js +1 -1
  231. package/dist/components/{sd-radio-button-group.d.ts → sd-loading-container.d.ts} +4 -4
  232. package/dist/components/sd-loading-container.js +1 -0
  233. package/dist/components/{sd-toggle-button.d.ts → sd-loading-modal.d.ts} +4 -4
  234. package/dist/components/sd-loading-modal.js +1 -0
  235. package/dist/components/sd-modal-container.js +1 -1
  236. package/dist/components/sd-number-input.js +1 -1
  237. package/dist/components/sd-pagination.js +1 -1
  238. package/dist/components/sd-popover.js +1 -1
  239. package/dist/components/sd-portal.js +1 -1
  240. package/dist/components/sd-progress.js +1 -1
  241. package/dist/components/sd-radio-button.d.ts +11 -0
  242. package/dist/components/sd-radio-button.js +1 -0
  243. package/dist/components/sd-radio-group.js +1 -1
  244. package/dist/components/sd-radio.js +1 -1
  245. package/dist/components/sd-select-dropdown.js +1 -1
  246. package/dist/components/sd-select-group.js +1 -1
  247. package/dist/components/sd-select-multiple-group.js +1 -1
  248. package/dist/components/sd-select-multiple.js +1 -1
  249. package/dist/components/sd-select-option-group.js +1 -1
  250. package/dist/components/sd-select-option.js +1 -1
  251. package/dist/components/sd-select-search-input.js +1 -1
  252. package/dist/components/sd-select-v2-list-item-search.js +1 -1
  253. package/dist/components/sd-select-v2-list-item.js +1 -1
  254. package/dist/components/sd-select-v2-listbox.js +1 -1
  255. package/dist/components/sd-select-v2-trigger.js +1 -1
  256. package/dist/components/sd-select-v2.js +1 -1
  257. package/dist/components/sd-select.js +1 -1
  258. package/dist/components/sd-switch.d.ts +11 -0
  259. package/dist/components/sd-switch.js +1 -0
  260. package/dist/components/sd-table.js +1 -1
  261. package/dist/components/sd-tabs.js +1 -1
  262. package/dist/components/sd-tag.js +1 -1
  263. package/dist/components/sd-tbody.d.ts +11 -0
  264. package/dist/components/sd-tbody.js +1 -0
  265. package/dist/components/sd-td.d.ts +11 -0
  266. package/dist/components/sd-td.js +1 -0
  267. package/dist/components/sd-text-link.js +1 -1
  268. package/dist/components/sd-textarea.js +1 -1
  269. package/dist/components/sd-thead.d.ts +11 -0
  270. package/dist/components/sd-thead.js +1 -0
  271. package/dist/components/sd-toast-container.js +1 -1
  272. package/dist/components/sd-toast.js +1 -1
  273. package/dist/components/sd-toggle.js +1 -1
  274. package/dist/components/sd-tooltip.js +1 -1
  275. package/dist/components/sd-tr.d.ts +11 -0
  276. package/dist/components/sd-tr.js +1 -0
  277. package/dist/components/table-test.d.ts +11 -0
  278. package/dist/components/table-test.js +1 -0
  279. package/dist/design-system/design-system.css +1 -1
  280. package/dist/design-system/design-system.esm.js +1 -1
  281. package/dist/design-system/index.esm.js +1 -1
  282. package/dist/design-system/p-010e4f47.entry.js +1 -0
  283. package/dist/design-system/p-03099a57.entry.js +1 -0
  284. package/dist/design-system/p-04be87a4.entry.js +1 -0
  285. package/dist/design-system/{p-e9c28bdc.entry.js → p-09ba9dbc.entry.js} +1 -1
  286. package/dist/design-system/p-0fbb6d92.entry.js +1 -0
  287. package/dist/design-system/p-12a03c88.entry.js +1 -0
  288. package/dist/design-system/p-15cda79c.entry.js +1 -0
  289. package/dist/design-system/{p-a03ad24f.entry.js → p-1d310832.entry.js} +1 -1
  290. package/dist/design-system/p-2ae97b1c.entry.js +1 -0
  291. package/dist/design-system/p-2f64dd95.entry.js +1 -0
  292. package/dist/design-system/p-33e4ce64.entry.js +1 -0
  293. package/dist/design-system/{p-14b67a6e.entry.js → p-363da5ff.entry.js} +1 -1
  294. package/dist/design-system/p-3d341993.entry.js +1 -0
  295. package/dist/design-system/p-3f79f1d1.entry.js +1 -0
  296. package/dist/design-system/{p-c59191d3.entry.js → p-40495e05.entry.js} +1 -1
  297. package/dist/design-system/p-4128c17f.entry.js +1 -0
  298. package/dist/design-system/{p-614c9883.entry.js → p-4a53d7b0.entry.js} +1 -1
  299. package/dist/design-system/{p-9ae589c4.entry.js → p-4dcadde3.entry.js} +1 -1
  300. package/dist/design-system/{p-62992b73.entry.js → p-53bc77f8.entry.js} +1 -1
  301. package/dist/design-system/{p-28058050.entry.js → p-5a63febd.entry.js} +1 -1
  302. package/dist/design-system/p-6644c4a0.entry.js +1 -0
  303. package/dist/design-system/{p-30055371.entry.js → p-6c71d7b7.entry.js} +1 -1
  304. package/dist/design-system/{p-7a18a52b.entry.js → p-73acee07.entry.js} +1 -1
  305. package/dist/design-system/p-7e09fdd5.entry.js +1 -0
  306. package/dist/design-system/{p-4272b9e6.entry.js → p-84a329fb.entry.js} +1 -1
  307. package/dist/design-system/p-867ec4ee.entry.js +1 -0
  308. package/dist/design-system/p-8acf3b67.entry.js +1 -0
  309. package/dist/design-system/p-8d2328ae.entry.js +1 -0
  310. package/dist/design-system/p-96b14db1.entry.js +1 -0
  311. package/dist/design-system/p-BqHL8W3c.js +2 -0
  312. package/dist/design-system/{p-DSRYrM1n.js → p-COK6PVLC.js} +1 -1
  313. package/dist/design-system/p-DOXMJi-V.js +1 -0
  314. package/dist/design-system/{p-72b564ed.entry.js → p-a129711d.entry.js} +1 -1
  315. package/dist/design-system/{p-3acd076e.entry.js → p-a27718c1.entry.js} +1 -1
  316. package/dist/design-system/p-a983560d.entry.js +1 -0
  317. package/dist/design-system/{p-3d10be45.entry.js → p-a9a91e69.entry.js} +1 -1
  318. package/dist/design-system/p-ae1800c0.entry.js +1 -0
  319. package/dist/design-system/p-b1fe12f8.entry.js +1 -0
  320. package/dist/design-system/p-b3279f07.entry.js +1 -0
  321. package/dist/design-system/p-b60ae063.entry.js +1 -0
  322. package/dist/design-system/p-b6e02544.entry.js +1 -0
  323. package/dist/design-system/p-b81e0493.entry.js +1 -0
  324. package/dist/design-system/p-bYCOh35g.js +1 -0
  325. package/dist/design-system/{p-85e22acd.entry.js → p-c4e68815.entry.js} +1 -1
  326. package/dist/design-system/p-cb65a9e4.entry.js +1 -0
  327. package/dist/design-system/p-cf1156cb.entry.js +1 -0
  328. package/dist/design-system/p-d040ec6f.entry.js +1 -0
  329. package/dist/design-system/{p-5d2e8779.entry.js → p-d04551be.entry.js} +1 -1
  330. package/dist/design-system/p-d8eb17a8.entry.js +1 -0
  331. package/dist/design-system/p-e0f9e5b5.entry.js +1 -0
  332. package/dist/design-system/p-e1fdd540.entry.js +1 -0
  333. package/dist/design-system/{p-2bd887ca.entry.js → p-e33389b8.entry.js} +1 -1
  334. package/dist/design-system/p-e78faea6.entry.js +1 -0
  335. package/dist/design-system/p-ed61fe19.entry.js +1 -0
  336. package/dist/design-system/p-f3d082c8.entry.js +1 -0
  337. package/dist/design-system/p-f9b9204d.entry.js +1 -0
  338. package/dist/design-system/{p-13fed1bd.entry.js → p-fd296c73.entry.js} +1 -1
  339. package/dist/design-system/p-sZMi_32I.js +1 -0
  340. package/dist/esm/{component.modal-mO5GcwI3.js → component.modal-DOXMJi-V.js} +14 -0
  341. package/dist/esm/constants-sZMi_32I.js +3 -0
  342. package/dist/esm/design-system.js +3 -4
  343. package/dist/esm/{index-DsU722JF.js → index-BqHL8W3c.js} +128 -10
  344. package/dist/esm/index.js +103 -33
  345. package/dist/esm/loader.js +3 -4
  346. package/dist/esm/sd-action-modal.entry.js +3 -3
  347. package/dist/esm/sd-badge.entry.js +2 -2
  348. package/dist/esm/sd-barcode-input.entry.js +4 -3
  349. package/dist/esm/sd-button-v2_2.entry.js +9 -8
  350. package/dist/esm/sd-button_4.entry.js +62 -18
  351. package/dist/esm/sd-calendar.entry.js +1 -1
  352. package/dist/esm/sd-card.entry.js +2 -2
  353. package/dist/esm/sd-checkbox.entry.js +30 -5
  354. package/dist/esm/sd-circle-progress.entry.js +69 -0
  355. package/dist/esm/sd-confirm-modal_2.entry.js +183 -0
  356. package/dist/esm/sd-date-box.entry.js +1 -1
  357. package/dist/esm/sd-date-picker-calendar.entry.js +3 -3
  358. package/dist/esm/sd-date-picker-trigger.entry.js +4 -4
  359. package/dist/esm/{sd-date-picker.config-C4i826lM.js → sd-date-picker.config-bYCOh35g.js} +3 -3
  360. package/dist/esm/sd-date-picker.entry.js +5 -4
  361. package/dist/esm/sd-date-range-picker-calendar.entry.js +3 -3
  362. package/dist/esm/sd-date-range-picker.entry.js +5 -4
  363. package/dist/esm/sd-dropdown-button.entry.js +10 -5
  364. package/dist/esm/sd-file-picker.entry.js +3 -2
  365. package/dist/esm/sd-form.entry.js +1 -1
  366. package/dist/esm/sd-ghost-button.entry.js +15 -6
  367. package/dist/esm/sd-guide.entry.js +2 -2
  368. package/dist/esm/sd-input_2.entry.js +8 -7
  369. package/dist/esm/sd-loading-container.entry.js +27 -0
  370. package/dist/esm/sd-modal-container.entry.js +45 -2
  371. package/dist/esm/sd-number-input.entry.js +6 -10
  372. package/dist/esm/{sd-select-v2.entry.js → sd-pagination_2.entry.js} +91 -5
  373. package/dist/esm/sd-popover.entry.js +4 -4
  374. package/dist/esm/sd-portal.entry.js +2 -2
  375. package/dist/esm/sd-progress.entry.js +3 -3
  376. package/dist/esm/sd-radio-button.entry.js +180 -0
  377. package/dist/esm/sd-radio-group.entry.js +1 -1
  378. package/dist/esm/sd-radio.entry.js +6 -6
  379. package/dist/esm/sd-select-dropdown_2.entry.js +4 -4
  380. package/dist/esm/sd-select-group.entry.js +4 -3
  381. package/dist/esm/sd-select-multiple-group.entry.js +4 -3
  382. package/dist/esm/sd-select-multiple.entry.js +4 -3
  383. package/dist/esm/sd-select-option-group.entry.js +4 -4
  384. package/dist/esm/sd-select-v2-list-item_4.entry.js +656 -0
  385. package/dist/esm/sd-select.entry.js +178 -0
  386. package/dist/esm/sd-switch.entry.js +108 -0
  387. package/dist/esm/sd-table.entry.js +424 -651
  388. package/dist/esm/sd-tabs.entry.js +2 -2
  389. package/dist/esm/sd-tag.entry.js +6 -5
  390. package/dist/esm/sd-tbody.entry.js +64 -0
  391. package/dist/esm/sd-td.entry.js +56 -0
  392. package/dist/esm/sd-text-link.entry.js +10 -12
  393. package/dist/esm/sd-textarea.entry.js +3 -2
  394. package/dist/esm/sd-thead.entry.js +177 -0
  395. package/dist/esm/sd-toast-container.entry.js +2 -2
  396. package/dist/esm/sd-toast.entry.js +3 -3
  397. package/dist/esm/sd-toggle.entry.js +96 -13
  398. package/dist/esm/sd-tr.entry.js +169 -0
  399. package/dist/esm/table-test.entry.js +94 -0
  400. package/dist/esm/{tooltipArrow-CJuzsrdH.js → tooltipArrow-BcsrQx1U.js} +1 -1
  401. package/dist/types/__mocks__/nanoid-non-secure.d.ts +2 -0
  402. package/dist/types/__mocks__/nanoid.d.ts +1 -0
  403. package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +1 -0
  404. package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +1 -0
  405. package/dist/types/components/sd-checkbox/sd-checkbox.config.d.ts +3 -0
  406. package/dist/types/components/sd-checkbox/sd-checkbox.d.ts +2 -0
  407. package/dist/types/components/sd-circle-progress/sd-circle-progress.config.d.ts +9 -0
  408. package/dist/types/components/sd-circle-progress/sd-circle-progress.d.ts +8 -0
  409. package/dist/types/components/sd-date-picker/sd-date-picker.d.ts +1 -0
  410. package/dist/types/components/sd-date-range-picker/sd-date-range-picker.d.ts +1 -0
  411. package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +1 -0
  412. package/dist/types/components/sd-field/sd-field.config.d.ts +9 -0
  413. package/dist/types/components/sd-field/sd-field.d.ts +3 -0
  414. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +1 -0
  415. package/dist/types/components/sd-ghost-button/sd-ghost-button.config.d.ts +1 -1
  416. package/dist/types/components/sd-input/sd-input.d.ts +1 -0
  417. package/dist/types/components/sd-loading-container/sd-loading-container.config.d.ts +4 -0
  418. package/dist/types/components/sd-loading-container/sd-loading-container.d.ts +8 -0
  419. package/dist/types/components/sd-loading-modal/sd-loading-modal.config.d.ts +25 -0
  420. package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +15 -0
  421. package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +10 -0
  422. package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +6 -2
  423. package/dist/types/components/sd-number-input/sd-number-input.config.d.ts +0 -1
  424. package/dist/types/components/sd-number-input/sd-number-input.d.ts +1 -0
  425. package/dist/types/components/sd-radio-button/sd-radio-button.config.d.ts +44 -0
  426. package/dist/types/components/{sd-radio-button-group/sd-radio-button-group.d.ts → sd-radio-button/sd-radio-button.d.ts} +4 -3
  427. package/dist/types/components/sd-select/sd-select.d.ts +1 -0
  428. package/dist/types/components/sd-select-group/sd-select-group.d.ts +1 -0
  429. package/dist/types/components/sd-select-multiple/sd-select-multiple.d.ts +1 -0
  430. package/dist/types/components/sd-select-multiple-group/sd-select-multiple-group.d.ts +1 -0
  431. package/dist/types/components/sd-select-v2/sd-select-v2.config.d.ts +1 -0
  432. package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +1 -0
  433. package/dist/types/components/sd-switch/sd-switch.config.d.ts +22 -0
  434. package/dist/types/components/{sd-toggle-button/sd-toggle-button.d.ts → sd-switch/sd-switch.d.ts} +2 -6
  435. package/dist/types/components/sd-table/constants.d.ts +44 -0
  436. package/dist/types/components/sd-table/sd-table.d.ts +103 -115
  437. package/dist/types/components/sd-table/sd-tbody/sd-tbody.d.ts +14 -0
  438. package/dist/types/components/sd-table/sd-td/sd-td.d.ts +12 -0
  439. package/dist/types/components/sd-table/sd-thead/sd-thead.d.ts +36 -0
  440. package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +34 -0
  441. package/dist/types/components/sd-textarea/sd-textarea.d.ts +1 -0
  442. package/dist/types/components/sd-toggle/sd-toggle.config.d.ts +32 -0
  443. package/dist/types/components/sd-toggle/sd-toggle.d.ts +0 -3
  444. package/dist/types/components/table-test/table-test.d.ts +46 -0
  445. package/dist/types/components.d.ts +649 -141
  446. package/dist/types/index.d.ts +3 -1
  447. package/dist/types/utils/loading.d.ts +7 -0
  448. package/dist/types/utils/modal.d.ts +19 -3
  449. package/hydrate/index.js +2500 -968
  450. package/hydrate/index.mjs +2500 -968
  451. package/package.json +1 -1
  452. package/readme.md +1 -1
  453. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
  454. package/dist/cjs/sd-confirm-modal.cjs.entry.js +0 -106
  455. package/dist/cjs/sd-loading-spinner_3.cjs.entry.js +0 -283
  456. package/dist/cjs/sd-radio-button-group.cjs.entry.js +0 -57
  457. package/dist/cjs/sd-select-v2-list-item_2.cjs.entry.js +0 -150
  458. package/dist/cjs/sd-select-v2-listbox_2.cjs.entry.js +0 -353
  459. package/dist/cjs/sd-select-v2.config-7xBJQhvx.js +0 -171
  460. package/dist/cjs/sd-toggle-button.cjs.entry.js +0 -49
  461. package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.css +0 -44
  462. package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +0 -46
  463. package/dist/collection/components/sd-radio-button-group/sd-radio-button-group.css +0 -85
  464. package/dist/collection/components/sd-toggle-button/sd-toggle-button.css +0 -47
  465. package/dist/components/p-5OtzmjLh.js +0 -1
  466. package/dist/components/p-BFaIxm6b.js +0 -1
  467. package/dist/components/p-BP-QKaKz.js +0 -1
  468. package/dist/components/p-BSZadK9N.js +0 -1
  469. package/dist/components/p-BbtO5CEW.js +0 -1
  470. package/dist/components/p-BxPyZJaz.js +0 -1
  471. package/dist/components/p-C-qSDgVU.js +0 -1
  472. package/dist/components/p-C4i826lM.js +0 -1
  473. package/dist/components/p-CEa1HSpw.js +0 -1
  474. package/dist/components/p-CYRGa0VL.js +0 -1
  475. package/dist/components/p-ClgihpRm.js +0 -1
  476. package/dist/components/p-D-Y0-FQk.js +0 -1
  477. package/dist/components/p-D-pFdq6g.js +0 -1
  478. package/dist/components/p-DPipeCRI.js +0 -1
  479. package/dist/components/p-DSYw-7RA.js +0 -1
  480. package/dist/components/p-DXAB0k9r.js +0 -1
  481. package/dist/components/p-mO5GcwI3.js +0 -1
  482. package/dist/components/sd-loading-spinner.js +0 -1
  483. package/dist/components/sd-radio-button-group.js +0 -1
  484. package/dist/components/sd-toggle-button.js +0 -1
  485. package/dist/design-system/p-00207f08.entry.js +0 -1
  486. package/dist/design-system/p-067b0b3c.entry.js +0 -1
  487. package/dist/design-system/p-0e6f5a99.entry.js +0 -1
  488. package/dist/design-system/p-22a4972a.entry.js +0 -1
  489. package/dist/design-system/p-27df33c1.entry.js +0 -1
  490. package/dist/design-system/p-3ac6a626.entry.js +0 -1
  491. package/dist/design-system/p-6610c16b.entry.js +0 -1
  492. package/dist/design-system/p-739ac181.entry.js +0 -1
  493. package/dist/design-system/p-7dce4241.entry.js +0 -1
  494. package/dist/design-system/p-7e4c0a36.entry.js +0 -1
  495. package/dist/design-system/p-8b5b2866.entry.js +0 -1
  496. package/dist/design-system/p-90f51f65.entry.js +0 -1
  497. package/dist/design-system/p-C3eQSZx-.js +0 -1
  498. package/dist/design-system/p-C4i826lM.js +0 -1
  499. package/dist/design-system/p-DQuL1Twl.js +0 -1
  500. package/dist/design-system/p-DsU722JF.js +0 -2
  501. package/dist/design-system/p-a6bc8512.entry.js +0 -1
  502. package/dist/design-system/p-afeb740a.entry.js +0 -1
  503. package/dist/design-system/p-b3e0e6f4.entry.js +0 -1
  504. package/dist/design-system/p-ba90dc5f.entry.js +0 -1
  505. package/dist/design-system/p-bad88292.entry.js +0 -1
  506. package/dist/design-system/p-cbb5575d.entry.js +0 -1
  507. package/dist/design-system/p-ce6a0b0f.entry.js +0 -1
  508. package/dist/design-system/p-d07448fe.entry.js +0 -1
  509. package/dist/design-system/p-d1a94401.entry.js +0 -1
  510. package/dist/design-system/p-d5b5cfc7.entry.js +0 -1
  511. package/dist/design-system/p-d75e0dc0.entry.js +0 -1
  512. package/dist/design-system/p-dee605b1.entry.js +0 -1
  513. package/dist/design-system/p-e9ed9c00.entry.js +0 -1
  514. package/dist/design-system/p-f8567970.entry.js +0 -1
  515. package/dist/design-system/p-fa22f13c.entry.js +0 -1
  516. package/dist/design-system/p-fa8b64c2.entry.js +0 -1
  517. package/dist/design-system/p-fbac6160.entry.js +0 -1
  518. package/dist/design-system/p-mO5GcwI3.js +0 -1
  519. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  520. package/dist/esm/sd-confirm-modal.entry.js +0 -104
  521. package/dist/esm/sd-loading-spinner_3.entry.js +0 -279
  522. package/dist/esm/sd-radio-button-group.entry.js +0 -55
  523. package/dist/esm/sd-select-v2-list-item_2.entry.js +0 -147
  524. package/dist/esm/sd-select-v2-listbox_2.entry.js +0 -350
  525. package/dist/esm/sd-select-v2.config-C3eQSZx-.js +0 -158
  526. package/dist/esm/sd-toggle-button.entry.js +0 -47
  527. package/dist/types/components/sd-loading-spinner/sd-loading-spinner.d.ts +0 -5
@@ -1,7 +1,12 @@
1
- import { h, readTask, Fragment, } from "@stencil/core";
1
+ import { h, Host, readTask, } from "@stencil/core";
2
+ import { nanoid } from "nanoid";
3
+ import { TABLE_ID_ATTR, } from "./constants";
2
4
  export class SdTable {
5
+ static DEFAULT_NO_DATA_LABEL = '데이터가 없습니다.';
3
6
  el;
4
- columns;
7
+ tableId = nanoid(8);
8
+ fallbackTableId = nanoid(8);
9
+ columns = [];
5
10
  rows;
6
11
  selected = [];
7
12
  rowKey = 'id';
@@ -11,603 +16,391 @@ export class SdTable {
11
16
  height;
12
17
  stickyHeader = false;
13
18
  stickyColumn = { left: 0, right: 0 };
14
- noDataLabel = '데이터가 없습니다.';
19
+ noDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
20
+ resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
15
21
  isLoading = false;
16
22
  pagination;
17
23
  useInternalPagination = false;
18
24
  useRowsPerPageSelect = false;
25
+ // ─── Virtual Scroll ───────────────────────────────────────────────
26
+ useVirtualScroll = false;
27
+ rowHeight = 40;
28
+ virtualBuffer = 5;
29
+ virtualEndThreshold = 10;
30
+ // ─────────────────────────────────────────────────────────────────
19
31
  rowsPerPageOption = [
20
32
  { label: '10개씩 보기', value: 10 },
21
33
  { label: '25개씩 보기', value: 25 },
22
34
  { label: '50개씩 보기', value: 50 },
23
35
  { label: '100개씩 보기', value: 100 },
24
36
  ];
25
- useVirtualScroll = {}; // 가상 스크롤 사용 여부
26
- virtualRowHeight = 44; // 가상 스크롤 사용시 각 행의 높이 - 세로 가상 스크롤 사용시 필수값
27
- // 가상 스크롤 사용시 각 열의 너비 - 가로 가상 스크롤 사용시 필수값
28
- // 가상화하려는 컬럼의 넓이는 무조건 고정(resizable의 경우 넓이가 변동되는데 이때에는 고려 x)
29
- virtualColumnWidth = 120;
30
- virtualBufferSize = {
31
- vertical: 5,
32
- horizontal: 5,
33
- }; // 가상 스크롤 위아래 버퍼 크기
34
37
  sdSelectChange;
35
38
  sdPageChange;
36
39
  sdRowsPerPageChange;
37
- currentPage = this.pagination?.page || 1;
38
- innerRows = [];
40
+ sdVirtualUpdate;
41
+ sdVirtualReachEnd;
42
+ currentPage = 1;
43
+ innerRowsPerPage = 10;
39
44
  innerSelected = new Set();
40
45
  columnWidths = [];
41
46
  scrolledLeft = false;
42
47
  scrolledRight = false;
43
- // 세로 가상 스크롤 상태값
44
- virtualStartIndex = 0;
45
- virtualEndIndex = 0;
46
- scrollTopPosition = 0;
47
- // 가로 가상 스크롤 상태값
48
- virtualStartColIdx = 0;
49
- virtualEndColIdx = 0;
50
- scrollLeftPosition = 0;
51
- // 가상 스크롤 Raf(Request Animation Frame) 관리
52
- scrollRequestAnimationFrame = null;
48
+ rowCount = 0;
49
+ loadingScrollTop = 0;
50
+ vsStart = 0;
51
+ vsEnd = 0;
52
+ lastReachEndNotifiedRowCount = -1;
53
53
  scrollContainer = null;
54
- resizeObserver = null;
55
- rafScheduled = false;
56
- pendingUpdates = {
57
- vertical: false,
58
- horizontal: false,
59
- };
60
- // 상태 캐시값
61
- cachedVirtualRows = null;
62
- cachedVirtualIndexKey = '';
63
- cachedColumnOrder = null;
64
- lastColumnOrderKey = '';
65
- // DOM 측정 캐시값
66
- cachedContainerHeight = 0;
67
- cachedContainerWidth = 0;
68
- // 스타일 캐시
69
- stickyStyleCache = new Map();
70
- // isAllChecked 캐시
71
- cachedIsAllChecked;
72
- lastSelectionKey = '';
73
54
  onScroll;
74
- handleColumnsChange(newCols) {
75
- this.columnWidths = this.getColumnWidths(newCols);
76
- this.refreshColumnLayout();
55
+ toFiniteNumber(value, fallback) {
56
+ const n = typeof value === 'number' ? value : Number(value);
57
+ return Number.isFinite(n) ? n : fallback;
77
58
  }
78
- handleUseVirtualScrollChange() {
79
- this.columnWidths = this.getColumnWidths(this.columns || []);
80
- this.refreshColumnLayout();
81
- if (this.useVirtualScroll.vertical) {
82
- this.scheduleUpdate('vertical');
83
- }
59
+ isRowsPerPageValue(value) {
60
+ return value === null || typeof value === 'string' || typeof value === 'number';
84
61
  }
85
- handleVirtualColumnWidthChange() {
86
- if (!this.useVirtualScroll.horizontal)
87
- return;
88
- this.columnWidths = this.getColumnWidths(this.columns || []);
89
- this.refreshColumnLayout();
62
+ isValidTableId(value) {
63
+ return (typeof value === 'string' &&
64
+ value.trim().length > 0 &&
65
+ value !== 'undefined' &&
66
+ value !== 'null');
90
67
  }
91
- handleSelectableChange() {
92
- this.refreshColumnLayout();
68
+ getResolvedTableId() {
69
+ if (this.isValidTableId(this.tableId))
70
+ return this.tableId;
71
+ const attrId = this.el?.getAttribute(TABLE_ID_ATTR);
72
+ if (this.isValidTableId(attrId))
73
+ return attrId;
74
+ return this.fallbackTableId;
93
75
  }
94
- handleStickyColumnChange() {
95
- this.refreshColumnLayout();
76
+ syncTableIdAttribute() {
77
+ const resolvedTableId = this.getResolvedTableId();
78
+ if (this.el?.getAttribute(TABLE_ID_ATTR) !== resolvedTableId) {
79
+ this.el.setAttribute(TABLE_ID_ATTR, resolvedTableId);
80
+ }
96
81
  }
97
- handleColumnWidthsChange() {
98
- this.stickyStyleCache.clear();
99
- if (this.useVirtualScroll.horizontal) {
100
- this.scheduleUpdate('horizontal');
82
+ handleIsLoadingChange(newVal) {
83
+ if (newVal) {
84
+ this.loadingScrollTop = this.scrollContainer?.scrollTop ?? 0;
101
85
  }
102
86
  }
103
- handleRowsChange(newRows) {
104
- this.innerRows = [...newRows];
105
- this.clearRowDerivedCache();
106
- if (this.useVirtualScroll.vertical) {
107
- this.scheduleUpdate('vertical');
87
+ handleUseVirtualScrollChange(newVal) {
88
+ if (newVal) {
89
+ // DOM이 새 --table-container-height로 업데이트된 후 계산해야 정확함
90
+ readTask(() => this.propagateVirtualUpdate());
108
91
  }
109
92
  }
110
- handleSelectedChange(newSelected) {
111
- this.innerSelected = new Set(this.dedupeRowsByKey(newSelected || []));
112
- this.clearSelectionCache();
93
+ handleColumnsChange(newCols) {
94
+ this.columnWidths = newCols.map(c => parseInt(c.width || '120', 10));
95
+ this.refreshChildrenConfig();
96
+ }
97
+ handleRowsChange(newRows) {
98
+ if (!Array.isArray(newRows))
99
+ return;
100
+ this.rowCount = newRows.length;
101
+ if (this.useVirtualScroll)
102
+ this.propagateVirtualUpdate(true);
103
+ this.pushRowsToChildren(newRows);
113
104
  }
114
- cleanUpVirtualCache() {
115
- this.cachedVirtualRows = null;
116
- this.cachedVirtualIndexKey = '';
117
- this.cachedColumnOrder = null;
118
- this.lastColumnOrderKey = '';
105
+ handleTableIdChange() {
106
+ this.syncTableIdAttribute();
119
107
  }
120
- refreshColumnLayout() {
121
- this.cleanUpVirtualCache();
122
- this.stickyStyleCache.clear();
123
- if (this.useVirtualScroll.horizontal) {
124
- this.scheduleUpdate('horizontal');
108
+ handleNoDataLabelChange(newLabel) {
109
+ if (typeof newLabel === 'string' &&
110
+ newLabel.trim().length > 0 &&
111
+ newLabel !== 'undefined' &&
112
+ newLabel !== 'null') {
113
+ this.resolvedNoDataLabel = newLabel;
114
+ }
115
+ else {
116
+ this.resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
125
117
  }
126
118
  }
127
- clearSelectionCache() {
128
- this.cachedIsAllChecked = undefined;
129
- this.lastSelectionKey = '';
119
+ handleConfigChange() {
120
+ this.refreshChildrenConfig();
130
121
  }
131
- clearRowDerivedCache() {
132
- this.cleanUpVirtualCache();
133
- this.clearSelectionCache();
122
+ handleSelectedChange(newSelected) {
123
+ this.innerSelected = new Set(newSelected);
134
124
  }
135
125
  handlePaginationChange(newVal) {
136
- this.clearRowDerivedCache();
137
126
  if (newVal?.page && newVal.page !== this.currentPage) {
138
127
  this.currentPage = newVal.page;
139
- if (this.useVirtualScroll.vertical && this.scrollContainer) {
140
- this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
141
- this.scrollTopPosition = 0;
142
- this.calculateVisibleRange();
143
- }
128
+ }
129
+ if (newVal?.rowsPerPage && newVal.rowsPerPage !== this.innerRowsPerPage) {
130
+ this.innerRowsPerPage = newVal.rowsPerPage;
144
131
  }
145
132
  }
146
133
  componentWillLoad() {
147
- this.innerRows = [...(this.rows || [])];
148
- this.innerSelected = new Set(this.dedupeRowsByKey(this.selected || []));
149
- this.columnWidths = this.getColumnWidths(this.columns || []);
134
+ this.syncTableIdAttribute();
135
+ this.handleNoDataLabelChange(this.noDataLabel);
136
+ this.innerSelected = new Set(this.selected || []);
137
+ this.columnWidths = (this.columns || []).map(c => parseInt(c.width || '120', 10));
150
138
  if (this.pagination?.page) {
151
139
  this.currentPage = this.pagination.page;
152
140
  }
141
+ if (this.pagination?.rowsPerPage) {
142
+ this.innerRowsPerPage = this.pagination.rowsPerPage;
143
+ }
144
+ const el = this.el;
145
+ el.isRowSelectedSync = this.isRowSelectedSync.bind(this);
146
+ el.updateRowSelectSync = this.updateRowSelectSync.bind(this);
147
+ el.toggleSelectAllSync = this.toggleSelectAllSync.bind(this);
148
+ el.getIsAllCheckedSync = this.getIsAllCheckedSync.bind(this);
149
+ el.getStickyStyleSync = this.getStickyStyleSync.bind(this);
150
+ el.setRowCountSync = this.setRowCountSync.bind(this);
151
+ el.handleResize = this.handleResize.bind(this);
152
+ el.getPaginationInfoSync = this.getPaginationInfoSync.bind(this);
153
+ el.getVirtualScrollRangeSync = this.getVirtualScrollRangeSync.bind(this);
154
+ el.getConfigSync = this.getConfigSync.bind(this);
155
+ el.getTableIdSync = () => this.getResolvedTableId();
156
+ el.getVirtualScrollConfigSync = this.getVirtualScrollConfigSync.bind(this);
157
+ el.calculateVisibleRange = this.calculateVisibleRange.bind(this);
158
+ if (Array.isArray(this.rows)) {
159
+ this.rowCount = this.rows.length;
160
+ this.pushRowsToChildren(this.rows);
161
+ }
153
162
  }
154
163
  componentDidLoad() {
164
+ if (Array.isArray(this.rows)) {
165
+ this.pushRowsToChildren(this.rows);
166
+ }
155
167
  readTask(() => {
156
- const middle = this.el.querySelector('.sd-table__middle');
157
- if (!middle)
168
+ const wrapper = this.el.shadowRoot?.querySelector('.sd-table__wrapper');
169
+ if (!wrapper)
158
170
  return;
171
+ let rafPending = false;
159
172
  this.onScroll = () => {
160
- const scrollLeft = middle.scrollLeft;
161
- const scrollWidth = middle.scrollWidth;
162
- const clientWidth = middle.clientWidth;
163
- const scrollTop = middle.scrollTop;
164
- const verticalChanged = this.useVirtualScroll.vertical && this.scrollTopPosition !== scrollTop;
165
- const horizontalChanged = this.useVirtualScroll.horizontal && this.scrollLeftPosition !== scrollLeft;
173
+ // 가로 스크롤 그림자
174
+ const scrollLeft = wrapper.scrollLeft;
175
+ const scrollWidth = wrapper.scrollWidth;
176
+ const clientWidth = wrapper.clientWidth;
166
177
  const newScrolledLeft = scrollLeft > 0;
167
178
  const newScrolledRight = scrollLeft + clientWidth < scrollWidth;
168
179
  if (this.scrolledLeft !== newScrolledLeft || this.scrolledRight !== newScrolledRight) {
169
180
  this.scrolledLeft = newScrolledLeft;
170
181
  this.scrolledRight = newScrolledRight;
182
+ this.refreshChildrenConfig();
171
183
  }
172
- if (verticalChanged || horizontalChanged) {
173
- if (this.scrollRequestAnimationFrame !== null) {
174
- cancelAnimationFrame(this.scrollRequestAnimationFrame);
175
- }
176
- this.scrollRequestAnimationFrame = requestAnimationFrame(() => {
177
- if (verticalChanged) {
178
- this.scrollTopPosition = scrollTop;
179
- this.calculateVisibleRange();
180
- }
181
- if (horizontalChanged) {
182
- this.scrollLeftPosition = scrollLeft;
183
- this.calculateVisibleColumnRange();
184
- }
185
- this.scrollRequestAnimationFrame = null;
184
+ // 세로 가상 스크롤 — RAF로 프레임당 1회만 처리
185
+ if (this.useVirtualScroll && !rafPending) {
186
+ rafPending = true;
187
+ requestAnimationFrame(() => {
188
+ rafPending = false;
189
+ this.propagateVirtualUpdate();
186
190
  });
187
191
  }
188
192
  };
189
- this.scrollContainer = middle;
190
- requestAnimationFrame(() => {
191
- if (this.scrollContainer && this.onScroll) {
192
- this.cachedContainerHeight = this.scrollContainer.clientHeight;
193
- this.cachedContainerWidth = this.scrollContainer.clientWidth;
194
- middle.addEventListener('scroll', this.onScroll, { passive: true });
195
- this.startResizeObserver();
196
- if (this.useVirtualScroll.vertical) {
197
- this.calculateVisibleRange();
198
- }
199
- if (this.useVirtualScroll.horizontal) {
200
- this.calculateVisibleColumnRange();
201
- }
202
- this.onScroll();
203
- }
204
- });
193
+ this.scrollContainer = wrapper;
194
+ wrapper.addEventListener('scroll', this.onScroll, { passive: true });
195
+ this.onScroll();
196
+ if (this.useVirtualScroll) {
197
+ this.propagateVirtualUpdate(); // 초기 렌더
198
+ }
205
199
  });
206
200
  }
207
- changePage(page) {
208
- if (!this.useInternalPagination) {
209
- this.sdPageChange.emit(page);
210
- return;
211
- }
212
- this.currentPage = page;
213
- this.clearRowDerivedCache();
214
- if (this.useVirtualScroll.vertical && this.scrollContainer) {
215
- this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
216
- this.scrollTopPosition = 0;
217
- this.calculateVisibleRange();
218
- }
219
- this.sdPageChange.emit(this.currentPage);
220
- }
221
- changeRowsPerPage(perPage) {
222
- const changedRowsPerPage = perPage ? Number(perPage) : 0;
223
- if (!this.useInternalPagination) {
224
- this.sdRowsPerPageChange.emit(changedRowsPerPage);
225
- return;
226
- }
227
- const newRowsPerPage = Number(perPage || 0);
228
- let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
229
- let newCurrentPage = this.currentPage;
230
- if (newCurrentPage > newLastPage) {
231
- newCurrentPage = newLastPage;
232
- }
233
- this.pagination = {
234
- page: newCurrentPage,
235
- rowsPerPage: newRowsPerPage,
236
- lastPage: newLastPage,
237
- };
238
- this.currentPage = newCurrentPage;
239
- this.clearRowDerivedCache();
240
- if (this.useVirtualScroll.vertical && this.scrollContainer) {
241
- this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
242
- this.scrollTopPosition = 0;
243
- this.calculateVisibleRange();
244
- }
245
- this.sdRowsPerPageChange.emit(changedRowsPerPage);
246
- }
247
201
  disconnectedCallback() {
248
202
  if (this.scrollContainer && this.onScroll) {
249
203
  this.scrollContainer.removeEventListener('scroll', this.onScroll);
250
204
  }
251
- this.resizeObserver?.disconnect();
252
- if (this.scrollRequestAnimationFrame !== null) {
253
- cancelAnimationFrame(this.scrollRequestAnimationFrame);
254
- }
255
205
  }
256
- // ----- Derived getters -----
257
- get tableColumns() {
258
- return this.columns || [];
206
+ pushRowsToChildren(rows) {
207
+ const tbody = this.el.querySelector('sd-tbody');
208
+ if (tbody)
209
+ tbody.rows = rows;
210
+ const thead = this.el.querySelector('sd-thead');
211
+ if (thead)
212
+ thead.rows = rows;
259
213
  }
260
- get paginatedRows() {
261
- if (!this.pagination || !this.useInternalPagination)
262
- return this.innerRows;
263
- const { rowsPerPage = this.rows.length } = this.pagination || {};
264
- return this.innerRows.slice((this.currentPage - 1) * rowsPerPage, this.currentPage * rowsPerPage);
265
- }
266
- get virtualRows() {
267
- const pageKey = this.useInternalPagination
268
- ? `${this.currentPage}-${this.pagination?.rowsPerPage ?? 'all'}`
269
- : 'all';
270
- const newVirtualIndexKey = `${pageKey}-${this.innerRows.length}-${this.virtualStartIndex}-${this.virtualEndIndex}`;
271
- if (this.cachedVirtualRows && this.cachedVirtualIndexKey === newVirtualIndexKey) {
272
- return this.cachedVirtualRows;
273
- }
274
- this.cachedVirtualIndexKey = newVirtualIndexKey;
275
- if (!this.useVirtualScroll.vertical) {
276
- this.cachedVirtualRows = this.paginatedRows.map((row, idx) => ({ row, actualIndex: idx }));
214
+ handleStructureSlotChange = () => {
215
+ if (Array.isArray(this.rows)) {
216
+ this.pushRowsToChildren(this.rows);
277
217
  }
278
- else {
279
- this.cachedVirtualRows = this.paginatedRows
280
- .slice(this.virtualStartIndex, this.virtualEndIndex + 1)
281
- .map((row, relativeIdx) => ({
282
- row,
283
- actualIndex: this.virtualStartIndex + relativeIdx,
284
- }));
285
- }
286
- return this.cachedVirtualRows;
287
- }
288
- get topSpacerHeight() {
289
- if (!this.useVirtualScroll.vertical || this.virtualStartIndex === 0)
290
- return 0;
291
- return this.virtualStartIndex * this.virtualRowHeight;
292
- }
293
- get bottomSpacerHeight() {
294
- if (!this.useVirtualScroll.vertical)
295
- return 0;
296
- const remainingRows = this.paginatedRows.length - this.virtualEndIndex - 1;
297
- return remainingRows > 0 ? remainingRows * this.virtualRowHeight : 0;
218
+ this.refreshChildrenConfig();
219
+ };
220
+ refreshChildrenSelection() {
221
+ const thead = this.el.querySelector('sd-thead');
222
+ const rows = this.el.querySelectorAll('sd-tr');
223
+ thead?.refreshSelection?.();
224
+ rows.forEach(tr => tr?.refreshSelection?.());
298
225
  }
299
- getHorizontalSpacerWidth(position) {
300
- const { stickyLeftCount, stickyRightCount } = this.getNormalizedStickyCounts();
301
- const virtualColumnWidths = this.columnWidths.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
302
- const remainingCols = virtualColumnWidths.length - this.virtualEndColIdx - 1;
303
- if (position === 'right' && remainingCols <= 0)
304
- return 0;
305
- const targetIndex = position === 'left' ? [0, this.virtualStartColIdx] : [this.virtualEndColIdx + 1];
306
- return virtualColumnWidths.slice(...targetIndex).reduce((sum, width) => sum + width, 0);
226
+ refreshChildrenConfig() {
227
+ const thead = this.el.querySelector('sd-thead');
228
+ const rows = this.el.querySelectorAll('sd-tr');
229
+ thead?.refreshConfig?.();
230
+ rows.forEach(tr => tr?.refreshConfig?.());
307
231
  }
308
- get leftSpacerWidth() {
309
- if (!this.useVirtualScroll.horizontal || this.virtualStartColIdx === 0) {
310
- return 0;
311
- }
312
- return this.getHorizontalSpacerWidth('left');
232
+ maybeEmitVirtualReachEnd(start, end) {
233
+ const threshold = Math.max(1, this.virtualEndThreshold);
234
+ const nearEnd = end >= Math.max(0, this.rowCount - threshold);
235
+ if (!nearEnd)
236
+ return;
237
+ if (this.lastReachEndNotifiedRowCount === this.rowCount)
238
+ return;
239
+ this.lastReachEndNotifiedRowCount = this.rowCount;
240
+ this.sdVirtualReachEnd.emit({
241
+ from: start,
242
+ to: end,
243
+ rowCount: this.rowCount,
244
+ threshold,
245
+ });
313
246
  }
314
- get rightSpacerWidth() {
315
- if (!this.useVirtualScroll.horizontal) {
316
- return 0;
247
+ propagateVirtualUpdate(forceSpacerUpdate = false) {
248
+ if (!this.scrollContainer || !this.useVirtualScroll)
249
+ return;
250
+ const scrollTop = this.toFiniteNumber(this.scrollContainer.scrollTop, 0);
251
+ const containerHeight = this.toFiniteNumber(this.scrollContainer.clientHeight, 0);
252
+ const { start, end } = this.calculateVisibleRange(scrollTop, containerHeight);
253
+ if (!Number.isFinite(start) || !Number.isFinite(end))
254
+ return;
255
+ const rangeChanged = this.vsStart !== start || this.vsEnd !== end;
256
+ if (!rangeChanged && !forceSpacerUpdate)
257
+ return;
258
+ this.vsStart = start;
259
+ this.vsEnd = end;
260
+ const topHeight = start * this.rowHeight;
261
+ const bottomHeight = Math.max(0, (this.rowCount - end) * this.rowHeight);
262
+ const tbody = this.el.querySelector('sd-tbody');
263
+ tbody?.setSpacersSync?.(topHeight, bottomHeight);
264
+ if (rangeChanged) {
265
+ this.sdVirtualUpdate.emit({
266
+ from: start,
267
+ to: end,
268
+ });
317
269
  }
318
- return this.getHorizontalSpacerWidth('right');
270
+ this.maybeEmitVirtualReachEnd(start, end);
319
271
  }
320
- get totalVirtualHeight() {
321
- if (!this.useVirtualScroll.vertical)
322
- return 0;
323
- return this.paginatedRows.length * this.virtualRowHeight;
324
- }
325
- get lastPageNumber() {
326
- const { lastPage, rowsPerPage = this.rows.length } = this.pagination || {};
327
- return lastPage ?? Math.max(1, Math.ceil(this.rows.length / rowsPerPage));
328
- }
329
- get sdTableClasses() {
330
- return [
331
- 'sd-table',
332
- this.stickyHeader && 'sd-table--sticky-header',
333
- this.selectable && 'sd-table--selectable',
334
- this.resizable && 'sd-table--resizable',
335
- !this.innerRows.length && 'sd-table--no-data',
336
- this.hasStickyColumn && 'sd-table--sticky-column',
337
- this.scrolledLeft && 'sd-table--scrolled-left',
338
- this.scrolledRight && 'sd-table--scrolled-right',
339
- ]
340
- .filter(Boolean)
341
- .join(' ');
272
+ getVirtualScrollConfigSync() {
273
+ return {
274
+ useVirtualScroll: this.useVirtualScroll,
275
+ rowHeight: this.rowHeight,
276
+ virtualBuffer: this.virtualBuffer,
277
+ vsStart: this.vsStart,
278
+ vsEnd: this.vsEnd,
279
+ rowCount: this.rowCount,
280
+ };
342
281
  }
343
- get hasStickyColumn() {
344
- const { stickyLeftCount, stickyRightCount } = this.getNormalizedStickyCounts();
345
- return (this.selectable || stickyLeftCount > 0 || stickyRightCount > 0);
282
+ getConfigSync() {
283
+ return {
284
+ columns: this.columns,
285
+ selectable: this.selectable,
286
+ resizable: this.resizable,
287
+ stickyColumn: this.stickyColumn,
288
+ stickyHeader: this.stickyHeader,
289
+ scrolledLeft: this.scrolledLeft,
290
+ scrolledRight: this.scrolledRight,
291
+ columnWidths: this.columnWidths,
292
+ };
346
293
  }
347
- get hasStickyLeftDataColumn() {
348
- return this.getNormalizedStickyCounts().stickyLeftCount > 0;
294
+ isRowSelectedSync(row) {
295
+ return Array.from(this.innerSelected).some(r => r[this.rowKey] === row[this.rowKey]);
349
296
  }
350
- // ----- Selection -----
351
- isRowSelected(row) {
352
- return Array.from(this.innerSelected).some(r => this.getRowKeyValue(r) === this.getRowKeyValue(row));
297
+ async isRowSelected(row) {
298
+ return this.isRowSelectedSync(row);
353
299
  }
354
- updateRowSelect(row) {
300
+ updateRowSelectSync(row) {
355
301
  const selectedArray = Array.from(this.innerSelected);
356
- const exists = this.isRowSelected(row);
302
+ const exists = this.isRowSelectedSync(row);
357
303
  const newSelected = exists
358
- ? selectedArray.filter(r => this.getRowKeyValue(r) !== this.getRowKeyValue(row))
304
+ ? selectedArray.filter(r => r[this.rowKey] !== row[this.rowKey])
359
305
  : [...selectedArray, row];
360
- // 동일 상태면 set하지 않음 → 불필요 렌더 방지
361
306
  if (newSelected.length === selectedArray.length)
362
307
  return;
363
- this.innerSelected = new Set(this.dedupeRowsByKey(newSelected));
364
- this.clearSelectionCache();
308
+ this.innerSelected = new Set(newSelected);
365
309
  this.selected = Array.from(this.innerSelected);
366
310
  this.sdSelectChange.emit(Array.from(this.innerSelected));
311
+ this.refreshChildrenSelection();
312
+ }
313
+ async updateRowSelect(row) {
314
+ this.updateRowSelectSync(row);
367
315
  }
368
- toggleSelectAll(checked) {
369
- const selectedRows = Array.from(this.innerSelected);
316
+ toggleSelectAllSync(checked, rows) {
370
317
  if (checked) {
371
- this.innerSelected = new Set(this.dedupeRowsByKey([...selectedRows, ...this.paginatedRows]));
318
+ const pageRows = new Set([...rows]);
319
+ this.innerSelected = new Set([...this.innerSelected, ...pageRows]);
372
320
  }
373
321
  else {
374
- const currentPageKeys = new Set(this.paginatedRows.map(r => this.getRowKeyValue(r)));
375
- this.innerSelected = new Set(selectedRows.filter(r => !currentPageKeys.has(this.getRowKeyValue(r))));
322
+ const currentPageKeys = rows.map(r => r[this.rowKey]);
323
+ this.innerSelected = new Set([...this.innerSelected].filter(r => !currentPageKeys.includes(r[this.rowKey])));
376
324
  }
377
- this.clearSelectionCache();
378
325
  this.selected = Array.from(this.innerSelected);
379
326
  this.sdSelectChange.emit(Array.from(this.innerSelected));
327
+ this.refreshChildrenSelection();
380
328
  }
381
- get isAllChecked() {
382
- const paginatedKeys = this.paginatedRows.map(row => String(this.getRowKeyValue(row))).join('|');
383
- const selectedKeys = Array.from(this.innerSelected)
384
- .map(row => String(this.getRowKeyValue(row)))
385
- .sort()
386
- .join('|');
387
- const selectionKey = `${paginatedKeys}::${selectedKeys}`;
388
- if (this.cachedIsAllChecked !== undefined && this.lastSelectionKey === selectionKey) {
389
- return this.cachedIsAllChecked;
390
- }
391
- const total = this.paginatedRows.length;
392
- const selectedCount = this.paginatedRows.filter(row => Array.from(this.innerSelected).some(selectedRow => this.getRowKeyValue(selectedRow) === this.getRowKeyValue(row))).length;
393
- let result;
394
- if (selectedCount === 0) {
395
- result = false; // 아무것도 안 선택됨
396
- }
397
- else if (selectedCount === total) {
398
- result = true; // 전부 선택됨
399
- }
400
- else {
401
- result = null; // 일부만 선택됨
402
- }
403
- this.cachedIsAllChecked = result;
404
- this.lastSelectionKey = selectionKey;
405
- return result;
329
+ async toggleSelectAll(checked, rows) {
330
+ this.toggleSelectAllSync(checked, rows);
406
331
  }
407
- // RAF 통합 관리
408
- scheduleUpdate(type) {
409
- this.pendingUpdates[type] = true;
410
- if (!this.rafScheduled) {
411
- this.rafScheduled = true;
412
- this.scrollRequestAnimationFrame = requestAnimationFrame(() => {
413
- if (this.pendingUpdates.vertical)
414
- this.calculateVisibleRange();
415
- if (this.pendingUpdates.horizontal)
416
- this.calculateVisibleColumnRange();
417
- this.pendingUpdates = { vertical: false, horizontal: false };
418
- this.rafScheduled = false;
419
- this.scrollRequestAnimationFrame = null;
420
- });
421
- }
332
+ getIsAllCheckedSync(rows) {
333
+ const total = rows.length;
334
+ const selectedCount = rows.filter(row => Array.from(this.innerSelected).some(selectedRow => selectedRow[this.rowKey] === row[this.rowKey])).length;
335
+ if (selectedCount === 0)
336
+ return false;
337
+ if (selectedCount === total)
338
+ return true;
339
+ return null; // indeterminate
422
340
  }
423
- // 세로 가상 스크롤 렌더링 계산
424
- calculateVisibleRange() {
425
- if (!this.useVirtualScroll.vertical) {
426
- this.virtualStartIndex = 0;
427
- this.virtualEndIndex = this.paginatedRows.length - 1;
428
- return;
429
- }
430
- const scrollTop = this.scrollTopPosition;
431
- let containerHeight = this.cachedContainerHeight;
432
- if (containerHeight === 0 && this.scrollContainer) {
433
- containerHeight = this.scrollContainer.clientHeight;
434
- this.cachedContainerHeight = containerHeight;
435
- }
436
- const bufferSize = this.virtualBufferSize.vertical || 5;
437
- const startIndex = Math.floor(scrollTop / this.virtualRowHeight);
438
- const visibleCount = Math.ceil(containerHeight / this.virtualRowHeight);
439
- const endIndex = startIndex + visibleCount - 1;
440
- const newStartIndex = Math.max(0, startIndex - bufferSize);
441
- const newEndIndex = Math.min(this.paginatedRows.length - 1, endIndex + bufferSize);
442
- // 실제로 변경된 경우에만 상태 업데이트
443
- if (this.virtualStartIndex !== newStartIndex || this.virtualEndIndex !== newEndIndex) {
444
- this.virtualStartIndex = newStartIndex;
445
- this.virtualEndIndex = newEndIndex;
446
- }
341
+ async getIsAllChecked(rows) {
342
+ return this.getIsAllCheckedSync(rows);
447
343
  }
448
- // 가로 가상 스크롤 렌더링 계산
449
- calculateVisibleColumnRange() {
450
- if (!this.useVirtualScroll.horizontal) {
451
- this.virtualStartColIdx = 0;
452
- this.virtualEndColIdx = this.tableColumns.length - 1;
453
- return;
454
- }
455
- const scrollLeft = this.scrollLeftPosition;
456
- // 캐시된 값 사용, 없으면 측정 후 캐시
457
- let containerWidth = this.cachedContainerWidth;
458
- if (containerWidth === 0 && this.scrollContainer) {
459
- containerWidth = this.scrollContainer.clientWidth;
460
- this.cachedContainerWidth = containerWidth;
461
- }
462
- const { stickyLeftCount, stickyRightCount } = this.getNormalizedStickyCounts();
463
- // 가상 스크롤 컬럼 - sticky column 제외
464
- const virtualColumns = this.tableColumns.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
465
- if (virtualColumns.length === 0) {
466
- this.virtualStartColIdx = 0;
467
- this.virtualEndColIdx = 0;
344
+ changePage(page) {
345
+ if (!this.useInternalPagination) {
346
+ this.sdPageChange.emit(page);
468
347
  return;
469
348
  }
470
- const stickyLeftWidth = this.columnWidths.slice(0, stickyLeftCount).reduce((sum, width) => sum + width, 0) +
471
- (this.selectable ? 52 : 0);
472
- const stickyRightWidth = this.columnWidths
473
- .slice(this.tableColumns.length - stickyRightCount)
474
- .reduce((sum, width) => sum + width, 0);
475
- // 가상 스크롤 영역의 너비 계산
476
- const virtualScrollableWidth = containerWidth - stickyLeftWidth - stickyRightWidth;
477
- const virtualColumnWidths = this.columnWidths.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
478
- const virtualScrollLeft = Math.max(0, scrollLeft - stickyLeftWidth);
479
- const reducedVirtualWidth = virtualColumnWidths.reduce((acc, width, idx) => {
480
- acc.push((acc[idx - 1] || 0) + width);
481
- return acc;
482
- }, []);
483
- let startIdx = 0; // 가상 스크롤 시작 인덱스
484
- let endIdx = virtualColumns.length - 1; // 가상 스크롤 종료 인덱스
485
- // sticky left 영역 제외한 스크롤 위치
486
- for (let i = 0; i < reducedVirtualWidth.length; i++) {
487
- if (reducedVirtualWidth[i] > virtualScrollLeft) {
488
- startIdx = Math.max(0, i);
489
- break;
490
- }
491
- }
492
- const scrollRight = virtualScrollLeft + virtualScrollableWidth;
493
- for (let i = startIdx; i < reducedVirtualWidth.length; i++) {
494
- if (reducedVirtualWidth[i] >= scrollRight) {
495
- endIdx = Math.min(virtualColumns.length - 1, i);
496
- break;
497
- }
498
- }
499
- const bufferSize = this.virtualBufferSize.horizontal || 5;
500
- const newStartColIdx = Math.max(0, startIdx - bufferSize);
501
- const newEndColIdx = Math.min(virtualColumns.length - 1, endIdx + bufferSize);
502
- // 실제로 변경된 경우에만 상태 업데이트
503
- if (this.virtualStartColIdx !== newStartColIdx || this.virtualEndColIdx !== newEndColIdx) {
504
- this.virtualStartColIdx = newStartColIdx;
505
- this.virtualEndColIdx = newEndColIdx;
506
- }
349
+ this.currentPage = page;
350
+ this.sdPageChange.emit(this.currentPage);
351
+ this.updateRowsVisibility();
507
352
  }
508
- // ----- Helpers -----
509
- getStickyStyle(colIdx) {
510
- // 캐시된 스타일이 있으면 반환
511
- if (this.stickyStyleCache.has(colIdx)) {
512
- return this.stickyStyleCache.get(colIdx);
513
- }
514
- const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) + (this.selectable ? 52 : 0);
515
- const { stickyRightCount } = this.getNormalizedStickyCounts();
516
- const rightOffset = this.columnWidths
517
- .filter((_, i) => i >= this.tableColumns.length - stickyRightCount && i > colIdx)
518
- .reduce((a, b) => a + b, 0);
519
- const style = {
520
- '--sticky-left-offset': `${leftOffset}px`,
521
- '--sticky-right-offset': `${rightOffset}px`,
522
- 'width': `${this.columnWidths[colIdx]}px`,
523
- 'minWidth': `${this.columnWidths[colIdx]}px`,
524
- 'maxWidth': `${this.columnWidths[colIdx]}px`,
525
- };
526
- // 스타일 캐시에 저장
527
- this.stickyStyleCache.set(colIdx, style);
528
- return style;
353
+ updateRowsVisibility() {
354
+ const rows = this.el.querySelectorAll('sd-tr');
355
+ rows.forEach(tr => tr?.updateVisibility?.());
529
356
  }
530
- startResizeObserver() {
531
- if (!this.scrollContainer || typeof ResizeObserver === 'undefined')
357
+ changeRowsPerPage(perPage) {
358
+ const changedRowsPerPage = perPage ? Number(perPage) : 0;
359
+ if (!this.useInternalPagination) {
360
+ this.sdRowsPerPageChange.emit(changedRowsPerPage);
532
361
  return;
533
- this.resizeObserver?.disconnect();
534
- this.resizeObserver = new ResizeObserver(() => {
535
- if (!this.scrollContainer)
536
- return;
537
- const nextHeight = this.scrollContainer.clientHeight;
538
- const nextWidth = this.scrollContainer.clientWidth;
539
- const heightChanged = this.cachedContainerHeight !== nextHeight;
540
- const widthChanged = this.cachedContainerWidth !== nextWidth;
541
- if (!heightChanged && !widthChanged)
542
- return;
543
- this.cachedContainerHeight = nextHeight;
544
- this.cachedContainerWidth = nextWidth;
545
- if (heightChanged && this.useVirtualScroll.vertical) {
546
- this.scheduleUpdate('vertical');
547
- }
548
- if (widthChanged && this.useVirtualScroll.horizontal) {
549
- this.scheduleUpdate('horizontal');
550
- }
551
- });
552
- this.resizeObserver.observe(this.scrollContainer);
553
- }
554
- parseColumnWidth(width, fallbackWidth) {
555
- if (typeof width === 'number') {
556
- return Number.isFinite(width) ? width : fallbackWidth;
557
362
  }
558
- if (typeof width !== 'string')
559
- return fallbackWidth;
560
- const normalized = width.trim();
561
- if (!normalized)
562
- return fallbackWidth;
563
- if (/^\d+(\.\d+)?px$/.test(normalized)) {
564
- return Number.parseFloat(normalized);
363
+ this.innerRowsPerPage = changedRowsPerPage;
364
+ const newLastPage = Math.max(1, Math.ceil(this.rowCount / changedRowsPerPage));
365
+ if (this.currentPage > newLastPage) {
366
+ this.currentPage = newLastPage;
565
367
  }
566
- if (/^\d+(\.\d+)?$/.test(normalized)) {
567
- return Number.parseFloat(normalized);
568
- }
569
- return fallbackWidth;
570
- }
571
- getColumnWidths(columns = []) {
572
- const fallbackWidth = this.useVirtualScroll.horizontal ? this.virtualColumnWidth : 120;
573
- return columns.map(c => this.parseColumnWidth(c.width, fallbackWidth));
574
- }
575
- getNormalizedStickyCounts() {
576
- const totalColumnCount = this.tableColumns.length;
577
- const requestedLeft = Number(this.stickyColumn?.left ?? 0) || 0;
578
- const requestedRight = Number(this.stickyColumn?.right ?? 0) || 0;
579
- const stickyLeftCount = Math.min(totalColumnCount, Math.max(0, requestedLeft));
580
- const stickyRightCount = Math.min(Math.max(0, totalColumnCount - stickyLeftCount), Math.max(0, requestedRight));
581
- return {
582
- stickyLeftCount,
583
- stickyRightCount,
584
- };
585
- }
586
- getRowKeyValue(row) {
587
- return row?.[this.rowKey];
368
+ this.sdRowsPerPageChange.emit(changedRowsPerPage);
369
+ this.updateRowsVisibility();
588
370
  }
589
- dedupeRowsByKey(rows) {
590
- const rowMap = new Map();
591
- rows.forEach(row => {
592
- rowMap.set(this.getRowKeyValue(row), row);
593
- });
594
- return Array.from(rowMap.values());
371
+ get lastPageNumber() {
372
+ if (this.useInternalPagination) {
373
+ return Math.max(1, Math.ceil(this.rowCount / this.innerRowsPerPage));
374
+ }
375
+ const { lastPage, rowsPerPage = 10 } = this.pagination || {};
376
+ return lastPage ?? Math.max(1, Math.ceil(this.rowCount / rowsPerPage));
595
377
  }
596
- handleResize(index, event) {
597
- // SSR 환경 체크
378
+ handleResize(index, event, reversed = false) {
598
379
  if (typeof document === 'undefined')
599
380
  return;
600
381
  const startX = event.clientX;
601
382
  const startWidth = this.columnWidths[index];
602
383
  const handleMouseMove = (moveEvent) => {
603
- const currentWidth = this.columnWidths[index];
604
- if (!currentWidth)
384
+ const col = this.columns[index];
385
+ if (!col)
605
386
  return;
606
- const targetColumn = this.tableColumns[index];
607
- const minWidth = targetColumn?.minWidth || 50;
608
- const maxWidth = targetColumn?.maxWidth || 9999;
609
- const newWidth = Math.min(Math.max(startWidth + moveEvent.clientX - startX, minWidth), maxWidth);
387
+ const minWidth = col.minWidth || 50;
388
+ const maxWidth = col.maxWidth || 9999;
389
+ const delta = moveEvent.clientX - startX;
390
+ const newWidth = Math.min(Math.max(startWidth + (reversed ? -delta : delta), minWidth), maxWidth);
610
391
  this.columnWidths = this.columnWidths.map((width, idx) => (idx === index ? newWidth : width));
392
+ const thead = this.el.querySelector('sd-thead');
393
+ const rows = this.el.querySelectorAll('sd-tr');
394
+ thead?.setColumnWidths?.(this.columnWidths);
395
+ rows.forEach(tr => tr?.setColumnWidths?.(this.columnWidths));
396
+ const stickyRightCount = this.stickyColumn?.right || 0;
397
+ const visibleColCount = this.columns.filter(c => c.visible !== false).length;
398
+ const isRightStickyEdgeResizer = stickyRightCount > 0 && index === visibleColCount - stickyRightCount;
399
+ if (isRightStickyEdgeResizer) {
400
+ requestAnimationFrame(() => {
401
+ this.onScroll?.();
402
+ });
403
+ }
611
404
  };
612
405
  const handleMouseUp = () => {
613
406
  document.removeEventListener('mousemove', handleMouseMove);
@@ -616,161 +409,119 @@ export class SdTable {
616
409
  document.addEventListener('mousemove', handleMouseMove);
617
410
  document.addEventListener('mouseup', handleMouseUp);
618
411
  }
619
- getCellValue(column, row) {
620
- const { field, format, name } = column;
621
- const value = typeof field === 'function' ? field(row) : field ? row[field] : row[name];
622
- return format ? format(value, row) : value;
623
- }
624
- getColumnRenderedInOrder() {
625
- const { stickyLeftCount, stickyRightCount } = this.getNormalizedStickyCounts();
626
- const orderKey = `${this.tableColumns.map(col => col.name).join('|')}-${stickyLeftCount}-${stickyRightCount}-${this.useVirtualScroll.horizontal ? `${this.virtualStartColIdx}-${this.virtualEndColIdx}` : 'all'}`;
627
- if (this.cachedColumnOrder && this.lastColumnOrderKey === orderKey) {
628
- return this.cachedColumnOrder;
629
- }
630
- // Sticky left 컬럼들
631
- const stickyLeftCols = this.tableColumns.slice(0, stickyLeftCount);
632
- const stickyRightCols = this.tableColumns.slice(this.tableColumns.length - stickyRightCount);
633
- const middleCols = this.useVirtualScroll.horizontal
634
- ? this.tableColumns
635
- .slice(stickyLeftCount, this.tableColumns.length - stickyRightCount)
636
- .slice(this.virtualStartColIdx, this.virtualEndColIdx + 1)
637
- : this.tableColumns.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
638
- this.cachedColumnOrder = {
639
- stickyLeftCount,
640
- stickyRightCount,
641
- stickyLeftCols,
642
- middleCols,
643
- stickyRightCols,
412
+ getStickyStyleSync(colIdx) {
413
+ const leftOffset = this.columnWidths
414
+ .slice(0, colIdx)
415
+ .reduce((a, b) => a + b, this.selectable ? 52 : 0);
416
+ const rightOffset = this.columnWidths
417
+ .filter((_, i) => i >=
418
+ this.columns.filter(c => c.visible !== false).length -
419
+ (this.stickyColumn?.right || 0) && i > colIdx)
420
+ .reduce((a, b) => a + b, 0);
421
+ return {
422
+ '--sticky-left-offset': `${leftOffset}px`,
423
+ '--sticky-right-offset': `${rightOffset}px`,
424
+ 'width': `${this.columnWidths[colIdx]}px`,
425
+ 'minWidth': `${this.columnWidths[colIdx]}px`,
426
+ 'maxWidth': `${this.columnWidths[colIdx]}px`,
644
427
  };
645
- this.lastColumnOrderKey = orderKey;
646
- return this.cachedColumnOrder;
647
428
  }
648
- // ----- Render -----
649
- renderHead() {
650
- const { stickyLeftCount, stickyRightCount, stickyLeftCols, middleCols, stickyRightCols } = this.getColumnRenderedInOrder();
651
- return (h("thead", null, h("tr", null, this.selectable && (h("th", { class: {
652
- 'sd-th': true,
653
- 'sd-th--selected': true,
654
- 'sticky-left': true,
655
- 'sticky-left-edge': !this.hasStickyLeftDataColumn,
656
- }, style: {
657
- '--sticky-left-offset': '0px',
658
- } }, h("sd-checkbox", { value: this.isAllChecked, disabled: !this.paginatedRows.length, onSdUpdate: (e) => this.toggleSelectAll(e.detail) }))), stickyLeftCols.map((col, idx) => {
659
- return (h("th", { key: col.name, class: {
660
- 'sd-th': true,
661
- [`${col.thClass}`]: Boolean(col.thClass),
662
- 'sticky-left': true,
663
- 'sticky-left-edge': idx === stickyLeftCount - 1,
664
- }, style: { ...col.thStyle, ...this.getStickyStyle(idx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(idx, evt) }))));
665
- }), this.renderSpacerTh('left'), middleCols.map((col, relativeIdx) => {
666
- const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
667
- return (h("th", { key: col.name, class: {
668
- 'sd-th': true,
669
- [`${col.thClass}`]: Boolean(col.thClass),
670
- }, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
671
- }), this.renderSpacerTh('right'), stickyRightCols.map((col, relativeIdx) => {
672
- const actualColIdx = this.tableColumns.length - stickyRightCount + relativeIdx;
673
- return (h("th", { key: col.name, class: {
674
- 'sd-th': true,
675
- [`${col.thClass}`]: Boolean(col.thClass),
676
- 'sticky-right': true,
677
- 'sticky-right-edge': relativeIdx === 0,
678
- }, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
679
- }))));
429
+ async getStickyStyle(colIdx) {
430
+ return this.getStickyStyleSync(colIdx);
680
431
  }
681
- renderBody() {
682
- return (h("tbody", { ...(!this.paginatedRows.length && { part: 'tbody-empty' }), class: `sd-table-tbody ${this.useVirtualScroll.vertical ? 'sd-table-tbody--virtual-scroll' : ''}`, style: { '--total-virtual-height': `${this.totalVirtualHeight}px` } }, this.useVirtualScroll.vertical && this.topSpacerHeight > 0 && this.renderSpacerRow('top'), this.paginatedRows.length > 0 &&
683
- this.virtualRows.map(({ row, actualIndex }) => this.renderRow(row, actualIndex)), this.useVirtualScroll.vertical &&
684
- this.bottomSpacerHeight > 0 &&
685
- this.renderSpacerRow('bottom')));
432
+ setRowCountSync(count) {
433
+ const safeCount = Math.max(0, Math.floor(this.toFiniteNumber(count, 0)));
434
+ if (safeCount !== this.rowCount) {
435
+ this.lastReachEndNotifiedRowCount = -1;
436
+ }
437
+ this.rowCount = safeCount;
438
+ if (this.useVirtualScroll) {
439
+ this.propagateVirtualUpdate(true);
440
+ }
686
441
  }
687
- renderRow(row, rowIdx) {
688
- const { stickyLeftCount, stickyRightCount, stickyLeftCols, middleCols, stickyRightCols } = this.getColumnRenderedInOrder();
689
- return (h("tr", { key: row[this.rowKey], class: "hover:bg-Grey_Lighten-6", style: this.useVirtualScroll.vertical
690
- ? {
691
- height: `${this.virtualRowHeight}px`,
692
- }
693
- : {} }, this.selectable && (h("td", { class: {
694
- 'sd-td': true,
695
- 'sd-td--selected': true,
696
- 'sticky-left': true,
697
- 'sticky-left-edge': !this.hasStickyLeftDataColumn,
698
- }, style: {
699
- '--sticky-left-offset': '0px',
700
- } }, h("sd-checkbox", { value: this.isRowSelected(row), disabled: !this.paginatedRows.length, onSdUpdate: () => this.updateRowSelect(row) }))), stickyLeftCols.map((column, idx) => {
701
- return (h("td", { key: column.name, part: `td-${column.name}`, class: {
702
- 'sd-td': true,
703
- [`sd-td--${column.align || 'left'}`]: true,
704
- 'sticky-left': true,
705
- 'sticky-left-edge': idx === stickyLeftCount - 1,
706
- [`${column.tdClass}`]: Boolean(column.tdClass),
707
- }, style: this.getStickyStyle(idx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
708
- }), this.renderSpacerTd('left', rowIdx), middleCols.map((column, relativeIdx) => {
709
- const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
710
- return (h("td", { key: column.name, part: `td-${column.name}`, class: {
711
- 'sd-td': true,
712
- [`sd-td--${column.align || 'left'}`]: true,
713
- [`${column.tdClass}`]: Boolean(column.tdClass),
714
- }, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
715
- }), this.renderSpacerTd('right', rowIdx), stickyRightCols.map((column, relativeIdx) => {
716
- const actualColIdx = this.tableColumns.length - stickyRightCount + relativeIdx;
717
- return (h("td", { key: column.name, part: `td-${column.name}`, class: {
718
- 'sd-td': true,
719
- [`sd-td--${column.align || 'left'}`]: true,
720
- 'sticky-right': true,
721
- 'sticky-right-edge': relativeIdx === 0,
722
- [`${column.tdClass}`]: Boolean(column.tdClass),
723
- }, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
724
- })));
442
+ async setRowCount(count) {
443
+ this.setRowCountSync(count);
725
444
  }
726
- renderSpacerRow(position) {
727
- const spacerHeight = position === 'top' ? this.topSpacerHeight : this.bottomSpacerHeight;
728
- return (h("tr", { key: `virtual-${position}-spacer`, class: "sd-table__virtual-row-spacer", style: {
729
- height: `${spacerHeight}px`,
730
- }, "aria-hidden": "true" }, h("td", { colSpan: this.tableColumns.length + (this.selectable ? 1 : 0) }, h("div", { class: "sd-table__skeleton", style: {
731
- '--row-height': `${this.virtualRowHeight}px`,
732
- } }))));
445
+ calculateVisibleRange(scrollTop, containerHeight) {
446
+ const safeRowHeight = Math.max(1, this.toFiniteNumber(this.rowHeight, 40));
447
+ const safeBuffer = Math.max(0, Math.floor(this.toFiniteNumber(this.virtualBuffer, 5)));
448
+ const safeScrollTop = Math.max(0, this.toFiniteNumber(scrollTop, 0));
449
+ const safeContainerHeight = Math.max(0, this.toFiniteNumber(containerHeight, 0));
450
+ const safeRowCount = Math.max(0, Math.floor(this.toFiniteNumber(this.rowCount, 0)));
451
+ const firstVisible = Math.floor(safeScrollTop / safeRowHeight);
452
+ const visibleCount = Math.ceil(safeContainerHeight / safeRowHeight);
453
+ const start = Math.max(0, firstVisible - safeBuffer);
454
+ const end = Math.min(safeRowCount, firstVisible + visibleCount + safeBuffer);
455
+ return { start, end };
733
456
  }
734
- getSpacerCellStyle(spacerWidth) {
457
+ getPaginationInfoSync() {
458
+ if (!this.useInternalPagination || !this.pagination)
459
+ return null;
460
+ const startIndex = (this.currentPage - 1) * this.innerRowsPerPage;
461
+ const endIndex = startIndex + this.innerRowsPerPage;
735
462
  return {
736
- width: `${spacerWidth}px`,
737
- minWidth: `${spacerWidth}px`,
738
- maxWidth: `${spacerWidth}px`,
739
- padding: '0',
740
- border: 'none',
463
+ startIndex,
464
+ endIndex,
465
+ currentPage: this.currentPage,
466
+ rowsPerPage: this.innerRowsPerPage,
741
467
  };
742
468
  }
743
- renderSpacerTh(position) {
744
- const spacerWidth = position === 'left' ? this.leftSpacerWidth : this.rightSpacerWidth;
745
- const showSpacer = position === 'left'
746
- ? this.useVirtualScroll.horizontal && this.leftSpacerWidth > 0
747
- : this.useVirtualScroll.horizontal && this.rightSpacerWidth > 0;
748
- if (!showSpacer)
749
- return null;
750
- return (h("th", { key: `virtual-${position}-spacer-header`, class: "sd-table__virtual-spacer", style: this.getSpacerCellStyle(spacerWidth), "aria-hidden": "true" }, h("div", { class: "sd-table__skeleton-cell" })));
469
+ async getPaginationInfo() {
470
+ return this.getPaginationInfoSync();
751
471
  }
752
- renderSpacerTd(position, rowIdx) {
753
- const spacerWidth = position === 'left' ? this.leftSpacerWidth : this.rightSpacerWidth;
754
- const showSpacer = position === 'left'
755
- ? this.useVirtualScroll.horizontal && this.leftSpacerWidth > 0
756
- : this.useVirtualScroll.horizontal && this.rightSpacerWidth > 0;
757
- if (!showSpacer)
472
+ getVirtualScrollRangeSync() {
473
+ if (!this.useVirtualScroll)
758
474
  return null;
759
- return (h("td", { key: `virtual-${position}-spacer-${rowIdx}`, class: "sd-table__virtual-spacer", style: this.getSpacerCellStyle(spacerWidth), "aria-hidden": "true" }, h("div", { class: "sd-table__skeleton-cell" })));
475
+ if (!(this.vsEnd > 0))
476
+ return null;
477
+ return { from: this.vsStart, to: this.vsEnd };
478
+ }
479
+ get tableClasses() {
480
+ return [
481
+ 'sd-table',
482
+ this.stickyHeader && 'sd-table--sticky-header',
483
+ this.selectable && 'sd-table--selectable',
484
+ this.resizable && 'sd-table--resizable',
485
+ (this.selectable ||
486
+ (this.stickyColumn?.left ?? 0) > 0 ||
487
+ (this.stickyColumn?.right ?? 0) > 0) &&
488
+ 'sd-table--sticky-column',
489
+ this.scrolledLeft && 'sd-table--scrolled-left',
490
+ this.scrolledRight && 'sd-table--scrolled-right',
491
+ this.rowCount === 0 && !this.isLoading && 'sd-table--no-data',
492
+ ]
493
+ .filter(Boolean)
494
+ .join(' ');
760
495
  }
761
496
  render() {
762
- return (h(Fragment, { key: 'cc7236bc2511f0b7c6bd31610e005c558e4dda81' }, h("div", { key: 'c78feb1d4ba89c8340660405598c8892d660078d', class: "sd-table__wrapper", style: {
497
+ const resolvedTableId = this.getResolvedTableId();
498
+ return (h(Host, { key: 'dd25a84ce29a197a7e853d1812ce0f0fbdf043bd' }, h("div", { key: '8b256e995d55c36ff9622148054911fcbe8aa89b', class: "sd-table__container", style: {
763
499
  '--table-width': this.width,
764
500
  '--table-height': this.height,
765
- } }, h("div", { key: 'e127e5e51cfa1b930a79d031ff4fbffac3cf8b69', class: "sd-table__container", style: {
766
- '--table-container-height': `calc(${this.height} - ${this.pagination && this.innerRows.length > 0 ? 48 : 0}px)`,
767
- } }, h("div", { key: 'ea47affe622b7f7c98b9c044db73f275a9c7b8ba', class: {
768
- 'sd-table__middle': true,
769
- 'sd-table__middle--scrollable': this.paginatedRows.length > 0,
770
- 'sd-table__middle--loading': this.isLoading,
771
- } }, this.isLoading && (h("div", { key: '52c9d3a0b83bf786980cb6561b39234d3f1697ad', class: "sd-table__middle--loading__spinner" }, h("sd-loading-spinner", { key: '60d8f10a4f35e509969190ab23713057f9fb1efb' }))), h("table", { key: 'fd25840b4aeddd456d97c7397541da58c8d0aed9', part: "table", class: this.sdTableClasses }, this.renderHead(), this.renderBody())), !this.paginatedRows.length && (h("div", { key: '5d1ed19126eb328a78ff50e701392b0d18208030', class: "sd-table__bottom" }, h("div", { key: 'e3cc512088e0bf7f6ec9699c1ce948910d621e45', class: "sd-table__no-data" }, h("slot", { key: 'a5285e5d607a66a6e9f7993c6a82dc9bd6d53a08', name: "no-data" }, this.noDataLabel))))), this.pagination && this.innerRows.length > 0 && (h("div", { key: '1a57bf7960624ebfd80005cd320d0d29ed7b6123', class: "sd-table__pagination" }, h("sd-pagination", { key: 'dbc457c10036556928c3503ef84b8bfc29849342', 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: '6a0bdf472ed0dfca4c57725635c50bf1a375f11c', value: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", onSdUpdate: (e) => this.changeRowsPerPage(e.detail.value) })))))));
501
+ '--table-container-height': `calc(${this.height || '100%'} - ${this.pagination && this.rowCount > 0 && !this.useVirtualScroll ? 48 : 0}px)`,
502
+ } }, h("div", { key: 'b4949fed8c50b93bcddace22978aff358ea7c210', class: {
503
+ 'sd-table__clip': true,
504
+ 'sd-table__clip--has-pagination': !!(this.pagination &&
505
+ this.pagination.rowsPerPage > 0 &&
506
+ this.rowCount > 0 &&
507
+ !this.useVirtualScroll),
508
+ } }, h("div", { key: '5fcceeb27568afdd367e7dbf2886fcbd107089c5', class: {
509
+ 'sd-table__wrapper': true,
510
+ 'sd-table__wrapper--loading': this.isLoading,
511
+ 'sd-table__wrapper--no-data': this.rowCount === 0 && !this.isLoading,
512
+ } }, this.isLoading && (h("div", { key: 'edabfb6b601cfad985e3b8614d603f2df1da8f98', class: "sd-table__loading", style: { top: `${this.loadingScrollTop}px` } }, h("sd-circle-progress", { key: '40de9b2b97407523d1b02b97f208682e4946be66', indeterminate: true }))), this.rowCount === 0 && !this.isLoading && (h("div", { key: 'fe0d54f45a2a0a8ca1cc6552a42c7725ecd84c99', class: "sd-table__no-data" }, h("slot", { key: 'f64d232d1b3bd69d7c43a5170d06e73cbc586226', name: "no-data" }, h("span", { key: '71f5dcf2e5af2403032bdefd19a3cc4793a823e9' }, this.resolvedNoDataLabel)))), h("table", { key: 'e32c9f96523db174a57efffa584237836a67214a', class: this.tableClasses }, h("slot", { key: 'ce5e49454ac9044d6b3fcf3ac51809bb1e5465f8', name: `${resolvedTableId}-head`, onSlotchange: this.handleStructureSlotChange }), h("slot", { key: '800b45ddc05aac02cf8827b31beca5d0f363b55f', name: `${resolvedTableId}-body`, onSlotchange: this.handleStructureSlotChange })))), this.pagination &&
513
+ this.pagination.rowsPerPage > 0 &&
514
+ this.rowCount > 0 &&
515
+ !this.useVirtualScroll && (h("div", { key: 'ea2afbe59f7b249d3f4e9d9763ab402438e47008', class: "sd-table__pagination" }, h("sd-pagination", { key: 'a64223b9d2374142cbf12ec582e580f1b9f8f8dc', 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-v2", { key: '597cd596ac0ce2752ab6fc792887ce447c863eb8', value: this.useInternalPagination
516
+ ? this.innerRowsPerPage
517
+ : this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", emitValue: true, onSdUpdate: e => {
518
+ if (!this.isRowsPerPageValue(e.detail))
519
+ return;
520
+ this.changeRowsPerPage(e.detail);
521
+ } })))))));
772
522
  }
773
523
  static get is() { return "sd-table"; }
524
+ static get encapsulation() { return "shadow"; }
774
525
  static get originalStyleUrls() {
775
526
  return {
776
527
  "$": ["sd-table.scss"]
@@ -783,6 +534,26 @@ export class SdTable {
783
534
  }
784
535
  static get properties() {
785
536
  return {
537
+ "tableId": {
538
+ "type": "string",
539
+ "mutable": false,
540
+ "complexType": {
541
+ "original": "string",
542
+ "resolved": "string",
543
+ "references": {}
544
+ },
545
+ "required": false,
546
+ "optional": false,
547
+ "docs": {
548
+ "tags": [],
549
+ "text": ""
550
+ },
551
+ "getter": false,
552
+ "setter": false,
553
+ "reflect": true,
554
+ "attribute": "table-id",
555
+ "defaultValue": "nanoid(8)"
556
+ },
786
557
  "columns": {
787
558
  "type": "unknown",
788
559
  "mutable": false,
@@ -791,37 +562,40 @@ export class SdTable {
791
562
  "resolved": "SdTableColumn[]",
792
563
  "references": {
793
564
  "SdTableColumn": {
794
- "location": "local",
795
- "path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
796
- "id": "src/components/sd-table/sd-table.tsx::SdTableColumn"
565
+ "location": "import",
566
+ "path": "./constants",
567
+ "id": "src/components/sd-table/constants.ts::SdTableColumn",
568
+ "referenceLocation": "SdTableColumn"
797
569
  }
798
570
  }
799
571
  },
800
- "required": true,
572
+ "required": false,
801
573
  "optional": false,
802
574
  "docs": {
803
575
  "tags": [],
804
576
  "text": ""
805
577
  },
806
578
  "getter": false,
807
- "setter": false
579
+ "setter": false,
580
+ "defaultValue": "[]"
808
581
  },
809
582
  "rows": {
810
583
  "type": "unknown",
811
- "mutable": true,
584
+ "mutable": false,
812
585
  "complexType": {
813
586
  "original": "Row[]",
814
- "resolved": "Row[]",
587
+ "resolved": "Row[] | undefined",
815
588
  "references": {
816
589
  "Row": {
817
- "location": "local",
818
- "path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
819
- "id": "src/components/sd-table/sd-table.tsx::Row"
590
+ "location": "import",
591
+ "path": "./constants",
592
+ "id": "src/components/sd-table/constants.ts::Row",
593
+ "referenceLocation": "Row"
820
594
  }
821
595
  }
822
596
  },
823
- "required": true,
824
- "optional": false,
597
+ "required": false,
598
+ "optional": true,
825
599
  "docs": {
826
600
  "tags": [],
827
601
  "text": ""
@@ -837,9 +611,10 @@ export class SdTable {
837
611
  "resolved": "Row[]",
838
612
  "references": {
839
613
  "Row": {
840
- "location": "local",
841
- "path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
842
- "id": "src/components/sd-table/sd-table.tsx::Row"
614
+ "location": "import",
615
+ "path": "./constants",
616
+ "id": "src/components/sd-table/constants.ts::Row",
617
+ "referenceLocation": "Row"
843
618
  }
844
619
  }
845
620
  },
@@ -975,9 +750,16 @@ export class SdTable {
975
750
  "type": "unknown",
976
751
  "mutable": false,
977
752
  "complexType": {
978
- "original": "{ left?: number; right?: number }",
979
- "resolved": "{ left?: number | undefined; right?: number | undefined; }",
980
- "references": {}
753
+ "original": "SdTableStickyColumn",
754
+ "resolved": "SdTableStickyColumn",
755
+ "references": {
756
+ "SdTableStickyColumn": {
757
+ "location": "import",
758
+ "path": "./constants",
759
+ "id": "src/components/sd-table/constants.ts::SdTableStickyColumn",
760
+ "referenceLocation": "SdTableStickyColumn"
761
+ }
762
+ }
981
763
  },
982
764
  "required": false,
983
765
  "optional": false,
@@ -1007,7 +789,7 @@ export class SdTable {
1007
789
  "setter": false,
1008
790
  "reflect": false,
1009
791
  "attribute": "no-data-label",
1010
- "defaultValue": "'\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.'"
792
+ "defaultValue": "SdTable.DEFAULT_NO_DATA_LABEL"
1011
793
  },
1012
794
  "isLoading": {
1013
795
  "type": "boolean",
@@ -1033,9 +815,16 @@ export class SdTable {
1033
815
  "type": "unknown",
1034
816
  "mutable": false,
1035
817
  "complexType": {
1036
- "original": "{\n page: number;\n rowsPerPage: number;\n lastPage?: number;\n }",
1037
- "resolved": "undefined | { page: number; rowsPerPage: number; lastPage?: number | undefined; }",
1038
- "references": {}
818
+ "original": "SdTablePagination",
819
+ "resolved": "SdTablePagination | undefined",
820
+ "references": {
821
+ "SdTablePagination": {
822
+ "location": "import",
823
+ "path": "./constants",
824
+ "id": "src/components/sd-table/constants.ts::SdTablePagination",
825
+ "referenceLocation": "SdTablePagination"
826
+ }
827
+ }
1039
828
  },
1040
829
  "required": false,
1041
830
  "optional": true,
@@ -1086,20 +875,13 @@ export class SdTable {
1086
875
  "attribute": "use-rows-per-page-select",
1087
876
  "defaultValue": "false"
1088
877
  },
1089
- "rowsPerPageOption": {
1090
- "type": "unknown",
878
+ "useVirtualScroll": {
879
+ "type": "boolean",
1091
880
  "mutable": false,
1092
881
  "complexType": {
1093
- "original": "SelectOption[]",
1094
- "resolved": "SelectOption[]",
1095
- "references": {
1096
- "SelectOption": {
1097
- "location": "import",
1098
- "path": "../sd-select/sd-select",
1099
- "id": "src/components/sd-select/sd-select.tsx::SelectOption",
1100
- "referenceLocation": "SelectOption"
1101
- }
1102
- }
882
+ "original": "boolean",
883
+ "resolved": "boolean",
884
+ "references": {}
1103
885
  },
1104
886
  "required": false,
1105
887
  "optional": false,
@@ -1109,14 +891,16 @@ export class SdTable {
1109
891
  },
1110
892
  "getter": false,
1111
893
  "setter": false,
1112
- "defaultValue": "[\n { label: '10\uAC1C\uC529 \uBCF4\uAE30', value: 10 },\n { label: '25\uAC1C\uC529 \uBCF4\uAE30', value: 25 },\n { label: '50\uAC1C\uC529 \uBCF4\uAE30', value: 50 },\n { label: '100\uAC1C\uC529 \uBCF4\uAE30', value: 100 },\n ]"
894
+ "reflect": false,
895
+ "attribute": "use-virtual-scroll",
896
+ "defaultValue": "false"
1113
897
  },
1114
- "useVirtualScroll": {
1115
- "type": "unknown",
898
+ "rowHeight": {
899
+ "type": "number",
1116
900
  "mutable": false,
1117
901
  "complexType": {
1118
- "original": "{ vertical?: boolean; horizontal?: boolean }",
1119
- "resolved": "{ vertical?: boolean | undefined; horizontal?: boolean | undefined; }",
902
+ "original": "number",
903
+ "resolved": "number",
1120
904
  "references": {}
1121
905
  },
1122
906
  "required": false,
@@ -1127,9 +911,11 @@ export class SdTable {
1127
911
  },
1128
912
  "getter": false,
1129
913
  "setter": false,
1130
- "defaultValue": "{}"
914
+ "reflect": false,
915
+ "attribute": "row-height",
916
+ "defaultValue": "40"
1131
917
  },
1132
- "virtualRowHeight": {
918
+ "virtualBuffer": {
1133
919
  "type": "number",
1134
920
  "mutable": false,
1135
921
  "complexType": {
@@ -1146,10 +932,10 @@ export class SdTable {
1146
932
  "getter": false,
1147
933
  "setter": false,
1148
934
  "reflect": false,
1149
- "attribute": "virtual-row-height",
1150
- "defaultValue": "44"
935
+ "attribute": "virtual-buffer",
936
+ "defaultValue": "5"
1151
937
  },
1152
- "virtualColumnWidth": {
938
+ "virtualEndThreshold": {
1153
939
  "type": "number",
1154
940
  "mutable": false,
1155
941
  "complexType": {
@@ -1166,16 +952,23 @@ export class SdTable {
1166
952
  "getter": false,
1167
953
  "setter": false,
1168
954
  "reflect": false,
1169
- "attribute": "virtual-column-width",
1170
- "defaultValue": "120"
955
+ "attribute": "virtual-end-threshold",
956
+ "defaultValue": "10"
1171
957
  },
1172
- "virtualBufferSize": {
958
+ "rowsPerPageOption": {
1173
959
  "type": "unknown",
1174
960
  "mutable": false,
1175
961
  "complexType": {
1176
- "original": "{ vertical?: number; horizontal?: number }",
1177
- "resolved": "{ vertical?: number | undefined; horizontal?: number | undefined; }",
1178
- "references": {}
962
+ "original": "SelectOption[]",
963
+ "resolved": "SelectOption[]",
964
+ "references": {
965
+ "SelectOption": {
966
+ "location": "import",
967
+ "path": "./constants",
968
+ "id": "src/components/sd-table/constants.ts::SelectOption",
969
+ "referenceLocation": "SelectOption"
970
+ }
971
+ }
1179
972
  },
1180
973
  "required": false,
1181
974
  "optional": false,
@@ -1185,24 +978,21 @@ export class SdTable {
1185
978
  },
1186
979
  "getter": false,
1187
980
  "setter": false,
1188
- "defaultValue": "{\n vertical: 5,\n horizontal: 5,\n }"
981
+ "defaultValue": "[\n { label: '10\uAC1C\uC529 \uBCF4\uAE30', value: 10 },\n { label: '25\uAC1C\uC529 \uBCF4\uAE30', value: 25 },\n { label: '50\uAC1C\uC529 \uBCF4\uAE30', value: 50 },\n { label: '100\uAC1C\uC529 \uBCF4\uAE30', value: 100 },\n ]"
1189
982
  }
1190
983
  };
1191
984
  }
1192
985
  static get states() {
1193
986
  return {
987
+ "resolvedNoDataLabel": {},
1194
988
  "currentPage": {},
1195
- "innerRows": {},
989
+ "innerRowsPerPage": {},
1196
990
  "innerSelected": {},
1197
991
  "columnWidths": {},
1198
992
  "scrolledLeft": {},
1199
993
  "scrolledRight": {},
1200
- "virtualStartIndex": {},
1201
- "virtualEndIndex": {},
1202
- "scrollTopPosition": {},
1203
- "virtualStartColIdx": {},
1204
- "virtualEndColIdx": {},
1205
- "scrollLeftPosition": {}
994
+ "rowCount": {},
995
+ "loadingScrollTop": {}
1206
996
  };
1207
997
  }
1208
998
  static get events() {
@@ -1221,9 +1011,10 @@ export class SdTable {
1221
1011
  "resolved": "Row[]",
1222
1012
  "references": {
1223
1013
  "Row": {
1224
- "location": "local",
1225
- "path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
1226
- "id": "src/components/sd-table/sd-table.tsx::Row"
1014
+ "location": "import",
1015
+ "path": "./constants",
1016
+ "id": "src/components/sd-table/constants.ts::Row",
1017
+ "referenceLocation": "Row"
1227
1018
  }
1228
1019
  }
1229
1020
  }
@@ -1257,31 +1048,245 @@ export class SdTable {
1257
1048
  "resolved": "number",
1258
1049
  "references": {}
1259
1050
  }
1051
+ }, {
1052
+ "method": "sdVirtualUpdate",
1053
+ "name": "sdVirtualUpdate",
1054
+ "bubbles": true,
1055
+ "cancelable": true,
1056
+ "composed": true,
1057
+ "docs": {
1058
+ "tags": [],
1059
+ "text": ""
1060
+ },
1061
+ "complexType": {
1062
+ "original": "{\n from: number;\n to: number;\n }",
1063
+ "resolved": "{ from: number; to: number; }",
1064
+ "references": {}
1065
+ }
1066
+ }, {
1067
+ "method": "sdVirtualReachEnd",
1068
+ "name": "sdVirtualReachEnd",
1069
+ "bubbles": true,
1070
+ "cancelable": true,
1071
+ "composed": true,
1072
+ "docs": {
1073
+ "tags": [],
1074
+ "text": ""
1075
+ },
1076
+ "complexType": {
1077
+ "original": "{\n from: number;\n to: number;\n rowCount: number;\n threshold: number;\n }",
1078
+ "resolved": "{ from: number; to: number; rowCount: number; threshold: number; }",
1079
+ "references": {}
1080
+ }
1260
1081
  }];
1261
1082
  }
1083
+ static get methods() {
1084
+ return {
1085
+ "isRowSelected": {
1086
+ "complexType": {
1087
+ "signature": "(row: Row) => Promise<boolean>",
1088
+ "parameters": [{
1089
+ "name": "row",
1090
+ "type": "Row",
1091
+ "docs": ""
1092
+ }],
1093
+ "references": {
1094
+ "Promise": {
1095
+ "location": "global",
1096
+ "id": "global::Promise"
1097
+ },
1098
+ "Row": {
1099
+ "location": "import",
1100
+ "path": "./constants",
1101
+ "id": "src/components/sd-table/constants.ts::Row",
1102
+ "referenceLocation": "Row"
1103
+ }
1104
+ },
1105
+ "return": "Promise<boolean>"
1106
+ },
1107
+ "docs": {
1108
+ "text": "",
1109
+ "tags": []
1110
+ }
1111
+ },
1112
+ "updateRowSelect": {
1113
+ "complexType": {
1114
+ "signature": "(row: Row) => Promise<void>",
1115
+ "parameters": [{
1116
+ "name": "row",
1117
+ "type": "Row",
1118
+ "docs": ""
1119
+ }],
1120
+ "references": {
1121
+ "Promise": {
1122
+ "location": "global",
1123
+ "id": "global::Promise"
1124
+ },
1125
+ "Row": {
1126
+ "location": "import",
1127
+ "path": "./constants",
1128
+ "id": "src/components/sd-table/constants.ts::Row",
1129
+ "referenceLocation": "Row"
1130
+ }
1131
+ },
1132
+ "return": "Promise<void>"
1133
+ },
1134
+ "docs": {
1135
+ "text": "",
1136
+ "tags": []
1137
+ }
1138
+ },
1139
+ "toggleSelectAll": {
1140
+ "complexType": {
1141
+ "signature": "(checked: boolean, rows: Row[]) => Promise<void>",
1142
+ "parameters": [{
1143
+ "name": "checked",
1144
+ "type": "boolean",
1145
+ "docs": ""
1146
+ }, {
1147
+ "name": "rows",
1148
+ "type": "Row[]",
1149
+ "docs": ""
1150
+ }],
1151
+ "references": {
1152
+ "Promise": {
1153
+ "location": "global",
1154
+ "id": "global::Promise"
1155
+ },
1156
+ "Row": {
1157
+ "location": "import",
1158
+ "path": "./constants",
1159
+ "id": "src/components/sd-table/constants.ts::Row",
1160
+ "referenceLocation": "Row"
1161
+ }
1162
+ },
1163
+ "return": "Promise<void>"
1164
+ },
1165
+ "docs": {
1166
+ "text": "",
1167
+ "tags": []
1168
+ }
1169
+ },
1170
+ "getIsAllChecked": {
1171
+ "complexType": {
1172
+ "signature": "(rows: Row[]) => Promise<boolean | null>",
1173
+ "parameters": [{
1174
+ "name": "rows",
1175
+ "type": "Row[]",
1176
+ "docs": ""
1177
+ }],
1178
+ "references": {
1179
+ "Promise": {
1180
+ "location": "global",
1181
+ "id": "global::Promise"
1182
+ },
1183
+ "Row": {
1184
+ "location": "import",
1185
+ "path": "./constants",
1186
+ "id": "src/components/sd-table/constants.ts::Row",
1187
+ "referenceLocation": "Row"
1188
+ }
1189
+ },
1190
+ "return": "Promise<boolean | null>"
1191
+ },
1192
+ "docs": {
1193
+ "text": "",
1194
+ "tags": []
1195
+ }
1196
+ },
1197
+ "getStickyStyle": {
1198
+ "complexType": {
1199
+ "signature": "(colIdx: number) => Promise<{ '--sticky-left-offset': string; '--sticky-right-offset': string; width: string; minWidth: string; maxWidth: string; }>",
1200
+ "parameters": [{
1201
+ "name": "colIdx",
1202
+ "type": "number",
1203
+ "docs": ""
1204
+ }],
1205
+ "references": {
1206
+ "Promise": {
1207
+ "location": "global",
1208
+ "id": "global::Promise"
1209
+ }
1210
+ },
1211
+ "return": "Promise<{ '--sticky-left-offset': string; '--sticky-right-offset': string; width: string; minWidth: string; maxWidth: string; }>"
1212
+ },
1213
+ "docs": {
1214
+ "text": "",
1215
+ "tags": []
1216
+ }
1217
+ },
1218
+ "setRowCount": {
1219
+ "complexType": {
1220
+ "signature": "(count: number) => Promise<void>",
1221
+ "parameters": [{
1222
+ "name": "count",
1223
+ "type": "number",
1224
+ "docs": ""
1225
+ }],
1226
+ "references": {
1227
+ "Promise": {
1228
+ "location": "global",
1229
+ "id": "global::Promise"
1230
+ }
1231
+ },
1232
+ "return": "Promise<void>"
1233
+ },
1234
+ "docs": {
1235
+ "text": "",
1236
+ "tags": []
1237
+ }
1238
+ },
1239
+ "getPaginationInfo": {
1240
+ "complexType": {
1241
+ "signature": "() => Promise<{ startIndex: number; endIndex: number; currentPage: number; rowsPerPage: number; } | null>",
1242
+ "parameters": [],
1243
+ "references": {
1244
+ "Promise": {
1245
+ "location": "global",
1246
+ "id": "global::Promise"
1247
+ }
1248
+ },
1249
+ "return": "Promise<{ startIndex: number; endIndex: number; currentPage: number; rowsPerPage: number; } | null>"
1250
+ },
1251
+ "docs": {
1252
+ "text": "",
1253
+ "tags": []
1254
+ }
1255
+ }
1256
+ };
1257
+ }
1262
1258
  static get elementRef() { return "el"; }
1263
1259
  static get watchers() {
1264
1260
  return [{
1265
- "propName": "columns",
1266
- "methodName": "handleColumnsChange"
1261
+ "propName": "isLoading",
1262
+ "methodName": "handleIsLoadingChange"
1267
1263
  }, {
1268
1264
  "propName": "useVirtualScroll",
1269
1265
  "methodName": "handleUseVirtualScrollChange"
1270
1266
  }, {
1271
- "propName": "virtualColumnWidth",
1272
- "methodName": "handleVirtualColumnWidthChange"
1267
+ "propName": "columns",
1268
+ "methodName": "handleColumnsChange"
1269
+ }, {
1270
+ "propName": "rows",
1271
+ "methodName": "handleRowsChange"
1272
+ }, {
1273
+ "propName": "tableId",
1274
+ "methodName": "handleTableIdChange"
1275
+ }, {
1276
+ "propName": "noDataLabel",
1277
+ "methodName": "handleNoDataLabelChange"
1273
1278
  }, {
1274
1279
  "propName": "selectable",
1275
- "methodName": "handleSelectableChange"
1280
+ "methodName": "handleConfigChange"
1276
1281
  }, {
1277
- "propName": "stickyColumn",
1278
- "methodName": "handleStickyColumnChange"
1282
+ "propName": "resizable",
1283
+ "methodName": "handleConfigChange"
1279
1284
  }, {
1280
- "propName": "columnWidths",
1281
- "methodName": "handleColumnWidthsChange"
1285
+ "propName": "stickyColumn",
1286
+ "methodName": "handleConfigChange"
1282
1287
  }, {
1283
- "propName": "rows",
1284
- "methodName": "handleRowsChange"
1288
+ "propName": "stickyHeader",
1289
+ "methodName": "handleConfigChange"
1285
1290
  }, {
1286
1291
  "propName": "selected",
1287
1292
  "methodName": "handleSelectedChange"