@sellmate/design-system 1.0.54 → 1.0.55

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 (82) hide show
  1. package/dist/cjs/{component.textinput-DIDZPtYE.js → component.textinput-BWW8c3OY.js} +10 -1
  2. package/dist/cjs/design-system.cjs.js +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
  5. package/dist/cjs/{sd-button_5.cjs.entry.js → sd-button_4.cjs.entry.js} +2 -146
  6. package/dist/cjs/sd-ghost-button.cjs.entry.js +148 -0
  7. package/dist/cjs/sd-input_2.cjs.entry.js +1 -1
  8. package/dist/cjs/sd-textarea.cjs.entry.js +76 -37
  9. package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
  10. package/dist/cjs/sd-toast.cjs.entry.js +2 -2
  11. package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
  12. package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
  13. package/dist/collection/components/sd-textarea/sd-textarea.config.js +16 -0
  14. package/dist/collection/components/sd-textarea/sd-textarea.css +13 -53
  15. package/dist/collection/components/sd-textarea/sd-textarea.js +445 -60
  16. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  17. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  18. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  19. package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
  20. package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
  21. package/dist/components/{p-hWm-Llzv.js → p-BM4qDFZj.js} +1 -1
  22. package/dist/components/{p-Bbl5852O.js → p-BR0LWoJL.js} +1 -1
  23. package/dist/components/p-C8kA64_1.js +1 -0
  24. package/dist/components/{p-DJdigrkS.js → p-Cbtpfl9F.js} +1 -1
  25. package/dist/components/{p-CYppNuFU.js → p-CmXAKr-2.js} +1 -1
  26. package/dist/components/p-DSNs8RRn.js +1 -0
  27. package/dist/components/{p-CpGiSLY_.js → p-DxzIjbQJ.js} +1 -1
  28. package/dist/components/{p-CSrbKcYv.js → p-w3CsjVGg.js} +1 -1
  29. package/dist/components/sd-barcode-input.js +1 -1
  30. package/dist/components/sd-date-picker.js +1 -1
  31. package/dist/components/sd-date-range-picker.js +1 -1
  32. package/dist/components/sd-field.js +1 -1
  33. package/dist/components/sd-file-picker.js +1 -1
  34. package/dist/components/sd-input.js +1 -1
  35. package/dist/components/sd-number-input.js +1 -1
  36. package/dist/components/sd-select-dropdown.js +1 -1
  37. package/dist/components/sd-select-group.js +1 -1
  38. package/dist/components/sd-select-multiple-group.js +1 -1
  39. package/dist/components/sd-select-multiple.js +1 -1
  40. package/dist/components/sd-select-search-input.js +1 -1
  41. package/dist/components/sd-select-v2.js +1 -1
  42. package/dist/components/sd-select.js +1 -1
  43. package/dist/components/sd-table.js +1 -1
  44. package/dist/components/sd-textarea.js +1 -1
  45. package/dist/components/sd-toast-container.js +1 -1
  46. package/dist/components/sd-toast.js +1 -1
  47. package/dist/components/sd-toggle-button.js +1 -1
  48. package/dist/components/sd-toggle.js +1 -1
  49. package/dist/components/sd-tooltip.js +1 -1
  50. package/dist/design-system/design-system.esm.js +1 -1
  51. package/dist/design-system/{p-47931c26.entry.js → p-184649a9.entry.js} +1 -1
  52. package/dist/design-system/{p-64f2a188.entry.js → p-266ff86b.entry.js} +1 -1
  53. package/dist/design-system/{p-cebaca7c.entry.js → p-391cf704.entry.js} +1 -1
  54. package/dist/design-system/{p-a59c0cab.entry.js → p-4e9413c0.entry.js} +1 -1
  55. package/dist/design-system/p-5213773b.entry.js +1 -0
  56. package/dist/design-system/{p-4487b2ec.entry.js → p-99b6157f.entry.js} +1 -1
  57. package/dist/design-system/p-DSNs8RRn.js +1 -0
  58. package/dist/design-system/p-c2a0f10d.entry.js +1 -0
  59. package/dist/design-system/{p-c9af0fc9.entry.js → p-efe684e6.entry.js} +1 -1
  60. package/dist/design-system/{p-ea768c2e.entry.js → p-fdf7ed87.entry.js} +1 -1
  61. package/dist/esm/{component.textinput-BGovA1BG.js → component.textinput-DSNs8RRn.js} +10 -1
  62. package/dist/esm/design-system.js +1 -1
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/sd-barcode-input.entry.js +1 -1
  65. package/dist/esm/{sd-button_5.entry.js → sd-button_4.entry.js} +3 -146
  66. package/dist/esm/sd-ghost-button.entry.js +146 -0
  67. package/dist/esm/sd-input_2.entry.js +1 -1
  68. package/dist/esm/sd-textarea.entry.js +76 -37
  69. package/dist/esm/sd-toast-container.entry.js +1 -1
  70. package/dist/esm/sd-toast.entry.js +2 -2
  71. package/dist/esm/sd-toggle-button.entry.js +1 -1
  72. package/dist/esm/sd-toggle.entry.js +1 -1
  73. package/dist/types/components/sd-textarea/sd-textarea.config.d.ts +34 -0
  74. package/dist/types/components/sd-textarea/sd-textarea.d.ts +28 -9
  75. package/dist/types/components.d.ts +142 -8
  76. package/hydrate/index.js +114 -52
  77. package/hydrate/index.mjs +114 -52
  78. package/package.json +1 -1
  79. package/dist/components/p-BGovA1BG.js +0 -1
  80. package/dist/components/p-Ck-2jtzb.js +0 -1
  81. package/dist/design-system/p-52d6d7b5.entry.js +0 -1
  82. package/dist/design-system/p-BGovA1BG.js +0 -1
@@ -32,7 +32,7 @@ export class SdToggleButton {
32
32
  this.change.emit(newValue);
33
33
  };
