@sellmate/design-system 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cjs/design-system.cjs.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sd-calendar_2.cjs.entry.js +2 -2
  4. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +1 -1
  5. package/dist/cjs/sd-date-picker_7.cjs.entry.js +9 -9
  6. package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
  7. package/dist/cjs/sd-divider.cjs.entry.js +1 -1
  8. package/dist/cjs/sd-field_3.cjs.entry.js +9 -12
  9. package/dist/cjs/sd-ghost-button_3.cjs.entry.js +11 -3
  10. package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
  11. package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
  12. package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
  13. package/dist/cjs/sd-popup.cjs.entry.js +1 -1
  14. package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
  15. package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
  16. package/dist/cjs/sd-switch.cjs.entry.js +1 -1
  17. package/dist/cjs/sd-table.cjs.entry.js +6 -6
  18. package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
  19. package/dist/cjs/sd-td.cjs.entry.js +1 -1
  20. package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
  21. package/dist/cjs/sd-toast.cjs.entry.js +2 -2
  22. package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
  23. package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
  24. package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
  25. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
  26. package/dist/collection/components/sd-divider/sd-divider.js +1 -1
  27. package/dist/collection/components/sd-field/sd-field.js +6 -9
  28. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  29. package/dist/collection/components/sd-input/sd-input.js +2 -2
  30. package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
  31. package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
  32. package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
  33. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  34. package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
  35. package/dist/collection/components/sd-popup/sd-popup.js +1 -1
  36. package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
  37. package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
  38. package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
  39. package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
  40. package/dist/collection/components/sd-select/sd-select.js +4 -4
  41. package/dist/collection/components/sd-switch/sd-switch.js +1 -1
  42. package/dist/collection/components/sd-table/sd-table.js +6 -6
  43. package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
  44. package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
  45. package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
  46. package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
  47. package/dist/collection/components/sd-tag/sd-tag.css +2 -1
  48. package/dist/collection/components/sd-tag/sd-tag.js +31 -3
  49. package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
  50. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  51. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  52. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  53. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  54. package/dist/components/{p--qAfho9a.js → p-0UeArSzN.js} +1 -1
  55. package/dist/components/{p-BvJuT-H0.js → p-1kjTqHez.js} +1 -1
  56. package/dist/components/{p-BlN03Cqm.js → p-B4ua22vZ.js} +1 -1
  57. package/dist/components/{p-CqivNcjh.js → p-BAIi5T00.js} +1 -1
  58. package/dist/components/{p-BQHbIUbt.js → p-BCLDTSO0.js} +1 -1
  59. package/dist/components/{p-PMD-Col0.js → p-BGIwu6m1.js} +1 -1
  60. package/dist/components/{p-DMvWCQfX.js → p-BOrdn-Js.js} +1 -1
  61. package/dist/components/{p-B8uvCE1e.js → p-BTWV2vRX.js} +1 -1
  62. package/dist/components/{p-BuuIkYiY.js → p-Bv_CVYp1.js} +1 -1
  63. package/dist/components/{p-CnEZJlEp.js → p-BwwpMQLA.js} +1 -1
  64. package/dist/components/{p-0U99W-3Z.js → p-C1vqL1Kl.js} +1 -1
  65. package/dist/components/{p-CtNDxhxx.js → p-C7sPq8UM.js} +1 -1
  66. package/dist/components/p-C7sUn4qb.js +1 -0
  67. package/dist/components/{p-Bls7CCxZ.js → p-CA2sZAsI.js} +1 -1
  68. package/dist/components/{p-BAsjJuJJ.js → p-CFqCJx9B.js} +1 -1
  69. package/dist/components/{p-lGr865w2.js → p-D0Xz7CoK.js} +1 -1
  70. package/dist/components/{p-DpHtcEDP.js → p-D15bTkjr.js} +1 -1
  71. package/dist/components/{p-BZUlNC0d.js → p-DPotN1QM.js} +1 -1
  72. package/dist/components/{p-DBw58vNP.js → p-DU2_jzh4.js} +1 -1
  73. package/dist/components/{p-BGpxtouI.js → p-DsGK3Aye.js} +1 -1
  74. package/dist/components/{p-DpYG9T3S.js → p-DznzJSU-.js} +1 -1
  75. package/dist/components/{p-BoH7ykYx.js → p-IBgCA-vo.js} +1 -1
  76. package/dist/components/{p-CNwoxvpg.js → p-JamWHNrr.js} +1 -1
  77. package/dist/components/p-UkSGSWSA.js +1 -0
  78. package/dist/components/{p-h9_f4fUW.js → p-aYmWxyum.js} +1 -1
  79. package/dist/components/{p-d3KpOGRC.js → p-tSYcqBKN.js} +1 -1
  80. package/dist/components/{p-DFp9nJnT.js → p-zGr4He38.js} +1 -1
  81. package/dist/components/sd-action-modal.js +1 -1
  82. package/dist/components/sd-barcode-input.js +1 -1
  83. package/dist/components/sd-calendar.js +1 -1
  84. package/dist/components/sd-chip-input.js +1 -1
  85. package/dist/components/sd-chip.js +1 -1
  86. package/dist/components/sd-confirm-modal.js +1 -1
  87. package/dist/components/sd-date-picker-trigger.js +1 -1
  88. package/dist/components/sd-date-picker.js +1 -1
  89. package/dist/components/sd-date-range-picker-calendar.js +1 -1
  90. package/dist/components/sd-date-range-picker.js +1 -1
  91. package/dist/components/sd-divider.js +1 -1
  92. package/dist/components/sd-field.js +1 -1
  93. package/dist/components/sd-file-picker.js +1 -1
  94. package/dist/components/sd-floating-portal.js +1 -1
  95. package/dist/components/sd-ghost-button.js +1 -1
  96. package/dist/components/sd-guide.js +1 -1
  97. package/dist/components/sd-input.js +1 -1
  98. package/dist/components/sd-key-value-table.js +1 -1
  99. package/dist/components/sd-linear-progress.js +1 -1
  100. package/dist/components/sd-loading-container.js +1 -1
  101. package/dist/components/sd-loading-modal.js +1 -1
  102. package/dist/components/sd-modal-container.js +1 -1
  103. package/dist/components/sd-number-input.js +1 -1
  104. package/dist/components/sd-pagination.js +1 -1
  105. package/dist/components/sd-popover.js +1 -1
  106. package/dist/components/sd-popup.js +1 -1
  107. package/dist/components/sd-select-list-item-search.js +1 -1
  108. package/dist/components/sd-select-list-item.js +1 -1
  109. package/dist/components/sd-select-listbox.js +1 -1
  110. package/dist/components/sd-select-trigger.js +1 -1
  111. package/dist/components/sd-select.js +1 -1
  112. package/dist/components/sd-switch.js +1 -1
  113. package/dist/components/sd-table.js +1 -1
  114. package/dist/components/sd-tabs.js +1 -1
  115. package/dist/components/sd-tag.js +1 -1
  116. package/dist/components/sd-tbody.js +1 -1
  117. package/dist/components/sd-td.js +1 -1
  118. package/dist/components/sd-text-link.js +1 -1
  119. package/dist/components/sd-textarea.js +1 -1
  120. package/dist/components/sd-thead.js +1 -1
  121. package/dist/components/sd-toast-container.js +1 -1
  122. package/dist/components/sd-toast.js +1 -1
  123. package/dist/components/sd-toggle.js +1 -1
  124. package/dist/components/sd-tooltip.js +1 -1
  125. package/dist/design-system/design-system.esm.js +1 -1
  126. package/dist/design-system/{p-9ea2fbec.entry.js → p-065cd2f4.entry.js} +1 -1
  127. package/dist/design-system/p-28e1cf94.entry.js +1 -0
  128. package/dist/design-system/{p-cb63d4cf.entry.js → p-2c704047.entry.js} +1 -1
  129. package/dist/design-system/{p-43d521c4.entry.js → p-4d747082.entry.js} +1 -1
  130. package/dist/design-system/{p-74e605c0.entry.js → p-4deb11d8.entry.js} +1 -1
  131. package/dist/design-system/p-681f8612.entry.js +1 -0
  132. package/dist/design-system/{p-9afc1f7c.entry.js → p-79d85b32.entry.js} +1 -1
  133. package/dist/design-system/{p-8862e3e3.entry.js → p-7c22de74.entry.js} +1 -1
  134. package/dist/design-system/{p-3b71d1d4.entry.js → p-8b4d246f.entry.js} +1 -1
  135. package/dist/design-system/{p-b4df75b9.entry.js → p-8da06c09.entry.js} +1 -1
  136. package/dist/design-system/{p-5a67c40d.entry.js → p-940de4ba.entry.js} +1 -1
  137. package/dist/design-system/{p-a1438f7d.entry.js → p-9c3f7c57.entry.js} +1 -1
  138. package/dist/design-system/{p-a8d69ab2.entry.js → p-a992c64b.entry.js} +1 -1
  139. package/dist/design-system/{p-21d8f192.entry.js → p-b127ac21.entry.js} +1 -1
  140. package/dist/design-system/{p-6f77fc76.entry.js → p-ba10c791.entry.js} +1 -1
  141. package/dist/design-system/{p-f1e0ba30.entry.js → p-bd700588.entry.js} +1 -1
  142. package/dist/design-system/p-c3b032a1.entry.js +1 -0
  143. package/dist/design-system/{p-6b20c76b.entry.js → p-d8bebc8e.entry.js} +1 -1
  144. package/dist/design-system/{p-a505459f.entry.js → p-dca19618.entry.js} +1 -1
  145. package/dist/design-system/{p-c0198e3a.entry.js → p-e45e6e56.entry.js} +1 -1
  146. package/dist/esm/design-system.js +1 -1
  147. package/dist/esm/loader.js +1 -1
  148. package/dist/esm/sd-calendar_2.entry.js +2 -2
  149. package/dist/esm/sd-confirm-modal_2.entry.js +1 -1
  150. package/dist/esm/sd-date-picker_7.entry.js +9 -9
  151. package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
  152. package/dist/esm/sd-divider.entry.js +1 -1
  153. package/dist/esm/sd-field_3.entry.js +9 -12
  154. package/dist/esm/sd-ghost-button_3.entry.js +12 -4
  155. package/dist/esm/sd-linear-progress.entry.js +1 -1
  156. package/dist/esm/sd-loading-container.entry.js +2 -2
  157. package/dist/esm/sd-pagination_4.entry.js +8 -8
  158. package/dist/esm/sd-popup.entry.js +1 -1
  159. package/dist/esm/sd-select-list-item_2.entry.js +6 -6
  160. package/dist/esm/sd-select_3.entry.js +8 -8
  161. package/dist/esm/sd-switch.entry.js +1 -1
  162. package/dist/esm/sd-table.entry.js +6 -6
  163. package/dist/esm/sd-tabs.entry.js +1 -1
  164. package/dist/esm/sd-td.entry.js +1 -1
  165. package/dist/esm/sd-toast-container.entry.js +1 -1
  166. package/dist/esm/sd-toast.entry.js +2 -2
  167. package/dist/esm/sd-toggle.entry.js +1 -1
  168. package/dist/types/components/sd-tag/sd-tag.d.ts +3 -0
  169. package/dist/types/components.d.ts +11 -0
  170. package/hydrate/index.js +75 -69
  171. package/hydrate/index.mjs +75 -69
  172. package/package.json +1 -1
  173. package/dist/components/p-0eogwabp.js +0 -1
  174. package/dist/components/p-D8T1XeGP.js +0 -1
  175. package/dist/design-system/p-0d5d2723.entry.js +0 -1
  176. package/dist/design-system/p-ad822c82.entry.js +0 -1
  177. package/dist/design-system/p-fb609583.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as r,t as i}from"./p-CEVDmQdt.js";import{i as g,h as d,j as o,k as l}from"./p-DvvGi4J_.js";import{s as c}from"./p-BE4tnQ2Z.js";import{d as n}from"./p-BnhzUsGP.js";const a=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.triggerClick=t(this,"sdTriggerClick",7),this.triggerFocus=t(this,"sdTriggerFocus",7),this.triggerBlur=t(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 e=""!==this.displayText;return r("div",{key:"bd967efa32ed0692512e549db9f852c7c08d5dcd",ref:e=>{this.triggerEl=e},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":`${l.paddingX}px`,"--trigger-gap":`${l.gap}px`,"--trigger-font-size":`${o.fontSize}px`,"--trigger-line-height":`${o.lineHeight}px`,"--trigger-font-weight":o.fontWeight,"--trigger-color":this.disabled?d.text.disabled:e?d.text.default:d.icon.default,"--trigger-icon-color":this.disabled?d.icon.disabled:d.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},r("div",{key:"04a8568ac5d109f0635d3474a394030d630f441e",class:"sd-select-trigger__content"},e&&g(this.displayText)?r("span",{class:"sd-select-trigger__text",ref:e=>e&&(e.innerHTML=c(this.displayText))}):r("span",{class:"sd-select-trigger__text"},e?this.displayText:this.placeholder??"선택"),r("sd-icon",{key:"ba256d1a780f7805c81330a6ba4e010c458be57e",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}static get style(){return"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)}"}},[512,"sd-select-trigger",{displayText:[1,"display-text"],placeholder:[1],disabled:[4],isOpen:[4,"is-open"],sdFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-trigger","sd-icon"].forEach((e=>{switch(e){case"sd-select-trigger":customElements.get(i(e))||customElements.define(i(e),a);break;case"sd-icon":customElements.get(i(e))||n()}}))}export{a as S,h as d}
