@sellmate/design-system 1.26.1 → 1.27.1

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 (333) hide show
  1. package/dist/cjs/{component.field-YIQ9TAhV.js → component.field-C7it8cZm.js} +2 -2
  2. package/dist/cjs/{component.modal-BFelrSMx.js → component.modal-CrZe2db_.js} +0 -14
  3. package/dist/cjs/component.overlay-CBhFnzM2.js +29 -0
  4. package/dist/cjs/{component.progress-Bmg3vAAy.js → component.progress-DimGJZAd.js} +1 -2
  5. package/dist/cjs/{component.table-DIxmbGBT.js → component.table-BrI3b--h.js} +4 -5
  6. package/dist/cjs/design-system.cjs.js +2 -2
  7. package/dist/cjs/{index-BuaQW9U4.js → index-DsYLSqCp.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/sd-action-modal.cjs.entry.js +12 -10
  10. package/dist/cjs/sd-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
  12. package/dist/cjs/{sd-button.config-eTAJM2iW.js → sd-button.config-BH7gFPmM.js} +1 -2
  13. package/dist/cjs/sd-button_2.cjs.entry.js +2 -2
  14. package/dist/cjs/sd-calendar_2.cjs.entry.js +3 -3
  15. package/dist/cjs/sd-callout.cjs.entry.js +1 -1
  16. package/dist/cjs/sd-card.cjs.entry.js +1 -1
  17. package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
  18. package/dist/cjs/sd-chip-input.cjs.entry.js +1 -1
  19. package/dist/cjs/sd-chip.cjs.entry.js +1 -1
  20. package/dist/cjs/sd-circle-progress.cjs.entry.js +6 -16
  21. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +8 -4
  22. package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
  23. package/dist/cjs/{sd-date-picker.config-CtXmufyj.js → sd-date-picker.config-De7ahWIs.js} +1 -1
  24. package/dist/cjs/sd-date-picker_7.cjs.entry.js +25 -29
  25. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
  26. package/dist/cjs/sd-divider.cjs.entry.js +1 -1
  27. package/dist/cjs/sd-dropdown-button.cjs.entry.js +4 -4
  28. package/dist/cjs/sd-field_3.cjs.entry.js +18 -12
  29. package/dist/cjs/sd-form.cjs.entry.js +1 -1
  30. package/dist/cjs/sd-ghost-button_3.cjs.entry.js +2 -3
  31. package/dist/cjs/sd-guide.cjs.entry.js +1 -1
  32. package/dist/cjs/sd-key-value-table.cjs.entry.js +3 -3
  33. package/dist/cjs/sd-linear-progress.cjs.entry.js +3 -3
  34. package/dist/cjs/sd-loading-container.cjs.entry.js +23 -3
  35. package/dist/cjs/sd-modal-container.cjs.entry.js +1 -1
  36. package/dist/cjs/sd-pagination_4.cjs.entry.js +17 -12
  37. package/dist/cjs/sd-popover.cjs.entry.js +2 -2
  38. package/dist/cjs/sd-popup.cjs.entry.js +9 -14
  39. package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
  40. package/dist/cjs/sd-radio.cjs.entry.js +1 -1
  41. package/dist/cjs/sd-select-list-item_2.cjs.entry.js +7 -7
  42. package/dist/cjs/sd-select_3.cjs.entry.js +10 -10
  43. package/dist/cjs/sd-switch.cjs.entry.js +2 -2
  44. package/dist/cjs/sd-table.cjs.entry.js +10 -10
  45. package/dist/cjs/{sd-table.config-B7MuRLoR.js → sd-table.config-DzC55sap.js} +3 -3
  46. package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
  47. package/dist/cjs/sd-td.cjs.entry.js +2 -2
  48. package/dist/cjs/sd-text-link.cjs.entry.js +2 -3
  49. package/dist/cjs/sd-toast-container.cjs.entry.js +5 -5
  50. package/dist/cjs/sd-toast.cjs.entry.js +3 -3
  51. package/dist/cjs/sd-toggle.cjs.entry.js +3 -4
  52. package/dist/cjs/{tooltipArrow-VQq73W83.js → tooltipArrow-FLiD3ceS.js} +1 -1
  53. package/dist/collection/components/sd-action-modal/sd-action-modal.config.js +10 -8
  54. package/dist/collection/components/sd-circle-progress/sd-circle-progress.config.js +4 -5
  55. package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +2 -2
  56. package/dist/collection/components/sd-field/sd-field.css +5 -0
  57. package/dist/collection/components/sd-field/sd-field.js +30 -4
  58. package/dist/collection/components/sd-file-picker/sd-file-picker.css +2 -5
  59. package/dist/collection/components/sd-file-picker/sd-file-picker.js +14 -17
  60. package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +1 -0
  61. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  62. package/dist/collection/components/sd-input/sd-input.js +2 -2
  63. package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +1 -1
  64. package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
  65. package/dist/collection/components/sd-loading-container/sd-loading-container.js +22 -2
  66. package/dist/collection/components/sd-loading-modal/sd-loading-modal.config.js +4 -4
  67. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +5 -1
  68. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  69. package/dist/collection/components/sd-pagination/sd-pagination.config.js +1 -0
  70. package/dist/collection/components/sd-pagination/sd-pagination.css +1 -1
  71. package/dist/collection/components/sd-pagination/sd-pagination.js +4 -3
  72. package/dist/collection/components/sd-popup/sd-popup.config.js +6 -4
  73. package/dist/collection/components/sd-popup/sd-popup.js +1 -1
  74. package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
  75. package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
  76. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.css +16 -0
  77. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
  78. package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
  79. package/dist/collection/components/sd-select/sd-select.js +4 -4
  80. package/dist/collection/components/sd-switch/sd-switch.js +1 -1
  81. package/dist/collection/components/sd-table/sd-table.config.js +3 -3
  82. package/dist/collection/components/sd-table/sd-table.css +16 -0
  83. package/dist/collection/components/sd-table/sd-table.js +6 -6
  84. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
  85. package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
  86. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
  87. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  88. package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
  89. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  90. package/dist/collection/components/sd-toast-container/sd-toast-container.js +4 -4
  91. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  92. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  93. package/dist/components/index.js +1 -1
  94. package/dist/components/{p-CBXH-GWN.js → p--AZbwi7P.js} +1 -1
  95. package/dist/components/{p-DoJxhlz2.js → p-BFy8txYj.js} +1 -1
  96. package/dist/components/{p-BBRQlkBM.js → p-BHNytAtJ.js} +1 -1
  97. package/dist/components/{p-DlBZuGIN.js → p-BOJALVxB.js} +1 -1
  98. package/dist/components/{p-Dz70SQco.js → p-BQqXWtI6.js} +1 -1
  99. package/dist/components/{p-BnhzUsGP.js → p-BU1H7ElF.js} +1 -1
  100. package/dist/components/{p-C4Vfr3RI.js → p-BV4cnHWn.js} +1 -1
  101. package/dist/components/p-BXcizROm.js +1 -0
  102. package/dist/components/p-BZdgdRXJ.js +1 -0
  103. package/dist/components/{p-BNxNJ3CK.js → p-BaRjXqSM.js} +1 -1
  104. package/dist/components/{p-c9mdxFTZ.js → p-Bk6aI8rL.js} +1 -1
  105. package/dist/components/p-BxphFsxh.js +1 -0
  106. package/dist/components/{p-k89ztBz6.js → p-CIPPETF-.js} +1 -1
  107. package/dist/components/{p-C3rOud8J.js → p-CJcs7kNH.js} +1 -1
  108. package/dist/components/{p-CaQ-qyG-.js → p-CV5LiFKt.js} +1 -1
  109. package/dist/components/p-CiTn4ZiI.js +1 -0
  110. package/dist/components/p-CmK45nj3.js +1 -0
  111. package/dist/components/{p-BOTW76OV.js → p-Cok_EW_N.js} +1 -1
  112. package/dist/components/{p-j1n74q9u.js → p-CvSPsoRb.js} +1 -1
  113. package/dist/components/p-Cw8yDfQh.js +1 -0
  114. package/dist/components/{p-B90EQBEX.js → p-CwwJD-NF.js} +1 -1
  115. package/dist/components/{p-D3dq5pt5.js → p-D7XGOtx0.js} +1 -1
  116. package/dist/components/{p-D6GUzecR.js → p-D9tQwTWy.js} +1 -1
  117. package/dist/{design-system/p-GXE2lEVj.js → components/p-DMrzTImA.js} +1 -1
  118. package/dist/components/{p-UIytIOVz.js → p-DT-e9J59.js} +1 -1
  119. package/dist/components/{p-346Z6-KH.js → p-DTb2c83G.js} +1 -1
  120. package/dist/components/{p-DUHiXyfJ.js → p-DVq9oE_p.js} +1 -1
  121. package/dist/components/p-DYp8I4VH.js +1 -0
  122. package/dist/components/p-De0OtxK5.js +1 -0
  123. package/dist/components/{p-D6AroYk-.js → p-DeXLIS7e.js} +1 -1
  124. package/dist/components/{p-BOJJ_sQS.js → p-DjKOoQuF.js} +1 -1
  125. package/dist/components/{p-DiJvHjSG.js → p-DkaajrxX.js} +1 -1
  126. package/dist/components/p-DmC83_E9.js +1 -0
  127. package/dist/components/{p-BxiJsH7Z.js → p-DnxEeX9I.js} +1 -1
  128. package/dist/components/{p-BSnINeoq.js → p-DsQQFJ8o.js} +1 -1
  129. package/dist/components/{p-DhgwAPO4.js → p-Du_Yc-lW.js} +1 -1
  130. package/dist/components/{p-D9tjoBhH.js → p-Dy6LmOzw.js} +1 -1
  131. package/dist/components/p-NeXvaRu7.js +1 -0
  132. package/dist/components/{p-DsZ3vasC.js → p-PvltLPHp.js} +1 -1
  133. package/dist/components/{p-DGBRubiD.js → p-SROa9QCy.js} +1 -1
  134. package/dist/components/{p-DNRm9_Bv.js → p-hP1aeMuZ.js} +1 -1
  135. package/dist/components/p-jwusYvH0.js +1 -0
  136. package/dist/components/sd-action-modal.js +1 -1
  137. package/dist/components/sd-badge.js +1 -1
  138. package/dist/components/sd-barcode-input.js +1 -1
  139. package/dist/components/sd-button.js +1 -1
  140. package/dist/components/sd-calendar.js +1 -1
  141. package/dist/components/sd-callout.js +1 -1
  142. package/dist/components/sd-card.js +1 -1
  143. package/dist/components/sd-checkbox.js +1 -1
  144. package/dist/components/sd-chip-input.js +1 -1
  145. package/dist/components/sd-chip.js +1 -1
  146. package/dist/components/sd-circle-progress.js +1 -1
  147. package/dist/components/sd-confirm-modal.js +1 -1
  148. package/dist/components/sd-date-box.js +1 -1
  149. package/dist/components/sd-date-picker-trigger.js +1 -1
  150. package/dist/components/sd-date-picker.js +1 -1
  151. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  152. package/dist/components/sd-date-range-picker.js +1 -1
  153. package/dist/components/sd-divider.js +1 -1
  154. package/dist/components/sd-dropdown-button.js +1 -1
  155. package/dist/components/sd-field.js +1 -1
  156. package/dist/components/sd-file-picker.js +1 -1
  157. package/dist/components/sd-floating-portal.js +1 -1
  158. package/dist/components/sd-form.js +1 -1
  159. package/dist/components/sd-ghost-button.js +1 -1
  160. package/dist/components/sd-guide.js +1 -1
  161. package/dist/components/sd-icon.js +1 -1
  162. package/dist/components/sd-input.js +1 -1
  163. package/dist/components/sd-key-value-table.js +1 -1
  164. package/dist/components/sd-linear-progress.js +1 -1
  165. package/dist/components/sd-loading-container.js +1 -1
  166. package/dist/components/sd-loading-modal.js +1 -1
  167. package/dist/components/sd-modal-container.js +1 -1
  168. package/dist/components/sd-number-input.js +1 -1
  169. package/dist/components/sd-pagination.js +1 -1
  170. package/dist/components/sd-popover.js +1 -1
  171. package/dist/components/sd-popup.js +1 -1
  172. package/dist/components/sd-portal.js +1 -1
  173. package/dist/components/sd-radio-button.js +1 -1
  174. package/dist/components/sd-radio-group.js +1 -1
  175. package/dist/components/sd-radio.js +1 -1
  176. package/dist/components/sd-select-list-item-search.js +1 -1
  177. package/dist/components/sd-select-list-item.js +1 -1
  178. package/dist/components/sd-select-listbox.js +1 -1
  179. package/dist/components/sd-select-trigger.js +1 -1
  180. package/dist/components/sd-select.js +1 -1
  181. package/dist/components/sd-switch.js +1 -1
  182. package/dist/components/sd-table.js +1 -1
  183. package/dist/components/sd-tabs.js +1 -1
  184. package/dist/components/sd-tag.js +1 -1
  185. package/dist/components/sd-tbody.js +1 -1
  186. package/dist/components/sd-td.js +1 -1
  187. package/dist/components/sd-text-link.js +1 -1
  188. package/dist/components/sd-textarea.js +1 -1
  189. package/dist/components/sd-thead.js +1 -1
  190. package/dist/components/sd-toast-container.js +1 -1
  191. package/dist/components/sd-toast.js +1 -1
  192. package/dist/components/sd-toggle.js +1 -1
  193. package/dist/components/sd-tooltip.js +1 -1
  194. package/dist/components/sd-tr.js +1 -1
  195. package/dist/design-system/design-system.css +1 -1
  196. package/dist/design-system/design-system.esm.js +1 -1
  197. package/dist/design-system/{p-754c11a8.entry.js → p-06b56059.entry.js} +1 -1
  198. package/dist/design-system/{p-5b184e17.entry.js → p-07755193.entry.js} +1 -1
  199. package/dist/design-system/p-147e0413.entry.js +1 -0
  200. package/dist/design-system/{p-352a72ef.entry.js → p-26297c6e.entry.js} +1 -1
  201. package/dist/design-system/{p-d4097b87.entry.js → p-270c8529.entry.js} +1 -1
  202. package/dist/design-system/{p-9761ef4a.entry.js → p-459a408f.entry.js} +1 -1
  203. package/dist/design-system/{p-a0349edd.entry.js → p-49b1636a.entry.js} +1 -1
  204. package/dist/design-system/{p-20bb91ed.entry.js → p-5142cd06.entry.js} +1 -1
  205. package/dist/design-system/p-51c7839c.entry.js +1 -0
  206. package/dist/design-system/{p-ba5bb1ee.entry.js → p-55c8ce37.entry.js} +1 -1
  207. package/dist/design-system/p-5aa5aec3.entry.js +1 -0
  208. package/dist/design-system/{p-992f9509.entry.js → p-5f1dae23.entry.js} +1 -1
  209. package/dist/design-system/p-5f5f2fbe.entry.js +1 -0
  210. package/dist/design-system/{p-8c5451f2.entry.js → p-65285327.entry.js} +1 -1
  211. package/dist/design-system/{p-4d68b0a8.entry.js → p-6aec5853.entry.js} +1 -1
  212. package/dist/design-system/{p-1680b427.entry.js → p-7540f591.entry.js} +1 -1
  213. package/dist/design-system/p-761c008c.entry.js +1 -0
  214. package/dist/design-system/{p-3064d7c6.entry.js → p-80abdfe7.entry.js} +1 -1
  215. package/dist/design-system/{p-f910d33f.entry.js → p-839e6b5a.entry.js} +1 -1
  216. package/dist/design-system/{p-8001447c.entry.js → p-8ac340db.entry.js} +1 -1
  217. package/dist/design-system/{p-c79bf2eb.entry.js → p-8c1a9374.entry.js} +1 -1
  218. package/dist/design-system/p-947dcc28.entry.js +1 -0
  219. package/dist/design-system/{p-e77fe58a.entry.js → p-9603971e.entry.js} +1 -1
  220. package/dist/design-system/p-9825e76c.entry.js +1 -0
  221. package/dist/design-system/{p-c8e86fb4.entry.js → p-9c0d3011.entry.js} +1 -1
  222. package/dist/design-system/p-B-LOf2aM.js +1 -0
  223. package/dist/design-system/p-BXcizROm.js +1 -0
  224. package/dist/design-system/p-BZg-6aSz.js +2 -0
  225. package/dist/design-system/p-Cw8yDfQh.js +1 -0
  226. package/dist/design-system/{p-d24F7UcR.js → p-D2S9Zafz.js} +1 -1
  227. package/dist/design-system/{p-D6GUzecR.js → p-D9tQwTWy.js} +1 -1
  228. package/dist/design-system/p-De0OtxK5.js +1 -0
  229. package/dist/design-system/{p-BOJJ_sQS.js → p-DjKOoQuF.js} +1 -1
  230. package/dist/design-system/{p-a76a8463.entry.js → p-a4e1dd8c.entry.js} +1 -1
  231. package/dist/design-system/{p-a32704bc.entry.js → p-b84f5550.entry.js} +1 -1
  232. package/dist/design-system/{p-eb1233ff.entry.js → p-b86a69ce.entry.js} +1 -1
  233. package/dist/design-system/{p-90a360ca.entry.js → p-b9387621.entry.js} +1 -1
  234. package/dist/design-system/p-cb0cbcb0.entry.js +1 -0
  235. package/dist/design-system/{p-f089fc54.entry.js → p-d790fbb8.entry.js} +1 -1
  236. package/dist/design-system/{p-f9c0013c.entry.js → p-dae6914d.entry.js} +1 -1
  237. package/dist/design-system/{p-d6329729.entry.js → p-ddb9a2c4.entry.js} +1 -1
  238. package/dist/design-system/{p-9b53de38.entry.js → p-dfa16f49.entry.js} +1 -1
  239. package/dist/design-system/{p-2646a746.entry.js → p-e63bf0e1.entry.js} +1 -1
  240. package/dist/design-system/p-edfb5c83.entry.js +1 -0
  241. package/dist/design-system/{p-89c8585f.entry.js → p-efc55114.entry.js} +1 -1
  242. package/dist/design-system/p-fd671afe.entry.js +1 -0
  243. package/dist/design-system/{p-83a86e6d.entry.js → p-fe2b853f.entry.js} +1 -1
  244. package/dist/design-system/{p-25a11d7d.entry.js → p-ff9ccbf6.entry.js} +1 -1
  245. package/dist/esm/{component.field-BOJJ_sQS.js → component.field-DjKOoQuF.js} +2 -2
  246. package/dist/esm/{component.modal-DOXMJi-V.js → component.modal-Cw8yDfQh.js} +0 -14
  247. package/dist/esm/component.overlay-De0OtxK5.js +27 -0
  248. package/dist/esm/{component.progress-D1vaasIp.js → component.progress-BG5nGnBi.js} +1 -2
  249. package/dist/esm/{component.table-D6GUzecR.js → component.table-D9tQwTWy.js} +4 -5
  250. package/dist/esm/design-system.js +3 -3
  251. package/dist/esm/{index-BZ5lcC25.js → index-BZg-6aSz.js} +1 -1
  252. package/dist/esm/loader.js +3 -3
  253. package/dist/esm/sd-action-modal.entry.js +12 -10
  254. package/dist/esm/sd-badge.entry.js +1 -1
  255. package/dist/esm/sd-barcode-input.entry.js +1 -1
  256. package/dist/esm/{sd-button.config-DjcjlPt7.js → sd-button.config-ClMlDGkX.js} +1 -2
  257. package/dist/esm/sd-button_2.entry.js +2 -2
  258. package/dist/esm/sd-calendar_2.entry.js +3 -3
  259. package/dist/esm/sd-callout.entry.js +1 -1
  260. package/dist/esm/sd-card.entry.js +1 -1
  261. package/dist/esm/sd-checkbox.entry.js +1 -1
  262. package/dist/esm/sd-chip-input.entry.js +1 -1
  263. package/dist/esm/sd-chip.entry.js +1 -1
  264. package/dist/esm/sd-circle-progress.entry.js +6 -16
  265. package/dist/esm/sd-confirm-modal_2.entry.js +8 -4
  266. package/dist/esm/sd-date-box.entry.js +1 -1
  267. package/dist/esm/{sd-date-picker.config-6dvDZPGx.js → sd-date-picker.config-D-ks6qNf.js} +1 -1
  268. package/dist/esm/sd-date-picker_7.entry.js +25 -29
  269. package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
  270. package/dist/esm/sd-divider.entry.js +1 -1
  271. package/dist/esm/sd-dropdown-button.entry.js +4 -4
  272. package/dist/esm/sd-field_3.entry.js +18 -12
  273. package/dist/esm/sd-form.entry.js +1 -1
  274. package/dist/esm/sd-ghost-button_3.entry.js +2 -3
  275. package/dist/esm/sd-guide.entry.js +1 -1
  276. package/dist/esm/sd-key-value-table.entry.js +3 -3
  277. package/dist/esm/sd-linear-progress.entry.js +3 -3
  278. package/dist/esm/sd-loading-container.entry.js +23 -3
  279. package/dist/esm/sd-modal-container.entry.js +1 -1
  280. package/dist/esm/sd-pagination_4.entry.js +17 -12
  281. package/dist/esm/sd-popover.entry.js +2 -2
  282. package/dist/esm/sd-popup.entry.js +9 -14
  283. package/dist/esm/sd-radio-button.entry.js +1 -1
  284. package/dist/esm/sd-radio.entry.js +1 -1
  285. package/dist/esm/sd-select-list-item_2.entry.js +7 -7
  286. package/dist/esm/sd-select_3.entry.js +10 -10
  287. package/dist/esm/sd-switch.entry.js +2 -2
  288. package/dist/esm/{sd-table.config-B3wuA5wX.js → sd-table.config-BbIWNUE2.js} +3 -3
  289. package/dist/esm/sd-table.entry.js +10 -10
  290. package/dist/esm/sd-tabs.entry.js +2 -2
  291. package/dist/esm/sd-td.entry.js +2 -2
  292. package/dist/esm/sd-text-link.entry.js +2 -3
  293. package/dist/esm/sd-toast-container.entry.js +5 -5
  294. package/dist/esm/sd-toast.entry.js +3 -3
  295. package/dist/esm/sd-toggle.entry.js +3 -4
  296. package/dist/esm/{tooltipArrow-ByHjyr3Z.js → tooltipArrow-BAi-pktU.js} +1 -1
  297. package/dist/types/components/sd-field/sd-field.d.ts +5 -0
  298. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +1 -1
  299. package/dist/types/components/sd-loading-container/sd-loading-container.d.ts +6 -0
  300. package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +2 -0
  301. package/dist/types/components/sd-pagination/sd-pagination.config.d.ts +1 -0
  302. package/dist/types/components.d.ts +13 -2
  303. package/hydrate/index.js +176 -153
  304. package/hydrate/index.mjs +176 -153
  305. package/package.json +1 -1
  306. package/dist/components/p-B3bERWUt.js +0 -1
  307. package/dist/components/p-BTWJkT9Y.js +0 -1
  308. package/dist/components/p-BVVYrEje.js +0 -1
  309. package/dist/components/p-B_12VhSA.js +0 -1
  310. package/dist/components/p-C3rAloxT.js +0 -1
  311. package/dist/components/p-CEVDmQdt.js +0 -1
  312. package/dist/components/p-Cmg10jpN.js +0 -1
  313. package/dist/components/p-DLZRxIKh.js +0 -1
  314. package/dist/components/p-DOXMJi-V.js +0 -1
  315. package/dist/components/p-DlROb9xa.js +0 -1
  316. package/dist/components/p-h-EFBJM4.js +0 -1
  317. package/dist/design-system/p-0fcb6fb3.entry.js +0 -1
  318. package/dist/design-system/p-12e7b9fc.entry.js +0 -1
  319. package/dist/design-system/p-250b8e5d.entry.js +0 -1
  320. package/dist/design-system/p-3f16f44b.entry.js +0 -1
  321. package/dist/design-system/p-43c47cd5.entry.js +0 -1
  322. package/dist/design-system/p-6e702726.entry.js +0 -1
  323. package/dist/design-system/p-7cf2305b.entry.js +0 -1
  324. package/dist/design-system/p-8be26652.entry.js +0 -1
  325. package/dist/design-system/p-BZ5lcC25.js +0 -2
  326. package/dist/design-system/p-Cmg10jpN.js +0 -1
  327. package/dist/design-system/p-DOXMJi-V.js +0 -1
  328. package/dist/design-system/p-c4e0c490.entry.js +0 -1
  329. package/dist/design-system/p-f418055d.entry.js +0 -1
  330. /package/dist/components/{p-D1vaasIp.js → p-BG5nGnBi.js} +0 -0
  331. /package/dist/components/{p-Dp6NByuZ.js → p-CGs6_91u.js} +0 -0
  332. /package/dist/design-system/{p-D1vaasIp.js → p-BG5nGnBi.js} +0 -0
  333. /package/dist/design-system/{p-DjcjlPt7.js → p-ClMlDGkX.js} +0 -0
@@ -1 +1 @@
1
- import{r as d,c as e,h as i}from"./p-BZ5lcC25.js";var r={default:{fontWeight:"400",fontSize:"12",lineHeight:"20"},selected:{fontWeight:"500"}},a={default:"#FFFFFF",disabled:"#E1E1E1",hover:"#D9EAFF"},o={default:"#AAAAAA",hover:"#0075FF",active:"#0075FF",disabled:"#CCCCCC"},s={default:"#0075FF",disabled:"#CCCCCC",size:"10"},t={default:"#222222",disabled:"#888888"};const l="16",c="1",h="8",n=s.size,b={default:{fontSize:r.default.fontSize,lineHeight:r.default.lineHeight,fontWeight:r.default.fontWeight},selected:{fontWeight:r.selected.fontWeight}},g={unchecked:{bg:a.default,bgHover:a.hover,border:o.default,borderHover:o.hover},checked:{border:o.active,dot:s.default},disabled:{bg:a.disabled,border:o.disabled,dot:s.disabled},label:{default:t.default,disabled:t.disabled}},f=class{constructor(i){d(this,i),this.update=e(this,"sdUpdate",7)}value;val;disabled=!1;label;update;valueChanged(d){this.value=d}get isSelected(){return String(this.val)===String(this.value)}get radioClasses(){const d=["sd-radio",this.isSelected?"sd-radio--checked":"sd-radio--unchecked"];return this.disabled&&d.push("sd-radio--disabled"),d.join(" ")}handleRadioChange=()=>{this.disabled||(this.value=this.val,this.update.emit(this.value))};render(){return i("label",{key:"cc7ff62ac992791ef81db9212bb5986989f6b4d6",class:this.radioClasses,style:{"--sd-radio-size":`${l}px`,"--sd-radio-border-width":`${c}px`,"--sd-radio-gap":`${h}px`,"--sd-radio-dot-size":`${n}px`,"--sd-radio-font-size":`${b.default.fontSize}px`,"--sd-radio-line-height":`${b.default.lineHeight}px`,"--sd-radio-font-weight":b.default.fontWeight,"--sd-radio-selected-font-weight":b.selected.fontWeight,"--sd-radio-unchecked-bg":g.unchecked.bg,"--sd-radio-unchecked-bg-hover":g.unchecked.bgHover,"--sd-radio-unchecked-border":g.unchecked.border,"--sd-radio-unchecked-border-hover":g.unchecked.borderHover,"--sd-radio-checked-border":g.checked.border,"--sd-radio-checked-dot":g.checked.dot,"--sd-radio-disabled-bg":g.disabled.bg,"--sd-radio-disabled-border":g.disabled.border,"--sd-radio-disabled-dot":g.disabled.dot,"--sd-radio-label-color":g.label.default,"--sd-radio-label-disabled-color":g.label.disabled},"aria-checked":this.isSelected?"true":"false","aria-disabled":this.disabled?"true":"false"},i("input",{key:"20bfeaf5bc322335f5300955ebf653213d662fa6",type:"radio",name:String(this.val),value:String(this.val),checked:this.isSelected,disabled:this.disabled,"aria-label":this.label||String(this.val),onInput:this.handleRadioChange}),i("span",{key:"61d8bdfdb5f8309b8832b89ea2979db5b80968c8",class:"sd-radio__circle"}),this.label&&i("span",{key:"cc2a5402e4745aaae897c8f37d5fc287a2ba9b29",class:"sd-radio__label","data-label":this.label},this.label))}static get watchers(){return{value:[{valueChanged:0}]}}};f.style='sd-radio{display:inline-flex;width:fit-content;height:var(--sd-radio-line-height);line-height:0}sd-radio .sd-radio{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-radio-gap);height:var(--sd-radio-line-height);max-height:var(--sd-radio-line-height)}sd-radio .sd-radio>input{position:absolute;width:0;height:0;opacity:0;pointer-events:none}sd-radio .sd-radio>input:focus-visible+.sd-radio__circle{box-shadow:0 0 0 2px white, 0 0 0 4px var(--sd-radio-checked-border);outline:none}sd-radio .sd-radio__circle{position:relative;width:var(--sd-radio-size);height:var(--sd-radio-size);border-radius:50%;border:var(--sd-radio-border-width) solid var(--sd-radio-unchecked-border);box-sizing:border-box;background:var(--sd-radio-unchecked-bg);display:inline-flex;flex-shrink:0}sd-radio .sd-radio__label{font-size:var(--sd-radio-font-size);font-weight:var(--sd-radio-font-weight);color:var(--sd-radio-label-color);line-height:var(--sd-radio-line-height);display:inline-flex;flex-direction:column}sd-radio .sd-radio__label::before{content:attr(data-label);height:0;font-weight:var(--sd-radio-selected-font-weight);visibility:hidden;overflow:hidden;user-select:none;pointer-events:none}sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle{background:var(--sd-radio-unchecked-bg-hover);border-color:var(--sd-radio-unchecked-border-hover)}sd-radio .sd-radio--checked .sd-radio__label{font-weight:var(--sd-radio-selected-font-weight)}sd-radio .sd-radio--checked .sd-radio__circle{border-color:var(--sd-radio-checked-border)}sd-radio .sd-radio--checked .sd-radio__circle::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:var(--sd-radio-dot-size);height:var(--sd-radio-dot-size);border-radius:50%;background:var(--sd-radio-checked-dot)}sd-radio .sd-radio--disabled{cursor:not-allowed}sd-radio .sd-radio--disabled .sd-radio__label{color:var(--sd-radio-label-disabled-color)}sd-radio .sd-radio--disabled .sd-radio__circle{background:var(--sd-radio-disabled-bg);border-color:var(--sd-radio-disabled-border)}sd-radio .sd-radio--disabled.sd-radio--checked .sd-radio__circle::after{background:var(--sd-radio-disabled-dot)}';export{f as sd_radio}
1
+ import{r as d,c as e,h as i}from"./p-BZg-6aSz.js";var r={default:{fontWeight:"400",fontSize:"12",lineHeight:"20"},selected:{fontWeight:"500"}},a={default:"#FFFFFF",disabled:"#E1E1E1",hover:"#D9EAFF"},o={default:"#AAAAAA",hover:"#0075FF",active:"#0075FF",disabled:"#CCCCCC"},s={default:"#0075FF",disabled:"#CCCCCC",size:"10"},t={default:"#222222",disabled:"#888888"};const l="16",c="1",h="8",n=s.size,b={default:{fontSize:r.default.fontSize,lineHeight:r.default.lineHeight,fontWeight:r.default.fontWeight},selected:{fontWeight:r.selected.fontWeight}},g={unchecked:{bg:a.default,bgHover:a.hover,border:o.default,borderHover:o.hover},checked:{border:o.active,dot:s.default},disabled:{bg:a.disabled,border:o.disabled,dot:s.disabled},label:{default:t.default,disabled:t.disabled}},f=class{constructor(i){d(this,i),this.update=e(this,"sdUpdate",7)}value;val;disabled=!1;label;update;valueChanged(d){this.value=d}get isSelected(){return String(this.val)===String(this.value)}get radioClasses(){const d=["sd-radio",this.isSelected?"sd-radio--checked":"sd-radio--unchecked"];return this.disabled&&d.push("sd-radio--disabled"),d.join(" ")}handleRadioChange=()=>{this.disabled||(this.value=this.val,this.update.emit(this.value))};render(){return i("label",{key:"cc7ff62ac992791ef81db9212bb5986989f6b4d6",class:this.radioClasses,style:{"--sd-radio-size":`${l}px`,"--sd-radio-border-width":`${c}px`,"--sd-radio-gap":`${h}px`,"--sd-radio-dot-size":`${n}px`,"--sd-radio-font-size":`${b.default.fontSize}px`,"--sd-radio-line-height":`${b.default.lineHeight}px`,"--sd-radio-font-weight":b.default.fontWeight,"--sd-radio-selected-font-weight":b.selected.fontWeight,"--sd-radio-unchecked-bg":g.unchecked.bg,"--sd-radio-unchecked-bg-hover":g.unchecked.bgHover,"--sd-radio-unchecked-border":g.unchecked.border,"--sd-radio-unchecked-border-hover":g.unchecked.borderHover,"--sd-radio-checked-border":g.checked.border,"--sd-radio-checked-dot":g.checked.dot,"--sd-radio-disabled-bg":g.disabled.bg,"--sd-radio-disabled-border":g.disabled.border,"--sd-radio-disabled-dot":g.disabled.dot,"--sd-radio-label-color":g.label.default,"--sd-radio-label-disabled-color":g.label.disabled},"aria-checked":this.isSelected?"true":"false","aria-disabled":this.disabled?"true":"false"},i("input",{key:"20bfeaf5bc322335f5300955ebf653213d662fa6",type:"radio",name:String(this.val),value:String(this.val),checked:this.isSelected,disabled:this.disabled,"aria-label":this.label||String(this.val),onInput:this.handleRadioChange}),i("span",{key:"61d8bdfdb5f8309b8832b89ea2979db5b80968c8",class:"sd-radio__circle"}),this.label&&i("span",{key:"cc2a5402e4745aaae897c8f37d5fc287a2ba9b29",class:"sd-radio__label","data-label":this.label},this.label))}static get watchers(){return{value:[{valueChanged:0}]}}};f.style='sd-radio{display:inline-flex;width:fit-content;height:var(--sd-radio-line-height);line-height:0}sd-radio .sd-radio{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-radio-gap);height:var(--sd-radio-line-height);max-height:var(--sd-radio-line-height)}sd-radio .sd-radio>input{position:absolute;width:0;height:0;opacity:0;pointer-events:none}sd-radio .sd-radio>input:focus-visible+.sd-radio__circle{box-shadow:0 0 0 2px white, 0 0 0 4px var(--sd-radio-checked-border);outline:none}sd-radio .sd-radio__circle{position:relative;width:var(--sd-radio-size);height:var(--sd-radio-size);border-radius:50%;border:var(--sd-radio-border-width) solid var(--sd-radio-unchecked-border);box-sizing:border-box;background:var(--sd-radio-unchecked-bg);display:inline-flex;flex-shrink:0}sd-radio .sd-radio__label{font-size:var(--sd-radio-font-size);font-weight:var(--sd-radio-font-weight);color:var(--sd-radio-label-color);line-height:var(--sd-radio-line-height);display:inline-flex;flex-direction:column}sd-radio .sd-radio__label::before{content:attr(data-label);height:0;font-weight:var(--sd-radio-selected-font-weight);visibility:hidden;overflow:hidden;user-select:none;pointer-events:none}sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle{background:var(--sd-radio-unchecked-bg-hover);border-color:var(--sd-radio-unchecked-border-hover)}sd-radio .sd-radio--checked .sd-radio__label{font-weight:var(--sd-radio-selected-font-weight)}sd-radio .sd-radio--checked .sd-radio__circle{border-color:var(--sd-radio-checked-border)}sd-radio .sd-radio--checked .sd-radio__circle::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:var(--sd-radio-dot-size);height:var(--sd-radio-dot-size);border-radius:50%;background:var(--sd-radio-checked-dot)}sd-radio .sd-radio--disabled{cursor:not-allowed}sd-radio .sd-radio--disabled .sd-radio__label{color:var(--sd-radio-label-disabled-color)}sd-radio .sd-radio--disabled .sd-radio__circle{background:var(--sd-radio-disabled-bg);border-color:var(--sd-radio-disabled-border)}sd-radio .sd-radio--disabled.sd-radio--checked .sd-radio__circle::after{background:var(--sd-radio-disabled-dot)}';export{f as sd_radio}
@@ -0,0 +1 @@
1
+ import{r as e,a as t,h as i,c as s,F as d}from"./p-BZg-6aSz.js";import{f as o}from"./p-DjKOoQuF.js";import{T as l}from"./p-B-LOf2aM.js";const n={start:"flex-start",center:"center",end:"flex-end"},a=o.field.label.sm,r=o.field.label.md,f={sm:{height:a.height,gap:a.gap,icon:a.icon,fontSize:a.typography.fontSize,lineHeight:a.typography.lineHeight,fontWeight:a.typography.fontWeight},md:{height:r.height,gap:r.gap,icon:r.icon,fontSize:r.typography.fontSize,lineHeight:r.typography.lineHeight,fontWeight:r.typography.fontWeight}},h=["sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select","sd-file-picker","sd-date-picker","sd-date-range-picker","sd-chip-input"],c=class{constructor(t){e(this,t)}get el(){return t(this)}name="";rules=[];error=!1;disabled=!1;readonly=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";size="sm";borderless=!1;label="";labelWidth="";addonLabel="";addonAlign="start";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.readonly?(e="readonly",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),void 0!==this.status&&(e=this.status),this.error&&(e="error"),""!==e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of h){const t=this.el.closest(e);if(t&&"value"in t)return t}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const t=e(this.value??"");if(!0!==t)return this.setError(!0,t),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,t){this.errorMsg=t,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,t=o.field.addonLabel,s=this.size in f?this.size:"sm",d=f[s],l={"--sd-field-wrapper-height":`var(--sd-system-size-field-${s}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${s})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${s}-gap)`},a={"--sd-field-error-message-color":o.field.errorMessage.color,"--sd-field-error-message-font-size":`${o.field.errorMessage.typography.fontSize}px`,"--sd-field-error-message-line-height":`${o.field.errorMessage.typography.lineHeight}px`,"--sd-field-hint-color":o.field.hint.color,"--sd-field-hint-font-size":`${o.field.hint.typography.fontSize}px`,"--sd-field-hint-line-height":`${o.field.hint.typography.lineHeight}px`,"--sd-field-message-gap":`${o.field.contents.gap}px`},r=""!==this.label?{"--sd-field-label-height":`${d.height}px`,"--sd-field-label-gap":`${d.gap}px`,"--sd-field-label-font-size":`${d.fontSize}px`,"--sd-field-label-line-height":`${d.lineHeight}px`,"--sd-field-label-font-weight":d.fontWeight,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},h=""!==e?{"--sd-field-addon-padding-x":`${t.paddingX}px`,"--sd-field-addon-font-size":`${t.typography.fontSize}px`,"--sd-field-addon-line-height":`${t.typography.lineHeight}px`,"--sd-field-addon-font-weight":t.typography.fontWeight,"--sd-field-addon-bg":t.bg,"--sd-field-addon-border-color":this.disabled?t.border.disabled:t.border.default,"--sd-field-addon-gap":`${t.gap}px`,"--sd-field-addon-border-width":`${t.border.width}px`,"--sd-field-addon-justify":n[this.addonAlign]??n.start,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-addon-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{};return i("div",{key:"bce0bc8ccc19e41c2a61980bd12f07d7f8838569",class:{"sd-field":!0,"sd-field--has-label":""!==this.label,"sd-field--has-addon":""!==e,"sd-field--borderless":this.borderless,[this.fieldStatus]:""!==this.fieldStatus},style:{...l,...r,...h,...a}},i("div",{key:"c6c4e3ec6e018ebd0dc6fbbae5fbaef4ea6503e5",class:"sd-field__wrapper"},this.renderLabel(this.label),i("div",{key:"bd778a24325412924e0a331db592535e4b4e542b",class:"sd-field__main"},i("div",{key:"485cfbdbfa7299cb27d84e61306d6e2cf196d071",class:{"sd-field__control":!0,"sd-field__control--has-addon":""!==e},style:""!==this.width&&0!==this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width}:{}},e&&i("div",{key:"510238ac22b7e923724cc20abf2541adbddcb594",class:"sd-field__addon"},this.icon&&i("sd-icon",{key:"2cca5b62cbe56050acd536764c33cbc3009f740b",name:this.icon.name,size:this.icon.size??Number(f[this.size in f?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate}),e),i("slot",{key:"470c0d559409a11f1c5650e88a50555a4656d3f9"})),""!==this.errorMsg||""!==this.errorMessage?i("div",{class:"sd-field__error-message"},""!==this.errorMsg?this.errorMsg:this.errorMessage):""!==this.hint&&i("div",{class:"sd-field__hint"},this.hint))))}renderLabel(e){return null==e||""===e?null:i("label",{class:"sd-field__label"},this.icon&&i("sd-icon",{name:this.icon.name,size:this.icon.size??Number(f[this.size in f?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),i("div",{class:"sd-field__label__text"},e),this.labelTooltip&&i("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip))}};c.style="sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--readonly .sd-field__wrapper .sd-field__control{background-color:var(--sd-system-color-field-bg-read-only);color:var(--sd-system-color-field-text-read-only)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;justify-content:var(--sd-field-addon-justify, flex-start);white-space:nowrap;box-sizing:border-box;flex-shrink:0;width:var(--sd-field-addon-width, auto);padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled):not(.sd-field--readonly) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus:not(.sd-field--readonly) .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--borderless .sd-field__wrapper .sd-field__control,sd-field .sd-field.sd-field--borderless.sd-field--error .sd-field__wrapper .sd-field__control:not(:hover),sd-field .sd-field.sd-field--borderless.sd-field--pass .sd-field__wrapper .sd-field__control,sd-field .sd-field.sd-field--borderless:not(.sd-field--disabled):not(.sd-field--readonly) .sd-field__wrapper .sd-field__control:hover,sd-field .sd-field.sd-field--borderless.sd-field--focus:not(.sd-field--readonly) .sd-field__wrapper .sd-field__control{border-color:transparent !important;background:transparent !important;box-shadow:none !important}sd-field .sd-field .sd-field__error-message{color:var(--sd-field-error-message-color);font-size:var(--sd-field-error-message-font-size);line-height:var(--sd-field-error-message-line-height);margin-top:var(--sd-field-message-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-field-hint-color);font-size:var(--sd-field-hint-font-size);line-height:var(--sd-field-hint-line-height);margin-top:var(--sd-field-message-gap)}";const p=class{constructor(t){e(this,t),this.close=s(this,"sdClose",7)}get el(){return t(this)}to="body";parentRef=null;offset=[0,0];zIndex=996;placement="bottom";open=!1;close;container;wrapper;rafId;isInsideClick=!1;resizeObserver;mutationObserver;scrollHandler=()=>this.updatePosition();static ARROW_SIZE=11.2;componentDidLoad(){this.container=this.resolveContainer(),this.createWrapper(),this.moveSlotContent(),requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")})),this.observeParent(),window.addEventListener("scroll",this.scrollHandler,!0)}componentDidRender(){this.wrapper&&(this.open?(this.wrapper.style.display="block",requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")}))):(this.wrapper.style.display="none",this.wrapper.style.visibility="hidden"))}disconnectedCallback(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("scroll",this.scrollHandler,!0),this.unobserveParent(),this.wrapper?.remove()}resolveContainer(){const e="string"==typeof this.to?document.querySelector(this.to):this.to;return e instanceof HTMLElement?e:document.body}resolveZIndex(){const e=this.zIndex??996,t=this.parentRef?.closest(".sd-modal-container__layer");if(!t)return e;const i=t.closest(".sd-modal-container"),s=i instanceof HTMLElement?parseInt(getComputedStyle(i).zIndex,10):NaN,d=Number.isFinite(s)?s:997;return Math.max(e,d+1)}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",zIndex:this.resolveZIndex().toString(),transition:"opacity 0.4s",top:"-9999px",left:"-9999px"}),this.container.appendChild(this.wrapper)}moveSlotContent(){this.wrapper&&Array.from(this.el.childNodes).filter((e=>e.nodeType!==Node.COMMENT_NODE)).forEach((e=>this.wrapper.appendChild(e)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const e=this.parentRef.getBoundingClientRect();if(0===e.width&&0===e.height)return;const[t,i]=this.offset??[0,0],s=p.ARROW_SIZE;let d=0,o=0;switch(this.placement??"bottom"){case"top":d=e.top-this.wrapper.offsetHeight+i-s,o=e.left+e.width/2-this.wrapper.offsetWidth/2+t;break;case"bottom":d=e.bottom+i+s,o=e.left+e.width/2-this.wrapper.offsetWidth/2+t;break;case"left":d=e.top+e.height/2-this.wrapper.offsetHeight/2+i,o=e.left-this.wrapper.offsetWidth-t-s;break;case"right":d=e.top+e.height/2-this.wrapper.offsetHeight/2+i,o=e.right+t+s}Object.assign(this.wrapper.style,{top:`${d}px`,left:`${o}px`})}))}observeParent(){this.parentRef&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef),this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}unobserveParent(){this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}handleMouseDown(e){this.isInsideClick=!!(this.wrapper&&this.wrapper.contains(e.target)||this.parentRef&&this.parentRef.contains(e.target))}handleWindowClick(e){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(e.target)||this.close.emit()}handleKeydown(e){"Escape"===e.key&&this.close.emit()}render(){return i("slot",{key:"487d3c23320bd5f44492e3fb84e3cb357605de39"})}};p.style=".sd-floating-menu{width:fit-content;padding:12px 16px;border-radius:6px;font-size:12px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);animation:sd-floating-fade-in 0.35s ease-out}.sd-floating-menu--top{animation-name:sd-floating-slide-top}.sd-floating-menu--bottom{animation-name:sd-floating-slide-bottom}.sd-floating-menu--left{animation-name:sd-floating-slide-left}.sd-floating-menu--right{animation-name:sd-floating-slide-right}.sd-floating-menu .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--default{background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);font-weight:500}.sd-floating-menu--default .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--danger{background:var(--sd-floating-bg, #FCE6E6);color:var(--sd-floating-content, #FB4444);font-weight:700}.sd-floating-menu--danger .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FCE6E6)}.sd-floating-menu--warning{background:var(--sd-floating-bg, #FEF1EA);color:var(--sd-floating-content, #FF6B00);font-weight:700}.sd-floating-menu--warning .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FEF1EA)}.sd-floating-menu--accent{background:var(--sd-floating-bg, #E6F1FF);color:var(--sd-floating-content, #0075FF);font-weight:700}.sd-floating-menu--accent .sd-floating-menu__arrow{color:var(--sd-floating-bg, #E6F1FF)}.sd-floating-menu__arrow{position:absolute;display:flex;width:16px;height:12px}.sd-floating-menu__arrow svg{width:100%;height:100%}.sd-floating-menu__arrow--top{bottom:-12px;left:50%;transform:translateX(-50%)}.sd-floating-menu__arrow--bottom{top:-12px;left:50%;transform:translateX(-50%) rotate(180deg)}.sd-floating-menu__arrow--left{right:-12px;top:50%;transform:translateY(-50%) rotate(-90deg)}.sd-floating-menu__arrow--right{left:-12px;top:50%;transform:translateY(-50%) rotate(90deg)}.sd-floating-menu__content{font-size:12px;line-height:20px}.sd-floating-menu__content .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px;margin-bottom:4px}.sd-floating-menu__content .sd-floating-menu__messages{font-weight:500}.sd-floating-menu__content .sd-floating-menu__buttons{margin-top:12px;display:flex;gap:8px;align-items:center;justify-content:flex-end}.sd-floating-menu__content .sd-floating-menu__buttons--with-link{justify-content:space-between}.sd-floating-menu--popover{padding:16px 20px}.sd-floating-menu--popover .sd-floating-menu__content{gap:4px}.sd-floating-menu--popover .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px}.sd-floating-menu--popover .sd-floating-menu__messages{font-size:12px;font-weight:500;line-height:20px}.sd-floating-menu--closing{animation:sd-floating-fade-out 0.15s ease-in forwards}.sd-floating-menu--closing.sd-floating-menu--top{animation-name:sd-floating-slide-out-top}.sd-floating-menu--closing.sd-floating-menu--bottom{animation-name:sd-floating-slide-out-bottom}.sd-floating-menu--closing.sd-floating-menu--left{animation-name:sd-floating-slide-out-left}.sd-floating-menu--closing.sd-floating-menu--right{animation-name:sd-floating-slide-out-right}.sd-floating-menu--has-close .sd-floating-menu__content{padding-right:28px}.sd-floating-menu__close-button{position:absolute;top:12px;right:12px}@keyframes sd-floating-fade-out{from{opacity:1}to{opacity:0}}@keyframes sd-floating-slide-out-top{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes sd-floating-slide-out-bottom{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes sd-floating-slide-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes sd-floating-slide-out-right{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes sd-floating-fade-in{from{opacity:0}to{opacity:1}}@keyframes sd-floating-slide-top{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-bottom{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-left{from{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes sd-floating-slide-right{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}";var g={bg:"#07284A",content:"#FFFFFF"},m={bg:"#FCEFEF",content:"#FB4444"},b={bg:"#FEF1EA",content:"#FF6B00"},u={bg:"#E6F1FF",content:"#0075FF"};const _={default:{bg:g.bg,content:g.content},danger:{bg:m.bg,content:m.content},warning:{bg:b.bg,content:b.content},accent:{bg:u.bg,content:u.content}},v=class{constructor(t){e(this,t)}get el(){return t(this)}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";useClose=!1;sdClass="";message=[];triggerClass="";triggerStyle="";showTooltip=!1;slotContentHTML="";buttonEl;triggerEl;isAnchorMode=!1;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;openTooltip=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};closeTooltip=()=>{this.menuEl&&this.menuEl.classList.add("sd-floating-menu--closing"),this.closeTimeout=setTimeout((()=>{this.showTooltip=!1}),v.CLOSE_ANIM_MS)};startHideTimer=()=>{this.hideTimeout=setTimeout((()=>this.closeTooltip()),100)};cancelHideTimer=()=>{this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=void 0)};get tooltipOffset(){switch(this.placement??"top"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>!this.useClose&&this.closeTooltip();async show(){this.openTooltip()}async hide(){this.closeTooltip()}componentWillLoad(){this.isAnchorMode=Array.from(this.el.children).some((e=>"anchor"===e.getAttribute("slot"))),this.isAnchorMode||(this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren()),this.el.classList.toggle("visible",!0)}componentDidRender(){this.triggerEl&&""!==this.triggerStyle&&this.triggerEl.setAttribute("style",this.triggerStyle)}render(){const e=this.trigger??"hover",t=this.placement??"top",s=this.tooltipType??"default",o=this.icon??"helpOutline",n=this.color??"#01BB4B",a=_[s]??_.default,r=()=>this.showTooltip=!this.showTooltip,f=void 0!==this.label&&""!==this.label,h=this.isAnchorMode,c="hover"===e?{onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()}:h||!f?{onClick:r}:{},p="click"===e&&!h&&f?{onSdClick:r}:{},g=["sd-tooltip-trigger",this.sdClass,this.triggerClass].filter((e=>void 0!==e&&""!==e)).join(" "),m=this.message&&this.message.length>0?this.message.map((e=>`<div>${e}</div>`)).join(""):this.slotContentHTML;return i(d,{key:"682acd0035e35645b1ddcb5b9bfa796f135d26ce"},i("div",{key:"63550c550389759026812d624bfb8fc152a61dfa",ref:e=>this.triggerEl=e,class:g,...c},h?i("slot",{name:"anchor"}):f?i("sd-button",{ref:e=>this.buttonEl=e,name:this.name??"primary_sm",label:this.label,icon:o,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel,disabled:this.disabled,type:this.type??"button",class:"sd-tooltip",...p}):i("sd-icon",{ref:e=>this.buttonEl=e,name:o,size:this.iconSize??12,color:n,class:"sd-tooltip"})),this.showTooltip&&i("sd-floating-portal",{key:"84c71d8f766d79831e262810918085de1cb76a69",parentRef:h?this.triggerEl:this.buttonEl,onSdClose:this.handleClose,placement:t,offset:this.tooltipOffset},i("div",{key:"622676ac69e0563623a7dfa6ebb9f8d0b8d7761d",ref:e=>this.menuEl=e,class:{"sd-floating-menu":!0,[`sd-floating-menu--${s}`]:!0,[`sd-floating-menu--${t}`]:!0,"sd-floating-menu--has-close":this.useClose},style:{"--sd-floating-bg":a.bg,"--sd-floating-content":a.content},onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()},i("i",{key:"e81b686f152e408e7affc9181e2a19cb0aece8cd",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${t}`},i(l,{key:"a91ee4a5c1b2564b63d061c32f5013be6f28b0d0"})),i("div",{key:"77671787b0ee0beb851c7a35a04f8df826b268a8",class:"sd-floating-menu__content",innerHTML:m}),this.useClose&&i("sd-ghost-button",{key:"74e41984b8589dba31feb6f269c4ce7ed8fe3c6f",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xxs",onClick:()=>this.closeTooltip()}))))}};v.style="sd-tooltip{visibility:hidden !important;display:inline-flex}sd-tooltip.visible{visibility:visible !important}sd-tooltip .sd-tooltip-trigger{display:inline-flex;position:relative;cursor:pointer;align-items:center;justify-content:center}";export{c as sd_field,p as sd_floating_portal,v as sd_tooltip}
@@ -1 +1 @@
1
- import{r as t,c as e,a as i,h as s,H as n}from"./p-BZ5lcC25.js";var o={size:"16",icon:"12"},a={size:"24",icon:"16"},r={size:"28",icon:"20"},h={size:"36",icon:"24"},d={size:"62",icon:"32"},c={sm:"4",md:"6"},l={opacity:"5%"},g={disabled:"#BBBBBB"},u={content:"#888888",hover:{bg:"#222222"}},b={content:"#E30000",hover:{bg:"#E30000"}},p={content:"#025497",hover:{bg:"#0075FF"}},f={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const m={xxs:{size:Number(o.size),icon:Number(o.icon)},xs:{size:Number(a.size),icon:Number(a.icon)},sm:{size:Number(r.size),icon:Number(r.icon)},md:{size:Number(h.size),icon:Number(h.icon)},lg:{size:Number(d.size),icon:Number(d.icon)}},v={xxs:Number(c.sm),xs:Number(c.sm),sm:Number(c.sm),md:Number(c.md),lg:Number(c.md)},x=l.opacity,y={default:u.content,danger:b.content,action:p.content,inverse:f.content},F={default:u.hover.bg,danger:b.hover.bg,action:p.hover.bg,inverse:f.hover.bg},w=g.disabled,z={default:w,danger:w,action:w,inverse:f.disabled},k=class{constructor(i){t(this,i),this.click=e(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";tooltipText;disabled=!1;get hostEl(){return i(this)}isTooltipOpen=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};handleMouseEnter=()=>{this.isTooltipOpen=!0};handleMouseLeave=()=>{this.isTooltipOpen=!1};handleFocus=()=>{this.isTooltipOpen=!0};handleBlur=()=>{this.isTooltipOpen=!1};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",e=this.intent??"default",i=m[t]??m.sm,n=this.disabled?z[e]:y[e],o=(this.ariaLabel??"").trim()||void 0,a=(this.tooltipText??"").trim();return s("button",{key:"9d2d352d36c7c34c67d8c57de6236d72727bd078",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled},type:"button","aria-disabled":this.disabled?"true":void 0,tabIndex:this.disabled?-1:void 0,"aria-label":o,style:{"--sd-ghost-button-size":`${i.size}px`,"--sd-ghost-button-radius":`${v[t]}px`,"--sd-ghost-button-hover-bg":F[e],"--sd-ghost-button-hover-opacity":x,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},a.length>0&&this.isTooltipOpen&&s("sd-portal",{key:"1a73fb53be28a622d03e4f20be0b30e0e76bccd4",parentRef:this.hostEl,open:!0,offset:[i.size/2,4],placement:"top"},s("div",{key:"e4a349dbfbf2fd16eed9a46f5e2ed43935212cfe",class:"sd-ghost-button__tooltip-inner","aria-hidden":"true"},s("sd-tag",{key:"4aa1525a6da6ee72daf1815f1440d665bd1cf2c8",name:"square_xs_grey",label:a}))),s("sd-icon",{key:"4caac22d0d888c1998032697043e3a3761e012aa",name:this.icon,size:i.icon,color:n}))}};k.style='sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}.sd-ghost-button__tooltip-inner{display:inline-flex;white-space:nowrap;transform:translateX(-50%)}[data-align=right] .sd-ghost-button__tooltip-inner{transform:none}';const $=class{constructor(i){t(this,i),this.close=e(this,"sdClose",3)}get hostEl(){return i(this)}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=996;open=!1;placement="bottom";close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof HTMLElement?t:document.body}resolveZIndex(){const t=this.zIndex??996,e=this.parentRef?.closest(".sd-modal-container__layer");if(!e)return t;const i=e.closest(".sd-modal-container"),s=i instanceof HTMLElement?parseInt(getComputedStyle(i).zIndex,10):NaN,n=Number.isFinite(s)?s:997;return Math.max(t,n+1)}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",top:"0",left:"0",zIndex:this.resolveZIndex().toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),e=window.innerWidth,i=window.innerHeight,s=this.offset??[0,4],n=Math.max(0,this.viewportPadding??0),o=Math.max(e-2*n,0),a=Math.max(i-2*n,0);this.wrapper.style.maxWidth=`${o}px`,this.wrapper.style.maxHeight=`${a}px`;const r=this.wrapper.getBoundingClientRect(),h=i-t.bottom-s[1]-n,d=t.top-s[1]-n;let c,l=t.left+s[0];"top"===(this.placement??"bottom")?(c=t.top-r.height-s[1],d<r.height&&h>d&&(c=t.bottom+s[1])):(c=t.bottom+s[1],h<r.height&&d>h&&(c=t.top-r.height-s[1]));const g=i-n-r.height;c=g<n?n:Math.min(Math.max(c,n),g);const u=l+r.width>e-n,b=n,p=e-n-r.width;this.wrapper.style.top=`${c}px`,p<b?(this.wrapper.style.left=`${b}px`,this.wrapper.style.right="auto",delete this.wrapper.dataset.align):u?(this.wrapper.style.left="auto",this.wrapper.style.right=e-t.right+"px",this.wrapper.dataset.align="right"):(this.wrapper.style.right="auto",delete this.wrapper.dataset.align,l=Math.min(Math.max(l,b),p),this.wrapper.style.left=`${l}px`),this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const e=this.getScrollParents(t);e.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=e}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const e=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:s,overflowY:n}=getComputedStyle(i);[t,s,n].some((t=>/(auto|scroll|overlay)/.test(t)))&&e.push(i),i=i.parentElement}return e}isInsideTarget(t){return!(!this.wrapper?.contains(t)&&!this.parentRef?.contains(t))}handleMouseDown(t){this.open&&(this.isInsideClick=this.isInsideTarget(t.target))}handleWindowClick(t){this.open&&(this.isInsideClick?this.isInsideClick=!1:this.isInsideTarget(t.target)||this.close.emit())}render(){return s("slot",{key:"623ee5423b145701ba9dd801d44874214f7a76e3"})}static get watchers(){return{open:[{handleOpenChange:0}]}}};$.style=":host { display: none !important; }";var E={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},_={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},N={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},C={content:"#FB4444",bg:"#FCEFEF"},M={content:"#FF6B00",bg:"#FEF1EA"},S={content:"#916C0D",bg:"#FFF7DD"},O={content:"#00973C",bg:"#E8F9EF"},W={content:"#0075FF",bg:"#E6F1FF"},L={content:"#006AC1",bg:"#EAF5FE"},B={content:"#004290",bg:"#EFF6FF"},I={content:"#737373",bg:"#EEEEEE"};const T=["xs","sm","md"],H=["grey","red","orange","yellow","green","blue","darkblue","indigo"],P={grey:{background:I.bg,content:I.content,icon:I.content},red:{background:C.bg,content:C.content,icon:C.content},orange:{background:M.bg,content:M.content,icon:M.content},yellow:{background:S.bg,content:S.content,icon:S.content},green:{background:O.bg,content:O.content,icon:O.content},blue:{background:W.bg,content:W.content,icon:W.content},darkblue:{background:L.bg,content:L.content,icon:L.content},indigo:{background:B.bg,content:B.content,icon:B.content}},j={xs:{height:`${E.height}px`,paddingX:`${E.paddingX}px`,gap:`${E.gap}px`,fontSize:`${E.typography.fontSize}px`,fontWeight:E.typography.fontWeight,lineHeight:`${E.typography.lineHeight}px`,iconSize:12,radius:`${E.radius}px`},sm:{height:`${_.height}px`,paddingX:`${_.paddingX}px`,gap:`${_.gap}px`,fontSize:`${_.typography.fontSize}px`,fontWeight:_.typography.fontWeight,lineHeight:`${_.typography.lineHeight}px`,iconSize:16,radius:`${_.radius}px`},md:{height:`${N.height}px`,paddingX:`${N.paddingX}px`,gap:`${N.gap}px`,fontSize:`${N.typography.fontSize}px`,fontWeight:N.typography.fontWeight,lineHeight:`${N.typography.lineHeight}px`,iconSize:16,radius:`${N.radius}px`}},A={xs:{...j.xs,radius:"999px"},sm:{...j.sm,radius:"999px"},md:{...j.md,radius:"999px"}},X=Object.fromEntries(["square","pill"].flatMap((t=>T.flatMap((e=>H.map((i=>[`${t}_${e}_${i}`,{shape:t,size:e,color:i,..."square"===t?j[e]:A[e],...P[i]}]))))))),q=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;width="";componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(X,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return X[this.resolvedName]}renderIcon(t,e){return null==this.icon?null:s("sd-icon",{class:"sd-tag__icon",name:this.icon,size:e,color:t})}get resolvedWidth(){if(""!==this.width&&0!==this.width)return"number"==typeof this.width?`${this.width}px`:this.width}render(){const t=this.resolvedConfig,e=this.renderIcon(t.icon,t.iconSize),i=this.resolvedWidth;return s(n,{key:"37bb1fefd51f583b0a9dde9fe46cf843a48e8e13",style:null!=i?{"--sd-tag-width":i}:void 0},s("span",{key:"e996471849834802eaeff02abaadee1a2addac4f",class:"sd-tag",style:{"--sd-tag-background":t.background,"--sd-tag-content":t.content,"--sd-tag-height":t.height,"--sd-tag-padding-x":t.paddingX,"--sd-tag-gap":t.gap,"--sd-tag-font-size":t.fontSize,"--sd-tag-font-weight":t.fontWeight,"--sd-tag-line-height":t.lineHeight,"--sd-tag-radius":t.radius},"aria-label":this.label||"tag"},this.icon&&this.isLeft&&e,s("span",{key:"2e63073d1950046747521071ba5db5f9a404acef",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&e))}};q.style="sd-tag{display:inline-flex;width:var(--sd-tag-width, fit-content);height:fit-content}.sd-tag{display:inline-flex;width:100%;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}";export{k as sd_ghost_button,$ as sd_portal,q as sd_tag}
1
+ import{r as t,c as e,a as i,h as s,H as n}from"./p-BZg-6aSz.js";var o={size:"16",icon:"12"},a={size:"24",icon:"16"},r={size:"28",icon:"20"},h={size:"36",icon:"24"},d={size:"62",icon:"32"},c={sm:"4",md:"6"},l={opacity:"5%"},g={disabled:"#BBBBBB"},u={content:"#888888",hover:{bg:"#222222"}},b={content:"#E30000",hover:{bg:"#E30000"}},p={content:"#025497",hover:{bg:"#0075FF"}},f={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const m={xxs:{size:Number(o.size),icon:Number(o.icon)},xs:{size:Number(a.size),icon:Number(a.icon)},sm:{size:Number(r.size),icon:Number(r.icon)},md:{size:Number(h.size),icon:Number(h.icon)},lg:{size:Number(d.size),icon:Number(d.icon)}},v={xxs:Number(c.sm),xs:Number(c.sm),sm:Number(c.sm),md:Number(c.md),lg:Number(c.md)},x=l.opacity,y={default:u.content,danger:b.content,action:p.content,inverse:f.content},F={default:u.hover.bg,danger:b.hover.bg,action:p.hover.bg,inverse:f.hover.bg},w=g.disabled,z={default:w,danger:w,action:w,inverse:f.disabled},k=class{constructor(i){t(this,i),this.click=e(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";tooltipText;disabled=!1;get hostEl(){return i(this)}isTooltipOpen=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};handleMouseEnter=()=>{this.isTooltipOpen=!0};handleMouseLeave=()=>{this.isTooltipOpen=!1};handleFocus=()=>{this.isTooltipOpen=!0};handleBlur=()=>{this.isTooltipOpen=!1};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",e=this.intent??"default",i=m[t]??m.sm,n=this.disabled?z[e]:y[e],o=(this.ariaLabel??"").trim()||void 0,a=(this.tooltipText??"").trim();return s("button",{key:"9d2d352d36c7c34c67d8c57de6236d72727bd078",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled},type:"button","aria-disabled":this.disabled?"true":void 0,tabIndex:this.disabled?-1:void 0,"aria-label":o,style:{"--sd-ghost-button-size":`${i.size}px`,"--sd-ghost-button-radius":`${v[t]}px`,"--sd-ghost-button-hover-bg":F[e],"--sd-ghost-button-hover-opacity":x,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},a.length>0&&this.isTooltipOpen&&s("sd-portal",{key:"1a73fb53be28a622d03e4f20be0b30e0e76bccd4",parentRef:this.hostEl,open:!0,offset:[i.size/2,4],placement:"top"},s("div",{key:"e4a349dbfbf2fd16eed9a46f5e2ed43935212cfe",class:"sd-ghost-button__tooltip-inner","aria-hidden":"true"},s("sd-tag",{key:"4aa1525a6da6ee72daf1815f1440d665bd1cf2c8",name:"square_xs_grey",label:a}))),s("sd-icon",{key:"4caac22d0d888c1998032697043e3a3761e012aa",name:this.icon,size:i.icon,color:n}))}};k.style='sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}.sd-ghost-button__tooltip-inner{display:inline-flex;white-space:nowrap;transform:translateX(-50%)}[data-align=right] .sd-ghost-button__tooltip-inner{transform:none}';const $=class{constructor(i){t(this,i),this.close=e(this,"sdClose",3)}get hostEl(){return i(this)}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=996;open=!1;placement="bottom";close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof HTMLElement?t:document.body}resolveZIndex(){const t=this.zIndex??996,e=this.parentRef?.closest(".sd-modal-container__layer");if(!e)return t;const i=e.closest(".sd-modal-container"),s=i instanceof HTMLElement?parseInt(getComputedStyle(i).zIndex,10):NaN,n=Number.isFinite(s)?s:997;return Math.max(t,n+1)}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",top:"0",left:"0",zIndex:this.resolveZIndex().toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),e=window.innerWidth,i=window.innerHeight,s=this.offset??[0,4],n=Math.max(0,this.viewportPadding??0),o=Math.max(e-2*n,0),a=Math.max(i-2*n,0);this.wrapper.style.maxWidth=`${o}px`,this.wrapper.style.maxHeight=`${a}px`;const r=this.wrapper.getBoundingClientRect(),h=i-t.bottom-s[1]-n,d=t.top-s[1]-n;let c,l=t.left+s[0];"top"===(this.placement??"bottom")?(c=t.top-r.height-s[1],d<r.height&&h>d&&(c=t.bottom+s[1])):(c=t.bottom+s[1],h<r.height&&d>h&&(c=t.top-r.height-s[1]));const g=i-n-r.height;c=g<n?n:Math.min(Math.max(c,n),g);const u=l+r.width>e-n,b=n,p=e-n-r.width;this.wrapper.style.top=`${c}px`,p<b?(this.wrapper.style.left=`${b}px`,this.wrapper.style.right="auto",delete this.wrapper.dataset.align):u?(this.wrapper.style.left="auto",this.wrapper.style.right=e-t.right+"px",this.wrapper.dataset.align="right"):(this.wrapper.style.right="auto",delete this.wrapper.dataset.align,l=Math.min(Math.max(l,b),p),this.wrapper.style.left=`${l}px`),this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const e=this.getScrollParents(t);e.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=e}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const e=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:s,overflowY:n}=getComputedStyle(i);[t,s,n].some((t=>/(auto|scroll|overlay)/.test(t)))&&e.push(i),i=i.parentElement}return e}isInsideTarget(t){return!(!this.wrapper?.contains(t)&&!this.parentRef?.contains(t))}handleMouseDown(t){this.open&&(this.isInsideClick=this.isInsideTarget(t.target))}handleWindowClick(t){this.open&&(this.isInsideClick?this.isInsideClick=!1:this.isInsideTarget(t.target)||this.close.emit())}render(){return s("slot",{key:"623ee5423b145701ba9dd801d44874214f7a76e3"})}static get watchers(){return{open:[{handleOpenChange:0}]}}};$.style=":host { display: none !important; }";var E={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},_={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},N={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},M={content:"#FB4444",bg:"#FCEFEF"},S={content:"#FF6B00",bg:"#FEF1EA"},C={content:"#916C0D",bg:"#FFF7DD"},O={content:"#00973C",bg:"#E8F9EF"},W={content:"#0075FF",bg:"#E6F1FF"},L={content:"#006AC1",bg:"#EAF5FE"},B={content:"#004290",bg:"#EFF6FF"},I={content:"#737373",bg:"#EEEEEE"};const T=["xs","sm","md"],H=["grey","red","orange","yellow","green","blue","darkblue","indigo"],P={grey:{background:I.bg,content:I.content,icon:I.content},red:{background:M.bg,content:M.content,icon:M.content},orange:{background:S.bg,content:S.content,icon:S.content},yellow:{background:C.bg,content:C.content,icon:C.content},green:{background:O.bg,content:O.content,icon:O.content},blue:{background:W.bg,content:W.content,icon:W.content},darkblue:{background:L.bg,content:L.content,icon:L.content},indigo:{background:B.bg,content:B.content,icon:B.content}},j={xs:{height:`${E.height}px`,paddingX:`${E.paddingX}px`,gap:`${E.gap}px`,fontSize:`${E.typography.fontSize}px`,fontWeight:E.typography.fontWeight,lineHeight:`${E.typography.lineHeight}px`,iconSize:12,radius:`${E.radius}px`},sm:{height:`${_.height}px`,paddingX:`${_.paddingX}px`,gap:`${_.gap}px`,fontSize:`${_.typography.fontSize}px`,fontWeight:_.typography.fontWeight,lineHeight:`${_.typography.lineHeight}px`,iconSize:16,radius:`${_.radius}px`},md:{height:`${N.height}px`,paddingX:`${N.paddingX}px`,gap:`${N.gap}px`,fontSize:`${N.typography.fontSize}px`,fontWeight:N.typography.fontWeight,lineHeight:`${N.typography.lineHeight}px`,iconSize:16,radius:`${N.radius}px`}},A={xs:{...j.xs,radius:"999px"},sm:{...j.sm,radius:"999px"},md:{...j.md,radius:"999px"}},X=Object.fromEntries(["square","pill"].flatMap((t=>T.flatMap((e=>H.map((i=>[`${t}_${e}_${i}`,{shape:t,size:e,color:i,..."square"===t?j[e]:A[e],...P[i]}]))))))),q=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;width="";componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(X,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return X[this.resolvedName]}renderIcon(t,e){return null==this.icon?null:s("sd-icon",{class:"sd-tag__icon",name:this.icon,size:e,color:t})}get resolvedWidth(){if(""!==this.width&&0!==this.width)return"number"==typeof this.width?`${this.width}px`:this.width}render(){const t=this.resolvedConfig,e=this.renderIcon(t.icon,t.iconSize),i=this.resolvedWidth;return s(n,{key:"37bb1fefd51f583b0a9dde9fe46cf843a48e8e13",style:null!=i?{"--sd-tag-width":i}:void 0},s("span",{key:"e996471849834802eaeff02abaadee1a2addac4f",class:"sd-tag",style:{"--sd-tag-background":t.background,"--sd-tag-content":t.content,"--sd-tag-height":t.height,"--sd-tag-padding-x":t.paddingX,"--sd-tag-gap":t.gap,"--sd-tag-font-size":t.fontSize,"--sd-tag-font-weight":t.fontWeight,"--sd-tag-line-height":t.lineHeight,"--sd-tag-radius":t.radius},"aria-label":this.label||"tag"},this.icon&&this.isLeft&&e,s("span",{key:"2e63073d1950046747521071ba5db5f9a404acef",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&e))}};q.style="sd-tag{display:inline-flex;width:var(--sd-tag-width, fit-content);height:fit-content}.sd-tag{display:inline-flex;width:100%;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}";export{k as sd_ghost_button,$ as sd_portal,q as sd_tag}
@@ -1 +1 @@
1
- import{r as t,c as o,a as n,h as d}from"./p-BZ5lcC25.js";import{s as r}from"./p-BE4tnQ2Z.js";import{B as s,g as e,f as i,d as a,P as u,c as p,e as b,b as l}from"./p-DjcjlPt7.js";import{s as h}from"./p-BJfiMC9H.js";class w{static instance;activeDropdowns=new Set;static getInstance(){return void 0===w.instance&&(w.instance=new w),w.instance}register(t){this.activeDropdowns.add(t)}unregister(t){this.activeDropdowns.delete(t)}openDropdown(t){this.activeDropdowns.forEach((o=>{o!==t&&o.isOpen&&o.closeDropdown()}))}closeAllDropdowns(){this.activeDropdowns.forEach((t=>{t.isOpen&&t.closeDropdown()}))}}const c=w.getInstance();class g{documentClickHandler;documentKeydownHandler;initializeEvent(){c.register(this),this.initializeEventHandlers()}cleanupEvent(){c.unregister(this),this.cleanup()}initializeEventHandlers(){this.documentClickHandler=t=>this.handleDocumentClick(t),this.documentKeydownHandler=t=>this.handleDocumentKeydown(t)}addGlobalEventListeners(){this.documentClickHandler&&document.addEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.addEventListener("keydown",this.documentKeydownHandler)}removeGlobalEventListeners(){this.documentClickHandler&&document.removeEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.removeEventListener("keydown",this.documentKeydownHandler)}onDropdownToggle(t){t&&!this.disabled?(c.openDropdown(this),this.addGlobalEventListeners()):this.removeGlobalEventListeners()}cleanup(){this.removeGlobalEventListeners()}closeDropdown(){this.isOpen=!1}}const m=(()=>{const t=Object.keys(s).filter((t=>!t.endsWith("_lg")));return Object.fromEntries(t.map((t=>[t,s[t]])))})(),v=b,_=p,x=u,f=a,y={primary:i.button.dropdown.brand.strong.split,secondary:i.button.dropdown.brand.subtle.split,primary_outline:f.primary_outline,neutral_outline:f.neutral_outline,danger:i.button.dropdown.danger.strong.split,danger_outline:f.danger_outline},C=h.color.fg.secondary,k=h.color.bg.accent.default,z=h.color.fg.inverse,D={primary:C,secondary:C,primary_outline:C,neutral_outline:C,danger:C,danger_outline:C},E={primary:k,secondary:k,primary_outline:k,neutral_outline:k,danger:k,danger_outline:k},F={primary:z,secondary:z,primary_outline:z,neutral_outline:z,danger:z,danger_outline:z},B={xs:12,sm:12,md:16},O={xs:{default:44,split:60},sm:{default:70,split:76},md:{default:100,split:106}},A=i.button.bg.disabled,T=i.button.text.disabled,j=i.button.icon.disabled,I=i.button.border.disabled,S=class extends g{constructor(n){super(),t(this,n),this.click=o(this,"sdClick",7),this.buttonClick=o(this,"sdButtonClick",7),this.dropDownShow=o(this,"sdDropDownShow",7)}get el(){return n(this)}name="primary_sm";label="";items=[];disabled=!1;split=!1;static CLOSE_ANIMATION_DURATION=150;isOpen=!1;isAnimatingOut=!1;itemIndex=-1;triggerRef;splitContainerRef;menuRef;closeAnimationTimer;click;buttonClick;dropDownShow;handleOpenChange(t){this.onDropdownToggle(t),this.dropDownShow.emit({isOpen:t}),t||(this.itemIndex=-1)}componentWillLoad(){this.initializeEvent()}disconnectedCallback(){this.cleanupEvent(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}async sdOpen(){this.disabled||0===this.items.length||(this.isOpen=!0)}async sdClose(){this.closeDropdown()}closeDropdown=()=>{this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),S.CLOSE_ANIMATION_DURATION))};handleDocumentClick(t){const o=t.target;o&&(this.el.contains(o)||this.menuRef?.contains(o)||this.closeDropdown())}handleDocumentKeydown(t){if(this.isOpen&&["ArrowDown","ArrowUp","Enter","Escape"].includes(t.key))switch(t.preventDefault(),t.stopPropagation(),t.key){case"ArrowDown":this.itemIndex=this.getNextEnabledIndex(1);break;case"ArrowUp":this.itemIndex=this.getNextEnabledIndex(-1);break;case"Enter":if(this.itemIndex<0)return;this.selectItem(this.items[this.itemIndex]);break;case"Escape":this.closeDropdown()}}get resolvedName(){if(!(this.name in m))throw new Error(`Invalid sd-dropdown-button name: "${this.name}"`);return this.name}get resolvedConfig(){const t=this.resolvedName;return{config:m[t],preset:(o=t,e(o))};var o}getNextEnabledIndex(t){const o=this.items.reduce(((t,o,n)=>(o.disabled||t.push(n),t)),[]);if(0===o.length)return-1;const n=o.indexOf(this.itemIndex);return-1===n?1===t?o[0]:o[o.length-1]:o[(n+t+o.length)%o.length]}toggleDropdown=t=>{t.stopPropagation(),this.disabled||0===this.items.length||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleButtonClick=t=>{t.stopPropagation(),this.disabled||(this.buttonClick.emit(),this.closeDropdown())};selectItem(t,o){o?.stopPropagation(),t&&!t.disabled&&(this.click.emit(t.value),this.closeDropdown())}getTriggerClasses(t,o,n,d,r){const s=["sd-dropdown-button__trigger",`sd-dropdown-button__trigger--${t}`,`sd-dropdown-button__trigger--${o}`];return n&&s.push("sd-dropdown-button__trigger--disabled"),d&&s.push("sd-dropdown-button__trigger--open"),void 0!==r&&s.push(`sd-dropdown-button__trigger--${r}-part`),s.join(" ")}getTriggerStyle(t,o){return{"--sd-dropdown-button-bg":t.color,"--sd-dropdown-button-bg-hover":v[o],"--sd-dropdown-button-border":f[o],"--sd-dropdown-button-content":_[o],"--sd-dropdown-button-icon":x[o],"--sd-dropdown-button-divider":y[o],"--sd-dropdown-button-accent":l,"--sd-dropdown-button-disabled-bg":A,"--sd-dropdown-button-disabled-content":T,"--sd-dropdown-button-disabled-icon":j,"--sd-dropdown-button-disabled-border":I}}getMenuItemClasses(t,o){const n=["sd-dropdown-button__menu-item"];return t&&n.push("sd-dropdown-button__menu-item--active"),o&&n.push("sd-dropdown-button__menu-item--disabled"),n.join(" ")}renderDropdown(t){const o=this.split?this.splitContainerRef:this.triggerRef;return(this.isOpen||this.isAnimatingOut)&&o?d("sd-portal",{open:this.isOpen,parentRef:o,onSdClose:this.closeDropdown},d("div",{class:"sd-dropdown-button__menu",role:"menu",ref:t=>this.menuRef=t,style:{"--sd-dropdown-button-menu-min-width":`${o.offsetWidth}px`,"--sd-dropdown-button-menu-item-color":D[t],"--sd-dropdown-button-menu-item-active-bg":E[t],"--sd-dropdown-button-menu-item-active-color":F[t],"--sd-dropdown-button-menu-border":"transparent"===f[t]?y[t]:f[t]}},this.items.map(((t,o)=>d("button",{type:"button",role:"menuitem",class:this.getMenuItemClasses(this.itemIndex===o&&!t.disabled,Boolean(t.disabled)),disabled:t.disabled,onClick:o=>this.selectItem(t,o),onMouseEnter:()=>{t.disabled||(this.itemIndex=o)}},t.icon&&d("sd-icon",{class:"sd-dropdown-button__menu-item-icon",name:t.icon,size:12,color:"var(--sd-dropdown-button-menu-item-current-color)"}),d("span",{class:"sd-dropdown-button__menu-item-label",innerHTML:r(t.label)})))))):null}renderChevron(t){return d("span",{class:{"sd-dropdown-button__trigger-icon":!0,"sd-dropdown-button__trigger-icon--open":this.isOpen&&!this.split},"aria-hidden":"true"},d("sd-icon",{name:this.split?"etc":"caretDown",size:B[t],color:"var(--sd-dropdown-button-current-icon)"}))}render(){const{config:t,preset:o}=this.resolvedConfig,n=this.getTriggerStyle(t,o),r=O[t.size];return this.split?d("div",{class:"sd-dropdown-button sd-dropdown-button--split",ref:t=>this.splitContainerRef=t,style:{minWidth:`${r.split}px`}},d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen,"label"),disabled:this.disabled,onClick:this.handleButtonClick,style:n},d("span",{class:"sd-dropdown-button__trigger-label"},this.label)),d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen,"chevron"),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":String(this.isOpen),"aria-label":"dropdown toggle",onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:n},this.renderChevron(t.size)),this.renderDropdown(o)):d("div",{class:"sd-dropdown-button"},d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":String(this.isOpen),onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:{...n,minWidth:`${r.default}px`}},d("span",{class:"sd-dropdown-button__trigger-label"},this.label),this.renderChevron(t.size)),this.renderDropdown(o))}static get watchers(){return{isOpen:[{handleOpenChange:0}]}}};S.style="sd-dropdown-button{display:inline-flex;width:fit-content;height:fit-content}.sd-dropdown-button{display:inline-flex;position:relative}.sd-dropdown-button__trigger{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-md-gap, 16px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var(--sd-button-button-md-typography-text-decoration, none);--sd-dropdown-button-bg:#025497;--sd-dropdown-button-bg-hover:#004177;--sd-dropdown-button-border:transparent;--sd-dropdown-button-content:#FFFFFF;--sd-dropdown-button-icon:var(--sd-dropdown-button-content);--sd-dropdown-button-current-content:var(--sd-dropdown-button-content);--sd-dropdown-button-current-icon:var(--sd-dropdown-button-icon);--sd-dropdown-button-divider:#006AC1;--sd-dropdown-button-accent:#0075FF;--sd-dropdown-button-disabled-bg:var(--sd-button-button-bg-disabled, #E1E1E1);--sd-dropdown-button-disabled-content:var(--sd-button-button-text-disabled, #888888);--sd-dropdown-button-disabled-icon:var(--sd-button-button-icon-disabled, #BBBBBB);--sd-dropdown-button-disabled-border:var(--sd-button-button-border-disabled, #CCCCCC);display:inline-flex;align-items:stretch;justify-content:space-between;min-height:var(--sd-dropdown-button-height);padding:0;border:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-border);border-radius:var(--sd-button-button-radius-sm, 4px);background:var(--sd-dropdown-button-bg);color:var(--sd-dropdown-button-current-content);cursor:pointer;box-sizing:border-box;font-family:var(--sd-dropdown-button-font-family);font-size:var(--sd-dropdown-button-font-size);font-weight:var(--sd-dropdown-button-font-weight);line-height:1;text-decoration:var(--sd-dropdown-button-text-decoration);transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;white-space:nowrap}.sd-dropdown-button__trigger:hover:not(.sd-dropdown-button__trigger--disabled){background:var(--sd-dropdown-button-bg-hover)}.sd-dropdown-button__trigger:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-dropdown-button-accent)}.sd-dropdown-button__trigger--xs{--sd-dropdown-button-height:var(--sd-button-button-xs-height, 24px);--sd-dropdown-button-padding-x:var(--sd-button-button-xs-padding-x, 8px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-xs-gap, 6px);--sd-dropdown-button-font-family:var(--sd-button-button-xs-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-xs-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-xs-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-xs-typography-text-decoration, none )}.sd-dropdown-button__trigger--sm{--sd-dropdown-button-height:var(--sd-button-button-sm-height, 28px);--sd-dropdown-button-padding-x:var(--sd-button-button-sm-padding-x, 12px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-sm-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-sm-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-sm-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-sm-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-sm-typography-text-decoration, none )}.sd-dropdown-button__trigger--md{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-md-gap, 16px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 16px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-md-typography-text-decoration, none );border-radius:var(--sd-button-button-radius-md, 6px)}.sd-dropdown-button__trigger--disabled{border-color:var(--sd-dropdown-button-disabled-border);background:var(--sd-dropdown-button-disabled-bg);--sd-dropdown-button-current-content:var(--sd-dropdown-button-disabled-content);--sd-dropdown-button-current-icon:var(--sd-dropdown-button-disabled-icon);cursor:not-allowed}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger{gap:var(--sd-dropdown-button-gap);padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger-label{padding:0}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger-icon{min-width:0;padding:0}.sd-dropdown-button--split{display:inline-flex;align-items:stretch}.sd-dropdown-button--split .sd-dropdown-button__trigger--label-part{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}.sd-dropdown-button--split .sd-dropdown-button__trigger--chevron-part{border-top-left-radius:0;border-bottom-left-radius:0;border-left:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-divider)}.sd-dropdown-button--split .sd-dropdown-button__trigger--chevron-part.sd-dropdown-button__trigger--disabled{border-left-color:var(--sd-dropdown-button-disabled-border)}.sd-dropdown-button__trigger-label,.sd-dropdown-button__trigger-icon{display:inline-flex;align-items:center;justify-content:center}.sd-dropdown-button__trigger-label{flex:1 1 auto;min-width:0;padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button__trigger-icon{flex:0 0 auto;min-width:calc(var(--sd-dropdown-button-height) - 2px);padding:0 calc(var(--sd-dropdown-button-gap) + 2px);transition:transform 0.2s ease}.sd-dropdown-button__trigger-icon--open{transform:rotate(180deg)}.sd-dropdown-button__menu{position:relative;display:grid;width:max-content;min-width:var(--sd-dropdown-button-menu-min-width, max-content);max-width:calc(100vw - 24px);padding:4px 0;border:0;border-radius:4px;background:#FFFFFF;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1019607843);box-sizing:border-box;overflow:hidden}.sd-dropdown-button__menu-item{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-color);display:inline-flex;align-items:center;gap:8px;min-height:28px;width:100%;padding:0 12px;border:0;border-radius:0;background:transparent;color:var(--sd-dropdown-button-menu-item-current-color);cursor:pointer;box-sizing:border-box;font:inherit;text-align:left;transition:background-color 0.15s ease, color 0.15s ease}.sd-dropdown-button__menu-item--active{background:var(--sd-dropdown-button-menu-item-active-bg);--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-active-color)}.sd-dropdown-button__menu-item--disabled{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__menu-item-icon{flex:0 0 auto}.sd-dropdown-button__menu-item-label{display:inline-flex;align-items:center;min-width:0;white-space:nowrap;font-size:12px}";export{S as sd_dropdown_button}
1
+ import{r as t,c as o,a as n,h as d}from"./p-BZg-6aSz.js";import{s as r}from"./p-BE4tnQ2Z.js";import{B as s,g as e,f as i,d as a,P as u,c as p,e as b,b as l}from"./p-ClMlDGkX.js";import{s as h}from"./p-BJfiMC9H.js";class w{static instance;activeDropdowns=new Set;static getInstance(){return void 0===w.instance&&(w.instance=new w),w.instance}register(t){this.activeDropdowns.add(t)}unregister(t){this.activeDropdowns.delete(t)}openDropdown(t){this.activeDropdowns.forEach((o=>{o!==t&&o.isOpen&&o.closeDropdown()}))}closeAllDropdowns(){this.activeDropdowns.forEach((t=>{t.isOpen&&t.closeDropdown()}))}}const c=w.getInstance();class g{documentClickHandler;documentKeydownHandler;initializeEvent(){c.register(this),this.initializeEventHandlers()}cleanupEvent(){c.unregister(this),this.cleanup()}initializeEventHandlers(){this.documentClickHandler=t=>this.handleDocumentClick(t),this.documentKeydownHandler=t=>this.handleDocumentKeydown(t)}addGlobalEventListeners(){this.documentClickHandler&&document.addEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.addEventListener("keydown",this.documentKeydownHandler)}removeGlobalEventListeners(){this.documentClickHandler&&document.removeEventListener("click",this.documentClickHandler),this.documentKeydownHandler&&document.removeEventListener("keydown",this.documentKeydownHandler)}onDropdownToggle(t){t&&!this.disabled?(c.openDropdown(this),this.addGlobalEventListeners()):this.removeGlobalEventListeners()}cleanup(){this.removeGlobalEventListeners()}closeDropdown(){this.isOpen=!1}}const m=(()=>{const t=Object.keys(s).filter((t=>!t.endsWith("_lg")));return Object.fromEntries(t.map((t=>[t,s[t]])))})(),v=b,_=p,x=u,f=a,y={primary:i.button.dropdown.brand.strong.split,secondary:i.button.dropdown.brand.subtle.split,primary_outline:f.primary_outline,neutral_outline:f.neutral_outline,danger:i.button.dropdown.danger.strong.split,danger_outline:f.danger_outline},C=h.color.fg.secondary,k=h.color.bg.accent.default,z=h.color.fg.inverse,D={primary:C,secondary:C,primary_outline:C,neutral_outline:C,danger:C,danger_outline:C},E={primary:k,secondary:k,primary_outline:k,neutral_outline:k,danger:k,danger_outline:k},F={primary:z,secondary:z,primary_outline:z,neutral_outline:z,danger:z,danger_outline:z},B={xs:12,sm:12,md:16},O={xs:{default:64,split:72},sm:{default:72,split:88},md:{default:100,split:106}},A=i.button.bg.disabled,T=i.button.text.disabled,I=i.button.icon.disabled,S=i.button.border.disabled,j=class extends g{constructor(n){super(),t(this,n),this.click=o(this,"sdClick",7),this.buttonClick=o(this,"sdButtonClick",7),this.dropDownShow=o(this,"sdDropDownShow",7)}get el(){return n(this)}name="primary_sm";label="";items=[];disabled=!1;split=!1;static CLOSE_ANIMATION_DURATION=150;isOpen=!1;isAnimatingOut=!1;itemIndex=-1;triggerRef;splitContainerRef;menuRef;closeAnimationTimer;click;buttonClick;dropDownShow;handleOpenChange(t){this.onDropdownToggle(t),this.dropDownShow.emit({isOpen:t}),t||(this.itemIndex=-1)}componentWillLoad(){this.initializeEvent()}disconnectedCallback(){this.cleanupEvent(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}async sdOpen(){this.disabled||0===this.items.length||(this.isOpen=!0)}async sdClose(){this.closeDropdown()}closeDropdown=()=>{this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),j.CLOSE_ANIMATION_DURATION))};handleDocumentClick(t){const o=t.target;o&&(this.el.contains(o)||this.menuRef?.contains(o)||this.closeDropdown())}handleDocumentKeydown(t){if(this.isOpen&&["ArrowDown","ArrowUp","Enter","Escape"].includes(t.key))switch(t.preventDefault(),t.stopPropagation(),t.key){case"ArrowDown":this.itemIndex=this.getNextEnabledIndex(1);break;case"ArrowUp":this.itemIndex=this.getNextEnabledIndex(-1);break;case"Enter":if(this.itemIndex<0)return;this.selectItem(this.items[this.itemIndex]);break;case"Escape":this.closeDropdown()}}get resolvedName(){if(!(this.name in m))throw new Error(`Invalid sd-dropdown-button name: "${this.name}"`);return this.name}get resolvedConfig(){const t=this.resolvedName;return{config:m[t],preset:(o=t,e(o))};var o}getNextEnabledIndex(t){const o=this.items.reduce(((t,o,n)=>(o.disabled||t.push(n),t)),[]);if(0===o.length)return-1;const n=o.indexOf(this.itemIndex);return-1===n?1===t?o[0]:o[o.length-1]:o[(n+t+o.length)%o.length]}toggleDropdown=t=>{t.stopPropagation(),this.disabled||0===this.items.length||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleButtonClick=t=>{t.stopPropagation(),this.disabled||(this.buttonClick.emit(),this.closeDropdown())};selectItem(t,o){o?.stopPropagation(),t&&!t.disabled&&(this.click.emit(t.value),this.closeDropdown())}getTriggerClasses(t,o,n,d,r){const s=["sd-dropdown-button__trigger",`sd-dropdown-button__trigger--${t}`,`sd-dropdown-button__trigger--${o}`];return n&&s.push("sd-dropdown-button__trigger--disabled"),d&&s.push("sd-dropdown-button__trigger--open"),void 0!==r&&s.push(`sd-dropdown-button__trigger--${r}-part`),s.join(" ")}getTriggerStyle(t,o){return{"--sd-dropdown-button-bg":t.color,"--sd-dropdown-button-bg-hover":v[o],"--sd-dropdown-button-border":f[o],"--sd-dropdown-button-content":_[o],"--sd-dropdown-button-icon":x[o],"--sd-dropdown-button-divider":y[o],"--sd-dropdown-button-accent":l,"--sd-dropdown-button-disabled-bg":A,"--sd-dropdown-button-disabled-content":T,"--sd-dropdown-button-disabled-icon":I,"--sd-dropdown-button-disabled-border":S}}getMenuItemClasses(t,o){const n=["sd-dropdown-button__menu-item"];return t&&n.push("sd-dropdown-button__menu-item--active"),o&&n.push("sd-dropdown-button__menu-item--disabled"),n.join(" ")}renderDropdown(t){const o=this.split?this.splitContainerRef:this.triggerRef;return(this.isOpen||this.isAnimatingOut)&&o?d("sd-portal",{open:this.isOpen,parentRef:o,onSdClose:this.closeDropdown},d("div",{class:"sd-dropdown-button__menu",role:"menu",ref:t=>this.menuRef=t,style:{"--sd-dropdown-button-menu-min-width":`${o.offsetWidth}px`,"--sd-dropdown-button-menu-item-color":D[t],"--sd-dropdown-button-menu-item-active-bg":E[t],"--sd-dropdown-button-menu-item-active-color":F[t],"--sd-dropdown-button-menu-border":"transparent"===f[t]?y[t]:f[t]}},this.items.map(((t,o)=>d("button",{type:"button",role:"menuitem",class:this.getMenuItemClasses(this.itemIndex===o&&!t.disabled,Boolean(t.disabled)),disabled:t.disabled,onClick:o=>this.selectItem(t,o),onMouseEnter:()=>{t.disabled||(this.itemIndex=o)}},t.icon&&d("sd-icon",{class:"sd-dropdown-button__menu-item-icon",name:t.icon,size:12,color:"var(--sd-dropdown-button-menu-item-current-color)"}),d("span",{class:"sd-dropdown-button__menu-item-label",innerHTML:r(t.label)})))))):null}renderChevron(t){return d("span",{class:{"sd-dropdown-button__trigger-icon":!0,"sd-dropdown-button__trigger-icon--open":this.isOpen&&!this.split},"aria-hidden":"true"},d("sd-icon",{name:this.split?"etc":"caretDown",size:B[t],color:"var(--sd-dropdown-button-current-icon)"}))}render(){const{config:t,preset:o}=this.resolvedConfig,n=this.getTriggerStyle(t,o),r=O[t.size];return this.split?d("div",{class:"sd-dropdown-button sd-dropdown-button--split",ref:t=>this.splitContainerRef=t,style:{minWidth:`${r.split}px`}},d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen,"label"),disabled:this.disabled,onClick:this.handleButtonClick,style:n},d("span",{class:"sd-dropdown-button__trigger-label"},this.label)),d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen,"chevron"),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":String(this.isOpen),"aria-label":"dropdown toggle",onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:n},this.renderChevron(t.size)),this.renderDropdown(o)):d("div",{class:"sd-dropdown-button"},d("button",{type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":String(this.isOpen),onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:{...n,minWidth:`${r.default}px`}},d("span",{class:"sd-dropdown-button__trigger-label"},this.label),this.renderChevron(t.size)),this.renderDropdown(o))}static get watchers(){return{isOpen:[{handleOpenChange:0}]}}};j.style="sd-dropdown-button{display:inline-flex;width:fit-content;height:fit-content}.sd-dropdown-button{display:inline-flex;position:relative}.sd-dropdown-button__trigger{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-md-gap, 16px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var(--sd-button-button-md-typography-text-decoration, none);--sd-dropdown-button-bg:#025497;--sd-dropdown-button-bg-hover:#004177;--sd-dropdown-button-border:transparent;--sd-dropdown-button-content:#FFFFFF;--sd-dropdown-button-icon:var(--sd-dropdown-button-content);--sd-dropdown-button-current-content:var(--sd-dropdown-button-content);--sd-dropdown-button-current-icon:var(--sd-dropdown-button-icon);--sd-dropdown-button-divider:#006AC1;--sd-dropdown-button-accent:#0075FF;--sd-dropdown-button-disabled-bg:var(--sd-button-button-bg-disabled, #E1E1E1);--sd-dropdown-button-disabled-content:var(--sd-button-button-text-disabled, #888888);--sd-dropdown-button-disabled-icon:var(--sd-button-button-icon-disabled, #BBBBBB);--sd-dropdown-button-disabled-border:var(--sd-button-button-border-disabled, #CCCCCC);display:inline-flex;align-items:stretch;justify-content:space-between;min-height:var(--sd-dropdown-button-height);padding:0;border:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-border);border-radius:var(--sd-button-button-radius-sm, 4px);background:var(--sd-dropdown-button-bg);color:var(--sd-dropdown-button-current-content);cursor:pointer;box-sizing:border-box;font-family:var(--sd-dropdown-button-font-family);font-size:var(--sd-dropdown-button-font-size);font-weight:var(--sd-dropdown-button-font-weight);line-height:1;text-decoration:var(--sd-dropdown-button-text-decoration);transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;white-space:nowrap}.sd-dropdown-button__trigger:hover:not(.sd-dropdown-button__trigger--disabled){background:var(--sd-dropdown-button-bg-hover)}.sd-dropdown-button__trigger:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-dropdown-button-accent)}.sd-dropdown-button__trigger--xs{--sd-dropdown-button-height:var(--sd-button-button-xs-height, 24px);--sd-dropdown-button-padding-x:var(--sd-button-button-xs-padding-x, 8px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-xs-gap, 6px);--sd-dropdown-button-font-family:var(--sd-button-button-xs-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-xs-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-xs-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-xs-typography-text-decoration, none )}.sd-dropdown-button__trigger--sm{--sd-dropdown-button-height:var(--sd-button-button-sm-height, 28px);--sd-dropdown-button-padding-x:var(--sd-button-button-sm-padding-x, 12px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-sm-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-sm-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-sm-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-sm-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-sm-typography-text-decoration, none )}.sd-dropdown-button__trigger--md{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-dropdown-md-gap, 16px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 16px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-md-typography-text-decoration, none );border-radius:var(--sd-button-button-radius-md, 6px)}.sd-dropdown-button__trigger--disabled{border-color:var(--sd-dropdown-button-disabled-border);background:var(--sd-dropdown-button-disabled-bg);--sd-dropdown-button-current-content:var(--sd-dropdown-button-disabled-content);--sd-dropdown-button-current-icon:var(--sd-dropdown-button-disabled-icon);cursor:not-allowed}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger{gap:var(--sd-dropdown-button-gap);padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger-label{padding:0}.sd-dropdown-button:not(.sd-dropdown-button--split) .sd-dropdown-button__trigger-icon{min-width:0;padding:0}.sd-dropdown-button--split{display:inline-flex;align-items:stretch}.sd-dropdown-button--split .sd-dropdown-button__trigger--label-part{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}.sd-dropdown-button--split .sd-dropdown-button__trigger--chevron-part{border-top-left-radius:0;border-bottom-left-radius:0;border-left:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-divider)}.sd-dropdown-button--split .sd-dropdown-button__trigger--chevron-part.sd-dropdown-button__trigger--disabled{border-left-color:var(--sd-dropdown-button-disabled-border)}.sd-dropdown-button__trigger-label,.sd-dropdown-button__trigger-icon{display:inline-flex;align-items:center;justify-content:center}.sd-dropdown-button__trigger-label{flex:1 1 auto;min-width:0;padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button__trigger-icon{flex:0 0 auto;min-width:calc(var(--sd-dropdown-button-height) - 2px);padding:0 calc(var(--sd-dropdown-button-gap) + 2px);transition:transform 0.2s ease}.sd-dropdown-button__trigger-icon--open{transform:rotate(180deg)}.sd-dropdown-button__menu{position:relative;display:grid;width:max-content;min-width:var(--sd-dropdown-button-menu-min-width, max-content);max-width:calc(100vw - 24px);padding:4px 0;border:0;border-radius:4px;background:#FFFFFF;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1019607843);box-sizing:border-box;overflow:hidden}.sd-dropdown-button__menu-item{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-color);display:inline-flex;align-items:center;gap:8px;min-height:28px;width:100%;padding:0 12px;border:0;border-radius:0;background:transparent;color:var(--sd-dropdown-button-menu-item-current-color);cursor:pointer;box-sizing:border-box;font:inherit;text-align:left;transition:background-color 0.15s ease, color 0.15s ease}.sd-dropdown-button__menu-item--active{background:var(--sd-dropdown-button-menu-item-active-bg);--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-active-color)}.sd-dropdown-button__menu-item--disabled{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__menu-item-icon{flex:0 0 auto}.sd-dropdown-button__menu-item-label{display:inline-flex;align-items:center;min-width:0;white-space:nowrap;font-size:12px}";export{j as sd_dropdown_button}
@@ -1 +1 @@
1
- import{r as e,h as d}from"./p-BZ5lcC25.js";const s={red:"#FB4444",orange:"#FF6B00",yellow:"#FFC700",green:"#00973C",blue:"#0075FF",darkblue:"#006AC1",indigo:"#004290",grey:"#737373"},a=class{constructor(d){e(this,d)}color="blue";render(){return d("div",{key:"2531ebcfe66e33f8ac31be0299865ee8aa45ed17",class:"sd-badge",style:{"--sd-badge-color":s[this.color]??s.blue}},d("div",{key:"a8ddd518167b90fedb4d6d26cc28b17082f5fe0b",class:"sd-badge__dot"}))}};a.style="sd-badge{display:inline-flex}sd-badge .sd-badge{display:flex;align-items:center;justify-content:center}sd-badge .sd-badge .sd-badge__dot{width:6px;height:6px;min-width:6px;min-height:6px;border-radius:9999px;background:var(--sd-badge-color, #0075FF)}sd-badge .sd-badge .sd-badge__label{margin-left:8px;font-size:12px;font-weight:500;line-height:20px;color:#333333}";export{a as sd_badge}
1
+ import{r as e,h as d}from"./p-BZg-6aSz.js";const a={red:"#FB4444",orange:"#FF6B00",yellow:"#FFC700",green:"#00973C",blue:"#0075FF",darkblue:"#006AC1",indigo:"#004290",grey:"#737373"},s=class{constructor(d){e(this,d)}color="blue";render(){return d("div",{key:"2531ebcfe66e33f8ac31be0299865ee8aa45ed17",class:"sd-badge",style:{"--sd-badge-color":a[this.color]??a.blue}},d("div",{key:"a8ddd518167b90fedb4d6d26cc28b17082f5fe0b",class:"sd-badge__dot"}))}};s.style="sd-badge{display:inline-flex}sd-badge .sd-badge{display:flex;align-items:center;justify-content:center}sd-badge .sd-badge .sd-badge__dot{width:6px;height:6px;min-width:6px;min-height:6px;border-radius:9999px;background:var(--sd-badge-color, #0075FF)}sd-badge .sd-badge .sd-badge__label{margin-left:8px;font-size:12px;font-weight:500;line-height:20px;color:#333333}";export{s as sd_badge}
@@ -1 +1 @@
1
- import{r as t,c as o,h as e}from"./p-BZ5lcC25.js";var d={height:"24",paddingX:"8",typography:{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",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},i={height:"28",paddingX:"12",typography:{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",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},r="4",a={width:"1",default:"#CCCCCC",select:"#0075FF",disabled:"#CCCCCC"},n={default:"#FFFFFF",hover:"#0075FF",select:"#FFFFFF",disabled:"#E1E1E1"},s={default:"#555555",hover:"#FFFFFF",select:"#0075FF",disabled:"#888888"},b={gap:"-1"};const l={xs:{height:Number(d.height),paddingX:Number(d.paddingX),fontSize:Number(d.typography.fontSize),lineHeight:Number(d.typography.lineHeight),fontWeight:d.typography.fontWeight,fontFamily:d.typography.fontFamily,textDecoration:d.typography.textDecoration},sm:{height:Number(i.height),paddingX:Number(i.paddingX),fontSize:Number(i.typography.fontSize),lineHeight:Number(i.typography.lineHeight),fontWeight:i.typography.fontWeight,fontFamily:i.typography.fontFamily,textDecoration:i.typography.textDecoration}},u=Number(r),h=Number(a.width),c=Number(b.gap),p={border:{default:a.default,select:a.select,disabled:a.disabled},bg:{default:n.default,hover:n.hover,select:n.select,disabled:n.disabled},content:{default:s.default,hover:s.hover,select:s.select,disabled:s.disabled}},g=class{constructor(e){t(this,e),this.change=o(this,"sdUpdate",7)}value;options=[];size="sm";disabled=!1;name;change;componentWillLoad(){this.size??="sm",this.options??=[],this.disabled??=!1}handleRadioChange=(t,o)=>{this.disabled||o||(this.value=t,this.change.emit(t))};isOptionSelected(t){return this.value===t.value}isOptionDisabled(t){return this.disabled||!!t.disabled}getButtonClasses(t){const o=["sd-radio-button__option",this.isOptionSelected(t)?"sd-radio-button__option--selected":"sd-radio-button__option--unselected"];return this.isOptionDisabled(t)&&o.push("sd-radio-button__option--disabled"),o.join(" ")}getGroupClasses(){return["sd-radio-button",`sd-radio-button--${this.size??"sm"}`].join(" ")}_groupName;get groupName(){return null!=this._groupName&&""!==this._groupName||(this._groupName=null!=this.name&&""!==this.name?this.name:`sd-radio-button-${crypto.randomUUID()}`),this._groupName}render(){const t=l[this.size??"sm"]??l.sm,o={"--sd-radio-button-height":`${t.height}px`,"--sd-radio-button-padding-x":`${t.paddingX}px`,"--sd-radio-button-font-family":t.fontFamily,"--sd-radio-button-font-weight":t.fontWeight,"--sd-radio-button-font-size":`${t.fontSize}px`,"--sd-radio-button-line-height":`${t.lineHeight}px`,"--sd-radio-button-text-decoration":t.textDecoration,"--sd-radio-button-radius":`${u}px`,"--sd-radio-button-border-width":`${h}px`,"--sd-radio-button-group-gap":`${c}px`,"--sd-radio-button-border-default":p.border.default,"--sd-radio-button-border-select":p.border.select,"--sd-radio-button-border-disabled":p.border.disabled,"--sd-radio-button-bg-default":p.bg.default,"--sd-radio-button-bg-hover":p.bg.hover,"--sd-radio-button-bg-select":p.bg.select,"--sd-radio-button-bg-disabled":p.bg.disabled,"--sd-radio-button-content-default":p.content.default,"--sd-radio-button-content-hover":p.content.hover,"--sd-radio-button-content-select":p.content.select,"--sd-radio-button-content-disabled":p.content.disabled};return e("div",{key:"17355ebde09f652f5b94b4f70f09f68ef44cd29d",class:this.getGroupClasses(),style:o,role:"radiogroup","aria-disabled":this.disabled.toString()},this.options.map((t=>{const o=this.isOptionSelected(t),d=this.isOptionDisabled(t);return e("label",{key:`radio-${t.value}`,class:this.getButtonClasses(t),"aria-label":t.label||"radio option","data-label":t.label},e("input",{type:"radio",name:this.groupName,value:t.value.toString(),checked:o,disabled:d,onInput:()=>this.handleRadioChange(t.value,t.disabled)}),t.label&&e("span",{class:"sd-radio-button__label"},t.label))})))}};g.style="sd-radio-button{display:inline-flex;width:fit-content;height:fit-content}.sd-radio-button{display:inline-flex;flex-flow:row nowrap;gap:0}.sd-radio-button__option{display:flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;height:var(--sd-radio-button-height);padding:0 var(--sd-radio-button-padding-x);border:var(--sd-radio-button-border-width) solid var(--sd-radio-button-border-default);background-color:var(--sd-radio-button-bg-default);color:var(--sd-radio-button-content-default);font-family:var(--sd-radio-button-font-family);font-weight:var(--sd-radio-button-font-weight);font-size:var(--sd-radio-button-font-size);line-height:var(--sd-radio-button-line-height);text-decoration:var(--sd-radio-button-text-decoration);cursor:pointer;user-select:none;-webkit-user-select:none;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.sd-radio-button__option input{display:none}.sd-radio-button__option:not(:first-child){margin-left:var(--sd-radio-button-group-gap)}.sd-radio-button__option:first-child{border-top-left-radius:var(--sd-radio-button-radius);border-bottom-left-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:last-child{border-top-right-radius:var(--sd-radio-button-radius);border-bottom-right-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:only-child{border-radius:var(--sd-radio-button-radius)}.sd-radio-button__option--selected{background-color:var(--sd-radio-button-bg-select);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-select);z-index:1}.sd-radio-button__option:hover:not(.sd-radio-button__option--disabled){background-color:var(--sd-radio-button-bg-hover);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-hover);z-index:2}.sd-radio-button__option--disabled{background-color:var(--sd-radio-button-bg-disabled);border-color:var(--sd-radio-button-border-disabled);color:var(--sd-radio-button-content-disabled);cursor:not-allowed}.sd-radio-button__label{user-select:none;-webkit-user-select:none}";export{g as sd_radio_button}
1
+ import{r as t,c as o,h as e}from"./p-BZg-6aSz.js";var d={height:"24",paddingX:"8",typography:{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",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},i={height:"28",paddingX:"12",typography:{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",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},r="4",a={width:"1",default:"#CCCCCC",select:"#0075FF",disabled:"#CCCCCC"},n={default:"#FFFFFF",hover:"#0075FF",select:"#FFFFFF",disabled:"#E1E1E1"},s={default:"#555555",hover:"#FFFFFF",select:"#0075FF",disabled:"#888888"},b={gap:"-1"};const l={xs:{height:Number(d.height),paddingX:Number(d.paddingX),fontSize:Number(d.typography.fontSize),lineHeight:Number(d.typography.lineHeight),fontWeight:d.typography.fontWeight,fontFamily:d.typography.fontFamily,textDecoration:d.typography.textDecoration},sm:{height:Number(i.height),paddingX:Number(i.paddingX),fontSize:Number(i.typography.fontSize),lineHeight:Number(i.typography.lineHeight),fontWeight:i.typography.fontWeight,fontFamily:i.typography.fontFamily,textDecoration:i.typography.textDecoration}},u=Number(r),h=Number(a.width),c=Number(b.gap),p={border:{default:a.default,select:a.select,disabled:a.disabled},bg:{default:n.default,hover:n.hover,select:n.select,disabled:n.disabled},content:{default:s.default,hover:s.hover,select:s.select,disabled:s.disabled}},g=class{constructor(e){t(this,e),this.change=o(this,"sdUpdate",7)}value;options=[];size="sm";disabled=!1;name;change;componentWillLoad(){this.size??="sm",this.options??=[],this.disabled??=!1}handleRadioChange=(t,o)=>{this.disabled||o||(this.value=t,this.change.emit(t))};isOptionSelected(t){return this.value===t.value}isOptionDisabled(t){return this.disabled||!!t.disabled}getButtonClasses(t){const o=["sd-radio-button__option",this.isOptionSelected(t)?"sd-radio-button__option--selected":"sd-radio-button__option--unselected"];return this.isOptionDisabled(t)&&o.push("sd-radio-button__option--disabled"),o.join(" ")}getGroupClasses(){return["sd-radio-button",`sd-radio-button--${this.size??"sm"}`].join(" ")}_groupName;get groupName(){return null!=this._groupName&&""!==this._groupName||(this._groupName=null!=this.name&&""!==this.name?this.name:`sd-radio-button-${crypto.randomUUID()}`),this._groupName}render(){const t=l[this.size??"sm"]??l.sm,o={"--sd-radio-button-height":`${t.height}px`,"--sd-radio-button-padding-x":`${t.paddingX}px`,"--sd-radio-button-font-family":t.fontFamily,"--sd-radio-button-font-weight":t.fontWeight,"--sd-radio-button-font-size":`${t.fontSize}px`,"--sd-radio-button-line-height":`${t.lineHeight}px`,"--sd-radio-button-text-decoration":t.textDecoration,"--sd-radio-button-radius":`${u}px`,"--sd-radio-button-border-width":`${h}px`,"--sd-radio-button-group-gap":`${c}px`,"--sd-radio-button-border-default":p.border.default,"--sd-radio-button-border-select":p.border.select,"--sd-radio-button-border-disabled":p.border.disabled,"--sd-radio-button-bg-default":p.bg.default,"--sd-radio-button-bg-hover":p.bg.hover,"--sd-radio-button-bg-select":p.bg.select,"--sd-radio-button-bg-disabled":p.bg.disabled,"--sd-radio-button-content-default":p.content.default,"--sd-radio-button-content-hover":p.content.hover,"--sd-radio-button-content-select":p.content.select,"--sd-radio-button-content-disabled":p.content.disabled};return e("div",{key:"17355ebde09f652f5b94b4f70f09f68ef44cd29d",class:this.getGroupClasses(),style:o,role:"radiogroup","aria-disabled":this.disabled.toString()},this.options.map((t=>{const o=this.isOptionSelected(t),d=this.isOptionDisabled(t);return e("label",{key:`radio-${t.value}`,class:this.getButtonClasses(t),"aria-label":t.label||"radio option","data-label":t.label},e("input",{type:"radio",name:this.groupName,value:t.value.toString(),checked:o,disabled:d,onInput:()=>this.handleRadioChange(t.value,t.disabled)}),t.label&&e("span",{class:"sd-radio-button__label"},t.label))})))}};g.style="sd-radio-button{display:inline-flex;width:fit-content;height:fit-content}.sd-radio-button{display:inline-flex;flex-flow:row nowrap;gap:0}.sd-radio-button__option{display:flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;height:var(--sd-radio-button-height);padding:0 var(--sd-radio-button-padding-x);border:var(--sd-radio-button-border-width) solid var(--sd-radio-button-border-default);background-color:var(--sd-radio-button-bg-default);color:var(--sd-radio-button-content-default);font-family:var(--sd-radio-button-font-family);font-weight:var(--sd-radio-button-font-weight);font-size:var(--sd-radio-button-font-size);line-height:var(--sd-radio-button-line-height);text-decoration:var(--sd-radio-button-text-decoration);cursor:pointer;user-select:none;-webkit-user-select:none;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.sd-radio-button__option input{display:none}.sd-radio-button__option:not(:first-child){margin-left:var(--sd-radio-button-group-gap)}.sd-radio-button__option:first-child{border-top-left-radius:var(--sd-radio-button-radius);border-bottom-left-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:last-child{border-top-right-radius:var(--sd-radio-button-radius);border-bottom-right-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:only-child{border-radius:var(--sd-radio-button-radius)}.sd-radio-button__option--selected{background-color:var(--sd-radio-button-bg-select);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-select);z-index:1}.sd-radio-button__option:hover:not(.sd-radio-button__option--disabled){background-color:var(--sd-radio-button-bg-hover);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-hover);z-index:2}.sd-radio-button__option--disabled{background-color:var(--sd-radio-button-bg-disabled);border-color:var(--sd-radio-button-border-disabled);color:var(--sd-radio-button-content-disabled);cursor:not-allowed}.sd-radio-button__label{user-select:none;-webkit-user-select:none}";export{g as sd_radio_button}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-BZ5lcC25.js";const a=class{constructor(t){s(this,t),this.sdSubmit=i(this,"sdSubmit",7),this.sdValidationError=i(this,"sdValidationError",7)}formClass="";fields=[];sdSubmit;sdValidationError;sortFieldsByDomOrder(){this.fields.sort(((s,i)=>{const t=s.el,a=i.el;if(!t||!a)return 0;if(t===a)return 0;const e=t.compareDocumentPosition(a);return e&Node.DOCUMENT_POSITION_FOLLOWING?-1:e&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}async sdRegisterField(s){""!==s.name?this.fields.includes(s)||(this.fields.push(s),this.sortFieldsByDomOrder()):console.warn("[sd-form] field.name is required")}async sdUnregisterField(s){if("string"!=typeof s)this.fields=this.fields.filter((i=>i!==s));else{const i=this.fields.findIndex((i=>i.name===s));-1!==i&&this.fields.splice(i,1)}}async runValidation(){const s=(await Promise.all(this.fields.map((async s=>({field:s,valid:await s.sdValidate()}))))).filter((s=>!s.valid)).map((s=>s.field));if(s.length>0){const i=s[0];i.sdFocus(),i.sdScrollIntoView?.()}return{valid:0===s.length,invalidFields:s}}async sdValidate(){const{valid:s}=await this.runValidation();return s}async sdReset(){this.fields.forEach((s=>s.sdReset()))}async sdResetValidation(){this.fields.forEach((s=>s.sdResetValidation()))}async onSubmit(s){s.preventDefault();const{valid:i,invalidFields:t}=await this.runValidation();i?this.sdSubmit.emit():this.sdValidationError.emit({names:t.map((s=>s.name))})}render(){return t("form",{key:"f533f9dcf3a13e66d37644baa5217b90a67350a2",onSubmit:s=>this.onSubmit(s),class:this.formClass},t("slot",{key:"8a108703faeb2ed7d1e47a72b407b7a7fc88063d"}))}};export{a as sd_form}
1
+ import{r as s,c as i,h as t}from"./p-BZg-6aSz.js";const a=class{constructor(t){s(this,t),this.sdSubmit=i(this,"sdSubmit",7),this.sdValidationError=i(this,"sdValidationError",7)}formClass="";fields=[];sdSubmit;sdValidationError;sortFieldsByDomOrder(){this.fields.sort(((s,i)=>{const t=s.el,a=i.el;if(!t||!a)return 0;if(t===a)return 0;const e=t.compareDocumentPosition(a);return e&Node.DOCUMENT_POSITION_FOLLOWING?-1:e&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}async sdRegisterField(s){""!==s.name?this.fields.includes(s)||(this.fields.push(s),this.sortFieldsByDomOrder()):console.warn("[sd-form] field.name is required")}async sdUnregisterField(s){if("string"!=typeof s)this.fields=this.fields.filter((i=>i!==s));else{const i=this.fields.findIndex((i=>i.name===s));-1!==i&&this.fields.splice(i,1)}}async runValidation(){const s=(await Promise.all(this.fields.map((async s=>({field:s,valid:await s.sdValidate()}))))).filter((s=>!s.valid)).map((s=>s.field));if(s.length>0){const i=s[0];i.sdFocus(),i.sdScrollIntoView?.()}return{valid:0===s.length,invalidFields:s}}async sdValidate(){const{valid:s}=await this.runValidation();return s}async sdReset(){this.fields.forEach((s=>s.sdReset()))}async sdResetValidation(){this.fields.forEach((s=>s.sdResetValidation()))}async onSubmit(s){s.preventDefault();const{valid:i,invalidFields:t}=await this.runValidation();i?this.sdSubmit.emit():this.sdValidationError.emit({names:t.map((s=>s.name))})}render(){return t("form",{key:"f533f9dcf3a13e66d37644baa5217b90a67350a2",onSubmit:s=>this.onSubmit(s),class:this.formClass},t("slot",{key:"8a108703faeb2ed7d1e47a72b407b7a7fc88063d"}))}};export{a as sd_form}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,a as s,d as i,f as a,h,H as n}from"./p-BZg-6aSz.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as o,b as d,c,d as b}from"./p-BXcizROm.js";import"./p-D9tQwTWy.js";import"./p-BJfiMC9H.js";let u=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&s[t]];return e};const g=class{constructor(s){t(this,s),this.sdSelectChange=e(this,"sdSelectChange",7),this.sdPageChange=e(this,"sdPageChange",7),this.sdRowsPerPageChange=e(this,"sdRowsPerPageChange",7),this.sdVirtualUpdate=e(this,"sdVirtualUpdate",7),this.sdVirtualReachEnd=e(this,"sdVirtualReachEnd",7)}static DEFAULT_NO_DATA_LABEL="데이터가 없습니다.";get el(){return s(this)}tableId=u(8);fallbackTableId=u(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};radius="default";noDataLabel=g.DEFAULT_NO_DATA_LABEL;resolvedNoDataLabel=g.DEFAULT_NO_DATA_LABEL;isLoading=!1;pagination;useInternalPagination=!1;useRowsPerPageSelect=!1;dense=!1;useVirtualScroll=!1;rowHeight;get effectiveRowHeight(){return null!=this.rowHeight?this.rowHeight:Number(this.dense?l.dense.height:l.default.height)}virtualBuffer=5;virtualEndThreshold=10;rowsPerPageOption=[{label:"10개씩 보기",value:10},{label:"25개씩 보기",value:25},{label:"50개씩 보기",value:50},{label:"100개씩 보기",value:100}];sdSelectChange;sdPageChange;sdRowsPerPageChange;sdVirtualUpdate;sdVirtualReachEnd;currentPage=1;innerRowsPerPage=10;innerSelected=new Set;columnWidths=[];scrolledLeft=!1;scrolledRight=!1;rowCount=0;loadingScrollTop=0;noDataBodyHeight=60;autoThead=!1;autoTbody=!1;vsStart=0;vsEnd=0;lastReachEndNotifiedRowCount=-1;scrollContainer=null;noDataContentEl=null;noDataContentResizeObserver;onScroll;spanRegistry=new Map;useFrameRegistry=new Map;cellClassRegistry=new Map;rowIndexMap=new Map;rebuildRowIndexMap(){if(this.rowIndexMap.clear(),!Array.isArray(this.rows))return;const t=this.rowKey;this.rows.forEach(((e,s)=>{const i=e?.[t];null!=i&&this.rowIndexMap.set(String(i),s)}))}resolveRowIndex(t){const e=this.rowIndexMap.get(t);if(void 0!==e)return e;const s=Number(t);return Number.isFinite(s)?s:null}toFiniteNumber(t,e){const s="number"==typeof t?t:Number(t);return Number.isFinite(s)?s:e}isRowsPerPageValue(t){return null===t||"string"==typeof t||"number"==typeof t}isValidTableId(t){return"string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t}getResolvedTableId(){if(this.isValidTableId(this.tableId))return this.tableId;const t=this.el?.getAttribute(r);return this.isValidTableId(t)?t:this.fallbackTableId}syncTableIdAttribute(){const t=this.getResolvedTableId();this.el?.getAttribute(r)!==t&&this.el.setAttribute(r,t)}handleIsLoadingChange(t){t&&(this.loadingScrollTop=this.scrollContainer?.scrollTop??0),this.syncNoDataContentObserver()}handleUseVirtualScrollChange(t){t&&i((()=>this.propagateVirtualUpdate()))}handleColumnsChange(t){this.columnWidths=t.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.refreshChildrenConfig()}handleRowsChange(t){Array.isArray(t)&&(this.rowCount=t.length,this.rebuildRowIndexMap(),this.useVirtualScroll&&this.propagateVirtualUpdate(!0),this.pushRowsToChildren(t),this.syncNoDataContentObserver())}handleRowKeyChange(){this.rebuildRowIndexMap()}handleTableIdChange(){this.syncTableIdAttribute()}handleNoDataLabelChange(t){this.resolvedNoDataLabel="string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t?t:g.DEFAULT_NO_DATA_LABEL}handleConfigChange(){this.refreshChildrenConfig()}handleSelectedChange(t){this.innerSelected=new Set(t)}handlePaginationChange(t){null!=t?.page&&t.page!==this.currentPage&&(this.currentPage=t.page),null!=t?.rowsPerPage&&t.rowsPerPage!==this.innerRowsPerPage&&(this.innerRowsPerPage=t.rowsPerPage)}detectChildren(){const t=!!this.el.querySelector(":scope > sd-thead"),e=!!this.el.querySelector(":scope > sd-tbody");this.autoThead=!t,this.autoTbody=!e}componentWillLoad(){this.syncTableIdAttribute(),this.handleNoDataLabelChange(this.noDataLabel),this.detectChildren(),this.innerSelected=new Set(this.selected||[]),this.columnWidths=(this.columns||[]).map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.rebuildRowIndexMap(),null!=this.pagination?.page&&(this.currentPage=this.pagination.page),null!=this.pagination?.rowsPerPage&&(this.innerRowsPerPage=this.pagination.rowsPerPage);const t=this.el;t.isRowSelectedSync=this.isRowSelectedSync.bind(this),t.updateRowSelectSync=this.updateRowSelectSync.bind(this),t.toggleSelectAllSync=this.toggleSelectAllSync.bind(this),t.getIsAllCheckedSync=this.getIsAllCheckedSync.bind(this),t.getStickyStyleSync=this.getStickyStyleSync.bind(this),t.setRowCountSync=this.setRowCountSync.bind(this),t.handleResize=this.handleResize.bind(this),t.getPaginationInfoSync=this.getPaginationInfoSync.bind(this),t.getVirtualScrollRangeSync=this.getVirtualScrollRangeSync.bind(this),t.getConfigSync=this.getConfigSync.bind(this),t.getTableIdSync=()=>this.getResolvedTableId(),t.getVirtualScrollConfigSync=this.getVirtualScrollConfigSync.bind(this),t.calculateVisibleRange=this.calculateVisibleRange.bind(this),t.registerSpanSync=this.registerSpanSync.bind(this),t.unregisterSpanSync=this.unregisterSpanSync.bind(this),t.getSpanSync=this.getSpanSync.bind(this),t.isCoveredSync=this.isCoveredSync.bind(this),t.hasRowspanSync=this.hasRowspanSync.bind(this),t.registerCellClassSync=this.registerCellClassSync.bind(this),t.unregisterCellClassSync=this.unregisterCellClassSync.bind(this),t.getCellClassSync=this.getCellClassSync.bind(this),t.registerUseFrameSync=this.registerUseFrameSync.bind(this),t.unregisterUseFrameSync=this.unregisterUseFrameSync.bind(this),t.hasUseFrameInRowSync=this.hasUseFrameInRowSync.bind(this),t.isCellUseFrameSync=this.isCellUseFrameSync.bind(this),Array.isArray(this.rows)&&(this.rowCount=this.rows.length,this.pushRowsToChildren(this.rows))}componentDidLoad(){Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),i((()=>{const t=this.el.shadowRoot?.querySelector(".sd-table__scroll-container");if(!t)return;let e=!1;this.onScroll=()=>{const s=t.scrollLeft,i=s>0,a=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===a||(this.scrolledLeft=i,this.scrolledRight=a,this.refreshChildrenConfig()),this.useVirtualScroll&&!e&&(e=!0,requestAnimationFrame((()=>{e=!1,this.propagateVirtualUpdate()})))},this.scrollContainer=t,t.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll(),this.useVirtualScroll&&this.propagateVirtualUpdate()})),this.syncNoDataContentObserver()}disconnectedCallback(){this.scrollContainer&&this.onScroll&&this.scrollContainer.removeEventListener("scroll",this.onScroll),this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0}syncNoDataContentObserver(){if(0!==this.rowCount||this.isLoading)return this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0,void(this.noDataBodyHeight=60);this.observeNoDataContentHeight()}observeNoDataContentHeight(){if("undefined"==typeof ResizeObserver)return;const t=this.noDataContentEl;t&&(this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=new ResizeObserver((()=>{const e=Math.ceil(t.scrollHeight),s=Math.max(60,e);s!==this.noDataBodyHeight&&(this.noDataBodyHeight=s)})),this.noDataContentResizeObserver.observe(t),i((()=>{if(!this.noDataContentEl)return;const t=Math.ceil(this.noDataContentEl.scrollHeight),e=Math.max(60,t);e!==this.noDataBodyHeight&&(this.noDataBodyHeight=e)})))}queryChildEl(t){return this.el.querySelector(t)??this.el.shadowRoot?.querySelector(t)??null}queryAllTr(){return[...Array.from(this.el.querySelectorAll("sd-tr")),...Array.from(this.el.shadowRoot?.querySelectorAll("sd-tr")??[])]}pushRowsToChildren(t){const e=this.queryChildEl("sd-tbody");e&&(e.rows=t);const s=this.queryChildEl("sd-thead");s&&(s.rows=t)}handleStructureSlotChange=()=>{Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),this.refreshChildrenConfig()};refreshChildrenSelection(){const t=this.queryChildEl("sd-thead");t?.refreshSelection?.(),this.queryAllTr().forEach((t=>t.refreshSelection?.()))}refreshChildrenConfig(){const t=this.queryChildEl("sd-thead");t?.refreshConfig?.(),this.queryAllTr().forEach((t=>t.refreshConfig?.()))}maybeEmitVirtualReachEnd(t,e){const s=Math.max(1,this.virtualEndThreshold);e>=Math.max(0,this.rowCount-s)&&this.lastReachEndNotifiedRowCount!==this.rowCount&&(this.lastReachEndNotifiedRowCount=this.rowCount,this.sdVirtualReachEnd.emit({from:t,to:e,rowCount:this.rowCount,threshold:s}))}propagateVirtualUpdate(t=!1){if(!this.scrollContainer||!this.useVirtualScroll)return;const e=this.toFiniteNumber(this.scrollContainer.scrollTop,0),s=this.toFiniteNumber(this.scrollContainer.clientHeight,0),{start:i,end:a}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(a))return;const h=this.vsStart!==i||this.vsEnd!==a;if(!h&&!t)return;this.vsStart=i,this.vsEnd=a;const n=i*this.effectiveRowHeight,r=Math.max(0,(this.rowCount-a)*this.effectiveRowHeight),l=this.queryChildEl("sd-tbody");l?.setSpacersSync?.(n,r),h&&this.sdVirtualUpdate.emit({from:i,to:a}),this.maybeEmitVirtualReachEnd(i,a)}getVirtualScrollConfigSync(){return{useVirtualScroll:this.useVirtualScroll,rowHeight:this.effectiveRowHeight,virtualBuffer:this.virtualBuffer,vsStart:this.vsStart,vsEnd:this.vsEnd,rowCount:this.rowCount}}getConfigSync(){return{columns:this.columns,selectable:this.selectable,resizable:this.resizable,stickyColumn:this.stickyColumn,stickyHeader:this.stickyHeader,scrolledLeft:this.scrolledLeft,scrolledRight:this.scrolledRight,columnWidths:this.columnWidths,dense:this.dense}}registerUseFrameSync(t,e){if(null==t||""===e)return;let s=this.useFrameRegistry.get(t);s||(s=new Set,this.useFrameRegistry.set(t,s)),s.add(e)}unregisterUseFrameSync(t,e){if(null==t||""===e)return;const s=this.useFrameRegistry.get(t);s&&(s.delete(e),0===s.size&&this.useFrameRegistry.delete(t))}hasUseFrameInRowSync(t){const e=this.useFrameRegistry.get(t);return null!=e&&e.size>0}isCellUseFrameSync(t,e){return this.useFrameRegistry.get(t)?.has(e)??!1}isRowSelectedSync(t){return Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"]))}async isRowSelected(t){return this.isRowSelectedSync(t)}updateRowSelectSync(t){const e=Array.from(this.innerSelected),s=this.isRowSelectedSync(t)?e.filter((e=>e[this.rowKey??"id"]!==t[this.rowKey??"id"])):[...e,t];s.length!==e.length&&(this.innerSelected=new Set(s),this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection())}async updateRowSelect(t){this.updateRowSelectSync(t)}toggleSelectAllSync(t,e){if(t){const t=new Set([...e]);this.innerSelected=new Set([...this.innerSelected,...t])}else{const t=e.map((t=>t[this.rowKey??"id"]));this.innerSelected=new Set([...this.innerSelected].filter((e=>!t.includes(e[this.rowKey??"id"]))))}this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection()}async toggleSelectAll(t,e){this.toggleSelectAllSync(t,e)}getIsAllCheckedSync(t){const e=t.length,s=t.filter((t=>Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"])))).length;return 0!==s&&(s===e||null)}async getIsAllChecked(t){return this.getIsAllCheckedSync(t)}changePage(t){this.useInternalPagination?(this.currentPage=t,this.sdPageChange.emit(this.currentPage),this.updateRowsVisibility()):this.sdPageChange.emit(t)}updateRowsVisibility(){this.queryAllTr().forEach((t=>t.updateVisibility?.()))}changeRowsPerPage(t){const e=null!=t&&""!==t?Number(t):0;if(!this.useInternalPagination)return void this.sdRowsPerPageChange.emit(e);this.innerRowsPerPage=e;const s=Math.max(1,Math.ceil(this.rowCount/e));this.currentPage>s&&(this.currentPage=s),this.sdRowsPerPageChange.emit(e),this.updateRowsVisibility()}get lastPageNumber(){if(this.useInternalPagination)return Math.max(1,Math.ceil(this.rowCount/this.innerRowsPerPage));const{lastPage:t,rowsPerPage:e=10}=this.pagination||{};return t??Math.max(1,Math.ceil(this.rowCount/e))}handleResize(t,e,s=!1){if("undefined"==typeof document)return;const i=e.clientX,a=this.columnWidths[t],h=e=>{const h=this.columns[t];if(null==h)return;const n=h.maxWidth||9999,r=e.clientX-i,l=Math.min(Math.max(a+(s?-r:r),h.minWidth||50),n);this.columnWidths=this.columnWidths.map(((e,s)=>s===t?l:e));const o=this.queryChildEl("sd-thead");o?.setColumnWidths?.(this.columnWidths),this.queryAllTr().forEach((t=>t.setColumnWidths?.(this.columnWidths)));const d=this.stickyColumn?.right||0,c=this.columns.filter((t=>!1!==t.visible)).length;d>0&&t===c-d&&requestAnimationFrame((()=>{this.onScroll?.()}))},n=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",n)}getStickyStyleSync(t){const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),this.selectable?o:0),s=this.columnWidths.filter(((e,s)=>s>=this.columns.filter((t=>!1!==t.visible)).length-(this.stickyColumn?.right||0)&&s>t)).reduce(((t,e)=>t+e),0),i=this.columns.filter((t=>!1!==t.visible))[t],a={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(a.width=`${this.columnWidths[t]}px`,a.minWidth=`${this.columnWidths[t]}px`,a.maxWidth=`${this.columnWidths[t]}px`),a}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():a(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const a=Math.max(1,Math.floor(s||1)),h=Math.max(1,Math.floor(i||1)),n=this.spanKey(t,e),r=this.spanRegistry.get(n);if(1===a&&1===h){if(!r)return;return this.spanRegistry.delete(n),void this.requestAllTrUpdate()}r&&r.rowspan===a&&r.colspan===h||(this.spanRegistry.set(n,{rowspan:a,colspan:h}),this.requestAllTrUpdate())}unregisterSpanSync(t,e){if(null==t||""===e)return;const s=this.spanKey(t,e);this.spanRegistry.has(s)&&(this.spanRegistry.delete(s),this.requestAllTrUpdate())}getSpanSync(t,e){return this.spanRegistry.get(this.spanKey(t,e))}registerCellClassSync(t,e,s){if(null==t||""===e)return;const i=this.spanKey(t,e),a=(s??"").trim();""!==a?this.cellClassRegistry.set(i,a):this.cellClassRegistry.delete(i)}unregisterCellClassSync(t,e){null!=t&&""!==e&&this.cellClassRegistry.delete(this.spanKey(t,e))}getCellClassSync(t,e){return this.cellClassRegistry.get(this.spanKey(t,e))}hasRowspanSync(){for(const t of this.spanRegistry.values())if(t.rowspan>1)return!0;return!1}isCoveredSync(t,e,s){if(0===this.spanRegistry.size)return!1;const i=s.filter((t=>!1!==t.visible));for(let s=0;s<e;s++){const a=i[s];if(null==a)continue;const h=this.spanRegistry.get(this.spanKey(t,"string"==typeof a.field?a.field:a.name));if(h&&s+h.colspan>e)return!0}const a=this.resolveRowIndex(t);if(null==a)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const h=t.indexOf("::");if(h<0)continue;const n=t.slice(0,h),r=t.slice(h+2),l=this.resolveRowIndex(n);if(null==l)continue;if(l>=a)continue;if(l+s.rowspan<=a)continue;const o=i.findIndex((t=>("string"==typeof t.field?t.field:t.name)===r));if(!(o<0)&&o<=e&&o+s.colspan>e)return!0}return!1}setRowCountSync(t){const e=Math.max(0,Math.floor(this.toFiniteNumber(t,0)));e!==this.rowCount&&(this.lastReachEndNotifiedRowCount=-1),this.rowCount=e,this.useVirtualScroll&&this.propagateVirtualUpdate(!0)}async setRowCount(t){this.setRowCountSync(t)}calculateVisibleRange(t,e){const s=Math.max(1,this.toFiniteNumber(this.effectiveRowHeight,40)),i=Math.max(0,Math.floor(this.toFiniteNumber(this.virtualBuffer,5))),a=Math.max(0,this.toFiniteNumber(t,0)),h=Math.max(0,this.toFiniteNumber(e,0)),n=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),r=Math.floor(a/s),l=Math.ceil(h/s);return{start:Math.max(0,r-i),end:Math.min(n,r+l+i)}}getPaginationInfoSync(){if(!this.useInternalPagination||!this.pagination)return null;const t=(this.currentPage-1)*this.innerRowsPerPage;return{startIndex:t,endIndex:t+this.innerRowsPerPage,currentPage:this.currentPage,rowsPerPage:this.innerRowsPerPage}}async getPaginationInfo(){return this.getPaginationInfoSync()}getVirtualScrollRangeSync(){return this.useVirtualScroll&&this.vsEnd>0?{from:this.vsStart,to:this.vsEnd}:null}renderAutoRows(){if(this.useVirtualScroll)return null;const t=this.rows??[],e=this.getPaginationInfoSync(),s=e?.startIndex??0;return(e?t.slice(e.startIndex,e.endIndex):t).map(((t,e)=>{const i=s+e;return h("sd-tr",{key:i,"row-key":String(i),row:t})}))}get tableClasses(){return["sd-table",this.stickyHeader&&"sd-table--sticky-header",this.selectable&&"sd-table--selectable",this.resizable&&"sd-table--resizable",(this.selectable||(this.stickyColumn?.left??0)>0||(this.stickyColumn?.right??0)>0)&&"sd-table--sticky-column",this.scrolledLeft&&"sd-table--scrolled-left",this.scrolledRight&&"sd-table--scrolled-right",0===this.rowCount&&!this.isLoading&&"sd-table--no-data"].filter(Boolean).join(" ")}render(){const t=this.getResolvedTableId(),e=0===this.rowCount&&!this.isLoading,s=36+this.noDataBodyHeight;return h(n,{key:"b90b9865f78c2b42c3c13ad27ed968dd97827eb6",style:{"--table-radius":`${b}px`,"--table-border-color":c.color,"--table-border-width":`${c.width}px`,"--table-body-font-family":d.fontFamily,"--table-body-font-weight":d.fontWeight,"--table-body-font-size":`${d.fontSize}px`,"--table-body-line-height":`${d.lineHeight}px`,"--table-body-text-decoration":d.textDecoration,"--table-selectable-width":`${o}px`,"--table-host-height":e?void 0!==this.height?`max(${this.height}, ${s}px)`:`max(${s}px, 100%)`:this.height??"100%"}},h("div",{key:"2eb291b03b219a3abb4da5967c6d0f43195b458e",class:"sd-table__container",style:{"--table-width":this.width,"--pagination-height":(this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0)+"px"}},h("div",{key:"999feaffbf82db9233416a1d66974e8859b9b3a0",class:{"sd-table__wrapper":!0,"sd-table__wrapper--radius-useTop":"useTop"===this.radius,"sd-table__wrapper--radius-full":"full"===this.radius}},h("div",{key:"ff0a04325ab9fe1ba5e6b25f52bb8265226fbba4",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&h("div",{key:"1a4dbf4a721240b3395230997c18c8ef989bbffc",class:"sd-table__loading",style:{top:`${this.loadingScrollTop}px`}},h("sd-circle-progress",{key:"793a6772ef4c792e7f50c2ad90d43bdfbdde11a0",indeterminate:!0})),e&&h(h.Fragment,null,h("div",{key:"13b76f695edddfa3d4a13bcb1091f95cafb1ae17",class:"sd-table__no-data-header-overlay"}),h("div",{key:"f271bfa20d06cba0cc6c5fe6b5af5c874c1e0682",class:"sd-table__no-data"},h("div",{key:"6791f70e0b4cd1226bdcc16414249ad178b70396",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},h("slot",{key:"9cba0ff5c5ea3b4c78ccdb961de9cfe3ef2ac1e9",name:"no-data"},h("span",{key:"1022372f37f1564b0d636c888a17cb5ab5ac2e35"},this.resolvedNoDataLabel))))),h("table",{key:"e3d8c7dec8b3c76896b3063266dd5450bbfa7c13",class:this.tableClasses},this.autoThead?h("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange},h("sd-thead",{rows:this.rows??[]})):h("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange}),this.autoTbody?h("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange},h("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):h("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&h("div",{key:"5410b53a9182f97406a0992464bc3435eb8439b1",class:"sd-table__pagination"},h("sd-pagination",{key:"aa237fe475797dd626856f5335395bdfa870f6db",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&h("sd-select",{key:"d2b98c053c6d63f0bbea73d66779dfa5c1828b5a",value:this.useInternalPagination?this.innerRowsPerPage:this.pagination.rowsPerPage,options:this.rowsPerPageOption,width:"128px",emitValue:!0,onSdUpdate:t=>{this.isRowsPerPageValue(t.detail)&&this.changeRowsPerPage(t.detail)}}))))}static get watchers(){return{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}}};g.style="sd-table,:host{display:block;width:100%;height:var(--table-host-height);max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:100%;width:var(--table-width, 100%);max-width:100%;min-width:0;color:#222222;display:flex;flex-direction:column}.sd-table__wrapper{width:100%;min-width:0;height:calc(100% - var(--pagination-height, 0px));border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--radius-useTop{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.sd-table__wrapper--radius-full{border-radius:0}.sd-table__scroll-container{width:100%;height:100%;display:flex;flex-direction:column;position:relative;font-family:var(--table-body-font-family, inherit);font-weight:var(--table-body-font-weight, 400);font-size:var(--table-body-font-size, 12px);line-height:var(--table-body-line-height, 20px);text-decoration:var(--table-body-text-decoration, none);overflow:auto;background:#FFFFFF}.sd-table__scroll-container::-webkit-scrollbar{opacity:0;width:8px;background:#E5E5E5}.sd-table__scroll-container::-webkit-scrollbar:horizontal{height:8px}.sd-table__scroll-container::-webkit-scrollbar-thumb{height:80px;background-color:#CCCCCC;border-radius:4px}.sd-table__scroll-container::-webkit-scrollbar-track{background-color:#E5E5E5}.sd-table__scroll-container--loading{overflow:hidden !important;pointer-events:none}.sd-table__scroll-container--no-data{overflow:hidden;pointer-events:none}.sd-table__no-data{position:absolute;top:36px;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;font-size:var(--table-body-font-size, 12px);color:#888888;pointer-events:none;z-index:200;background:rgba(255, 255, 255, 0.6)}.sd-table__no-data-header-overlay{position:absolute;top:0;left:0;right:0;height:36px;background:rgba(255, 255, 255, 0.6);z-index:210;pointer-events:none}.sd-table__no-data-content{pointer-events:auto;min-height:60px;width:100%;display:flex;align-items:center;justify-content:center}.sd-table__loading{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center;pointer-events:none}.sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table--selectable sd-thead,.sd-table--selectable sd-tbody{--selectable:true}.sd-table--sticky-header sd-thead thead{position:sticky;top:0;z-index:120}.sd-table--sticky-column sd-thead,.sd-table--sticky-column sd-tbody{--sticky-column:true}.sd-table--scrolled-left sd-thead,.sd-table--scrolled-left sd-tbody{--scrolled-left:true}.sd-table--scrolled-right sd-thead,.sd-table--scrolled-right sd-tbody{--scrolled-right:true}.sd-table--resizable sd-thead{--resizable:true}.sd-table--no-data sd-thead{opacity:0.4}.sd-table__pagination{position:relative;background:#F9F9F9;height:48px;display:flex;align-items:center;justify-content:center;border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);margin-top:-1px;border-radius:var(--table-radius, 8px)}.sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}";export{g as sd_table}
@@ -1 +1 @@
1
- import{r as t,c as e,a as s,h as i}from"./p-BZ5lcC25.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,i as n,e as d,E as c,L as a,a as u,b as g,d as p}from"./p-CAFz8W8_.js";import{s as f}from"./p-BE4tnQ2Z.js";import"./p-U8VaRj9c.js";const b=class{constructor(s){t(this,s),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return s(this)}type="default";value=null;options=[];placeholder="선택";dropdownWidth="";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";addonAlign="start";error=!1;hint="";errorMessage="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";useSearch=!1;allSelectedLabel="전체";useSelectAll=!1;isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;async sdFocus(){this.disabled||await(this.triggerComponentRef?.sdFocus())}async sdOpen(){await new Promise((t=>setTimeout(t,0))),this.disabled||this.isOpen||(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)}triggerRef;triggerComponentRef;closeAnimationTimer;name=r();triggerHasFocus=!1;watchIsOpen(t){this.syncFocusedState(t),this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}get displayText(){if(this.isMulti){if(!Array.isArray(this.value)||0===this.value.length)return"";const t=this.getNonDisabledLeaves(this.options),e=this.getSelectedOptions();if(t.length>0&&t.every((t=>e.some((e=>e.value===t.value)))))return this.allSelectedLabel??"전체";const s=this.flattenOptions(this.options);return this.value.map((t=>{if(null!=t&&"object"==typeof t){const e=t;return e.label??s.find((t=>t.value===e.value))?.label??""}return s.find((e=>e.value===t))?.label??""})).filter(Boolean).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options);return t.find((t=>t.value===this.value))?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getNonDisabledLeaves(t){return t.flatMap((t=>t.disabled?[]:t.children?this.getNonDisabledLeaves(t.children):[t]))}getSelectedOptions(){const t=this.value;return null!=t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const t=this.triggerRef.getBoundingClientRect(),e=b.VIEWPORT_PADDING,s=b.PORTAL_OFFSET_Y,i=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),h=Math.max(window.innerHeight-t.bottom-e-s,0),o=Math.max(t.top-e-s,0),l=Math.max(h,o),n=Math.max(window.innerWidth-2*e,0);this.resolvedDropdownHeight=`${Math.min(i,l)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,n)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),b.CLOSE_ANIMATION_DURATION))}prepareDropdownGeometry(){this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints()}syncFocusedState(t=this.isOpen){this.focused=t||this.triggerHasFocus}handleTriggerFocus=()=>{this.triggerHasFocus=!0,this.syncFocusedState()};handleTriggerBlur=()=>{this.triggerHasFocus=!1,this.syncFocusedState()};handleTriggerClick=()=>{this.isOpen?this.closeDropdown():(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),r=e.filter((e=>!t.has(e.value)));i=[...s,...r]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const t={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:b.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"0864fe68a337d4bab526fa61570e856c8eff6d1c",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"781819ed75f47395e96fd6808766e6bb8c246fa5",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"8cebad98f0cd4b333954a55857aec3fbb6f3d283",ref:t=>{this.triggerComponentRef=t},displayText:this.displayText,placeholder:this.placeholder??"선택",disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick,onSdTriggerFocus:this.handleTriggerFocus,onSdTriggerBlur:this.handleTriggerBlur})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"fe68f0b01256e1c1d3200f9f5fd17c2adf97f0e0",...t},i("sd-select-listbox",{key:"98368524ef06a6d752f2313756a89ae6e8c05955",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.dropdownWidth||this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};b.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const x=class{constructor(s){t(this,s),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti&&this.getAllNonDisabledLeaves().length>0}getAllNonDisabledLeaves(){const t=e=>e.flatMap((e=>e.disabled?[]:e.children?t(e.children):[e]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const e=this.getSelectedValues(),s=t.filter((t=>e.has(t.value))).length;return 0!==s&&(s===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?h(this.options):this.options.length)>=o}get filteredOptions(){if(null==this.searchKeyword||""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>{const s=n(e.label)?d(e.label):e.label;return null!=s&&s.toLowerCase().includes(t)}))}get isEmpty(){return this.isDepth?0===h(this.filteredOptions)&&0===this.filteredOptions.length:0===this.filteredOptions.length}getSelectedValues(){return null!=this.value&&Array.isArray(this.value)?this.emitValue?new Set(this.value):new Set(this.value.map((t=>t.value))):new Set}isOptionSelected(t){return this.isMulti?this.getSelectedValues().has(t.value):this.emitValue||null==this.value||"object"!=typeof this.value||Array.isArray(this.value)?this.value===t.value:this.value.value===t.value}getGroupSelectionState(t){if(!this.isMulti||!t.children)return!1;const e=this.getSelectedValues();if(0===e.size)return!1;const s=this.collectVisibleLeaves(t);if(0===s.length)return!1;const i=s.filter((t=>e.has(t.value))).length;return 0!==i&&(i===s.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const e=this.getSelectedValues(),s=this.collectVisibleLeaves(t);return{selected:s.filter((t=>e.has(t.value))).length,total:s.length}}findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}collectLeaves(t){return t.children?t.children.flatMap((t=>this.collectLeaves(t))):[t]}collectVisibleLeaves(t){if(t.disabled)return[];if(!t.children)return[t];if(0===t.children.length){const e=this.findOriginalOption(t.value,this.options);return e?this.collectLeaves(e).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const t=[];this.showSelectAll&&t.push(x.SELECT_ALL_OPTION);const e=s=>{for(const i of s){const s=!!i.children;(!s||this.isMulti)&&!i.disabled&&t.push(i),s&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),t}isSelectAllOption(t){return this.showSelectAll&&t.value===x.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...x.SELECT_ALL_OPTION,children:t},leaves:t})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const e=this.navigableOptions[this.focusedIndex];return null!=e&&e.value===t.value}resetFocusOnFilter(){this.focusedIndex=this.navigableOptions.length>0?0:-1,this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}handleSearchFilter=t=>{this.searchKeyword=t.detail};handleScroll=t=>{this.isScrolled=t.target.scrollTop>0};emitOptionSelect(t){this.optionSelect.emit({option:t,leaves:this.collectVisibleLeaves(t)})}handleOptionClick=t=>{t.stopPropagation(),this.emitOptionSelect(t.detail)};handleOptionHover=t=>{if(this.suppressHover)return;const e=this.navigableOptions.findIndex((e=>e.value===t.value));e>=0&&(this.focusedIndex=e)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const e=this.navigableOptions;if("ArrowDown"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%e.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?e.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=e.length)return;t.preventDefault(),t.stopPropagation();const s=e[this.focusedIndex];this.isSelectAllOption(s)?this.emitSelectAll():this.emitOptionSelect(s)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,e=t?.querySelector(".sd-select-list-item--focused");if(!t||!e)return;const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<s.top?t.scrollTop+=i.top-s.top:i.bottom>s.bottom&&(t.scrollTop+=i.bottom-s.bottom)}connectedCallback(){this.keydownAttached||(document.addEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!0)}disconnectedCallback(){this.keydownAttached&&(document.removeEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!1),this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}componentDidRender(){this.focusedIndex!==this.lastScrolledIndex&&(this.lastScrolledIndex=this.focusedIndex,this.focusedIndex>=0&&this.scrollFocusedIntoView())}renderOptions(t,e=1){return t.map((t=>{const s=!!t.children;return[i("sd-select-list-item",{option:t,depth:e,isSelected:s?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),s&&t.children?this.renderOptions(t.children,e+1):null]}))}render(){return i("div",{key:"bb8c7f22a164d29e30d2f9da7740883daef4fc27",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${a.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"ac1b06b12ec20d2b9d57ca3b4074b3752b5da5e1",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"2c7735e7098090762f573d63c2673d6face702c1",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"5377511fd55f0d34056ad64707265dd2cc86afc4",option:x.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(x.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(x.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},c):this.isDepth?this.renderOptions(this.filteredOptions):this.filteredOptions.map((t=>i("sd-select-list-item",{option:t,depth:1,isSelected:this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)})))))}static get watchers(){return{searchKeyword:[{resetFocusOnFilter:0}]}}};x.style=":host{display:block}:host .sd-select-listbox{display:flex;flex-direction:column;width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden;outline:none}:host .sd-select-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:0}:host .sd-select-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}";const m=class{constructor(s){t(this,s),this.triggerClick=e(this,"sdTriggerClick",7),this.triggerFocus=e(this,"sdTriggerFocus",7),this.triggerBlur=e(this,"sdTriggerBlur",7)}displayText="";placeholder="선택";disabled=!1;isOpen=!1;triggerClick;triggerFocus;triggerBlur;triggerEl;async sdFocus(){this.disabled||this.triggerEl?.focus()}handleClick=()=>{this.disabled||this.triggerClick.emit()};handleFocus=()=>{this.triggerFocus.emit()};handleBlur=()=>{this.triggerBlur.emit()};render(){const t=""!==this.displayText;return i("div",{key:"b2f140907d6e4454a3adfb9d3dd9babd9058c178",ref:t=>{this.triggerEl=t},role:"button","aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false",tabindex:this.disabled?-1:0,class:{"sd-select-trigger":!0,"sd-select-trigger--open":this.isOpen,"sd-select-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${p.paddingX}px`,"--trigger-gap":`${p.gap}px`,"--trigger-font-size":`${g.fontSize}px`,"--trigger-line-height":`${g.lineHeight}px`,"--trigger-font-weight":g.fontWeight,"--trigger-color":this.disabled?u.text.disabled:t?u.text.default:u.icon.default,"--trigger-icon-color":this.disabled?u.icon.disabled:u.icon.default},onClick:this.handleClick,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},i("div",{key:"6803bc50c5f62dce1b1e9d874559f8ca5fca7b75",class:"sd-select-trigger__content"},t&&n(this.displayText)?i("span",{class:"sd-select-trigger__text",ref:t=>t&&(t.innerHTML=f(this.displayText))}):i("span",{class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"397264b3179fb6699c1ee5454f76ac9d0779488c",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};m.style="sd-select-trigger{display:block;width:100%;height:100%}sd-select-trigger .sd-select-trigger{display:flex;width:100%;height:100%;cursor:pointer;user-select:none;overflow:hidden;border-radius:3px}sd-select-trigger .sd-select-trigger--disabled{cursor:not-allowed}sd-select-trigger .sd-select-trigger__content{display:flex;align-items:center;gap:var(--trigger-gap);flex:1;padding:0 var(--trigger-padding-x);min-width:0}sd-select-trigger .sd-select-trigger__text{flex:1;font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-trigger .sd-select-trigger__icon{flex-shrink:0;transition:transform 0.2s ease}sd-select-trigger .sd-select-trigger__icon--open{transform:rotate(180deg)}";export{b as sd_select,x as sd_select_listbox,m as sd_select_trigger}
1
+ import{r as t,c as e,a as s,h as i}from"./p-BZg-6aSz.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,i as n,e as c,E as a,L as d,a as u,b as g,d as p}from"./p-CAFz8W8_.js";import{s as f}from"./p-BE4tnQ2Z.js";import"./p-U8VaRj9c.js";const b=class{constructor(s){t(this,s),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return s(this)}type="default";value=null;options=[];placeholder="선택";dropdownWidth="";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";addonAlign="start";error=!1;hint="";errorMessage="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";useSearch=!1;allSelectedLabel="전체";useSelectAll=!1;isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;async sdFocus(){this.disabled||await(this.triggerComponentRef?.sdFocus())}async sdOpen(){await new Promise((t=>setTimeout(t,0))),this.disabled||this.isOpen||(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)}triggerRef;triggerComponentRef;closeAnimationTimer;name=r();triggerHasFocus=!1;watchIsOpen(t){this.syncFocusedState(t),this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}get displayText(){if(this.isMulti){if(!Array.isArray(this.value)||0===this.value.length)return"";const t=this.getNonDisabledLeaves(this.options),e=this.getSelectedOptions();if(t.length>0&&t.every((t=>e.some((e=>e.value===t.value)))))return this.allSelectedLabel??"전체";const s=this.flattenOptions(this.options);return this.value.map((t=>{if(null!=t&&"object"==typeof t){const e=t;return e.label??s.find((t=>t.value===e.value))?.label??""}return s.find((e=>e.value===t))?.label??""})).filter(Boolean).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options);return t.find((t=>t.value===this.value))?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getNonDisabledLeaves(t){return t.flatMap((t=>t.disabled?[]:t.children?this.getNonDisabledLeaves(t.children):[t]))}getSelectedOptions(){const t=this.value;return null!=t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const t=this.triggerRef.getBoundingClientRect(),e=b.VIEWPORT_PADDING,s=b.PORTAL_OFFSET_Y,i=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),h=Math.max(window.innerHeight-t.bottom-e-s,0),o=Math.max(t.top-e-s,0),l=Math.max(h,o),n=Math.max(window.innerWidth-2*e,0);this.resolvedDropdownHeight=`${Math.min(i,l)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,n)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),b.CLOSE_ANIMATION_DURATION))}prepareDropdownGeometry(){this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints()}syncFocusedState(t=this.isOpen){this.focused=t||this.triggerHasFocus}handleTriggerFocus=()=>{this.triggerHasFocus=!0,this.syncFocusedState()};handleTriggerBlur=()=>{this.triggerHasFocus=!1,this.syncFocusedState()};handleTriggerClick=()=>{this.isOpen?this.closeDropdown():(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),r=e.filter((e=>!t.has(e.value)));i=[...s,...r]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const t={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:b.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"426e5777a976da591726108e8a19c27822151c34",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"2e47d100a63bd6445f452701409cf05efabb30e0",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"65763371f56bae558f927189931b567e5ca73df6",ref:t=>{this.triggerComponentRef=t},displayText:this.displayText,placeholder:this.placeholder??"선택",disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick,onSdTriggerFocus:this.handleTriggerFocus,onSdTriggerBlur:this.handleTriggerBlur})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"98518c875649c8e38c15565d9bfccf9c0b0eeb9a",...t},i("sd-select-listbox",{key:"be8e2c814bd30a57ee20b0a0b378f3809ffef26a",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.dropdownWidth||this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};b.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const x=class{constructor(s){t(this,s),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti&&this.getAllNonDisabledLeaves().length>0}getAllNonDisabledLeaves(){const t=e=>e.flatMap((e=>e.disabled?[]:e.children?t(e.children):[e]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const e=this.getSelectedValues(),s=t.filter((t=>e.has(t.value))).length;return 0!==s&&(s===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?h(this.options):this.options.length)>=o}get filteredOptions(){if(null==this.searchKeyword||""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>{const s=n(e.label)?c(e.label):e.label;return null!=s&&s.toLowerCase().includes(t)}))}get isEmpty(){return this.isDepth?0===h(this.filteredOptions)&&0===this.filteredOptions.length:0===this.filteredOptions.length}getSelectedValues(){return null!=this.value&&Array.isArray(this.value)?this.emitValue?new Set(this.value):new Set(this.value.map((t=>t.value))):new Set}isOptionSelected(t){return this.isMulti?this.getSelectedValues().has(t.value):this.emitValue||null==this.value||"object"!=typeof this.value||Array.isArray(this.value)?this.value===t.value:this.value.value===t.value}getGroupSelectionState(t){if(!this.isMulti||!t.children)return!1;const e=this.getSelectedValues();if(0===e.size)return!1;const s=this.collectVisibleLeaves(t);if(0===s.length)return!1;const i=s.filter((t=>e.has(t.value))).length;return 0!==i&&(i===s.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const e=this.getSelectedValues(),s=this.collectVisibleLeaves(t);return{selected:s.filter((t=>e.has(t.value))).length,total:s.length}}findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}collectLeaves(t){return t.children?t.children.flatMap((t=>this.collectLeaves(t))):[t]}collectVisibleLeaves(t){if(t.disabled)return[];if(!t.children)return[t];if(0===t.children.length){const e=this.findOriginalOption(t.value,this.options);return e?this.collectLeaves(e).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const t=[];this.showSelectAll&&t.push(x.SELECT_ALL_OPTION);const e=s=>{for(const i of s){const s=!!i.children;(!s||this.isMulti)&&!i.disabled&&t.push(i),s&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),t}isSelectAllOption(t){return this.showSelectAll&&t.value===x.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...x.SELECT_ALL_OPTION,children:t},leaves:t})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const e=this.navigableOptions[this.focusedIndex];return null!=e&&e.value===t.value}resetFocusOnFilter(){this.focusedIndex=this.navigableOptions.length>0?0:-1,this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}handleSearchFilter=t=>{this.searchKeyword=t.detail};handleScroll=t=>{this.isScrolled=t.target.scrollTop>0};emitOptionSelect(t){this.optionSelect.emit({option:t,leaves:this.collectVisibleLeaves(t)})}handleOptionClick=t=>{t.stopPropagation(),this.emitOptionSelect(t.detail)};handleOptionHover=t=>{if(this.suppressHover)return;const e=this.navigableOptions.findIndex((e=>e.value===t.value));e>=0&&(this.focusedIndex=e)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const e=this.navigableOptions;if("ArrowDown"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%e.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?e.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=e.length)return;t.preventDefault(),t.stopPropagation();const s=e[this.focusedIndex];this.isSelectAllOption(s)?this.emitSelectAll():this.emitOptionSelect(s)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,e=t?.querySelector(".sd-select-list-item--focused");if(!t||!e)return;const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<s.top?t.scrollTop+=i.top-s.top:i.bottom>s.bottom&&(t.scrollTop+=i.bottom-s.bottom)}connectedCallback(){this.keydownAttached||(document.addEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!0)}disconnectedCallback(){this.keydownAttached&&(document.removeEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!1),this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}componentDidRender(){this.focusedIndex!==this.lastScrolledIndex&&(this.lastScrolledIndex=this.focusedIndex,this.focusedIndex>=0&&this.scrollFocusedIntoView())}renderOptions(t,e=1){return t.map((t=>{const s=!!t.children;return[i("sd-select-list-item",{option:t,depth:e,isSelected:s?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),s&&t.children?this.renderOptions(t.children,e+1):null]}))}render(){return i("div",{key:"0e322ab6384a37b9ea83883e8012799f157ec833",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${d.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"12d35a6ab654d4ce0cf504c0d1b1b6e4cc7eac78",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"ba99682e9c486fe0efa02a888166a06a600c189e",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"8f66c32cc3f8287d04ad7081e71903ccb4467b4f",option:x.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(x.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(x.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},a):this.isDepth?this.renderOptions(this.filteredOptions):this.filteredOptions.map((t=>i("sd-select-list-item",{option:t,depth:1,isSelected:this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)})))))}static get watchers(){return{searchKeyword:[{resetFocusOnFilter:0}]}}};x.style=":host{display:block}:host .sd-select-listbox{display:flex;flex-direction:column;width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden;outline:none}:host .sd-select-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:0}:host .sd-select-listbox__list::-webkit-scrollbar{opacity:0;width:8px;background:#E5E5E5}:host .sd-select-listbox__list::-webkit-scrollbar:horizontal{height:8px}:host .sd-select-listbox__list::-webkit-scrollbar-thumb{height:80px;background-color:#CCCCCC;border-radius:4px}:host .sd-select-listbox__list::-webkit-scrollbar-track{background-color:#E5E5E5}:host .sd-select-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}";const m=class{constructor(s){t(this,s),this.triggerClick=e(this,"sdTriggerClick",7),this.triggerFocus=e(this,"sdTriggerFocus",7),this.triggerBlur=e(this,"sdTriggerBlur",7)}displayText="";placeholder="선택";disabled=!1;isOpen=!1;triggerClick;triggerFocus;triggerBlur;triggerEl;async sdFocus(){this.disabled||this.triggerEl?.focus()}handleClick=()=>{this.disabled||this.triggerClick.emit()};handleFocus=()=>{this.triggerFocus.emit()};handleBlur=()=>{this.triggerBlur.emit()};render(){const t=""!==this.displayText;return i("div",{key:"a261a38ab844572d693bdb736e8c6c5df8b2b0c6",ref:t=>{this.triggerEl=t},role:"button","aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false",tabindex:this.disabled?-1:0,class:{"sd-select-trigger":!0,"sd-select-trigger--open":this.isOpen,"sd-select-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${p.paddingX}px`,"--trigger-gap":`${p.gap}px`,"--trigger-font-size":`${g.fontSize}px`,"--trigger-line-height":`${g.lineHeight}px`,"--trigger-font-weight":g.fontWeight,"--trigger-color":this.disabled?u.text.disabled:t?u.text.default:u.icon.default,"--trigger-icon-color":this.disabled?u.icon.disabled:u.icon.default},onClick:this.handleClick,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},i("div",{key:"c8255f624c101fa984d7dc081231f0ce957f8707",class:"sd-select-trigger__content"},t&&n(this.displayText)?i("span",{class:"sd-select-trigger__text",ref:t=>t&&(t.innerHTML=f(this.displayText))}):i("span",{class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"bf2145a098a31eba8a5210eb265fb252b84c9e0b",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};m.style="sd-select-trigger{display:block;width:100%;height:100%}sd-select-trigger .sd-select-trigger{display:flex;width:100%;height:100%;cursor:pointer;user-select:none;overflow:hidden;border-radius:3px}sd-select-trigger .sd-select-trigger--disabled{cursor:not-allowed}sd-select-trigger .sd-select-trigger__content{display:flex;align-items:center;gap:var(--trigger-gap);flex:1;padding:0 var(--trigger-padding-x);min-width:0}sd-select-trigger .sd-select-trigger__text{flex:1;font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-trigger .sd-select-trigger__icon{flex-shrink:0;transition:transform 0.2s ease}sd-select-trigger .sd-select-trigger__icon--open{transform:rotate(180deg)}";export{b as sd_select,x as sd_select_listbox,m as sd_select_trigger}
@@ -0,0 +1 @@
1
+ import{r as o,c as a,a as s,h as d,H as e}from"./p-BZg-6aSz.js";import{s as i}from"./p-BE4tnQ2Z.js";import{m as t}from"./p-Cw8yDfQh.js";const n={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},l={positive:"notificationOutline",negative:"warningOutline",default:null},m={positive:t.modal.confirm.positive.icon,negative:t.modal.confirm.negative.icon,default:""},r=Number(t.modal.confirm.title.icon),c=class{constructor(s){o(this,s),this.close=a(this,"sdClose",7),this.cancel=a(this,"sdCancel",7),this.ok=a(this,"sdOk",7)}get el(){return s(this)}hasSlottedContent=!1;customContentRef;slotObserver;type="positive";modalTitle="";titleClass="";topMessage=[];bottomMessage=[];mainButtonName;mainButtonLabel="확인";subButtonLabel="";tagPreset="square_sm_grey";tagLabel="";slotLabel="";tagContents;close;cancel;ok;componentWillLoad(){this.syncHasSlottedContent()}componentDidLoad(){"undefined"!=typeof MutationObserver&&(this.slotObserver=new MutationObserver((()=>this.syncHasSlottedContent())),this.slotObserver.observe(this.el,{childList:!0,characterData:!0}))}componentDidRender(){this.customContentRef&&this.tagContents instanceof HTMLElement&&("function"==typeof this.customContentRef.replaceChildren?this.customContentRef.replaceChildren(this.tagContents):(this.customContentRef.innerHTML="",this.customContentRef.appendChild(this.tagContents)))}disconnectedCallback(){this.slotObserver?.disconnect()}get resolvedType(){return this.type??"positive"}get resolvedMainButton(){return this.mainButtonName??n[this.resolvedType]}get hasTagContent(){return void 0!==this.tagLabel&&""!==this.tagLabel||void 0!==this.slotLabel&&""!==this.slotLabel}get showContentBox(){return null!=this.tagContents||this.hasTagContent||this.hasSlottedContent}syncHasSlottedContent(){const o=Array.from(this.el.childNodes).some((o=>!(o.nodeType===Node.ELEMENT_NODE&&o.classList.contains("sd-confirm-modal"))&&(o.nodeType===Node.ELEMENT_NODE||o.nodeType===Node.TEXT_NODE&&o.textContent?.trim())));o!==this.hasSlottedContent&&(this.hasSlottedContent=o)}render(){const o=this.resolvedType,a=l[o],s=m[o];return d("div",{key:"396bef971efaab6638586fa1a067eae54c1897f4",class:"sd-confirm-modal"},d("sd-ghost-button",{key:"4716168808371f4515bf763e77198386fc9fe7cf",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),a&&d("sd-icon",{key:"1ab7ca2c5262374a0823a8e5c501758433c25051",class:"sd-confirm-modal__icon",name:a,size:r,color:s}),d("h2",{key:"a190f975d27153e4d928c95395f13ecd8ba0667a",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),d("div",{key:"da7821097377b7a9781df87ae40b2439a103ff9b",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&d("div",{key:"ced23315888ad43b3d91b8bb5388b77e517dd52a",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((o=>d("p",{class:"sd-confirm-modal__message-text",innerHTML:i(o)})))),this.showContentBox&&d("div",{key:"5bdbe145bdb6639ebe582e7295f413a4b1990c15",class:"sd-confirm-modal__content-box"},this.tagContents?d("div",{class:"sd-confirm-modal__custom-content",ref:o=>{this.customContentRef=o}}):d("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&d("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&d("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&d("div",{key:"e99adc95c95be16945407d54833164908aad0b50",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((o=>d("p",{class:"sd-confirm-modal__message-text",innerHTML:i(o)}))))),d("div",{key:"20a6660323e1d9f4ee096f0c07bf0596f5a2445a",class:"sd-confirm-modal__button"},this.subButtonLabel&&d("sd-button",{key:"73141dd6fc6f703bff11e71ca9820cf3e1045466",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),d("sd-button",{key:"bed2d910b4b35d59897e14222f86f20a7e8c3bde",name:this.resolvedMainButton,label:this.mainButtonLabel??"확인",onSdClick:()=>this.ok.emit()})))}};c.style="sd-confirm-modal{display:block;width:fit-content;min-width:520px}sd-confirm-modal .sd-confirm-modal{position:relative;padding:var(--sd-modal-modal-confirm-padding-y) var(--sd-modal-modal-confirm-padding-x);border-radius:var(--sd-modal-modal-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2);background:var(--sd-modal-modal-bg)}sd-confirm-modal .sd-confirm-modal__close-button{position:absolute;top:12px;right:12px}sd-confirm-modal .sd-confirm-modal__icon{display:block;width:var(--sd-modal-modal-confirm-title-icon);height:var(--sd-modal-modal-confirm-title-icon);margin:0 auto var(--sd-modal-modal-confirm-title-gap) auto}sd-confirm-modal .sd-confirm-modal__title{color:var(--sd-modal-modal-confirm-title-color);font-size:var(--sd-modal-modal-confirm-title-typography-font-size);font-weight:var(--sd-modal-modal-confirm-title-typography-font-weight);line-height:var(--sd-modal-modal-confirm-title-typography-line-height);text-align:center;margin:0 0 var(--sd-modal-modal-confirm-body-gap) 0}sd-confirm-modal .sd-confirm-modal__body{display:flex;flex-direction:column;gap:var(--sd-modal-modal-confirm-body-gap)}sd-confirm-modal .sd-confirm-modal__message-text{color:var(--sd-modal-modal-confirm-message-color);font-size:12px;font-weight:400;line-height:20px;text-align:center;margin:0}sd-confirm-modal .sd-confirm-modal__content-box{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 16px;border:1px solid #e1e1e1;border-radius:8px;background:white}sd-confirm-modal .sd-confirm-modal__slot-label{font-size:14px;font-weight:700;line-height:22px;color:var(--sd-modal-modal-confirm-message-color)}sd-confirm-modal .sd-confirm-modal__button{display:flex;justify-content:center;gap:var(--sd-modal-modal-confirm-button-gap);margin-top:40px}";const g={minWidth:Number(t.modal.loading.width),minHeight:Number(t.modal.loading.height),gap:Number(t.modal.loading.gap),contentSize:Number(t.modal.loading.content),radius:Number(t.modal.radius)},h={bg:t.modal.bg,messageColor:t.modal.loading.message.color,errorIcon:t.modal.confirm.negative.icon},f=t.modal.loading.message.typography.fontFamily,b=Number(t.modal.loading.message.typography.fontSize),p=Number(t.modal.loading.message.typography.fontWeight),u=Number(t.modal.loading.message.typography.lineHeight),_={loading:"작업 진행중...",error:"작업에 실패하였습니다. 다시 시도해 주세요."},v={loading:"작업 취소",error:"다시 시도"},y=class{constructor(s){o(this,s),this.click=a(this,"sdClick",7)}state="loading";message="";useButton=!1;buttonLabel="";width;height;progress;click;get resolvedState(){return this.state??"loading"}get resolvedMessage(){return this.message||_[this.resolvedState]}get resolvedButtonLabel(){return this.buttonLabel||v[this.resolvedState]}get showButton(){return this.useButton||"error"===this.resolvedState}handleClick=()=>{this.click.emit()};toCssSize(o){if(null!=o&&""!==o)return"number"==typeof o?`${o}px`:o}render(){const o={"--sd-loading-modal-min-width":`${g.minWidth}px`,"--sd-loading-modal-min-height":`${g.minHeight}px`,"--sd-loading-modal-gap":`${g.gap}px`,"--sd-loading-modal-content-size":`${g.contentSize}px`,"--sd-loading-modal-radius":`${g.radius}px`,"--sd-loading-modal-bg":h.bg,"--sd-loading-modal-message-color":h.messageColor,"--sd-loading-modal-message-font-family":f,"--sd-loading-modal-message-font-size":`${b}px`,"--sd-loading-modal-message-font-weight":`${p}`,"--sd-loading-modal-message-line-height":`${u}px`,"--sd-loading-modal-error-color":h.errorIcon,"--sd-loading-modal-width":this.toCssSize(this.width)??`${g.minWidth}px`,"--sd-loading-modal-height":this.toCssSize(this.height)??`${g.minHeight}px`};return d(e,{key:"01bd677e5ef79c7fba151be5d4fb28f4de53c063",style:o},d("div",{key:"f1062845695886535ee1d96613db83e1a8da4b88",class:"sd-loading-modal"},d("div",{key:"c1ca61a82f105e5582719375506634a2ee5a538f",class:"sd-loading-modal__content"},"loading"===this.resolvedState?d("sd-circle-progress",void 0!==this.progress?{value:this.progress}:{indeterminate:!0}):d("sd-icon",{class:"sd-loading-modal__icon",name:"warningOutline",size:g.contentSize,color:h.errorIcon})),d("div",{key:"60039cb0c90b9450355c6545a82301797c0b65bc",class:"sd-loading-modal__message-wrapper"},Array.isArray(this.resolvedMessage)?this.resolvedMessage.map((o=>d("p",{class:"sd-loading-modal__message"},o))):d("p",{class:"sd-loading-modal__message"},this.resolvedMessage)),this.showButton&&d("div",{key:"0f00c197e0f320ffb2a8bebe4418307639d5ee09",class:"sd-loading-modal__button"},d("sd-button",{key:"6d8f96e681843afe1590f9a9fcc18c4668f64d22",name:"neutral_outline_sm",label:this.resolvedButtonLabel,onSdClick:this.handleClick}))))}};y.style="sd-loading-modal{display:inline-block}sd-loading-modal .sd-loading-modal{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--sd-loading-modal-gap);min-width:var(--sd-loading-modal-min-width);min-height:var(--sd-loading-modal-min-height);width:var(--sd-loading-modal-width, auto);height:var(--sd-loading-modal-height, auto);border-radius:var(--sd-loading-modal-radius);background:var(--sd-loading-modal-bg);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2)}sd-loading-modal .sd-loading-modal__content{display:flex;align-items:center;justify-content:center;width:var(--sd-loading-modal-content-size);height:var(--sd-loading-modal-content-size)}sd-loading-modal .sd-loading-modal__message{margin:0;color:var(--sd-loading-modal-message-color);font-family:var(--sd-loading-modal-message-font-family);font-size:var(--sd-loading-modal-message-font-size);font-weight:var(--sd-loading-modal-message-font-weight);line-height:var(--sd-loading-modal-message-line-height);text-align:center}sd-loading-modal .sd-loading-modal__button{display:flex;justify-content:center}";export{c as sd_confirm_modal,y as sd_loading_modal}
@@ -1 +1 @@
1
- import{r as t,a as e,h as i}from"./p-BZ5lcC25.js";import{s as d}from"./p-BJfiMC9H.js";import{s as o}from"./p-BE4tnQ2Z.js";const{button:n,contents:s}={button:{height:"28",paddingX:"12",radius:"9999",gap:"6",typography:{fontSize:"12",fontWeight:"500",lineHeight:"20"},icon:{default:"#00973C",active:"#FFFFFF"},border:{width:"1",default:"#E1E1E1"},bg:{default:"#FFFFFF",tip:"#00973C",notion:"#1F8AE1"},text:{default:"#222222",active:"#FFFFFF"}},contents:{paddingX:"24",paddingY:"20",gap:"12",title:{gap:"8"},row:{gap:"8"},body:{gap:"2"},typography:{title:{fontWeight:"700",fontSize:"16",lineHeight:"26"},body:{fontWeight:"400",fontSize:"12",lineHeight:"20"},color:"#222222"},icon:"#00973C",radius:"8"}},u=d.color.fg.primary,g={button:{height:`${n.height}px`,paddingX:`${n.paddingX}px`,radius:`${n.radius}px`,gap:`${n.gap}px`,fontSize:`${n.typography.fontSize}px`,fontWeight:n.typography.fontWeight,lineHeight:`${n.typography.lineHeight}px`,iconColorDefault:n.icon.default,iconColorActive:n.icon.active,iconColorNotion:u,borderWidth:`${n.border.width}px`,borderColor:n.border.default,bgDefault:n.bg.default,bgTip:n.bg.tip,bgNotion:n.bg.notion,textDefault:n.text.default,textActive:n.text.active},contents:{paddingX:`${s.paddingX}px`,paddingY:`${s.paddingY}px`,gap:`${s.gap}px`,rowGap:`${s.row.gap}px`,bodyGap:`${s.body.gap}px`,titleGap:`${s.title.gap}px`,radius:`${s.radius}px`,iconColor:s.icon,iconColorNotion:u,titleFontSize:`${s.typography.title.fontSize}px`,titleFontWeight:s.typography.title.fontWeight,titleLineHeight:`${s.typography.title.lineHeight}px`,bodyFontSize:`${s.typography.body.fontSize}px`,bodyFontWeight:s.typography.body.fontWeight,bodyLineHeight:`${s.typography.body.lineHeight}px`,textColor:s.typography.color}},a={tip:"활용 TIP",notion:"사용법 안내"},r={tip:"helpOutline",notion:"notion"},p=class{constructor(e){t(this,e)}get el(){return e(this)}type="tip";label="";message="";url="";popupTitle="";popupWidth;popupShow=!1;guideRef;handleClickGuide=()=>{"notion"!==this.type?this.popupShow=!this.popupShow:""!==this.url&&window.open(this.url,"_blank","noopener,noreferrer")};closeDropdown=()=>{this.popupShow=!1};get guideStyle(){const{button:t,contents:e}=g;return{"--sd-guide-button-height":t.height,"--sd-guide-button-padding-x":t.paddingX,"--sd-guide-button-radius":t.radius,"--sd-guide-button-gap":t.gap,"--sd-guide-button-font-size":t.fontSize,"--sd-guide-button-font-weight":t.fontWeight,"--sd-guide-button-line-height":t.lineHeight,"--sd-guide-button-border-width":t.borderWidth,"--sd-guide-button-border-color":t.borderColor,"--sd-guide-button-bg-default":t.bgDefault,"--sd-guide-button-bg-tip":t.bgTip,"--sd-guide-button-bg-notion":t.bgNotion,"--sd-guide-button-text-default":t.textDefault,"--sd-guide-button-text-active":t.textActive,"--sd-guide-button-icon-color-default":t.iconColorDefault,"--sd-guide-button-icon-color-active":t.iconColorActive,"--sd-guide-button-icon-color-notion":t.iconColorNotion,"--sd-guide-contents-padding-x":e.paddingX,"--sd-guide-contents-padding-y":e.paddingY,"--sd-guide-contents-gap":e.gap,"--sd-guide-contents-row-gap":e.rowGap,"--sd-guide-contents-body-gap":e.bodyGap,"--sd-guide-contents-title-gap":e.titleGap,"--sd-guide-contents-radius":e.radius,"--sd-guide-contents-title-font-size":e.titleFontSize,"--sd-guide-contents-title-font-weight":e.titleFontWeight,"--sd-guide-contents-title-line-height":e.titleLineHeight,"--sd-guide-contents-body-font-size":e.bodyFontSize,"--sd-guide-contents-body-font-weight":e.bodyFontWeight,"--sd-guide-contents-body-line-height":e.bodyLineHeight,"--sd-guide-contents-text-color":e.textColor}}render(){const{contents:t}=g,e=this.popupShow,d=a[this.type??"tip"],o=r[this.type??"tip"],n="notion"===(this.type??"tip")?t.iconColorNotion:t.iconColor,s=["sd-guide__button",`sd-guide__button--type-${this.type??"tip"}`];return e&&s.push("sd-guide__button--active"),i("div",{key:"d89a517d78a8f9624c94d320291e5a4b5bd0715d",class:"sd-guide",style:this.guideStyle},i("sd-button",{key:"6e959f0f5fd6f816fd1cef4545852b860d30de85",ref:t=>this.guideRef=t,class:s.join(" "),name:e?"primary_sm":"neutral_outline_sm",label:this.label||d,icon:o,onSdClick:this.handleClickGuide}),this.popupShow&&i("sd-portal",{key:"a837cababa5504400293729ad28e4dcd2450eeec",open:this.popupShow,parentRef:this.guideRef,onSdClose:this.closeDropdown,offset:[0,4]},i("div",{key:"61dd3c574495f85021495d80865e162999368f9c",class:"sd-guide__popup",style:{...this.guideStyle,width:null!=this.popupWidth?this.popupWidth+"px":"426px"}},i("sd-ghost-button",{key:"dbf8aebd1be4b5286bf726d22e0a5f80c29e867f",class:"sd-guide__popup__close",icon:"close",ariaLabel:"close",size:"sm",onSdClick:this.closeDropdown}),i("div",{key:"5a08fa823bb8839e654d7bb2ba027df2dc68b85b",class:"sd-guide__popup__header"},i("sd-icon",{key:"1dda43d100b4f5f3b7fa81115a1ac4bfbd584a51",name:o,size:24,color:n}),i("h3",{key:"cfe6342f44f4e1355397ed94d6db74807f917548",class:"sd-guide__popup__title"},this.popupTitle||d)),i("ul",{key:"9acc2f507ed3d3d6f1fda27a9e5cf66dcc2f619d",class:"sd-guide__popup__list"},this.renderListItem(this.message)))))}renderListItem(t,e=0){const i=[];if(Array.isArray(t)){const d=t.map((t=>this.renderListItem(t,e+1)));i.push(...d.flat())}else i.push(this.renderLi(t,e));return i}renderLi=(t,e)=>i("li",{class:`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${e}`},i("p",{innerHTML:o(t)}))};p.style='@charset "UTF-8";sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide .sd-guide__button .sd-button{min-height:var(--sd-guide-button-height);padding:0 var(--sd-guide-button-padding-x);border-radius:var(--sd-guide-button-radius);border:var(--sd-guide-button-border-width) solid var(--sd-guide-button-border-color);background:var(--sd-guide-button-bg-default);color:var(--sd-guide-button-text-default) !important;transition:none;display:flex;align-items:center;gap:var(--sd-guide-button-gap);--sd-button-bg-hover:var(--sd-guide-button-bg-default);--sd-button-current-icon:var(--sd-guide-button-icon-color-default)}.sd-guide .sd-guide__button .sd-button .sd-button__content{color:var(--sd-guide-button-text-default) !important;gap:var(--sd-guide-button-gap)}.sd-guide .sd-guide__button .sd-button .sd-button__content .sd-button__label{margin-left:0;color:var(--sd-guide-button-text-default) !important;font-size:var(--sd-guide-button-font-size);font-weight:var(--sd-guide-button-font-weight);line-height:var(--sd-guide-button-line-height)}.sd-guide .sd-guide__button--type-notion .sd-button{--sd-button-current-icon:var(--sd-guide-button-icon-color-notion)}.sd-guide .sd-guide__button--active .sd-button{color:var(--sd-guide-button-text-active) !important;--sd-button-current-icon:var(--sd-guide-button-icon-color-active)}.sd-guide .sd-guide__button--active .sd-button .sd-button__content{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--active .sd-button .sd-button__content .sd-button__label{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--type-tip.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-tip);border-color:var(--sd-guide-button-bg-tip);--sd-button-bg-hover:var(--sd-guide-button-bg-tip)}.sd-guide .sd-guide__button--type-notion.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-notion);border-color:var(--sd-guide-button-bg-notion);--sd-button-bg-hover:var(--sd-guide-button-bg-notion)}.sd-guide__popup{position:relative;padding:var(--sd-guide-contents-padding-y) var(--sd-guide-contents-padding-x);border-radius:var(--sd-guide-contents-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.1);background:white}.sd-guide__popup>.sd-guide__popup__close{position:absolute;top:12px;right:12px}.sd-guide__popup__header{display:flex;align-items:center;gap:var(--sd-guide-contents-title-gap);margin-bottom:var(--sd-guide-contents-gap)}.sd-guide__popup__header .sd-guide__popup__title{margin-top:0;margin-bottom:0;font-size:var(--sd-guide-contents-title-font-size);font-weight:var(--sd-guide-contents-title-font-weight);line-height:var(--sd-guide-contents-title-line-height);color:var(--sd-guide-contents-text-color)}.sd-guide__popup__list{width:100%;padding:0;margin:0}.sd-guide__popup__list__item{display:flex;width:100%;align-items:start;list-style:none;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height)}.sd-guide__popup__list__item p{width:100%;padding:0;margin:0;word-wrap:break-word;word-break:break-word;white-space:normal;overflow-wrap:break-word;min-width:0}.sd-guide__popup__list__item::before{display:block;content:"-";width:6px;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height);margin-left:10px;margin-right:12px;flex-shrink:0}.sd-guide__popup__list__item--depth-1:not(:first-child){margin-top:var(--sd-guide-contents-row-gap)}.sd-guide__popup__list__item--depth-2{margin-top:var(--sd-guide-contents-body-gap)}.sd-guide__popup__list__item--depth-2::before{content:"•"}.sd-guide__popup__list__item--depth-2{padding-left:26px}';export{p as sd_guide}
1
+ import{r as t,a as e,h as i}from"./p-BZg-6aSz.js";import{s as d}from"./p-BJfiMC9H.js";import{s as o}from"./p-BE4tnQ2Z.js";const{button:n,contents:s}={button:{height:"28",paddingX:"12",radius:"9999",gap:"6",typography:{fontSize:"12",fontWeight:"500",lineHeight:"20"},icon:{default:"#00973C",active:"#FFFFFF"},border:{width:"1",default:"#E1E1E1"},bg:{default:"#FFFFFF",tip:"#00973C",notion:"#1F8AE1"},text:{default:"#222222",active:"#FFFFFF"}},contents:{paddingX:"24",paddingY:"20",gap:"12",title:{gap:"8"},row:{gap:"8"},body:{gap:"2"},typography:{title:{fontWeight:"700",fontSize:"16",lineHeight:"26"},body:{fontWeight:"400",fontSize:"12",lineHeight:"20"},color:"#222222"},icon:"#00973C",radius:"8"}},u=d.color.fg.primary,g={button:{height:`${n.height}px`,paddingX:`${n.paddingX}px`,radius:`${n.radius}px`,gap:`${n.gap}px`,fontSize:`${n.typography.fontSize}px`,fontWeight:n.typography.fontWeight,lineHeight:`${n.typography.lineHeight}px`,iconColorDefault:n.icon.default,iconColorActive:n.icon.active,iconColorNotion:u,borderWidth:`${n.border.width}px`,borderColor:n.border.default,bgDefault:n.bg.default,bgTip:n.bg.tip,bgNotion:n.bg.notion,textDefault:n.text.default,textActive:n.text.active},contents:{paddingX:`${s.paddingX}px`,paddingY:`${s.paddingY}px`,gap:`${s.gap}px`,rowGap:`${s.row.gap}px`,bodyGap:`${s.body.gap}px`,titleGap:`${s.title.gap}px`,radius:`${s.radius}px`,iconColor:s.icon,iconColorNotion:u,titleFontSize:`${s.typography.title.fontSize}px`,titleFontWeight:s.typography.title.fontWeight,titleLineHeight:`${s.typography.title.lineHeight}px`,bodyFontSize:`${s.typography.body.fontSize}px`,bodyFontWeight:s.typography.body.fontWeight,bodyLineHeight:`${s.typography.body.lineHeight}px`,textColor:s.typography.color}},a={tip:"활용 TIP",notion:"사용법 안내"},r={tip:"helpOutline",notion:"notion"},p=class{constructor(e){t(this,e)}get el(){return e(this)}type="tip";label="";message="";url="";popupTitle="";popupWidth;popupShow=!1;guideRef;handleClickGuide=()=>{"notion"!==this.type?this.popupShow=!this.popupShow:""!==this.url&&window.open(this.url,"_blank","noopener,noreferrer")};closeDropdown=()=>{this.popupShow=!1};get guideStyle(){const{button:t,contents:e}=g;return{"--sd-guide-button-height":t.height,"--sd-guide-button-padding-x":t.paddingX,"--sd-guide-button-radius":t.radius,"--sd-guide-button-gap":t.gap,"--sd-guide-button-font-size":t.fontSize,"--sd-guide-button-font-weight":t.fontWeight,"--sd-guide-button-line-height":t.lineHeight,"--sd-guide-button-border-width":t.borderWidth,"--sd-guide-button-border-color":t.borderColor,"--sd-guide-button-bg-default":t.bgDefault,"--sd-guide-button-bg-tip":t.bgTip,"--sd-guide-button-bg-notion":t.bgNotion,"--sd-guide-button-text-default":t.textDefault,"--sd-guide-button-text-active":t.textActive,"--sd-guide-button-icon-color-default":t.iconColorDefault,"--sd-guide-button-icon-color-active":t.iconColorActive,"--sd-guide-button-icon-color-notion":t.iconColorNotion,"--sd-guide-contents-padding-x":e.paddingX,"--sd-guide-contents-padding-y":e.paddingY,"--sd-guide-contents-gap":e.gap,"--sd-guide-contents-row-gap":e.rowGap,"--sd-guide-contents-body-gap":e.bodyGap,"--sd-guide-contents-title-gap":e.titleGap,"--sd-guide-contents-radius":e.radius,"--sd-guide-contents-title-font-size":e.titleFontSize,"--sd-guide-contents-title-font-weight":e.titleFontWeight,"--sd-guide-contents-title-line-height":e.titleLineHeight,"--sd-guide-contents-body-font-size":e.bodyFontSize,"--sd-guide-contents-body-font-weight":e.bodyFontWeight,"--sd-guide-contents-body-line-height":e.bodyLineHeight,"--sd-guide-contents-text-color":e.textColor}}render(){const{contents:t}=g,e=this.popupShow,d=a[this.type??"tip"],o=r[this.type??"tip"],n="notion"===(this.type??"tip")?t.iconColorNotion:t.iconColor,s=["sd-guide__button",`sd-guide__button--type-${this.type??"tip"}`];return e&&s.push("sd-guide__button--active"),i("div",{key:"d89a517d78a8f9624c94d320291e5a4b5bd0715d",class:"sd-guide",style:this.guideStyle},i("sd-button",{key:"6e959f0f5fd6f816fd1cef4545852b860d30de85",ref:t=>this.guideRef=t,class:s.join(" "),name:e?"primary_sm":"neutral_outline_sm",label:this.label||d,icon:o,onSdClick:this.handleClickGuide}),this.popupShow&&i("sd-portal",{key:"a837cababa5504400293729ad28e4dcd2450eeec",open:this.popupShow,parentRef:this.guideRef,onSdClose:this.closeDropdown,offset:[0,4]},i("div",{key:"61dd3c574495f85021495d80865e162999368f9c",class:"sd-guide__popup",style:{...this.guideStyle,width:null!=this.popupWidth?this.popupWidth+"px":"426px"}},i("sd-ghost-button",{key:"dbf8aebd1be4b5286bf726d22e0a5f80c29e867f",class:"sd-guide__popup__close",icon:"close",ariaLabel:"close",size:"sm",onSdClick:this.closeDropdown}),i("div",{key:"5a08fa823bb8839e654d7bb2ba027df2dc68b85b",class:"sd-guide__popup__header"},i("sd-icon",{key:"1dda43d100b4f5f3b7fa81115a1ac4bfbd584a51",name:o,size:24,color:n}),i("h3",{key:"cfe6342f44f4e1355397ed94d6db74807f917548",class:"sd-guide__popup__title"},this.popupTitle||d)),i("ul",{key:"9acc2f507ed3d3d6f1fda27a9e5cf66dcc2f619d",class:"sd-guide__popup__list"},this.renderListItem(this.message)))))}renderListItem(t,e=0){const i=[];if(Array.isArray(t)){const d=t.map((t=>this.renderListItem(t,e+1)));i.push(...d.flat())}else i.push(this.renderLi(t,e));return i}renderLi=(t,e)=>i("li",{class:`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${e}`},i("p",{innerHTML:o(t)}))};p.style='@charset "UTF-8";sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide{display:inline-flex;align-items:center;height:fit-content;width:fit-content}.sd-guide .sd-guide__button .sd-button{min-height:var(--sd-guide-button-height);padding:0 var(--sd-guide-button-padding-x);border-radius:var(--sd-guide-button-radius);border:var(--sd-guide-button-border-width) solid var(--sd-guide-button-border-color);background:var(--sd-guide-button-bg-default);color:var(--sd-guide-button-text-default) !important;transition:none;display:flex;align-items:center;gap:var(--sd-guide-button-gap);--sd-button-bg-hover:var(--sd-guide-button-bg-default);--sd-button-current-icon:var(--sd-guide-button-icon-color-default)}.sd-guide .sd-guide__button .sd-button .sd-button__content{color:var(--sd-guide-button-text-default) !important;gap:var(--sd-guide-button-gap)}.sd-guide .sd-guide__button .sd-button .sd-button__content .sd-button__label{margin-left:0;color:var(--sd-guide-button-text-default) !important;font-size:var(--sd-guide-button-font-size);font-weight:var(--sd-guide-button-font-weight);line-height:var(--sd-guide-button-line-height)}.sd-guide .sd-guide__button--type-notion .sd-button{--sd-button-current-icon:var(--sd-guide-button-icon-color-notion)}.sd-guide .sd-guide__button--active .sd-button{color:var(--sd-guide-button-text-active) !important;--sd-button-current-icon:var(--sd-guide-button-icon-color-active)}.sd-guide .sd-guide__button--active .sd-button .sd-button__content{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--active .sd-button .sd-button__content .sd-button__label{color:var(--sd-guide-button-text-active) !important}.sd-guide .sd-guide__button--type-tip.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-tip);border-color:var(--sd-guide-button-bg-tip);--sd-button-bg-hover:var(--sd-guide-button-bg-tip)}.sd-guide .sd-guide__button--type-notion.sd-guide__button--active .sd-button{background:var(--sd-guide-button-bg-notion);border-color:var(--sd-guide-button-bg-notion);--sd-button-bg-hover:var(--sd-guide-button-bg-notion)}.sd-guide__popup{position:relative;padding:var(--sd-guide-contents-padding-y) var(--sd-guide-contents-padding-x);border-radius:var(--sd-guide-contents-radius);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.1);background:white}.sd-guide__popup>.sd-guide__popup__close{position:absolute;top:12px;right:12px}.sd-guide__popup__header{display:flex;align-items:center;gap:var(--sd-guide-contents-title-gap);margin-bottom:var(--sd-guide-contents-gap)}.sd-guide__popup__header .sd-guide__popup__title{margin-top:0;margin-bottom:0;font-size:var(--sd-guide-contents-title-font-size);font-weight:var(--sd-guide-contents-title-font-weight);line-height:var(--sd-guide-contents-title-line-height);color:var(--sd-guide-contents-text-color)}.sd-guide__popup__list{width:100%;padding:0;margin:0}.sd-guide__popup__list__item{display:flex;width:100%;align-items:start;list-style:none;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height)}.sd-guide__popup__list__item p{width:100%;padding:0;margin:0;word-wrap:break-word;word-break:break-word;white-space:normal;overflow-wrap:break-word;min-width:0}.sd-guide__popup__list__item::before{display:block;content:"-";width:6px;color:var(--sd-guide-contents-text-color);font-size:var(--sd-guide-contents-body-font-size);font-weight:var(--sd-guide-contents-body-font-weight);line-height:var(--sd-guide-contents-body-line-height);margin-left:10px;margin-right:12px;flex-shrink:0}.sd-guide__popup__list__item--depth-1:not(:first-child){margin-top:var(--sd-guide-contents-row-gap)}.sd-guide__popup__list__item--depth-2{margin-top:var(--sd-guide-contents-body-gap)}.sd-guide__popup__list__item--depth-2::before{content:"•"}.sd-guide__popup__list__item--depth-2{padding-left:26px}';export{p as sd_guide}
@@ -1 +1 @@
1
- import{r as t,a as i,f as s,h as n,H as e}from"./p-BZ5lcC25.js";import{T as h}from"./p-sZMi_32I.js";const a=class{constructor(i){t(this,i)}get el(){return i(this)}field;rowKey;align;rowspan;colspan;sdClass;dividerLeft=!1;dividerRight=!1;useFrame=!1;handleFieldChange(t,i){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(i),this.syncUseFrameRegistration(i)}handleRowKeyChange(t,i){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(void 0,i),this.syncUseFrameRegistration(void 0,i)}handleSpanChange(){this.syncSpanRegistration()}handleSdClassChange(){this.syncCellClassRegistration()}handleDividerChange(){this.syncCellClassRegistration()}handleUseFrameChange(){this.syncUseFrameRegistration(),this.requestParentTrUpdate()}componentWillLoad(){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration();const t=this.el.parentElement;"sd-tr"===t?.tagName?.toLowerCase()&&s(t)}componentDidLoad(){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration()}connectedCallback(){this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration()}disconnectedCallback(){const t=this.findTable();null!=t&&""!==this.field&&null!=this.rowKey&&(t.unregisterSpanSync?.(String(this.rowKey),this.field),t.unregisterCellClassSync?.(String(this.rowKey),this.field),t.unregisterUseFrameSync?.(String(this.rowKey),this.field),this.requestParentTrUpdate())}findTable(){return this.el.closest("sd-table")}requestParentTrUpdate(){const t=this.el.parentElement;"sd-tr"===t?.tagName?.toLowerCase()&&("function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():s(t))}syncSpanRegistration(){const t=this.findTable();if(null==t?.registerSpanSync||""===this.field||null==this.rowKey)return;const i=Math.max(1,Math.floor(Number(this.rowspan)||1)),s=Math.max(1,Math.floor(Number(this.colspan)||1));t.registerSpanSync(String(this.rowKey),this.field,i,s),this.requestParentTrUpdate()}syncCellClassRegistration(t,i){const s=this.findTable();if(!s)return;const n=t??this.field,e=i??(null!=this.rowKey?String(this.rowKey):void 0);if(""!==n&&null!=e&&s.unregisterCellClassSync?.(e,n),!s.registerCellClassSync||""===this.field||null==this.rowKey)return;const h=[this.sdClass,this.dividerLeft&&"td--divider-left",this.dividerRight&&"td--divider-right"].filter(Boolean).join(" ")||void 0;s.registerCellClassSync(String(this.rowKey),this.field,h),this.requestParentTrUpdate()}syncUseFrameRegistration(t,i){const s=this.findTable();if(!s)return;const n=t??this.field,e=i??(null!=this.rowKey?String(this.rowKey):void 0);""!==n&&null!=e&&s.unregisterUseFrameSync?.(e,n),""!==this.field&&null!=this.rowKey&&(this.useFrame?s.registerUseFrameSync?.(String(this.rowKey),this.field):s.unregisterUseFrameSync?.(String(this.rowKey),this.field))}syncSlotName(){const t=this.el.closest("sd-table"),i=t?.getTableIdSync?.(),s=t?.getAttribute(h),n=(null!=i&&""!==i&&"undefined"!==i?i:null)??(null!=s&&""!==s&&"undefined"!==s?s:null)??"";""!==this.field&&void 0!==this.rowKey&&""!==n&&this.el.setAttribute("slot",`${n}-${this.field}-${this.rowKey}`)}render(){return n(e,{key:"28d45d8cd629c6cdd826834cbae719fd7c851511",class:{[`align-${this.align}`]:Boolean(this.align)}},n("slot",{key:"0bab0005e4513464ad18698c111a55eb684434e9"}))}static get watchers(){return{field:[{handleFieldChange:0}],rowKey:[{handleRowKeyChange:0}],rowspan:[{handleSpanChange:0}],colspan:[{handleSpanChange:0}],sdClass:[{handleSdClassChange:0}],dividerLeft:[{handleDividerChange:0}],dividerRight:[{handleDividerChange:0}],useFrame:[{handleUseFrameChange:0}]}}};a.style="sd-td *{box-sizing:border-box}sd-td{display:contents}sd-td.align-left{text-align:left}sd-td.align-center{text-align:center}sd-td.align-right{text-align:right}";export{a as sd_td}
1
+ import{r as t,a as i,f as s,h as n,H as e}from"./p-BZg-6aSz.js";import{T as h}from"./p-sZMi_32I.js";const a=class{constructor(i){t(this,i)}get el(){return i(this)}field;rowKey;align;rowspan;colspan;sdClass;dividerLeft=!1;dividerRight=!1;useFrame=!1;handleFieldChange(t,i){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(i),this.syncUseFrameRegistration(i)}handleRowKeyChange(t,i){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(void 0,i),this.syncUseFrameRegistration(void 0,i)}handleSpanChange(){this.syncSpanRegistration()}handleSdClassChange(){this.syncCellClassRegistration()}handleDividerChange(){this.syncCellClassRegistration()}handleUseFrameChange(){this.syncUseFrameRegistration(),this.requestParentTrUpdate()}componentWillLoad(){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration();const t=this.el.parentElement;"sd-tr"===t?.tagName?.toLowerCase()&&s(t)}componentDidLoad(){this.syncSlotName(),this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration()}connectedCallback(){this.syncSpanRegistration(),this.syncCellClassRegistration(),this.syncUseFrameRegistration()}disconnectedCallback(){const t=this.findTable();null!=t&&""!==this.field&&null!=this.rowKey&&(t.unregisterSpanSync?.(String(this.rowKey),this.field),t.unregisterCellClassSync?.(String(this.rowKey),this.field),t.unregisterUseFrameSync?.(String(this.rowKey),this.field),this.requestParentTrUpdate())}findTable(){return this.el.closest("sd-table")}requestParentTrUpdate(){const t=this.el.parentElement;"sd-tr"===t?.tagName?.toLowerCase()&&("function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():s(t))}syncSpanRegistration(){const t=this.findTable();if(null==t?.registerSpanSync||""===this.field||null==this.rowKey)return;const i=Math.max(1,Math.floor(Number(this.rowspan)||1)),s=Math.max(1,Math.floor(Number(this.colspan)||1));t.registerSpanSync(String(this.rowKey),this.field,i,s),this.requestParentTrUpdate()}syncCellClassRegistration(t,i){const s=this.findTable();if(!s)return;const n=t??this.field,e=i??(null!=this.rowKey?String(this.rowKey):void 0);if(""!==n&&null!=e&&s.unregisterCellClassSync?.(e,n),!s.registerCellClassSync||""===this.field||null==this.rowKey)return;const h=[this.sdClass,this.dividerLeft&&"td--divider-left",this.dividerRight&&"td--divider-right"].filter(Boolean).join(" ")||void 0;s.registerCellClassSync(String(this.rowKey),this.field,h),this.requestParentTrUpdate()}syncUseFrameRegistration(t,i){const s=this.findTable();if(!s)return;const n=t??this.field,e=i??(null!=this.rowKey?String(this.rowKey):void 0);""!==n&&null!=e&&s.unregisterUseFrameSync?.(e,n),""!==this.field&&null!=this.rowKey&&(this.useFrame?s.registerUseFrameSync?.(String(this.rowKey),this.field):s.unregisterUseFrameSync?.(String(this.rowKey),this.field))}syncSlotName(){const t=this.el.closest("sd-table"),i=t?.getTableIdSync?.(),s=t?.getAttribute(h),n=(null!=i&&""!==i&&"undefined"!==i?i:null)??(null!=s&&""!==s&&"undefined"!==s?s:null)??"";""!==this.field&&void 0!==this.rowKey&&""!==n&&this.el.setAttribute("slot",`${n}-${this.field}-${this.rowKey}`)}render(){return n(e,{key:"2fce45ffda30fd75a0c0ef2ff0de5896c409c108",class:{[`align-${this.align}`]:Boolean(this.align)}},n("slot",{key:"3e2131547d544d01c745017f3375a26df35a9d6e"}))}static get watchers(){return{field:[{handleFieldChange:0}],rowKey:[{handleRowKeyChange:0}],rowspan:[{handleSpanChange:0}],colspan:[{handleSpanChange:0}],sdClass:[{handleSdClassChange:0}],dividerLeft:[{handleDividerChange:0}],dividerRight:[{handleDividerChange:0}],useFrame:[{handleUseFrameChange:0}]}}};a.style="sd-td *{box-sizing:border-box}sd-td{display:contents}sd-td.align-left{text-align:left}sd-td.align-center{text-align:center}sd-td.align-right{text-align:right}";export{a as sd_td}
@@ -3,7 +3,7 @@ const field = {
3
3
  sm: {
4
4
  height: "28",
5
5
  gap: "6",
6
- icon: "12",
6
+ icon: "16",
7
7
  typography: {
8
8
  fontWeight: "700",
9
9
  fontSize: "12",
@@ -13,7 +13,7 @@ const field = {
13
13
  md: {
14
14
  height: "36",
15
15
  gap: "8",
16
- icon: "12",
16
+ icon: "16",
17
17
  typography: {
18
18
  fontWeight: "700",
19
19
  fontSize: "14",