@sellmate/design-system 1.7.0 → 1.7.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 (250) hide show
  1. package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
  2. package/dist/cjs/sd-badge.cjs.entry.js +1 -1
  3. package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
  4. package/dist/cjs/sd-button_2.cjs.entry.js +2 -2
  5. package/dist/cjs/sd-calendar_2.cjs.entry.js +5 -5
  6. package/dist/cjs/sd-callout.cjs.entry.js +1 -1
  7. package/dist/cjs/sd-card.cjs.entry.js +1 -1
  8. package/dist/cjs/sd-chip.cjs.entry.js +1 -1
  9. package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
  10. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +3 -3
  11. package/dist/cjs/sd-date-picker_7.cjs.entry.js +10 -10
  12. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
  13. package/dist/cjs/sd-divider.cjs.entry.js +1 -1
  14. package/dist/cjs/sd-field_3.cjs.entry.js +8 -8
  15. package/dist/cjs/sd-ghost-button.cjs.entry.js +2 -2
  16. package/dist/cjs/sd-guide.cjs.entry.js +2 -2
  17. package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
  18. package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
  19. package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
  20. package/dist/cjs/sd-popover.cjs.entry.js +3 -3
  21. package/dist/cjs/sd-popup.cjs.entry.js +1 -1
  22. package/dist/cjs/sd-portal.cjs.entry.js +1 -1
  23. package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
  24. package/dist/cjs/sd-radio.cjs.entry.js +1 -1
  25. package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
  26. package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
  27. package/dist/cjs/sd-switch.cjs.entry.js +1 -1
  28. package/dist/cjs/sd-table.cjs.entry.js +6 -6
  29. package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
  30. package/dist/cjs/sd-tag.cjs.entry.js +2 -2
  31. package/dist/cjs/sd-td.cjs.entry.js +1 -1
  32. package/dist/cjs/sd-text-link.cjs.entry.js +3 -3
  33. package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
  34. package/dist/cjs/sd-toast.cjs.entry.js +2 -2
  35. package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
  36. package/dist/collection/components/sd-action-modal/sd-action-modal.js +1 -1
  37. package/dist/collection/components/sd-badge/sd-badge.js +1 -1
  38. package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
  39. package/dist/collection/components/sd-button/sd-button.js +2 -2
  40. package/dist/collection/components/sd-calendar/sd-calendar.js +3 -3
  41. package/dist/collection/components/sd-callout/sd-callout.js +1 -1
  42. package/dist/collection/components/sd-card/sd-card.js +1 -1
  43. package/dist/collection/components/sd-chip/sd-chip.js +1 -1
  44. package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
  45. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
  46. package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
  47. package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
  48. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
  49. package/dist/collection/components/sd-divider/sd-divider.js +1 -1
  50. package/dist/collection/components/sd-field/sd-field.js +5 -5
  51. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  52. package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +2 -2
  53. package/dist/collection/components/sd-guide/sd-guide.js +2 -2
  54. package/dist/collection/components/sd-input/sd-input.js +2 -2
  55. package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
  56. package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
  57. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
  58. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  59. package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
  60. package/dist/collection/components/sd-popover/sd-popover.js +3 -3
  61. package/dist/collection/components/sd-popup/sd-popup.js +1 -1
  62. package/dist/collection/components/sd-portal/sd-portal.js +1 -1
  63. package/dist/collection/components/sd-radio/sd-radio.js +1 -1
  64. package/dist/collection/components/sd-radio-button/sd-radio-button.js +1 -1
  65. package/dist/collection/components/sd-radio-group/sd-radio-group.js +1 -1
  66. package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
  67. package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
  68. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
  69. package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
  70. package/dist/collection/components/sd-select/sd-select.js +4 -4
  71. package/dist/collection/components/sd-switch/sd-switch.js +1 -1
  72. package/dist/collection/components/sd-table/sd-table.js +6 -6
  73. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
  74. package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
  75. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
  76. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  77. package/dist/collection/components/sd-tag/sd-tag.js +2 -2
  78. package/dist/collection/components/sd-text-link/sd-text-link.js +3 -3
  79. package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
  80. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  81. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  82. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  83. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  84. package/dist/components/{p-DeHt0RYQ.js → p-2z2c2umH.js} +1 -1
  85. package/dist/components/{p-BDJJQALT.js → p-B45aOf4I.js} +1 -1
  86. package/dist/components/{p-CSbyXQa9.js → p-B6G64i5a.js} +1 -1
  87. package/dist/components/{p-CRq8zgt_.js → p-B6JOxZKP.js} +1 -1
  88. package/dist/components/{p-CAP-9lnL.js → p-B6L3bPm2.js} +1 -1
  89. package/dist/components/{p-C1Fk1556.js → p-BWJtQGYo.js} +1 -1
  90. package/dist/components/{p-DAAHX92J.js → p-Bhh7ig9Q.js} +1 -1
  91. package/dist/components/{p-DR1f1cS9.js → p-C8c6MuKQ.js} +1 -1
  92. package/dist/components/{p-Dq38kgOY.js → p-CARYLqH9.js} +1 -1
  93. package/dist/components/{p-BYRvYsiC.js → p-CTuKWVTh.js} +1 -1
  94. package/dist/components/{p-CJRGLvgC.js → p-CkR5oiLy.js} +1 -1
  95. package/dist/components/{p-5_BC8C6x.js → p-CwQTEZWO.js} +1 -1
  96. package/dist/components/{p-CK6jFkqR.js → p-CwRItc2J.js} +1 -1
  97. package/dist/components/{p-CtXad9by.js → p-D6cUtm8p.js} +1 -1
  98. package/dist/components/{p-2aQ4cVXp.js → p-DCFqtVBm.js} +1 -1
  99. package/dist/components/{p-D4mjSR0u.js → p-DISZkQqT.js} +1 -1
  100. package/dist/components/{p-vZLoby4N.js → p-DMrXwfmf.js} +1 -1
  101. package/dist/components/{p-DwKYjjIC.js → p-DP0Dp12H.js} +1 -1
  102. package/dist/components/{p-DY1iQfib.js → p-DhmsCQrB.js} +1 -1
  103. package/dist/components/{p-DfKa36bs.js → p-DhtKHJ7-.js} +1 -1
  104. package/dist/components/{p-DK4Jvax0.js → p-DmDGMDzt.js} +1 -1
  105. package/dist/components/p-DoREs-rv.js +1 -0
  106. package/dist/components/{p-BNXKU1BW.js → p-EcuI_UmK.js} +1 -1
  107. package/dist/components/{p-CnbeQ2DI.js → p-I9SoAcVO.js} +1 -1
  108. package/dist/components/{p-BVvVDIo0.js → p-ZSGGRCNc.js} +1 -1
  109. package/dist/components/{p-F7yyGdIc.js → p-cX2DD74L.js} +1 -1
  110. package/dist/components/{p-CWGbMz0J.js → p-f10Mw7qM.js} +1 -1
  111. package/dist/components/{p-D155awu4.js → p-lOVBaLB7.js} +1 -1
  112. package/dist/components/p-p4bNikji.js +1 -0
  113. package/dist/components/{p-EbF6qsnG.js → p-uVZjhyvS.js} +1 -1
  114. package/dist/components/{p-B_2U9h3P.js → p-wLoP3KMv.js} +1 -1
  115. package/dist/components/p-y_6iWhDy.js +1 -0
  116. package/dist/components/sd-action-modal.js +1 -1
  117. package/dist/components/sd-badge.js +1 -1
  118. package/dist/components/sd-barcode-input.js +1 -1
  119. package/dist/components/sd-button.js +1 -1
  120. package/dist/components/sd-calendar.js +1 -1
  121. package/dist/components/sd-callout.js +1 -1
  122. package/dist/components/sd-card.js +1 -1
  123. package/dist/components/sd-chip.js +1 -1
  124. package/dist/components/sd-circle-progress.js +1 -1
  125. package/dist/components/sd-confirm-modal.js +1 -1
  126. package/dist/components/sd-date-picker-trigger.js +1 -1
  127. package/dist/components/sd-date-picker.js +1 -1
  128. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  129. package/dist/components/sd-date-range-picker.js +1 -1
  130. package/dist/components/sd-divider.js +1 -1
  131. package/dist/components/sd-dropdown-button.js +1 -1
  132. package/dist/components/sd-field.js +1 -1
  133. package/dist/components/sd-file-picker.js +1 -1
  134. package/dist/components/sd-floating-portal.js +1 -1
  135. package/dist/components/sd-ghost-button.js +1 -1
  136. package/dist/components/sd-guide.js +1 -1
  137. package/dist/components/sd-input.js +1 -1
  138. package/dist/components/sd-key-value-table.js +1 -1
  139. package/dist/components/sd-linear-progress.js +1 -1
  140. package/dist/components/sd-loading-container.js +1 -1
  141. package/dist/components/sd-loading-modal.js +1 -1
  142. package/dist/components/sd-modal-container.js +1 -1
  143. package/dist/components/sd-number-input.js +1 -1
  144. package/dist/components/sd-pagination.js +1 -1
  145. package/dist/components/sd-popover.js +1 -1
  146. package/dist/components/sd-popup.js +1 -1
  147. package/dist/components/sd-portal.js +1 -1
  148. package/dist/components/sd-radio-button.js +1 -1
  149. package/dist/components/sd-radio-group.js +1 -1
  150. package/dist/components/sd-radio.js +1 -1
  151. package/dist/components/sd-select-list-item-search.js +1 -1
  152. package/dist/components/sd-select-list-item.js +1 -1
  153. package/dist/components/sd-select-listbox.js +1 -1
  154. package/dist/components/sd-select-trigger.js +1 -1
  155. package/dist/components/sd-select.js +1 -1
  156. package/dist/components/sd-switch.js +1 -1
  157. package/dist/components/sd-table.js +1 -1
  158. package/dist/components/sd-tabs.js +1 -1
  159. package/dist/components/sd-tag.js +1 -1
  160. package/dist/components/sd-tbody.js +1 -1
  161. package/dist/components/sd-td.js +1 -1
  162. package/dist/components/sd-text-link.js +1 -1
  163. package/dist/components/sd-textarea.js +1 -1
  164. package/dist/components/sd-thead.js +1 -1
  165. package/dist/components/sd-toast-container.js +1 -1
  166. package/dist/components/sd-toast.js +1 -1
  167. package/dist/components/sd-toggle.js +1 -1
  168. package/dist/components/sd-tooltip.js +1 -1
  169. package/dist/design-system/design-system.esm.js +1 -1
  170. package/dist/design-system/{p-32d96a70.entry.js → p-07b0d118.entry.js} +1 -1
  171. package/dist/design-system/{p-e159f70d.entry.js → p-0de5a53b.entry.js} +1 -1
  172. package/dist/design-system/{p-e1350f4d.entry.js → p-1219699a.entry.js} +1 -1
  173. package/dist/design-system/p-18057222.entry.js +1 -0
  174. package/dist/design-system/{p-08798232.entry.js → p-18d3ae55.entry.js} +1 -1
  175. package/dist/design-system/{p-643c004a.entry.js → p-1aafbc7b.entry.js} +1 -1
  176. package/dist/design-system/{p-0060136e.entry.js → p-2c0a8333.entry.js} +1 -1
  177. package/dist/design-system/{p-ea17a361.entry.js → p-2d3d25bd.entry.js} +1 -1
  178. package/dist/design-system/p-3e2b5e01.entry.js +1 -0
  179. package/dist/design-system/{p-840f592d.entry.js → p-46faa7ed.entry.js} +1 -1
  180. package/dist/design-system/{p-b08ca29b.entry.js → p-4c3ead1b.entry.js} +1 -1
  181. package/dist/design-system/{p-a6c9baa5.entry.js → p-5c4fd9c1.entry.js} +1 -1
  182. package/dist/design-system/{p-eef5f8d7.entry.js → p-5d5d8220.entry.js} +1 -1
  183. package/dist/design-system/p-60b80bf3.entry.js +1 -0
  184. package/dist/design-system/{p-8d2815cf.entry.js → p-74b3e95b.entry.js} +1 -1
  185. package/dist/design-system/{p-0964c79a.entry.js → p-78b0b759.entry.js} +1 -1
  186. package/dist/design-system/p-78c2fd6d.entry.js +1 -0
  187. package/dist/design-system/p-8674d868.entry.js +1 -0
  188. package/dist/design-system/{p-10f579ba.entry.js → p-95bbba4f.entry.js} +1 -1
  189. package/dist/design-system/{p-b5e9320f.entry.js → p-969665c0.entry.js} +1 -1
  190. package/dist/design-system/{p-adce8704.entry.js → p-97b405aa.entry.js} +1 -1
  191. package/dist/design-system/{p-4ef942a8.entry.js → p-9d34518e.entry.js} +1 -1
  192. package/dist/design-system/{p-d1da969d.entry.js → p-a5930cbd.entry.js} +1 -1
  193. package/dist/design-system/{p-102c2153.entry.js → p-bd4e5141.entry.js} +1 -1
  194. package/dist/design-system/{p-70f47e43.entry.js → p-c1bac61e.entry.js} +1 -1
  195. package/dist/design-system/{p-f172920e.entry.js → p-c73cadc7.entry.js} +1 -1
  196. package/dist/design-system/{p-7444d475.entry.js → p-cffa6da7.entry.js} +1 -1
  197. package/dist/design-system/{p-914d74c4.entry.js → p-deec1ef0.entry.js} +1 -1
  198. package/dist/design-system/{p-2e4d1fe1.entry.js → p-e6bd8ab1.entry.js} +1 -1
  199. package/dist/design-system/{p-1743651a.entry.js → p-e81cb8c9.entry.js} +1 -1
  200. package/dist/design-system/{p-e9079238.entry.js → p-ea586c5e.entry.js} +1 -1
  201. package/dist/design-system/{p-733aa107.entry.js → p-f14962bd.entry.js} +1 -1
  202. package/dist/design-system/{p-521e5d2e.entry.js → p-f3dff8b8.entry.js} +1 -1
  203. package/dist/design-system/{p-afdca5bb.entry.js → p-fc6da22d.entry.js} +1 -1
  204. package/dist/design-system/{p-282b1260.entry.js → p-ff33d019.entry.js} +1 -1
  205. package/dist/esm/sd-action-modal.entry.js +1 -1
  206. package/dist/esm/sd-badge.entry.js +1 -1
  207. package/dist/esm/sd-barcode-input.entry.js +1 -1
  208. package/dist/esm/sd-button_2.entry.js +2 -2
  209. package/dist/esm/sd-calendar_2.entry.js +5 -5
  210. package/dist/esm/sd-callout.entry.js +1 -1
  211. package/dist/esm/sd-card.entry.js +1 -1
  212. package/dist/esm/sd-chip.entry.js +1 -1
  213. package/dist/esm/sd-circle-progress.entry.js +1 -1
  214. package/dist/esm/sd-confirm-modal_2.entry.js +3 -3
  215. package/dist/esm/sd-date-picker_7.entry.js +10 -10
  216. package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
  217. package/dist/esm/sd-divider.entry.js +1 -1
  218. package/dist/esm/sd-field_3.entry.js +8 -8
  219. package/dist/esm/sd-ghost-button.entry.js +2 -2
  220. package/dist/esm/sd-guide.entry.js +2 -2
  221. package/dist/esm/sd-linear-progress.entry.js +1 -1
  222. package/dist/esm/sd-loading-container.entry.js +2 -2
  223. package/dist/esm/sd-pagination_4.entry.js +8 -8
  224. package/dist/esm/sd-popover.entry.js +3 -3
  225. package/dist/esm/sd-popup.entry.js +1 -1
  226. package/dist/esm/sd-portal.entry.js +1 -1
  227. package/dist/esm/sd-radio-button.entry.js +1 -1
  228. package/dist/esm/sd-radio.entry.js +1 -1
  229. package/dist/esm/sd-select-list-item_2.entry.js +6 -6
  230. package/dist/esm/sd-select_3.entry.js +8 -8
  231. package/dist/esm/sd-switch.entry.js +1 -1
  232. package/dist/esm/sd-table.entry.js +6 -6
  233. package/dist/esm/sd-tabs.entry.js +1 -1
  234. package/dist/esm/sd-tag.entry.js +2 -2
  235. package/dist/esm/sd-td.entry.js +1 -1
  236. package/dist/esm/sd-text-link.entry.js +3 -3
  237. package/dist/esm/sd-toast-container.entry.js +1 -1
  238. package/dist/esm/sd-toast.entry.js +2 -2
  239. package/dist/esm/sd-toggle.entry.js +1 -1
  240. package/hydrate/index.js +91 -91
  241. package/hydrate/index.mjs +91 -91
  242. package/package.json +1 -1
  243. package/dist/components/p-BFAQ4nY2.js +0 -1
  244. package/dist/components/p-LZKaKr8O.js +0 -1
  245. package/dist/components/p-pTx5xpqU.js +0 -1
  246. package/dist/design-system/p-17ec576c.entry.js +0 -1
  247. package/dist/design-system/p-4cf1c8ae.entry.js +0 -1
  248. package/dist/design-system/p-69a208c0.entry.js +0 -1
  249. package/dist/design-system/p-9c74571a.entry.js +0 -1
  250. package/dist/design-system/p-f97b75d3.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as e,a as i,h as s}from"./p-DNWwGHho.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-ByhWX2NK.js";const d=a.textinput.sm,n=a.textinput.md,r={sm:{height:d.height,paddingX:d.paddingX,gap:d.gap,radius:d.radius,fontSize:d.typography.fontSize,lineHeight:d.typography.lineHeight,fontWeight:d.typography.fontWeight},md:{height:n.height,paddingX:n.paddingX,gap:n.gap,radius:n.radius,fontSize:n.typography.fontSize,lineHeight:n.typography.lineHeight,fontWeight:n.typography.fontWeight}},l={bg:a.textinput.bg,text:a.textinput.text,icon:a.textinput.icon},c=class{constructor(i){t(this,i),this.input=e(this,"sdUpdate",7),this.focus=e(this,"sdFocus",7),this.blur=e(this,"sdBlur",7)}get host(){return i(this)}value=null;size="sm";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){void 0!==this.value&&""!==this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,e)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(e)):this.focus?.emit(e)};render(){const t=r[this.size]??r.sm;return s("sd-field",{key:"61eb9beceb57e58323c1477c71147607db834e71",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,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":`${t.fontSize}px`,"--sd-barcode-input-line-height":`${t.lineHeight}px`,"--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":`${t.paddingX}px`,"--sd-barcode-input-gap":`${t.gap}px`,"--sd-barcode-input-text-color":l.text.default,"--sd-barcode-input-placeholder-color":l.text.placeholder,"--sd-barcode-input-disabled-color":l.text.disabled,"--sd-barcode-input-icon-color":l.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`,"--sd-system-color-field-bg-default":l.bg.barcode}},s("label",{key:"9d4fa219af76d29b2d2e8443af1e66b980d62dd1",class:"sd-barcode-input__content"},s("slot",{key:"044bf2c4a6e79bb0d6b2a76398107b47d1237662",name:"prefix"}),s("input",{key:"2522d0ded40b69c76872877bede00b1e4e5260d2",name:this.name,ref:t=>this.nativeEl=t,class:`sd-barcode-input__native ${this.inputClass}`,type:"text",value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),s("slot",{key:"8dc300df9f8bd7045f9c9e357925be3b7f2bdbb4",name:"suffix"}),this.clearable&&this.internalValue&&s("sd-ghost-button",{key:"1b3cab2c7fe9caf973e7defff170f64b3fd35daa",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}};c.style="sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}";export{c as sd_barcode_input}
1
+ import{r as t,c as e,a as i,h as s}from"./p-DNWwGHho.js";import{n as a}from"./p-CCwNgVmC.js";import{i as o}from"./p-ByhWX2NK.js";const n=o.textinput.sm,d=o.textinput.md,r={sm:{height:n.height,paddingX:n.paddingX,gap:n.gap,radius:n.radius,fontSize:n.typography.fontSize,lineHeight:n.typography.lineHeight,fontWeight:n.typography.fontWeight},md:{height:d.height,paddingX:d.paddingX,gap:d.gap,radius:d.radius,fontSize:d.typography.fontSize,lineHeight:d.typography.lineHeight,fontWeight:d.typography.fontWeight}},l={bg:o.textinput.bg,text:o.textinput.text,icon:o.textinput.icon},c=class{constructor(i){t(this,i),this.input=e(this,"sdUpdate",7),this.focus=e(this,"sdFocus",7),this.blur=e(this,"sdBlur",7)}get host(){return i(this)}value=null;size="sm";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=a();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){void 0!==this.value&&""!==this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,e)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(e)):this.focus?.emit(e)};render(){const t=r[this.size]??r.sm;return s("sd-field",{key:"c009f4c33b31e9498c230e9a0f4064925a1e5757",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,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":`${t.fontSize}px`,"--sd-barcode-input-line-height":`${t.lineHeight}px`,"--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":`${t.paddingX}px`,"--sd-barcode-input-gap":`${t.gap}px`,"--sd-barcode-input-text-color":l.text.default,"--sd-barcode-input-placeholder-color":l.text.placeholder,"--sd-barcode-input-disabled-color":l.text.disabled,"--sd-barcode-input-icon-color":l.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`,"--sd-system-color-field-bg-default":l.bg.barcode}},s("label",{key:"a614817eab514a80f7132ebb92ebb0b8bb8009e4",class:"sd-barcode-input__content"},s("slot",{key:"16a0bf4c55eafec3fb827ba8fe54f61e546fbbca",name:"prefix"}),s("input",{key:"de9e2abcfe4b8f34084feb8691ef6c8183568932",name:this.name,ref:t=>this.nativeEl=t,class:`sd-barcode-input__native ${this.inputClass}`,type:"text",value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),s("slot",{key:"dbfc3e2c03b20da68e80cc3855cace42aae268ec",name:"suffix"}),this.clearable&&this.internalValue&&s("sd-ghost-button",{key:"05670236ffb93c7b894bdea9763d11adcab75e05",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}};c.style="sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}";export{c as sd_barcode_input}
@@ -0,0 +1 @@
1
+ import{r as e,c as s,a as t,h as i,F as a}from"./p-DNWwGHho.js";import{T as o}from"./p-LIf7YMBN.js";var n="#07284A";const l=class{constructor(t){e(this,t),this.showChange=s(this,"sdShowChange",7)}get el(){return t(this)}show=!1;placement="bottom";color="#01BB4B";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";menuTitle;leftLink;button;menuClass="";slotContentHTML="";showChange;buttonEl;setShow=e=>{this.show!==e&&(this.show=e,this.showChange.emit(e))};get popoverOffset(){switch(this.placement??"bottom"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>this.setShow(!1);componentWillLoad(){this.slotContentHTML=this.el.innerHTML,this.el.innerHTML=""}render(){const e=this.placement??"bottom",s=this.color??"#01BB4B",t=this.icon??"helpOutline",l=this.iconSize??12,c=this.menuClass??"",d=this.leftLink,b=this.button,f=!!d||!!b;return i(a,{key:"f0b7cc015ab688e21d6df2a797c3964808965934"},""!==this.label?i("sd-button",{ref:e=>this.buttonEl=e,name:this.name??"primary_sm",label:this.label,icon:t,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel||this.label||t||"Open popover",disabled:this.disabled,type:this.type??"button",class:"sd-popover",onSdClick:()=>this.setShow(!this.show)}):i("sd-icon",{ref:e=>this.buttonEl=e,name:t,size:l,color:s,class:"sd-popover",onClick:()=>this.setShow(!this.show)}),this.show&&i("sd-floating-portal",{key:"3b8ad8010a7d74fb519f0ad9ff504c0c0fa32941",parentRef:this.buttonEl,onSdClose:this.handleClose,placement:e,offset:this.popoverOffset},i("div",{key:"8fba73c8cf2718258a176dac2033fb3b33a8a618",class:{"sd-floating-menu":!0,"sd-floating-menu--popover":!0,[`sd-floating-menu--${e}`]:!0,[c]:""!==c},style:{"--sd-floating-bg":n}},i("i",{key:"1cef252c66b1c350ea43849e552faced5a53fec0",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${e}`},i(o,{key:"755246fe5fbf9b203509f8d45d2bcbeead0c02c6"})),i("div",{key:"cbefa421598f83f692533d4abf8cfc584b4e02e1",class:"sd-floating-menu__content"},this.menuTitle&&i("div",{key:"0f1dfbaf65236416ba00e5f87cb60e2e98971995",class:"sd-floating-menu__title"},this.menuTitle),this.slotContentHTML&&i("div",{key:"38ef67a38921e3fbd1e8bee95892655fc57d124c",class:"sd-floating-menu__messages",innerHTML:this.slotContentHTML}),f&&i("div",{key:"6b3f297563e3b7aa17ace0e20c4423d09b528b32",class:{"sd-floating-menu__buttons":!0,"sd-floating-menu__buttons--with-link":!!d}},d&&i("sd-text-link",{key:"6ff83b0aefa24ac3bbae7f1399fdaaa1028b4e75",class:"sd-floating-menu__left-link",label:d.label,icon:d.icon??"",iconColor:d.iconColor??"",useArrow:!!d.useArrow,underline:!!d.underline,disabled:!!d.disabled,onSdClick:d.onClick}),b&&i("sd-button",{key:"b8b75cd68c55b16b5eb0e4635c16b784381ced78",name:b.name??"secondary_xs",label:b.label,icon:b.icon,rightIcon:b.rightIcon,ariaLabel:b.ariaLabel||b.label||b.icon||"Open popover",disabled:b.disabled,type:b.type,onSdClick:b.onClick}))),i("sd-ghost-button",{key:"246ab053d1109d7b999e63c3aa5a1048d6096583",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xs",onClick:this.handleClose}))))}};l.style="sd-popover{position:relative;cursor:pointer;display:inline-flex}";export{l as sd_popover}
@@ -1 +1 @@
1
- import{r as t,h as e}from"./p-DNWwGHho.js";var n={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},i={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},a={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},g={content:"#FB4444",bg:"#FCEFEF"},s={content:"#FF6B00",bg:"#FEF1EA"},o={content:"#916C0D",bg:"#FFF7DD"},d={content:"#00973C",bg:"#E8F9EF"},r={content:"#0075FF",bg:"#E6F1FF"},c={content:"#006AC1",bg:"#EAF5FE"},h={content:"#004290",bg:"#EFF6FF"},p={content:"#737373",bg:"#EEEEEE"};const l=["xs","sm","md"],u=["grey","red","orange","yellow","green","blue","darkblue","indigo"],b={grey:{background:p.bg,content:p.content,icon:p.content},red:{background:g.bg,content:g.content,icon:g.content},orange:{background:s.bg,content:s.content,icon:s.content},yellow:{background:o.bg,content:o.content,icon:o.content},green:{background:d.bg,content:d.content,icon:d.content},blue:{background:r.bg,content:r.content,icon:r.content},darkblue:{background:c.bg,content:c.content,icon:c.content},indigo:{background:h.bg,content:h.content,icon:h.content}},x={xs:{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:12,radius:`${n.radius}px`},sm:{height:`${i.height}px`,paddingX:`${i.paddingX}px`,gap:`${i.gap}px`,fontSize:`${i.typography.fontSize}px`,fontWeight:i.typography.fontWeight,lineHeight:`${i.typography.lineHeight}px`,iconSize:16,radius:`${i.radius}px`},md:{height:`${a.height}px`,paddingX:`${a.paddingX}px`,gap:`${a.gap}px`,fontSize:`${a.typography.fontSize}px`,fontWeight:a.typography.fontWeight,lineHeight:`${a.typography.lineHeight}px`,iconSize:16,radius:`${a.radius}px`}},f={xs:{...x.xs,radius:"999px"},sm:{...x.sm,radius:"999px"},md:{...x.md,radius:"999px"}},F=Object.fromEntries(["square","pill"].flatMap((t=>l.flatMap((e=>u.map((n=>[`${t}_${e}_${n}`,{shape:t,size:e,color:n,..."square"===t?x[e]:f[e],...b[n]}]))))))),y=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(F,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return F[this.resolvedName]}renderIcon(t,n){return null==this.icon?null:e("sd-icon",{class:"sd-tag__icon",name:this.icon,size:n,color:t})}render(){const t=this.resolvedConfig,n=this.renderIcon(t.icon,t.iconSize);return e("span",{key:"c8b8b88e2c83401bb9d3e05004b0517d7e4a3a6a",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&&n,e("span",{key:"67094b09ab1d7b7e865c9f6b8017f8c5c3f8274a",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&n)}};y.style="sd-tag{display:inline-flex;width:fit-content;height:fit-content}.sd-tag{display:inline-flex;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{y as sd_tag}
1
+ import{r as t,h as e}from"./p-DNWwGHho.js";var n={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},i={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},a={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},g={content:"#FB4444",bg:"#FCEFEF"},s={content:"#FF6B00",bg:"#FEF1EA"},o={content:"#916C0D",bg:"#FFF7DD"},d={content:"#00973C",bg:"#E8F9EF"},r={content:"#0075FF",bg:"#E6F1FF"},c={content:"#006AC1",bg:"#EAF5FE"},h={content:"#004290",bg:"#EFF6FF"},p={content:"#737373",bg:"#EEEEEE"};const l=["xs","sm","md"],u=["grey","red","orange","yellow","green","blue","darkblue","indigo"],x={grey:{background:p.bg,content:p.content,icon:p.content},red:{background:g.bg,content:g.content,icon:g.content},orange:{background:s.bg,content:s.content,icon:s.content},yellow:{background:o.bg,content:o.content,icon:o.content},green:{background:d.bg,content:d.content,icon:d.content},blue:{background:r.bg,content:r.content,icon:r.content},darkblue:{background:c.bg,content:c.content,icon:c.content},indigo:{background:h.bg,content:h.content,icon:h.content}},b={xs:{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:12,radius:`${n.radius}px`},sm:{height:`${i.height}px`,paddingX:`${i.paddingX}px`,gap:`${i.gap}px`,fontSize:`${i.typography.fontSize}px`,fontWeight:i.typography.fontWeight,lineHeight:`${i.typography.lineHeight}px`,iconSize:16,radius:`${i.radius}px`},md:{height:`${a.height}px`,paddingX:`${a.paddingX}px`,gap:`${a.gap}px`,fontSize:`${a.typography.fontSize}px`,fontWeight:a.typography.fontWeight,lineHeight:`${a.typography.lineHeight}px`,iconSize:16,radius:`${a.radius}px`}},f={xs:{...b.xs,radius:"999px"},sm:{...b.sm,radius:"999px"},md:{...b.md,radius:"999px"}},F=Object.fromEntries(["square","pill"].flatMap((t=>l.flatMap((e=>u.map((n=>[`${t}_${e}_${n}`,{shape:t,size:e,color:n,..."square"===t?b[e]:f[e],...x[n]}]))))))),y=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(F,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return F[this.resolvedName]}renderIcon(t,n){return null==this.icon?null:e("sd-icon",{class:"sd-tag__icon",name:this.icon,size:n,color:t})}render(){const t=this.resolvedConfig,n=this.renderIcon(t.icon,t.iconSize);return e("span",{key:"945a8a13f4891b5174e48e262b2a108674da7198",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&&n,e("span",{key:"441932c2eb85eea471838db541fb95302527df23",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&n)}};y.style="sd-tag{display:inline-flex;width:fit-content;height:fit-content}.sd-tag{display:inline-flex;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{y as sd_tag}
@@ -1 +1 @@
1
- import{r as e,h as d}from"./p-DNWwGHho.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:"9ae835aba8a4acde4b918eceda00441ee2c22905",class:"sd-badge",style:{"--sd-badge-color":a[this.color]??a.blue}},d("div",{key:"c3b648845b5c138026a82a6a2c483d2a56ed2aab",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
+ import{r as e,h as d}from"./p-DNWwGHho.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:"5fec3220f60c6567d1aa5de6aa3d1c7c9f9e605b",class:"sd-badge",style:{"--sd-badge-color":s[this.color]??s.blue}},d("div",{key:"892f2c5c1d004d172c06bc0871688d30e449e80f",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}
@@ -0,0 +1 @@
1
+ import{r as t,a as e,h as i}from"./p-DNWwGHho.js";import{s as d}from"./p-j2khhcHY.js";import{s as o}from"./p-DopVneZA.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:"ea4f220faf6165f7650360f74a19d9f781b81489",class:"sd-guide",style:this.guideStyle},i("sd-button",{key:"c90eaa6cc42a9a2f20b8fc79db16697db0cf2ff2",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:"21f57a739141ffa36f3b799a2688ca5b3c1bd428",open:this.popupShow,parentRef:this.guideRef,onSdClose:this.closeDropdown,offset:[0,4]},i("div",{key:"94e12fa797748a02334b97e13c5012ab95bc2bce",class:"sd-guide__popup",style:{...this.guideStyle,width:null!=this.popupWidth?this.popupWidth+"px":"426px"}},i("sd-ghost-button",{key:"6fc71032016e7a3be0581508ef0ecc6772981185",class:"sd-guide__popup__close",icon:"close",ariaLabel:"close",size:"sm",onSdClick:this.closeDropdown}),i("div",{key:"385c0c18bc888be6a654525dc6f4359a56ad6de9",class:"sd-guide__popup__header"},i("sd-icon",{key:"34624d2ac3397ba15b2dc7ba23dc460a87cb878b",name:o,size:24,color:n}),i("h3",{key:"dd3527ec329698b0fd1ec82f2a7d0cf5865802c2",class:"sd-guide__popup__title"},this.popupTitle||d)),i("ul",{key:"429357d0203acdf31177353ceb45d9ac41fadae7",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}
@@ -0,0 +1 @@
1
+ import{r as d,h as r,F as s}from"./p-DNWwGHho.js";const e=class{constructor(r){d(this,r)}bordered=!1;sdClass="";render(){return r(s,{key:"366604b2ca458d2b9b26f61c1cb282543b27a699"},r("div",{key:"889e8ec8d359eb26713762ebb9990ea07dfaf0ba",class:`sd-card ${this.bordered?"sd-card--bordered":""} ${this.sdClass}`},r("slot",{key:"d680bfe14dc135da77e35440587f089781ef383f"})))}};e.style="sd-card{display:block;height:fit-content}sd-card .sd-card{border-radius:8px;background:white}sd-card .sd-card--bordered{border:1px solid #E1E1E1}";export{e as sd_card}
@@ -1 +1 @@
1
- import{r as t,c as s,h as e}from"./p-DNWwGHho.js";var a={tab:{main:{lg:{height:"44",paddingX:"32"},md:{height:"36",paddingX:"24"},gap:"8",container:{gap:"4"},radius:"6",border:{width:"1"},selected:{bg:"#FFFFFF",text:"#0075FF",border:"#0075FF",typography:{fontWeight:"700"}},default:{bg:"#F6F6F6",text:"#888888",border:"#CCCCCC",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",fontWeight:"400",fontSize:"12",lineHeight:"20"}}},sub:{selected:{text:"#0075FF",line:"#0075FF",typography:{fontWeight:"700"}},default:{text:"#222222",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",fontWeight:"400",fontSize:"12",lineHeight:"20"}},border:{width:"1"},gap:"24",content:{gap:"4"}}}};const d={md:{height:Number(a.tab.main.md.height),paddingX:Number(a.tab.main.md.paddingX)},lg:{height:Number(a.tab.main.lg.height),paddingX:Number(a.tab.main.lg.paddingX)},gap:Number(a.tab.main.gap),containerGap:Number(a.tab.main.container.gap),radius:Number(a.tab.main.radius),borderWidth:Number(a.tab.main.border.width)},b={selected:{bg:a.tab.main.selected.bg,text:a.tab.main.selected.text,border:a.tab.main.selected.border},default:{bg:a.tab.main.default.bg,text:a.tab.main.default.text,border:a.tab.main.default.border}},i={selected:a.tab.main.selected.typography,default:a.tab.main.default.typography},r=Number(a.tab.sub.gap),n=Number(a.tab.sub.content.gap),o=Number(a.tab.sub.border.width),l={selected:{text:a.tab.sub.selected.text,line:a.tab.sub.selected.line},default:{text:a.tab.sub.default.text}},u={selected:a.tab.sub.selected.typography,default:a.tab.sub.default.typography},g=class{constructor(e){t(this,e),this.update=s(this,"sdUpdate",7)}value;tabs=[];size="md";isSub=!1;update;valueChanged(t){this.value=t}handleTabClick=t=>{this.value=t.value,this.update.emit(t.value)};isTabSelected(t){return this.value===t.value}getTabClasses(t){return["sd-tabs__tab",this.isTabSelected(t)?"sd-tabs__tab--selected":"sd-tabs__tab--unselected"].join(" ")}getContainerClasses(){const t=["sd-tabs",`sd-tabs--${this.size??"md"}`];return this.isSub&&t.push("sd-tabs--sub"),t.join(" ")}getBadgeName(t){return"square_xs_"+(this.isTabSelected(t)?"blue":"grey")}buildCssVars(){const t=d[this.size??"md"];return{"--sd-tabs-main-height":`${t.height}px`,"--sd-tabs-main-padding-x":`${t.paddingX}px`,"--sd-tabs-main-gap":`${d.gap}px`,"--sd-tabs-main-container-gap":`${d.containerGap}px`,"--sd-tabs-main-radius":`${d.radius}px`,"--sd-tabs-main-border-width":`${d.borderWidth}px`,"--sd-tabs-main-selected-bg":b.selected.bg,"--sd-tabs-main-selected-text":b.selected.text,"--sd-tabs-main-selected-border":b.selected.border,"--sd-tabs-main-default-bg":b.default.bg,"--sd-tabs-main-default-text":b.default.text,"--sd-tabs-main-default-border":b.default.border,"--sd-tabs-main-font-family":i.default.fontFamily,"--sd-tabs-main-font-size":`${i.default.fontSize}px`,"--sd-tabs-main-line-height":`${i.default.lineHeight}px`,"--sd-tabs-main-font-weight-default":i.default.fontWeight,"--sd-tabs-main-font-weight-selected":i.selected.fontWeight,"--sd-tabs-sub-gap":`${r}px`,"--sd-tabs-sub-content-gap":`${n}px`,"--sd-tabs-sub-border-width":`${o}px`,"--sd-tabs-sub-selected-text":l.selected.text,"--sd-tabs-sub-selected-line":l.selected.line,"--sd-tabs-sub-default-text":l.default.text,"--sd-tabs-sub-font-family":u.default.fontFamily,"--sd-tabs-sub-font-size":`${u.default.fontSize}px`,"--sd-tabs-sub-line-height":`${u.default.lineHeight}px`,"--sd-tabs-sub-font-weight-default":u.default.fontWeight,"--sd-tabs-sub-font-weight-selected":u.selected.fontWeight}}render(){return e("div",{key:"880f1aa80c29f2d578ffe2d5e5e5e0c008c898d3",class:this.getContainerClasses(),style:this.buildCssVars()},this.tabs.map(((t,s)=>{const a=this.getBadgeName(t);return e("div",{key:`tab-${s}`,role:"tab",tabindex:0,"aria-selected":t.value===this.value?"true":"false",class:this.getTabClasses(t),"aria-label":t.label||"tab",onClick:()=>this.handleTabClick(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.handleTabClick(t))}},e("span",{"data-label":t.label,class:"sd-tabs__label"},t.label),null!=t.badge&&""!==t.badge&&e("sd-tag",{name:a,label:t.badge.toString()}))})))}static get watchers(){return{value:[{valueChanged:0}]}}};g.style='sd-tabs{display:inline-block;width:100%}sd-tabs .sd-tabs{display:flex;flex-direction:row;gap:var(--sd-tabs-main-container-gap);border-bottom:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-selected-border);font-family:var(--sd-tabs-main-font-family)}sd-tabs .sd-tabs__tab{display:flex;align-items:center;justify-content:center;gap:var(--sd-tabs-main-gap);cursor:pointer;box-sizing:border-box;height:var(--sd-tabs-main-height);padding:0 var(--sd-tabs-main-padding-x);border:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-default-border);border-bottom:none;border-top-left-radius:var(--sd-tabs-main-radius);border-top-right-radius:var(--sd-tabs-main-radius);background-color:var(--sd-tabs-main-default-bg);color:var(--sd-tabs-main-default-text);font-size:var(--sd-tabs-main-font-size);line-height:var(--sd-tabs-main-line-height);font-weight:var(--sd-tabs-main-font-weight-default);transition:all 0.2s ease;position:relative;user-select:none}sd-tabs .sd-tabs__tab::before{content:"";position:absolute;inset:0;opacity:0;transition:all 0.2s;pointer-events:none}sd-tabs .sd-tabs__tab--selected{border-color:var(--sd-tabs-main-selected-border);color:var(--sd-tabs-main-selected-text);background-color:var(--sd-tabs-main-selected-bg)}sd-tabs .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-main-font-weight-selected)}sd-tabs .sd-tabs__tab--selected:hover::before{background-color:var(--sd-tabs-main-selected-border);opacity:0.15}sd-tabs .sd-tabs__tab--unselected:hover::before{background-color:var(--sd-tabs-main-default-text);opacity:0.15}sd-tabs .sd-tabs__label{user-select:none;font-weight:var(--sd-tabs-main-font-weight-selected);visibility:hidden;position:relative;white-space:nowrap}sd-tabs .sd-tabs__label::before{content:attr(data-label);visibility:visible;position:absolute;inset:0;font-weight:var(--sd-tabs-main-font-weight-default);transition:font-weight 0.2s ease}sd-tabs .sd-tabs--sub{gap:var(--sd-tabs-sub-gap);border-bottom:none;font-family:var(--sd-tabs-sub-font-family)}sd-tabs .sd-tabs--sub .sd-tabs__tab{height:auto;padding:0 0 var(--sd-tabs-sub-content-gap) 0;border:none;border-radius:0;background-color:transparent;color:var(--sd-tabs-sub-default-text);font-size:var(--sd-tabs-sub-font-size);line-height:var(--sd-tabs-sub-line-height);font-weight:var(--sd-tabs-sub-font-weight-default)}sd-tabs .sd-tabs--sub .sd-tabs__tab::before{content:"";position:absolute;left:0;right:0;bottom:0;height:var(--sd-tabs-sub-border-width);width:100%;background-color:var(--sd-tabs-sub-selected-line);opacity:0;transition:opacity 0.2s ease;inset:auto 0 0 0;pointer-events:none}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected{color:var(--sd-tabs-sub-selected-text);background-color:transparent}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected::before{opacity:1}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-default)}';export{g as sd_tabs}
1
+ import{r as t,c as s,h as e}from"./p-DNWwGHho.js";var a={tab:{main:{lg:{height:"44",paddingX:"32"},md:{height:"36",paddingX:"24"},gap:"8",container:{gap:"4"},radius:"6",border:{width:"1"},selected:{bg:"#FFFFFF",text:"#0075FF",border:"#0075FF",typography:{fontWeight:"700"}},default:{bg:"#F6F6F6",text:"#888888",border:"#CCCCCC",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",fontWeight:"400",fontSize:"12",lineHeight:"20"}}},sub:{selected:{text:"#0075FF",line:"#0075FF",typography:{fontWeight:"700"}},default:{text:"#222222",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",fontWeight:"400",fontSize:"12",lineHeight:"20"}},border:{width:"1"},gap:"24",content:{gap:"4"}}}};const d={md:{height:Number(a.tab.main.md.height),paddingX:Number(a.tab.main.md.paddingX)},lg:{height:Number(a.tab.main.lg.height),paddingX:Number(a.tab.main.lg.paddingX)},gap:Number(a.tab.main.gap),containerGap:Number(a.tab.main.container.gap),radius:Number(a.tab.main.radius),borderWidth:Number(a.tab.main.border.width)},b={selected:{bg:a.tab.main.selected.bg,text:a.tab.main.selected.text,border:a.tab.main.selected.border},default:{bg:a.tab.main.default.bg,text:a.tab.main.default.text,border:a.tab.main.default.border}},i={selected:a.tab.main.selected.typography,default:a.tab.main.default.typography},r=Number(a.tab.sub.gap),n=Number(a.tab.sub.content.gap),o=Number(a.tab.sub.border.width),l={selected:{text:a.tab.sub.selected.text,line:a.tab.sub.selected.line},default:{text:a.tab.sub.default.text}},u={selected:a.tab.sub.selected.typography,default:a.tab.sub.default.typography},g=class{constructor(e){t(this,e),this.update=s(this,"sdUpdate",7)}value;tabs=[];size="md";isSub=!1;update;valueChanged(t){this.value=t}handleTabClick=t=>{this.value=t.value,this.update.emit(t.value)};isTabSelected(t){return this.value===t.value}getTabClasses(t){return["sd-tabs__tab",this.isTabSelected(t)?"sd-tabs__tab--selected":"sd-tabs__tab--unselected"].join(" ")}getContainerClasses(){const t=["sd-tabs",`sd-tabs--${this.size??"md"}`];return this.isSub&&t.push("sd-tabs--sub"),t.join(" ")}getBadgeName(t){return"square_xs_"+(this.isTabSelected(t)?"blue":"grey")}buildCssVars(){const t=d[this.size??"md"];return{"--sd-tabs-main-height":`${t.height}px`,"--sd-tabs-main-padding-x":`${t.paddingX}px`,"--sd-tabs-main-gap":`${d.gap}px`,"--sd-tabs-main-container-gap":`${d.containerGap}px`,"--sd-tabs-main-radius":`${d.radius}px`,"--sd-tabs-main-border-width":`${d.borderWidth}px`,"--sd-tabs-main-selected-bg":b.selected.bg,"--sd-tabs-main-selected-text":b.selected.text,"--sd-tabs-main-selected-border":b.selected.border,"--sd-tabs-main-default-bg":b.default.bg,"--sd-tabs-main-default-text":b.default.text,"--sd-tabs-main-default-border":b.default.border,"--sd-tabs-main-font-family":i.default.fontFamily,"--sd-tabs-main-font-size":`${i.default.fontSize}px`,"--sd-tabs-main-line-height":`${i.default.lineHeight}px`,"--sd-tabs-main-font-weight-default":i.default.fontWeight,"--sd-tabs-main-font-weight-selected":i.selected.fontWeight,"--sd-tabs-sub-gap":`${r}px`,"--sd-tabs-sub-content-gap":`${n}px`,"--sd-tabs-sub-border-width":`${o}px`,"--sd-tabs-sub-selected-text":l.selected.text,"--sd-tabs-sub-selected-line":l.selected.line,"--sd-tabs-sub-default-text":l.default.text,"--sd-tabs-sub-font-family":u.default.fontFamily,"--sd-tabs-sub-font-size":`${u.default.fontSize}px`,"--sd-tabs-sub-line-height":`${u.default.lineHeight}px`,"--sd-tabs-sub-font-weight-default":u.default.fontWeight,"--sd-tabs-sub-font-weight-selected":u.selected.fontWeight}}render(){return e("div",{key:"92384577bf4ce85de90ae05a32e44715e595fe16",class:this.getContainerClasses(),style:this.buildCssVars()},this.tabs.map(((t,s)=>{const a=this.getBadgeName(t);return e("div",{key:`tab-${s}`,role:"tab",tabindex:0,"aria-selected":t.value===this.value?"true":"false",class:this.getTabClasses(t),"aria-label":t.label||"tab",onClick:()=>this.handleTabClick(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.handleTabClick(t))}},e("span",{"data-label":t.label,class:"sd-tabs__label"},t.label),null!=t.badge&&""!==t.badge&&e("sd-tag",{name:a,label:t.badge.toString()}))})))}static get watchers(){return{value:[{valueChanged:0}]}}};g.style='sd-tabs{display:inline-block;width:100%}sd-tabs .sd-tabs{display:flex;flex-direction:row;gap:var(--sd-tabs-main-container-gap);border-bottom:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-selected-border);font-family:var(--sd-tabs-main-font-family)}sd-tabs .sd-tabs__tab{display:flex;align-items:center;justify-content:center;gap:var(--sd-tabs-main-gap);cursor:pointer;box-sizing:border-box;height:var(--sd-tabs-main-height);padding:0 var(--sd-tabs-main-padding-x);border:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-default-border);border-bottom:none;border-top-left-radius:var(--sd-tabs-main-radius);border-top-right-radius:var(--sd-tabs-main-radius);background-color:var(--sd-tabs-main-default-bg);color:var(--sd-tabs-main-default-text);font-size:var(--sd-tabs-main-font-size);line-height:var(--sd-tabs-main-line-height);font-weight:var(--sd-tabs-main-font-weight-default);transition:all 0.2s ease;position:relative;user-select:none}sd-tabs .sd-tabs__tab::before{content:"";position:absolute;inset:0;opacity:0;transition:all 0.2s;pointer-events:none}sd-tabs .sd-tabs__tab--selected{border-color:var(--sd-tabs-main-selected-border);color:var(--sd-tabs-main-selected-text);background-color:var(--sd-tabs-main-selected-bg)}sd-tabs .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-main-font-weight-selected)}sd-tabs .sd-tabs__tab--selected:hover::before{background-color:var(--sd-tabs-main-selected-border);opacity:0.15}sd-tabs .sd-tabs__tab--unselected:hover::before{background-color:var(--sd-tabs-main-default-text);opacity:0.15}sd-tabs .sd-tabs__label{user-select:none;font-weight:var(--sd-tabs-main-font-weight-selected);visibility:hidden;position:relative;white-space:nowrap}sd-tabs .sd-tabs__label::before{content:attr(data-label);visibility:visible;position:absolute;inset:0;font-weight:var(--sd-tabs-main-font-weight-default);transition:font-weight 0.2s ease}sd-tabs .sd-tabs--sub{gap:var(--sd-tabs-sub-gap);border-bottom:none;font-family:var(--sd-tabs-sub-font-family)}sd-tabs .sd-tabs--sub .sd-tabs__tab{height:auto;padding:0 0 var(--sd-tabs-sub-content-gap) 0;border:none;border-radius:0;background-color:transparent;color:var(--sd-tabs-sub-default-text);font-size:var(--sd-tabs-sub-font-size);line-height:var(--sd-tabs-sub-line-height);font-weight:var(--sd-tabs-sub-font-weight-default)}sd-tabs .sd-tabs--sub .sd-tabs__tab::before{content:"";position:absolute;left:0;right:0;bottom:0;height:var(--sd-tabs-sub-border-width);width:100%;background-color:var(--sd-tabs-sub-selected-line);opacity:0;transition:opacity 0.2s ease;inset:auto 0 0 0;pointer-events:none}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected{color:var(--sd-tabs-sub-selected-text);background-color:transparent}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected::before{opacity:1}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-default)}';export{g as sd_tabs}
@@ -1 +1 @@
1
- import{r as t,c as e,a as s,d as i,f as h,h as a,H as n}from"./p-DNWwGHho.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as o,b as d,c,d as u}from"./p-DGyTYauz.js";import"./p-D6GUzecR.js";import"./p-j2khhcHY.js";let b=(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=b(8);fallbackTableId=b(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};useTop=!1;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,h=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===h||(this.scrolledLeft=i,this.scrolledRight=h,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:h}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(h))return;const a=this.vsStart!==i||this.vsEnd!==h;if(!a&&!t)return;this.vsStart=i,this.vsEnd=h;const n=i*this.effectiveRowHeight,r=Math.max(0,(this.rowCount-h)*this.effectiveRowHeight),l=this.queryChildEl("sd-tbody");l?.setSpacersSync?.(n,r),a&&this.sdVirtualUpdate.emit({from:i,to:h}),this.maybeEmitVirtualReachEnd(i,h)}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,h=this.columnWidths[t],a=e=>{const a=this.columns[t];if(null==a)return;const n=a.maxWidth||9999,r=e.clientX-i,l=Math.min(Math.max(h+(s?-r:r),a.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",a),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",a),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],h={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(h.width=`${this.columnWidths[t]}px`,h.minWidth=`${this.columnWidths[t]}px`,h.maxWidth=`${this.columnWidths[t]}px`),h}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():h(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const h=Math.max(1,Math.floor(s||1)),a=Math.max(1,Math.floor(i||1)),n=this.spanKey(t,e),r=this.spanRegistry.get(n);if(1===h&&1===a){if(!r)return;return this.spanRegistry.delete(n),void this.requestAllTrUpdate()}r&&r.rowspan===h&&r.colspan===a||(this.spanRegistry.set(n,{rowspan:h,colspan:a}),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),h=(s??"").trim();""!==h?this.cellClassRegistry.set(i,h):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 h=i[s];if(null==h)continue;const a=this.spanRegistry.get(this.spanKey(t,"string"==typeof h.field?h.field:h.name));if(a&&s+a.colspan>e)return!0}const h=this.resolveRowIndex(t);if(null==h)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const a=t.indexOf("::");if(a<0)continue;const n=t.slice(0,a),r=t.slice(a+2),l=this.resolveRowIndex(n);if(null==l)continue;if(l>=h)continue;if(l+s.rowspan<=h)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))),h=Math.max(0,this.toFiniteNumber(t,0)),a=Math.max(0,this.toFiniteNumber(e,0)),n=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),r=Math.floor(h/s),l=Math.ceil(a/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 a("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=e?`max(${this.height||"96px"}, ${36+this.noDataBodyHeight}px)`:this.height||"100%";return a(n,{key:"73046beb47b356f351ae89b162c8e8af2942b0b2",style:{"--table-radius":`${u}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`}},a("div",{key:"f56b8a425d15a3598e6c1f3373d21ef263cbd800",class:"sd-table__container",style:{"--table-width":this.width,"--table-height":s,"--table-container-height":`calc(${s} - ${this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0}px)`}},a("div",{key:"519a193ab21616ce0a423c9043e0114c489539f3",class:{"sd-table__wrapper":!0,"sd-table__wrapper--use-top":this.useTop}},a("div",{key:"ef96c9e2ef6b70023c35e5709048f3d994a5bebc",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&a("div",{key:"94f9bbc56855af3548a73ccbbf228b2247764f54",class:"sd-table__loading",style:{top:`${this.loadingScrollTop}px`}},a("sd-circle-progress",{key:"2f8a0bfbc0c5829779b7474a9520ddec70a977ea",indeterminate:!0})),e&&a(a.Fragment,null,a("div",{key:"fab3d44147ecbc99ff3745908ec69da003b4e7cf",class:"sd-table__no-data-header-overlay"}),a("div",{key:"10f8b13e6bba12c80001e5d4432715b0abe2f2f2",class:"sd-table__no-data"},a("div",{key:"8c411450fc0780df83e69c86ad06c2d09cf80350",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},a("slot",{key:"661b982cde4f4a6dfa9f6c712efed6745e20f3bf",name:"no-data"},a("span",{key:"76330839b2614611266315bb8b482b6a8571f1f4"},this.resolvedNoDataLabel))))),a("table",{key:"89d9f80c6a0c9963b311d2c121ae0cb0a3289da0",class:this.tableClasses},this.autoThead?a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange},a("sd-thead",{rows:this.rows??[]})):a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange}),this.autoTbody?a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange},a("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&a("div",{key:"02e675535bbdc30ab7177378f1b2b13799a9e5c8",class:"sd-table__pagination"},a("sd-pagination",{key:"83537d5e2f6d5b92e2a4b7dd9e4624372adf0433",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&a("sd-select",{key:"f843f063b736e534b017fd7f881f049c4258c792",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%;max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:var(--table-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:var(--table-container-height, 400px);border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--use-top{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.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--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
+ import{r as t,c as e,a as s,d as i,f as h,h as a,H as n}from"./p-DNWwGHho.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as o,b as d,c,d as u}from"./p-DGyTYauz.js";import"./p-D6GUzecR.js";import"./p-j2khhcHY.js";let b=(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=b(8);fallbackTableId=b(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};useTop=!1;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,h=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===h||(this.scrolledLeft=i,this.scrolledRight=h,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:h}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(h))return;const a=this.vsStart!==i||this.vsEnd!==h;if(!a&&!t)return;this.vsStart=i,this.vsEnd=h;const n=i*this.effectiveRowHeight,r=Math.max(0,(this.rowCount-h)*this.effectiveRowHeight),l=this.queryChildEl("sd-tbody");l?.setSpacersSync?.(n,r),a&&this.sdVirtualUpdate.emit({from:i,to:h}),this.maybeEmitVirtualReachEnd(i,h)}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,h=this.columnWidths[t],a=e=>{const a=this.columns[t];if(null==a)return;const n=a.maxWidth||9999,r=e.clientX-i,l=Math.min(Math.max(h+(s?-r:r),a.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",a),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",a),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],h={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(h.width=`${this.columnWidths[t]}px`,h.minWidth=`${this.columnWidths[t]}px`,h.maxWidth=`${this.columnWidths[t]}px`),h}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():h(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const h=Math.max(1,Math.floor(s||1)),a=Math.max(1,Math.floor(i||1)),n=this.spanKey(t,e),r=this.spanRegistry.get(n);if(1===h&&1===a){if(!r)return;return this.spanRegistry.delete(n),void this.requestAllTrUpdate()}r&&r.rowspan===h&&r.colspan===a||(this.spanRegistry.set(n,{rowspan:h,colspan:a}),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),h=(s??"").trim();""!==h?this.cellClassRegistry.set(i,h):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 h=i[s];if(null==h)continue;const a=this.spanRegistry.get(this.spanKey(t,"string"==typeof h.field?h.field:h.name));if(a&&s+a.colspan>e)return!0}const h=this.resolveRowIndex(t);if(null==h)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const a=t.indexOf("::");if(a<0)continue;const n=t.slice(0,a),r=t.slice(a+2),l=this.resolveRowIndex(n);if(null==l)continue;if(l>=h)continue;if(l+s.rowspan<=h)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))),h=Math.max(0,this.toFiniteNumber(t,0)),a=Math.max(0,this.toFiniteNumber(e,0)),n=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),r=Math.floor(h/s),l=Math.ceil(a/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 a("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=e?`max(${this.height||"96px"}, ${36+this.noDataBodyHeight}px)`:this.height||"100%";return a(n,{key:"4596e04bd57aca00fa6378fd26ce33a06a795eaf",style:{"--table-radius":`${u}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`}},a("div",{key:"11a20d327410b0be659cede32917164e036e796c",class:"sd-table__container",style:{"--table-width":this.width,"--table-height":s,"--table-container-height":`calc(${s} - ${this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0}px)`}},a("div",{key:"f4f3acf584dc4eacdae25b11aa2b62b73ffab949",class:{"sd-table__wrapper":!0,"sd-table__wrapper--use-top":this.useTop}},a("div",{key:"c8ab618b9c990a22b8e9466a5bfb5f02f4de8b12",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&a("div",{key:"a696933a70799ba282fc743281d0af27fd691a2e",class:"sd-table__loading",style:{top:`${this.loadingScrollTop}px`}},a("sd-circle-progress",{key:"cba6ac47367ef6499bf338b9b757ee74fdd7e6c1",indeterminate:!0})),e&&a(a.Fragment,null,a("div",{key:"6e22156bf5b0fb9814d9bf9cad57506758c6284b",class:"sd-table__no-data-header-overlay"}),a("div",{key:"b72f9fabcc8acb8e700ad55acc4d7aff08355a1c",class:"sd-table__no-data"},a("div",{key:"43f271a8803121362f16e8153748328658f073ec",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},a("slot",{key:"4b8533115bbc81962b80c9c2533fe4b44a87193c",name:"no-data"},a("span",{key:"d94c4f7cf9eca7901b99434f712480a7b20c869a"},this.resolvedNoDataLabel))))),a("table",{key:"a9a353aca09124ed8a82fcd2f8a0a7de09b234f5",class:this.tableClasses},this.autoThead?a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange},a("sd-thead",{rows:this.rows??[]})):a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange}),this.autoTbody?a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange},a("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&a("div",{key:"8afeb9398c3d7540a54b9a3660fb9685ae1cddca",class:"sd-table__pagination"},a("sd-pagination",{key:"e2cbb3f7414f65b81ab2d33eaec5d9f28bed6cc8",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&a("sd-select",{key:"ce723544dbc7e4cc0d77ced3b685b8575cf67e6f",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%;max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:var(--table-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:var(--table-container-height, 400px);border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--use-top{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.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--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-DNWwGHho.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,E as n,L as d,a as c,b as a,d as u}from"./p-CxOCk_ge.js";const g=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="선택";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).find((t=>t.value===this.value));return t?.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=g.VIEWPORT_PADDING,s=g.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}),g.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:g.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"08992d05403b6e7ba6aec7968dd6fa99d8857666",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:"3372029d54087654b8172d4d374126c0be703f5c",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"af832319b490501468b05da69eeed964a07f00ea",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:"b6b9211aadd5ef643716948dfa67d6d923420679",...t},i("sd-select-listbox",{key:"9d532180439c8d1867e349d89914626b644ac224",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};g.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const p=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}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(""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>e.label.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(p.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===p.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...p.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:"f2b243788074de1aa3e78a78566a622ab3116351",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:"a9f9f30a43e1965756095e29a24f75b4f1c14100",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"b500f705a69e2c98e3ad79bf04c2bb2a4b8a6162",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"c47e41ebce483ee311cae261b2f4fe21c134e437",option:p.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(p.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(p.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},n):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}]}}};p.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 f=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:"471e6df2948987989fa192474b0305ad0c8bcd32",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":`${u.paddingX}px`,"--trigger-gap":`${u.gap}px`,"--trigger-font-size":`${a.fontSize}px`,"--trigger-line-height":`${a.lineHeight}px`,"--trigger-font-weight":a.fontWeight,"--trigger-color":this.disabled?c.text.disabled:t?c.text.default:c.icon.default,"--trigger-icon-color":this.disabled?c.icon.disabled:c.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:"8133b44065cd4a27d6aa71980c8684c363c7e7ba",class:"sd-select-trigger__content"},i("span",{key:"d8ee3d118cf760b687b491387592efe0c7532cf2",class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"0271061d32f1236346812a21a2e483402a94415c",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};f.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{g as sd_select,p as sd_select_listbox,f as sd_select_trigger}
1
+ import{r as t,c as e,a as s,h as i}from"./p-DNWwGHho.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,E as n,L as c,a as d,b as a,d as u}from"./p-CxOCk_ge.js";const g=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="선택";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).find((t=>t.value===this.value));return t?.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=g.VIEWPORT_PADDING,s=g.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}),g.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:g.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"3c188cbdd8c612e78780d18c03acc382d32080c9",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:"be596d399856ed966408ba1525fea9dbdf8fcc7e",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"f8a29b1ac2469c60af8c7101d05157674566f00f",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:"3cef3f95f69b09d0e4e8f6b01615df4cca031cff",...t},i("sd-select-listbox",{key:"e8833c547aa2e8084754c7a439d3860df5c97e5b",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};g.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const p=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}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(""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>e.label.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(p.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===p.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...p.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:"7505e221ddb890880f0ba5088c3fdc76700e3b2f",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":`${c.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"54b97ad40c5e7abe92b478689d09337843736652",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"f7417f923cc34cbb2c2a56ae70ed54701d013d3d",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"5e8cfcb1f9f0953b9eaa6fc73de992b52a0a23d7",option:p.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(p.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(p.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},n):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}]}}};p.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 f=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:"3a97ed909e3088528714682050a3986081e19433",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":`${u.paddingX}px`,"--trigger-gap":`${u.gap}px`,"--trigger-font-size":`${a.fontSize}px`,"--trigger-line-height":`${a.lineHeight}px`,"--trigger-font-weight":a.fontWeight,"--trigger-color":this.disabled?d.text.disabled:t?d.text.default:d.icon.default,"--trigger-icon-color":this.disabled?d.icon.disabled:d.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:"986faba7d79980f0bcd10fff32495d2100e1805f",class:"sd-select-trigger__content"},i("span",{key:"c51b268186de7cdabcf06ac3d540ccb570c9e865",class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"8a03b400d5aef2e0ca9aeb4b1f6122db2932455a",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};f.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{g as sd_select,p as sd_select_listbox,f as sd_select_trigger}
@@ -1 +1 @@
1
- import{r as t,c as i,a as s,h as e}from"./p-DNWwGHho.js";var h={default:{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",lineHeight:"20"},focus:{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:"400",lineHeight:"20"}},n={default:"#F6F6F6",error:"#FCEFEF",focus:"#FFFFFF"},o={default:"#888888",error:"#E30000",focus:"#555555"},d={focus:"#E1E1E1",width:"1"};const a={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${d.width}px`},r={bg:{default:n.default,error:n.error,focus:n.focus},content:{default:o.default,error:o.error,focus:o.focus},border:{focus:d.focus}},c={default:{fontFamily:h.default.fontFamily,fontSize:`${h.default.fontSize}px`,fontWeight:h.default.fontWeight,lineHeight:`${h.default.lineHeight}px`},focus:{fontFamily:h.focus.fontFamily,fontSize:`${h.focus.fontSize}px`,fontWeight:h.focus.fontWeight,lineHeight:`${h.focus.lineHeight}px`}},l=class{constructor(s){t(this,s),this.update=i(this,"sdUpdate",7),this.delete=i(this,"sdRemove",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get el(){return s(this)}name="";value="";error=!1;disabled=!1;placeholder="";rules=[];internalValue="";isEditing=!1;update;delete;focus;blur;inputEl;draftValue="";shouldInitInput=!1;valueChanged(t){const i=t??"",s=this.isEditing;this.internalValue=i,this.draftValue=i,s&&(this.isEditing=!1,this.shouldInitInput=!1,this.inputEl?.blur(),this.blur.emit())}componentWillLoad(){this.internalValue=this.value??""}componentDidLoad(){this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}async sdValidate(){if(!this.rules||0===this.rules.length)return this.error=!1,!0;for(const t of this.rules)if(!0!==t(this.internalValue??""))return this.error=!0,!1;return this.error=!1,!0}async sdReset(){this.internalValue="",this.value="",this.error=!1,this.draftValue="",this.isEditing=!1,this.shouldInitInput=!1}async sdResetValidate(){this.error=!1}async sdResetValidation(){this.error=!1}async sdFocus(){this.disabled||this.enterEditMode()}async sdGetNativeElement(){return this.inputEl??null}enterEditMode=()=>{this.disabled||this.isEditing||(this.draftValue=this.internalValue,this.shouldInitInput=!0,this.isEditing=!0,this.focus.emit())};commitEdit=async()=>{if(!this.isEditing)return;const t=(this.inputEl?.textContent??this.draftValue).trim(),i=t!==this.draftValue;this.internalValue=t,this.isEditing=!1,this.shouldInitInput=!1,this.value=t,i&&this.update.emit(t),await this.sdValidate(),this.blur.emit()};cancelEdit=()=>{this.isEditing&&(this.internalValue=this.draftValue,this.isEditing=!1,this.shouldInitInput=!1,this.blur.emit())};handleChipClick=()=>{this.disabled||this.isEditing||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),this.cancelEdit())};handleInputBlur=()=>{this.commitEdit()};handlePaste=t=>{t.preventDefault();const i=t.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,i)};handleRemoveClick=t=>{t.stopPropagation(),this.disabled||this.delete.emit()};syncInputValue(t){if(!this.inputEl)return;this.inputEl.textContent=t;const i=document.createRange();i.selectNodeContents(this.inputEl),i.collapse(!1);const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}registerToForm(){const t=this.el.closest("sd-form");t&&"function"==typeof t.componentOnReady&&t.componentOnReady().then((t=>{t.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const t=this.el.closest("sd-form");t?.componentOnReady().then((t=>{t.sdUnregisterField(this)}))}componentDidUpdate(){this.isEditing&&this.inputEl&&this.shouldInitInput&&(this.inputEl.focus(),this.syncInputValue(this.internalValue),this.shouldInitInput=!1)}resolveState(){return this.isEditing?"focus":this.error?"error":"default"}render(){const t=this.resolveState(),i="focus"===t?c.focus:c.default,s={"--sd-chip-height":a.height,"--sd-chip-padding-x":a.paddingX,"--sd-chip-gap":a.gap,"--sd-chip-radius":a.radius,"--sd-chip-border-width":a.borderWidth,"--sd-chip-bg":r.bg[t],"--sd-chip-content":r.content[t],"--sd-chip-border-color":"focus"===t?r.border.focus:"transparent","--sd-chip-font-family":i.fontFamily,"--sd-chip-font-size":i.fontSize,"--sd-chip-font-weight":i.fontWeight,"--sd-chip-line-height":i.lineHeight};return e("span",{key:"0addb8566b639d05921b9320b99abab7f1d67899",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled},role:this.disabled?void 0:"button",tabIndex:this.disabled||this.isEditing?-1:0,"aria-disabled":this.disabled?"true":void 0,style:s,onClick:this.handleChipClick,onKeyDown:this.handleChipKeyDown},this.isEditing?e("span",{key:"chip-input",ref:t=>this.inputEl=t,class:"sd-chip__input",role:"textbox",tabindex:this.disabled?-1:0,contentEditable:!this.disabled,"data-placeholder":this.placeholder,spellcheck:!1,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onBlur:this.handleInputBlur,onPaste:this.handlePaste,onClick:t=>t.stopPropagation()}):[e("span",{key:"chip-label",class:"sd-chip__label"},this.internalValue),!this.disabled&&e("sd-ghost-button",{key:"chip-remove",class:"sd-chip__remove",icon:"close",size:"xxs",ariaLabel:"remove",onClick:this.handleRemoveClick})])}static get watchers(){return{value:[{valueChanged:0}]}}};l.style="sd-chip{display:inline-flex;width:fit-content;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);height:var(--sd-chip-height);padding:0 var(--sd-chip-padding-x);border-radius:var(--sd-chip-radius);background:var(--sd-chip-bg);color:var(--sd-chip-content);border:var(--sd-chip-border-width) solid var(--sd-chip-border-color);font-family:var(--sd-chip-font-family);font-size:var(--sd-chip-font-size);font-weight:var(--sd-chip-font-weight);line-height:var(--sd-chip-line-height);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}sd-chip .sd-chip--editable:not(.sd-chip--focus){cursor:text}sd-chip .sd-chip--disabled{cursor:not-allowed;opacity:0.6}sd-chip .sd-chip__label{display:inline-flex;align-items:center;min-width:0}sd-chip .sd-chip__input{display:inline-block;min-width:1ch;outline:none;background:transparent;color:inherit;font:inherit;white-space:nowrap;cursor:text}sd-chip .sd-chip__input:empty::before{content:attr(data-placeholder);color:inherit;opacity:0.6;pointer-events:none}sd-chip .sd-chip__remove{flex-shrink:0}";export{l as sd_chip}
1
+ import{r as t,c as i,a as s,h as e}from"./p-DNWwGHho.js";var h={default:{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",lineHeight:"20"},focus:{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:"400",lineHeight:"20"}},n={default:"#F6F6F6",error:"#FCEFEF",focus:"#FFFFFF"},o={default:"#888888",error:"#E30000",focus:"#555555"},a={focus:"#E1E1E1",width:"1"};const d={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${a.width}px`},r={bg:{default:n.default,error:n.error,focus:n.focus},content:{default:o.default,error:o.error,focus:o.focus},border:{focus:a.focus}},c={default:{fontFamily:h.default.fontFamily,fontSize:`${h.default.fontSize}px`,fontWeight:h.default.fontWeight,lineHeight:`${h.default.lineHeight}px`},focus:{fontFamily:h.focus.fontFamily,fontSize:`${h.focus.fontSize}px`,fontWeight:h.focus.fontWeight,lineHeight:`${h.focus.lineHeight}px`}},l=class{constructor(s){t(this,s),this.update=i(this,"sdUpdate",7),this.delete=i(this,"sdRemove",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get el(){return s(this)}name="";value="";error=!1;disabled=!1;placeholder="";rules=[];internalValue="";isEditing=!1;update;delete;focus;blur;inputEl;draftValue="";shouldInitInput=!1;valueChanged(t){const i=t??"",s=this.isEditing;this.internalValue=i,this.draftValue=i,s&&(this.isEditing=!1,this.shouldInitInput=!1,this.inputEl?.blur(),this.blur.emit())}componentWillLoad(){this.internalValue=this.value??""}componentDidLoad(){this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}async sdValidate(){if(!this.rules||0===this.rules.length)return this.error=!1,!0;for(const t of this.rules)if(!0!==t(this.internalValue??""))return this.error=!0,!1;return this.error=!1,!0}async sdReset(){this.internalValue="",this.value="",this.error=!1,this.draftValue="",this.isEditing=!1,this.shouldInitInput=!1}async sdResetValidate(){this.error=!1}async sdResetValidation(){this.error=!1}async sdFocus(){this.disabled||this.enterEditMode()}async sdGetNativeElement(){return this.inputEl??null}enterEditMode=()=>{this.disabled||this.isEditing||(this.draftValue=this.internalValue,this.shouldInitInput=!0,this.isEditing=!0,this.focus.emit())};commitEdit=async()=>{if(!this.isEditing)return;const t=(this.inputEl?.textContent??this.draftValue).trim(),i=t!==this.draftValue;this.internalValue=t,this.isEditing=!1,this.shouldInitInput=!1,this.value=t,i&&this.update.emit(t),await this.sdValidate(),this.blur.emit()};cancelEdit=()=>{this.isEditing&&(this.internalValue=this.draftValue,this.isEditing=!1,this.shouldInitInput=!1,this.blur.emit())};handleChipClick=()=>{this.disabled||this.isEditing||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),this.cancelEdit())};handleInputBlur=()=>{this.commitEdit()};handlePaste=t=>{t.preventDefault();const i=t.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,i)};handleRemoveClick=t=>{t.stopPropagation(),this.disabled||this.delete.emit()};syncInputValue(t){if(!this.inputEl)return;this.inputEl.textContent=t;const i=document.createRange();i.selectNodeContents(this.inputEl),i.collapse(!1);const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}registerToForm(){const t=this.el.closest("sd-form");t&&"function"==typeof t.componentOnReady&&t.componentOnReady().then((t=>{t.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const t=this.el.closest("sd-form");t?.componentOnReady().then((t=>{t.sdUnregisterField(this)}))}componentDidUpdate(){this.isEditing&&this.inputEl&&this.shouldInitInput&&(this.inputEl.focus(),this.syncInputValue(this.internalValue),this.shouldInitInput=!1)}resolveState(){return this.isEditing?"focus":this.error?"error":"default"}render(){const t=this.resolveState(),i="focus"===t?c.focus:c.default,s={"--sd-chip-height":d.height,"--sd-chip-padding-x":d.paddingX,"--sd-chip-gap":d.gap,"--sd-chip-radius":d.radius,"--sd-chip-border-width":d.borderWidth,"--sd-chip-bg":r.bg[t],"--sd-chip-content":r.content[t],"--sd-chip-border-color":"focus"===t?r.border.focus:"transparent","--sd-chip-font-family":i.fontFamily,"--sd-chip-font-size":i.fontSize,"--sd-chip-font-weight":i.fontWeight,"--sd-chip-line-height":i.lineHeight};return e("span",{key:"6503611c9cb03be2de4fc09398e2ce1b34b8ab10",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled},role:this.disabled?void 0:"button",tabIndex:this.disabled||this.isEditing?-1:0,"aria-disabled":this.disabled?"true":void 0,style:s,onClick:this.handleChipClick,onKeyDown:this.handleChipKeyDown},this.isEditing?e("span",{key:"chip-input",ref:t=>this.inputEl=t,class:"sd-chip__input",role:"textbox",tabindex:this.disabled?-1:0,contentEditable:!this.disabled,"data-placeholder":this.placeholder,spellcheck:!1,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onBlur:this.handleInputBlur,onPaste:this.handlePaste,onClick:t=>t.stopPropagation()}):[e("span",{key:"chip-label",class:"sd-chip__label"},this.internalValue),!this.disabled&&e("sd-ghost-button",{key:"chip-remove",class:"sd-chip__remove",icon:"close",size:"xxs",ariaLabel:"remove",onClick:this.handleRemoveClick})])}static get watchers(){return{value:[{valueChanged:0}]}}};l.style="sd-chip{display:inline-flex;width:fit-content;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);height:var(--sd-chip-height);padding:0 var(--sd-chip-padding-x);border-radius:var(--sd-chip-radius);background:var(--sd-chip-bg);color:var(--sd-chip-content);border:var(--sd-chip-border-width) solid var(--sd-chip-border-color);font-family:var(--sd-chip-font-family);font-size:var(--sd-chip-font-size);font-weight:var(--sd-chip-font-weight);line-height:var(--sd-chip-line-height);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}sd-chip .sd-chip--editable:not(.sd-chip--focus){cursor:text}sd-chip .sd-chip--disabled{cursor:not-allowed;opacity:0.6}sd-chip .sd-chip__label{display:inline-flex;align-items:center;min-width:0}sd-chip .sd-chip__input{display:inline-block;min-width:1ch;outline:none;background:transparent;color:inherit;font:inherit;white-space:nowrap;cursor:text}sd-chip .sd-chip__input:empty::before{content:attr(data-placeholder);color:inherit;opacity:0.6;pointer-events:none}sd-chip .sd-chip__remove{flex-shrink:0}";export{l as sd_chip}
@@ -1 +1 @@
1
- import{r as i,h as e}from"./p-DNWwGHho.js";const n=class{constructor(e){i(this,e)}visible=!1;message="";async show(i={}){this.message=i.message??"",this.visible=!0}async hide(){this.visible=!1}render(){return e("div",{key:"bae5e9473237c0389d6fb404294abe6897c9847c",class:{"sd-loading-container":!0,"sd-loading-container--visible":this.visible},"aria-hidden":this.visible?"false":"true"},e("div",{key:"d78b4d84c7cd34739452b0ab84df640c94939b2b",class:"sd-loading-container__backdrop"}),e("div",{key:"890c86605412bf67ab878155fd299c2f0b84e375",class:"sd-loading-container__content"},e("sd-circle-progress",{key:"0912c4b7c23700b6ccf8ffdc6b4ce0d67b568320",indeterminate:!0,type:"inverse"}),this.message&&e("p",{key:"373d1765d0a7c24b54bb22e65a8a6a525771ed78",class:"sd-loading-container__message"},this.message)))}};n.style="sd-loading-container .sd-loading-container{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--sd-loading-container-z-index, 999);opacity:0;visibility:hidden;transition:opacity 0.2s ease, visibility 0s linear 0.2s;pointer-events:none}sd-loading-container .sd-loading-container--visible{opacity:1;visibility:visible;transition:opacity 0.2s ease, visibility 0s linear 0s;pointer-events:auto}sd-loading-container .sd-loading-container__backdrop{position:absolute;inset:0;background:rgba(0, 0, 0, 0.4)}sd-loading-container .sd-loading-container__content{position:relative;display:flex;flex-direction:column;align-items:center;gap:16px}sd-loading-container .sd-loading-container__message{margin:0;color:#ffffff;font-size:14px;font-weight:500;line-height:22px;text-align:center;max-width:400px;word-break:keep-all}";export{n as sd_loading_container}
1
+ import{r as i,h as e}from"./p-DNWwGHho.js";const n=class{constructor(e){i(this,e)}visible=!1;message="";async show(i={}){this.message=i.message??"",this.visible=!0}async hide(){this.visible=!1}render(){return e("div",{key:"99c6d9e798862f41142f246f371a357cd604aa44",class:{"sd-loading-container":!0,"sd-loading-container--visible":this.visible},"aria-hidden":this.visible?"false":"true"},e("div",{key:"b836c7d283113e57d0947a178035591521dc8ee2",class:"sd-loading-container__backdrop"}),e("div",{key:"02f1ae9b17eedb29f24d0170c65ef4217f38a5b5",class:"sd-loading-container__content"},e("sd-circle-progress",{key:"3d9c1b33693e823c4c55967d00a63eff8a2a805e",indeterminate:!0,type:"inverse"}),this.message&&e("p",{key:"46c060f444506a9771507b09fd0867f763a95680",class:"sd-loading-container__message"},this.message)))}};n.style="sd-loading-container .sd-loading-container{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--sd-loading-container-z-index, 999);opacity:0;visibility:hidden;transition:opacity 0.2s ease, visibility 0s linear 0.2s;pointer-events:none}sd-loading-container .sd-loading-container--visible{opacity:1;visibility:visible;transition:opacity 0.2s ease, visibility 0s linear 0s;pointer-events:auto}sd-loading-container .sd-loading-container__backdrop{position:absolute;inset:0;background:rgba(0, 0, 0, 0.4)}sd-loading-container .sd-loading-container__content{position:relative;display:flex;flex-direction:column;align-items:center;gap:16px}sd-loading-container .sd-loading-container__message{margin:0;color:#ffffff;font-size:14px;font-weight:500;line-height:22px;text-align:center;max-width:400px;word-break:keep-all}";export{n as sd_loading_container}
@@ -1 +1 @@
1
- import{r as o,c as a,a as d,h as s,H as i}from"./p-DNWwGHho.js";import{s as t}from"./p-DopVneZA.js";import{m as e}from"./p-DOXMJi-V.js";const l={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},n={positive:"notificationOutline",negative:"warningOutline",default:null},m={positive:e.modal.confirm.positive.icon,negative:e.modal.confirm.negative.icon,default:""},r=Number(e.modal.confirm.title.icon),c=class{constructor(d){o(this,d),this.close=a(this,"sdClose",7),this.cancel=a(this,"sdCancel",7),this.ok=a(this,"sdOk",7)}get el(){return d(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??l[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=n[o],d=m[o];return s("div",{key:"f9a1d63c1cd047969c72d0e71ccd3b1cf30bac15",class:"sd-confirm-modal"},s("sd-ghost-button",{key:"8f1e4ec22a12ad9347c8c8c843f6dbb91591b289",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),a&&s("sd-icon",{key:"8adada47e2dc0a6677cdf004ca8cad8794123d03",class:"sd-confirm-modal__icon",name:a,size:r,color:d}),s("h2",{key:"ddc0636d2cd8333aa0d5a3f242dbf2d57759fc5b",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),s("div",{key:"66d4c779f4269824937306ca34a0b51e6208d03f",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&s("div",{key:"87634b26cba0fb24115f0cd59fcc7956f9fde53c",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((o=>s("p",{class:"sd-confirm-modal__message-text",innerHTML:t(o)})))),this.showContentBox&&s("div",{key:"0b495d1393cf029e8b07f9041c51e344ff7cb5da",class:"sd-confirm-modal__content-box"},this.tagContents?s("div",{class:"sd-confirm-modal__custom-content",ref:o=>{this.customContentRef=o}}):s("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&s("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&s("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&s("div",{key:"09d34f47a466e4277f1bb2215a3b087bc78e240d",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((o=>s("p",{class:"sd-confirm-modal__message-text",innerHTML:t(o)}))))),s("div",{key:"2a62193311791f84b6eca22a49cff8a0fc65d5a7",class:"sd-confirm-modal__button"},this.subButtonLabel&&s("sd-button",{key:"4c800376dec7ca035b2aaaaac00738851829108d",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),s("sd-button",{key:"dcb473b7b6ce29983d89df6c288526071962ac01",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(e.modal.loading.width),minHeight:Number(e.modal.loading.height),gap:Number(e.modal.loading.gap),contentSize:Number(e.modal.loading.content),radius:Number(e.modal.radius)},h={bg:e.modal.bg,messageColor:e.modal.loading.message.color,errorIcon:e.modal.confirm.negative.icon},f=e.modal.loading.message.typography.fontFamily,b=Number(e.modal.loading.message.typography.fontSize),p=Number(e.modal.loading.message.typography.fontWeight),u=Number(e.modal.loading.message.typography.lineHeight),_={loading:"작업을 진행하고 있습니다. 잠시만 기다려 주세요.",error:"작업에 실패하였습니다. 다시 시도해 주세요."},v={loading:"작업 취소",error:"다시 시도"},y=class{constructor(d){o(this,d),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]}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 s(i,{key:"f14baf774d5d8547158a84bc3948035e69e022b5",style:o},s("div",{key:"f441c9718abd608c687e92884fbbefb6030610f4",class:"sd-loading-modal"},s("div",{key:"9e7a73f9f35fc800326ffd809058ae23a5b60688",class:"sd-loading-modal__content"},"loading"===this.resolvedState?s("sd-circle-progress",void 0!==this.progress?{value:this.progress}:{indeterminate:!0}):s("sd-icon",{class:"sd-loading-modal__icon",name:"warningOutline",size:g.contentSize,color:h.errorIcon})),s("div",{key:"1d468a2ad713efa5162648868b6c137255834a39",class:"sd-loading-modal__message-wrapper"},Array.isArray(this.resolvedMessage)?this.resolvedMessage.map((o=>s("p",{class:"sd-loading-modal__message"},o))):s("p",{class:"sd-loading-modal__message"},this.resolvedMessage)),this.useButton&&s("div",{key:"75a88c01cd7df4953c766cb71a7cf89a150de65e",class:"sd-loading-modal__button"},s("sd-button",{key:"bdd17775f1b57e140cc09f7a79835ca10693ceff",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
+ import{r as o,c as a,a as d,h as s,H as e}from"./p-DNWwGHho.js";import{s as i}from"./p-DopVneZA.js";import{m as t}from"./p-DOXMJi-V.js";const l={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},n={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(d){o(this,d),this.close=a(this,"sdClose",7),this.cancel=a(this,"sdCancel",7),this.ok=a(this,"sdOk",7)}get el(){return d(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??l[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=n[o],d=m[o];return s("div",{key:"c41a58f13b95da7f1f0aea3620abf239dcb116b6",class:"sd-confirm-modal"},s("sd-ghost-button",{key:"bdc1bc374934c2f9745f567b4e6ffd55ec3675ce",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),a&&s("sd-icon",{key:"ff16ebde448157e657eb74e1b0c5f4a331cf396a",class:"sd-confirm-modal__icon",name:a,size:r,color:d}),s("h2",{key:"d718b2ae6f6e92f8c77ec821b78924ffbe267d12",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),s("div",{key:"a3909abde84c4d6987c9036a705cba4aa7d01ea6",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&s("div",{key:"29a4bf80ab75d973544c0a29c87133c9ef8a5aab",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((o=>s("p",{class:"sd-confirm-modal__message-text",innerHTML:i(o)})))),this.showContentBox&&s("div",{key:"93eb2c75728cf26969a229a876f9217b4e00c63a",class:"sd-confirm-modal__content-box"},this.tagContents?s("div",{class:"sd-confirm-modal__custom-content",ref:o=>{this.customContentRef=o}}):s("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&s("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&s("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&s("div",{key:"730fd073ade9b8788de77d36fc4aeddd0b304c07",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((o=>s("p",{class:"sd-confirm-modal__message-text",innerHTML:i(o)}))))),s("div",{key:"059fd87fb39b8e2976fcb671c7dd78310324119f",class:"sd-confirm-modal__button"},this.subButtonLabel&&s("sd-button",{key:"6b320645505c099783a4a6704e96e9261054c7dc",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),s("sd-button",{key:"d6a4554a7db861ae7afc610a629591224946d990",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(d){o(this,d),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]}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 s(e,{key:"e1161a16a56cddedc8e4bb76370bdf456d90e15a",style:o},s("div",{key:"e01979e4636465afa4b960ffdb9722f645386dca",class:"sd-loading-modal"},s("div",{key:"1c1ecc05d20f58084c0d6f8048b17cd84f446edb",class:"sd-loading-modal__content"},"loading"===this.resolvedState?s("sd-circle-progress",void 0!==this.progress?{value:this.progress}:{indeterminate:!0}):s("sd-icon",{class:"sd-loading-modal__icon",name:"warningOutline",size:g.contentSize,color:h.errorIcon})),s("div",{key:"6793b86562b67699c59fd83fb0d6ee7378f6d991",class:"sd-loading-modal__message-wrapper"},Array.isArray(this.resolvedMessage)?this.resolvedMessage.map((o=>s("p",{class:"sd-loading-modal__message"},o))):s("p",{class:"sd-loading-modal__message"},this.resolvedMessage)),this.useButton&&s("div",{key:"75036f7d88be636987de2fe999c00d338fa352d5",class:"sd-loading-modal__button"},s("sd-button",{key:"91f30470702df2be7256d451cc80d27e86510d2e",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 e,c as a,h as d}from"./p-DNWwGHho.js";import{u as r,t as n,W as t,C as i}from"./p-BGtUaScP.js";import{a as l,D as s}from"./p-TF8_Lyhq.js";import"./p-BQn6le_Y.js";const c=class{constructor(d){e(this,d),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=r();_eventMapCache;get eventMap(){const e=this._eventMapCache;if(e&&e.src===this.events)return e.map;const a=new Map;return(this.events??[]).forEach((e=>e.dates.forEach((d=>{const r=a.get(d)??[];r.push({color:e.color,label:e.label}),a.set(d,r)})))),this._eventMapCache={src:this.events,map:a},a}get legendItems(){const e=new Set,a=[];return(this.events??[]).forEach((d=>{const r=`${d.color}|${d.label}`;e.has(r)||(e.add(r),a.push({color:d.color,label:d.label}))})),a}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const e=this.value||n,[a,d]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=d}formatDate(e,a,d){return`${e}-${String(a).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const e=this.currentYear,a=this.currentMonth,d=new Date(e,a-1,1).getDay(),r=new Date(e,a,0).getDate(),n=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,n,0).getDate(),l=12===a?1:a+1,s=12===a?e+1:e,c=[];for(let e=d-1;e>=0;e--){const a=i-e;c.push({date:this.formatDate(t,n,a),day:a,inCurrentMonth:!1})}for(let d=1;d<=r;d++)c.push({date:this.formatDate(e,a,d),day:d,inCurrentMonth:!0});const o=(7-c.length%7)%7;for(let e=1;e<=o;e++)c.push({date:this.formatDate(s,l,e),day:e,inCurrentMonth:!1});return c}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};isDisabled(e){if(!this.selectable)return!1;const[a,d]=this.selectable;return""!==a&&e<a||""!==d&&e>d}handleDayClick(e){this.isDisabled(e.date)||(this.value=e.date,this.update.emit(e.date))}render(){const e={"--calendar-bg":i.bg,"--calendar-padding":`${i.paddingXY}px`,"--calendar-gap":`${i.gap}px`,"--calendar-radius":`${i.radius}px`,"--calendar-header-gap":`${i.header.gap}px`,"--calendar-header-divider":i.header.divider,"--calendar-header-font-size":`${i.header.fontSize}px`,"--calendar-header-line-height":`${i.header.lineHeight}px`,"--calendar-header-font-weight":i.header.fontWeight,"--calendar-week-font-size":`${i.week.fontSize}px`,"--calendar-week-line-height":`${i.week.lineHeight}px`,"--calendar-week-font-weight":i.week.fontWeight,"--calendar-week-color":i.week.color,"--calendar-grid-row-gap":`${i.grid.rowGap}px`,"--calendar-day-size":`${i.day.size}px`,"--calendar-day-circle-size":`${i.day.circleSize}px`,"--calendar-day-circle-radius":`${i.day.circleRadius}px`,"--calendar-day-text":i.day.defaultText,"--calendar-day-hover-text":i.day.hoverText,"--calendar-day-hover-border":i.day.hoverBorder,"--calendar-day-select-bg":i.day.selectBg,"--calendar-day-select-text":i.day.selectText,"--calendar-day-disabled-text":i.day.disabledText,"--calendar-day-font-size":`${i.day.fontSize}px`,"--calendar-day-line-height":`${i.day.lineHeight}px`,"--calendar-day-font-weight":i.day.fontWeight,"--calendar-day-bold-font-weight":i.day.boldFontWeight,"--calendar-day-dot-size":`${i.day.dot.size}px`,"--calendar-day-dot-gap":`${i.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${i.day.dot.paddingY}px`,"--calendar-legend-font-size":`${i.legend.fontSize}px`,"--calendar-legend-line-height":`${i.legend.lineHeight}px`,"--calendar-legend-font-weight":i.legend.fontWeight,"--calendar-legend-gap":`${i.legend.gap}px`,"--calendar-legend-group-gap":`${i.legend.groupGap}px`},a=this.eventMap,r=this.legendItems,l=(this.events?.length??0)>0;return d("div",{key:"0ed0317b3cecffea4015de8688888e0ab2a38586",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:e},d("div",{key:"b915f275a31617711d06d98c8a4d9369ddd36af5",class:"sd-calendar__header"},d("div",{key:"cd3b625e4e26af4b11f6af8b22c02099e8ab68a5",class:"sd-calendar__nav-group"},d("sd-ghost-button",{key:"e0ebfed48a7fdb61fd082371e7247176c02a8fb1",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),d("span",{key:"6bfebc94dce54ca472ad5b3e03a7630e32676c3f",class:"sd-calendar__label"},this.currentYear),d("sd-ghost-button",{key:"2e42ad52cd7d1b5d3502d578347c997910f3efc3",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),d("span",{key:"95be4ab5e03d7378e82006221f190ffd55659cf1",class:"sd-calendar__divider","aria-hidden":"true"}),d("div",{key:"edce7cf91a873cdaeed68e50372bdfa20af7507d",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},d("sd-ghost-button",{key:"9ba274e9db32177d30d8c218303384855b7a3f60",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),d("span",{key:"bc113063e769fe12c2a39732cd82060752b7d9eb",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),d("sd-ghost-button",{key:"52cfde203e06334c5eee85abc9d82d6889bf511c",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),d("div",{key:"9ae80aee03a4e6392a1d9a4ef28e565db20faea3",class:"sd-calendar__week"},t.map((e=>d("span",{key:e,class:"sd-calendar__week-cell"},e)))),d("div",{key:"7c47907311ea24f1af030931b8efd11955e55436",class:"sd-calendar__grid"},this.cells.map((e=>{const r=e.inCurrentMonth&&""!==this.value&&this.value===e.date,t=e.inCurrentMonth&&n===e.date,i=e.inCurrentMonth&&this.isDisabled(e.date),s=e.inCurrentMonth?a.get(e.date):void 0;return d("button",{type:"button",key:e.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!e.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":r,"sd-calendar__day--disabled":i},disabled:!e.inCurrentMonth||i,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>e.inCurrentMonth&&this.handleDayClick(e)},d("span",{class:"sd-calendar__day-circle"},e.inCurrentMonth?e.day:""),l&&d("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},s?.map(((e,a)=>d("span",{key:`${e.color}|${e.label}|${a}`,class:"sd-calendar__dot",style:{backgroundColor:e.color}})))))}))),r.length>0&&[d("span",{key:"4ba064cad3188db8342f51ca017e4bf5af8aa460",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),d("div",{key:"ac132a1f1f948e618ee75d4c01a1c99a0dfc2c0a",class:"sd-calendar__legend"},r.map((e=>d("span",{key:`${e.color}|${e.label}`,class:"sd-calendar__legend-item"},d("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:e.color},"aria-hidden":"true"}),d("span",{class:"sd-calendar__legend-label"},e.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}";const o=class{constructor(d){e(this,d),this.triggerClick=a(this,"sdTriggerClick",7)}displayText="";placeholder="YYYY-MM-DD";disabled=!1;size="sm";triggerClick;handleClick=()=>{this.disabled||this.triggerClick.emit()};render(){const e=l[this.size]??l.sm,a=""!==this.displayText;return d("div",{key:"df53dd75ead71167d7089daab5718c7ff1c990ae",role:"button",tabindex:this.disabled?-1:0,class:{"sd-date-picker-trigger":!0,"sd-date-picker-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${e.paddingX}px`,"--trigger-gap":`${e.gap}px`,"--trigger-icon-size":`${e.iconSize}px`,"--trigger-font-size":`${e.fontSize}px`,"--trigger-line-height":`${e.lineHeight}px`,"--trigger-font-weight":e.fontWeight,"--trigger-radius":`${e.radius}px`,"--trigger-text-min-width":("md"===this.size?104:80)+"px","--trigger-text-color":this.disabled?s.text.disabled:a?s.text.default:s.text.hint,"--trigger-icon-color":this.disabled?s.icon.disabled:s.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},d("sd-icon",{key:"76f41c99e1695eaa191cbc81ae057e65cb78e955",name:"date",size:Number(e.iconSize),color:"var(--trigger-icon-color)",class:"sd-date-picker-trigger__icon"}),d("span",{key:"4e1a4b2b41737f05dc1a4e642d317f5fc93bf9b2",class:"sd-date-picker-trigger__text"},a?this.displayText:this.placeholder))}};o.style="sd-date-picker-trigger{display:block;width:100%;height:100%}sd-date-picker-trigger .sd-date-picker-trigger{display:flex;align-items:center;gap:var(--trigger-gap);width:100%;height:100%;padding:0 var(--trigger-padding-x);cursor:pointer;user-select:none;overflow:hidden;border-radius:var(--trigger-radius)}sd-date-picker-trigger .sd-date-picker-trigger--disabled{cursor:not-allowed}sd-date-picker-trigger .sd-date-picker-trigger__icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}sd-date-picker-trigger .sd-date-picker-trigger__text{flex:1;min-width:var(--trigger-text-min-width, 80px);font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}";export{c as sd_calendar,o as sd_date_picker_trigger}
1
+ import{r as e,c as a,h as d}from"./p-DNWwGHho.js";import{u as r,t as n,W as t,C as i}from"./p-BGtUaScP.js";import{a as l,D as s}from"./p-TF8_Lyhq.js";import"./p-BQn6le_Y.js";const c=class{constructor(d){e(this,d),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=r();_eventMapCache;get eventMap(){const e=this._eventMapCache;if(e&&e.src===this.events)return e.map;const a=new Map;return(this.events??[]).forEach((e=>e.dates.forEach((d=>{const r=a.get(d)??[];r.push({color:e.color,label:e.label}),a.set(d,r)})))),this._eventMapCache={src:this.events,map:a},a}get legendItems(){const e=new Set,a=[];return(this.events??[]).forEach((d=>{const r=`${d.color}|${d.label}`;e.has(r)||(e.add(r),a.push({color:d.color,label:d.label}))})),a}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const e=this.value||n,[a,d]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=d}formatDate(e,a,d){return`${e}-${String(a).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const e=this.currentYear,a=this.currentMonth,d=new Date(e,a-1,1).getDay(),r=new Date(e,a,0).getDate(),n=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,n,0).getDate(),l=12===a?1:a+1,s=12===a?e+1:e,c=[];for(let e=d-1;e>=0;e--){const a=i-e;c.push({date:this.formatDate(t,n,a),day:a,inCurrentMonth:!1})}for(let d=1;d<=r;d++)c.push({date:this.formatDate(e,a,d),day:d,inCurrentMonth:!0});const o=(7-c.length%7)%7;for(let e=1;e<=o;e++)c.push({date:this.formatDate(s,l,e),day:e,inCurrentMonth:!1});return c}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};isDisabled(e){if(!this.selectable)return!1;const[a,d]=this.selectable;return""!==a&&e<a||""!==d&&e>d}handleDayClick(e){this.isDisabled(e.date)||(this.value=e.date,this.update.emit(e.date))}render(){const e={"--calendar-bg":i.bg,"--calendar-padding":`${i.paddingXY}px`,"--calendar-gap":`${i.gap}px`,"--calendar-radius":`${i.radius}px`,"--calendar-header-gap":`${i.header.gap}px`,"--calendar-header-divider":i.header.divider,"--calendar-header-font-size":`${i.header.fontSize}px`,"--calendar-header-line-height":`${i.header.lineHeight}px`,"--calendar-header-font-weight":i.header.fontWeight,"--calendar-week-font-size":`${i.week.fontSize}px`,"--calendar-week-line-height":`${i.week.lineHeight}px`,"--calendar-week-font-weight":i.week.fontWeight,"--calendar-week-color":i.week.color,"--calendar-grid-row-gap":`${i.grid.rowGap}px`,"--calendar-day-size":`${i.day.size}px`,"--calendar-day-circle-size":`${i.day.circleSize}px`,"--calendar-day-circle-radius":`${i.day.circleRadius}px`,"--calendar-day-text":i.day.defaultText,"--calendar-day-hover-text":i.day.hoverText,"--calendar-day-hover-border":i.day.hoverBorder,"--calendar-day-select-bg":i.day.selectBg,"--calendar-day-select-text":i.day.selectText,"--calendar-day-disabled-text":i.day.disabledText,"--calendar-day-font-size":`${i.day.fontSize}px`,"--calendar-day-line-height":`${i.day.lineHeight}px`,"--calendar-day-font-weight":i.day.fontWeight,"--calendar-day-bold-font-weight":i.day.boldFontWeight,"--calendar-day-dot-size":`${i.day.dot.size}px`,"--calendar-day-dot-gap":`${i.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${i.day.dot.paddingY}px`,"--calendar-legend-font-size":`${i.legend.fontSize}px`,"--calendar-legend-line-height":`${i.legend.lineHeight}px`,"--calendar-legend-font-weight":i.legend.fontWeight,"--calendar-legend-gap":`${i.legend.gap}px`,"--calendar-legend-group-gap":`${i.legend.groupGap}px`},a=this.eventMap,r=this.legendItems,l=(this.events?.length??0)>0;return d("div",{key:"d85abe861103677565ff172def182761255eee97",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:e},d("div",{key:"2d087beb6f61c1545c61c040d7266eb809c59c56",class:"sd-calendar__header"},d("div",{key:"90b85428cd8f22aac7f0d8915a0fb0fc1ba0fd0f",class:"sd-calendar__nav-group"},d("sd-ghost-button",{key:"6a5b6c35489eeeae6d2fca4a96a77755b5d48c5a",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),d("span",{key:"b00bab4993fb6f57bf1c6e8fd02243b8cbab8007",class:"sd-calendar__label"},this.currentYear),d("sd-ghost-button",{key:"1ed1ea634a311b429c6e2053c22e1d043d34aa82",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),d("span",{key:"1d471e12d7e5a48998b33ef6c3b7208c2fff1796",class:"sd-calendar__divider","aria-hidden":"true"}),d("div",{key:"07e70fb3696cfe6bcf2253c0ead87fead96ad04e",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},d("sd-ghost-button",{key:"c8401e8f8a1018eec46d9ee9857e8aa64235fff5",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),d("span",{key:"3ceaa4a07a45eb16c43ed70e953f4540c2554ae9",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),d("sd-ghost-button",{key:"6dd7c2c29159e549e2294141726b39c0ad559634",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),d("div",{key:"623928bc8970c2746f3d924a4ae36149ce7d21f7",class:"sd-calendar__week"},t.map((e=>d("span",{key:e,class:"sd-calendar__week-cell"},e)))),d("div",{key:"5ab1f7042906eb7542f4effa35c0c9992ded34dc",class:"sd-calendar__grid"},this.cells.map((e=>{const r=e.inCurrentMonth&&""!==this.value&&this.value===e.date,t=e.inCurrentMonth&&n===e.date,i=e.inCurrentMonth&&this.isDisabled(e.date),s=e.inCurrentMonth?a.get(e.date):void 0;return d("button",{type:"button",key:e.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!e.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":r,"sd-calendar__day--disabled":i},disabled:!e.inCurrentMonth||i,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>e.inCurrentMonth&&this.handleDayClick(e)},d("span",{class:"sd-calendar__day-circle"},e.inCurrentMonth?e.day:""),l&&d("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},s?.map(((e,a)=>d("span",{key:`${e.color}|${e.label}|${a}`,class:"sd-calendar__dot",style:{backgroundColor:e.color}})))))}))),r.length>0&&[d("span",{key:"9d3f938ca0ac1d48ec6189a6b9f7598c06dbaf13",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),d("div",{key:"1b5a55959212257085707478d7d0a358dc355403",class:"sd-calendar__legend"},r.map((e=>d("span",{key:`${e.color}|${e.label}`,class:"sd-calendar__legend-item"},d("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:e.color},"aria-hidden":"true"}),d("span",{class:"sd-calendar__legend-label"},e.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}";const o=class{constructor(d){e(this,d),this.triggerClick=a(this,"sdTriggerClick",7)}displayText="";placeholder="YYYY-MM-DD";disabled=!1;size="sm";triggerClick;handleClick=()=>{this.disabled||this.triggerClick.emit()};render(){const e=l[this.size]??l.sm,a=""!==this.displayText;return d("div",{key:"8a41444172b2d9aa54fa6efe09c4440705d55e06",role:"button",tabindex:this.disabled?-1:0,class:{"sd-date-picker-trigger":!0,"sd-date-picker-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${e.paddingX}px`,"--trigger-gap":`${e.gap}px`,"--trigger-icon-size":`${e.iconSize}px`,"--trigger-font-size":`${e.fontSize}px`,"--trigger-line-height":`${e.lineHeight}px`,"--trigger-font-weight":e.fontWeight,"--trigger-radius":`${e.radius}px`,"--trigger-text-min-width":("md"===this.size?104:80)+"px","--trigger-text-color":this.disabled?s.text.disabled:a?s.text.default:s.text.hint,"--trigger-icon-color":this.disabled?s.icon.disabled:s.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},d("sd-icon",{key:"74613a1b65814a1f73d00c67d7c1f01019961511",name:"date",size:Number(e.iconSize),color:"var(--trigger-icon-color)",class:"sd-date-picker-trigger__icon"}),d("span",{key:"118733548ddee2bc20ccdc92785ada3bbc765303",class:"sd-date-picker-trigger__text"},a?this.displayText:this.placeholder))}};o.style="sd-date-picker-trigger{display:block;width:100%;height:100%}sd-date-picker-trigger .sd-date-picker-trigger{display:flex;align-items:center;gap:var(--trigger-gap);width:100%;height:100%;padding:0 var(--trigger-padding-x);cursor:pointer;user-select:none;overflow:hidden;border-radius:var(--trigger-radius)}sd-date-picker-trigger .sd-date-picker-trigger--disabled{cursor:not-allowed}sd-date-picker-trigger .sd-date-picker-trigger__icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}sd-date-picker-trigger .sd-date-picker-trigger__text{flex:1;min-width:var(--trigger-text-min-width, 80px);font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}";export{c as sd_calendar,o as sd_date_picker_trigger}