@sellmate/design-system 1.27.1 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/dist/cjs/{component.datepicker-CUQbDSku.js → component.datepicker-zFTQQKMH.js} +1 -2
  2. package/dist/cjs/component.listBox-MHAv4Yy7.js +15 -0
  3. package/dist/cjs/{component.listItem-Bnh0r_CA.js → component.listItem-cAO_ppOz.js} +0 -7
  4. package/dist/cjs/design-system.cjs.js +2 -2
  5. package/dist/cjs/{index-DsYLSqCp.js → index-iiJZMzVM.js} +1 -15
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/sd-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
  10. package/dist/cjs/sd-button_2.cjs.entry.js +1 -1
  11. package/dist/cjs/sd-calendar_2.cjs.entry.js +6 -6
  12. package/dist/cjs/sd-callout.cjs.entry.js +1 -1
  13. package/dist/cjs/sd-card.cjs.entry.js +1 -1
  14. package/dist/cjs/sd-checkbox.cjs.entry.js +2 -3
  15. package/dist/cjs/sd-chip-input.cjs.entry.js +5 -4
  16. package/dist/cjs/sd-chip.cjs.entry.js +1 -1
  17. package/dist/cjs/sd-circle-progress.cjs.entry.js +6 -4
  18. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +37 -37
  19. package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
  20. package/dist/cjs/{sd-date-picker.config-De7ahWIs.js → sd-date-picker.config-Chrd8c4v.js} +1 -1
  21. package/dist/cjs/{sd-date-picker_7.cjs.entry.js → sd-date-picker_8.cjs.entry.js} +381 -19
  22. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +4 -4
  23. package/dist/cjs/sd-divider.cjs.entry.js +3 -3
  24. package/dist/cjs/sd-dropdown-button.cjs.entry.js +2 -2
  25. package/dist/cjs/sd-field_3.cjs.entry.js +10 -10
  26. package/dist/cjs/sd-form.cjs.entry.js +1 -1
  27. package/dist/cjs/sd-ghost-button_3.cjs.entry.js +4 -5
  28. package/dist/cjs/sd-guide.cjs.entry.js +5 -10
  29. package/dist/cjs/sd-key-value-table.cjs.entry.js +88 -18
  30. package/dist/cjs/sd-linear-progress.cjs.entry.js +3 -3
  31. package/dist/cjs/sd-loading-container.cjs.entry.js +3 -3
  32. package/dist/cjs/sd-modal-container.cjs.entry.js +16 -2
  33. package/dist/cjs/sd-pagination.cjs.entry.js +173 -0
  34. package/dist/cjs/sd-popover.cjs.entry.js +2 -2
  35. package/dist/cjs/sd-popup.cjs.entry.js +3 -3
  36. package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/sd-radio.cjs.entry.js +2 -3
  38. package/dist/cjs/{sd-select_3.cjs.entry.js → sd-select-list-item_4.cjs.entry.js} +294 -314
  39. package/dist/cjs/sd-switch.cjs.entry.js +2 -2
  40. package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
  41. package/dist/cjs/sd-text-link.cjs.entry.js +1 -1
  42. package/dist/cjs/sd-toast-container.cjs.entry.js +2 -2
  43. package/dist/cjs/sd-toast.cjs.entry.js +3 -3
  44. package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
  45. package/dist/cjs/{system-MjrAugX-.js → system-B4KkVpu2.js} +1 -7
  46. package/dist/cjs/{tooltipArrow-FLiD3ceS.js → tooltipArrow-DOOcBlLp.js} +1 -1
  47. package/dist/cjs/{useDatePicker-iMd6WToc.js → useDatePicker-CgpIfwLA.js} +1 -1
  48. package/dist/collection/collection-manifest.json +0 -5
  49. package/dist/collection/components/sd-circle-progress/sd-circle-progress.css +13 -0
  50. package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +23 -1
  51. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +3 -0
  52. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +35 -59
  53. package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
  54. package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
  55. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
  56. package/dist/collection/components/sd-divider/sd-divider.js +1 -1
  57. package/dist/collection/components/sd-field/sd-field.js +4 -4
  58. package/dist/collection/components/sd-file-picker/sd-file-picker.config.js +9 -0
  59. package/dist/collection/components/sd-file-picker/sd-file-picker.css +18 -0
  60. package/dist/collection/components/sd-file-picker/sd-file-picker.js +73 -7
  61. package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +1 -1
  62. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  63. package/dist/collection/components/sd-guide/sd-guide.config.js +0 -1
  64. package/dist/collection/components/sd-guide/sd-guide.css +0 -3
  65. package/dist/collection/components/sd-guide/sd-guide.js +2 -3
  66. package/dist/collection/components/sd-input/sd-input.js +2 -2
  67. package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +2 -0
  68. package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +5 -1
  69. package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +65 -15
  70. package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
  71. package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
  72. package/dist/collection/components/sd-loading-modal/sd-loading-modal.css +7 -0
  73. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +18 -1
  74. package/dist/collection/components/sd-modal-container/sd-modal-container.js +15 -1
  75. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  76. package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
  77. package/dist/collection/components/sd-popup/sd-popup.js +1 -1
  78. package/dist/collection/components/sd-radio-group/sd-radio-group.css +2 -2
  79. package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
  80. package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
  81. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
  82. package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
  83. package/dist/collection/components/sd-select/sd-select.js +4 -4
  84. package/dist/collection/components/sd-switch/sd-switch.js +1 -1
  85. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  86. package/dist/collection/components/sd-tag/sd-tag.js +2 -2
  87. package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
  88. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  89. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  90. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  91. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  92. package/dist/components/index.js +1 -1
  93. package/dist/components/p-4S0_Ykmo.js +1 -0
  94. package/dist/components/{p-Dy6LmOzw.js → p-9Ap2W-Mi.js} +1 -1
  95. package/dist/components/{p-NeXvaRu7.js → p-BFVfSW9t.js} +1 -1
  96. package/dist/components/{p-Du_Yc-lW.js → p-BHjezpAC.js} +1 -1
  97. package/dist/components/{p-DnxEeX9I.js → p-BIEPMPWA.js} +1 -1
  98. package/dist/components/{p--AZbwi7P.js → p-BKu0I6Io.js} +1 -1
  99. package/dist/components/{p-DTb2c83G.js → p-B_Zwr4Et.js} +1 -1
  100. package/dist/components/{p-BysikR_g.js → p-Bpv90tfa.js} +1 -1
  101. package/dist/components/p-Bth2l1cy.js +1 -0
  102. package/dist/components/{p-Cok_EW_N.js → p-C7mC7a1z.js} +1 -1
  103. package/dist/components/{p-CIPPETF-.js → p-CBoDoYDO.js} +1 -1
  104. package/dist/components/p-CErFctrV.js +1 -0
  105. package/dist/components/{p-SROa9QCy.js → p-CFTyEfB9.js} +1 -1
  106. package/dist/components/{p-BaRjXqSM.js → p-CSr33M9s.js} +1 -1
  107. package/dist/components/p-CYMMLsGt.js +1 -0
  108. package/dist/components/{p-CvSPsoRb.js → p-C_SG4M4z.js} +1 -1
  109. package/dist/components/{p-BV4cnHWn.js → p-C_in6AVN.js} +1 -1
  110. package/dist/components/{p-DsQQFJ8o.js → p-CbS69IvC.js} +1 -1
  111. package/dist/components/{p-BOJALVxB.js → p-CgSXYw_0.js} +1 -1
  112. package/dist/components/{p-DVq9oE_p.js → p-CmRF12Fy.js} +1 -1
  113. package/dist/components/p-CnRfET5y.js +1 -0
  114. package/dist/components/{p-BFy8txYj.js → p-Cvsrc0be.js} +1 -1
  115. package/dist/components/{p-PvltLPHp.js → p-DJ8z7_EG.js} +1 -1
  116. package/dist/components/{p-CwwJD-NF.js → p-DJmxpVkK.js} +1 -1
  117. package/dist/components/{p-D7XGOtx0.js → p-DMoFncVl.js} +1 -1
  118. package/dist/components/{p-BxphFsxh.js → p-DN7MAx-q.js} +1 -1
  119. package/dist/components/{p-hP1aeMuZ.js → p-DS6NVBvu.js} +1 -1
  120. package/dist/components/{p-Bk6aI8rL.js → p-D_56BjcD.js} +1 -1
  121. package/dist/components/{p-DMrzTImA.js → p-Dg1UrMqI.js} +1 -1
  122. package/dist/components/{p-BU1H7ElF.js → p-Di1q4f5E.js} +1 -1
  123. package/dist/components/p-DlJaYVWf.js +1 -0
  124. package/dist/components/p-OO7xxhkC.js +1 -0
  125. package/dist/components/{p-DYp8I4VH.js → p-R-Sdglj0.js} +1 -1
  126. package/dist/components/p-Uh9emYrV.js +1 -0
  127. package/dist/components/{p-DkaajrxX.js → p-f0aBxUBG.js} +1 -1
  128. package/dist/components/{p-DT-e9J59.js → p-idG6CMO0.js} +1 -1
  129. package/dist/components/p-oYbVr-z0.js +1 -0
  130. package/dist/components/p-x9AWBHPy.js +1 -0
  131. package/dist/components/sd-action-modal.js +1 -1
  132. package/dist/components/sd-badge.js +1 -1
  133. package/dist/components/sd-barcode-input.js +1 -1
  134. package/dist/components/sd-button.js +1 -1
  135. package/dist/components/sd-calendar.js +1 -1
  136. package/dist/components/sd-callout.js +1 -1
  137. package/dist/components/sd-card.js +1 -1
  138. package/dist/components/sd-checkbox.js +1 -1
  139. package/dist/components/sd-chip-input.js +1 -1
  140. package/dist/components/sd-chip.js +1 -1
  141. package/dist/components/sd-circle-progress.js +1 -1
  142. package/dist/components/sd-confirm-modal.js +1 -1
  143. package/dist/components/sd-date-box.js +1 -1
  144. package/dist/components/sd-date-picker-trigger.js +1 -1
  145. package/dist/components/sd-date-picker.js +1 -1
  146. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  147. package/dist/components/sd-date-range-picker.js +1 -1
  148. package/dist/components/sd-divider.js +1 -1
  149. package/dist/components/sd-dropdown-button.js +1 -1
  150. package/dist/components/sd-field.js +1 -1
  151. package/dist/components/sd-file-picker.js +1 -1
  152. package/dist/components/sd-floating-portal.js +1 -1
  153. package/dist/components/sd-form.js +1 -1
  154. package/dist/components/sd-ghost-button.js +1 -1
  155. package/dist/components/sd-guide.js +1 -1
  156. package/dist/components/sd-icon.js +1 -1
  157. package/dist/components/sd-input.js +1 -1
  158. package/dist/components/sd-key-value-table.js +1 -1
  159. package/dist/components/sd-linear-progress.js +1 -1
  160. package/dist/components/sd-loading-container.js +1 -1
  161. package/dist/components/sd-loading-modal.js +1 -1
  162. package/dist/components/sd-modal-container.js +1 -1
  163. package/dist/components/sd-number-input.js +1 -1
  164. package/dist/components/sd-pagination.js +1 -1
  165. package/dist/components/sd-popover.js +1 -1
  166. package/dist/components/sd-popup.js +1 -1
  167. package/dist/components/sd-portal.js +1 -1
  168. package/dist/components/sd-radio-button.js +1 -1
  169. package/dist/components/sd-radio-group.js +1 -1
  170. package/dist/components/sd-radio.js +1 -1
  171. package/dist/components/sd-select-list-item-search.js +1 -1
  172. package/dist/components/sd-select-list-item.js +1 -1
  173. package/dist/components/sd-select-listbox.js +1 -1
  174. package/dist/components/sd-select-trigger.js +1 -1
  175. package/dist/components/sd-select.js +1 -1
  176. package/dist/components/sd-switch.js +1 -1
  177. package/dist/components/sd-tabs.js +1 -1
  178. package/dist/components/sd-tag.js +1 -1
  179. package/dist/components/sd-text-link.js +1 -1
  180. package/dist/components/sd-textarea.js +1 -1
  181. package/dist/components/sd-toast-container.js +1 -1
  182. package/dist/components/sd-toast.js +1 -1
  183. package/dist/components/sd-toggle.js +1 -1
  184. package/dist/components/sd-tooltip.js +1 -1
  185. package/dist/design-system/design-system.css +1 -1
  186. package/dist/design-system/design-system.esm.js +1 -1
  187. package/dist/design-system/{p-ddb9a2c4.entry.js → p-02f0b906.entry.js} +1 -1
  188. package/dist/design-system/{p-a4e1dd8c.entry.js → p-0c1d1a15.entry.js} +1 -1
  189. package/dist/design-system/{p-cb0cbcb0.entry.js → p-0e014b76.entry.js} +1 -1
  190. package/dist/design-system/{p-49b1636a.entry.js → p-1b5fcf7b.entry.js} +1 -1
  191. package/dist/design-system/{p-5aa5aec3.entry.js → p-1ed1bfa1.entry.js} +1 -1
  192. package/dist/design-system/{p-8c1a9374.entry.js → p-246aafb9.entry.js} +1 -1
  193. package/dist/design-system/p-26a27312.entry.js +1 -0
  194. package/dist/design-system/{p-d790fbb8.entry.js → p-2a4d2ee0.entry.js} +1 -1
  195. package/dist/design-system/{p-270c8529.entry.js → p-2d6a7d7b.entry.js} +1 -1
  196. package/dist/design-system/{p-947dcc28.entry.js → p-3595cafb.entry.js} +1 -1
  197. package/dist/design-system/p-3cd2751a.entry.js +1 -0
  198. package/dist/design-system/p-4S0_Ykmo.js +1 -0
  199. package/dist/design-system/p-4b474538.entry.js +1 -0
  200. package/dist/design-system/{p-e63bf0e1.entry.js → p-4c85f6f6.entry.js} +1 -1
  201. package/dist/design-system/{p-55c8ce37.entry.js → p-53fe2741.entry.js} +1 -1
  202. package/dist/design-system/{p-06b56059.entry.js → p-55c0be7d.entry.js} +1 -1
  203. package/dist/design-system/p-5a257ed9.entry.js +1 -0
  204. package/dist/design-system/{p-459a408f.entry.js → p-840006b1.entry.js} +1 -1
  205. package/dist/design-system/{p-dae6914d.entry.js → p-86329ae3.entry.js} +1 -1
  206. package/dist/design-system/{p-8ac340db.entry.js → p-8de3b502.entry.js} +1 -1
  207. package/dist/design-system/{p-9603971e.entry.js → p-8ed1d470.entry.js} +1 -1
  208. package/dist/design-system/{p-D2S9Zafz.js → p-B91K50wC.js} +1 -1
  209. package/dist/design-system/{p-BqWuC4-J.js → p-BPKiBSGr.js} +1 -1
  210. package/dist/design-system/p-BhcvMs8c.js +1 -0
  211. package/dist/design-system/p-Bth2l1cy.js +1 -0
  212. package/dist/design-system/p-DlJaYVWf.js +1 -0
  213. package/dist/design-system/p-Dz490Ukt.js +2 -0
  214. package/dist/design-system/{p-761c008c.entry.js → p-a631cd78.entry.js} +1 -1
  215. package/dist/design-system/p-adf2f398.entry.js +1 -0
  216. package/dist/design-system/{p-26297c6e.entry.js → p-b585f94b.entry.js} +1 -1
  217. package/dist/design-system/p-be54fd3a.entry.js +1 -0
  218. package/dist/design-system/{p-7540f591.entry.js → p-c1066f40.entry.js} +1 -1
  219. package/dist/design-system/{p-b86a69ce.entry.js → p-c5cffcc6.entry.js} +1 -1
  220. package/dist/design-system/p-c7d2c195.entry.js +1 -0
  221. package/dist/design-system/{p-839e6b5a.entry.js → p-cb6ab65c.entry.js} +1 -1
  222. package/dist/design-system/{p-07755193.entry.js → p-d204cac5.entry.js} +1 -1
  223. package/dist/design-system/p-d2ce01ac.entry.js +1 -0
  224. package/dist/design-system/p-d51f4170.entry.js +1 -0
  225. package/dist/design-system/{p-dfa16f49.entry.js → p-d9f33192.entry.js} +1 -1
  226. package/dist/design-system/{p-b9387621.entry.js → p-e7740a5f.entry.js} +1 -1
  227. package/dist/design-system/p-e85bf462.entry.js +1 -0
  228. package/dist/design-system/{p-9c0d3011.entry.js → p-ea008087.entry.js} +1 -1
  229. package/dist/design-system/{p-5142cd06.entry.js → p-ec4ad48c.entry.js} +1 -1
  230. package/dist/design-system/{p-5f1dae23.entry.js → p-f962e5d2.entry.js} +1 -1
  231. package/dist/esm/{component.datepicker-laVsm9VM.js → component.datepicker-BOxGhKKP.js} +1 -2
  232. package/dist/esm/component.listBox-DlJaYVWf.js +13 -0
  233. package/dist/esm/{component.listItem-U8VaRj9c.js → component.listItem-4S0_Ykmo.js} +1 -7
  234. package/dist/esm/design-system.js +3 -3
  235. package/dist/esm/{index-BZg-6aSz.js → index-Dz490Ukt.js} +2 -14
  236. package/dist/esm/loader.js +3 -3
  237. package/dist/esm/sd-action-modal.entry.js +1 -1
  238. package/dist/esm/sd-badge.entry.js +1 -1
  239. package/dist/esm/sd-barcode-input.entry.js +1 -1
  240. package/dist/esm/sd-button_2.entry.js +1 -1
  241. package/dist/esm/sd-calendar_2.entry.js +6 -6
  242. package/dist/esm/sd-callout.entry.js +1 -1
  243. package/dist/esm/sd-card.entry.js +1 -1
  244. package/dist/esm/sd-checkbox.entry.js +2 -3
  245. package/dist/esm/sd-chip-input.entry.js +4 -3
  246. package/dist/esm/sd-chip.entry.js +1 -1
  247. package/dist/esm/sd-circle-progress.entry.js +6 -4
  248. package/dist/esm/sd-confirm-modal_2.entry.js +37 -37
  249. package/dist/esm/sd-date-box.entry.js +1 -1
  250. package/dist/esm/{sd-date-picker.config-D-ks6qNf.js → sd-date-picker.config-krRuSUsA.js} +1 -1
  251. package/dist/esm/{sd-date-picker_7.entry.js → sd-date-picker_8.entry.js} +381 -20
  252. package/dist/esm/sd-date-range-picker-calendar.entry.js +4 -4
  253. package/dist/esm/sd-divider.entry.js +3 -3
  254. package/dist/esm/sd-dropdown-button.entry.js +2 -2
  255. package/dist/esm/sd-field_3.entry.js +10 -10
  256. package/dist/esm/sd-form.entry.js +1 -1
  257. package/dist/esm/sd-ghost-button_3.entry.js +4 -5
  258. package/dist/esm/sd-guide.entry.js +5 -10
  259. package/dist/esm/sd-key-value-table.entry.js +87 -17
  260. package/dist/esm/sd-linear-progress.entry.js +3 -3
  261. package/dist/esm/sd-loading-container.entry.js +3 -3
  262. package/dist/esm/sd-modal-container.entry.js +16 -2
  263. package/dist/esm/sd-pagination.entry.js +171 -0
  264. package/dist/esm/sd-popover.entry.js +2 -2
  265. package/dist/esm/sd-popup.entry.js +3 -3
  266. package/dist/esm/sd-radio-button.entry.js +1 -1
  267. package/dist/esm/sd-radio.entry.js +2 -3
  268. package/dist/esm/{sd-select_3.entry.js → sd-select-list-item_4.entry.js} +277 -298
  269. package/dist/esm/sd-switch.entry.js +2 -2
  270. package/dist/esm/sd-tabs.entry.js +2 -2
  271. package/dist/esm/sd-text-link.entry.js +1 -1
  272. package/dist/esm/sd-toast-container.entry.js +2 -2
  273. package/dist/esm/sd-toast.entry.js +3 -3
  274. package/dist/esm/sd-toggle.entry.js +2 -2
  275. package/dist/esm/{system-BJfiMC9H.js → system-Bth2l1cy.js} +1 -7
  276. package/dist/esm/{tooltipArrow-BAi-pktU.js → tooltipArrow-CEHVt90h.js} +1 -1
  277. package/dist/esm/{useDatePicker-DoUg--aq.js → useDatePicker-BG0lUGJG.js} +1 -1
  278. package/dist/types/components/sd-circle-progress/sd-circle-progress.d.ts +2 -0
  279. package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +10 -10
  280. package/dist/types/components/sd-file-picker/sd-file-picker.config.d.ts +6 -0
  281. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +10 -0
  282. package/dist/types/components/sd-guide/sd-guide.config.d.ts +0 -1
  283. package/dist/types/components/sd-key-value-table/sd-key-value-table.config.d.ts +22 -3
  284. package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +9 -1
  285. package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +2 -0
  286. package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +3 -0
  287. package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +2 -0
  288. package/dist/types/components.d.ts +44 -696
  289. package/dist/types/index.d.ts +0 -1
  290. package/hydrate/index.js +254 -2235
  291. package/hydrate/index.mjs +254 -2235
  292. package/package.json +1 -1
  293. package/dist/cjs/component.table-BrI3b--h.js +0 -71
  294. package/dist/cjs/constants-DJRV1upE.js +0 -5
  295. package/dist/cjs/sd-pagination_4.cjs.entry.js +0 -856
  296. package/dist/cjs/sd-select-list-item_2.cjs.entry.js +0 -172
  297. package/dist/cjs/sd-select.config-C9Ohe1QA.js +0 -143
  298. package/dist/cjs/sd-table.cjs.entry.js +0 -956
  299. package/dist/cjs/sd-table.config-DzC55sap.js +0 -82
  300. package/dist/cjs/sd-td.cjs.entry.js +0 -201
  301. package/dist/collection/components/sd-table/constants.js +0 -1
  302. package/dist/collection/components/sd-table/sd-table.config.js +0 -87
  303. package/dist/collection/components/sd-table/sd-table.css +0 -180
  304. package/dist/collection/components/sd-table/sd-table.js +0 -1709
  305. package/dist/collection/components/sd-table/sd-table.stories.helpers.js +0 -242
  306. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.css +0 -10
  307. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +0 -110
  308. package/dist/collection/components/sd-table/sd-td/sd-td.css +0 -15
  309. package/dist/collection/components/sd-table/sd-td/sd-td.js +0 -381
  310. package/dist/collection/components/sd-table/sd-thead/sd-thead.css +0 -186
  311. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +0 -629
  312. package/dist/collection/components/sd-table/sd-tr/sd-tr.css +0 -145
  313. package/dist/collection/components/sd-table/sd-tr/sd-tr.js +0 -528
  314. package/dist/components/p-BHNytAtJ.js +0 -1
  315. package/dist/components/p-BJfiMC9H.js +0 -1
  316. package/dist/components/p-BQqXWtI6.js +0 -1
  317. package/dist/components/p-BXcizROm.js +0 -1
  318. package/dist/components/p-BZdgdRXJ.js +0 -1
  319. package/dist/components/p-CJcs7kNH.js +0 -1
  320. package/dist/components/p-CV5LiFKt.js +0 -1
  321. package/dist/components/p-CiTn4ZiI.js +0 -1
  322. package/dist/components/p-CmK45nj3.js +0 -1
  323. package/dist/components/p-D9tQwTWy.js +0 -1
  324. package/dist/components/p-DeXLIS7e.js +0 -1
  325. package/dist/components/p-DmC83_E9.js +0 -1
  326. package/dist/components/p-DvvGi4J_.js +0 -1
  327. package/dist/components/p-U8VaRj9c.js +0 -1
  328. package/dist/components/p-jwusYvH0.js +0 -1
  329. package/dist/components/p-sZMi_32I.js +0 -1
  330. package/dist/components/sd-table.d.ts +0 -11
  331. package/dist/components/sd-table.js +0 -1
  332. package/dist/components/sd-tbody.d.ts +0 -11
  333. package/dist/components/sd-tbody.js +0 -1
  334. package/dist/components/sd-td.d.ts +0 -11
  335. package/dist/components/sd-td.js +0 -1
  336. package/dist/components/sd-thead.d.ts +0 -11
  337. package/dist/components/sd-thead.js +0 -1
  338. package/dist/components/sd-tr.d.ts +0 -11
  339. package/dist/components/sd-tr.js +0 -1
  340. package/dist/design-system/p-147e0413.entry.js +0 -1
  341. package/dist/design-system/p-51c7839c.entry.js +0 -1
  342. package/dist/design-system/p-5f5f2fbe.entry.js +0 -1
  343. package/dist/design-system/p-65285327.entry.js +0 -1
  344. package/dist/design-system/p-6aec5853.entry.js +0 -1
  345. package/dist/design-system/p-80abdfe7.entry.js +0 -1
  346. package/dist/design-system/p-9825e76c.entry.js +0 -1
  347. package/dist/design-system/p-B-LOf2aM.js +0 -1
  348. package/dist/design-system/p-BJfiMC9H.js +0 -1
  349. package/dist/design-system/p-BXcizROm.js +0 -1
  350. package/dist/design-system/p-BZg-6aSz.js +0 -2
  351. package/dist/design-system/p-CAFz8W8_.js +0 -1
  352. package/dist/design-system/p-D9tQwTWy.js +0 -1
  353. package/dist/design-system/p-U8VaRj9c.js +0 -1
  354. package/dist/design-system/p-b84f5550.entry.js +0 -1
  355. package/dist/design-system/p-edfb5c83.entry.js +0 -1
  356. package/dist/design-system/p-efc55114.entry.js +0 -1
  357. package/dist/design-system/p-fd671afe.entry.js +0 -1
  358. package/dist/design-system/p-fe2b853f.entry.js +0 -1
  359. package/dist/design-system/p-ff9ccbf6.entry.js +0 -1
  360. package/dist/design-system/p-sZMi_32I.js +0 -1
  361. package/dist/esm/component.table-D9tQwTWy.js +0 -69
  362. package/dist/esm/constants-sZMi_32I.js +0 -3
  363. package/dist/esm/sd-pagination_4.entry.js +0 -851
  364. package/dist/esm/sd-select-list-item_2.entry.js +0 -169
  365. package/dist/esm/sd-select.config-D6ktrl7E.js +0 -128
  366. package/dist/esm/sd-table.config-BbIWNUE2.js +0 -69
  367. package/dist/esm/sd-table.entry.js +0 -954
  368. package/dist/esm/sd-td.entry.js +0 -199
  369. package/dist/types/components/sd-table/constants.d.ts +0 -50
  370. package/dist/types/components/sd-table/sd-table.config.d.ts +0 -70
  371. package/dist/types/components/sd-table/sd-table.d.ts +0 -199
  372. package/dist/types/components/sd-table/sd-table.stories.helpers.d.ts +0 -39
  373. package/dist/types/components/sd-table/sd-tbody/sd-tbody.d.ts +0 -15
  374. package/dist/types/components/sd-table/sd-td/sd-td.d.ts +0 -38
  375. package/dist/types/components/sd-table/sd-thead/sd-thead.d.ts +0 -62
  376. package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +0 -54
  377. /package/dist/components/{p-laVsm9VM.js → p-BOxGhKKP.js} +0 -0
  378. /package/dist/design-system/{p-laVsm9VM.js → p-BOxGhKKP.js} +0 -0