1
+ import{p as e,H as s,c as t,h as r,t as i}from"./p-CEVDmQdt.js";import{i as g,h as o,j as d,k as l}from"./p-DvvGi4J_.js";import{s as c}from"./p-BE4tnQ2Z.js";import{d as a}from"./p-BnhzUsGP.js";const n=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.triggerClick=t(this,"sdTriggerClick",7),this.triggerFocus=t(this,"sdTriggerFocus",7),this.triggerBlur=t(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 e=""!==this.displayText;return r("div",{key:"0c3e197cd8a238a979ee6d794a607e07585b2025",ref:e=>{this.triggerEl=e},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":`${l.paddingX}px`,"--trigger-gap":`${l.gap}px`,"--trigger-font-size":`${d.fontSize}px`,"--trigger-line-height":`${d.lineHeight}px`,"--trigger-font-weight":d.fontWeight,"--trigger-color":this.disabled?o.text.disabled:e?o.text.default:o.icon.default,"--trigger-icon-color":this.disabled?o.icon.disabled:o.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},r("div",{key:"4c068fb6a6784bde01669b7a5ad30d91dc358dd3",class:"sd-select-trigger__content"},e&&g(this.displayText)?r("span",{class:"sd-select-trigger__text",ref:e=>e&&(e.innerHTML=c(this.displayText))}):r("span",{class:"sd-select-trigger__text"},e?this.displayText:this.placeholder??"선택"),r("sd-icon",{key:"7172c372c2864574ca6ab0f726a0af091a3d0110",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}static get style(){return"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)}"}},[512,"sd-select-trigger",{displayText:[1,"display-text"],placeholder:[1],disabled:[4],isOpen:[4,"is-open"],sdFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-trigger","sd-icon"].forEach((e=>{switch(e){case"sd-select-trigger":customElements.get(i(e))||customElements.define(i(e),n);break;case"sd-icon":customElements.get(i(e))||a()}}))}export{n as S,h as d}
@@ -1 +1 @@
1
- import{p as t,H as n,c as o,h as e,t as i}from"./p-CEVDmQdt.js";const a=t(class t extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=o(this,"sdClose",7)}get el(){return this}to="body";parentRef=null;offset=[0,0];zIndex=996;placement="bottom";open=!1;close;container;wrapper;rafId;isInsideClick=!1;resizeObserver;mutationObserver;scrollHandler=()=>this.updatePosition();static ARROW_SIZE=11.2;componentDidLoad(){this.container=this.resolveContainer(),this.createWrapper(),this.moveSlotContent(),requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")})),this.observeParent(),window.addEventListener("scroll",this.scrollHandler,!0)}componentDidRender(){this.wrapper&&(this.open?(this.wrapper.style.display="block",requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")}))):(this.wrapper.style.display="none",this.wrapper.style.visibility="hidden"))}disconnectedCallback(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("scroll",this.scrollHandler,!0),this.unobserveParent(),this.wrapper?.remove()}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof n?t:document.body}resolveZIndex(){const t=this.zIndex??996,o=this.parentRef?.closest(".sd-modal-container__layer");if(!o)return t;const e=o.closest(".sd-modal-container"),i=e instanceof n?parseInt(getComputedStyle(e).zIndex,10):NaN,a=Number.isFinite(i)?i:997;return Math.max(t,a+1)}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",zIndex:this.resolveZIndex().toString(),transition:"opacity 0.4s",top:"-9999px",left:"-9999px"}),this.container.appendChild(this.wrapper)}moveSlotContent(){this.wrapper&&Array.from(this.el.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const n=this.parentRef.getBoundingClientRect();if(0===n.width&&0===n.height)return;const[o,e]=this.offset??[0,0],i=t.ARROW_SIZE;let a=0,s=0;switch(this.placement??"bottom"){case"top":a=n.top-this.wrapper.offsetHeight+e-i,s=n.left+n.width/2-this.wrapper.offsetWidth/2+o;break;case"bottom":a=n.bottom+e+i,s=n.left+n.width/2-this.wrapper.offsetWidth/2+o;break;case"left":a=n.top+n.height/2-this.wrapper.offsetHeight/2+e,s=n.left-this.wrapper.offsetWidth-o-i;break;case"right":a=n.top+n.height/2-this.wrapper.offsetHeight/2+e,s=n.right+o+i}Object.assign(this.wrapper.style,{top:`${a}px`,left:`${s}px`})}))}observeParent(){this.parentRef&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef),this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}unobserveParent(){this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}handleMouseDown(t){this.isInsideClick=!!(this.wrapper&&this.wrapper.contains(t.target)||this.parentRef&&this.parentRef.contains(t.target))}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(t.target)||this.close.emit()}handleKeydown(t){"Escape"===t.key&&this.close.emit()}render(){return e("slot",{key:"a560d8d46ef03688ce16a984c54ae23f740e7ef8"})}static get style(){return".sd-floating-menu{width:fit-content;padding:12px 16px;border-radius:6px;font-size:12px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);animation:sd-floating-fade-in 0.35s ease-out}.sd-floating-menu--top{animation-name:sd-floating-slide-top}.sd-floating-menu--bottom{animation-name:sd-floating-slide-bottom}.sd-floating-menu--left{animation-name:sd-floating-slide-left}.sd-floating-menu--right{animation-name:sd-floating-slide-right}.sd-floating-menu .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--default{background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);font-weight:500}.sd-floating-menu--default .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--danger{background:var(--sd-floating-bg, #FCE6E6);color:var(--sd-floating-content, #FB4444);font-weight:700}.sd-floating-menu--danger .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FCE6E6)}.sd-floating-menu--warning{background:var(--sd-floating-bg, #FEF1EA);color:var(--sd-floating-content, #FF6B00);font-weight:700}.sd-floating-menu--warning .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FEF1EA)}.sd-floating-menu--accent{background:var(--sd-floating-bg, #E6F1FF);color:var(--sd-floating-content, #0075FF);font-weight:700}.sd-floating-menu--accent .sd-floating-menu__arrow{color:var(--sd-floating-bg, #E6F1FF)}.sd-floating-menu__arrow{position:absolute;display:flex;width:16px;height:12px}.sd-floating-menu__arrow svg{width:100%;height:100%}.sd-floating-menu__arrow--top{bottom:-12px;left:50%;transform:translateX(-50%)}.sd-floating-menu__arrow--bottom{top:-12px;left:50%;transform:translateX(-50%) rotate(180deg)}.sd-floating-menu__arrow--left{right:-12px;top:50%;transform:translateY(-50%) rotate(-90deg)}.sd-floating-menu__arrow--right{left:-12px;top:50%;transform:translateY(-50%) rotate(90deg)}.sd-floating-menu__content{font-size:12px;line-height:20px}.sd-floating-menu__content .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px;margin-bottom:4px}.sd-floating-menu__content .sd-floating-menu__messages{font-weight:500}.sd-floating-menu__content .sd-floating-menu__buttons{margin-top:12px;display:flex;gap:8px;align-items:center;justify-content:flex-end}.sd-floating-menu__content .sd-floating-menu__buttons--with-link{justify-content:space-between}.sd-floating-menu--popover{padding:16px 20px}.sd-floating-menu--popover .sd-floating-menu__content{gap:4px}.sd-floating-menu--popover .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px}.sd-floating-menu--popover .sd-floating-menu__messages{font-size:12px;font-weight:500;line-height:20px}.sd-floating-menu--closing{animation:sd-floating-fade-out 0.15s ease-in forwards}.sd-floating-menu--closing.sd-floating-menu--top{animation-name:sd-floating-slide-out-top}.sd-floating-menu--closing.sd-floating-menu--bottom{animation-name:sd-floating-slide-out-bottom}.sd-floating-menu--closing.sd-floating-menu--left{animation-name:sd-floating-slide-out-left}.sd-floating-menu--closing.sd-floating-menu--right{animation-name:sd-floating-slide-out-right}.sd-floating-menu--has-close .sd-floating-menu__content{padding-right:28px}.sd-floating-menu__close-button{position:absolute;top:12px;right:12px}@keyframes sd-floating-fade-out{from{opacity:1}to{opacity:0}}@keyframes sd-floating-slide-out-top{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes sd-floating-slide-out-bottom{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes sd-floating-slide-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes sd-floating-slide-out-right{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes sd-floating-fade-in{from{opacity:0}to{opacity:1}}@keyframes sd-floating-slide-top{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-bottom{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-left{from{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes sd-floating-slide-right{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}"}},[772,"sd-floating-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],placement:[1],open:[4]},[[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"],[8,"keydown","handleKeydown"]]]);function s(){"undefined"!=typeof customElements&&["sd-floating-portal"].forEach((t=>{"sd-floating-portal"===t&&(customElements.get(i(t))||customElements.define(i(t),a))}))}export{a as S,s as d}
1
+ import{p as t,H as n,c as o,h as e,t as i}from"./p-CEVDmQdt.js";const a=t(class t extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=o(this,"sdClose",7)}get el(){return this}to="body";parentRef=null;offset=[0,0];zIndex=996;placement="bottom";open=!1;close;container;wrapper;rafId;isInsideClick=!1;resizeObserver;mutationObserver;scrollHandler=()=>this.updatePosition();static ARROW_SIZE=11.2;componentDidLoad(){this.container=this.resolveContainer(),this.createWrapper(),this.moveSlotContent(),requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")})),this.observeParent(),window.addEventListener("scroll",this.scrollHandler,!0)}componentDidRender(){this.wrapper&&(this.open?(this.wrapper.style.display="block",requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")}))):(this.wrapper.style.display="none",this.wrapper.style.visibility="hidden"))}disconnectedCallback(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("scroll",this.scrollHandler,!0),this.unobserveParent(),this.wrapper?.remove()}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof n?t:document.body}resolveZIndex(){const t=this.zIndex??996,o=this.parentRef?.closest(".sd-modal-container__layer");if(!o)return t;const e=o.closest(".sd-modal-container"),i=e instanceof n?parseInt(getComputedStyle(e).zIndex,10):NaN,a=Number.isFinite(i)?i:997;return Math.max(t,a+1)}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"fixed",zIndex:this.resolveZIndex().toString(),transition:"opacity 0.4s",top:"-9999px",left:"-9999px"}),this.container.appendChild(this.wrapper)}moveSlotContent(){this.wrapper&&Array.from(this.el.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const n=this.parentRef.getBoundingClientRect();if(0===n.width&&0===n.height)return;const[o,e]=this.offset??[0,0],i=t.ARROW_SIZE;let a=0,s=0;switch(this.placement??"bottom"){case"top":a=n.top-this.wrapper.offsetHeight+e-i,s=n.left+n.width/2-this.wrapper.offsetWidth/2+o;break;case"bottom":a=n.bottom+e+i,s=n.left+n.width/2-this.wrapper.offsetWidth/2+o;break;case"left":a=n.top+n.height/2-this.wrapper.offsetHeight/2+e,s=n.left-this.wrapper.offsetWidth-o-i;break;case"right":a=n.top+n.height/2-this.wrapper.offsetHeight/2+e,s=n.right+o+i}Object.assign(this.wrapper.style,{top:`${a}px`,left:`${s}px`})}))}observeParent(){this.parentRef&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef),this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}unobserveParent(){this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}handleMouseDown(t){this.isInsideClick=!!(this.wrapper&&this.wrapper.contains(t.target)||this.parentRef&&this.parentRef.contains(t.target))}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(t.target)||this.close.emit()}handleKeydown(t){"Escape"===t.key&&this.close.emit()}render(){return e("slot",{key:"cadee10f344de11650330995b0de9a342babe1e3"})}static get style(){return".sd-floating-menu{width:fit-content;padding:12px 16px;border-radius:6px;font-size:12px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);animation:sd-floating-fade-in 0.35s ease-out}.sd-floating-menu--top{animation-name:sd-floating-slide-top}.sd-floating-menu--bottom{animation-name:sd-floating-slide-bottom}.sd-floating-menu--left{animation-name:sd-floating-slide-left}.sd-floating-menu--right{animation-name:sd-floating-slide-right}.sd-floating-menu .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--default{background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);font-weight:500}.sd-floating-menu--default .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--danger{background:var(--sd-floating-bg, #FCE6E6);color:var(--sd-floating-content, #FB4444);font-weight:700}.sd-floating-menu--danger .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FCE6E6)}.sd-floating-menu--warning{background:var(--sd-floating-bg, #FEF1EA);color:var(--sd-floating-content, #FF6B00);font-weight:700}.sd-floating-menu--warning .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FEF1EA)}.sd-floating-menu--accent{background:var(--sd-floating-bg, #E6F1FF);color:var(--sd-floating-content, #0075FF);font-weight:700}.sd-floating-menu--accent .sd-floating-menu__arrow{color:var(--sd-floating-bg, #E6F1FF)}.sd-floating-menu__arrow{position:absolute;display:flex;width:16px;height:12px}.sd-floating-menu__arrow svg{width:100%;height:100%}.sd-floating-menu__arrow--top{bottom:-12px;left:50%;transform:translateX(-50%)}.sd-floating-menu__arrow--bottom{top:-12px;left:50%;transform:translateX(-50%) rotate(180deg)}.sd-floating-menu__arrow--left{right:-12px;top:50%;transform:translateY(-50%) rotate(-90deg)}.sd-floating-menu__arrow--right{left:-12px;top:50%;transform:translateY(-50%) rotate(90deg)}.sd-floating-menu__content{font-size:12px;line-height:20px}.sd-floating-menu__content .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px;margin-bottom:4px}.sd-floating-menu__content .sd-floating-menu__messages{font-weight:500}.sd-floating-menu__content .sd-floating-menu__buttons{margin-top:12px;display:flex;gap:8px;align-items:center;justify-content:flex-end}.sd-floating-menu__content .sd-floating-menu__buttons--with-link{justify-content:space-between}.sd-floating-menu--popover{padding:16px 20px}.sd-floating-menu--popover .sd-floating-menu__content{gap:4px}.sd-floating-menu--popover .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px}.sd-floating-menu--popover .sd-floating-menu__messages{font-size:12px;font-weight:500;line-height:20px}.sd-floating-menu--closing{animation:sd-floating-fade-out 0.15s ease-in forwards}.sd-floating-menu--closing.sd-floating-menu--top{animation-name:sd-floating-slide-out-top}.sd-floating-menu--closing.sd-floating-menu--bottom{animation-name:sd-floating-slide-out-bottom}.sd-floating-menu--closing.sd-floating-menu--left{animation-name:sd-floating-slide-out-left}.sd-floating-menu--closing.sd-floating-menu--right{animation-name:sd-floating-slide-out-right}.sd-floating-menu--has-close .sd-floating-menu__content{padding-right:28px}.sd-floating-menu__close-button{position:absolute;top:12px;right:12px}@keyframes sd-floating-fade-out{from{opacity:1}to{opacity:0}}@keyframes sd-floating-slide-out-top{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes sd-floating-slide-out-bottom{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes sd-floating-slide-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes sd-floating-slide-out-right{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes sd-floating-fade-in{from{opacity:0}to{opacity:1}}@keyframes sd-floating-slide-top{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-bottom{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-left{from{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes sd-floating-slide-right{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}"}},[772,"sd-floating-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],placement:[1],open:[4]},[[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"],[8,"keydown","handleKeydown"]]]);function s(){"undefined"!=typeof customElements&&["sd-floating-portal"].forEach((t=>{"sd-floating-portal"===t&&(customElements.get(i(t))||customElements.define(i(t),a))}))}export{a as S,s as d}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,d as o,t as i}from"./p-CEVDmQdt.js";import{T as a}from"./p-sZMi_32I.js";const n=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}rows=[];tableId="";topSpacerHeight=0;bottomSpacerHeight=0;tableEl=null;handleRowsChange(t){const s=t??[];this.tableEl?.setRowCountSync&&this.tableEl.setRowCountSync(s.length)}componentWillLoad(){this.syncTableContext(),this.rows=this.rows??[],this.tableEl?.setRowCountSync&&this.tableEl.setRowCountSync(this.rows.length),this.el.setSpacersSync=(t,s)=>{this.topSpacerHeight=t,this.bottomSpacerHeight=s}}componentDidLoad(){this.syncTableContext()}syncTableContext(){const t=this.el.closest("sd-table"),s=this.el.getRootNode(),e=s instanceof ShadowRoot?s.host:null,o=t??e;this.tableEl=o;const i=o?.getTableIdSync?.(),n=o?.getAttribute(a),d=(null!=i&&""!==i&&"undefined"!==i?i:null)??(null!=n&&""!==n&&"undefined"!==n?n:null)??"";""!==d&&d!==this.tableId&&(this.tableId=d)}render(){return e(o,{key:"af02c942fe83b515e2065840ff3b83ad22fd5542",slot:`${this.tableId}-body`},e("tbody",{key:"6f1b771c2a21ff087b5feb32b19e0fb4b0abed35",class:{tbody:!0}},[this.topSpacerHeight>0&&e("tr",{key:"spacer-top",class:"tbody__spacer",style:{height:`${this.topSpacerHeight}px`,display:"block"}}),e("slot",{key:"0c7c439b269527f9bfbb00bf60a1aec10646da56"}),this.bottomSpacerHeight>0&&e("tr",{key:"spacer-bottom",class:"tbody__spacer",style:{height:`${this.bottomSpacerHeight}px`,display:"block"}})]))}static get watchers(){return{rows:[{handleRowsChange:0}]}}static get style(){return":host{display:contents}:host *{box-sizing:border-box}.tbody{display:table-row-group}"}},[769,"sd-tbody",{rows:[16],tableId:[32],topSpacerHeight:[32],bottomSpacerHeight:[32]},void 0,{rows:[{handleRowsChange:0}]}]);function d(){"undefined"!=typeof customElements&&["sd-tbody"].forEach((t=>{"sd-tbody"===t&&(customElements.get(i(t))||customElements.define(i(t),n))}))}export{n as S,d}
1
+ import{p as t,H as s,h as e,d as o,t as d}from"./p-CEVDmQdt.js";import{T as i}from"./p-sZMi_32I.js";const a=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}rows=[];tableId="";topSpacerHeight=0;bottomSpacerHeight=0;tableEl=null;handleRowsChange(t){const s=t??[];this.tableEl?.setRowCountSync&&this.tableEl.setRowCountSync(s.length)}componentWillLoad(){this.syncTableContext(),this.rows=this.rows??[],this.tableEl?.setRowCountSync&&this.tableEl.setRowCountSync(this.rows.length),this.el.setSpacersSync=(t,s)=>{this.topSpacerHeight=t,this.bottomSpacerHeight=s}}componentDidLoad(){this.syncTableContext()}syncTableContext(){const t=this.el.closest("sd-table"),s=this.el.getRootNode(),e=s instanceof ShadowRoot?s.host:null,o=t??e;this.tableEl=o;const d=o?.getTableIdSync?.(),a=o?.getAttribute(i),n=(null!=d&&""!==d&&"undefined"!==d?d:null)??(null!=a&&""!==a&&"undefined"!==a?a:null)??"";""!==n&&n!==this.tableId&&(this.tableId=n)}render(){return e(o,{key:"3c3b748b436dc9db4054a5528fc205da7d21c8e8",slot:`${this.tableId}-body`},e("tbody",{key:"7cd092ce9b54bed7e4aaaf4b9b3df788d13e382c",class:{tbody:!0}},[this.topSpacerHeight>0&&e("tr",{key:"spacer-top",class:"tbody__spacer",style:{height:`${this.topSpacerHeight}px`,display:"block"}}),e("slot",{key:"0a8c271acdd45802cb036c58303bd08037067c7d"}),this.bottomSpacerHeight>0&&e("tr",{key:"spacer-bottom",class:"tbody__spacer",style:{height:`${this.bottomSpacerHeight}px`,display:"block"}})]))}static get watchers(){return{rows:[{handleRowsChange:0}]}}static get style(){return":host{display:contents}:host *{box-sizing:border-box}.tbody{display:table-row-group}"}},[769,"sd-tbody",{rows:[16],tableId:[32],topSpacerHeight:[32],bottomSpacerHeight:[32]},void 0,{rows:[{handleRowsChange:0}]}]);function n(){"undefined"!=typeof customElements&&["sd-tbody"].forEach((t=>{"sd-tbody"===t&&(customElements.get(d(t))||customElements.define(d(t),a))}))}export{a as S,n as d}
@@ -1 +1 @@
1
- import{p as t,H as o,c as s,h as e,t as a}from"./p-CEVDmQdt.js";import{s as i}from"./p-BE4tnQ2Z.js";import{m as d}from"./p-DOXMJi-V.js";import{d as n}from"./p-C3rOud8J.js";import{d as l}from"./p-BlN03Cqm.js";import{d as m}from"./p-BnhzUsGP.js";import{d as c}from"./p-BckY1cBy.js";import{d as r}from"./p-D8T1XeGP.js";const f={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},h={positive:"notificationOutline",negative:"warningOutline",default:null},b={positive:d.modal.confirm.positive.icon,negative:d.modal.confirm.negative.icon,default:""},p=Number(d.modal.confirm.title.icon),u=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=s(this,"sdClose",7),this.cancel=s(this,"sdCancel",7),this.ok=s(this,"sdOk",7)}get el(){return 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 o&&("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??f[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 t=Array.from(this.el.childNodes).some((t=>!(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("sd-confirm-modal"))&&(t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())));t!==this.hasSlottedContent&&(this.hasSlottedContent=t)}render(){const t=this.resolvedType,o=h[t],s=b[t];return e("div",{key:"e8fcb4879a5a9f2b3bf41753e4cc511e710db1f6",class:"sd-confirm-modal"},e("sd-ghost-button",{key:"a8595db97066963534d0ee5529f39481ed1e6c27",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),o&&e("sd-icon",{key:"3b5cf4842176f6c039ecb64ec7942e7cb5a6f1ac",class:"sd-confirm-modal__icon",name:o,size:p,color:s}),e("h2",{key:"6f7032707292e71e0f8adc655ce88487c08e1b8d",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),e("div",{key:"e21c66301b368ffd989063aaf9826e023de71925",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&e("div",{key:"3965561001b0520f491cac833bba3cfe92d7a200",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)})))),this.showContentBox&&e("div",{key:"dc2c38a945493e42d451e4fa3d3ebaa6dca75e4a",class:"sd-confirm-modal__content-box"},this.tagContents?e("div",{class:"sd-confirm-modal__custom-content",ref:t=>{this.customContentRef=t}}):e("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&e("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&e("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&e("div",{key:"ae35e60d69047547d159a452b838c8fc57a3e1a4",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)}))))),e("div",{key:"3bd41c58539faade80e61fac6a91a4ab318bbe88",class:"sd-confirm-modal__button"},this.subButtonLabel&&e("sd-button",{key:"177fba6b79a23c80b1037d3af4872c58a598aa33",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),e("sd-button",{key:"b332d980d9236c584ebca47f89fc2d9b217c0bfd",name:this.resolvedMainButton,label:this.mainButtonLabel??"확인",onSdClick:()=>this.ok.emit()})))}static get style(){return"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}"}},[772,"sd-confirm-modal",{type:[1],modalTitle:[1,"modal-title"],titleClass:[1,"title-class"],topMessage:[16],bottomMessage:[16],mainButtonName:[1,"main-button-name"],mainButtonLabel:[1,"main-button-label"],subButtonLabel:[1,"sub-button-label"],tagPreset:[1,"tag-preset"],tagLabel:[1,"tag-label"],slotLabel:[1,"slot-label"],tagContents:[16],hasSlottedContent:[32]}]);function g(){"undefined"!=typeof customElements&&["sd-confirm-modal","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-confirm-modal":customElements.get(a(t))||customElements.define(a(t),u);break;case"sd-button":customElements.get(a(t))||n();break;case"sd-ghost-button":customElements.get(a(t))||l();break;case"sd-icon":customElements.get(a(t))||m();break;case"sd-portal":customElements.get(a(t))||c();break;case"sd-tag":customElements.get(a(t))||r()}}))}export{u as S,g as d}
1
+ import{p as t,H as o,c as s,h as e,t as a}from"./p-CEVDmQdt.js";import{s as i}from"./p-BE4tnQ2Z.js";import{m as d}from"./p-DOXMJi-V.js";import{d as n}from"./p-C3rOud8J.js";import{d as l}from"./p-B4ua22vZ.js";import{d as m}from"./p-BnhzUsGP.js";import{d as c}from"./p-BckY1cBy.js";import{d as r}from"./p-C7sUn4qb.js";const f={positive:"primary_md",negative:"danger_md",default:"neutral_outline_md"},h={positive:"notificationOutline",negative:"warningOutline",default:null},b={positive:d.modal.confirm.positive.icon,negative:d.modal.confirm.negative.icon,default:""},p=Number(d.modal.confirm.title.icon),u=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=s(this,"sdClose",7),this.cancel=s(this,"sdCancel",7),this.ok=s(this,"sdOk",7)}get el(){return 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 o&&("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??f[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 t=Array.from(this.el.childNodes).some((t=>!(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("sd-confirm-modal"))&&(t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())));t!==this.hasSlottedContent&&(this.hasSlottedContent=t)}render(){const t=this.resolvedType,o=h[t],s=b[t];return e("div",{key:"e8fcb4879a5a9f2b3bf41753e4cc511e710db1f6",class:"sd-confirm-modal"},e("sd-ghost-button",{key:"a8595db97066963534d0ee5529f39481ed1e6c27",class:"sd-confirm-modal__close-button",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()}),o&&e("sd-icon",{key:"3b5cf4842176f6c039ecb64ec7942e7cb5a6f1ac",class:"sd-confirm-modal__icon",name:o,size:p,color:s}),e("h2",{key:"6f7032707292e71e0f8adc655ce88487c08e1b8d",class:`sd-confirm-modal__title ${this.titleClass??""}`},this.modalTitle),e("div",{key:"e21c66301b368ffd989063aaf9826e023de71925",class:"sd-confirm-modal__body"},(this.topMessage??[]).length>0&&e("div",{key:"3965561001b0520f491cac833bba3cfe92d7a200",class:"sd-confirm-modal__message"},(this.topMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)})))),this.showContentBox&&e("div",{key:"dc2c38a945493e42d451e4fa3d3ebaa6dca75e4a",class:"sd-confirm-modal__content-box"},this.tagContents?e("div",{class:"sd-confirm-modal__custom-content",ref:t=>{this.customContentRef=t}}):e("slot",{onSlotchange:()=>this.syncHasSlottedContent()},this.tagLabel&&e("sd-tag",{name:this.tagPreset??"square_sm_grey",label:this.tagLabel}),this.slotLabel&&e("span",{class:"sd-confirm-modal__slot-label"},this.slotLabel))),(this.bottomMessage??[]).length>0&&e("div",{key:"ae35e60d69047547d159a452b838c8fc57a3e1a4",class:"sd-confirm-modal__message"},(this.bottomMessage??[]).map((t=>e("p",{class:"sd-confirm-modal__message-text",innerHTML:i(t)}))))),e("div",{key:"3bd41c58539faade80e61fac6a91a4ab318bbe88",class:"sd-confirm-modal__button"},this.subButtonLabel&&e("sd-button",{key:"177fba6b79a23c80b1037d3af4872c58a598aa33",name:"neutral_outline_md",label:this.subButtonLabel,onSdClick:()=>this.cancel.emit()}),e("sd-button",{key:"b332d980d9236c584ebca47f89fc2d9b217c0bfd",name:this.resolvedMainButton,label:this.mainButtonLabel??"확인",onSdClick:()=>this.ok.emit()})))}static get style(){return"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}"}},[772,"sd-confirm-modal",{type:[1],modalTitle:[1,"modal-title"],titleClass:[1,"title-class"],topMessage:[16],bottomMessage:[16],mainButtonName:[1,"main-button-name"],mainButtonLabel:[1,"main-button-label"],subButtonLabel:[1,"sub-button-label"],tagPreset:[1,"tag-preset"],tagLabel:[1,"tag-label"],slotLabel:[1,"slot-label"],tagContents:[16],hasSlottedContent:[32]}]);function g(){"undefined"!=typeof customElements&&["sd-confirm-modal","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-confirm-modal":customElements.get(a(t))||customElements.define(a(t),u);break;case"sd-button":customElements.get(a(t))||n();break;case"sd-ghost-button":customElements.get(a(t))||l();break;case"sd-icon":customElements.get(a(t))||m();break;case"sd-portal":customElements.get(a(t))||c();break;case"sd-tag":customElements.get(a(t))||r()}}))}export{u as S,g as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as n}from"./p-CEVDmQdt.js";import{n as r}from"./p-CCwNgVmC.js";import{f as d}from"./p-BOJJ_sQS.js";import{d as u}from"./p-C3rOud8J.js";import{d as a}from"./p-0eogwabp.js";import{d as o}from"./p-DMvWCQfX.js";import{d as l}from"./p-BlN03Cqm.js";import{d as p}from"./p-BnhzUsGP.js";import{d as h}from"./p-BckY1cBy.js";import{d as c}from"./p-D8T1XeGP.js";import{d as m}from"./p-BGpxtouI.js";var b={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"14",lineHeight:"24"}},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const f=b.numberInput.sm,g=b.numberInput.md,y={sm:{height:f.height,paddingX:f.paddingX,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:g.height,paddingX:g.paddingX,radius:g.radius,fontSize:g.typography.fontSize,lineHeight:g.typography.lineHeight,fontWeight:g.typography.fontWeight}},_={border:b.numberInput.border,bg:b.numberInput.bg,text:b.numberInput.text},x={sm:{size:b.numberInput.stepper.sm.size},md:{size:b.numberInput.stepper.md.size},radius:b.numberInput.stepper.radius,bg:b.numberInput.stepper.bg,icon:b.numberInput.stepper.icon},v=d.field.hint,w=d.field.errorMessage,k=d.field.contents.gap,z=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}size="sm";min=Number.NEGATIVE_INFINITY;max=Number.POSITIVE_INFINITY;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=s.toString().split("."),r=(+i).toLocaleString(),d=e?"-"+r:r;return void 0!==n&&""!==n?d+"."+n:String(d)}parseInput(t){if(""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=y[this.size]??y.sm,e="md"===this.size?14:12;return i("sd-field",{key:"c50811d15f4b698d889132ac8e4527df72059a0d",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,readonly:this.readonly,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-number-input-font-size":`${t.fontSize}px`,"--sd-number-input-line-height":`${t.lineHeight}px`,"--sd-number-input-font-weight":t.fontWeight,"--sd-number-input-padding-x":`${t.paddingX}px`,"--sd-number-input-text-color":_.text.default,"--sd-number-input-placeholder-color":_.text.placeholder,"--sd-number-input-disabled-color":_.text.disabled,"--sd-number-input-stepper-size":`${x[this.size]?.size??x.sm.size}px`,"--sd-number-input-stepper-radius":`${x.radius}px`,"--sd-number-input-stepper-bg":x.bg.default,"--sd-number-input-stepper-bg-disabled":x.bg.disabled,"--sd-number-input-stepper-icon-color":x.icon.default,"--sd-number-input-stepper-icon-disabled":x.icon.disabled,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`,"--sd-system-color-field-border-default":_.border.default,"--sd-system-color-field-border-focus":_.border.focus,"--sd-system-color-field-border-danger":_.border.danger,"--sd-system-color-field-bg-default":_.bg.default,"--sd-textinput-input-text-error-message":w.color,"--sd-textinput-input-error-message-typography-font-size":`${w.typography.fontSize}px`,"--sd-textinput-input-error-message-typography-line-height":`${w.typography.lineHeight}px`,"--sd-textinput-input-text-hint":v.color,"--sd-textinput-input-hint-typography-font-size":`${v.typography.fontSize}px`,"--sd-textinput-input-hint-typography-line-height":`${v.typography.lineHeight}px`,"--sd-textinput-input-contents-gap":`${k}px`}},i("div",{key:"c36595fc48eeb88090cfdeeda3da0e51a86d814e",class:{"sd-number-input__content":!0,"sd-number-input__content--no-stepper":!this.useButton}},this.useButton&&i("button",{key:"89a68f1264907284d8718c59c42cbcc0d06ec29d",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"9e9c5f4d33eadf088c6e8c428dd97d2c717905b3",name:"minus",size:e,color:this.isDecrementDisabled()?x.icon.disabled:x.icon.default})),this.inputPrefix&&i("span",{key:"b5d2bef21242c1dc65d10f6dcb3b4c50380804d2",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"2f1d5c24a3462ae5aded71d645317ad84ca2dd6b",name:this.name,ref:t=>this.nativeEl=t,class:`sd-number-input__native ${this.inputClass}`,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&i("span",{key:"53391ecdede9630774be6891412835dad3975186",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"9383cf29b0688252023b6bc9e10189c70f049ccf",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"a380dce8f2cf42c2f312657ea8304e94b9af8fe7",name:"add",size:e,color:this.isIncrementDisabled()?x.icon.disabled:x.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;gap:var(--sd-number-input-padding-x);color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content--no-stepper{padding:0 calc(var(--sd-number-input-padding-x) * 2)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}"}},[512,"sd-number-input",{size:[1],min:[2],max:[2],step:[2],useButton:[4,"use-button"],useDecimal:[4,"use-decimal"],value:[1032],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],name:[1],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function F(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),z);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||a();break;case"sd-floating-portal":customElements.get(n(t))||o();break;case"sd-ghost-button":customElements.get(n(t))||l();break;case"sd-icon":customElements.get(n(t))||p();break;case"sd-portal":customElements.get(n(t))||h();break;case"sd-tag":customElements.get(n(t))||c();break;case"sd-tooltip":customElements.get(n(t))||m()}}))}export{z as S,F as d}
1
+ import{p as t,H as e,c as s,h as i,t as n}from"./p-CEVDmQdt.js";import{n as r}from"./p-CCwNgVmC.js";import{f as d}from"./p-BOJJ_sQS.js";import{d as u}from"./p-C3rOud8J.js";import{d as a}from"./p-UkSGSWSA.js";import{d as o}from"./p-BOrdn-Js.js";import{d as l}from"./p-B4ua22vZ.js";import{d as p}from"./p-BnhzUsGP.js";import{d as h}from"./p-BckY1cBy.js";import{d as c}from"./p-C7sUn4qb.js";import{d as b}from"./p-DsGK3Aye.js";var m={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"14",lineHeight:"24"}},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const f=m.numberInput.sm,g=m.numberInput.md,y={sm:{height:f.height,paddingX:f.paddingX,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:g.height,paddingX:g.paddingX,radius:g.radius,fontSize:g.typography.fontSize,lineHeight:g.typography.lineHeight,fontWeight:g.typography.fontWeight}},_={border:m.numberInput.border,bg:m.numberInput.bg,text:m.numberInput.text},x={sm:{size:m.numberInput.stepper.sm.size},md:{size:m.numberInput.stepper.md.size},radius:m.numberInput.stepper.radius,bg:m.numberInput.stepper.bg,icon:m.numberInput.stepper.icon},v=d.field.hint,k=d.field.errorMessage,w=d.field.contents.gap,z=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}size="sm";min=Number.NEGATIVE_INFINITY;max=Number.POSITIVE_INFINITY;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=s.toString().split("."),r=(+i).toLocaleString(),d=e?"-"+r:r;return void 0!==n&&""!==n?d+"."+n:String(d)}parseInput(t){if(""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=y[this.size]??y.sm,e="md"===this.size?14:12;return i("sd-field",{key:"c2047618e4efff7023d390f95efa349af0eb52af",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,readonly:this.readonly,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-number-input-font-size":`${t.fontSize}px`,"--sd-number-input-line-height":`${t.lineHeight}px`,"--sd-number-input-font-weight":t.fontWeight,"--sd-number-input-padding-x":`${t.paddingX}px`,"--sd-number-input-text-color":_.text.default,"--sd-number-input-placeholder-color":_.text.placeholder,"--sd-number-input-disabled-color":_.text.disabled,"--sd-number-input-stepper-size":`${x[this.size]?.size??x.sm.size}px`,"--sd-number-input-stepper-radius":`${x.radius}px`,"--sd-number-input-stepper-bg":x.bg.default,"--sd-number-input-stepper-bg-disabled":x.bg.disabled,"--sd-number-input-stepper-icon-color":x.icon.default,"--sd-number-input-stepper-icon-disabled":x.icon.disabled,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`,"--sd-system-color-field-border-default":_.border.default,"--sd-system-color-field-border-focus":_.border.focus,"--sd-system-color-field-border-danger":_.border.danger,"--sd-system-color-field-bg-default":_.bg.default,"--sd-textinput-input-text-error-message":k.color,"--sd-textinput-input-error-message-typography-font-size":`${k.typography.fontSize}px`,"--sd-textinput-input-error-message-typography-line-height":`${k.typography.lineHeight}px`,"--sd-textinput-input-text-hint":v.color,"--sd-textinput-input-hint-typography-font-size":`${v.typography.fontSize}px`,"--sd-textinput-input-hint-typography-line-height":`${v.typography.lineHeight}px`,"--sd-textinput-input-contents-gap":`${w}px`}},i("div",{key:"2e4dc263460e89763a5794499aef1cd7c9dbc267",class:{"sd-number-input__content":!0,"sd-number-input__content--no-stepper":!this.useButton}},this.useButton&&i("button",{key:"ce1e5d01421763c4ba77887ad823ddc63578b462",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"819664ac86d1813c3850e863412c9334195786f2",name:"minus",size:e,color:this.isDecrementDisabled()?x.icon.disabled:x.icon.default})),this.inputPrefix&&i("span",{key:"bb7355f2ace27bbd93cf506c2d973651d74d6d88",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"8c8ee1d3e4b9ef5b89b00189bd138c32a7bcbe48",name:this.name,ref:t=>this.nativeEl=t,class:`sd-number-input__native ${this.inputClass}`,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&i("span",{key:"8da77f4901166b778544d51b9a88a7990aa15ba1",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"251cce12749955262b112d80ebd15298944bd079",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"5ef30dba0f14baadca36fd651ca09e780ff9be7c",name:"add",size:e,color:this.isIncrementDisabled()?x.icon.disabled:x.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;gap:var(--sd-number-input-padding-x);color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content--no-stepper{padding:0 calc(var(--sd-number-input-padding-x) * 2)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}"}},[512,"sd-number-input",{size:[1],min:[2],max:[2],step:[2],useButton:[4,"use-button"],useDecimal:[4,"use-decimal"],value:[1032],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],name:[1],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function F(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),z);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||a();break;case"sd-floating-portal":customElements.get(n(t))||o();break;case"sd-ghost-button":customElements.get(n(t))||l();break;case"sd-icon":customElements.get(n(t))||p();break;case"sd-portal":customElements.get(n(t))||h();break;case"sd-tag":customElements.get(n(t))||c();break;case"sd-tooltip":customElements.get(n(t))||b()}}))}export{z as S,F as d}
@@ -1 +1 @@
1
- import{p as s,H as d,c as a,h as e,d as o,t as i}from"./p-CEVDmQdt.js";import{m as t}from"./p-DOXMJi-V.js";import{d as l}from"./p-C3rOud8J.js";import{d as n}from"./p-D6noGX38.js";import{d as m}from"./p-BnhzUsGP.js";const r={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)},g={bg:t.modal.bg,messageColor:t.modal.loading.message.color,errorIcon:t.modal.confirm.negative.icon},c=t.modal.loading.message.typography.fontFamily,h=Number(t.modal.loading.message.typography.fontSize),u=Number(t.modal.loading.message.typography.fontWeight),b=Number(t.modal.loading.message.typography.lineHeight),p={loading:"작업을 진행하고 있습니다. 잠시만 기다려 주세요.",error:"작업에 실패하였습니다. 다시 시도해 주세요."},f={loading:"작업 취소",error:"다시 시도"},v=s(class extends d{constructor(s){super(),!1!==s&&this.__registerHost(),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||p[this.resolvedState]}get resolvedButtonLabel(){return this.buttonLabel||f[this.resolvedState]}handleClick=()=>{this.click.emit()};toCssSize(s){if(null!=s&&""!==s)return"number"==typeof s?`${s}px`:s}render(){const s={"--sd-loading-modal-min-width":`${r.minWidth}px`,"--sd-loading-modal-min-height":`${r.minHeight}px`,"--sd-loading-modal-gap":`${r.gap}px`,"--sd-loading-modal-content-size":`${r.contentSize}px`,"--sd-loading-modal-radius":`${r.radius}px`,"--sd-loading-modal-bg":g.bg,"--sd-loading-modal-message-color":g.messageColor,"--sd-loading-modal-message-font-family":c,"--sd-loading-modal-message-font-size":`${h}px`,"--sd-loading-modal-message-font-weight":`${u}`,"--sd-loading-modal-message-line-height":`${b}px`,"--sd-loading-modal-error-color":g.errorIcon,"--sd-loading-modal-width":this.toCssSize(this.width)??`${r.minWidth}px`,"--sd-loading-modal-height":this.toCssSize(this.height)??`${r.minHeight}px`};return e(o,{key:"163783850461aff1255dbd0784db91ad28da3f16",style:s},e("div",{key:"1e09f93378b0813d03c444570d06ffb09b494b63",class:"sd-loading-modal"},e("div",{key:"97a4919967f5be295b57b4194295c919b13151a4",class:"sd-loading-modal__content"},"loading"===this.resolvedState?e("sd-circle-progress",void 0!==this.progress?{value:this.progress}:{indeterminate:!0}):e("sd-icon",{class:"sd-loading-modal__icon",name:"warningOutline",size:r.contentSize,color:g.errorIcon})),e("div",{key:"aea0e4b45a55f0907e073f125ba0195bfa128078",class:"sd-loading-modal__message-wrapper"},Array.isArray(this.resolvedMessage)?this.resolvedMessage.map((s=>e("p",{class:"sd-loading-modal__message"},s))):e("p",{class:"sd-loading-modal__message"},this.resolvedMessage)),this.useButton&&e("div",{key:"b64767c954b366f6414886f032c80dd1c8c0190b",class:"sd-loading-modal__button"},e("sd-button",{key:"8a99e885b5561656f4046698235537d461b41455",name:"neutral_outline_sm",label:this.resolvedButtonLabel,onSdClick:this.handleClick}))))}static get style(){return"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}"}},[512,"sd-loading-modal",{state:[513],message:[1],useButton:[516,"use-button"],buttonLabel:[1,"button-label"],width:[8],height:[8],progress:[2]}]);function x(){"undefined"!=typeof customElements&&["sd-loading-modal","sd-button","sd-circle-progress","sd-icon"].forEach((s=>{switch(s){case"sd-loading-modal":customElements.get(i(s))||customElements.define(i(s),v);break;case"sd-button":customElements.get(i(s))||l();break;case"sd-circle-progress":customElements.get(i(s))||n();break;case"sd-icon":customElements.get(i(s))||m()}}))}export{v as S,x as d}
1
+ import{p as a,H as d,c as s,h as e,d as o,t as i}from"./p-CEVDmQdt.js";import{m as t}from"./p-DOXMJi-V.js";import{d as l}from"./p-C3rOud8J.js";import{d as n}from"./p-D6noGX38.js";import{d as m}from"./p-BnhzUsGP.js";const r={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)},g={bg:t.modal.bg,messageColor:t.modal.loading.message.color,errorIcon:t.modal.confirm.negative.icon},c=t.modal.loading.message.typography.fontFamily,h=Number(t.modal.loading.message.typography.fontSize),u=Number(t.modal.loading.message.typography.fontWeight),p=Number(t.modal.loading.message.typography.lineHeight),b={loading:"작업을 진행하고 있습니다. 잠시만 기다려 주세요.",error:"작업에 실패하였습니다. 다시 시도해 주세요."},f={loading:"작업 취소",error:"다시 시도"},v=a(class extends d{constructor(a){super(),!1!==a&&this.__registerHost(),this.click=s(this,"sdClick",7)}state="loading";message="";useButton=!1;buttonLabel="";width;height;progress;click;get resolvedState(){return this.state??"loading"}get resolvedMessage(){return this.message||b[this.resolvedState]}get resolvedButtonLabel(){return this.buttonLabel||f[this.resolvedState]}handleClick=()=>{this.click.emit()};toCssSize(a){if(null!=a&&""!==a)return"number"==typeof a?`${a}px`:a}render(){const a={"--sd-loading-modal-min-width":`${r.minWidth}px`,"--sd-loading-modal-min-height":`${r.minHeight}px`,"--sd-loading-modal-gap":`${r.gap}px`,"--sd-loading-modal-content-size":`${r.contentSize}px`,"--sd-loading-modal-radius":`${r.radius}px`,"--sd-loading-modal-bg":g.bg,"--sd-loading-modal-message-color":g.messageColor,"--sd-loading-modal-message-font-family":c,"--sd-loading-modal-message-font-size":`${h}px`,"--sd-loading-modal-message-font-weight":`${u}`,"--sd-loading-modal-message-line-height":`${p}px`,"--sd-loading-modal-error-color":g.errorIcon,"--sd-loading-modal-width":this.toCssSize(this.width)??`${r.minWidth}px`,"--sd-loading-modal-height":this.toCssSize(this.height)??`${r.minHeight}px`};return e(o,{key:"2283ab10ad01f45488a9cc8d6cf7727606b405e9",style:a},e("div",{key:"18e367ecf8dfd716c41a1936c6a44b22ad25a601",class:"sd-loading-modal"},e("div",{key:"149ac117d0645c35e9d9e6b7dcac7103aa4aa554",class:"sd-loading-modal__content"},"loading"===this.resolvedState?e("sd-circle-progress",void 0!==this.progress?{value:this.progress}:{indeterminate:!0}):e("sd-icon",{class:"sd-loading-modal__icon",name:"warningOutline",size:r.contentSize,color:g.errorIcon})),e("div",{key:"c30f2f115d448e0489d93ee5e8a0fb8e5347926a",class:"sd-loading-modal__message-wrapper"},Array.isArray(this.resolvedMessage)?this.resolvedMessage.map((a=>e("p",{class:"sd-loading-modal__message"},a))):e("p",{class:"sd-loading-modal__message"},this.resolvedMessage)),this.useButton&&e("div",{key:"8db7230e3fb62c525db9cf6f5fa5781dcb44dad9",class:"sd-loading-modal__button"},e("sd-button",{key:"faf1ceccaa5009d589e727349b17c7c5080e3c48",name:"neutral_outline_sm",label:this.resolvedButtonLabel,onSdClick:this.handleClick}))))}static get style(){return"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}"}},[512,"sd-loading-modal",{state:[513],message:[1],useButton:[516,"use-button"],buttonLabel:[1,"button-label"],width:[8],height:[8],progress:[2]}]);function x(){"undefined"!=typeof customElements&&["sd-loading-modal","sd-button","sd-circle-progress","sd-icon"].forEach((a=>{switch(a){case"sd-loading-modal":customElements.get(i(a))||customElements.define(i(a),v);break;case"sd-button":customElements.get(i(a))||l();break;case"sd-circle-progress":customElements.get(i(a))||n();break;case"sd-icon":customElements.get(i(a))||m()}}))}export{v as S,x as d}
@@ -1 +1 @@
1
- import{p as e,H as t,c as s,h as i,t as l}from"./p-CEVDmQdt.js";import{L as c,i as d,a as o,b as r}from"./p-DvvGi4J_.js";import{s as m}from"./p-BE4tnQ2Z.js";import{d as a}from"./p-D3dq5pt5.js";import{d as h}from"./p-BnhzUsGP.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.listItemClick=s(this,"sdListItemClick",7)}option;depth=1;isSelected=!1;isFocused=!1;useCheckbox=!1;countInfo;listItemClick;get isGroup(){return!!this.option.children}get isSelectable(){return!this.isGroup||this.useCheckbox}get depthKey(){return this.depth<=1?"depth1":2===this.depth?"depth2":"depth3"}get paddingLeft(){return`${c.paddingLeft[this.depthKey]}px`}handleClick=e=>{e.stopPropagation(),!this.option.disabled&&this.isSelectable&&this.listItemClick.emit(this.option)};handleCheckboxClick=e=>{e.stopPropagation()};handleCheckboxUpdate=e=>{e.stopPropagation(),!this.option.disabled&&this.isSelectable&&this.listItemClick.emit(this.option)};render(){const e=this.isGroup,t=e&&1===this.depth,s=e&&2===this.depth,l={"--list-item-padding-y":`${c.paddingY}px`,"--list-item-padding-left":this.paddingLeft,"--list-item-padding-right":`${c.paddingRight}px`,"--list-item-gap":`${c.gap}px`,"--list-item-font-size":`${r.fontSize}px`,"--list-item-line-height":`${r.lineHeight}px`,"--list-item-font-weight":r.fontWeight,"--list-item-bg":t?o.depth1.bg:s?o.depth2.bg:o.bg.default,"--list-item-bg-hover":o.bg.hover,"--list-item-color":o.content.default,"--list-item-color-hover":o.content.hover,"--list-item-color-disabled":o.content.disabled,"--list-item-color-selected":o.content.selected,"--list-item-font-weight-selected":r.selectedFontWeight};return t&&(l["--list-item-border-top"]=`${o.depth1.borderWidth}px solid ${o.depth1.border}`),i("div",{key:"2bec32f64859ef0e39928d4288cba3c727e16cf1",role:"option",tabindex:-1,"aria-selected":!0===this.isSelected?"true":"false",class:{"sd-select-list-item":!0,"sd-select-list-item--group":e,"sd-select-list-item--depth1-group":t,"sd-select-list-item--depth2-group":s,"sd-select-list-item--selected":!0===this.isSelected,"sd-select-list-item--indeterminate":null===this.isSelected,"sd-select-list-item--focused":this.isFocused,"sd-select-list-item--selectable":this.isSelectable&&!this.option.disabled,"sd-select-list-item--disabled":!!this.option.disabled},style:l,onClick:this.handleClick},this.useCheckbox&&i("sd-checkbox",{key:"fb6d2ed50e6d24d0491200b5be2cb3ab97df1b04",value:null===this.isSelected?null:!!this.isSelected,disabled:this.option.disabled,inverse:this.isFocused&&!1!==this.isSelected,class:"sd-select-list-item__checkbox",onClick:this.handleCheckboxClick,onSdUpdate:this.handleCheckboxUpdate}),d(this.option.label)?i("span",{class:"sd-select-list-item__label",ref:e=>e&&(e.innerHTML=m(this.option.label))}):i("span",{class:"sd-select-list-item__label"},this.option.label),this.countInfo&&i("span",{key:"52162297e94d672128ea0a2343c6baf6e04ee78c",class:"sd-select-list-item__count"},"(",this.countInfo.selected,"/",this.countInfo.total,")"))}static get style(){return"sd-select-list-item{display:block}sd-select-list-item .sd-select-list-item{display:flex;align-items:center;gap:var(--list-item-gap);padding:var(--list-item-padding-y) var(--list-item-padding-right) var(--list-item-padding-y) var(--list-item-padding-left);font-size:var(--list-item-font-size);line-height:var(--list-item-line-height);font-weight:var(--list-item-font-weight);background:var(--list-item-bg);color:var(--list-item-color);cursor:default;user-select:none}sd-select-list-item .sd-select-list-item--selectable{cursor:pointer}sd-select-list-item .sd-select-list-item--depth1-group{border-top:var(--list-item-border-top);font-weight:700}sd-select-list-item .sd-select-list-item--depth2-group{font-weight:500}sd-select-list-item .sd-select-list-item--focused.sd-select-list-item--selectable:not(.sd-select-list-item--disabled){background:var(--list-item-bg-hover);color:var(--list-item-color-hover)}sd-select-list-item .sd-select-list-item--selected:not(.sd-select-list-item--group){font-weight:var(--list-item-font-weight-selected);color:var(--list-item-color-selected)}sd-select-list-item .sd-select-list-item--selected.sd-select-list-item--focused{color:var(--list-item-color-hover)}sd-select-list-item .sd-select-list-item--disabled{color:var(--list-item-color-disabled);cursor:not-allowed}sd-select-list-item .sd-select-list-item__label{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-list-item .sd-select-list-item__count{flex-shrink:0;font-weight:500;color:var(--list-item-color-disabled)}sd-select-list-item .sd-select-list-item--group.sd-select-list-item--focused .sd-select-list-item__count{color:#ffffff}sd-select-list-item .sd-select-list-item__checkbox{flex-shrink:0}"}},[512,"sd-select-list-item",{option:[16],depth:[2],isSelected:[4,"is-selected"],isFocused:[4,"is-focused"],useCheckbox:[4,"use-checkbox"],countInfo:[16]}]);function p(){"undefined"!=typeof customElements&&["sd-select-list-item","sd-checkbox","sd-icon"].forEach((e=>{switch(e){case"sd-select-list-item":customElements.get(l(e))||customElements.define(l(e),n);break;case"sd-checkbox":customElements.get(l(e))||a();break;case"sd-icon":customElements.get(l(e))||h()}}))}export{n as S,p as d}
1
+ import{p as t,H as e,c as s,h as i,t as l}from"./p-CEVDmQdt.js";import{L as c,i as d,a as o,b as r}from"./p-DvvGi4J_.js";import{s as m}from"./p-BE4tnQ2Z.js";import{d as a}from"./p-D3dq5pt5.js";import{d as h}from"./p-BnhzUsGP.js";const n=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.listItemClick=s(this,"sdListItemClick",7)}option;depth=1;isSelected=!1;isFocused=!1;useCheckbox=!1;countInfo;listItemClick;get isGroup(){return!!this.option.children}get isSelectable(){return!this.isGroup||this.useCheckbox}get depthKey(){return this.depth<=1?"depth1":2===this.depth?"depth2":"depth3"}get paddingLeft(){return`${c.paddingLeft[this.depthKey]}px`}handleClick=t=>{t.stopPropagation(),!this.option.disabled&&this.isSelectable&&this.listItemClick.emit(this.option)};handleCheckboxClick=t=>{t.stopPropagation()};handleCheckboxUpdate=t=>{t.stopPropagation(),!this.option.disabled&&this.isSelectable&&this.listItemClick.emit(this.option)};render(){const t=this.isGroup,e=t&&1===this.depth,s=t&&2===this.depth,l={"--list-item-padding-y":`${c.paddingY}px`,"--list-item-padding-left":this.paddingLeft,"--list-item-padding-right":`${c.paddingRight}px`,"--list-item-gap":`${c.gap}px`,"--list-item-font-size":`${r.fontSize}px`,"--list-item-line-height":`${r.lineHeight}px`,"--list-item-font-weight":r.fontWeight,"--list-item-bg":e?o.depth1.bg:s?o.depth2.bg:o.bg.default,"--list-item-bg-hover":o.bg.hover,"--list-item-color":o.content.default,"--list-item-color-hover":o.content.hover,"--list-item-color-disabled":o.content.disabled,"--list-item-color-selected":o.content.selected,"--list-item-font-weight-selected":r.selectedFontWeight};return e&&(l["--list-item-border-top"]=`${o.depth1.borderWidth}px solid ${o.depth1.border}`),i("div",{key:"42f9e69d39035fedce11095a2d5be95795831241",role:"option",tabindex:-1,"aria-selected":!0===this.isSelected?"true":"false",class:{"sd-select-list-item":!0,"sd-select-list-item--group":t,"sd-select-list-item--depth1-group":e,"sd-select-list-item--depth2-group":s,"sd-select-list-item--selected":!0===this.isSelected,"sd-select-list-item--indeterminate":null===this.isSelected,"sd-select-list-item--focused":this.isFocused,"sd-select-list-item--selectable":this.isSelectable&&!this.option.disabled,"sd-select-list-item--disabled":!!this.option.disabled},style:l,onClick:this.handleClick},this.useCheckbox&&i("sd-checkbox",{key:"655cf931840a15545c1afdd4aeb2044c7ae24c0a",value:null===this.isSelected?null:!!this.isSelected,disabled:this.option.disabled,inverse:this.isFocused&&!1!==this.isSelected,class:"sd-select-list-item__checkbox",onClick:this.handleCheckboxClick,onSdUpdate:this.handleCheckboxUpdate}),d(this.option.label)?i("span",{class:"sd-select-list-item__label",ref:t=>t&&(t.innerHTML=m(this.option.label))}):i("span",{class:"sd-select-list-item__label"},this.option.label),this.countInfo&&i("span",{key:"5461f3861a093d25e866cd94e603a4b6017fd701",class:"sd-select-list-item__count"},"(",this.countInfo.selected,"/",this.countInfo.total,")"))}static get style(){return"sd-select-list-item{display:block}sd-select-list-item .sd-select-list-item{display:flex;align-items:center;gap:var(--list-item-gap);padding:var(--list-item-padding-y) var(--list-item-padding-right) var(--list-item-padding-y) var(--list-item-padding-left);font-size:var(--list-item-font-size);line-height:var(--list-item-line-height);font-weight:var(--list-item-font-weight);background:var(--list-item-bg);color:var(--list-item-color);cursor:default;user-select:none}sd-select-list-item .sd-select-list-item--selectable{cursor:pointer}sd-select-list-item .sd-select-list-item--depth1-group{border-top:var(--list-item-border-top);font-weight:700}sd-select-list-item .sd-select-list-item--depth2-group{font-weight:500}sd-select-list-item .sd-select-list-item--focused.sd-select-list-item--selectable:not(.sd-select-list-item--disabled){background:var(--list-item-bg-hover);color:var(--list-item-color-hover)}sd-select-list-item .sd-select-list-item--selected:not(.sd-select-list-item--group){font-weight:var(--list-item-font-weight-selected);color:var(--list-item-color-selected)}sd-select-list-item .sd-select-list-item--selected.sd-select-list-item--focused{color:var(--list-item-color-hover)}sd-select-list-item .sd-select-list-item--disabled{color:var(--list-item-color-disabled);cursor:not-allowed}sd-select-list-item .sd-select-list-item__label{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-list-item .sd-select-list-item__count{flex-shrink:0;font-weight:500;color:var(--list-item-color-disabled)}sd-select-list-item .sd-select-list-item--group.sd-select-list-item--focused .sd-select-list-item__count{color:#ffffff}sd-select-list-item .sd-select-list-item__checkbox{flex-shrink:0}"}},[512,"sd-select-list-item",{option:[16],depth:[2],isSelected:[4,"is-selected"],isFocused:[4,"is-focused"],useCheckbox:[4,"use-checkbox"],countInfo:[16]}]);function p(){"undefined"!=typeof customElements&&["sd-select-list-item","sd-checkbox","sd-icon"].forEach((t=>{switch(t){case"sd-select-list-item":customElements.get(l(t))||customElements.define(l(t),n);break;case"sd-checkbox":customElements.get(l(t))||a();break;case"sd-icon":customElements.get(l(t))||h()}}))}export{n as S,p as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as e,h as n,d as i,t as s}from"./p-CEVDmQdt.js";import{d as a}from"./p-BnhzUsGP.js";var d={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},o={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},g={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},r={content:"#FB4444",bg:"#FCEFEF"},c={content:"#FF6B00",bg:"#FEF1EA"},h={content:"#916C0D",bg:"#FFF7DD"},l={content:"#00973C",bg:"#E8F9EF"},p={content:"#0075FF",bg:"#E6F1FF"},u={content:"#006AC1",bg:"#EAF5FE"},f={content:"#004290",bg:"#EFF6FF"},b={content:"#737373",bg:"#EEEEEE"};const x=["xs","sm","md"],m=["grey","red","orange","yellow","green","blue","darkblue","indigo"],y={grey:{background:b.bg,content:b.content,icon:b.content},red:{background:r.bg,content:r.content,icon:r.content},orange:{background:c.bg,content:c.content,icon:c.content},yellow:{background:h.bg,content:h.content,icon:h.content},green:{background:l.bg,content:l.content,icon:l.content},blue:{background:p.bg,content:p.content,icon:p.content},darkblue:{background:u.bg,content:u.content,icon:u.content},indigo:{background:f.bg,content:f.content,icon:f.content}},F={xs:{height:`${d.height}px`,paddingX:`${d.paddingX}px`,gap:`${d.gap}px`,fontSize:`${d.typography.fontSize}px`,fontWeight:d.typography.fontWeight,lineHeight:`${d.typography.lineHeight}px`,iconSize:12,radius:`${d.radius}px`},sm:{height:`${o.height}px`,paddingX:`${o.paddingX}px`,gap:`${o.gap}px`,fontSize:`${o.typography.fontSize}px`,fontWeight:o.typography.fontWeight,lineHeight:`${o.typography.lineHeight}px`,iconSize:16,radius:`${o.radius}px`},md:{height:`${g.height}px`,paddingX:`${g.paddingX}px`,gap:`${g.gap}px`,fontSize:`${g.typography.fontSize}px`,fontWeight:g.typography.fontWeight,lineHeight:`${g.typography.lineHeight}px`,iconSize:16,radius:`${g.radius}px`}},$={xs:{...F.xs,radius:"999px"},sm:{...F.sm,radius:"999px"},md:{...F.md,radius:"999px"}},E=Object.fromEntries(["square","pill"].flatMap((t=>x.flatMap((e=>m.map((n=>[`${t}_${e}_${n}`,{shape:t,size:e,color:n,..."square"===t?F[e]:$[e],...y[n]}]))))))),k=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost()}name="square_sm_grey";label="";icon;isLeft=!0;width="";componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(E,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return E[this.resolvedName]}renderIcon(t,e){return null==this.icon?null:n("sd-icon",{class:"sd-tag__icon",name:this.icon,size:e,color:t})}get resolvedWidth(){if(""!==this.width&&0!==this.width)return"number"==typeof this.width?`${this.width}px`:this.width}render(){const t=this.resolvedConfig,e=this.renderIcon(t.icon,t.iconSize),s=this.resolvedWidth;return n(i,{key:"77b65a35be3456f1bf821a0b276fd1e5820f5b90",style:null!=s?{"--sd-tag-width":s}:void 0},n("span",{key:"806c855067690cedefa8d867d3535fd83aab4d73",class:"sd-tag",style:{"--sd-tag-background":t.background,"--sd-tag-content":t.content,"--sd-tag-height":t.height,"--sd-tag-padding-x":t.paddingX,"--sd-tag-gap":t.gap,"--sd-tag-font-size":t.fontSize,"--sd-tag-font-weight":t.fontWeight,"--sd-tag-line-height":t.lineHeight,"--sd-tag-radius":t.radius},"aria-label":this.label||"tag"},this.icon&&this.isLeft&&e,n("span",{key:"88891681230cc9b916428d60814b4d90c1614c20",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&e))}static get style(){return"sd-tag{display:inline-flex;width:var(--sd-tag-width, fit-content);height:fit-content}.sd-tag{display:inline-flex;width:100%;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}"}},[512,"sd-tag",{name:[1],label:[1],icon:[1],isLeft:[4,"is-left"],width:[8]}]);function w(){"undefined"!=typeof customElements&&["sd-tag","sd-icon"].forEach((t=>{switch(t){case"sd-tag":customElements.get(s(t))||customElements.define(s(t),k);break;case"sd-icon":customElements.get(s(t))||a()}}))}export{k as S,w as d}
@@ -1 +1 @@
1
- import{p as e,H as i,c as s,h as t,t as l}from"./p-CEVDmQdt.js";import{n as r}from"./p-CCwNgVmC.js";import{d as o}from"./p-C3rOud8J.js";import{d as a}from"./p-DBw58vNP.js";import{d}from"./p-0eogwabp.js";import{d as n}from"./p-DMvWCQfX.js";import{d as c}from"./p-BlN03Cqm.js";import{d as p}from"./p-BnhzUsGP.js";import{d as h}from"./p-BckY1cBy.js";import{d as f}from"./p-D8T1XeGP.js";import{d as u}from"./p-BGpxtouI.js";var m={sm:{height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const k={height:m.sm.height,paddingX:m.sm.paddingX,gap:m.sm.gap,radius:m.sm.radius,fontSize:m.sm.typography.fontSize,lineHeight:m.sm.typography.lineHeight,fontWeight:m.sm.typography.fontWeight,iconSize:m.sm.icon},b={text:m.text,icon:{default:"#888888",disabled:m.icon.disabled}},x=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.reject=s(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name=r();label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdResetValidation())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e,i=0){const s=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),l=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=l&&i+e.length>l)return{accepted:[],rejected:e,reason:"max-files"};if(null!=s){const i=e.filter((e=>e.size>s));if(i.length>0)return{accepted:[],rejected:i,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const s=Array.from(i);if(this.multiple){const e=Array.isArray(this.internalValue)?this.internalValue:[],{accepted:i,rejected:t,reason:l}=this.validateFiles(s,e.length);if(this.fileInputRef&&(this.fileInputRef.value=""),null!=l)return void this.reject?.emit({files:t,reason:l});const r=[...e,...i];this.internalValue=r,this.value=r,this.update?.emit(this.value)}else{const{accepted:e,rejected:i,reason:t}=this.validateFiles(s);if(null!=t)return this.reject?.emit({files:i,reason:t}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=e[0],this.value=this.internalValue,this.update?.emit(this.value)}};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!this.multiple&&!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}hasChips(){return Array.isArray(this.internalValue)&&this.internalValue.length>0}getDisplayText(){return this.hasFiles()&&this.internalValue?.name||(this.placeholder??"Click to upload")}handleChipRemove=e=>{if(!Array.isArray(this.internalValue))return;const i=[...this.internalValue];i.splice(e,1),this.internalValue=i,this.value=i,this.update?.emit(this.value)};renderChipList(){return this.hasChips()?t("div",{class:"sd-file-picker__chip-list"},this.internalValue.map(((e,i)=>t("sd-chip",{value:e.name,onSdRemove:()=>this.handleChipRemove(i)})))):null}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?b.icon.disabled:b.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),s={"--sd-file-picker-font-size":`${k.fontSize}px`,"--sd-file-picker-line-height":`${k.lineHeight}px`,"--sd-file-picker-font-weight":k.fontWeight,"--sd-file-picker-padding-x":`${k.paddingX}px`,"--sd-file-picker-gap":`${k.gap}px`,"--sd-file-picker-text-color":b.text.default,"--sd-file-picker-placeholder-color":b.text.placeholder,"--sd-file-picker-disabled-color":b.text.disabled,"--sd-system-size-field-sm-height":`${k.height}px`,"--sd-system-radius-field-sm":`${k.radius}px`},l=t("div",{role:"button",tabindex:this.disabled?-1:0,class:"sd-file-picker__content",onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},t("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder??"Click to upload"}),t("sd-icon",{name:"attachFile",size:Number(k.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),t("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&t("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&t("div",{class:"sd-file-picker__tooltip"},i));return this.inline?t("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:s,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l,this.renderChipList()):t("div",{class:"sd-file-picker__wrapper",style:s},t("sd-field",{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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l),this.renderChipList())}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:flex;flex-direction:column;width:100%}.sd-file-picker__wrapper{display:flex;flex-direction:column;width:100%}.sd-file-picker__chip-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-chip","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),x);break;case"sd-button":customElements.get(l(e))||o();break;case"sd-chip":customElements.get(l(e))||a();break;case"sd-field":customElements.get(l(e))||d();break;case"sd-floating-portal":customElements.get(l(e))||n();break;case"sd-ghost-button":customElements.get(l(e))||c();break;case"sd-icon":customElements.get(l(e))||p();break;case"sd-portal":customElements.get(l(e))||h();break;case"sd-tag":customElements.get(l(e))||f();break;case"sd-tooltip":customElements.get(l(e))||u()}}))}export{x as S,g as d}
1
+ import{p as e,H as i,c as s,h as t,t as l}from"./p-CEVDmQdt.js";import{n as r}from"./p-CCwNgVmC.js";import{d as o}from"./p-C3rOud8J.js";import{d as a}from"./p-DU2_jzh4.js";import{d}from"./p-UkSGSWSA.js";import{d as n}from"./p-BOrdn-Js.js";import{d as c}from"./p-B4ua22vZ.js";import{d as p}from"./p-BnhzUsGP.js";import{d as h}from"./p-BckY1cBy.js";import{d as f}from"./p-C7sUn4qb.js";import{d as u}from"./p-DsGK3Aye.js";var m={sm:{height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const k={height:m.sm.height,paddingX:m.sm.paddingX,gap:m.sm.gap,radius:m.sm.radius,fontSize:m.sm.typography.fontSize,lineHeight:m.sm.typography.lineHeight,fontWeight:m.sm.typography.fontWeight,iconSize:m.sm.icon},b={text:m.text,icon:{default:"#888888",disabled:m.icon.disabled}},x=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.reject=s(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name=r();label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdResetValidation())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e,i=0){const s=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),l=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=l&&i+e.length>l)return{accepted:[],rejected:e,reason:"max-files"};if(null!=s){const i=e.filter((e=>e.size>s));if(i.length>0)return{accepted:[],rejected:i,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const s=Array.from(i);if(this.multiple){const e=Array.isArray(this.internalValue)?this.internalValue:[],{accepted:i,rejected:t,reason:l}=this.validateFiles(s,e.length);if(this.fileInputRef&&(this.fileInputRef.value=""),null!=l)return void this.reject?.emit({files:t,reason:l});const r=[...e,...i];this.internalValue=r,this.value=r,this.update?.emit(this.value)}else{const{accepted:e,rejected:i,reason:t}=this.validateFiles(s);if(null!=t)return this.reject?.emit({files:i,reason:t}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=e[0],this.value=this.internalValue,this.update?.emit(this.value)}};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!this.multiple&&!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}hasChips(){return Array.isArray(this.internalValue)&&this.internalValue.length>0}getDisplayText(){return this.hasFiles()&&this.internalValue?.name||(this.placeholder??"Click to upload")}handleChipRemove=e=>{if(!Array.isArray(this.internalValue))return;const i=[...this.internalValue];i.splice(e,1),this.internalValue=i,this.value=i,this.update?.emit(this.value)};renderChipList(){return this.hasChips()?t("div",{class:"sd-file-picker__chip-list"},this.internalValue.map(((e,i)=>t("sd-chip",{value:e.name,onSdRemove:()=>this.handleChipRemove(i)})))):null}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?b.icon.disabled:b.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),s={"--sd-file-picker-font-size":`${k.fontSize}px`,"--sd-file-picker-line-height":`${k.lineHeight}px`,"--sd-file-picker-font-weight":k.fontWeight,"--sd-file-picker-padding-x":`${k.paddingX}px`,"--sd-file-picker-gap":`${k.gap}px`,"--sd-file-picker-text-color":b.text.default,"--sd-file-picker-placeholder-color":b.text.placeholder,"--sd-file-picker-disabled-color":b.text.disabled,"--sd-system-size-field-sm-height":`${k.height}px`,"--sd-system-radius-field-sm":`${k.radius}px`},l=t("div",{role:"button",tabindex:this.disabled?-1:0,class:"sd-file-picker__content",onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},t("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder??"Click to upload"}),t("sd-icon",{name:"attachFile",size:Number(k.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),t("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&t("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&t("div",{class:"sd-file-picker__tooltip"},i));return this.inline?t("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:s,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l,this.renderChipList()):t("div",{class:"sd-file-picker__wrapper",style:s},t("sd-field",{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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l),this.renderChipList())}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:flex;flex-direction:column;width:100%}.sd-file-picker__wrapper{display:flex;flex-direction:column;width:100%}.sd-file-picker__chip-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-chip","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),x);break;case"sd-button":customElements.get(l(e))||o();break;case"sd-chip":customElements.get(l(e))||a();break;case"sd-field":customElements.get(l(e))||d();break;case"sd-floating-portal":customElements.get(l(e))||n();break;case"sd-ghost-button":customElements.get(l(e))||c();break;case"sd-icon":customElements.get(l(e))||p();break;case"sd-portal":customElements.get(l(e))||h();break;case"sd-tag":customElements.get(l(e))||f();break;case"sd-tooltip":customElements.get(l(e))||u()}}))}export{x as S,g as d}
@@ -1 +1 @@
1
- import{p as t,H as s,c as e,h as o,t as a}from"./p-CEVDmQdt.js";import{d as n}from"./p-C3rOud8J.js";import{d}from"./p-BlN03Cqm.js";import{d as i}from"./p-BnhzUsGP.js";import{d as c}from"./p-BckY1cBy.js";import{d as l}from"./p-D8T1XeGP.js";var r={bg:"#07284A",content:"#FFFFFF"},b={bg:"#FB4444",content:"#FFFFFF"},f={bg:"#FFC700",content:"#222222"},p={bg:"#00973C",content:"#FFFFFF"},u={bg:"#005CC9",content:"#FFFFFF"},m={bg:"#E6F1FF",icon:"#0075FF",text:"#222222",textLink:"#555555"};const g={default:"secondary_sm",danger:"danger_outline_sm",caution:"neutral_outline_sm",complete:"neutral_outline_sm",accent:"neutral_outline_sm",info:"secondary_sm"},h={default:{bg:r.bg,content:r.content},danger:{bg:b.bg,content:b.content},caution:{bg:f.bg,content:f.content},complete:{bg:p.bg,content:p.content},accent:{bg:u.bg,content:u.content},info:{bg:m.bg,content:m.text,icon:m.icon,linkColor:m.textLink}},k={iconSize:"16"},_=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=e(this,"sdClose",7),this.buttonClick=e(this,"sdButtonClick",7)}icon;message;link;linkLabel;buttonLabel;useClose=!1;type="default";close;buttonClick;render(){const t=h[this.type]??h.default,s=Number(k.iconSize),e=t.icon??t.content,a=t.linkColor??t.content,n=["default","caution","info"].includes(this.type),d=g[this.type]??g.default;return o("div",{key:"240ed7553fa03d18bb4384b1192d16a821be5832",style:{"--sd-toast-bg":t.bg,"--sd-toast-text":t.content,"--sd-toast-icon":e,"--sd-toast-link":a}},o("div",{key:"bdb9a45473dcab86e2dd8bb6321e7b717f93b784",class:"sd-toast",role:"status","aria-live":"polite","aria-atomic":"true"},this.icon&&o("div",{key:"2a02e47336cd6a46c7cc3560f3f82d4f10a3d211",class:"sd-toast__icon"},o("sd-icon",{key:"872cfb213c3a080fc1e5458ce53efa04c1fa8840",name:this.icon,size:s,color:e})),o("div",{key:"3a22f7518f63676e22c4faeb76873c31d6cf6b11",class:"sd-toast__content"},o("span",{key:"dd6a533b60c07bdcbdc80090d61bdf29b8879609",class:"sd-toast__message"},this.message)),this.link&&o("a",{key:"45efddf62b906e8f0b2136ad3d1131204d0b9125",href:this.link,class:"sd-toast__link",target:"_blank",rel:"noopener noreferrer"},this.linkLabel||this.link),this.buttonLabel&&o("sd-button",{key:"3729f4f21ba7e59c2702137053de946e284b226a",class:"sd-toast__button",name:d,label:this.buttonLabel,onSdClick:t=>this.buttonClick.emit(t.detail)}),this.useClose&&o("sd-ghost-button",{key:"d7f0f670aef527be6253cd70bd2b19a900ccaddd",class:"sd-toast__close",icon:"close",intent:n?"default":"inverse",ariaLabel:"close",size:"xs",onClick:()=>this.close.emit()})))}static get style(){return"sd-toast{display:block;width:fit-content;height:fit-content}sd-toast .sd-toast{display:flex;width:fit-content;align-items:center;gap:var(--sd-toast-gap, 16px);padding:var(--sd-toast-padding-y, 12px) var(--sd-toast-padding-x, 24px);border-radius:var(--sd-toast-radius, 8px);background-color:var(--sd-toast-bg);color:var(--sd-toast-text);box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}sd-toast .sd-toast__icon{display:flex;align-items:center;flex-shrink:0}sd-toast .sd-toast__content{display:flex;flex:1}sd-toast .sd-toast__message{font-size:14px;line-height:24px;font-weight:500;white-space:nowrap}sd-toast .sd-toast__link{font-size:14px;line-height:24px;font-weight:700;color:var(--sd-toast-link, var(--sd-toast-text));text-decoration:underline;cursor:pointer;transition:opacity 0.2s ease;margin-left:4px;white-space:nowrap}sd-toast .sd-toast__link:hover{opacity:0.8}sd-toast .sd-toast__button{flex-shrink:0}sd-toast .sd-toast__close{flex-shrink:0}"}},[512,"sd-toast",{icon:[1],message:[1],link:[1],linkLabel:[1,"link-label"],buttonLabel:[1,"button-label"],useClose:[4,"use-close"],type:[1]}]);function F(){"undefined"!=typeof customElements&&["sd-toast","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-toast":customElements.get(a(t))||customElements.define(a(t),_);break;case"sd-button":customElements.get(a(t))||n();break;case"sd-ghost-button":customElements.get(a(t))||d();break;case"sd-icon":customElements.get(a(t))||i();break;case"sd-portal":customElements.get(a(t))||c();break;case"sd-tag":customElements.get(a(t))||l()}}))}export{_ as S,F as d}
1
+ import{p as t,H as s,c as e,h as a,t as o}from"./p-CEVDmQdt.js";import{d as n}from"./p-C3rOud8J.js";import{d}from"./p-B4ua22vZ.js";import{d as i}from"./p-BnhzUsGP.js";import{d as c}from"./p-BckY1cBy.js";import{d as l}from"./p-C7sUn4qb.js";var r={bg:"#07284A",content:"#FFFFFF"},b={bg:"#FB4444",content:"#FFFFFF"},f={bg:"#FFC700",content:"#222222"},u={bg:"#00973C",content:"#FFFFFF"},p={bg:"#005CC9",content:"#FFFFFF"},m={bg:"#E6F1FF",icon:"#0075FF",text:"#222222",textLink:"#555555"};const g={default:"secondary_sm",danger:"danger_outline_sm",caution:"neutral_outline_sm",complete:"neutral_outline_sm",accent:"neutral_outline_sm",info:"secondary_sm"},h={default:{bg:r.bg,content:r.content},danger:{bg:b.bg,content:b.content},caution:{bg:f.bg,content:f.content},complete:{bg:u.bg,content:u.content},accent:{bg:p.bg,content:p.content},info:{bg:m.bg,content:m.text,icon:m.icon,linkColor:m.textLink}},k={iconSize:"16"},_=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=e(this,"sdClose",7),this.buttonClick=e(this,"sdButtonClick",7)}icon;message;link;linkLabel;buttonLabel;useClose=!1;type="default";close;buttonClick;render(){const t=h[this.type]??h.default,s=Number(k.iconSize),e=t.icon??t.content,o=t.linkColor??t.content,n=["default","caution","info"].includes(this.type),d=g[this.type]??g.default;return a("div",{key:"98f2adc86e98e6e1a33eec9f1166a36fd0132091",style:{"--sd-toast-bg":t.bg,"--sd-toast-text":t.content,"--sd-toast-icon":e,"--sd-toast-link":o}},a("div",{key:"bf62e48b849b5d233b917e9bff8b516cdee3273d",class:"sd-toast",role:"status","aria-live":"polite","aria-atomic":"true"},this.icon&&a("div",{key:"4a17910884a1778ff647cc4037d23a25834a5c8d",class:"sd-toast__icon"},a("sd-icon",{key:"7b6d9567d94f8351d5c07bdf4351bc028f9b0b06",name:this.icon,size:s,color:e})),a("div",{key:"1a0fa06eeb4b5aaf9a3b7804c3aa90be85797839",class:"sd-toast__content"},a("span",{key:"32eed9d06fae03ffea1de307eb006bc2889731c2",class:"sd-toast__message"},this.message)),this.link&&a("a",{key:"f1bafc6c06d5faad3fc556419ca556df9e76ee4f",href:this.link,class:"sd-toast__link",target:"_blank",rel:"noopener noreferrer"},this.linkLabel||this.link),this.buttonLabel&&a("sd-button",{key:"94fcfb175c9e302cbb27d2dc3ed7256a65960013",class:"sd-toast__button",name:d,label:this.buttonLabel,onSdClick:t=>this.buttonClick.emit(t.detail)}),this.useClose&&a("sd-ghost-button",{key:"ae2bcd09d6c0ee5afbdfeed6e268b899a308ec64",class:"sd-toast__close",icon:"close",intent:n?"default":"inverse",ariaLabel:"close",size:"xs",onClick:()=>this.close.emit()})))}static get style(){return"sd-toast{display:block;width:fit-content;height:fit-content}sd-toast .sd-toast{display:flex;width:fit-content;align-items:center;gap:var(--sd-toast-gap, 16px);padding:var(--sd-toast-padding-y, 12px) var(--sd-toast-padding-x, 24px);border-radius:var(--sd-toast-radius, 8px);background-color:var(--sd-toast-bg);color:var(--sd-toast-text);box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}sd-toast .sd-toast__icon{display:flex;align-items:center;flex-shrink:0}sd-toast .sd-toast__content{display:flex;flex:1}sd-toast .sd-toast__message{font-size:14px;line-height:24px;font-weight:500;white-space:nowrap}sd-toast .sd-toast__link{font-size:14px;line-height:24px;font-weight:700;color:var(--sd-toast-link, var(--sd-toast-text));text-decoration:underline;cursor:pointer;transition:opacity 0.2s ease;margin-left:4px;white-space:nowrap}sd-toast .sd-toast__link:hover{opacity:0.8}sd-toast .sd-toast__button{flex-shrink:0}sd-toast .sd-toast__close{flex-shrink:0}"}},[512,"sd-toast",{icon:[1],message:[1],link:[1],linkLabel:[1,"link-label"],buttonLabel:[1,"button-label"],useClose:[4,"use-close"],type:[1]}]);function F(){"undefined"!=typeof customElements&&["sd-toast","sd-button","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-toast":customElements.get(o(t))||customElements.define(o(t),_);break;case"sd-button":customElements.get(o(t))||n();break;case"sd-ghost-button":customElements.get(o(t))||d();break;case"sd-icon":customElements.get(o(t))||i();break;case"sd-portal":customElements.get(o(t))||c();break;case"sd-tag":customElements.get(o(t))||l()}}))}export{_ as S,F as d}
@@ -1 +1 @@
1
- import{p as e,H as t,c as i,h as n,t as o}from"./p-CEVDmQdt.js";import{d as s}from"./p-BnhzUsGP.js";import{d as l}from"./p-BckY1cBy.js";import{d as a}from"./p-D8T1XeGP.js";var r={textLink:{sm:{gap:"4",icon:"16",typography:{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",textDecoration:"none",lineHeight:"20"},underline:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"underline",lineHeight:"20"}}},md:{gap:"8",icon:"16",typography:{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:"14",fontWeight:"500",textDecoration:"none",lineHeight:"24"},underline:{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:"14",fontWeight:"500",textDecoration:"underline",lineHeight:"24"}}},content:{disabled:"#888888"},icon:{default:"#006AC1",disabled:"#BBBBBB"},lg:{typography:{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:"16",fontWeight:"500",textDecoration:"none",lineHeight:"26"},underline:{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:"16",fontWeight:"500",textDecoration:"underline",lineHeight:"26"}},gap:"8",icon:"20"}}};const d={sm:{gap:Number(r.textLink.sm.gap),iconSize:Number(r.textLink.sm.icon),typography:{default:r.textLink.sm.typography.default,underline:r.textLink.sm.typography.underline}},md:{gap:Number(r.textLink.md.gap),iconSize:Number(r.textLink.md.icon),typography:{default:r.textLink.md.typography.default,underline:r.textLink.md.typography.underline}},lg:{gap:Number(r.textLink.lg.gap),iconSize:Number(r.textLink.lg.icon),typography:{default:r.textLink.lg.typography.default,underline:r.textLink.lg.typography.underline}}},c={content:r.textLink.content,icon:r.textLink.icon},p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.click=i(this,"sdClick",7)}label="";icon="";iconColor="";labelClass="";rightArrow="none";underline=!1;disabled=!1;size="sm";tooltipText;get hostEl(){return this}isTooltipOpen=!1;click;handleClick=()=>{this.disabled||this.click.emit()};handleMouseEnter=()=>{this.isTooltipOpen=!0};handleMouseLeave=()=>{this.isTooltipOpen=!1};handleFocus=()=>{this.isTooltipOpen=!0};handleBlur=()=>{this.isTooltipOpen=!1};render(){const e=d[this.size]??d.sm,t=this.underline?e.typography.underline:e.typography.default,i=["sd-text-link__label",this.labelClass].filter(Boolean).join(" "),o=this.disabled?c.icon.disabled:this.iconColor||c.icon.default,s=this.disabled?c.icon.disabled:"#888888",l={"--sd-text-link-gap":`${e.gap}px`,"--sd-text-link-font-size":`${t.fontSize}px`,"--sd-text-link-line-height":`${t.lineHeight}px`,"--sd-text-link-text-decoration":t.textDecoration,...this.disabled?{"--sd-text-link-color":c.content.disabled}:{}},a=(this.tooltipText??"").trim();return n("span",{key:"d9653ed47a77fb5c00dc57f8f7cc2b4dc9035ca4",role:"button",tabindex:this.disabled?-1:0,class:{"sd-text-link":!0,"sd-text-link--disabled":this.disabled},style:l,onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},a.length>0&&this.isTooltipOpen&&n("sd-portal",{key:"62b3cb48c5b5fa6eb0b2b2962ef6c78bac5ac545",parentRef:this.hostEl,open:!0,offset:[this.hostEl.offsetWidth/2,4],placement:"top"},n("div",{key:"5a428366f5bc2f8686a78fc73d91517ccca13eb9",class:"sd-text-link__tooltip-inner","aria-hidden":"true"},n("sd-tag",{key:"3416662595e9bfd164279e684e2ead9d1575a9d8",name:"square_xs_grey",label:a}))),this.icon&&n("sd-icon",{key:"5056f0c55ebe92963e856f2970cfd74143876cfb",name:this.icon,size:e.iconSize,color:o,class:"sd-text-link__icon"}),n("span",{key:"6cf8474ba642c9ec3dc5952c5530f9ba15046053",class:i},this.label),this.rightArrow&&"none"!==this.rightArrow&&n("span",{key:"17a74ec3a3e1a26f18b73f7d4816ea0aee0cb22c",class:"sd-text-link__arrow",style:{width:"16px",height:"16px",display:"inline-flex",alignItems:"center",justifyContent:"center"}},n("sd-icon",{key:"ed0a6bf8b678a93fa8a0da907efb0cbf60427738",name:"chevron"===this.rightArrow?"chevronRight":"caretRight",size:12,color:s})))}static get style(){return"sd-text-link{display:inline-flex}sd-text-link .sd-text-link{position:relative;display:inline-flex;align-items:center;gap:var(--sd-text-link-gap);cursor:pointer;user-select:none}sd-text-link .sd-text-link__label{font-size:var(--sd-text-link-font-size, 12px);line-height:var(--sd-text-link-line-height, 20px);text-decoration:var(--sd-text-link-text-decoration);color:var(--sd-text-link-color, inherit)}sd-text-link .sd-text-link:not(.sd-text-link--disabled):hover .sd-text-link__label{text-decoration:underline}sd-text-link .sd-text-link--disabled{cursor:not-allowed}sd-text-link .sd-text-link sd-portal{position:absolute;width:0;height:0;overflow:hidden}.sd-text-link__tooltip-inner{display:inline-flex;white-space:nowrap;transform:translateX(-50%)}[data-align=right] .sd-text-link__tooltip-inner{transform:none}"}},[512,"sd-text-link",{label:[1],icon:[1],iconColor:[1,"icon-color"],labelClass:[1,"label-class"],rightArrow:[1,"right-arrow"],underline:[516],disabled:[516],size:[513],tooltipText:[1,"tooltip-text"],isTooltipOpen:[32]}]);function h(){"undefined"!=typeof customElements&&["sd-text-link","sd-icon","sd-portal","sd-tag"].forEach((e=>{switch(e){case"sd-text-link":customElements.get(o(e))||customElements.define(o(e),p);break;case"sd-icon":customElements.get(o(e))||s();break;case"sd-portal":customElements.get(o(e))||l();break;case"sd-tag":customElements.get(o(e))||a()}}))}export{p as S,h as d}
1
+ import{p as e,H as t,c as i,h as n,t as o}from"./p-CEVDmQdt.js";import{d as s}from"./p-BnhzUsGP.js";import{d as l}from"./p-BckY1cBy.js";import{d as a}from"./p-C7sUn4qb.js";var r={textLink:{sm:{gap:"4",icon:"16",typography:{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",textDecoration:"none",lineHeight:"20"},underline:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"underline",lineHeight:"20"}}},md:{gap:"8",icon:"16",typography:{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:"14",fontWeight:"500",textDecoration:"none",lineHeight:"24"},underline:{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:"14",fontWeight:"500",textDecoration:"underline",lineHeight:"24"}}},content:{disabled:"#888888"},icon:{default:"#006AC1",disabled:"#BBBBBB"},lg:{typography:{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:"16",fontWeight:"500",textDecoration:"none",lineHeight:"26"},underline:{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:"16",fontWeight:"500",textDecoration:"underline",lineHeight:"26"}},gap:"8",icon:"20"}}};const d={sm:{gap:Number(r.textLink.sm.gap),iconSize:Number(r.textLink.sm.icon),typography:{default:r.textLink.sm.typography.default,underline:r.textLink.sm.typography.underline}},md:{gap:Number(r.textLink.md.gap),iconSize:Number(r.textLink.md.icon),typography:{default:r.textLink.md.typography.default,underline:r.textLink.md.typography.underline}},lg:{gap:Number(r.textLink.lg.gap),iconSize:Number(r.textLink.lg.icon),typography:{default:r.textLink.lg.typography.default,underline:r.textLink.lg.typography.underline}}},c={content:r.textLink.content,icon:r.textLink.icon},p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.click=i(this,"sdClick",7)}label="";icon="";iconColor="";labelClass="";rightArrow="none";underline=!1;disabled=!1;size="sm";tooltipText;get hostEl(){return this}isTooltipOpen=!1;click;handleClick=()=>{this.disabled||this.click.emit()};handleMouseEnter=()=>{this.isTooltipOpen=!0};handleMouseLeave=()=>{this.isTooltipOpen=!1};handleFocus=()=>{this.isTooltipOpen=!0};handleBlur=()=>{this.isTooltipOpen=!1};render(){const e=d[this.size]??d.sm,t=this.underline?e.typography.underline:e.typography.default,i=["sd-text-link__label",this.labelClass].filter(Boolean).join(" "),o=this.disabled?c.icon.disabled:this.iconColor||c.icon.default,s=this.disabled?c.icon.disabled:"#888888",l={"--sd-text-link-gap":`${e.gap}px`,"--sd-text-link-font-size":`${t.fontSize}px`,"--sd-text-link-line-height":`${t.lineHeight}px`,"--sd-text-link-text-decoration":t.textDecoration,...this.disabled?{"--sd-text-link-color":c.content.disabled}:{}},a=(this.tooltipText??"").trim();return n("span",{key:"d9653ed47a77fb5c00dc57f8f7cc2b4dc9035ca4",role:"button",tabindex:this.disabled?-1:0,class:{"sd-text-link":!0,"sd-text-link--disabled":this.disabled},style:l,onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},a.length>0&&this.isTooltipOpen&&n("sd-portal",{key:"62b3cb48c5b5fa6eb0b2b2962ef6c78bac5ac545",parentRef:this.hostEl,open:!0,offset:[this.hostEl.offsetWidth/2,4],placement:"top"},n("div",{key:"5a428366f5bc2f8686a78fc73d91517ccca13eb9",class:"sd-text-link__tooltip-inner","aria-hidden":"true"},n("sd-tag",{key:"3416662595e9bfd164279e684e2ead9d1575a9d8",name:"square_xs_grey",label:a}))),this.icon&&n("sd-icon",{key:"5056f0c55ebe92963e856f2970cfd74143876cfb",name:this.icon,size:e.iconSize,color:o,class:"sd-text-link__icon"}),n("span",{key:"6cf8474ba642c9ec3dc5952c5530f9ba15046053",class:i},this.label),this.rightArrow&&"none"!==this.rightArrow&&n("span",{key:"17a74ec3a3e1a26f18b73f7d4816ea0aee0cb22c",class:"sd-text-link__arrow",style:{width:"16px",height:"16px",display:"inline-flex",alignItems:"center",justifyContent:"center"}},n("sd-icon",{key:"ed0a6bf8b678a93fa8a0da907efb0cbf60427738",name:"chevron"===this.rightArrow?"chevronRight":"caretRight",size:12,color:s})))}static get style(){return"sd-text-link{display:inline-flex}sd-text-link .sd-text-link{position:relative;display:inline-flex;align-items:center;gap:var(--sd-text-link-gap);cursor:pointer;user-select:none}sd-text-link .sd-text-link__label{font-size:var(--sd-text-link-font-size, 12px);line-height:var(--sd-text-link-line-height, 20px);text-decoration:var(--sd-text-link-text-decoration);color:var(--sd-text-link-color, inherit)}sd-text-link .sd-text-link:not(.sd-text-link--disabled):hover .sd-text-link__label{text-decoration:underline}sd-text-link .sd-text-link--disabled{cursor:not-allowed}sd-text-link .sd-text-link sd-portal{position:absolute;width:0;height:0;overflow:hidden}.sd-text-link__tooltip-inner{display:inline-flex;white-space:nowrap;transform:translateX(-50%)}[data-align=right] .sd-text-link__tooltip-inner{transform:none}"}},[512,"sd-text-link",{label:[1],icon:[1],iconColor:[1,"icon-color"],labelClass:[1,"label-class"],rightArrow:[1,"right-arrow"],underline:[516],disabled:[516],size:[513],tooltipText:[1,"tooltip-text"],isTooltipOpen:[32]}]);function h(){"undefined"!=typeof customElements&&["sd-text-link","sd-icon","sd-portal","sd-tag"].forEach((e=>{switch(e){case"sd-text-link":customElements.get(o(e))||customElements.define(o(e),p);break;case"sd-icon":customElements.get(o(e))||s();break;case"sd-portal":customElements.get(o(e))||l();break;case"sd-tag":customElements.get(o(e))||a()}}))}export{p as S,h as d}
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as i,t as a}from"./p-CEVDmQdt.js";import{n as d}from"./p-CCwNgVmC.js";import{d as o,D as r,a as l}from"./p-h9_f4fUW.js";import{d as n}from"./p-C3rOud8J.js";import{d as c}from"./p-CqivNcjh.js";import{d as h}from"./p-0eogwabp.js";import{d as p}from"./p-DMvWCQfX.js";import{d as m}from"./p-BlN03Cqm.js";import{d as b}from"./p-BnhzUsGP.js";import{d as u}from"./p-BckY1cBy.js";import{d as f}from"./p-D8T1XeGP.js";import{d as g}from"./p-BGpxtouI.js";const k=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;name=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{e.stopPropagation(),this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.sm;return i("sd-field",{key:"d40168072c744016d87e7e812b781f7cfeacbc0f",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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"75a6029631b17e71ce9ba984cb0804d4f0e4b003",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"50239daa174a49c306cd79633fc2b26756650b39",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"6b2bc9b10b5337b24ba2403a1a3dc29cf8c49007",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-calendar",{key:"04274e5bd12c2a3a9c0b6879c49fae4b547e5670",elevated:!0,value:this.value,selectable:this.selectable,onSdUpdate:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],name:[1],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]);function y(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),k);break;case"sd-button":customElements.get(a(e))||n();break;case"sd-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||h();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tag":customElements.get(a(e))||f();break;case"sd-tooltip":customElements.get(a(e))||g()}}))}export{k as S,y as d}
1
+ import{p as e,H as s,c as t,h as i,t as a}from"./p-CEVDmQdt.js";import{n as d}from"./p-CCwNgVmC.js";import{d as o,D as r,a as l}from"./p-aYmWxyum.js";import{d as n}from"./p-C3rOud8J.js";import{d as c}from"./p-BAIi5T00.js";import{d as h}from"./p-UkSGSWSA.js";import{d as p}from"./p-BOrdn-Js.js";import{d as m}from"./p-B4ua22vZ.js";import{d as b}from"./p-BnhzUsGP.js";import{d as u}from"./p-BckY1cBy.js";import{d as f}from"./p-C7sUn4qb.js";import{d as g}from"./p-DsGK3Aye.js";const k=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;name=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{e.stopPropagation(),this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.sm;return i("sd-field",{key:"ffb39c09ac88e10d083eea775c1bc01532c625bc",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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"c9501fc3a0b2f0df85b78887c23d41737f95dff1",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"b09f91b2c5433913d85116498d582cfa631a8534",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"8f15c254eef196212499746da68d7cdd52bfc338",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-calendar",{key:"3939d9444c6674b0aaa54aaec186ba6fbd988bf4",elevated:!0,value:this.value,selectable:this.selectable,onSdUpdate:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],name:[1],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]);function y(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),k);break;case"sd-button":customElements.get(a(e))||n();break;case"sd-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||h();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tag":customElements.get(a(e))||f();break;case"sd-tooltip":customElements.get(a(e))||g()}}))}export{k as S,y as d}
@@ -1 +1 @@
1
- import{p as t,H as s,c as e,h as i,t as h}from"./p-CEVDmQdt.js";import{c as o,d as l,f as r,i as n,e as c,E as d,g as a}from"./p-DvvGi4J_.js";import{d as u}from"./p-D3dq5pt5.js";import{d as m}from"./p-BnhzUsGP.js";import{d as p}from"./p-CtNDxhxx.js";import{d as f}from"./p-CNwoxvpg.js";const x=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti&&this.getAllNonDisabledLeaves().length>0}getAllNonDisabledLeaves(){const t=s=>s.flatMap((s=>s.disabled?[]:s.children?t(s.children):[s]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const s=this.getSelectedValues(),e=t.filter((t=>s.has(t.value))).length;return 0!==e&&(e===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?o(this.options):this.options.length)>=l}get filteredOptions(){if(null==this.searchKeyword||""===this.searchKeyword)return this.options;if(this.isDepth)return r(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((s=>{const e=n(s.label)?c(s.label):s.label;return null!=e&&e.toLowerCase().includes(t)}))}get isEmpty(){return this.isDepth?0===o(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 s=this.getSelectedValues();if(0===s.size)return!1;const e=this.collectVisibleLeaves(t);if(0===e.length)return!1;const i=e.filter((t=>s.has(t.value))).length;return 0!==i&&(i===e.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const s=this.getSelectedValues(),e=this.collectVisibleLeaves(t);return{selected:e.filter((t=>s.has(t.value))).length,total:e.length}}findOriginalOption(t,s){for(const e of s){if(e.value===t)return e;if(e.children){const s=this.findOriginalOption(t,e.children);if(s)return s}}}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 s=this.findOriginalOption(t.value,this.options);return s?this.collectLeaves(s).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const s=[];this.showSelectAll&&s.push(t.SELECT_ALL_OPTION);const e=t=>{for(const i of t){const t=!!i.children;(!t||this.isMulti)&&!i.disabled&&s.push(i),t&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),s}isSelectAllOption(s){return this.showSelectAll&&s.value===t.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const s=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...t.SELECT_ALL_OPTION,children:s},leaves:s})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const s=this.navigableOptions[this.focusedIndex];return null!=s&&s.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 s=this.navigableOptions.findIndex((s=>s.value===t.value));s>=0&&(this.focusedIndex=s)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const s=this.navigableOptions;if("ArrowDown"===t.key){if(0===s.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%s.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===s.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?s.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=s.length)return;t.preventDefault(),t.stopPropagation();const e=s[this.focusedIndex];this.isSelectAllOption(e)?this.emitSelectAll():this.emitOptionSelect(e)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,s=t?.querySelector(".sd-select-list-item--focused");if(!t||!s)return;const e=t.getBoundingClientRect(),i=s.getBoundingClientRect();i.top<e.top?t.scrollTop+=i.top-e.top:i.bottom>e.bottom&&(t.scrollTop+=i.bottom-e.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,s=1){return t.map((t=>{const e=!!t.children;return[i("sd-select-list-item",{option:t,depth:s,isSelected:e?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),e&&t.children?this.renderOptions(t.children,s+1):null]}))}render(){return i("div",{key:"df4d19f8807ce87384cad18ca981e0792da35682",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${a.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"b950890a9138fa5ab7f0df7c1d07bbea65140e67",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"1aeaf552893becedf8394c1e9af8ef7119e70fdb",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"83329f2d454d116d64155ef8a83c076e27cdc7b0",option:t.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(t.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(t.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},d):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}]}}static get style(){return":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}"}},[513,"sd-select-listbox",{type:[1],options:[16],value:[8],emitValue:[4,"emit-value"],useSearch:[4,"use-search"],useSelectAll:[4,"use-select-all"],triggerWidth:[1,"trigger-width"],maxWidth:[1,"max-width"],maxHeight:[1,"max-height"],searchKeyword:[32],isScrolled:[32],focusedIndex:[32]},void 0,{searchKeyword:[{resetFocusOnFilter:0}]}]);function b(){"undefined"!=typeof customElements&&["sd-select-listbox","sd-checkbox","sd-icon","sd-select-list-item","sd-select-list-item-search"].forEach((t=>{switch(t){case"sd-select-listbox":customElements.get(h(t))||customElements.define(h(t),x);break;case"sd-checkbox":customElements.get(h(t))||u();break;case"sd-icon":customElements.get(h(t))||m();break;case"sd-select-list-item":customElements.get(h(t))||p();break;case"sd-select-list-item-search":customElements.get(h(t))||f()}}))}export{x as S,b as d}
1
+ import{p as t,H as s,c as e,h as i,t as h}from"./p-CEVDmQdt.js";import{c as o,d as r,f as l,i as n,e as c,E as d,g as a}from"./p-DvvGi4J_.js";import{d as u}from"./p-D3dq5pt5.js";import{d as m}from"./p-BnhzUsGP.js";import{d as p}from"./p-C7sPq8UM.js";import{d as f}from"./p-JamWHNrr.js";const x=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti&&this.getAllNonDisabledLeaves().length>0}getAllNonDisabledLeaves(){const t=s=>s.flatMap((s=>s.disabled?[]:s.children?t(s.children):[s]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const s=this.getSelectedValues(),e=t.filter((t=>s.has(t.value))).length;return 0!==e&&(e===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?o(this.options):this.options.length)>=r}get filteredOptions(){if(null==this.searchKeyword||""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((s=>{const e=n(s.label)?c(s.label):s.label;return null!=e&&e.toLowerCase().includes(t)}))}get isEmpty(){return this.isDepth?0===o(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 s=this.getSelectedValues();if(0===s.size)return!1;const e=this.collectVisibleLeaves(t);if(0===e.length)return!1;const i=e.filter((t=>s.has(t.value))).length;return 0!==i&&(i===e.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const s=this.getSelectedValues(),e=this.collectVisibleLeaves(t);return{selected:e.filter((t=>s.has(t.value))).length,total:e.length}}findOriginalOption(t,s){for(const e of s){if(e.value===t)return e;if(e.children){const s=this.findOriginalOption(t,e.children);if(s)return s}}}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 s=this.findOriginalOption(t.value,this.options);return s?this.collectLeaves(s).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const s=[];this.showSelectAll&&s.push(t.SELECT_ALL_OPTION);const e=t=>{for(const i of t){const t=!!i.children;(!t||this.isMulti)&&!i.disabled&&s.push(i),t&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),s}isSelectAllOption(s){return this.showSelectAll&&s.value===t.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const s=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...t.SELECT_ALL_OPTION,children:s},leaves:s})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const s=this.navigableOptions[this.focusedIndex];return null!=s&&s.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 s=this.navigableOptions.findIndex((s=>s.value===t.value));s>=0&&(this.focusedIndex=s)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const s=this.navigableOptions;if("ArrowDown"===t.key){if(0===s.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%s.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===s.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?s.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=s.length)return;t.preventDefault(),t.stopPropagation();const e=s[this.focusedIndex];this.isSelectAllOption(e)?this.emitSelectAll():this.emitOptionSelect(e)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,s=t?.querySelector(".sd-select-list-item--focused");if(!t||!s)return;const e=t.getBoundingClientRect(),i=s.getBoundingClientRect();i.top<e.top?t.scrollTop+=i.top-e.top:i.bottom>e.bottom&&(t.scrollTop+=i.bottom-e.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,s=1){return t.map((t=>{const e=!!t.children;return[i("sd-select-list-item",{option:t,depth:s,isSelected:e?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),e&&t.children?this.renderOptions(t.children,s+1):null]}))}render(){return i("div",{key:"86caa4b3d4fbc3bcc6214ffe8596f62b6595b2e0",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${a.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"7a4f2cf77da2af673c7c11836cf1152f8cf55c2d",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"243c0be0b5898754a35adbce89d9f72671e39a3a",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"eef122310c6a45ed876af8cd578b86d1f27a68d3",option:t.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(t.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(t.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},d):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}]}}static get style(){return":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}"}},[513,"sd-select-listbox",{type:[1],options:[16],value:[8],emitValue:[4,"emit-value"],useSearch:[4,"use-search"],useSelectAll:[4,"use-select-all"],triggerWidth:[1,"trigger-width"],maxWidth:[1,"max-width"],maxHeight:[1,"max-height"],searchKeyword:[32],isScrolled:[32],focusedIndex:[32]},void 0,{searchKeyword:[{resetFocusOnFilter:0}]}]);function b(){"undefined"!=typeof customElements&&["sd-select-listbox","sd-checkbox","sd-icon","sd-select-list-item","sd-select-list-item-search"].forEach((t=>{switch(t){case"sd-select-listbox":customElements.get(h(t))||customElements.define(h(t),x);break;case"sd-checkbox":customElements.get(h(t))||u();break;case"sd-icon":customElements.get(h(t))||m();break;case"sd-select-list-item":customElements.get(h(t))||p();break;case"sd-select-list-item-search":customElements.get(h(t))||f()}}))}export{x as S,b as d}
@@ -1 +1 @@
1
- import{p as t,H as i,c as s,h as e,t as h}from"./p-CEVDmQdt.js";import{d as n}from"./p-BlN03Cqm.js";import{d as o}from"./p-BnhzUsGP.js";import{d as a}from"./p-BckY1cBy.js";import{d}from"./p-D8T1XeGP.js";var r={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"}},c={default:"#F6F6F6",error:"#FCEFEF"},l={default:"#222222",error:"#E30000",focus:"#222222"};const p={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${{width:"1"}.width}px`},u={bg:{default:c.default,error:c.error},content:{default:l.default,error:l.error,focus:l.focus}},m={default:{fontFamily:r.default.fontFamily,fontSize:`${r.default.fontSize}px`,fontWeight:r.default.fontWeight,lineHeight:`${r.default.lineHeight}px`},focus:{fontFamily:r.focus.fontFamily,fontSize:`${r.focus.fontSize}px`,fontWeight:r.focus.fontWeight,lineHeight:`${r.focus.lineHeight}px`}},f=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.delete=s(this,"sdRemove",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}name="";value="";error=!1;disabled=!1;editable=!0;showRemove=!0;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}get isEditable(){return!1!==this.editable}enterEditMode=()=>{this.disabled||this.isEditing||!this.isEditable||(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.isEditable||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||!this.isEditable||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),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=m.default,s={"--sd-chip-height":p.height,"--sd-chip-padding-x":p.paddingX,"--sd-chip-gap":p.gap,"--sd-chip-radius":p.radius,"--sd-chip-border-width":p.borderWidth,"--sd-chip-bg":"error"===t?u.bg.error:u.bg.default,"--sd-chip-content":"error"===t?u.content.error:u.content.default,"--sd-chip-border-color":"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:"2cd717bc842330a28bbc89a662deda16f59106ee",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled&&this.isEditable},role:this.disabled||!this.isEditable?void 0:"button",tabIndex:this.disabled||this.isEditing||!this.isEditable?-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&&(this.showRemove??!0)&&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}]}}static get style(){return"sd-chip{display:inline-flex;width:fit-content;max-width:100%;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);max-width:100%;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;overflow:hidden;-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;overflow:hidden;text-overflow:ellipsis}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}"}},[512,"sd-chip",{name:[1],value:[1025],error:[1028],disabled:[4],editable:[4],showRemove:[4,"show-remove"],placeholder:[1],rules:[16],internalValue:[32],isEditing:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdResetValidation:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-chip","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-chip":customElements.get(h(t))||customElements.define(h(t),f);break;case"sd-ghost-button":customElements.get(h(t))||n();break;case"sd-icon":customElements.get(h(t))||o();break;case"sd-portal":customElements.get(h(t))||a();break;case"sd-tag":customElements.get(h(t))||d()}}))}export{m as C,f as S,u as a,p as b,g as d}
1
+ import{p as t,H as i,c as s,h as e,t as h}from"./p-CEVDmQdt.js";import{d as n}from"./p-B4ua22vZ.js";import{d as o}from"./p-BnhzUsGP.js";import{d as a}from"./p-BckY1cBy.js";import{d}from"./p-C7sUn4qb.js";var r={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"}},c={default:"#F6F6F6",error:"#FCEFEF"},l={default:"#222222",error:"#E30000",focus:"#222222"};const p={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${{width:"1"}.width}px`},u={bg:{default:c.default,error:c.error},content:{default:l.default,error:l.error,focus:l.focus}},f={default:{fontFamily:r.default.fontFamily,fontSize:`${r.default.fontSize}px`,fontWeight:r.default.fontWeight,lineHeight:`${r.default.lineHeight}px`},focus:{fontFamily:r.focus.fontFamily,fontSize:`${r.focus.fontSize}px`,fontWeight:r.focus.fontWeight,lineHeight:`${r.focus.lineHeight}px`}},m=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.delete=s(this,"sdRemove",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}name="";value="";error=!1;disabled=!1;editable=!0;showRemove=!0;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}get isEditable(){return!1!==this.editable}enterEditMode=()=>{this.disabled||this.isEditing||!this.isEditable||(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.isEditable||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||!this.isEditable||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),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=f.default,s={"--sd-chip-height":p.height,"--sd-chip-padding-x":p.paddingX,"--sd-chip-gap":p.gap,"--sd-chip-radius":p.radius,"--sd-chip-border-width":p.borderWidth,"--sd-chip-bg":"error"===t?u.bg.error:u.bg.default,"--sd-chip-content":"error"===t?u.content.error:u.content.default,"--sd-chip-border-color":"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:"2cd717bc842330a28bbc89a662deda16f59106ee",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled&&this.isEditable},role:this.disabled||!this.isEditable?void 0:"button",tabIndex:this.disabled||this.isEditing||!this.isEditable?-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&&(this.showRemove??!0)&&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}]}}static get style(){return"sd-chip{display:inline-flex;width:fit-content;max-width:100%;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);max-width:100%;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;overflow:hidden;-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;overflow:hidden;text-overflow:ellipsis}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}"}},[512,"sd-chip",{name:[1],value:[1025],error:[1028],disabled:[4],editable:[4],showRemove:[4,"show-remove"],placeholder:[1],rules:[16],internalValue:[32],isEditing:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdResetValidation:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-chip","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-chip":customElements.get(h(t))||customElements.define(h(t),m);break;case"sd-ghost-button":customElements.get(h(t))||n();break;case"sd-icon":customElements.get(h(t))||o();break;case"sd-portal":customElements.get(h(t))||a();break;case"sd-tag":customElements.get(h(t))||d()}}))}export{f as C,m as S,u as a,p as b,g as d}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,F as i,t as o}from"./p-CEVDmQdt.js";import{T as n}from"./p-B3bERWUt.js";import{d as a}from"./p-C3rOud8J.js";import{d as l}from"./p-DMvWCQfX.js";import{d as r}from"./p-BlN03Cqm.js";import{d as c}from"./p-BnhzUsGP.js";import{d}from"./p-BckY1cBy.js";import{d as h}from"./p-D8T1XeGP.js";var m={bg:"#07284A",content:"#FFFFFF"},p={bg:"#FCEFEF",content:"#FB4444"},g={bg:"#FEF1EA",content:"#FF6B00"},b={bg:"#E6F1FF",content:"#0075FF"};const u={default:{bg:m.bg,content:m.content},danger:{bg:p.bg,content:p.content},warning:{bg:g.bg,content:g.content},accent:{bg:b.bg,content:b.content}},f=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";useClose=!1;sdClass="";message=[];triggerClass="";triggerStyle="";showTooltip=!1;slotContentHTML="";buttonEl;triggerEl;isAnchorMode=!1;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;openTooltip=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};closeTooltip=()=>{this.menuEl&&this.menuEl.classList.add("sd-floating-menu--closing"),this.closeTimeout=setTimeout((()=>{this.showTooltip=!1}),t.CLOSE_ANIM_MS)};startHideTimer=()=>{this.hideTimeout=setTimeout((()=>this.closeTooltip()),100)};cancelHideTimer=()=>{this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=void 0)};get tooltipOffset(){switch(this.placement??"top"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>!this.useClose&&this.closeTooltip();async show(){this.openTooltip()}async hide(){this.closeTooltip()}componentWillLoad(){this.isAnchorMode=Array.from(this.el.children).some((t=>"anchor"===t.getAttribute("slot"))),this.isAnchorMode||(this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren()),this.el.classList.toggle("visible",!0)}componentDidRender(){this.triggerEl&&""!==this.triggerStyle&&this.triggerEl.setAttribute("style",this.triggerStyle)}render(){const t=this.trigger??"hover",s=this.placement??"top",o=this.tooltipType??"default",a=this.icon??"helpOutline",l=this.color??"#01BB4B",r=u[o]??u.default,c=()=>this.showTooltip=!this.showTooltip,d=void 0!==this.label&&""!==this.label,h=this.isAnchorMode,m="hover"===t?{onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()}:h||!d?{onClick:c}:{},p="click"===t&&!h&&d?{onSdClick:c}:{},g=["sd-tooltip-trigger",this.sdClass,this.triggerClass].filter((t=>void 0!==t&&""!==t)).join(" "),b=this.message&&this.message.length>0?this.message.map((t=>`<div>${t}</div>`)).join(""):this.slotContentHTML;return e(i,{key:"81d582c4c8847a0f57abf632d975461cdf07b535"},e("div",{key:"c7515fb866fa85749405bb10512e27575850eb27",ref:t=>this.triggerEl=t,class:g,...m},h?e("slot",{name:"anchor"}):d?e("sd-button",{ref:t=>this.buttonEl=t,name:this.name??"primary_sm",label:this.label,icon:a,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel,disabled:this.disabled,type:this.type??"button",class:"sd-tooltip",...p}):e("sd-icon",{ref:t=>this.buttonEl=t,name:a,size:this.iconSize??12,color:l,class:"sd-tooltip"})),this.showTooltip&&e("sd-floating-portal",{key:"903aaa3723a119687e5af8120d54fb1b9e43c584",parentRef:h?this.triggerEl:this.buttonEl,onSdClose:this.handleClose,placement:s,offset:this.tooltipOffset},e("div",{key:"813e1dbf7f2d8e0378f4fcac1225341aafbd9948",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${s}`]:!0,"sd-floating-menu--has-close":this.useClose},style:{"--sd-floating-bg":r.bg,"--sd-floating-content":r.content},onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()},e("i",{key:"d74071d3d236382bc952ad03a05ebd77219b4ddb",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${s}`},e(n,{key:"91c35bd2bc22294b7e7998965930219a43799310"})),e("div",{key:"16edd2fc6e9ad02b646c05c6404d3eb79e2a7a71",class:"sd-floating-menu__content",innerHTML:b}),this.useClose&&e("sd-ghost-button",{key:"d234906f7a4a603a8e18cef6da49f9d893adb731",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xxs",onClick:()=>this.closeTooltip()}))))}static get style(){return"sd-tooltip{visibility:hidden !important;display:inline-flex}sd-tooltip.visible{visibility:visible !important}sd-tooltip .sd-tooltip-trigger{display:inline-flex;position:relative;cursor:pointer;align-items:center;justify-content:center}"}},[772,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],name:[1],rightIcon:[1,"right-icon"],ariaLabel:[1,"aria-label"],disabled:[4],type:[1],useClose:[4,"use-close"],sdClass:[1,"sd-class"],message:[16],triggerClass:[1,"trigger-class"],triggerStyle:[1,"trigger-style"],showTooltip:[32],slotContentHTML:[32],show:[64],hide:[64]}]);function y(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),f);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-floating-portal":customElements.get(o(t))||l();break;case"sd-ghost-button":customElements.get(o(t))||r();break;case"sd-icon":customElements.get(o(t))||c();break;case"sd-portal":customElements.get(o(t))||d();break;case"sd-tag":customElements.get(o(t))||h()}}))}export{f as S,y as d}
1
+ import{p as t,H as s,h as e,F as i,t as o}from"./p-CEVDmQdt.js";import{T as n}from"./p-B3bERWUt.js";import{d as a}from"./p-C3rOud8J.js";import{d as l}from"./p-BOrdn-Js.js";import{d as c}from"./p-B4ua22vZ.js";import{d as r}from"./p-BnhzUsGP.js";import{d}from"./p-BckY1cBy.js";import{d as h}from"./p-C7sUn4qb.js";var m={bg:"#07284A",content:"#FFFFFF"},p={bg:"#FCEFEF",content:"#FB4444"},b={bg:"#FEF1EA",content:"#FF6B00"},g={bg:"#E6F1FF",content:"#0075FF"};const u={default:{bg:m.bg,content:m.content},danger:{bg:p.bg,content:p.content},warning:{bg:b.bg,content:b.content},accent:{bg:g.bg,content:g.content}},f=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";useClose=!1;sdClass="";message=[];triggerClass="";triggerStyle="";showTooltip=!1;slotContentHTML="";buttonEl;triggerEl;isAnchorMode=!1;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;openTooltip=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};closeTooltip=()=>{this.menuEl&&this.menuEl.classList.add("sd-floating-menu--closing"),this.closeTimeout=setTimeout((()=>{this.showTooltip=!1}),t.CLOSE_ANIM_MS)};startHideTimer=()=>{this.hideTimeout=setTimeout((()=>this.closeTooltip()),100)};cancelHideTimer=()=>{this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=void 0)};get tooltipOffset(){switch(this.placement??"top"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>!this.useClose&&this.closeTooltip();async show(){this.openTooltip()}async hide(){this.closeTooltip()}componentWillLoad(){this.isAnchorMode=Array.from(this.el.children).some((t=>"anchor"===t.getAttribute("slot"))),this.isAnchorMode||(this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren()),this.el.classList.toggle("visible",!0)}componentDidRender(){this.triggerEl&&""!==this.triggerStyle&&this.triggerEl.setAttribute("style",this.triggerStyle)}render(){const t=this.trigger??"hover",s=this.placement??"top",o=this.tooltipType??"default",a=this.icon??"helpOutline",l=this.color??"#01BB4B",c=u[o]??u.default,r=()=>this.showTooltip=!this.showTooltip,d=void 0!==this.label&&""!==this.label,h=this.isAnchorMode,m="hover"===t?{onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()}:h||!d?{onClick:r}:{},p="click"===t&&!h&&d?{onSdClick:r}:{},b=["sd-tooltip-trigger",this.sdClass,this.triggerClass].filter((t=>void 0!==t&&""!==t)).join(" "),g=this.message&&this.message.length>0?this.message.map((t=>`<div>${t}</div>`)).join(""):this.slotContentHTML;return e(i,{key:"f50cb9c1397c479dd994edeb044cb95764976344"},e("div",{key:"0b6f62051b47015a1e0bb7e9f6ee66750b74c4e0",ref:t=>this.triggerEl=t,class:b,...m},h?e("slot",{name:"anchor"}):d?e("sd-button",{ref:t=>this.buttonEl=t,name:this.name??"primary_sm",label:this.label,icon:a,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel,disabled:this.disabled,type:this.type??"button",class:"sd-tooltip",...p}):e("sd-icon",{ref:t=>this.buttonEl=t,name:a,size:this.iconSize??12,color:l,class:"sd-tooltip"})),this.showTooltip&&e("sd-floating-portal",{key:"4e750b20c8ee4649f3474de06e12c7008f8796c3",parentRef:h?this.triggerEl:this.buttonEl,onSdClose:this.handleClose,placement:s,offset:this.tooltipOffset},e("div",{key:"d9f86aa8e074d516350ffc621d28b3d70ed08713",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${s}`]:!0,"sd-floating-menu--has-close":this.useClose},style:{"--sd-floating-bg":c.bg,"--sd-floating-content":c.content},onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>!this.useClose&&this.startHideTimer()},e("i",{key:"91080790a99c0aaad815c8deddce5fc6a9ff405d",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${s}`},e(n,{key:"db89405989bfb909e6f86050de407cbc5f821717"})),e("div",{key:"24cc5aa569cbf316aaaf23e5cc7e85144d51ab9b",class:"sd-floating-menu__content",innerHTML:g}),this.useClose&&e("sd-ghost-button",{key:"32b62d9c48d72428783375b68bcf4807154b6bb1",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xxs",onClick:()=>this.closeTooltip()}))))}static get style(){return"sd-tooltip{visibility:hidden !important;display:inline-flex}sd-tooltip.visible{visibility:visible !important}sd-tooltip .sd-tooltip-trigger{display:inline-flex;position:relative;cursor:pointer;align-items:center;justify-content:center}"}},[772,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],name:[1],rightIcon:[1,"right-icon"],ariaLabel:[1,"aria-label"],disabled:[4],type:[1],useClose:[4,"use-close"],sdClass:[1,"sd-class"],message:[16],triggerClass:[1,"trigger-class"],triggerStyle:[1,"trigger-style"],showTooltip:[32],slotContentHTML:[32],show:[64],hide:[64]}]);function y(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),f);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-floating-portal":customElements.get(o(t))||l();break;case"sd-ghost-button":customElements.get(o(t))||c();break;case"sd-icon":customElements.get(o(t))||r();break;case"sd-portal":customElements.get(o(t))||d();break;case"sd-tag":customElements.get(o(t))||h()}}))}export{f as S,y as d}