34
34
  render() {
35
- return (h("label", { key: '964590e261c212de41cae1cbb6e7e2054182d1f6', class: this.buttonClasses, "aria-label": this.label || 'toggle button' }, this.label, h("input", { key: 'f1bfd190408a6e2899cdcd1d66688b94a8d2ecc0', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
35
+ return (h("label", { key: '9d98201d5ab361d0d2d5c8c61ce1e5b129f4d588', class: this.buttonClasses, "aria-label": this.label || 'toggle button' }, this.label, h("input", { key: 'a745715a752bf99a94ab01d8c07c87d0f507a8ef', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
36
36
  }
37
37
  static get is() { return "sd-toggle-button"; }
38
38
  static get originalStyleUrls() {
@@ -81,14 +81,14 @@ export class SdTooltip {
81
81
  const toggleTooltip = () => (this.showTooltip = !this.showTooltip);
82
82
  const divTrigger = trigger === 'hover' ? hoverTrigger : this.label ? {} : { onClick: toggleTooltip };
83
83
  const buttonClickTrigger = trigger === 'click' && this.label ? { onSdClick: toggleTooltip } : {};
84
- return (h(Fragment, { key: '45662c35d1eb8cd1f23e0c62646a02fd244fee13' }, h("div", { key: '7f04bfcc31aecad132ce95eeb1a6d936f79189ee', class: `sd-tooltip-trigger ${this.sdClass || ''}`, ...divTrigger }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: icon, size: this.buttonSize ?? 'sm', color: color, variant: this.buttonVariant ?? 'primary', class: "sd-tooltip", ...buttonClickTrigger })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: icon, size: this.iconSize ?? 12, color: color, class: "sd-tooltip" }))), this.showTooltip && (h("sd-floating-portal", { key: '95c16d600733dca5f40d06b222b422bd48ddb2dd', parentRef: this.buttonEl, onSdClose: this.handleClose.bind(this), placement: placement, offset: this.tooltipOffset }, h("div", { key: '84b63cb44fbe9e7a81e033acde6be32b72ed24ba', ref: el => (this.menuEl = el), class: {
84
+ return (h(Fragment, { key: '2e854c5a056af93e65460500da199ddd763de777' }, h("div", { key: 'aa5e250e4d371c4a54401d367fdf647cefb6aecc', class: `sd-tooltip-trigger ${this.sdClass || ''}`, ...divTrigger }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: icon, size: this.buttonSize ?? 'sm', color: color, variant: this.buttonVariant ?? 'primary', class: "sd-tooltip", ...buttonClickTrigger })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: icon, size: this.iconSize ?? 12, color: color, class: "sd-tooltip" }))), this.showTooltip && (h("sd-floating-portal", { key: 'f94aa0d5730b7f585f943b60bf39e4248d0b695e', parentRef: this.buttonEl, onSdClose: this.handleClose.bind(this), placement: placement, offset: this.tooltipOffset }, h("div", { key: '76ece6c53c4daad54a13950b616bb7edd0827f81', ref: el => (this.menuEl = el), class: {
85
85
  'sd-floating-menu': true,
86
86
  [`sd-floating-menu--${tooltipType}`]: true,
87
87
  [`sd-floating-menu--${placement}`]: true,
88
88
  }, style: {
89
89
  '--sd-floating-bg': typeConfig.bg,
90
90
  '--sd-floating-content': typeConfig.content,
91
- }, onMouseEnter: () => this.show(), onMouseLeave: () => this.startHideTimer() }, h("i", { key: 'c05e9ecb128e780f3596e8e17b6796255e21b61e', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${placement}` }, h(TooltipArrow, { key: 'fa56346eb836456d4a646cd2d3959e2c4c98c2d7' })), h("div", { key: '926e918d55db0f79e5e776b341fe4d0d6b0bf574', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }))))));
91
+ }, onMouseEnter: () => this.show(), onMouseLeave: () => this.startHideTimer() }, h("i", { key: '4beed6bf9afbccd072c2c8ab9885d7a8bde99284', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${placement}` }, h(TooltipArrow, { key: 'e73b4c9085c57f40410ecc0a7ec758019418899e' })), h("div", { key: '8dcd58077836c846fafb948dbf0c77e149987818', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }))))));
92
92
  }
93
93
  static get is() { return "sd-tooltip"; }
94
94
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- import{p as e,H as d,h as s,t as i}from"./p-D-pFdq6g.js";import{d as l}from"./p-CDR-4auv.js";import{d as t}from"./p-tR70yRjm.js";import{d as o}from"./p-DSYw-7RA.js";import{d as r}from"./p-CpGiSLY_.js";var a={sm:{height:"28",gap:"6",icon:"12",typography:{fontWeight:"700",fontSize:"12",lineHeight:"20"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f=["sd-select","sd-select-multiple","sd-select-multiple-group","sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select-v2","sd-file-picker"],p=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}get el(){return this}name="";rules=[];error=!1;disabled=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";label="";addonLabel="";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),this.status&&(e=this.status),this.error&&(e="error"),e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of f){const d=this.el.closest(e);if(d&&"value"in d)return d}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(!this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this.name)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const d=e(this.value??"");if(!0!==d)return this.setError(!0,d),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,d){this.errorMsg=d,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,d=a.sm,i=this.label?{"--sd-field-label-height":`${d.height}px`,"--sd-field-label-gap":`${d.gap}px`,"--sd-field-label-font-size":`${d.typography.fontSize}px`,"--sd-field-label-line-height":`${d.typography.lineHeight}px`,"--sd-field-label-font-weight":d.typography.fontWeight}:{},l=e?{"--sd-field-addon-padding-x":`${n.paddingX}px`,"--sd-field-addon-font-size":`${n.typography.fontSize}px`,"--sd-field-addon-line-height":`${n.typography.lineHeight}px`,"--sd-field-addon-font-weight":n.typography.fontWeight,"--sd-field-addon-bg":n.bg,"--sd-field-addon-border-color":this.disabled?n.border.disabled:n.border.default,"--sd-field-addon-gap":`${n.gap}px`,"--sd-field-addon-border-width":`${n.border.width}px`}:{};return s("div",{key:"e37722a9afbd78654328954262d4bc458634170a",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...i,...l}},s("div",{key:"38440e5f21fba28ff49fd00bfd20189af9c43707",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"b6d65e0db6667cbe9b4dd85ec72f9ecd08afa291",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e},style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},e&&s("div",{key:"71a50d839dbbd7075c1f7f7b2daad0308ebc1225",class:"sd-field__addon"},e),s("slot",{key:"5c0696834e82eddde81c6603d26373a745a1febb"}))),this.errorMsg||this.errorMessage?s("div",{class:"sd-field__error-message"},this.errorMsg||this.errorMessage):this.hint&&s("div",{class:"sd-field__hint"},this.hint))}renderLabel(e){return e?s("label",{class:"sd-field__label"},this.icon&&s("sd-icon",{name:this.icon.name,size:this.icon.size??Number(a.sm.icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),s("div",{class:"sd-field__label__text"},e),this.labelTooltip&&s("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip)):null}static get style(){return"sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field:not(.sd-field--disabled):hover .sd-field__control{border:1px solid var(--sd-system-color-field-border-hover) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;height:var(--sd-field-label-height);margin-right:var(--sd-system-space-field-sm-gap)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap)}sd-field .sd-field--has-addon .sd-field__control{gap:var(--sd-field-addon-gap)}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;align-items:center;white-space:nowrap;padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-system-radius-field-sm) - 1px) 0 0 calc(var(--sd-system-radius-field-sm) - 1px)}sd-field .sd-field__wrapper{width:100%;height:var(--sd-system-size-field-sm-height);display:flex;align-items:center;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);cursor:pointer;-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:100%;display:flex;flex:1;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-system-radius-field-sm);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error:not(:hover) .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--focus .sd-field__wrapper .sd-field__control,sd-field .sd-field.sd-field--hover .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field .sd-field__error-message{color:var(--sd-textinput-input-text-error-message);font-size:var(--sd-textinput-input-error-message-typography-font-size);line-height:var(--sd-textinput-input-error-message-typography-line-height);margin-top:var(--sd-textinput-input-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-input-text-hint);font-size:var(--sd-textinput-input-hint-typography-font-size);line-height:var(--sd-textinput-input-hint-typography-line-height);margin-top:var(--sd-textinput-input-contents-gap)}"}},[772,"sd-field",{name:[1],rules:[16],error:[1028],disabled:[1028],hovered:[1028],focused:[1028],status:[1],hint:[1],errorMessage:[1,"error-message"],width:[8],label:[1],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-field","sd-button","sd-floating-portal","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-field":customElements.get(i(e))||customElements.define(i(e),p);break;case"sd-button":customElements.get(i(e))||l();break;case"sd-floating-portal":customElements.get(i(e))||t();break;case"sd-icon":customElements.get(i(e))||o();break;case"sd-tooltip":customElements.get(i(e))||r()}}))}export{p as S,h as d}
1
+ import{p as e,H as d,h as s,t as i}from"./p-D-pFdq6g.js";import{d as l}from"./p-CDR-4auv.js";import{d as t}from"./p-tR70yRjm.js";import{d as o}from"./p-DSYw-7RA.js";import{d as r}from"./p-DxzIjbQJ.js";var a={sm:{height:"28",gap:"6",icon:"12",typography:{fontWeight:"700",fontSize:"12",lineHeight:"20"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f=["sd-select","sd-select-multiple","sd-select-multiple-group","sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select-v2","sd-file-picker"],p=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}get el(){return this}name="";rules=[];error=!1;disabled=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";label="";addonLabel="";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),this.status&&(e=this.status),this.error&&(e="error"),e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of f){const d=this.el.closest(e);if(d&&"value"in d)return d}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(!this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this.name)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const d=e(this.value??"");if(!0!==d)return this.setError(!0,d),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,d){this.errorMsg=d,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,d=a.sm,i=this.label?{"--sd-field-label-height":`${d.height}px`,"--sd-field-label-gap":`${d.gap}px`,"--sd-field-label-font-size":`${d.typography.fontSize}px`,"--sd-field-label-line-height":`${d.typography.lineHeight}px`,"--sd-field-label-font-weight":d.typography.fontWeight}:{},l=e?{"--sd-field-addon-padding-x":`${n.paddingX}px`,"--sd-field-addon-font-size":`${n.typography.fontSize}px`,"--sd-field-addon-line-height":`${n.typography.lineHeight}px`,"--sd-field-addon-font-weight":n.typography.fontWeight,"--sd-field-addon-bg":n.bg,"--sd-field-addon-border-color":this.disabled?n.border.disabled:n.border.default,"--sd-field-addon-gap":`${n.gap}px`,"--sd-field-addon-border-width":`${n.border.width}px`}:{};return s("div",{key:"e37722a9afbd78654328954262d4bc458634170a",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...i,...l}},s("div",{key:"38440e5f21fba28ff49fd00bfd20189af9c43707",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"b6d65e0db6667cbe9b4dd85ec72f9ecd08afa291",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e},style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},e&&s("div",{key:"71a50d839dbbd7075c1f7f7b2daad0308ebc1225",class:"sd-field__addon"},e),s("slot",{key:"5c0696834e82eddde81c6603d26373a745a1febb"}))),this.errorMsg||this.errorMessage?s("div",{class:"sd-field__error-message"},this.errorMsg||this.errorMessage):this.hint&&s("div",{class:"sd-field__hint"},this.hint))}renderLabel(e){return e?s("label",{class:"sd-field__label"},this.icon&&s("sd-icon",{name:this.icon.name,size:this.icon.size??Number(a.sm.icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),s("div",{class:"sd-field__label__text"},e),this.labelTooltip&&s("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip)):null}static get style(){return"sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field:not(.sd-field--disabled):hover .sd-field__control{border:1px solid var(--sd-system-color-field-border-hover) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;height:var(--sd-field-label-height);margin-right:var(--sd-system-space-field-sm-gap)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap)}sd-field .sd-field--has-addon .sd-field__control{gap:var(--sd-field-addon-gap)}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;align-items:center;white-space:nowrap;padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-system-radius-field-sm) - 1px) 0 0 calc(var(--sd-system-radius-field-sm) - 1px)}sd-field .sd-field__wrapper{width:100%;height:var(--sd-system-size-field-sm-height);display:flex;align-items:center;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);cursor:pointer;-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:100%;display:flex;flex:1;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-system-radius-field-sm);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error:not(:hover) .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--focus .sd-field__wrapper .sd-field__control,sd-field .sd-field.sd-field--hover .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field .sd-field__error-message{color:var(--sd-textinput-input-text-error-message);font-size:var(--sd-textinput-input-error-message-typography-font-size);line-height:var(--sd-textinput-input-error-message-typography-line-height);margin-top:var(--sd-textinput-input-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-input-text-hint);font-size:var(--sd-textinput-input-hint-typography-font-size);line-height:var(--sd-textinput-input-hint-typography-line-height);margin-top:var(--sd-textinput-input-contents-gap)}"}},[772,"sd-field",{name:[1],rules:[16],error:[1028],disabled:[1028],hovered:[1028],focused:[1028],status:[1],hint:[1],errorMessage:[1,"error-message"],width:[8],label:[1],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-field","sd-button","sd-floating-portal","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-field":customElements.get(i(e))||customElements.define(i(e),p);break;case"sd-button":customElements.get(i(e))||l();break;case"sd-floating-portal":customElements.get(i(e))||t();break;case"sd-icon":customElements.get(i(e))||o();break;case"sd-tooltip":customElements.get(i(e))||r()}}))}export{p as S,h as d}
@@ -1 +1 @@
1
- import{p as e,H as t,c as i,h as s,t as a}from"./p-D-pFdq6g.js";import{n}from"./p-CCwNgVmC.js";import{i as d}from"./p-BGovA1BG.js";import{d as o}from"./p-CDR-4auv.js";import{d as r}from"./p-hWm-Llzv.js";import{d as l}from"./p-tR70yRjm.js";import{d as p}from"./p-B3CfLqLu.js";import{d as c}from"./p-DSYw-7RA.js";import{d as u}from"./p-CpGiSLY_.js";const h=d.input.sm,g=d.input.md,b={sm:{height:h.height,paddingX:h.paddingX,gap:h.gap,radius:h.radius,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:g.height,paddingX:g.paddingX,gap:g.gap,radius:g.radius,fontSize:g.typography.fontSize,lineHeight:g.typography.lineHeight,fontWeight:g.typography.fontWeight}},f={text:d.input.text,icon:d.input.icon},m=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return this}value=null;type="text";size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=n();input;focus;blur;valueChanged(e){this.internalValue=e}internalValueChanged(e){e!==this.value&&(this.value=e,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{this.internalValue=e.target.value};handleFocus=async(e,t)=>{this.focused="focus"===e,"blur"===e?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(t)):this.focus?.emit(t)};render(){const e=b[this.size]??b.sm;return s("sd-field",{key:"d5f554784340cbb9246165fb15124098e4f7165b",name:this.name,label:this.label,addonLabel:this.addonLabel,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,style:{"--sd-input-font-size":`${e.fontSize}px`,"--sd-input-line-height":`${e.lineHeight}px`,"--sd-input-font-weight":e.fontWeight,"--sd-input-padding-x":`${e.paddingX}px`,"--sd-input-gap":`${e.gap}px`,"--sd-input-text-color":f.text.default,"--sd-input-placeholder-color":f.text.placeholder,"--sd-input-disabled-color":f.text.disabled,"--sd-input-icon-color":f.icon.default,"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`}},s("label",{key:"02225d57c5bd17dbe78c680f243ad3a9a4ab3b5d",class:"sd-input__content"},s("slot",{key:"1011876ea9726e62a19047b28a82932e43762436",name:"prefix"}),s("input",{key:"10f4c594382aa002ba09a0012979ff930154fc7a",name:this.name,ref:e=>this.nativeEl=e,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type,value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:e=>this.handleFocus("focus",e),onBlur:e=>this.handleFocus("blur",e),style:this.inputStyle}),s("slot",{key:"007d15357a81f13ab4db5ddf237110b9d1f1728b",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&s("sd-ghost-button",{key:"92dfd40117cccdb48ebfc0056aa9e093546bbf6b",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&s("sd-ghost-button",{key:"a4bef720b55a94a4a6ada002f4a2ffd1d0f8da24",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled,class:"sd-input__password-icon",onClick:()=>{this.disabled||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}.sd-date-picker{width:100%;display:inline-block}.sd-date-picker .sd-date-picker--disabled .date-icon{cursor:not-allowed !important;color:#888888 !important}.sd-date-picker .sd-date-picker__input{text-align:center !important}.sd-date-picker__menu{border-radius:8px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-date-range-picker{width:fit-content;display:inline-flex}sd-date-range-picker .sd-date-range-picker--disabled .date-icon{cursor:not-allowed !important;color:#888888 !important}sd-date-range-picker .sd-date-range-picker--disabled .sd-input__native{color:#888888 !important}sd-date-range-picker .sd-field .sd-field__control{min-width:210px}sd-date-range-picker .sd-field .sd-input__native{margin-left:17px !important}.sd-date-range-picker__menu{width:609px;box-sizing:border-box;border-radius:8px;padding:24px 19px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);background:white}.sd-date-range-picker__menu .sd-date-range-picker__header{margin-bottom:16px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center}.sd-date-range-picker__menu .sd-date-range-picker__header .header-label{margin:0 12px;width:40px;text-align:center;font-size:14px;line-height:24px}.sd-date-range-picker__menu .sd-date-range-picker__body{display:flex;flex-flow:row nowrap;align-items:stretch;gap:19px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container{width:266px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header{width:100%;height:24px;line-height:24px;font-size:14px;text-align:center;position:relative;padding:0 5px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button{position:absolute;top:50%;transform:translateY(-50%)}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button.header-button-prev{left:5px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button.header-button-next{right:5px;left:auto}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-days{padding:0 5px;margin-top:8px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr));column-gap:10px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-days .day{width:28px;height:20px;font-size:12px;line-height:20px;text-align:center;color:#888888}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-body{margin-top:12px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr))}.sd-date-range-picker__menu .sd-date-range-picker__body .separator{width:1px;background-color:#D8D8D8}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-input",{value:[1032],type:[1],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],autocomplete:[1],maxlength:[2],minlength:[2],inputmode:[1],enterkeyhint:[1],spellcheck:[4],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],passwordVisible:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function _(){"undefined"!=typeof customElements&&["sd-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-input":customElements.get(a(e))||customElements.define(a(e),m);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||r();break;case"sd-floating-portal":customElements.get(a(e))||l();break;case"sd-ghost-button":customElements.get(a(e))||p();break;case"sd-icon":customElements.get(a(e))||c();break;case"sd-tooltip":customElements.get(a(e))||u()}}))}export{m as S,_ as d}
1
+ import{p as e,H as t,c as i,h as s,t as a}from"./p-D-pFdq6g.js";import{n}from"./p-CCwNgVmC.js";import{i as d}from"./p-DSNs8RRn.js";import{d as o}from"./p-CDR-4auv.js";import{d as r}from"./p-BM4qDFZj.js";import{d as l}from"./p-tR70yRjm.js";import{d as p}from"./p-B3CfLqLu.js";import{d as c}from"./p-DSYw-7RA.js";import{d as u}from"./p-DxzIjbQJ.js";const h=d.input.sm,g=d.input.md,b={sm:{height:h.height,paddingX:h.paddingX,gap:h.gap,radius:h.radius,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:g.height,paddingX:g.paddingX,gap:g.gap,radius:g.radius,fontSize:g.typography.fontSize,lineHeight:g.typography.lineHeight,fontWeight:g.typography.fontWeight}},f={text:d.input.text,icon:d.input.icon},m=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return this}value=null;type="text";size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=n();input;focus;blur;valueChanged(e){this.internalValue=e}internalValueChanged(e){e!==this.value&&(this.value=e,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{this.internalValue=e.target.value};handleFocus=async(e,t)=>{this.focused="focus"===e,"blur"===e?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(t)):this.focus?.emit(t)};render(){const e=b[this.size]??b.sm;return s("sd-field",{key:"d5f554784340cbb9246165fb15124098e4f7165b",name:this.name,label:this.label,addonLabel:this.addonLabel,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,style:{"--sd-input-font-size":`${e.fontSize}px`,"--sd-input-line-height":`${e.lineHeight}px`,"--sd-input-font-weight":e.fontWeight,"--sd-input-padding-x":`${e.paddingX}px`,"--sd-input-gap":`${e.gap}px`,"--sd-input-text-color":f.text.default,"--sd-input-placeholder-color":f.text.placeholder,"--sd-input-disabled-color":f.text.disabled,"--sd-input-icon-color":f.icon.default,"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`}},s("label",{key:"02225d57c5bd17dbe78c680f243ad3a9a4ab3b5d",class:"sd-input__content"},s("slot",{key:"1011876ea9726e62a19047b28a82932e43762436",name:"prefix"}),s("input",{key:"10f4c594382aa002ba09a0012979ff930154fc7a",name:this.name,ref:e=>this.nativeEl=e,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type,value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:e=>this.handleFocus("focus",e),onBlur:e=>this.handleFocus("blur",e),style:this.inputStyle}),s("slot",{key:"007d15357a81f13ab4db5ddf237110b9d1f1728b",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&s("sd-ghost-button",{key:"92dfd40117cccdb48ebfc0056aa9e093546bbf6b",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&s("sd-ghost-button",{key:"a4bef720b55a94a4a6ada002f4a2ffd1d0f8da24",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled,class:"sd-input__password-icon",onClick:()=>{this.disabled||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}.sd-date-picker{width:100%;display:inline-block}.sd-date-picker .sd-date-picker--disabled .date-icon{cursor:not-allowed !important;color:#888888 !important}.sd-date-picker .sd-date-picker__input{text-align:center !important}.sd-date-picker__menu{border-radius:8px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-date-range-picker{width:fit-content;display:inline-flex}sd-date-range-picker .sd-date-range-picker--disabled .date-icon{cursor:not-allowed !important;color:#888888 !important}sd-date-range-picker .sd-date-range-picker--disabled .sd-input__native{color:#888888 !important}sd-date-range-picker .sd-field .sd-field__control{min-width:210px}sd-date-range-picker .sd-field .sd-input__native{margin-left:17px !important}.sd-date-range-picker__menu{width:609px;box-sizing:border-box;border-radius:8px;padding:24px 19px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);background:white}.sd-date-range-picker__menu .sd-date-range-picker__header{margin-bottom:16px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center}.sd-date-range-picker__menu .sd-date-range-picker__header .header-label{margin:0 12px;width:40px;text-align:center;font-size:14px;line-height:24px}.sd-date-range-picker__menu .sd-date-range-picker__body{display:flex;flex-flow:row nowrap;align-items:stretch;gap:19px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container{width:266px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header{width:100%;height:24px;line-height:24px;font-size:14px;text-align:center;position:relative;padding:0 5px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button{position:absolute;top:50%;transform:translateY(-50%)}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button.header-button-prev{left:5px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-header button.header-button-next{right:5px;left:auto}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-days{padding:0 5px;margin-top:8px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr));column-gap:10px}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-days .day{width:28px;height:20px;font-size:12px;line-height:20px;text-align:center;color:#888888}.sd-date-range-picker__menu .sd-date-range-picker__body .calendar-container .calendar-body{margin-top:12px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr))}.sd-date-range-picker__menu .sd-date-range-picker__body .separator{width:1px;background-color:#D8D8D8}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-input",{value:[1032],type:[1],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],autocomplete:[1],maxlength:[2],minlength:[2],inputmode:[1],enterkeyhint:[1],spellcheck:[4],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],passwordVisible:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function _(){"undefined"!=typeof customElements&&["sd-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-input":customElements.get(a(e))||customElements.define(a(e),m);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||r();break;case"sd-floating-portal":customElements.get(a(e))||l();break;case"sd-ghost-button":customElements.get(a(e))||p();break;case"sd-icon":customElements.get(a(e))||c();break;case"sd-tooltip":customElements.get(a(e))||u()}}))}export{m as S,_ as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as s,c as e,h as o,t as a}from"./p-D-pFdq6g.js";import{d as n}from"./p-B3CfLqLu.js";import{d}from"./p-DSYw-7RA.js";var c={bg:"#07284A",content:"#FFFFFF"},i={bg:"#FB4444",content:"#FFFFFF"},r={bg:"#FFC700",content:"#222222"},l={bg:"#00973C",content:"#FFFFFF"},b={bg:"#005CC9",content:"#FFFFFF"};const p={default:{bg:c.bg,content:c.content},danger:{bg:i.bg,content:i.content},caution:{bg:r.bg,content:r.content},complete:{bg:l.bg,content:l.content},accent:{bg:b.bg,content:b.content}},g={iconSize:"16"},f=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=e(this,"sdClose",7)}icon;message;link;linkLabel;useClose=!1;type="default";close;render(){const t=p[this.type]??p.default,s=Number(g.iconSize);return o("div",{key:"cb42937774233de10872edb8414db88f03868eb3",style:{"--sd-toast-bg":t.bg,"--sd-toast-text":t.content}},o("div",{key:"e58b3335c4d7c450ef3686c53138636502c4e0f3",class:"sd-toast",role:"status","aria-live":"polite","aria-atomic":"true"},this.icon&&o("div",{key:"62e42c814ab2f15d563b3f75c4e9dd3e559318a0",class:"sd-toast__icon"},o("sd-icon",{key:"3e346baecd3207ee817ba843427ed2076fd7cc7c",name:this.icon,size:s,color:t.content})),o("div",{key:"700c7127a1d59409103b5ceb917e584020078736",class:"sd-toast__content"},o("span",{key:"d4165f0e324048edcb2492f3050795d26ce1fc86",class:"sd-toast__message"},this.message)),this.link&&o("a",{key:"f87089865b4e4fd5b488185478c453641920ac92",href:this.link,class:"sd-toast__link",target:"_blank",rel:"noopener noreferrer"},this.linkLabel||this.link),this.useClose&&o("sd-ghost-button",{key:"33de3a35d1532cd15215751996827a462a7b8cad",class:"sd-toast__close",icon:"close",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:700;white-space:nowrap}sd-toast .sd-toast__link{font-size:14px;line-height:24px;font-weight:700;color:var(--sd-toast-text);text-decoration:underline;cursor:pointer;transition:opacity 0.2s ease;margin-left:4px}sd-toast .sd-toast__link:hover{opacity:0.8}sd-toast .sd-toast__button{flex-shrink:0}sd-toast .sd-toast__button button{color:var(--button-text-color, inherit) !important}sd-toast .sd-toast__close{flex-shrink:0}"}},[512,"sd-toast",{icon:[1],message:[1],link:[1],linkLabel:[1,"link-label"],useClose:[4,"use-close"],type:[1]}]);function h(){"undefined"!=typeof customElements&&["sd-toast","sd-ghost-button","sd-icon"].forEach((t=>{switch(t){case"sd-toast":customElements.get(a(t))||customElements.define(a(t),f);break;case"sd-ghost-button":customElements.get(a(t))||n();break;case"sd-icon":customElements.get(a(t))||d()}}))}export{f as S,h as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as o,t as i}from"./p-D-pFdq6g.js";import{d}from"./p-CDR-4auv.js";import{d as n}from"./p-DXAB0k9r.js";import{d as r}from"./p-hWm-Llzv.js";import{d as a}from"./p-tR70yRjm.js";import{d as c}from"./p-B3CfLqLu.js";import{d as h}from"./p-DSYw-7RA.js";import{d as l}from"./p-Bbl5852O.js";import{d as p}from"./p-IRd25v7v.js";import{d as m}from"./p-CSrbKcYv.js";import{d as u}from"./p-CpGiSLY_.js";const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.optionClick=s(this,"sdOptionClick",7),this.optionFiltered=s(this,"sdOptionFiltered",7),this.scroll=s(this,"sdScroll",7)}itemIndex;value=null;options;width;dropdownHeight;searchable;optionPlaceholder;useCheckbox=!1;useAll=!1;filteredOptions=[];searchText=null;isScrolled=!1;isDropdownReady=!1;optionClick;optionFiltered;scroll;filteredOptionsChanged(t){this.optionFiltered.emit(t)}searchTextChanged(){this.filterOptions()}async itemIndexChanged(t,e){if(this.searchable){const t=await this.getNativeInputElement();if(-1===this.itemIndex)return void t?.focus({preventScroll:!0});t?.matches(":focus")&&t?.blur()}const s=this.dropdownRef?.querySelectorAll(".sd-select-dropdown sd-select-option")||[],o=s?.[this.itemIndex];o&&(this.optionRef=o,await this.optionRef.sdIsDisabled()?t>e?this.itemIndex++:this.itemIndex--:this.scrollToOption(o))}componentWillLoad(){this.filteredOptions=this.options,requestAnimationFrame((()=>{requestAnimationFrame((async()=>{const t=this.getSelectedOption();if(t){const e=Array.isArray(t)?this.options.indexOf(t[0]):this.options.indexOf(t),s=Array.from(this.dropdownRef?.querySelectorAll("sd-select-option")||[]),o=Math.min((this.useAll?e+1:e)+4,s.length-1),i=s?.[o];i&&this.scrollToOption(i,"instant")}if(this.isDropdownReady=!0,this.searchable){const t=await this.getNativeInputElement();t&&requestAnimationFrame((()=>{t.focus({preventScroll:!0})}))}}))}))}dropdownRef;searchRef;optionRef;get dropdownSize(){return{"--select-dropdown-width":this.width||"200px","--select-dropdown-height":this.dropdownHeight||"260px"}}filterOptions(){this.filteredOptions=this.searchText&&""!==this.searchText.trim()?this.options.filter((t=>t.label.toLowerCase().includes(this.searchText.toLowerCase()))):this.options}getSelectedOption(){return"object"!=typeof this.value?this.options.find((t=>t.value===this.value)):this.options.filter((t=>this.value?.includes(t)))}isOptionSelected(t){return Array.isArray(this.value)?this.value.some((e=>e.value===t)):t===this.value}async getNativeInputElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}scrollToOption(t,e="smooth"){if(!this.dropdownRef||!t)return;const s=this.dropdownRef,o=t.offsetTop,i=t.offsetHeight,d=s.scrollTop,n=s.clientHeight,r=s.querySelector(".sd-select-search-input"),a=r?r.offsetHeight:0,c=d+n;o<d+a?s.scrollTo({top:o-a,behavior:e}):o+i>c&&s.scrollTo({top:o+i-n+a,behavior:e})}handleDropdownScroll=t=>{this.isScrolled=t.target.scrollTop>0};render(){return o("div",{key:"47a99b4faac3adb110a548860ef094ba3bd4630a",class:{"sd-select-dropdown":!0,"sd-select-dropdown--ready":this.isDropdownReady},style:this.dropdownSize,onScroll:this.handleDropdownScroll,ref:t=>this.dropdownRef=t},this.searchable&&o("sd-select-search-input",{key:"0ed08c8a422d7d0be26ffcd68a424700feb6d66f",ref:t=>this.searchRef=t,isScrolled:this.isScrolled,searchText:this.searchText,onSdSearchInput:t=>this.searchText=t.detail||"",onSdSearchFocus:()=>this.itemIndex=-1}),this.filteredOptions.length>0?this.filteredOptions.map(((t,e)=>o("slot",{name:`option-${t.value}`},o("sd-select-option",{option:t,index:e,isSelected:this.isOptionSelected(t.value),isFocused:e===this.itemIndex,onOptionClick:({detail:t})=>this.optionClick.emit(t),useCheckbox:this.useCheckbox})))):o("slot",{name:"option-placeholder"},o("div",{class:"sd-select-option-placeholder"},this.optionPlaceholder)))}static get watchers(){return{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}}static get style(){return".sd-select-dropdown .sd-select-option-placeholder{height:48px;display:flex;align-items:center;padding:8px 16px;font-size:12px;line-height:0;text-align:left;color:#888888}.sd-select-dropdown{overflow:auto;min-width:fit-content;width:var(--select-dropdown-width, 200px);max-height:var(--select-dropdown-height, 260px);padding-bottom:2px;background-color:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);border-radius:4px;overflow-y:auto;color:#333333;display:flex;flex-direction:column;opacity:0.5;transition:opacity 0.15s ease-in}.sd-select-dropdown--ready{opacity:1}"}},[772,"sd-select-dropdown",{itemIndex:[1026,"item-index"],value:[8],options:[16],width:[1],dropdownHeight:[1,"dropdown-height"],searchable:[4],optionPlaceholder:[1,"option-placeholder"],useCheckbox:[4,"use-checkbox"],useAll:[4,"use-all"],filteredOptions:[32],searchText:[32],isScrolled:[32],isDropdownReady:[32]},void 0,{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-select-dropdown","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-dropdown":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||d();break;case"sd-checkbox":customElements.get(i(t))||n();break;case"sd-field":customElements.get(i(t))||r();break;case"sd-floating-portal":customElements.get(i(t))||a();break;case"sd-ghost-button":customElements.get(i(t))||c();break;case"sd-icon":customElements.get(i(t))||h();break;case"sd-input":customElements.get(i(t))||l();break;case"sd-select-option":customElements.get(i(t))||p();break;case"sd-select-search-input":customElements.get(i(t))||m();break;case"sd-tooltip":customElements.get(i(t))||u()}}))}export{f as S,x as d}
1
+ import{p as t,H as e,c as s,h as o,t as i}from"./p-D-pFdq6g.js";import{d}from"./p-CDR-4auv.js";import{d as n}from"./p-DXAB0k9r.js";import{d as r}from"./p-BM4qDFZj.js";import{d as a}from"./p-tR70yRjm.js";import{d as c}from"./p-B3CfLqLu.js";import{d as h}from"./p-DSYw-7RA.js";import{d as l}from"./p-BR0LWoJL.js";import{d as p}from"./p-IRd25v7v.js";import{d as m}from"./p-w3CsjVGg.js";import{d as u}from"./p-DxzIjbQJ.js";const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.optionClick=s(this,"sdOptionClick",7),this.optionFiltered=s(this,"sdOptionFiltered",7),this.scroll=s(this,"sdScroll",7)}itemIndex;value=null;options;width;dropdownHeight;searchable;optionPlaceholder;useCheckbox=!1;useAll=!1;filteredOptions=[];searchText=null;isScrolled=!1;isDropdownReady=!1;optionClick;optionFiltered;scroll;filteredOptionsChanged(t){this.optionFiltered.emit(t)}searchTextChanged(){this.filterOptions()}async itemIndexChanged(t,e){if(this.searchable){const t=await this.getNativeInputElement();if(-1===this.itemIndex)return void t?.focus({preventScroll:!0});t?.matches(":focus")&&t?.blur()}const s=this.dropdownRef?.querySelectorAll(".sd-select-dropdown sd-select-option")||[],o=s?.[this.itemIndex];o&&(this.optionRef=o,await this.optionRef.sdIsDisabled()?t>e?this.itemIndex++:this.itemIndex--:this.scrollToOption(o))}componentWillLoad(){this.filteredOptions=this.options,requestAnimationFrame((()=>{requestAnimationFrame((async()=>{const t=this.getSelectedOption();if(t){const e=Array.isArray(t)?this.options.indexOf(t[0]):this.options.indexOf(t),s=Array.from(this.dropdownRef?.querySelectorAll("sd-select-option")||[]),o=Math.min((this.useAll?e+1:e)+4,s.length-1),i=s?.[o];i&&this.scrollToOption(i,"instant")}if(this.isDropdownReady=!0,this.searchable){const t=await this.getNativeInputElement();t&&requestAnimationFrame((()=>{t.focus({preventScroll:!0})}))}}))}))}dropdownRef;searchRef;optionRef;get dropdownSize(){return{"--select-dropdown-width":this.width||"200px","--select-dropdown-height":this.dropdownHeight||"260px"}}filterOptions(){this.filteredOptions=this.searchText&&""!==this.searchText.trim()?this.options.filter((t=>t.label.toLowerCase().includes(this.searchText.toLowerCase()))):this.options}getSelectedOption(){return"object"!=typeof this.value?this.options.find((t=>t.value===this.value)):this.options.filter((t=>this.value?.includes(t)))}isOptionSelected(t){return Array.isArray(this.value)?this.value.some((e=>e.value===t)):t===this.value}async getNativeInputElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}scrollToOption(t,e="smooth"){if(!this.dropdownRef||!t)return;const s=this.dropdownRef,o=t.offsetTop,i=t.offsetHeight,d=s.scrollTop,n=s.clientHeight,r=s.querySelector(".sd-select-search-input"),a=r?r.offsetHeight:0,c=d+n;o<d+a?s.scrollTo({top:o-a,behavior:e}):o+i>c&&s.scrollTo({top:o+i-n+a,behavior:e})}handleDropdownScroll=t=>{this.isScrolled=t.target.scrollTop>0};render(){return o("div",{key:"47a99b4faac3adb110a548860ef094ba3bd4630a",class:{"sd-select-dropdown":!0,"sd-select-dropdown--ready":this.isDropdownReady},style:this.dropdownSize,onScroll:this.handleDropdownScroll,ref:t=>this.dropdownRef=t},this.searchable&&o("sd-select-search-input",{key:"0ed08c8a422d7d0be26ffcd68a424700feb6d66f",ref:t=>this.searchRef=t,isScrolled:this.isScrolled,searchText:this.searchText,onSdSearchInput:t=>this.searchText=t.detail||"",onSdSearchFocus:()=>this.itemIndex=-1}),this.filteredOptions.length>0?this.filteredOptions.map(((t,e)=>o("slot",{name:`option-${t.value}`},o("sd-select-option",{option:t,index:e,isSelected:this.isOptionSelected(t.value),isFocused:e===this.itemIndex,onOptionClick:({detail:t})=>this.optionClick.emit(t),useCheckbox:this.useCheckbox})))):o("slot",{name:"option-placeholder"},o("div",{class:"sd-select-option-placeholder"},this.optionPlaceholder)))}static get watchers(){return{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}}static get style(){return".sd-select-dropdown .sd-select-option-placeholder{height:48px;display:flex;align-items:center;padding:8px 16px;font-size:12px;line-height:0;text-align:left;color:#888888}.sd-select-dropdown{overflow:auto;min-width:fit-content;width:var(--select-dropdown-width, 200px);max-height:var(--select-dropdown-height, 260px);padding-bottom:2px;background-color:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);border-radius:4px;overflow-y:auto;color:#333333;display:flex;flex-direction:column;opacity:0.5;transition:opacity 0.15s ease-in}.sd-select-dropdown--ready{opacity:1}"}},[772,"sd-select-dropdown",{itemIndex:[1026,"item-index"],value:[8],options:[16],width:[1],dropdownHeight:[1,"dropdown-height"],searchable:[4],optionPlaceholder:[1,"option-placeholder"],useCheckbox:[4,"use-checkbox"],useAll:[4,"use-all"],filteredOptions:[32],searchText:[32],isScrolled:[32],isDropdownReady:[32]},void 0,{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-select-dropdown","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-dropdown":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||d();break;case"sd-checkbox":customElements.get(i(t))||n();break;case"sd-field":customElements.get(i(t))||r();break;case"sd-floating-portal":customElements.get(i(t))||a();break;case"sd-ghost-button":customElements.get(i(t))||c();break;case"sd-icon":customElements.get(i(t))||h();break;case"sd-input":customElements.get(i(t))||l();break;case"sd-select-option":customElements.get(i(t))||p();break;case"sd-select-search-input":customElements.get(i(t))||m();break;case"sd-tooltip":customElements.get(i(t))||u()}}))}export{f as S,x as d}
@@ -1 +1 @@
1
- import{p as s,c as e,h as t,t as i}from"./p-D-pFdq6g.js";import{B as o}from"./p-lKwhftf9.js";import{S as l}from"./p-Cy6HMEsK.js";import{n as d}from"./p-CCwNgVmC.js";import{d as r}from"./p-CDR-4auv.js";import{d as n}from"./p-DXAB0k9r.js";import{d as a}from"./p-hWm-Llzv.js";import{d as c}from"./p-tR70yRjm.js";import{d as h}from"./p-B3CfLqLu.js";import{d as p}from"./p-DSYw-7RA.js";import{d as m}from"./p-Bbl5852O.js";import{d as u}from"./p-DB_gU4hh.js";import{d as f}from"./p-DJdigrkS.js";import{d as b}from"./p-IRd25v7v.js";import{d as w}from"./p-CSrbKcYv.js";import{d as g}from"./p-CpGiSLY_.js";const x=s(class extends o{constructor(s){super(!1),!1!==s&&this.__registerHost(),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}get el(){return this}value=null;options=[];placeholder="선택";optionPlaceholder="선택지가 없습니다.";width="200px";dropdownHeight="260px";autoFocus=!1;disabled=!1;clearable=!1;searchable=!1;label="";addonLabel="";icon=void 0;labelTooltip="";labelTooltipProps=null;rules=[];error=!1;optionRenderer;isOpen=!1;itemIndex=-1;isScrolled=!1;update;dropDownShow;selectRef;triggerRef;formField;filteredOptions=[];dropDownWidth="200px";name=d();async sdOpen(){this.isOpen=!0}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async isOpenChanged(){this.onDropdownToggle(this.isOpen),this.dropDownShow?.emit({isOpen:this.isOpen}),!1===this.isOpen&&await(this.formField?.sdValidate())}componentWillLoad(){this.filteredOptions=this.options,this.dropDownWidth=this.width,this.initializeEvent()}componentDidLoad(){this.autoFocus&&this.selectRef?.focus()}componentDidRender(){const s=this.triggerRef,e=s?.getBoundingClientRect();this.dropDownWidth=e?.width?`${e.width}px`:this.width}disconnectedCallback(){this.cleanupEvent()}handleDocumentClick(s){this.selectRef?.contains(s.target)||(this.isOpen=!1)}handleDocumentKeydown(s){if(s.stopPropagation(),["ArrowDown","ArrowUp","Enter","Escape"].includes(s.key))switch(s.preventDefault(),s.key){case"ArrowDown":case"ArrowUp":const e=new l(this.searchable,this.filteredOptions).getNextIndex(this.itemIndex,s.key);this.itemIndex=e;break;case"Enter":const t=this.filteredOptions[this.itemIndex];t&&!t.disabled&&(this.value=t.value,this.isOpen=!1);break;case"Escape":this.isOpen=!1}}getSelectedOption(){return this.options.find((s=>s.value===this.value))}closeDropdown(){this.isOpen=!1}handleTriggerClick=s=>{s.stopPropagation(),this.disabled||(this.isOpen=!this.isOpen,this.dropDownShow?.emit({isOpen:this.isOpen}))};handleOptionClick=s=>{const{option:e,event:t}=s;if(t.stopPropagation(),!e.disabled){this.value=e.value,this.isOpen=!1;const s=this.getSelectedOption();this.update?.emit({value:s?.value||null,option:s||null})}};render(){return t("sd-field",{key:"f7cd0c34188712a30389d07bde7edc7875e9923b",label:this.label,name:this.name,rules:this.rules,error:this.error,disabled:this.disabled,icon:this.icon,addonLabel:this.addonLabel,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:s=>this.formField=s},t("div",{key:"460a8a23247e24a02bd25470105598914029e205",class:{"sd-select":!0,"sd-select--disabled":this.disabled,"sd-select--error":!!this.error,"sd-select--label":!!this.label},ref:s=>this.selectRef=s},this.renderTrigger(),this.renderDropdown()))}renderTrigger(){const s=this.getSelectedOption();return t("div",{class:"sd-select__trigger",tabindex:this.disabled?-1:0,onClick:this.handleTriggerClick,ref:s=>this.triggerRef=s},t("span",{class:"sd-select__value"},s?s.label:this.placeholder),this.clearable&&s&&!this.disabled&&t("sd-icon",{key:"clear-icon",name:"close",size:10,color:"#888",class:"sd-select__clear",onClick:async s=>{s.stopPropagation(),this.value=null,await(this.formField?.sdValidate())}}),t("sd-icon",{key:"arrow-icon",name:"arrowDown",color:"#888",class:{"sd-select__arrow":!0,"sd-select__arrow--open":this.isOpen}}))}renderDropdown(){if(!1===this.isOpen)return null;const s=this.selectRef?.querySelector(".sd-select__trigger")||this.selectRef;return t("sd-portal",{open:this.isOpen,parentRef:s,onSdClose:this.closeDropdown},t("sd-select-dropdown",{value:this.value,options:this.options,itemIndex:this.itemIndex,width:this.dropDownWidth,dropdownHeight:this.dropdownHeight,searchable:this.searchable,optionPlaceholder:this.optionPlaceholder,onSdOptionClick:({detail:s})=>this.handleOptionClick(s),onSdOptionFiltered:({detail:s})=>this.filteredOptions=s}))}static get watchers(){return{isOpen:[{isOpenChanged:0}]}}static get style(){return"sd-select{display:inline-flex;flex-flow:column nowrap;height:fit-content}sd-select *:focus,sd-select *:focus-visible,sd-select *:focus-within{outline:none !important}sd-select .sd-select{width:100%}sd-select .sd-select .sd-select__trigger{padding:4px 28px 4px 12px;display:flex;width:100%;height:100%;align-items:center}sd-select .sd-select .sd-select__trigger .sd-select__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:20px;font-size:12px;font-weight:400;text-align:left}sd-select .sd-select .sd-select__trigger .sd-select__clear{margin:0 4px;width:8px;height:8px;background-color:transparent;outline:none;border:none}sd-select .sd-select .sd-select__arrow{position:absolute;top:8px;right:8px;width:12px;height:12px;color:#888888;transition:transform 0.3s ease;margin-left:8px}sd-select .sd-select .sd-select__arrow--open{transform:rotate(180deg)}"}},[512,"sd-select",{value:[1032],options:[1040],placeholder:[1],optionPlaceholder:[1,"option-placeholder"],width:[1],dropdownHeight:[1,"dropdown-height"],autoFocus:[4,"auto-focus"],disabled:[4],clearable:[4],searchable:[4],label:[1],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],rules:[16],error:[4],optionRenderer:[16],isOpen:[32],itemIndex:[32],isScrolled:[32],sdOpen:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{isOpen:[{isOpenChanged:0}]}]);function k(){"undefined"!=typeof customElements&&["sd-select","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-select-dropdown","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select":customElements.get(i(s))||customElements.define(i(s),x);break;case"sd-button":customElements.get(i(s))||r();break;case"sd-checkbox":customElements.get(i(s))||n();break;case"sd-field":customElements.get(i(s))||a();break;case"sd-floating-portal":customElements.get(i(s))||c();break;case"sd-ghost-button":customElements.get(i(s))||h();break;case"sd-icon":customElements.get(i(s))||p();break;case"sd-input":customElements.get(i(s))||m();break;case"sd-portal":customElements.get(i(s))||u();break;case"sd-select-dropdown":customElements.get(i(s))||f();break;case"sd-select-option":customElements.get(i(s))||b();break;case"sd-select-search-input":customElements.get(i(s))||w();break;case"sd-tooltip":customElements.get(i(s))||g()}}))}export{x as S,k as d}
1
+ import{p as s,c as e,h as t,t as o}from"./p-D-pFdq6g.js";import{B as i}from"./p-lKwhftf9.js";import{S as l}from"./p-Cy6HMEsK.js";import{n as d}from"./p-CCwNgVmC.js";import{d as r}from"./p-CDR-4auv.js";import{d as n}from"./p-DXAB0k9r.js";import{d as a}from"./p-BM4qDFZj.js";import{d as c}from"./p-tR70yRjm.js";import{d as h}from"./p-B3CfLqLu.js";import{d as p}from"./p-DSYw-7RA.js";import{d as m}from"./p-BR0LWoJL.js";import{d as u}from"./p-DB_gU4hh.js";import{d as f}from"./p-Cbtpfl9F.js";import{d as b}from"./p-IRd25v7v.js";import{d as w}from"./p-w3CsjVGg.js";import{d as g}from"./p-DxzIjbQJ.js";const x=s(class extends i{constructor(s){super(!1),!1!==s&&this.__registerHost(),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}get el(){return this}value=null;options=[];placeholder="선택";optionPlaceholder="선택지가 없습니다.";width="200px";dropdownHeight="260px";autoFocus=!1;disabled=!1;clearable=!1;searchable=!1;label="";addonLabel="";icon=void 0;labelTooltip="";labelTooltipProps=null;rules=[];error=!1;optionRenderer;isOpen=!1;itemIndex=-1;isScrolled=!1;update;dropDownShow;selectRef;triggerRef;formField;filteredOptions=[];dropDownWidth="200px";name=d();async sdOpen(){this.isOpen=!0}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async isOpenChanged(){this.onDropdownToggle(this.isOpen),this.dropDownShow?.emit({isOpen:this.isOpen}),!1===this.isOpen&&await(this.formField?.sdValidate())}componentWillLoad(){this.filteredOptions=this.options,this.dropDownWidth=this.width,this.initializeEvent()}componentDidLoad(){this.autoFocus&&this.selectRef?.focus()}componentDidRender(){const s=this.triggerRef,e=s?.getBoundingClientRect();this.dropDownWidth=e?.width?`${e.width}px`:this.width}disconnectedCallback(){this.cleanupEvent()}handleDocumentClick(s){this.selectRef?.contains(s.target)||(this.isOpen=!1)}handleDocumentKeydown(s){if(s.stopPropagation(),["ArrowDown","ArrowUp","Enter","Escape"].includes(s.key))switch(s.preventDefault(),s.key){case"ArrowDown":case"ArrowUp":const e=new l(this.searchable,this.filteredOptions).getNextIndex(this.itemIndex,s.key);this.itemIndex=e;break;case"Enter":const t=this.filteredOptions[this.itemIndex];t&&!t.disabled&&(this.value=t.value,this.isOpen=!1);break;case"Escape":this.isOpen=!1}}getSelectedOption(){return this.options.find((s=>s.value===this.value))}closeDropdown(){this.isOpen=!1}handleTriggerClick=s=>{s.stopPropagation(),this.disabled||(this.isOpen=!this.isOpen,this.dropDownShow?.emit({isOpen:this.isOpen}))};handleOptionClick=s=>{const{option:e,event:t}=s;if(t.stopPropagation(),!e.disabled){this.value=e.value,this.isOpen=!1;const s=this.getSelectedOption();this.update?.emit({value:s?.value||null,option:s||null})}};render(){return t("sd-field",{key:"f7cd0c34188712a30389d07bde7edc7875e9923b",label:this.label,name:this.name,rules:this.rules,error:this.error,disabled:this.disabled,icon:this.icon,addonLabel:this.addonLabel,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:s=>this.formField=s},t("div",{key:"460a8a23247e24a02bd25470105598914029e205",class:{"sd-select":!0,"sd-select--disabled":this.disabled,"sd-select--error":!!this.error,"sd-select--label":!!this.label},ref:s=>this.selectRef=s},this.renderTrigger(),this.renderDropdown()))}renderTrigger(){const s=this.getSelectedOption();return t("div",{class:"sd-select__trigger",tabindex:this.disabled?-1:0,onClick:this.handleTriggerClick,ref:s=>this.triggerRef=s},t("span",{class:"sd-select__value"},s?s.label:this.placeholder),this.clearable&&s&&!this.disabled&&t("sd-icon",{key:"clear-icon",name:"close",size:10,color:"#888",class:"sd-select__clear",onClick:async s=>{s.stopPropagation(),this.value=null,await(this.formField?.sdValidate())}}),t("sd-icon",{key:"arrow-icon",name:"arrowDown",color:"#888",class:{"sd-select__arrow":!0,"sd-select__arrow--open":this.isOpen}}))}renderDropdown(){if(!1===this.isOpen)return null;const s=this.selectRef?.querySelector(".sd-select__trigger")||this.selectRef;return t("sd-portal",{open:this.isOpen,parentRef:s,onSdClose:this.closeDropdown},t("sd-select-dropdown",{value:this.value,options:this.options,itemIndex:this.itemIndex,width:this.dropDownWidth,dropdownHeight:this.dropdownHeight,searchable:this.searchable,optionPlaceholder:this.optionPlaceholder,onSdOptionClick:({detail:s})=>this.handleOptionClick(s),onSdOptionFiltered:({detail:s})=>this.filteredOptions=s}))}static get watchers(){return{isOpen:[{isOpenChanged:0}]}}static get style(){return"sd-select{display:inline-flex;flex-flow:column nowrap;height:fit-content}sd-select *:focus,sd-select *:focus-visible,sd-select *:focus-within{outline:none !important}sd-select .sd-select{width:100%}sd-select .sd-select .sd-select__trigger{padding:4px 28px 4px 12px;display:flex;width:100%;height:100%;align-items:center}sd-select .sd-select .sd-select__trigger .sd-select__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:20px;font-size:12px;font-weight:400;text-align:left}sd-select .sd-select .sd-select__trigger .sd-select__clear{margin:0 4px;width:8px;height:8px;background-color:transparent;outline:none;border:none}sd-select .sd-select .sd-select__arrow{position:absolute;top:8px;right:8px;width:12px;height:12px;color:#888888;transition:transform 0.3s ease;margin-left:8px}sd-select .sd-select .sd-select__arrow--open{transform:rotate(180deg)}"}},[512,"sd-select",{value:[1032],options:[1040],placeholder:[1],optionPlaceholder:[1,"option-placeholder"],width:[1],dropdownHeight:[1,"dropdown-height"],autoFocus:[4,"auto-focus"],disabled:[4],clearable:[4],searchable:[4],label:[1],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],rules:[16],error:[4],optionRenderer:[16],isOpen:[32],itemIndex:[32],isScrolled:[32],sdOpen:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{isOpen:[{isOpenChanged:0}]}]);function k(){"undefined"!=typeof customElements&&["sd-select","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-select-dropdown","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select":customElements.get(o(s))||customElements.define(o(s),x);break;case"sd-button":customElements.get(o(s))||r();break;case"sd-checkbox":customElements.get(o(s))||n();break;case"sd-field":customElements.get(o(s))||a();break;case"sd-floating-portal":customElements.get(o(s))||c();break;case"sd-ghost-button":customElements.get(o(s))||h();break;case"sd-icon":customElements.get(o(s))||p();break;case"sd-input":customElements.get(o(s))||m();break;case"sd-portal":customElements.get(o(s))||u();break;case"sd-select-dropdown":customElements.get(o(s))||f();break;case"sd-select-option":customElements.get(o(s))||b();break;case"sd-select-search-input":customElements.get(o(s))||w();break;case"sd-tooltip":customElements.get(o(s))||g()}}))}export{x as S,k as d}
@@ -0,0 +1 @@
1
+ var e={input:{sm:{height:"28",paddingX:"12",paddingY:"4",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"16",gap:"12",radius:"6",typography:{fontWeight:"400",fontSize:"16",lineHeight:"26"}},border:{default:"#AAAAAA"},bg:{default:"#FFFFFF",disabled:"#E1E1E1",barcode:"#FAFAA1"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{default:"#888888"},resizer:{color:"#AAAAAA"}}};export{e as i}
@@ -1 +1 @@
1
- import{p as t,H as e,h as s,F as i,t as o}from"./p-D-pFdq6g.js";import{T as n}from"./p-C2Yw3PoX.js";import{d as l}from"./p-CDR-4auv.js";import{d as a}from"./p-tR70yRjm.js";import{d as c}from"./p-DSYw-7RA.js";var r={bg:"#07284A",content:"#FFFFFF"},d={bg:"#FCEFEF",content:"#FB4444"},h={bg:"#FEF1EA",content:"#FF6B00"},p={bg:"#E6F1FF",content:"#0075FF"};const m={default:{bg:r.bg,content:r.content},danger:{bg:d.bg,content:d.content},warning:{bg:h.bg,content:h.content},accent:{bg:p.bg,content:p.content}},u=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";buttonSize="sm";buttonVariant="primary";noHover=!0;sdClass="";showTooltip=!1;slotContentHTML="";buttonEl;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;show=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};hide=()=>{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.hide()),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.hide();componentWillLoad(){this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren(),this.el.classList.toggle("visible",!0)}render(){const t=this.trigger??"hover",e=this.placement??"top",o=this.tooltipType??"default",l=this.icon??"helpOutline",a=this.color??"#01BB4B",c=m[o]??m.default,r=()=>this.showTooltip=!this.showTooltip;return s(i,{key:"45662c35d1eb8cd1f23e0c62646a02fd244fee13"},s("div",{key:"7f04bfcc31aecad132ce95eeb1a6d936f79189ee",class:`sd-tooltip-trigger ${this.sdClass||""}`,..."hover"===t?{onMouseEnter:()=>this.show(),onMouseLeave:()=>this.startHideTimer()}:this.label?{}:{onClick:r}},this.label?s("sd-button",{ref:t=>this.buttonEl=t,label:this.label,icon:l,size:this.buttonSize??"sm",color:a,variant:this.buttonVariant??"primary",class:"sd-tooltip",..."click"===t&&this.label?{onSdClick:r}:{}}):s("sd-icon",{ref:t=>this.buttonEl=t,name:l,size:this.iconSize??12,color:a,class:"sd-tooltip"})),this.showTooltip&&s("sd-floating-portal",{key:"95c16d600733dca5f40d06b222b422bd48ddb2dd",parentRef:this.buttonEl,onSdClose:this.handleClose.bind(this),placement:e,offset:this.tooltipOffset},s("div",{key:"84b63cb44fbe9e7a81e033acde6be32b72ed24ba",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${e}`]:!0},style:{"--sd-floating-bg":c.bg,"--sd-floating-content":c.content},onMouseEnter:()=>this.show(),onMouseLeave:()=>this.startHideTimer()},s("i",{key:"c05e9ecb128e780f3596e8e17b6796255e21b61e",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${e}`},s(n,{key:"fa56346eb836456d4a646cd2d3959e2c4c98c2d7"})),s("div",{key:"926e918d55db0f79e5e776b341fe4d0d6b0bf574",class:"sd-floating-menu__content",innerHTML:this.slotContentHTML}))))}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}"}},[512,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],buttonSize:[1,"button-size"],buttonVariant:[1,"button-variant"],noHover:[4,"no-hover"],sdClass:[1,"sd-class"],showTooltip:[32],slotContentHTML:[32]}]);function b(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-icon"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),u);break;case"sd-button":customElements.get(o(t))||l();break;case"sd-floating-portal":customElements.get(o(t))||a();break;case"sd-icon":customElements.get(o(t))||c()}}))}export{u as S,b as d}
1
+ import{p as t,H as e,h as s,F as i,t as o}from"./p-D-pFdq6g.js";import{T as n}from"./p-C2Yw3PoX.js";import{d as a}from"./p-CDR-4auv.js";import{d as l}from"./p-tR70yRjm.js";import{d as c}from"./p-DSYw-7RA.js";var r={bg:"#07284A",content:"#FFFFFF"},d={bg:"#FCEFEF",content:"#FB4444"},h={bg:"#FEF1EA",content:"#FF6B00"},p={bg:"#E6F1FF",content:"#0075FF"};const m={default:{bg:r.bg,content:r.content},danger:{bg:d.bg,content:d.content},warning:{bg:h.bg,content:h.content},accent:{bg:p.bg,content:p.content}},u=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";buttonSize="sm";buttonVariant="primary";noHover=!0;sdClass="";showTooltip=!1;slotContentHTML="";buttonEl;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;show=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};hide=()=>{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.hide()),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.hide();componentWillLoad(){this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren(),this.el.classList.toggle("visible",!0)}render(){const t=this.trigger??"hover",e=this.placement??"top",o=this.tooltipType??"default",a=this.icon??"helpOutline",l=this.color??"#01BB4B",c=m[o]??m.default,r=()=>this.showTooltip=!this.showTooltip;return s(i,{key:"2e854c5a056af93e65460500da199ddd763de777"},s("div",{key:"aa5e250e4d371c4a54401d367fdf647cefb6aecc",class:`sd-tooltip-trigger ${this.sdClass||""}`,..."hover"===t?{onMouseEnter:()=>this.show(),onMouseLeave:()=>this.startHideTimer()}:this.label?{}:{onClick:r}},this.label?s("sd-button",{ref:t=>this.buttonEl=t,label:this.label,icon:a,size:this.buttonSize??"sm",color:l,variant:this.buttonVariant??"primary",class:"sd-tooltip",..."click"===t&&this.label?{onSdClick:r}:{}}):s("sd-icon",{ref:t=>this.buttonEl=t,name:a,size:this.iconSize??12,color:l,class:"sd-tooltip"})),this.showTooltip&&s("sd-floating-portal",{key:"f94aa0d5730b7f585f943b60bf39e4248d0b695e",parentRef:this.buttonEl,onSdClose:this.handleClose.bind(this),placement:e,offset:this.tooltipOffset},s("div",{key:"76ece6c53c4daad54a13950b616bb7edd0827f81",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${e}`]:!0},style:{"--sd-floating-bg":c.bg,"--sd-floating-content":c.content},onMouseEnter:()=>this.show(),onMouseLeave:()=>this.startHideTimer()},s("i",{key:"4beed6bf9afbccd072c2c8ab9885d7a8bde99284",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${e}`},s(n,{key:"e73b4c9085c57f40410ecc0a7ec758019418899e"})),s("div",{key:"8dcd58077836c846fafb948dbf0c77e149987818",class:"sd-floating-menu__content",innerHTML:this.slotContentHTML}))))}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}"}},[512,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],buttonSize:[1,"button-size"],buttonVariant:[1,"button-variant"],noHover:[4,"no-hover"],sdClass:[1,"sd-class"],showTooltip:[32],slotContentHTML:[32]}]);function f(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-icon"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),u);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-floating-portal":customElements.get(o(t))||l();break;case"sd-icon":customElements.get(o(t))||c()}}))}export{u as S,f as d}
@@ -1 +1 @@
1
- import{p as s,H as e,c as t,h as c,t as a}from"./p-D-pFdq6g.js";import{d as o}from"./p-CDR-4auv.js";import{d as i}from"./p-hWm-Llzv.js";import{d as r}from"./p-tR70yRjm.js";import{d}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as l}from"./p-Bbl5852O.js";import{d as p}from"./p-CpGiSLY_.js";const u=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.searchInput=t(this,"sdSearchInput",7),this.searchFocus=t(this,"sdSearchFocus",7)}isScrolled=!1;searchText="";searchInput;searchFocus;searchRef;async sdGetNativeElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}async sdSearchInputFocus(){const s=await this.sdGetNativeElement();s?.focus({preventScroll:!0})}render(){return c("div",{key:"2d211645dc4041411e187f248a260a23b7c544f6",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"c609af0ab36359c8ccaea5827821dbc509d13eac",ref:s=>this.searchRef=s,value:this.searchText,placeholder:"검색",clearable:!0,inputStyle:{"padding-left":"8px"},autofocus:!0,onSdUpdate:s=>{this.searchInput.emit(String(s?.detail))},onSdFocus:()=>{this.searchFocus.emit()},onKeyDown:s=>{"Enter"===s.code&&s.stopPropagation()}},c("sd-icon",{key:"96a511b1f8625c883ec50d5e2985ff396d7b57c7",name:"search",size:16,color:"#737373",style:{marginRight:"4px"},slot:"prefix"})))}static get style(){return"sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center}sd-select-search-input .sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center;padding:4px 8px}sd-select-search-input .sd-select-search-input sd-input{width:100%}sd-select-search-input .sd-select-search-input--scrolled{box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}"}},[512,"sd-select-search-input",{isScrolled:[4,"is-scrolled"],searchText:[1,"search-text"],sdGetNativeElement:[64],sdSearchInputFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-search-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select-search-input":customElements.get(a(s))||customElements.define(a(s),u);break;case"sd-button":customElements.get(a(s))||o();break;case"sd-field":customElements.get(a(s))||i();break;case"sd-floating-portal":customElements.get(a(s))||r();break;case"sd-ghost-button":customElements.get(a(s))||d();break;case"sd-icon":customElements.get(a(s))||n();break;case"sd-input":customElements.get(a(s))||l();break;case"sd-tooltip":customElements.get(a(s))||p()}}))}export{u as S,h as d}
1
+ import{p as s,H as e,c as t,h as c,t as a}from"./p-D-pFdq6g.js";import{d as o}from"./p-CDR-4auv.js";import{d as i}from"./p-BM4qDFZj.js";import{d as r}from"./p-tR70yRjm.js";import{d}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as l}from"./p-BR0LWoJL.js";import{d as p}from"./p-DxzIjbQJ.js";const u=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.searchInput=t(this,"sdSearchInput",7),this.searchFocus=t(this,"sdSearchFocus",7)}isScrolled=!1;searchText="";searchInput;searchFocus;searchRef;async sdGetNativeElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}async sdSearchInputFocus(){const s=await this.sdGetNativeElement();s?.focus({preventScroll:!0})}render(){return c("div",{key:"2d211645dc4041411e187f248a260a23b7c544f6",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"c609af0ab36359c8ccaea5827821dbc509d13eac",ref:s=>this.searchRef=s,value:this.searchText,placeholder:"검색",clearable:!0,inputStyle:{"padding-left":"8px"},autofocus:!0,onSdUpdate:s=>{this.searchInput.emit(String(s?.detail))},onSdFocus:()=>{this.searchFocus.emit()},onKeyDown:s=>{"Enter"===s.code&&s.stopPropagation()}},c("sd-icon",{key:"96a511b1f8625c883ec50d5e2985ff396d7b57c7",name:"search",size:16,color:"#737373",style:{marginRight:"4px"},slot:"prefix"})))}static get style(){return"sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center}sd-select-search-input .sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center;padding:4px 8px}sd-select-search-input .sd-select-search-input sd-input{width:100%}sd-select-search-input .sd-select-search-input--scrolled{box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}"}},[512,"sd-select-search-input",{isScrolled:[4,"is-scrolled"],searchText:[1,"search-text"],sdGetNativeElement:[64],sdSearchInputFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-search-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select-search-input":customElements.get(a(s))||customElements.define(a(s),u);break;case"sd-button":customElements.get(a(s))||o();break;case"sd-field":customElements.get(a(s))||i();break;case"sd-floating-portal":customElements.get(a(s))||r();break;case"sd-ghost-button":customElements.get(a(s))||d();break;case"sd-icon":customElements.get(a(s))||n();break;case"sd-input":customElements.get(a(s))||l();break;case"sd-tooltip":customElements.get(a(s))||p()}}))}export{u as S,h as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as a}from"./p-D-pFdq6g.js";import{n as o}from"./p-CCwNgVmC.js";import{i as n}from"./p-BGovA1BG.js";import{d}from"./p-CDR-4auv.js";import{d as l}from"./p-hWm-Llzv.js";import{d as r}from"./p-tR70yRjm.js";import{d as c}from"./p-B3CfLqLu.js";import{d as u}from"./p-DSYw-7RA.js";import{d as h}from"./p-CpGiSLY_.js";const p=n.input.sm,b=n.input.md,f={sm:{height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={bg:n.input.bg,text:n.input.text,icon:n.input.icon},g=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get host(){return this}value=null;size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,e)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(e)):this.focus?.emit(e)};render(){const t=f[this.size]??f.sm;return i("sd-field",{key:"9987023d28947334836b6b0b0c5f493eab91c59c",name:this.name,label:this.label,addonLabel:this.addonLabel,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:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":m.text.default,"--sd-barcode-input-placeholder-color":m.text.placeholder,"--sd-barcode-input-disabled-color":m.text.disabled,"--sd-barcode-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":t.height+"px","--sd-system-radius-field-sm":t.radius+"px","--sd-system-color-field-bg-default":m.bg.barcode}},i("label",{key:"a3b70f106f4d05a82b9da0fda0c1450fef5a4bd4",class:"sd-barcode-input__content"},i("slot",{key:"5c6aa9b488ca414d191b538bca0bbcc1aca6cf75",name:"prefix"}),i("input",{key:"94133a24b1ba1e691584a27c5ddd13ded76ff462",name:this.name,ref:t=>this.nativeEl=t,class:"sd-barcode-input__native "+this.inputClass,type:"text",value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),i("slot",{key:"04d64be5bd466b68423e44caab9cc513610bef92",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"052388d8e79b249752a6668db221af140b3eea1f",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-barcode-input",{value:[1032],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=g,x=function(){"undefined"!=typeof customElements&&["sd-barcode-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-barcode-input":customElements.get(a(t))||customElements.define(a(t),g);break;case"sd-button":customElements.get(a(t))||d();break;case"sd-field":customElements.get(a(t))||l();break;case"sd-floating-portal":customElements.get(a(t))||r();break;case"sd-ghost-button":customElements.get(a(t))||c();break;case"sd-icon":customElements.get(a(t))||u();break;case"sd-tooltip":customElements.get(a(t))||h()}}))};export{v as SdBarcodeInput,x as defineCustomElement}
1
+ import{p as t,H as e,c as s,h as i,t as a}from"./p-D-pFdq6g.js";import{n as o}from"./p-CCwNgVmC.js";import{i as n}from"./p-DSNs8RRn.js";import{d}from"./p-CDR-4auv.js";import{d as l}from"./p-BM4qDFZj.js";import{d as r}from"./p-tR70yRjm.js";import{d as c}from"./p-B3CfLqLu.js";import{d as u}from"./p-DSYw-7RA.js";import{d as h}from"./p-DxzIjbQJ.js";const p=n.input.sm,b=n.input.md,f={sm:{height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={bg:n.input.bg,text:n.input.text,icon:n.input.icon},g=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get host(){return this}value=null;size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,e)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(e)):this.focus?.emit(e)};render(){const t=f[this.size]??f.sm;return i("sd-field",{key:"9987023d28947334836b6b0b0c5f493eab91c59c",name:this.name,label:this.label,addonLabel:this.addonLabel,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:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":m.text.default,"--sd-barcode-input-placeholder-color":m.text.placeholder,"--sd-barcode-input-disabled-color":m.text.disabled,"--sd-barcode-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":t.height+"px","--sd-system-radius-field-sm":t.radius+"px","--sd-system-color-field-bg-default":m.bg.barcode}},i("label",{key:"a3b70f106f4d05a82b9da0fda0c1450fef5a4bd4",class:"sd-barcode-input__content"},i("slot",{key:"5c6aa9b488ca414d191b538bca0bbcc1aca6cf75",name:"prefix"}),i("input",{key:"94133a24b1ba1e691584a27c5ddd13ded76ff462",name:this.name,ref:t=>this.nativeEl=t,class:"sd-barcode-input__native "+this.inputClass,type:"text",value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),i("slot",{key:"04d64be5bd466b68423e44caab9cc513610bef92",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"052388d8e79b249752a6668db221af140b3eea1f",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-barcode-input",{value:[1032],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=g,x=function(){"undefined"!=typeof customElements&&["sd-barcode-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-barcode-input":customElements.get(a(t))||customElements.define(a(t),g);break;case"sd-button":customElements.get(a(t))||d();break;case"sd-field":customElements.get(a(t))||l();break;case"sd-floating-portal":customElements.get(a(t))||r();break;case"sd-ghost-button":customElements.get(a(t))||c();break;case"sd-icon":customElements.get(a(t))||u();break;case"sd-tooltip":customElements.get(a(t))||h()}}))};export{v as SdBarcodeInput,x as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as d,t as a}from"./p-D-pFdq6g.js";import{d as i}from"./p-CDR-4auv.js";import{d as c}from"./p-DCJWAesd.js";import{d as o}from"./p-CqU3a1re.js";import{d as r}from"./p-hWm-Llzv.js";import{d as l}from"./p-tR70yRjm.js";import{d as p}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as m}from"./p-Bbl5852O.js";import{d as h}from"./p-DB_gU4hh.js";import{d as b}from"./p-CpGiSLY_.js";const u=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}get el(){return this}value=null;label;selectable;disabled=!1;placeholder="";isOpen=!1;update;viewChange;inputEl;openMenu(){this.disabled||(this.isOpen=!0)}handleSelect=e=>{this.value=e.detail,this.isOpen=!1,this.update.emit(e.detail)};handleClose=()=>{this.isOpen=!1};handleViewChange=e=>{this.viewChange.emit(e.detail)};render(){return d("div",{key:"160bd9b2bbd9d223d4df341ed2fbba79c1701c13",class:{"sd-date-picker":!0,"sd-date-picker--disabled":this.disabled}},d("sd-input",{key:"cf7c72c144f1222308eb936a14d1786863019126",ref:e=>this.inputEl=e,value:this.value,addonLabel:this.label,readonly:!0,disabled:this.disabled,placeholder:this.placeholder,inputClass:"sd-date-picker__input",onClick:()=>this.openMenu()},d("sd-icon",{key:"8651ba1d36749667f53e9f064b973cb336389ab3",slot:"prefix",name:"date",size:"16",color:this.disabled?"grey_65":"grey_70",class:"date-icon",onClick:()=>this.openMenu()})),this.isOpen&&d("sd-portal",{key:"6ee759cf5cbb0afc4cd8adf704a489ef6cffc8f9",open:this.isOpen,parentRef:this.inputEl,onSdClose:this.handleClose},d("div",{key:"96c038fea5102ffd780fd296534cc294bd1c6912",class:"sd-date-picker__menu"},d("sd-calendar",{key:"bc8d14f98d5d56e6775f083e4096d1113c28a658",value:this.value,selectable:this.selectable,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange}))))}static get style(){return".sd-date-picker.sc-sd-date-picker{width:100%;display:inline-block}.sd-date-picker.sc-sd-date-picker .sd-date-picker--disabled.sc-sd-date-picker .date-icon.sc-sd-date-picker{cursor:not-allowed !important;color:#888888 !important}.sd-date-picker.sc-sd-date-picker .sd-date-picker__input.sc-sd-date-picker{text-align:center !important}.sd-date-picker__menu.sc-sd-date-picker{border-radius:8px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}"}},[514,"sd-date-picker",{value:[1537],label:[1],selectable:[16],disabled:[4],placeholder:[1],isOpen:[32]}]),f=u,k=function(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-calendar","sd-date-box","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),u);break;case"sd-button":customElements.get(a(e))||i();break;case"sd-calendar":customElements.get(a(e))||c();break;case"sd-date-box":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||r();break;case"sd-floating-portal":customElements.get(a(e))||l();break;case"sd-ghost-button":customElements.get(a(e))||p();break;case"sd-icon":customElements.get(a(e))||n();break;case"sd-input":customElements.get(a(e))||m();break;case"sd-portal":customElements.get(a(e))||h();break;case"sd-tooltip":customElements.get(a(e))||b()}}))};export{f as SdDatePicker,k as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as d,t as a}from"./p-D-pFdq6g.js";import{d as i}from"./p-CDR-4auv.js";import{d as c}from"./p-DCJWAesd.js";import{d as o}from"./p-CqU3a1re.js";import{d as r}from"./p-BM4qDFZj.js";import{d as l}from"./p-tR70yRjm.js";import{d as p}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as m}from"./p-BR0LWoJL.js";import{d as b}from"./p-DB_gU4hh.js";import{d as h}from"./p-DxzIjbQJ.js";const u=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}get el(){return this}value=null;label;selectable;disabled=!1;placeholder="";isOpen=!1;update;viewChange;inputEl;openMenu(){this.disabled||(this.isOpen=!0)}handleSelect=e=>{this.value=e.detail,this.isOpen=!1,this.update.emit(e.detail)};handleClose=()=>{this.isOpen=!1};handleViewChange=e=>{this.viewChange.emit(e.detail)};render(){return d("div",{key:"160bd9b2bbd9d223d4df341ed2fbba79c1701c13",class:{"sd-date-picker":!0,"sd-date-picker--disabled":this.disabled}},d("sd-input",{key:"cf7c72c144f1222308eb936a14d1786863019126",ref:e=>this.inputEl=e,value:this.value,addonLabel:this.label,readonly:!0,disabled:this.disabled,placeholder:this.placeholder,inputClass:"sd-date-picker__input",onClick:()=>this.openMenu()},d("sd-icon",{key:"8651ba1d36749667f53e9f064b973cb336389ab3",slot:"prefix",name:"date",size:"16",color:this.disabled?"grey_65":"grey_70",class:"date-icon",onClick:()=>this.openMenu()})),this.isOpen&&d("sd-portal",{key:"6ee759cf5cbb0afc4cd8adf704a489ef6cffc8f9",open:this.isOpen,parentRef:this.inputEl,onSdClose:this.handleClose},d("div",{key:"96c038fea5102ffd780fd296534cc294bd1c6912",class:"sd-date-picker__menu"},d("sd-calendar",{key:"bc8d14f98d5d56e6775f083e4096d1113c28a658",value:this.value,selectable:this.selectable,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange}))))}static get style(){return".sd-date-picker.sc-sd-date-picker{width:100%;display:inline-block}.sd-date-picker.sc-sd-date-picker .sd-date-picker--disabled.sc-sd-date-picker .date-icon.sc-sd-date-picker{cursor:not-allowed !important;color:#888888 !important}.sd-date-picker.sc-sd-date-picker .sd-date-picker__input.sc-sd-date-picker{text-align:center !important}.sd-date-picker__menu.sc-sd-date-picker{border-radius:8px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}"}},[514,"sd-date-picker",{value:[1537],label:[1],selectable:[16],disabled:[4],placeholder:[1],isOpen:[32]}]),f=u,k=function(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-calendar","sd-date-box","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),u);break;case"sd-button":customElements.get(a(e))||i();break;case"sd-calendar":customElements.get(a(e))||c();break;case"sd-date-box":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||r();break;case"sd-floating-portal":customElements.get(a(e))||l();break;case"sd-ghost-button":customElements.get(a(e))||p();break;case"sd-icon":customElements.get(a(e))||n();break;case"sd-input":customElements.get(a(e))||m();break;case"sd-portal":customElements.get(a(e))||b();break;case"sd-tooltip":customElements.get(a(e))||h()}}))};export{f as SdDatePicker,k as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as t,c as a,h as s,F as r,t as d}from"./p-D-pFdq6g.js";import{u as i,t as n}from"./p-DTrMR0rx.js";import{d as c}from"./p-CDR-4auv.js";import{d as p}from"./p-CqU3a1re.js";import{d as o}from"./p-hWm-Llzv.js";import{d as h}from"./p-tR70yRjm.js";import{d as l}from"./p-B3CfLqLu.js";import{d as g}from"./p-DSYw-7RA.js";import{d as k}from"./p-Bbl5852O.js";import{d as b}from"./p-DB_gU4hh.js";import{d as m}from"./p-CpGiSLY_.js";const u=(e,t)=>{const[a,s,r]=e.split("-").map(Number),d=new Date(a,s-1,r);return d.setDate(d.getDate()+t),`${d.getFullYear()}-${(d.getMonth()+1+"").padStart(2,"0")}-${(d.getDate()+"").padStart(2,"0")}`},f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}get el(){return this}value=["",""];label;selectable;maxRange;disabled=!1;placeholder="";isOpen=!1;dateRange=this.value;hoverDate="";prevYear=Number(this.dateRange[0].split("-")[0]);prevMonth=Number(this.dateRange[0].split("-")[1]);update;viewChange;inputEl;dateUtil=i();tempDateRange=["",""];componentWillLoad(){this.syncFromValue(this.value)}onValueChange(e){this.dateRange=[...e]}syncFromValue(e){this.dateRange=[...e],this.resetCalendarByDateRange(e)}resetCalendarByDateRange(e){const t=e[0]||n,a=e[1]||t,[s,r]=t.split("-").map(Number),[d,i]=n.split("-").map(Number);a<=n?(this.prevYear=s,this.prevMonth=r):t<n&&a>n?(this.prevYear=d,this.prevMonth=i):(this.prevYear=s,this.prevMonth=r)}get nextYear(){return 12===this.prevMonth?this.prevYear+1:this.prevYear}get nextMonth(){return 12===this.prevMonth?1:this.prevMonth+1}get prevCalendar(){return this.dateUtil.createCalendar(this.prevYear,this.prevMonth)}get nextCalendar(){return this.dateUtil.createCalendar(this.nextYear,this.nextMonth)}setPrevYear(e){this.prevYear=e}setPrevMonth(e){this.prevMonth=e}updateYearMonth(e){const{newYear:t,newMonth:a}=this.dateUtil.calculateYearMonth(this.prevYear,this.prevMonth,e);this.setPrevYear(t),this.setPrevMonth(a),this.viewChange.emit({year:t,month:a})}setHoverDate(e){this.hoverDate=e}setDateRange(e){this.dateRange=e}formatDate(e,t){return this.dateUtil.formatDate(0===e?this.prevYear:this.nextYear,0===e?this.prevMonth:this.nextMonth,t)}getDateBoxType(e){const[t,a]=this.dateRange;return e===t?a?"start":this.hoverDate<this.dateRange[0]?"end":"start":e===a?"end":""}isDateInRange(e){const[t,a]=this.dateRange;if(t&&a)return e>=t&&e<=a;if(!this.hoverDate||!t||a)return!1;const[s,r]=t<=this.hoverDate?[t,this.hoverDate]:[this.hoverDate,t];return e>=s&&e<=r}isDisabledDate(e){const[t,a]=this.dateRange;if(this.maxRange&&t&&!a){const a=u(t,-this.maxRange),s=u(t,this.maxRange);return!(a<=e&&e<=s)}return!(!(this.selectable&&this.selectable[0]&&this.selectable[1])||e>=this.selectable[0]&&e<=this.selectable[1])}openMenu(){this.disabled||(this.tempDateRange=[...this.dateRange],this.resetCalendarByDateRange(this.dateRange),this.isOpen=!0)}closeMenu=()=>{this.dateRange[0]&&this.dateRange[1]||(this.dateRange=[...this.tempDateRange]),this.isOpen=!1};handleDateClick(e,t){this.setHoverDate("");const a=this.formatDate(e,t);if(!this.dateRange[0]||this.dateRange[1]||a<this.dateRange[0])return void this.setDateRange([a,""]);const s=[this.dateRange[0],a];this.setDateRange(s),this.value=s,this.update.emit?.(s),this.isOpen=!1}handleDateHover(e,t){const a=this.formatDate(e,t);this.setHoverDate(a)}render(){return s("div",{key:"ed71379abf9d60bfa21c9888ba0f84f543bc0fe2",class:{"sd-date-range-picker":!0,"sd-date-range-picker--disabled":this.disabled}},s("sd-input",{key:"d9b4269ee29ddf23dd80b5bcad2ded0d5edae8a6",ref:e=>this.inputEl=e,value:this.dateRange[0]?`${this.dateRange[0]} ~ ${this.dateRange[1]}`:"",addonLabel:this.label,readonly:!0,disabled:this.disabled,placeholder:this.placeholder,inputClass:"sd-date-range-picker__input",onClick:()=>this.openMenu()},s("sd-icon",{key:"a30448daa738ee75925974735f7a9948a47761e1",slot:"prefix",name:"date",size:"16",color:this.disabled?"grey_65":"grey_70",class:"date-icon",onClick:()=>this.openMenu()})),this.isOpen&&s("sd-portal",{key:"553abd0af76848be54788518507fbf0cc20db111",open:this.isOpen,parentRef:this.inputEl,onSdClose:this.closeMenu},s("div",{key:"152fb19e5c8dbd5e5f978b11868cc71b382255d8",class:"sd-date-range-picker__menu"},s("div",{key:"5d290d39d6aa8cc0d3a4394ac2f1d4bc93428bb3",class:"sd-date-range-picker__header mb-16pxr flex flex-nowrap items-center justify-center"},s("button",{key:"b20caad91457bda87690629aa3fc34d4d2c5a673",type:"button",name:"prev",title:"Previous",onClick:()=>{this.setPrevYear(this.prevYear-1),this.viewChange.emit({year:this.prevYear,month:this.prevMonth})}},s("sd-icon",{key:"5f0e8014992b7269aed7d97a4a56263349c90afa",name:"arrowLeft",size:"12",color:"#CCCCCC"})),s("div",{key:"f324d84e338aa2779e471a123fc7b5220900389d",class:"header-label"},this.prevYear),s("button",{key:"18e331eb0c8fe3cc1eba2b718433ca7f7ec17b3e",type:"button",name:"next",title:"Next",onClick:()=>{this.setPrevYear(this.prevYear+1),this.viewChange.emit({year:this.prevYear,month:this.prevMonth})}},s("sd-icon",{key:"1ec935fbbb3ecbafb42df34905f62753dfd49da2",name:"arrowRight",size:"12",color:"#CCCCCC"}))),s("div",{key:"47af9712b96158741a3fed052f4b1eb7bca08eef",class:"sd-date-range-picker__body"},[this.prevCalendar,this.nextCalendar].map(((e,t)=>s(r,null,1===t&&s("div",{class:"separator"}),s("div",{key:t,class:"calendar-container"},s("div",{class:"calendar-header"},s("button",{type:"button",name:"month",title:"Month",class:0===t?"header-button-prev":"header-button-next",onClick:()=>this.updateYearMonth(0===t?"prev":"next")},s("sd-icon",{name:0===t?"arrowLeft":"arrowRight",size:"12",color:"#CCCCCC"})),0===t?`${this.prevYear}.${(this.prevMonth+"").padStart(2,"0")}`:`${this.nextYear}.${(this.nextMonth+"").padStart(2,"0")}`),s("div",{class:"calendar-days"},["일","월","화","수","목","금","토"].map((e=>s("sd-date-box",{key:e,date:e,disabled:!0,class:"day"})))),s("div",{class:"calendar-body mt-12pxr grid grid-cols-7 gap-y-8pxr"},[...e.prevMonthDays,...e.days,...e.afterMonthDays].map(((e,a)=>s("sd-date-box",{key:`prev${e}_${a}`,date:e?Number(e):"",selected:this.dateRange.some((a=>a===this.formatDate(t,Number(e)))),type:this.getDateBoxType(this.formatDate(t,Number(e))),isToday:n===this.formatDate(t,Number(e)),disabled:!e||this.isDisabledDate(this.formatDate(t,Number(e))),inRange:this.isDateInRange(this.formatDate(t,Number(e))),isStartDate:this.dateRange[0]===this.formatDate(t,Number(e)),isEndDate:this.dateRange[1]===this.formatDate(t,Number(e)),onSdClick:()=>this.handleDateClick(t,Number(e)),onSdMouseOver:()=>this.handleDateHover(t,Number(e))}))))))))))))}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return"sd-date-range-picker.sc-sd-date-range-picker{width:fit-content;display:inline-flex}sd-date-range-picker.sc-sd-date-range-picker .sd-date-range-picker--disabled.sc-sd-date-range-picker .date-icon.sc-sd-date-range-picker{cursor:not-allowed !important;color:#888888 !important}sd-date-range-picker.sc-sd-date-range-picker .sd-date-range-picker--disabled.sc-sd-date-range-picker .sd-input__native.sc-sd-date-range-picker{color:#888888 !important}sd-date-range-picker.sc-sd-date-range-picker .sd-field.sc-sd-date-range-picker .sd-field__control.sc-sd-date-range-picker{min-width:210px}sd-date-range-picker.sc-sd-date-range-picker .sd-field.sc-sd-date-range-picker .sd-input__native.sc-sd-date-range-picker{margin-left:17px !important}.sd-date-range-picker__menu.sc-sd-date-range-picker{width:609px;box-sizing:border-box;border-radius:8px;padding:24px 19px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);background:white}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__header.sc-sd-date-range-picker{margin-bottom:16px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__header.sc-sd-date-range-picker .header-label.sc-sd-date-range-picker{margin:0 12px;width:40px;text-align:center;font-size:14px;line-height:24px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker{display:flex;flex-flow:row nowrap;align-items:stretch;gap:19px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker{width:266px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker{width:100%;height:24px;line-height:24px;font-size:14px;text-align:center;position:relative;padding:0 5px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.sc-sd-date-range-picker{position:absolute;top:50%;transform:translateY(-50%)}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.header-button-prev.sc-sd-date-range-picker{left:5px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.header-button-next.sc-sd-date-range-picker{right:5px;left:auto}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-days.sc-sd-date-range-picker{padding:0 5px;margin-top:8px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr));column-gap:10px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-days.sc-sd-date-range-picker .day.sc-sd-date-range-picker{width:28px;height:20px;font-size:12px;line-height:20px;text-align:center;color:#888888}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-body.sc-sd-date-range-picker{margin-top:12px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr))}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .separator.sc-sd-date-range-picker{width:1px;background-color:#D8D8D8}"}},[514,"sd-date-range-picker",{value:[1040],label:[1],selectable:[16],maxRange:[2,"max-range"],disabled:[4],placeholder:[1],isOpen:[32],dateRange:[32],hoverDate:[32],prevYear:[32],prevMonth:[32]},void 0,{value:[{onValueChange:0}]}]),x=f,_=function(){"undefined"!=typeof customElements&&["sd-date-range-picker","sd-button","sd-date-box","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-range-picker":customElements.get(d(e))||customElements.define(d(e),f);break;case"sd-button":customElements.get(d(e))||c();break;case"sd-date-box":customElements.get(d(e))||p();break;case"sd-field":customElements.get(d(e))||o();break;case"sd-floating-portal":customElements.get(d(e))||h();break;case"sd-ghost-button":customElements.get(d(e))||l();break;case"sd-icon":customElements.get(d(e))||g();break;case"sd-input":customElements.get(d(e))||k();break;case"sd-portal":customElements.get(d(e))||b();break;case"sd-tooltip":customElements.get(d(e))||m()}}))};export{x as SdDateRangePicker,_ as defineCustomElement}
1
+ import{p as e,H as t,c as a,h as s,F as r,t as d}from"./p-D-pFdq6g.js";import{u as i,t as n}from"./p-DTrMR0rx.js";import{d as c}from"./p-CDR-4auv.js";import{d as p}from"./p-CqU3a1re.js";import{d as o}from"./p-BM4qDFZj.js";import{d as h}from"./p-tR70yRjm.js";import{d as l}from"./p-B3CfLqLu.js";import{d as g}from"./p-DSYw-7RA.js";import{d as k}from"./p-BR0LWoJL.js";import{d as b}from"./p-DB_gU4hh.js";import{d as m}from"./p-DxzIjbQJ.js";const u=(e,t)=>{const[a,s,r]=e.split("-").map(Number),d=new Date(a,s-1,r);return d.setDate(d.getDate()+t),`${d.getFullYear()}-${(d.getMonth()+1+"").padStart(2,"0")}-${(d.getDate()+"").padStart(2,"0")}`},f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}get el(){return this}value=["",""];label;selectable;maxRange;disabled=!1;placeholder="";isOpen=!1;dateRange=this.value;hoverDate="";prevYear=Number(this.dateRange[0].split("-")[0]);prevMonth=Number(this.dateRange[0].split("-")[1]);update;viewChange;inputEl;dateUtil=i();tempDateRange=["",""];componentWillLoad(){this.syncFromValue(this.value)}onValueChange(e){this.dateRange=[...e]}syncFromValue(e){this.dateRange=[...e],this.resetCalendarByDateRange(e)}resetCalendarByDateRange(e){const t=e[0]||n,a=e[1]||t,[s,r]=t.split("-").map(Number),[d,i]=n.split("-").map(Number);a<=n?(this.prevYear=s,this.prevMonth=r):t<n&&a>n?(this.prevYear=d,this.prevMonth=i):(this.prevYear=s,this.prevMonth=r)}get nextYear(){return 12===this.prevMonth?this.prevYear+1:this.prevYear}get nextMonth(){return 12===this.prevMonth?1:this.prevMonth+1}get prevCalendar(){return this.dateUtil.createCalendar(this.prevYear,this.prevMonth)}get nextCalendar(){return this.dateUtil.createCalendar(this.nextYear,this.nextMonth)}setPrevYear(e){this.prevYear=e}setPrevMonth(e){this.prevMonth=e}updateYearMonth(e){const{newYear:t,newMonth:a}=this.dateUtil.calculateYearMonth(this.prevYear,this.prevMonth,e);this.setPrevYear(t),this.setPrevMonth(a),this.viewChange.emit({year:t,month:a})}setHoverDate(e){this.hoverDate=e}setDateRange(e){this.dateRange=e}formatDate(e,t){return this.dateUtil.formatDate(0===e?this.prevYear:this.nextYear,0===e?this.prevMonth:this.nextMonth,t)}getDateBoxType(e){const[t,a]=this.dateRange;return e===t?a?"start":this.hoverDate<this.dateRange[0]?"end":"start":e===a?"end":""}isDateInRange(e){const[t,a]=this.dateRange;if(t&&a)return e>=t&&e<=a;if(!this.hoverDate||!t||a)return!1;const[s,r]=t<=this.hoverDate?[t,this.hoverDate]:[this.hoverDate,t];return e>=s&&e<=r}isDisabledDate(e){const[t,a]=this.dateRange;if(this.maxRange&&t&&!a){const a=u(t,-this.maxRange),s=u(t,this.maxRange);return!(a<=e&&e<=s)}return!(!(this.selectable&&this.selectable[0]&&this.selectable[1])||e>=this.selectable[0]&&e<=this.selectable[1])}openMenu(){this.disabled||(this.tempDateRange=[...this.dateRange],this.resetCalendarByDateRange(this.dateRange),this.isOpen=!0)}closeMenu=()=>{this.dateRange[0]&&this.dateRange[1]||(this.dateRange=[...this.tempDateRange]),this.isOpen=!1};handleDateClick(e,t){this.setHoverDate("");const a=this.formatDate(e,t);if(!this.dateRange[0]||this.dateRange[1]||a<this.dateRange[0])return void this.setDateRange([a,""]);const s=[this.dateRange[0],a];this.setDateRange(s),this.value=s,this.update.emit?.(s),this.isOpen=!1}handleDateHover(e,t){const a=this.formatDate(e,t);this.setHoverDate(a)}render(){return s("div",{key:"ed71379abf9d60bfa21c9888ba0f84f543bc0fe2",class:{"sd-date-range-picker":!0,"sd-date-range-picker--disabled":this.disabled}},s("sd-input",{key:"d9b4269ee29ddf23dd80b5bcad2ded0d5edae8a6",ref:e=>this.inputEl=e,value:this.dateRange[0]?`${this.dateRange[0]} ~ ${this.dateRange[1]}`:"",addonLabel:this.label,readonly:!0,disabled:this.disabled,placeholder:this.placeholder,inputClass:"sd-date-range-picker__input",onClick:()=>this.openMenu()},s("sd-icon",{key:"a30448daa738ee75925974735f7a9948a47761e1",slot:"prefix",name:"date",size:"16",color:this.disabled?"grey_65":"grey_70",class:"date-icon",onClick:()=>this.openMenu()})),this.isOpen&&s("sd-portal",{key:"553abd0af76848be54788518507fbf0cc20db111",open:this.isOpen,parentRef:this.inputEl,onSdClose:this.closeMenu},s("div",{key:"152fb19e5c8dbd5e5f978b11868cc71b382255d8",class:"sd-date-range-picker__menu"},s("div",{key:"5d290d39d6aa8cc0d3a4394ac2f1d4bc93428bb3",class:"sd-date-range-picker__header mb-16pxr flex flex-nowrap items-center justify-center"},s("button",{key:"b20caad91457bda87690629aa3fc34d4d2c5a673",type:"button",name:"prev",title:"Previous",onClick:()=>{this.setPrevYear(this.prevYear-1),this.viewChange.emit({year:this.prevYear,month:this.prevMonth})}},s("sd-icon",{key:"5f0e8014992b7269aed7d97a4a56263349c90afa",name:"arrowLeft",size:"12",color:"#CCCCCC"})),s("div",{key:"f324d84e338aa2779e471a123fc7b5220900389d",class:"header-label"},this.prevYear),s("button",{key:"18e331eb0c8fe3cc1eba2b718433ca7f7ec17b3e",type:"button",name:"next",title:"Next",onClick:()=>{this.setPrevYear(this.prevYear+1),this.viewChange.emit({year:this.prevYear,month:this.prevMonth})}},s("sd-icon",{key:"1ec935fbbb3ecbafb42df34905f62753dfd49da2",name:"arrowRight",size:"12",color:"#CCCCCC"}))),s("div",{key:"47af9712b96158741a3fed052f4b1eb7bca08eef",class:"sd-date-range-picker__body"},[this.prevCalendar,this.nextCalendar].map(((e,t)=>s(r,null,1===t&&s("div",{class:"separator"}),s("div",{key:t,class:"calendar-container"},s("div",{class:"calendar-header"},s("button",{type:"button",name:"month",title:"Month",class:0===t?"header-button-prev":"header-button-next",onClick:()=>this.updateYearMonth(0===t?"prev":"next")},s("sd-icon",{name:0===t?"arrowLeft":"arrowRight",size:"12",color:"#CCCCCC"})),0===t?`${this.prevYear}.${(this.prevMonth+"").padStart(2,"0")}`:`${this.nextYear}.${(this.nextMonth+"").padStart(2,"0")}`),s("div",{class:"calendar-days"},["일","월","화","수","목","금","토"].map((e=>s("sd-date-box",{key:e,date:e,disabled:!0,class:"day"})))),s("div",{class:"calendar-body mt-12pxr grid grid-cols-7 gap-y-8pxr"},[...e.prevMonthDays,...e.days,...e.afterMonthDays].map(((e,a)=>s("sd-date-box",{key:`prev${e}_${a}`,date:e?Number(e):"",selected:this.dateRange.some((a=>a===this.formatDate(t,Number(e)))),type:this.getDateBoxType(this.formatDate(t,Number(e))),isToday:n===this.formatDate(t,Number(e)),disabled:!e||this.isDisabledDate(this.formatDate(t,Number(e))),inRange:this.isDateInRange(this.formatDate(t,Number(e))),isStartDate:this.dateRange[0]===this.formatDate(t,Number(e)),isEndDate:this.dateRange[1]===this.formatDate(t,Number(e)),onSdClick:()=>this.handleDateClick(t,Number(e)),onSdMouseOver:()=>this.handleDateHover(t,Number(e))}))))))))))))}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return"sd-date-range-picker.sc-sd-date-range-picker{width:fit-content;display:inline-flex}sd-date-range-picker.sc-sd-date-range-picker .sd-date-range-picker--disabled.sc-sd-date-range-picker .date-icon.sc-sd-date-range-picker{cursor:not-allowed !important;color:#888888 !important}sd-date-range-picker.sc-sd-date-range-picker .sd-date-range-picker--disabled.sc-sd-date-range-picker .sd-input__native.sc-sd-date-range-picker{color:#888888 !important}sd-date-range-picker.sc-sd-date-range-picker .sd-field.sc-sd-date-range-picker .sd-field__control.sc-sd-date-range-picker{min-width:210px}sd-date-range-picker.sc-sd-date-range-picker .sd-field.sc-sd-date-range-picker .sd-input__native.sc-sd-date-range-picker{margin-left:17px !important}.sd-date-range-picker__menu.sc-sd-date-range-picker{width:609px;box-sizing:border-box;border-radius:8px;padding:24px 19px;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);background:white}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__header.sc-sd-date-range-picker{margin-bottom:16px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__header.sc-sd-date-range-picker .header-label.sc-sd-date-range-picker{margin:0 12px;width:40px;text-align:center;font-size:14px;line-height:24px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker{display:flex;flex-flow:row nowrap;align-items:stretch;gap:19px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker{width:266px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker{width:100%;height:24px;line-height:24px;font-size:14px;text-align:center;position:relative;padding:0 5px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.sc-sd-date-range-picker{position:absolute;top:50%;transform:translateY(-50%)}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.header-button-prev.sc-sd-date-range-picker{left:5px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-header.sc-sd-date-range-picker button.header-button-next.sc-sd-date-range-picker{right:5px;left:auto}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-days.sc-sd-date-range-picker{padding:0 5px;margin-top:8px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr));column-gap:10px}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-days.sc-sd-date-range-picker .day.sc-sd-date-range-picker{width:28px;height:20px;font-size:12px;line-height:20px;text-align:center;color:#888888}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .calendar-container.sc-sd-date-range-picker .calendar-body.sc-sd-date-range-picker{margin-top:12px;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr))}.sd-date-range-picker__menu.sc-sd-date-range-picker .sd-date-range-picker__body.sc-sd-date-range-picker .separator.sc-sd-date-range-picker{width:1px;background-color:#D8D8D8}"}},[514,"sd-date-range-picker",{value:[1040],label:[1],selectable:[16],maxRange:[2,"max-range"],disabled:[4],placeholder:[1],isOpen:[32],dateRange:[32],hoverDate:[32],prevYear:[32],prevMonth:[32]},void 0,{value:[{onValueChange:0}]}]),x=f,_=function(){"undefined"!=typeof customElements&&["sd-date-range-picker","sd-button","sd-date-box","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-range-picker":customElements.get(d(e))||customElements.define(d(e),f);break;case"sd-button":customElements.get(d(e))||c();break;case"sd-date-box":customElements.get(d(e))||p();break;case"sd-field":customElements.get(d(e))||o();break;case"sd-floating-portal":customElements.get(d(e))||h();break;case"sd-ghost-button":customElements.get(d(e))||l();break;case"sd-icon":customElements.get(d(e))||g();break;case"sd-input":customElements.get(d(e))||k();break;case"sd-portal":customElements.get(d(e))||b();break;case"sd-tooltip":customElements.get(d(e))||m()}}))};export{x as SdDateRangePicker,_ as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p-hWm-Llzv.js";const m=o,p=s;export{m as SdField,p as defineCustomElement}
1
+ import{S as o,d as s}from"./p-BM4qDFZj.js";const p=o,r=s;export{p as SdField,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as i,c as t,h as s,t as l}from"./p-D-pFdq6g.js";import{d as r}from"./p-CDR-4auv.js";import{d as o}from"./p-hWm-Llzv.js";import{d as a}from"./p-tR70yRjm.js";import{d}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as c}from"./p-CpGiSLY_.js";var p={height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},size:{icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const h={height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight,iconSize:p.size.icon},f={text:p.text,icon:{default:"#888888",disabled:p.icon.disabled}},u=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.reject=t(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name="";label="";addonLabel="";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?.sdReset())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e){const i=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),s=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=s&&e.length>s)return{accepted:[],rejected:e,reason:"max-files"};if(null!=i){const t=e.filter((e=>e.size>i));if(t.length>0)return{accepted:[],rejected:t,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 t=Array.from(i),{accepted:s,rejected:l,reason:r}=this.validateFiles(t);if(r)return this.reject?.emit({files:l,reason:r}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=this.multiple?s:s[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.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}getDisplayText(){return this.hasFiles()?Array.isArray(this.internalValue)?this.internalValue.map((e=>e.name)).join(", "):this.internalValue?.name||this.placeholder:this.placeholder}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?f.icon.disabled:f.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),t={"--sd-file-picker-font-size":h.fontSize+"px","--sd-file-picker-line-height":h.lineHeight+"px","--sd-file-picker-font-weight":h.fontWeight,"--sd-file-picker-padding-x":h.paddingX+"px","--sd-file-picker-gap":h.gap+"px","--sd-file-picker-text-color":f.text.default,"--sd-file-picker-placeholder-color":f.text.placeholder,"--sd-file-picker-disabled-color":f.text.disabled,"--sd-system-size-field-sm-height":h.height+"px","--sd-system-radius-field-sm":h.radius+"px"},l=s("div",{class:"sd-file-picker__content",onClick:this.handleClick},s("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}),s("sd-icon",{name:"attachFile",size:Number(h.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),s("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&&s("sd-ghost-button",{icon:"close",size:"xxs",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&s("div",{class:"sd-file-picker__tooltip"},i));return this.inline?s("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l):s("sd-field",{name:this.name,label:this.label,addonLabel:this.addonLabel,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,style:t},l)}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:inline-flex;width:100%}.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:1000;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:[1],disabled:[4],inline:[4],multiple:[4],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],addonLabel:[1,"addon-label"],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}]}]),k=u,m=function(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),u);break;case"sd-button":customElements.get(l(e))||r();break;case"sd-field":customElements.get(l(e))||o();break;case"sd-floating-portal":customElements.get(l(e))||a();break;case"sd-ghost-button":customElements.get(l(e))||d();break;case"sd-icon":customElements.get(l(e))||n();break;case"sd-tooltip":customElements.get(l(e))||c()}}))};export{k as SdFilePicker,m as defineCustomElement}
1
+ import{p as e,H as i,c as t,h as s,t as l}from"./p-D-pFdq6g.js";import{d as r}from"./p-CDR-4auv.js";import{d as o}from"./p-BM4qDFZj.js";import{d as a}from"./p-tR70yRjm.js";import{d}from"./p-B3CfLqLu.js";import{d as n}from"./p-DSYw-7RA.js";import{d as c}from"./p-DxzIjbQJ.js";var p={height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},size:{icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const h={height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight,iconSize:p.size.icon},f={text:p.text,icon:{default:"#888888",disabled:p.icon.disabled}},u=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.reject=t(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name="";label="";addonLabel="";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?.sdReset())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e){const i=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),s=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=s&&e.length>s)return{accepted:[],rejected:e,reason:"max-files"};if(null!=i){const t=e.filter((e=>e.size>i));if(t.length>0)return{accepted:[],rejected:t,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 t=Array.from(i),{accepted:s,rejected:l,reason:r}=this.validateFiles(t);if(r)return this.reject?.emit({files:l,reason:r}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=this.multiple?s:s[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.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}getDisplayText(){return this.hasFiles()?Array.isArray(this.internalValue)?this.internalValue.map((e=>e.name)).join(", "):this.internalValue?.name||this.placeholder:this.placeholder}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?f.icon.disabled:f.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),t={"--sd-file-picker-font-size":h.fontSize+"px","--sd-file-picker-line-height":h.lineHeight+"px","--sd-file-picker-font-weight":h.fontWeight,"--sd-file-picker-padding-x":h.paddingX+"px","--sd-file-picker-gap":h.gap+"px","--sd-file-picker-text-color":f.text.default,"--sd-file-picker-placeholder-color":f.text.placeholder,"--sd-file-picker-disabled-color":f.text.disabled,"--sd-system-size-field-sm-height":h.height+"px","--sd-system-radius-field-sm":h.radius+"px"},l=s("div",{class:"sd-file-picker__content",onClick:this.handleClick},s("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}),s("sd-icon",{name:"attachFile",size:Number(h.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),s("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&&s("sd-ghost-button",{icon:"close",size:"xxs",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&s("div",{class:"sd-file-picker__tooltip"},i));return this.inline?s("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l):s("sd-field",{name:this.name,label:this.label,addonLabel:this.addonLabel,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,style:t},l)}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:inline-flex;width:100%}.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:1000;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:[1],disabled:[4],inline:[4],multiple:[4],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],addonLabel:[1,"addon-label"],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}]}]),k=u,m=function(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),u);break;case"sd-button":customElements.get(l(e))||r();break;case"sd-field":customElements.get(l(e))||o();break;case"sd-floating-portal":customElements.get(l(e))||a();break;case"sd-ghost-button":customElements.get(l(e))||d();break;case"sd-icon":customElements.get(l(e))||n();break;case"sd-tooltip":customElements.get(l(e))||c()}}))};export{k as SdFilePicker,m as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p-Bbl5852O.js";const p=o,r=s;export{p as SdInput,r as defineCustomElement}
1
+ import{S as o,d as s}from"./p-BR0LWoJL.js";const p=o,r=s;export{p as SdInput,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as n}from"./p-D-pFdq6g.js";import{n as r}from"./p-CCwNgVmC.js";import{d as u}from"./p-CDR-4auv.js";import{d}from"./p-hWm-Llzv.js";import{d as a}from"./p-tR70yRjm.js";import{d as o}from"./p-DSYw-7RA.js";import{d as l}from"./p-CpGiSLY_.js";var p={numberInput:{sm:{height:"28",paddingX:"6",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",gap:"12",radius:"6",typography:{fontWeight:"400",fontSize:"16",lineHeight:"26"}},contents:{gap:"4"},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},hint:{color:"#555555",typography:{fontSize:"12",lineHeight:"20"}},errorMessage:{color:"#E30000",typography:{fontSize:"12",lineHeight:"20"}},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const h=p.numberInput.sm,c=p.numberInput.md,b={sm:{height:h.height,paddingX:h.paddingX,gap:h.gap,radius:h.radius,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:c.height,paddingX:c.paddingX,gap:c.gap,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight}},m={border:p.numberInput.border,bg:p.numberInput.bg,text:p.numberInput.text},f={sm:{size:p.numberInput.stepper.sm.size},md:{size:p.numberInput.stepper.md.size},radius:p.numberInput.stepper.radius,bg:p.numberInput.stepper.bg,icon:p.numberInput.stepper.icon},g=p.numberInput.hint,y=p.numberInput.errorMessage,x=p.numberInput.contents.gap,_=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=-1/0;max=1/0;step=1;useButton=!1;useDecimal=!1;value=null;label;addonLabel="";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).split("."),r=(+i).toLocaleString(),u=e?"-"+r:r;return n?u+"."+n:u+""}parseInput(t){if(!t||""===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=b[this.size]??b.sm,e="md"===this.size?14:12;return i("sd-field",{key:"c09a48d9c0bfb0eb6c4327e63ff190b4fee7eff9",name:this.name,label:this.label,addonLabel:this.addonLabel,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,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-gap":t.gap+"px","--sd-number-input-text-color":m.text.default,"--sd-number-input-placeholder-color":m.text.placeholder,"--sd-number-input-disabled-color":m.text.disabled,"--sd-number-input-stepper-size":(f[this.size]?.size??f.sm.size)+"px","--sd-number-input-stepper-radius":f.radius+"px","--sd-number-input-stepper-bg":f.bg.default,"--sd-number-input-stepper-bg-disabled":f.bg.disabled,"--sd-number-input-stepper-icon-color":f.icon.default,"--sd-number-input-stepper-icon-disabled":f.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":m.border.default,"--sd-system-color-field-border-focus":m.border.focus,"--sd-system-color-field-border-danger":m.border.danger,"--sd-system-color-field-bg-default":m.bg.default,"--sd-textinput-input-text-error-message":y.color,"--sd-textinput-input-error-message-typography-font-size":y.typography.fontSize+"px","--sd-textinput-input-error-message-typography-line-height":y.typography.lineHeight+"px","--sd-textinput-input-text-hint":g.color,"--sd-textinput-input-hint-typography-font-size":g.typography.fontSize+"px","--sd-textinput-input-hint-typography-line-height":g.typography.lineHeight+"px","--sd-textinput-input-contents-gap":x+"px"}},i("div",{key:"7ba690b017d58326640083feb4f88ab74e20f7e3",class:"sd-number-input__content"},this.useButton&&i("button",{key:"0eb3ccd26428fce21d74b1e2f06258b054337017",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"4af528aa82ddc6f8abbee1fa8617f5fefc77f41b",name:"minus",size:e,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"f524a85295c29dc02b6803d5a145d24d6d7c3f1b",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"4f3c539cb82745b317ebc2e17f2852a5b386ba6b",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:"35a1cd706a87cf9320262b12aab7679cbb9eb7f2",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"a818bf380ac32291155bf8a3c35cf9b9a007ec5e",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"0d2e75fb5ebada9aa0846e807695d31f29b18647",name:"add",size:e,color:this.isIncrementDisabled()?f.icon.disabled:f.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;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);gap:var(--sd-number-input-gap)}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::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],addonLabel:[1,"addon-label"],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],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=_,w=function(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||a();break;case"sd-icon":customElements.get(n(t))||o();break;case"sd-tooltip":customElements.get(n(t))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
1
+ import{p as t,H as e,c as s,h as i,t as n}from"./p-D-pFdq6g.js";import{n as r}from"./p-CCwNgVmC.js";import{d as u}from"./p-CDR-4auv.js";import{d}from"./p-BM4qDFZj.js";import{d as a}from"./p-tR70yRjm.js";import{d as o}from"./p-DSYw-7RA.js";import{d as l}from"./p-DxzIjbQJ.js";var p={numberInput:{sm:{height:"28",paddingX:"6",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",gap:"12",radius:"6",typography:{fontWeight:"400",fontSize:"16",lineHeight:"26"}},contents:{gap:"4"},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},hint:{color:"#555555",typography:{fontSize:"12",lineHeight:"20"}},errorMessage:{color:"#E30000",typography:{fontSize:"12",lineHeight:"20"}},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const h=p.numberInput.sm,b=p.numberInput.md,c={sm:{height:h.height,paddingX:h.paddingX,gap:h.gap,radius:h.radius,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={border:p.numberInput.border,bg:p.numberInput.bg,text:p.numberInput.text},f={sm:{size:p.numberInput.stepper.sm.size},md:{size:p.numberInput.stepper.md.size},radius:p.numberInput.stepper.radius,bg:p.numberInput.stepper.bg,icon:p.numberInput.stepper.icon},g=p.numberInput.hint,y=p.numberInput.errorMessage,x=p.numberInput.contents.gap,_=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=-1/0;max=1/0;step=1;useButton=!1;useDecimal=!1;value=null;label;addonLabel="";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).split("."),r=(+i).toLocaleString(),u=e?"-"+r:r;return n?u+"."+n:u+""}parseInput(t){if(!t||""===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=c[this.size]??c.sm,e="md"===this.size?14:12;return i("sd-field",{key:"c09a48d9c0bfb0eb6c4327e63ff190b4fee7eff9",name:this.name,label:this.label,addonLabel:this.addonLabel,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,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-gap":t.gap+"px","--sd-number-input-text-color":m.text.default,"--sd-number-input-placeholder-color":m.text.placeholder,"--sd-number-input-disabled-color":m.text.disabled,"--sd-number-input-stepper-size":(f[this.size]?.size??f.sm.size)+"px","--sd-number-input-stepper-radius":f.radius+"px","--sd-number-input-stepper-bg":f.bg.default,"--sd-number-input-stepper-bg-disabled":f.bg.disabled,"--sd-number-input-stepper-icon-color":f.icon.default,"--sd-number-input-stepper-icon-disabled":f.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":m.border.default,"--sd-system-color-field-border-focus":m.border.focus,"--sd-system-color-field-border-danger":m.border.danger,"--sd-system-color-field-bg-default":m.bg.default,"--sd-textinput-input-text-error-message":y.color,"--sd-textinput-input-error-message-typography-font-size":y.typography.fontSize+"px","--sd-textinput-input-error-message-typography-line-height":y.typography.lineHeight+"px","--sd-textinput-input-text-hint":g.color,"--sd-textinput-input-hint-typography-font-size":g.typography.fontSize+"px","--sd-textinput-input-hint-typography-line-height":g.typography.lineHeight+"px","--sd-textinput-input-contents-gap":x+"px"}},i("div",{key:"7ba690b017d58326640083feb4f88ab74e20f7e3",class:"sd-number-input__content"},this.useButton&&i("button",{key:"0eb3ccd26428fce21d74b1e2f06258b054337017",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"4af528aa82ddc6f8abbee1fa8617f5fefc77f41b",name:"minus",size:e,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"f524a85295c29dc02b6803d5a145d24d6d7c3f1b",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"4f3c539cb82745b317ebc2e17f2852a5b386ba6b",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:"35a1cd706a87cf9320262b12aab7679cbb9eb7f2",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"a818bf380ac32291155bf8a3c35cf9b9a007ec5e",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"0d2e75fb5ebada9aa0846e807695d31f29b18647",name:"add",size:e,color:this.isIncrementDisabled()?f.icon.disabled:f.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;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);gap:var(--sd-number-input-gap)}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::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],addonLabel:[1,"addon-label"],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],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=_,w=function(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||a();break;case"sd-icon":customElements.get(n(t))||o();break;case"sd-tooltip":customElements.get(n(t))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as r}from"./p-DJdigrkS.js";const s=o,p=r;export{s as SdSelectDropdown,p as defineCustomElement}
1
+ import{S as o,d as p}from"./p-Cbtpfl9F.js";const s=o,t=p;export{s as SdSelectDropdown,t as defineCustomElement}