@@ -1,851 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, a as getElement, H as Host } from './index-BZg-6aSz.js';
2
- import { T as TABLE_ID_ATTR } from './constants-sZMi_32I.js';
3
- import { a as TABLE_SELECTABLE_COLUMN_WIDTH, r as resolveTableIconColor, e as resolveSortIconName, c as TABLE_BORDER, f as TABLE_HEADER_RESIZING_BAR, g as TABLE_HEADER_TYPOGRAPHY, h as TABLE_HEADER_COLORS, i as TABLE_HEADER_LAYOUT, T as TABLE_BODY_LAYOUT, j as TABLE_SEPARATOR, b as TABLE_BODY_TYPOGRAPHY } from './sd-table.config-BbIWNUE2.js';
4
- import './component.table-D9tQwTWy.js';
5
- import './system-BJfiMC9H.js';
6
-
7
- const pagination = {
8
- height: "24",
9
- paddingX: "6",
10
- radius: "6",
11
- gap: "12",
12
- move: {
13
- gap: "4"
14
- },
15
- icon: "12",
16
- typography: {
17
- "default": {
18
- fontFamily: "Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",
19
- fontSize: "12",
20
- fontWeight: "500",
21
- lineHeight: "20"},
22
- selected: {
23
- fontWeight: "700"}
24
- },
25
- item: {
26
- bg: {
27
- hover: "#EEEEEE",
28
- selected: "#E6F1FF"
29
- },
30
- content: {
31
- "default": "#555555",
32
- hover: "#004290",
33
- selected: "#004290"
34
- }
35
- },
36
- simple: {
37
- gap: "8"
38
- }
39
- };
40
- var paginationTokens = {
41
- pagination: pagination
42
- };
43
-
44
- const PAGINATION_LAYOUT = {
45
- height: `${paginationTokens.pagination.height}px`,
46
- paddingX: `${paginationTokens.pagination.paddingX}px`,
47
- radius: `${paginationTokens.pagination.radius}px`,
48
- gap: `${paginationTokens.pagination.gap}px`,
49
- moveGap: `${paginationTokens.pagination.move.gap}px`,
50
- simpleGap: `${paginationTokens.pagination.simple.gap}px`,
51
- iconSize: Number(paginationTokens.pagination.icon),
52
- };
53
- const PAGINATION_TYPOGRAPHY = {
54
- fontFamily: paginationTokens.pagination.typography.default.fontFamily,
55
- fontSize: `${paginationTokens.pagination.typography.default.fontSize}px`,
56
- lineHeight: `${paginationTokens.pagination.typography.default.lineHeight}px`,
57
- fontWeightDefault: paginationTokens.pagination.typography.default.fontWeight,
58
- fontWeightSelected: paginationTokens.pagination.typography.selected.fontWeight,
59
- };
60
- const PAGINATION_COLORS = {
61
- contentDefault: paginationTokens.pagination.item.content.default,
62
- contentHover: paginationTokens.pagination.item.content.hover,
63
- contentSelected: paginationTokens.pagination.item.content.selected,
64
- bgHover: paginationTokens.pagination.item.bg.hover,
65
- bgSelected: paginationTokens.pagination.item.bg.selected,
66
- // TODO: 토큰 반영 후 교체 — nav 화살표 색상은 현재 토큰에 없음
67
- iconDefault: '#888888',
68
- };
69
-
70
- const sdPaginationCss = () => `sd-pagination{display:inline-flex}.sd-pagination{display:inline-flex;align-items:center;gap:var(--sd-pagination-gap);font-family:var(--sd-pagination-font-family)}.sd-pagination__group{display:inline-flex;align-items:center;gap:var(--sd-pagination-move-gap);min-width:calc(var(--sd-pagination-height) * 2 + var(--sd-pagination-move-gap))}.sd-pagination__group--prev{justify-content:flex-end}.sd-pagination__group--next{justify-content:flex-start}.sd-pagination__numbers{display:inline-flex;align-items:center;gap:var(--sd-pagination-move-gap)}.sd-pagination__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-pagination-height);height:var(--sd-pagination-height);padding:0;background:transparent;border:0;border-radius:var(--sd-pagination-radius);cursor:pointer;outline:none}.sd-pagination__nav:hover{background-color:var(--sd-pagination-bg-hover)}.sd-pagination__item{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-pagination-item-width);height:var(--sd-pagination-height);padding:0 var(--sd-pagination-padding-x);background:transparent;border:0;border-radius:var(--sd-pagination-radius);color:var(--sd-pagination-content);font-size:var(--sd-pagination-font-size);font-weight:var(--sd-pagination-font-weight-default);line-height:var(--sd-pagination-line-height);cursor:pointer;outline:none;box-sizing:border-box}.sd-pagination__item:hover{background-color:var(--sd-pagination-bg-hover);color:var(--sd-pagination-content-hover)}.sd-pagination__item--selected{background-color:var(--sd-pagination-bg-selected);color:var(--sd-pagination-content-selected);font-weight:var(--sd-pagination-font-weight-selected)}.sd-pagination__item--selected:hover{background-color:var(--sd-pagination-bg-selected);color:var(--sd-pagination-content-selected)}.sd-pagination__info{display:inline-flex;align-items:center;gap:var(--sd-pagination-simple-gap);height:var(--sd-pagination-height);padding:0 var(--sd-pagination-padding-x);color:var(--sd-pagination-content);font-size:var(--sd-pagination-font-size);font-weight:var(--sd-pagination-font-weight-default);line-height:var(--sd-pagination-line-height)}.sd-pagination__current{color:var(--sd-pagination-content-selected);font-weight:var(--sd-pagination-font-weight-selected)}`;
71
-
72
- const PER_PAGE = 10;
73
- const BUTTON_WIDTH = {
74
- 1: 24,
75
- 2: 34,
76
- 3: 40,
77
- 4: 48,
78
- 5: 56,
79
- };
80
- const SdPagination = class {
81
- constructor(hostRef) {
82
- registerInstance(this, hostRef);
83
- this.pageChange = createEvent(this, "sdPageChange", 7);
84
- }
85
- /** 현재 페이지 번호 */
86
- currentPage = 1;
87
- /** 마지막 페이지 번호 */
88
- lastPage = 1;
89
- /** true이면 현재/마지막 페이지만 표시하는 단순 모드 */
90
- simple = false;
91
- /** 페이지가 변경될 때 새 페이지 번호를 전달합니다. */
92
- pageChange;
93
- get pageNumbers() {
94
- const start = Math.floor((this.currentPage - 1) / PER_PAGE) * PER_PAGE + 1;
95
- const end = Math.min(start + PER_PAGE - 1, this.lastPage);
96
- return Array.from({ length: end - start + 1 }, (_, i) => start + i);
97
- }
98
- get buttonWidth() {
99
- const lastPageNum = this.pageNumbers.at(-1) ?? 1;
100
- const maxPageLength = lastPageNum.toString().length;
101
- return BUTTON_WIDTH[maxPageLength] || BUTTON_WIDTH[1];
102
- }
103
- get isFirstGroup() {
104
- return this.currentPage <= PER_PAGE;
105
- }
106
- get isLastGroup() {
107
- const startPageGroup = Math.floor((this.currentPage - 1) / PER_PAGE) * PER_PAGE + 1;
108
- return startPageGroup + PER_PAGE - 1 >= this.lastPage;
109
- }
110
- handlePageChange = (page) => {
111
- if (page < 1 || page > this.lastPage)
112
- return;
113
- this.currentPage = page;
114
- this.pageChange.emit(page);
115
- };
116
- handleGroupChange = (direction) => {
117
- const delta = direction === 'forward' ? PER_PAGE : -PER_PAGE;
118
- const newPage = Math.min(Math.max(this.currentPage + delta, 1), this.lastPage);
119
- this.handlePageChange(newPage);
120
- };
121
- renderNavButton(iconName, ariaLabel, onClick) {
122
- return (h("button", { type: "button", class: "sd-pagination__nav", "aria-label": ariaLabel, onClick: onClick }, h("sd-icon", { name: iconName, size: PAGINATION_LAYOUT.iconSize, color: PAGINATION_COLORS.iconDefault })));
123
- }
124
- renderPrevButtons() {
125
- if (this.simple) {
126
- if (this.currentPage <= 1)
127
- return null;
128
- return (h(Fragment, null, this.renderNavButton('chevronLeftEnd', 'Go to first page', () => this.handlePageChange(1)), this.renderNavButton('chevronLeft', 'Go to previous page', () => this.handlePageChange(this.currentPage - 1))));
129
- }
130
- if (this.isFirstGroup)
131
- return null;
132
- return (h(Fragment, null, this.renderNavButton('chevronLeftEnd', 'Go to first page', () => this.handlePageChange(1)), this.renderNavButton('chevronLeft', 'Go to previous page group', () => this.handleGroupChange('backward'))));
133
- }
134
- renderNextButtons() {
135
- if (this.simple) {
136
- if (this.currentPage >= this.lastPage)
137
- return null;
138
- return (h(Fragment, null, this.renderNavButton('chevronRight', 'Go to next page', () => this.handlePageChange(this.currentPage + 1)), this.renderNavButton('chevronRightEnd', 'Go to last page', () => this.handlePageChange(this.lastPage))));
139
- }
140
- if (this.isLastGroup)
141
- return null;
142
- return (h(Fragment, null, this.renderNavButton('chevronRight', 'Go to next page group', () => this.handleGroupChange('forward')), this.renderNavButton('chevronRightEnd', 'Go to last page', () => this.handlePageChange(this.lastPage))));
143
- }
144
- render() {
145
- const cssVars = {
146
- '--sd-pagination-height': PAGINATION_LAYOUT.height,
147
- '--sd-pagination-padding-x': PAGINATION_LAYOUT.paddingX,
148
- '--sd-pagination-radius': PAGINATION_LAYOUT.radius,
149
- '--sd-pagination-gap': PAGINATION_LAYOUT.gap,
150
- '--sd-pagination-move-gap': PAGINATION_LAYOUT.moveGap,
151
- '--sd-pagination-simple-gap': PAGINATION_LAYOUT.simpleGap,
152
- '--sd-pagination-font-family': PAGINATION_TYPOGRAPHY.fontFamily,
153
- '--sd-pagination-font-size': PAGINATION_TYPOGRAPHY.fontSize,
154
- '--sd-pagination-line-height': PAGINATION_TYPOGRAPHY.lineHeight,
155
- '--sd-pagination-font-weight-default': PAGINATION_TYPOGRAPHY.fontWeightDefault,
156
- '--sd-pagination-font-weight-selected': PAGINATION_TYPOGRAPHY.fontWeightSelected,
157
- '--sd-pagination-content': PAGINATION_COLORS.contentDefault,
158
- '--sd-pagination-content-hover': PAGINATION_COLORS.contentHover,
159
- '--sd-pagination-content-selected': PAGINATION_COLORS.contentSelected,
160
- '--sd-pagination-bg-hover': PAGINATION_COLORS.bgHover,
161
- '--sd-pagination-bg-selected': PAGINATION_COLORS.bgSelected,
162
- '--sd-pagination-item-width': `${this.buttonWidth}px`,
163
- };
164
- return (h("div", { key: '2e5fdcc2d6a426be32128960131db2ed51674939', class: {
165
- 'sd-pagination': true,
166
- 'sd-pagination--simple': this.simple,
167
- }, style: cssVars }, h("div", { key: 'a83ee12c1af9ca41e3a5773fcd840200fcb873e2', class: "sd-pagination__group sd-pagination__group--prev" }, this.renderPrevButtons()), this.simple ? (h("div", { class: "sd-pagination__info" }, h("span", { class: "sd-pagination__current" }, this.currentPage), h("span", { class: "sd-pagination__divider" }, "/"), h("span", { class: "sd-pagination__last" }, this.lastPage))) : (h("div", { class: "sd-pagination__numbers" }, this.pageNumbers.map(n => (h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
168
- 'sd-pagination__item': true,
169
- 'sd-pagination__item--selected': this.currentPage === n,
170
- }, onClick: () => this.handlePageChange(n) }, n))))), h("div", { key: '3c98ea6c1bf5bea43baaa73a2a7db5c4fe1404e5', class: "sd-pagination__group sd-pagination__group--next" }, this.renderNextButtons())));
171
- }
172
- };
173
- SdPagination.style = sdPaginationCss();
174
-
175
- const sdTbodyCss = () => `:host{display:contents}:host *{box-sizing:border-box}.tbody{display:table-row-group}`;
176
-
177
- const SdTbody = class {
178
- constructor(hostRef) {
179
- registerInstance(this, hostRef);
180
- }
181
- get el() { return getElement(this); }
182
- /** 렌더링할 행 데이터 목록 */
183
- rows = [];
184
- tableId = '';
185
- topSpacerHeight = 0;
186
- bottomSpacerHeight = 0;
187
- tableEl = null;
188
- handleRowsChange(newRows) {
189
- const safeRows = newRows ?? [];
190
- if (this.tableEl?.setRowCountSync) {
191
- this.tableEl.setRowCountSync(safeRows.length);
192
- }
193
- }
194
- componentWillLoad() {
195
- this.syncTableContext();
196
- this.rows = this.rows ?? [];
197
- if (this.tableEl?.setRowCountSync) {
198
- this.tableEl.setRowCountSync(this.rows.length);
199
- }
200
- this.el.setSpacersSync = (top, bottom) => {
201
- this.topSpacerHeight = top;
202
- this.bottomSpacerHeight = bottom;
203
- };
204
- }
205
- componentDidLoad() {
206
- this.syncTableContext();
207
- }
208
- syncTableContext() {
209
- // sd-table이 shadow:true이므로 fallback content로 렌더되면 closest가 경계를 못 넘는다.
210
- // 그 경우 getRootNode().host(=sd-table)로 폴백한다.
211
- const closest = this.el.closest('sd-table');
212
- const root = this.el.getRootNode();
213
- const fromShadow = root instanceof ShadowRoot ? root.host : null;
214
- const table = closest ?? fromShadow;
215
- this.tableEl = table;
216
- const fromMethod = table?.getTableIdSync?.();
217
- const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
218
- const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
219
- (fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
220
- '';
221
- if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
222
- this.tableId = resolvedTableId;
223
- }
224
- }
225
- render() {
226
- return (h(Host, { key: '6d4bea755b962e2f5b9f37129d0b03fd7f997e93', slot: `${this.tableId}-body` }, h("tbody", { key: '11543f7ea385458bcb57ae4e62bfd258bacb9e01', class: { tbody: true } }, [
227
- this.topSpacerHeight > 0 && (h("tr", { key: "spacer-top", class: "tbody__spacer", style: { height: `${this.topSpacerHeight}px`, display: 'block' } })),
228
- h("slot", { key: '515aa270f49dfd20f78de1d11c3c5b914cfda792' }),
229
- this.bottomSpacerHeight > 0 && (h("tr", { key: "spacer-bottom", class: "tbody__spacer", style: { height: `${this.bottomSpacerHeight}px`, display: 'block' } })),
230
- ])));
231
- }
232
- static get watchers() { return {
233
- "rows": [{
234
- "handleRowsChange": 0
235
- }]
236
- }; }
237
- };
238
- SdTbody.style = sdTbodyCss();
239
-
240
- const sdTheadCss = () => `sd-thead{display:contents}sd-thead *{box-sizing:border-box}.thead{display:table-header-group;height:var(--table-header-height, 36px)}.thead--sticky{position:sticky;top:0;z-index:120}.tr{display:table-row;width:100%}.th{display:table-cell;background:var(--table-header-bg, #F5FAFF);height:var(--table-header-height, 36px);padding:0 var(--table-header-padding-x, 16px);font-family:var(--table-header-font-family, inherit);font-weight:var(--table-header-font-weight, 500);font-size:var(--table-header-font-size, 12px);line-height:var(--table-header-line-height, 20px);text-decoration:var(--table-header-text-decoration, none);vertical-align:middle;border-bottom:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);-webkit-user-select:none;user-select:none;position:relative;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.th--selected{position:relative;width:var(--table-selectable-width, 48px) !important;max-width:var(--table-selectable-width, 48px) !important;min-width:var(--table-selectable-width, 48px) !important;text-align:center}.th--selected sd-checkbox label{position:relative}.th--selected sd-checkbox label:before{content:"";position:absolute;inset:-6px}.th.sticky-left{position:sticky;background-color:var(--table-header-bg, #F5FAFF);z-index:110 !important;left:var(--sticky-left-offset, 0)}.th.sticky-right{position:sticky;background-color:var(--table-header-bg, #F5FAFF);z-index:110 !important;right:var(--sticky-right-offset, 0)}.th.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.th.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.th.sticky-left-edge.is-scrolled-left{overflow:visible}.th.sticky-left-edge.is-scrolled-left:after{opacity:1}.th.sticky-right-edge.is-scrolled-right{overflow:visible}.th.sticky-right-edge.is-scrolled-right:after{opacity:1}.th__content{display:flex;flex-flow:row nowrap;align-items:center;gap:var(--table-header-gap, 4px)}.th__content--left{justify-content:flex-start}.th__content--center{justify-content:center}.th__content--right{justify-content:flex-end}.th__content--label{white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.th__bar{position:absolute;top:50%;right:0;transform:translateY(-50%);width:var(--table-border-width, 1px);height:var(--table-header-resizer-height, 16px);z-index:3;background-color:var(--table-header-resizer-color, #CCCCCC)}.th--has-dropdown{cursor:pointer}.th__dropdown-trigger{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;padding:0;border:none;background:transparent;cursor:pointer;color:inherit;border-radius:2px}.th__dropdown-trigger sd-icon{transition:transform 0.15s ease}.th__dropdown-trigger--open sd-icon{transform:rotate(180deg)}.th__resizer{position:absolute;top:50%;right:0;transform:translateY(-50%);width:4px;height:var(--table-header-resizer-height, 16px);cursor:col-resize;z-index:3;border-left:var(--table-border-width, 1px) solid var(--table-header-resizer-color, #CCCCCC);border-right:var(--table-border-width, 1px) solid var(--table-header-resizer-color, #CCCCCC)}.th__resizer--left{right:auto;left:0}`;
241
-
242
- const SdThead = class {
243
- constructor(hostRef) {
244
- registerInstance(this, hostRef);
245
- this.sdColumnSort = createEvent(this, "sdColumnSort", 7);
246
- }
247
- get el() { return getElement(this); }
248
- /** 테이블 컬럼 목록 */
249
- columns;
250
- /** 행 선택 기능 사용 여부 */
251
- selectable;
252
- /** 컬럼 너비 조절 가능 여부 */
253
- resizable;
254
- /** 고정 컬럼 설정 */
255
- stickyColumn;
256
- /** 헤더 고정 여부 */
257
- stickyHeader;
258
- /** 좌측 스크롤 여부 */
259
- scrolledLeft;
260
- /** 우측 스크롤 여부 */
261
- scrolledRight;
262
- /** 전체 선택 체크박스용 행 데이터 */
263
- rows = [];
264
- /** 컬럼 너비 목록 */
265
- columnWidths = [];
266
- /** 컬럼 정렬 버튼 클릭 시 발생합니다. */
267
- sdColumnSort;
268
- tableId = '';
269
- _columns = [];
270
- _selectable = false;
271
- _resizable = false;
272
- _stickyColumn = { left: 0, right: 0 };
273
- _stickyHeader = false;
274
- _scrolledLeft = false;
275
- _scrolledRight = false;
276
- dropdownOpenMap = {};
277
- tableEl = null;
278
- dropdownRefs = {};
279
- dropdownThRefs = {};
280
- dropdownPortals = {};
281
- handleColumnsChange(newCols) {
282
- if (Array.isArray(newCols) && (this.columnWidths ?? []).length === 0) {
283
- this.columnWidths = newCols.map(c => (c.autoWidth ? 0 : parseInt(c.width || '120', 10)));
284
- }
285
- }
286
- disconnectedCallback() {
287
- const portals = this.dropdownPortals ?? {};
288
- Object.values(portals).forEach(portal => {
289
- if (portal?.parentNode != null)
290
- portal.parentNode.removeChild(portal);
291
- });
292
- }
293
- componentWillLoad() {
294
- this.syncTableContext();
295
- this.dropdownOpenMap = this.dropdownOpenMap ?? {};
296
- this.dropdownRefs = this.dropdownRefs ?? {};
297
- this.dropdownThRefs = this.dropdownThRefs ?? {};
298
- this.dropdownPortals = this.dropdownPortals ?? {};
299
- this.columnWidths = Array.isArray(this.columnWidths) ? this.columnWidths : [];
300
- this.resolveConfig();
301
- if ((this.columnWidths ?? []).length === 0) {
302
- this.columnWidths = this._columns.map(c => c.autoWidth ? 0 : parseInt(c.width || '120', 10));
303
- }
304
- }
305
- componentDidLoad() {
306
- this.syncTableContext();
307
- this.resolveConfig();
308
- this.initDropdownPortals();
309
- }
310
- // sd-portal을 body에 붙여 CSS transform 영향 없이 정확한 위치에 패널을 표시한다.
311
- // <slot>을 render에 두지 않고 직접 DOM 이동(slot 속성 제거)으로 Stencil 슬롯 에뮬레이션 충돌을 피한다.
312
- initDropdownPortals() {
313
- const cols = this._columns ?? [];
314
- const hasDropdownCols = cols.filter(c => c.hasDropdown === true);
315
- if (hasDropdownCols.length === 0)
316
- return;
317
- for (const col of hasDropdownCols) {
318
- const colName = col.name;
319
- // 이미 포탈이 생성된 컬럼은 건너뜀 (refreshConfig 재호출 대비)
320
- if ((this.dropdownPortals ?? {})[colName] != null)
321
- continue;
322
- const slotContent = this.el.querySelector(`[slot="dropdown-${colName}"]`);
323
- if (slotContent == null)
324
- continue;
325
- // slot 속성 제거: Stencil 슬롯 에뮬레이션이 재배포하지 못하게 한다
326
- slotContent.removeAttribute('slot');
327
- const portal = document.createElement('sd-portal');
328
- portal.parentRef = this.dropdownThRefs[colName] ?? null;
329
- portal.open = false;
330
- // 첫 open 전까지 포탈 호스트 자체를 숨긴다.
331
- // moveSlotContent()가 open=true 시 children을 독립 wrapper div로 이동하므로 이후 동작에 영향 없음.
332
- portal.style.display = 'none';
333
- portal.addEventListener('sdClose', () => this.closeDropdown(colName));
334
- portal.appendChild(slotContent);
335
- document.body.appendChild(portal);
336
- this.dropdownPortals[colName] = portal;
337
- }
338
- }
339
- syncTableContext() {
340
- // sd-table이 shadow:true이므로 fallback content로 렌더되면 closest가 경계를 못 넘는다.
341
- // 그 경우 getRootNode().host(=sd-table)로 폴백한다.
342
- const closest = this.el.closest('sd-table');
343
- const root = this.el.getRootNode();
344
- const fromShadow = root instanceof ShadowRoot ? root.host : null;
345
- const table = closest ?? fromShadow;
346
- this.tableEl = table;
347
- const fromMethod = table?.getTableIdSync?.();
348
- const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
349
- const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
350
- (fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
351
- '';
352
- if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
353
- this.tableId = resolvedTableId;
354
- }
355
- }
356
- resolveConfig() {
357
- const config = this.tableEl?.getConfigSync?.();
358
- const resolvedColumns = Array.isArray(this.columns)
359
- ? this.columns
360
- : Array.isArray(config?.columns)
361
- ? config.columns
362
- : [];
363
- this._columns = resolvedColumns;
364
- this._selectable = this.selectable ?? config?.selectable ?? false;
365
- this._resizable = this.resizable ?? config?.resizable ?? false;
366
- this._stickyColumn = this.stickyColumn ?? config?.stickyColumn ?? { left: 0, right: 0 };
367
- this._stickyHeader = this.stickyHeader ?? config?.stickyHeader ?? false;
368
- this._scrolledLeft = this.scrolledLeft ?? config?.scrolledLeft ?? false;
369
- this._scrolledRight = this.scrolledRight ?? config?.scrolledRight ?? false;
370
- if (Array.isArray(config?.columnWidths) && (this.columnWidths ?? []).length === 0) {
371
- this.columnWidths = [...config.columnWidths];
372
- }
373
- if (!Array.isArray(this.columnWidths)) {
374
- this.columnWidths = [];
375
- }
376
- }
377
- /** 테이블 설정을 다시 불러옵니다. */
378
- async refreshConfig() {
379
- this.resolveConfig();
380
- this.initDropdownPortals();
381
- }
382
- /** 컬럼 너비를 업데이트합니다. */
383
- async setColumnWidths(widths) {
384
- this.columnWidths = Array.isArray(widths) ? widths : [];
385
- }
386
- /** 전체 선택 체크박스 상태를 갱신합니다. */
387
- async refreshSelection() {
388
- const checkbox = this.el.querySelector('sd-checkbox');
389
- if (checkbox) {
390
- checkbox.value = this.getIsAllChecked();
391
- }
392
- }
393
- get visibleColumns() {
394
- return this._columns.filter(col => col.visible !== false);
395
- }
396
- getStickyStyle(colIdx) {
397
- if (this.tableEl?.getStickyStyleSync) {
398
- return this.tableEl.getStickyStyleSync(colIdx);
399
- }
400
- const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) +
401
- (this._selectable ? TABLE_SELECTABLE_COLUMN_WIDTH : 0);
402
- const rightOffset = this.columnWidths
403
- .filter((_, i) => i >= this.visibleColumns.length - (this._stickyColumn.right || 0) && i > colIdx)
404
- .reduce((a, b) => a + b, 0);
405
- const col = this.visibleColumns[colIdx];
406
- const base = {
407
- '--sticky-left-offset': `${leftOffset}px`,
408
- '--sticky-right-offset': `${rightOffset}px`,
409
- };
410
- if (!col?.autoWidth) {
411
- base['width'] = `${this.columnWidths[colIdx]}px`;
412
- base['minWidth'] = `${this.columnWidths[colIdx]}px`;
413
- base['maxWidth'] = `${this.columnWidths[colIdx]}px`;
414
- }
415
- return base;
416
- }
417
- handleResize(index, event, reversed = false) {
418
- if (this.tableEl?.handleResize) {
419
- this.tableEl.handleResize(index, event, reversed);
420
- }
421
- }
422
- handleColumnSort = (col) => {
423
- this.sdColumnSort.emit({ column: col });
424
- };
425
- toggleDropdown(name) {
426
- const isOpen = this.dropdownOpenMap[name] !== true;
427
- const portals = this.dropdownPortals ?? {};
428
- const newMap = { ...this.dropdownOpenMap };
429
- // _columns 기준으로 순회: portals가 비어도 dropdownOpenMap은 항상 갱신됨
430
- for (const col of (this._columns ?? []).filter(c => c.hasDropdown === true)) {
431
- const shouldBeOpen = col.name === name ? isOpen : false;
432
- newMap[col.name] = shouldBeOpen;
433
- const portal = portals[col.name];
434
- if (portal != null)
435
- portal.open = shouldBeOpen;
436
- }
437
- this.dropdownOpenMap = newMap;
438
- }
439
- closeDropdown(name) {
440
- if (this.dropdownOpenMap[name] !== true)
441
- return;
442
- this.dropdownOpenMap = { ...this.dropdownOpenMap, [name]: false };
443
- const portal = (this.dropdownPortals ?? {})[name];
444
- if (portal != null)
445
- portal.open = false;
446
- }
447
- handleSelectAll(checked) {
448
- const nextChecked = !!checked;
449
- const safeRows = Array.isArray(this.rows) ? this.rows : [];
450
- if (this.tableEl?.toggleSelectAllSync) {
451
- this.tableEl.toggleSelectAllSync(nextChecked, safeRows);
452
- }
453
- }
454
- getIsAllChecked() {
455
- const safeRows = Array.isArray(this.rows) ? this.rows : [];
456
- if (this.tableEl?.getIsAllCheckedSync && safeRows.length > 0) {
457
- return this.tableEl.getIsAllCheckedSync(safeRows);
458
- }
459
- return false;
460
- }
461
- render() {
462
- const safeRows = Array.isArray(this.rows) ? this.rows : [];
463
- const dropdownOpenMap = this.dropdownOpenMap ?? {};
464
- const dropdownRefs = this.dropdownRefs ?? {};
465
- const stickyLeftCount = this._stickyColumn.left || 0;
466
- const stickyRightCount = this._stickyColumn.right || 0;
467
- const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
468
- const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
469
- const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
470
- const lastColIdx = this.visibleColumns.length - 1;
471
- const headStyle = {
472
- '--table-header-height': `${TABLE_HEADER_LAYOUT.height}px`,
473
- '--table-header-padding-x': `${TABLE_HEADER_LAYOUT.paddingX}px`,
474
- '--table-header-gap': `${TABLE_HEADER_LAYOUT.gap}px`,
475
- '--table-header-bg': TABLE_HEADER_COLORS.bg,
476
- '--table-header-font-family': TABLE_HEADER_TYPOGRAPHY.fontFamily,
477
- '--table-header-font-weight': TABLE_HEADER_TYPOGRAPHY.fontWeight,
478
- '--table-header-font-size': `${TABLE_HEADER_TYPOGRAPHY.fontSize}px`,
479
- '--table-header-line-height': `${TABLE_HEADER_TYPOGRAPHY.lineHeight}px`,
480
- '--table-header-text-decoration': TABLE_HEADER_TYPOGRAPHY.textDecoration,
481
- '--table-header-resizer-color': TABLE_HEADER_RESIZING_BAR.color,
482
- '--table-header-resizer-height': `${TABLE_HEADER_RESIZING_BAR.height}px`,
483
- '--table-border-color': TABLE_BORDER.color,
484
- '--table-border-width': `${TABLE_BORDER.width}px`,
485
- };
486
- return (h(Host, { key: 'ec85c86aa6d93e5a2405262809bf790fbb12ee79', slot: `${this.tableId}-head`, style: headStyle }, h("thead", { key: '8afbdf4d81ebb649e262baa6da8ce3a1eca31e15', class: {
487
- 'thead': true,
488
- 'thead--sticky': this._stickyHeader,
489
- } }, h("tr", { key: '9643f19e95aa00f5bb5d6462ecb0da4ca95c3dcc', class: "tr" }, this._selectable && (h("th", { key: '6d87ceb557e61454eaf0acf492234788bfd99235', class: {
490
- 'th': true,
491
- 'th--selected': true,
492
- 'sticky-left': true,
493
- 'sticky-left-edge': stickyLeftCount === 0,
494
- 'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
495
- }, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: 'c2dc4e112510bb9ab13109fd966cd0485588835a', value: this.getIsAllChecked(), disabled: safeRows.length === 0, onSdUpdate: (e) => this.handleSelectAll(e.detail) }), h("div", { key: '478a665c0d06efc829e4f2818be4be1b43e44708', class: "th__bar" }))), stickyLeftCols.map((col, idx) => (h("th", { key: col.name, class: {
496
- 'th': true,
497
- [`${col.thClass}`]: Boolean(col.thClass),
498
- 'sticky-left': true,
499
- 'sticky-left-edge': idx === stickyLeftCount - 1,
500
- 'is-scrolled-left': idx === stickyLeftCount - 1 && this._scrolledLeft,
501
- 'th--has-dropdown': col.hasDropdown === true,
502
- }, style: { ...col.thStyle, ...this.getStickyStyle(idx) }, ref: col.hasDropdown === true
503
- ? el => {
504
- this.dropdownThRefs[col.name] = el;
505
- }
506
- : undefined, onClick: col.hasDropdown === true ? () => this.toggleDropdown(col.name) : undefined }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: (e) => {
507
- e.stopPropagation();
508
- this.handleColumnSort(col);
509
- }, style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text)))))), col.hasDropdown === true && (h("button", { class: {
510
- 'th__dropdown-trigger': true,
511
- 'th__dropdown-trigger--open': dropdownOpenMap[col.name] === true,
512
- }, ref: el => {
513
- dropdownRefs[col.name] = el;
514
- }, "aria-haspopup": "listbox", "aria-expanded": dropdownOpenMap[col.name] === true ? 'true' : 'false' }, h("sd-icon", { name: "caretDown", size: "12" })))), this._resizable && idx !== lastColIdx && (
515
- // column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
516
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
517
- h("div", { class: "th__resizer", onMouseDown: (evt) => this.handleResize(idx, evt) }))))), middleCols.map((col, relativeIdx) => {
518
- const actualColIdx = stickyLeftCount + relativeIdx;
519
- return (h("th", { key: col.name, class: {
520
- 'th': true,
521
- [`${col.thClass}`]: Boolean(col.thClass),
522
- 'th--has-dropdown': col.hasDropdown === true,
523
- }, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) }, ref: col.hasDropdown === true
524
- ? el => {
525
- this.dropdownThRefs[col.name] = el;
526
- }
527
- : undefined, onClick: col.hasDropdown === true ? () => this.toggleDropdown(col.name) : undefined }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: (e) => {
528
- e.stopPropagation();
529
- this.handleColumnSort(col);
530
- }, style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text)))))), col.hasDropdown === true && (h("button", { class: {
531
- 'th__dropdown-trigger': true,
532
- 'th__dropdown-trigger--open': this.dropdownOpenMap[col.name] === true,
533
- }, ref: el => {
534
- this.dropdownRefs[col.name] = el;
535
- }, "aria-haspopup": "listbox", "aria-expanded": this.dropdownOpenMap[col.name] === true ? 'true' : 'false' }, h("sd-icon", { name: "caretDown", size: "12" })))), this._resizable && actualColIdx !== lastColIdx && (
536
- // column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
537
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
538
- h("div", { class: "th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
539
- }), stickyRightCols.map((col, relativeIdx) => {
540
- const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
541
- return (h("th", { key: col.name, class: {
542
- 'th': true,
543
- [`${col.thClass}`]: Boolean(col.thClass),
544
- 'sticky-right': true,
545
- 'sticky-right-edge': relativeIdx === 0,
546
- 'is-scrolled-right': relativeIdx === 0 && this._scrolledRight,
547
- 'th--has-dropdown': col.hasDropdown === true,
548
- }, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) }, ref: col.hasDropdown === true
549
- ? el => {
550
- this.dropdownThRefs[col.name] = el;
551
- }
552
- : undefined, onClick: col.hasDropdown === true ? () => this.toggleDropdown(col.name) : undefined }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: (e) => {
553
- e.stopPropagation();
554
- this.handleColumnSort(col);
555
- }, style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text)))))), col.hasDropdown === true && (h("button", { class: {
556
- 'th__dropdown-trigger': true,
557
- 'th__dropdown-trigger--open': this.dropdownOpenMap[col.name] === true,
558
- }, ref: el => {
559
- this.dropdownRefs[col.name] = el;
560
- }, "aria-haspopup": "listbox", "aria-expanded": this.dropdownOpenMap[col.name] === true ? 'true' : 'false' }, h("sd-icon", { name: "caretDown", size: "12" })))), this._resizable && (
561
- // column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
562
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
563
- h("div", { class: "th__resizer th__resizer--left", onMouseDown: (evt) => this.handleResize(actualColIdx, evt, true) }))));
564
- })))));
565
- }
566
- static get watchers() { return {
567
- "columns": [{
568
- "handleColumnsChange": 0
569
- }]
570
- }; }
571
- };
572
- SdThead.style = sdTheadCss();
573
-
574
- const sdTrCss = () => `sd-tr{display:contents}sd-tr *{box-sizing:border-box}.tr{display:table-row}.tr:hover .td{background-color:#F9F9F9}.tr--no-hover:hover .td{background-color:white}.tr--separator:hover .td{background-color:var(--table-separator-color, #eeeeee)}.td{display:table-cell;height:var(--table-body-height, 44px);padding:var(--table-body-padding-y, 0) var(--table-body-padding-x, 16px);border-bottom:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);background:white;vertical-align:middle;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.td--left{text-align:left}.td--center{text-align:center}.td--right{text-align:right}.td--selected{position:relative;width:var(--table-selectable-width, 48px) !important;max-width:var(--table-selectable-width, 48px) !important;min-width:var(--table-selectable-width, 48px) !important;text-align:center}.td--selected sd-checkbox label{position:relative}.td--selected sd-checkbox label:before{content:"";position:absolute;inset:-6px}.td.sticky-left{position:sticky;background-color:white;z-index:100 !important;left:var(--sticky-left-offset, 0)}.td.sticky-right{position:sticky;background-color:white;z-index:100 !important;right:var(--sticky-right-offset, 0)}.td.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-left-edge.is-scrolled-left{overflow:visible}.td.sticky-left-edge.is-scrolled-left:after{opacity:1}.td.sticky-right-edge.is-scrolled-right{overflow:visible}.td.sticky-right-edge.is-scrolled-right:after{opacity:1}.tr:hover .td.sticky-left,.tr:hover .td.sticky-right{background-color:#F9F9F9}.tr--no-hover:hover .td.sticky-left,.tr--no-hover:hover .td.sticky-right{background-color:white}.tr--separator:hover .td.sticky-left,.tr--separator:hover .td.sticky-right{background-color:var(--table-separator-color, #eeeeee)}.tr--separator .td--separator{height:var(--table-separator-width, 6px);padding:0;background-color:var(--table-separator-color, #eeeeee);border-bottom:none}.tr--separator--dense .td--separator{height:var(--table-separator-dense-width, 4px)}.td--divider-left{border-left:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1)}.td--divider-right{border-right:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1)}`;
575
-
576
- const SdTr = class {
577
- constructor(hostRef) {
578
- registerInstance(this, hostRef);
579
- }
580
- get el() { return getElement(this); }
581
- /** 테이블 컬럼 목록 */
582
- columns;
583
- /** 행 선택 기능 사용 여부 */
584
- selectable;
585
- /** 고정 컬럼 설정 */
586
- stickyColumn;
587
- /** 행 식별 키 */
588
- rowKey = '';
589
- /** 행 데이터 객체 */
590
- row = {};
591
- /** 구분선 높이 (4 또는 6px, null이면 일반 행) */
592
- separator = null;
593
- tableId = '';
594
- columnWidths = [];
595
- isVisible = true;
596
- spansVersion = 0;
597
- _columns = [];
598
- _selectable = false;
599
- _stickyColumn = { left: 0, right: 0 };
600
- _scrolledLeft = false;
601
- _scrolledRight = false;
602
- _dense = false;
603
- tableEl = null;
604
- componentWillLoad() {
605
- this.row = this.row ?? {};
606
- this.syncTableContext();
607
- this.columnWidths = this.columnWidths ?? [];
608
- this.resolveConfig();
609
- this.columnWidths = this._columns.map(c => (c.autoWidth ? 0 : parseInt(c.width || '120', 10)));
610
- this.updateVisibilitySync();
611
- }
612
- componentDidLoad() {
613
- this.syncTableContext();
614
- }
615
- syncTableContext() {
616
- // sd-table이 shadow:true이므로 fallback content로 렌더되면 closest가 경계를 못 넘는다.
617
- // 그 경우 getRootNode().host(=sd-table)로 폴백한다.
618
- const closest = this.el.closest('sd-table');
619
- const root = this.el.getRootNode();
620
- const fromShadow = root instanceof ShadowRoot ? root.host : null;
621
- const table = closest ?? fromShadow;
622
- this.tableEl = table;
623
- const fromMethod = table?.getTableIdSync?.();
624
- const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
625
- const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
626
- (fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
627
- '';
628
- if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
629
- this.tableId = resolvedTableId;
630
- }
631
- }
632
- resolveConfig() {
633
- const config = this.tableEl?.getConfigSync?.();
634
- this._columns = this.columns ?? config?.columns ?? [];
635
- this._selectable = this.selectable ?? config?.selectable ?? false;
636
- this._stickyColumn = this.stickyColumn ?? config?.stickyColumn ?? { left: 0, right: 0 };
637
- this._scrolledLeft = config?.scrolledLeft ?? false;
638
- this._scrolledRight = config?.scrolledRight ?? false;
639
- this._dense = config?.dense ?? false;
640
- if (config?.columnWidths && (this.columnWidths ?? []).length === 0) {
641
- this.columnWidths = [...config.columnWidths];
642
- }
643
- }
644
- /** 테이블 설정을 다시 불러옵니다. */
645
- async refreshConfig() {
646
- this.resolveConfig();
647
- }
648
- /** 셀 병합 버전을 갱신해 td를 재렌더링합니다. */
649
- async bumpSpansVersion() {
650
- this.spansVersion = this.spansVersion + 1;
651
- }
652
- /** 페이지네이션에 따른 행 표시 여부를 갱신합니다. */
653
- async updateVisibility() {
654
- this.updateVisibilitySync();
655
- }
656
- updateVisibilitySync() {
657
- const rowIndex = parseInt(this.rowKey, 10);
658
- const pageInfo = this.tableEl?.getPaginationInfoSync?.();
659
- if (!pageInfo) {
660
- this.isVisible = true;
661
- return;
662
- }
663
- this.isVisible = rowIndex >= pageInfo.startIndex && rowIndex < pageInfo.endIndex;
664
- }
665
- /** 컬럼 너비를 업데이트합니다. */
666
- async setColumnWidths(widths) {
667
- this.columnWidths = widths;
668
- }
669
- /** 체크박스 선택 상태를 갱신합니다. */
670
- async refreshSelection() {
671
- const checkbox = this.el.querySelector('sd-checkbox');
672
- if (checkbox) {
673
- checkbox.value = this.isSelected();
674
- }
675
- }
676
- get visibleColumns() {
677
- return this._columns.filter(col => col.visible !== false);
678
- }
679
- formatValue(value) {
680
- if (value === null || value === undefined) {
681
- return '';
682
- }
683
- if (typeof value === 'number') {
684
- return value.toLocaleString();
685
- }
686
- return String(value);
687
- }
688
- getCellValue(column) {
689
- const { field, format, name } = column;
690
- const value = typeof field === 'function'
691
- ? field(this.row)
692
- : field !== ''
693
- ? this.row[field]
694
- : this.row[name];
695
- return format ? format(value, this.row) : this.formatValue(value);
696
- }
697
- getStickyStyle(colIdx) {
698
- if (this.tableEl?.getStickyStyleSync) {
699
- return this.tableEl.getStickyStyleSync(colIdx);
700
- }
701
- const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) + (this._selectable ? 52 : 0);
702
- const rightOffset = this.columnWidths
703
- .filter((_, i) => i >= this.visibleColumns.length - (this._stickyColumn.right || 0) && i > colIdx)
704
- .reduce((a, b) => a + b, 0);
705
- const col = this.visibleColumns[colIdx];
706
- const base = {
707
- '--sticky-left-offset': `${leftOffset}px`,
708
- '--sticky-right-offset': `${rightOffset}px`,
709
- };
710
- if (!col?.autoWidth) {
711
- base['width'] = `${this.columnWidths[colIdx]}px`;
712
- base['minWidth'] = `${this.columnWidths[colIdx]}px`;
713
- base['maxWidth'] = `${this.columnWidths[colIdx]}px`;
714
- }
715
- return base;
716
- }
717
- isSelected() {
718
- if (this.tableEl?.isRowSelectedSync) {
719
- return this.tableEl.isRowSelectedSync(this.row);
720
- }
721
- return false;
722
- }
723
- handleSelect() {
724
- if (this.tableEl?.updateRowSelectSync) {
725
- this.tableEl.updateRowSelectSync(this.row);
726
- }
727
- }
728
- getSpanFor(col) {
729
- if (!this.tableEl?.getSpanSync)
730
- return undefined;
731
- const fieldName = typeof col.field === 'string' ? col.field : col.name;
732
- return this.tableEl.getSpanSync(this.rowKey, fieldName);
733
- }
734
- isCovered(colIdx) {
735
- if (!this.tableEl?.isCoveredSync)
736
- return false;
737
- return this.tableEl.isCoveredSync(this.rowKey, colIdx, this._columns);
738
- }
739
- getCellClassFor(col) {
740
- if (!this.tableEl?.getCellClassSync)
741
- return undefined;
742
- const fieldName = typeof col.field === 'string' ? col.field : col.name;
743
- return this.tableEl.getCellClassSync(this.rowKey, fieldName);
744
- }
745
- getFramePaddingStyle(field) {
746
- if (!(this.tableEl?.isCellUseFrameSync?.(this.rowKey, field) ?? false))
747
- return undefined;
748
- return { padding: `${TABLE_BODY_LAYOUT.framePadding}px` };
749
- }
750
- expandCellClass(classStr) {
751
- if (classStr == null || classStr === '')
752
- return {};
753
- return Object.fromEntries(classStr
754
- .split(/\s+/)
755
- .filter(Boolean)
756
- .map(c => [c, true]));
757
- }
758
- render() {
759
- const stickyLeftCount = this._stickyColumn.left || 0;
760
- const stickyRightCount = this._stickyColumn.right || 0;
761
- const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
762
- const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
763
- const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
764
- const hasRowspan = this.tableEl?.hasRowspanSync?.() ?? false;
765
- const isUseFrameRow = this.tableEl?.hasUseFrameInRowSync?.(this.rowKey) ?? false;
766
- const effectiveDense = this._dense && !isUseFrameRow;
767
- const rowLayoutY = effectiveDense ? TABLE_BODY_LAYOUT.dense : TABLE_BODY_LAYOUT.default;
768
- const rowPaddingX = this._dense && isUseFrameRow ? TABLE_BODY_LAYOUT.paddingX : TABLE_BODY_LAYOUT.paddingX;
769
- const rowStyle = {
770
- 'display': this.isVisible ? '' : 'none',
771
- '--table-body-height': `${rowLayoutY.height}px`,
772
- '--table-body-padding-y': `${rowLayoutY.paddingY}px`,
773
- '--table-body-padding-x': `${rowPaddingX}px`,
774
- '--table-body-font-family': TABLE_BODY_TYPOGRAPHY.fontFamily,
775
- '--table-body-font-weight': TABLE_BODY_TYPOGRAPHY.fontWeight,
776
- '--table-body-font-size': `${TABLE_BODY_TYPOGRAPHY.fontSize}px`,
777
- '--table-body-line-height': `${TABLE_BODY_TYPOGRAPHY.lineHeight}px`,
778
- '--table-body-text-decoration': TABLE_BODY_TYPOGRAPHY.textDecoration,
779
- '--table-border-color': TABLE_BORDER.color,
780
- '--table-border-width': `${TABLE_BORDER.width}px`,
781
- '--table-separator-color': TABLE_SEPARATOR.color,
782
- '--table-separator-width': `${TABLE_SEPARATOR.width}px`,
783
- '--table-separator-dense-width': `${TABLE_SEPARATOR.denseWidth}px`,
784
- };
785
- if (this.separator != null) {
786
- const totalCols = this.visibleColumns.length + (this._selectable ? 1 : 0);
787
- const isDense = this.separator === 4;
788
- return (h(Host, { style: rowStyle }, h("tr", { class: { 'tr': true, 'tr--separator': true, 'tr--separator--dense': isDense } }, h("td", { colSpan: totalCols, class: "td td--separator" }))));
789
- }
790
- return (h(Host, { style: rowStyle }, h("tr", { class: { 'tr': true, 'tr--no-hover': hasRowspan } }, this._selectable && (h("td", { class: {
791
- 'td': true,
792
- 'td--selected': true,
793
- 'sticky-left': true,
794
- 'sticky-left-edge': stickyLeftCount === 0,
795
- 'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
796
- }, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { value: this.isSelected(), onSdUpdate: () => this.handleSelect() }))), stickyLeftCols.map((col, idx) => {
797
- if (this.isCovered(idx))
798
- return null;
799
- const fieldName = typeof col.field === 'string' ? col.field : col.name;
800
- const span = this.getSpanFor(col);
801
- const sdCellClass = this.getCellClassFor(col);
802
- return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
803
- 'td': true,
804
- [`td--${col.align || 'left'}`]: true,
805
- 'sticky-left': true,
806
- 'sticky-left-edge': idx === stickyLeftCount - 1,
807
- 'is-scrolled-left': idx === stickyLeftCount - 1 && this._scrolledLeft,
808
- [`${col.tdClass}`]: Boolean(col.tdClass),
809
- ...this.expandCellClass(sdCellClass),
810
- }, style: { ...this.getStickyStyle(idx), ...this.getFramePaddingStyle(fieldName) } }, h("slot", { name: `${this.tableId}-${fieldName}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
811
- }), middleCols.map((col, relativeIdx) => {
812
- const actualColIdx = stickyLeftCount + relativeIdx;
813
- if (this.isCovered(actualColIdx))
814
- return null;
815
- const fieldName = typeof col.field === 'string' ? col.field : col.name;
816
- const span = this.getSpanFor(col);
817
- const sdCellClass = this.getCellClassFor(col);
818
- return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
819
- td: true,
820
- [`td--${col.align || 'left'}`]: true,
821
- [`${col.tdClass}`]: Boolean(col.tdClass),
822
- ...this.expandCellClass(sdCellClass),
823
- }, style: {
824
- ...this.getStickyStyle(actualColIdx),
825
- ...this.getFramePaddingStyle(fieldName),
826
- } }, h("slot", { name: `${this.tableId}-${fieldName}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
827
- }), stickyRightCols.map((col, relativeIdx) => {
828
- const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
829
- if (this.isCovered(actualColIdx))
830
- return null;
831
- const fieldName = typeof col.field === 'string' ? col.field : col.name;
832
- const span = this.getSpanFor(col);
833
- const sdCellClass = this.getCellClassFor(col);
834
- return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
835
- 'td': true,
836
- [`td--${col.align || 'left'}`]: true,
837
- 'sticky-right': true,
838
- 'sticky-right-edge': relativeIdx === 0,
839
- 'is-scrolled-right': relativeIdx === 0 && this._scrolledRight,
840
- [`${col.tdClass}`]: Boolean(col.tdClass),
841
- ...this.expandCellClass(sdCellClass),
842
- }, style: {
843
- ...this.getStickyStyle(actualColIdx),
844
- ...this.getFramePaddingStyle(fieldName),
845
- } }, h("slot", { name: `${this.tableId}-${fieldName}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
846
- }))));
847
- }
848
- };
849
- SdTr.style = sdTrCss();
850
-
851
- export { SdPagination as sd_pagination, SdTbody as sd_tbody, SdThead as sd_thead, SdTr as sd_tr };