@sellmate/design-system 1.0.64 → 1.0.66

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 (65) hide show
  1. package/dist/cjs/design-system.cjs.js +1 -1
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sd-action-modal.cjs.entry.js +13 -3
  5. package/dist/cjs/sd-button_4.cjs.entry.js +3 -3
  6. package/dist/cjs/sd-portal.cjs.entry.js +3 -3
  7. package/dist/collection/components/sd-action-modal/sd-action-modal.css +4 -2
  8. package/dist/collection/components/sd-action-modal/sd-action-modal.js +52 -5
  9. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +4 -4
  10. package/dist/collection/components/sd-portal/sd-portal.js +4 -4
  11. package/dist/collection/utils/modal.js +2 -2
  12. package/dist/components/index.js +1 -1
  13. package/dist/components/{p-BkUclgga.js → p-BH3z_vB9.js} +1 -1
  14. package/dist/components/{p-xmvTLf74.js → p-CAeSM6Ov.js} +1 -1
  15. package/dist/components/{p-BZ7V5xV5.js → p-Cc7ZBscb.js} +1 -1
  16. package/dist/components/{p-DC9KYl3L.js → p-Cpg2hVm3.js} +1 -1
  17. package/dist/components/p-DXtyg5eK.js +1 -0
  18. package/dist/components/{p-BjjrNz4C.js → p-HsTw_qYU.js} +1 -1
  19. package/dist/components/{p-CKU8CeW3.js → p-fcZvjHk_.js} +1 -1
  20. package/dist/components/p-h6zSUtA2.js +1 -0
  21. package/dist/components/sd-action-modal.js +1 -1
  22. package/dist/components/sd-barcode-input.js +1 -1
  23. package/dist/components/sd-date-picker.js +1 -1
  24. package/dist/components/sd-date-range-picker.js +1 -1
  25. package/dist/components/sd-dropdown-button.js +1 -1
  26. package/dist/components/sd-field.js +1 -1
  27. package/dist/components/sd-file-picker.js +1 -1
  28. package/dist/components/sd-floating-portal.js +1 -1
  29. package/dist/components/sd-guide.js +1 -1
  30. package/dist/components/sd-input.js +1 -1
  31. package/dist/components/sd-number-input.js +1 -1
  32. package/dist/components/sd-popover.js +1 -1
  33. package/dist/components/sd-portal.js +1 -1
  34. package/dist/components/sd-select-dropdown.js +1 -1
  35. package/dist/components/sd-select-group.js +1 -1
  36. package/dist/components/sd-select-multiple-group.js +1 -1
  37. package/dist/components/sd-select-multiple.js +1 -1
  38. package/dist/components/sd-select-search-input.js +1 -1
  39. package/dist/components/sd-select-v2.js +1 -1
  40. package/dist/components/sd-select.js +1 -1
  41. package/dist/components/sd-table.js +1 -1
  42. package/dist/components/sd-textarea.js +1 -1
  43. package/dist/components/sd-thead.js +1 -1
  44. package/dist/components/sd-tooltip.js +1 -1
  45. package/dist/design-system/design-system.esm.js +1 -1
  46. package/dist/design-system/index.esm.js +1 -1
  47. package/dist/design-system/{p-cb65a9e4.entry.js → p-05ce3449.entry.js} +1 -1
  48. package/dist/design-system/p-9dd3c6a7.entry.js +1 -0
  49. package/dist/design-system/p-e5f71ec0.entry.js +1 -0
  50. package/dist/esm/design-system.js +1 -1
  51. package/dist/esm/index.js +2 -2
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/sd-action-modal.entry.js +13 -3
  54. package/dist/esm/sd-button_4.entry.js +3 -3
  55. package/dist/esm/sd-portal.entry.js +3 -3
  56. package/dist/types/components/sd-action-modal/sd-action-modal.d.ts +3 -1
  57. package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +1 -1
  58. package/dist/types/components.d.ts +11 -11
  59. package/hydrate/index.js +22 -10
  60. package/hydrate/index.mjs +22 -10
  61. package/package.json +1 -1
  62. package/dist/components/p-BgRPWxrz.js +0 -1
  63. package/dist/components/p-DxzgCf_d.js +0 -1
  64. package/dist/design-system/p-1d310832.entry.js +0 -1
  65. package/dist/design-system/p-a9a91e69.entry.js +0 -1
@@ -5,7 +5,7 @@ export class SdPortal {
5
5
  parentRef = null;
6
6
  offset = [0, 4];
7
7
  viewportPadding = 0;
8
- zIndex = 9999;
8
+ zIndex = 10000;
9
9
  open = false;
10
10
  close;
11
11
  container;
@@ -51,7 +51,7 @@ export class SdPortal {
51
51
  position: 'absolute',
52
52
  top: '0',
53
53
  left: '0',
54
- zIndex: (this.zIndex ?? 9999).toString(),
54
+ zIndex: (this.zIndex ?? 10000).toString(),
55
55
  opacity: '0',
56
56
  transition: 'opacity 0.15s ease-out',
57
57
  boxSizing: 'border-box',
@@ -220,7 +220,7 @@ export class SdPortal {
220
220
  this.close.emit();
221
221
  }
222
222
  render() {
223
- return h("slot", { key: 'e9862350592ae8ea0741b4639a94e288f0b302f2' });
223
+ return h("slot", { key: '7213237baa73430dbf3d01aeb6f7a3e5fe173ecb' });
224
224
  }
225
225
  static get is() { return "sd-portal"; }
226
226
  static get properties() {
@@ -329,7 +329,7 @@ export class SdPortal {
329
329
  "setter": false,
330
330
  "reflect": false,
331
331
  "attribute": "z-index",
332
- "defaultValue": "9999"
332
+ "defaultValue": "10000"
333
333
  },
334
334
  "open": {
335
335
  "type": "boolean",
@@ -140,9 +140,9 @@ export function _createSdModalRef() {
140
140
  return new ModalDialogRefImpl('', container);
141
141
  }
142
142
  export function _attachSdModalWithRef(modalRef, input) {
143
- const { component, persist } = input;
143
+ const { component, persistent } = input;
144
144
  const container = getContainer();
145
- const options = { persistent: persist };
145
+ const options = { persistent };
146
146
  whenReady(container).then(async () => {
147
147
  const id = await container.createCustom(component, options, modalRef);
148
148
  modalRef._setId(id);
@@ -1 +1 @@
1
- export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-DuYi4aqj.js";let n=null;function t(n,t){t&&(t.position&&n.setAttribute("position",t.position),null!=t.maxVisible&&n.setAttribute("max-visible",t.maxVisible+""),null!=t.defaultDuration&&n.setAttribute("default-duration",t.defaultDuration+""),null!=t.zIndex&&n.setAttribute("z-index",t.zIndex+""))}function e(e){return n&&document.body.contains(n)?(t(n,e),n):(n=document.createElement("sd-toast-container"),t(n,e),document.body.appendChild(n),n)}function o(n){return"function"==typeof n.create?Promise.resolve():new Promise((t=>{const e=()=>{"function"==typeof n.create?t():requestAnimationFrame(e)};requestAnimationFrame(e)}))}const i={async create(n,t,s){const{globalOptions:i,...r}=s??{},c=e(i);return await o(c),c.create({message:n,type:t,...r})},async dismiss(t){if(n)return await o(n),n.dismiss(t)},async dismissAll(){if(n)return await o(n),n.dismissAll()},configure(n){e(n)}},c="sd-modal-container",u={ok:"confirm",cancel:"cancel",close:"close"};class d{modalId;okFn;cancelFn;closeFn;clickFn;dismissedFn;containerRef;pendingActions=[];dismissRequested=!1;constructor(n,t){this.modalId=n,this.containerRef=t}onOk(n){return this.okFn=n,this}onCancel(n){return this.cancelFn=n,this}onClose(n){return this.closeFn=n,this}onClick(n){return this.clickFn=n,this}onDismissed(n){return this.dismissedFn=n,this}update(n){return this.runOrQueue((()=>{this.containerRef.update?.(this.modalId,n)})),this}ok(){return this.dismiss("ok")}cancel(){return this.dismiss("cancel")}close(){return this.dismiss("close")}dismiss(n="close"){if(this.dismissRequested)return this;this.dismissRequested=!0;const t=u[n];return this.runOrQueue((()=>{this.containerRef.dismissById?.(this.modalId,t)})),this}_triggerOk(){this.okFn?.()}_triggerCancel(){this.cancelFn?.()}_triggerClose(){this.closeFn?.()}_triggerClick(){this.clickFn?.()}_triggerDismissed(){this.dismissedFn?.()}_setId(n){this.modalId=n;const t=[...this.pendingActions];this.pendingActions=[],t.forEach((n=>n()))}runOrQueue(n){this.modalId?n():this.pendingActions.push(n)}}let l=null;function m(n,t){t&&null!=t.zIndex&&n.style.setProperty("--sd-modal-container-z-index",t.zIndex+"")}function f(n){return function(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdModal] Browser APIs are unavailable. Use `sdModal` only on the client.")}(),function(){if(!customElements.get(c))throw Error("[sdModal] `sd-modal-container` is not registered. Call `defineCustomElements(window)` before using `sdModal`.")}(),l&&document.body.contains(l)?(m(l,n),l):(l=document.createElement(c),m(l,n),document.body.appendChild(l),l)}async function h(n){if(await customElements.whenDefined(c),"function"==typeof n.open)return Promise.resolve();throw Error("[sdModal] `sd-modal-container` is registered but not ready to open dialogs.")}function w(){const n=f();return new d("",n)}function p(n,t){const{component:e,persist:s}=t,o=f(),i={persistent:s};h(o).then((async()=>{const t=await o.createCustom(e,i,n);n._setId(t)}))}const y={confirm(n){const t=f(),e=new d("",t);return h(t).then((async()=>{const s=await t.open(n,e);e._setId(s)})),e},loading(n={}){const t=f(),e=new d("",t);return h(t).then((async()=>{const s=await t.openLoading(n,e);e._setId(s)})),e},create(n){const t=w();return p(t,n),t},configure(n){f(n)}},E="sd-loading-container";let C=null;async function k(n){const t=(function(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdLoading] Browser APIs are unavailable. Use `sdLoading` only on the client.")}(),function(){if(!customElements.get(E))throw Error("[sdLoading] `sd-loading-container` is not registered. Call `defineCustomElements(window)` before using `sdLoading`.")}(),C&&document.body.contains(C)||(C=document.createElement(E),document.body.appendChild(C)),C);await customElements.whenDefined(E),n(t)}const A={show(n={}){k((t=>{t.show?.(n)}))},hide(){C&&k((n=>{n.hide?.()}))}};export{p as _attachSdModalWithRef,w as _createSdModalRef,A as sdLoading,y as sdModal,i as sdToast}
1
+ export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-DuYi4aqj.js";let n=null;function t(n,t){t&&(t.position&&n.setAttribute("position",t.position),null!=t.maxVisible&&n.setAttribute("max-visible",t.maxVisible+""),null!=t.defaultDuration&&n.setAttribute("default-duration",t.defaultDuration+""),null!=t.zIndex&&n.setAttribute("z-index",t.zIndex+""))}function e(e){return n&&document.body.contains(n)?(t(n,e),n):(n=document.createElement("sd-toast-container"),t(n,e),document.body.appendChild(n),n)}function o(n){return"function"==typeof n.create?Promise.resolve():new Promise((t=>{const e=()=>{"function"==typeof n.create?t():requestAnimationFrame(e)};requestAnimationFrame(e)}))}const i={async create(n,t,s){const{globalOptions:i,...r}=s??{},c=e(i);return await o(c),c.create({message:n,type:t,...r})},async dismiss(t){if(n)return await o(n),n.dismiss(t)},async dismissAll(){if(n)return await o(n),n.dismissAll()},configure(n){e(n)}},c="sd-modal-container",u={ok:"confirm",cancel:"cancel",close:"close"};class d{modalId;okFn;cancelFn;closeFn;clickFn;dismissedFn;containerRef;pendingActions=[];dismissRequested=!1;constructor(n,t){this.modalId=n,this.containerRef=t}onOk(n){return this.okFn=n,this}onCancel(n){return this.cancelFn=n,this}onClose(n){return this.closeFn=n,this}onClick(n){return this.clickFn=n,this}onDismissed(n){return this.dismissedFn=n,this}update(n){return this.runOrQueue((()=>{this.containerRef.update?.(this.modalId,n)})),this}ok(){return this.dismiss("ok")}cancel(){return this.dismiss("cancel")}close(){return this.dismiss("close")}dismiss(n="close"){if(this.dismissRequested)return this;this.dismissRequested=!0;const t=u[n];return this.runOrQueue((()=>{this.containerRef.dismissById?.(this.modalId,t)})),this}_triggerOk(){this.okFn?.()}_triggerCancel(){this.cancelFn?.()}_triggerClose(){this.closeFn?.()}_triggerClick(){this.clickFn?.()}_triggerDismissed(){this.dismissedFn?.()}_setId(n){this.modalId=n;const t=[...this.pendingActions];this.pendingActions=[],t.forEach((n=>n()))}runOrQueue(n){this.modalId?n():this.pendingActions.push(n)}}let l=null;function m(n,t){t&&null!=t.zIndex&&n.style.setProperty("--sd-modal-container-z-index",t.zIndex+"")}function f(n){return function(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdModal] Browser APIs are unavailable. Use `sdModal` only on the client.")}(),function(){if(!customElements.get(c))throw Error("[sdModal] `sd-modal-container` is not registered. Call `defineCustomElements(window)` before using `sdModal`.")}(),l&&document.body.contains(l)?(m(l,n),l):(l=document.createElement(c),m(l,n),document.body.appendChild(l),l)}async function h(n){if(await customElements.whenDefined(c),"function"==typeof n.open)return Promise.resolve();throw Error("[sdModal] `sd-modal-container` is registered but not ready to open dialogs.")}function w(){const n=f();return new d("",n)}function p(n,t){const{component:e,persistent:s}=t,o=f(),i={persistent:s};h(o).then((async()=>{const t=await o.createCustom(e,i,n);n._setId(t)}))}const y={confirm(n){const t=f(),e=new d("",t);return h(t).then((async()=>{const s=await t.open(n,e);e._setId(s)})),e},loading(n={}){const t=f(),e=new d("",t);return h(t).then((async()=>{const s=await t.openLoading(n,e);e._setId(s)})),e},create(n){const t=w();return p(t,n),t},configure(n){f(n)}},E="sd-loading-container";let C=null;async function k(n){const t=(function(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdLoading] Browser APIs are unavailable. Use `sdLoading` only on the client.")}(),function(){if(!customElements.get(E))throw Error("[sdLoading] `sd-loading-container` is not registered. Call `defineCustomElements(window)` before using `sdLoading`.")}(),C&&document.body.contains(C)||(C=document.createElement(E),document.body.appendChild(C)),C);await customElements.whenDefined(E),n(t)}const A={show(n={}){k((t=>{t.show?.(n)}))},hide(){C&&k((n=>{n.hide?.()}))}};export{p as _attachSdModalWithRef,w as _createSdModalRef,A as sdLoading,y as sdModal,i as sdToast}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as o,t as i}from"./p-DuYi4aqj.js";import{d}from"./p-BLC3AWW8.js";import{d as n}from"./p-TMuoVuhE.js";import{d as r}from"./p-BjjrNz4C.js";import{d as a}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as l}from"./p-DC9KYl3L.js";import{d as p}from"./p-Bh548Ckv.js";import{d as m}from"./p-xmvTLf74.js";import{d as u}from"./p-BZ7V5xV5.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:"fdfad8ab2f1f6a26da8ad0ca0dcd17bfed7dcf9d",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:"74cfba89d85a980c6c8074150bdba91387b9c115",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-DuYi4aqj.js";import{d}from"./p-BLC3AWW8.js";import{d as n}from"./p-TMuoVuhE.js";import{d as r}from"./p-HsTw_qYU.js";import{d as a}from"./p-DXtyg5eK.js";import{d as c}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as l}from"./p-Cpg2hVm3.js";import{d as p}from"./p-Bh548Ckv.js";import{d as m}from"./p-CAeSM6Ov.js";import{d as u}from"./p-Cc7ZBscb.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:"fdfad8ab2f1f6a26da8ad0ca0dcd17bfed7dcf9d",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:"74cfba89d85a980c6c8074150bdba91387b9c115",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,H as e,c as t,h as c,t as a}from"./p-DuYi4aqj.js";import{d as o}from"./p-BLC3AWW8.js";import{d as i}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as l}from"./p-DC9KYl3L.js";import{d as p}from"./p-BZ7V5xV5.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:"36003b7e0e7d8a3df224b18257d4d6b1712d47da",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"3b6f80d033a7903cb8e3692a2eebe0ab991e8d68",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:"7c453e87ba6b384c5be7bb142697ba43c0d1a20b",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-DuYi4aqj.js";import{d as o}from"./p-BLC3AWW8.js";import{d as i}from"./p-HsTw_qYU.js";import{d as r}from"./p-DXtyg5eK.js";import{d}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as l}from"./p-Cpg2hVm3.js";import{d as p}from"./p-Cc7ZBscb.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:"36003b7e0e7d8a3df224b18257d4d6b1712d47da",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"3b6f80d033a7903cb8e3692a2eebe0ab991e8d68",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:"7c453e87ba6b384c5be7bb142697ba43c0d1a20b",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,h as s,F as i,t as o}from"./p-DuYi4aqj.js";import{T as n}from"./p-Cpu_hXwN.js";import{d as a}from"./p-BLC3AWW8.js";import{d as l}from"./p-DxzgCf_d.js";import{d as c}from"./p-CGssy8eb.js";var r={bg:"#07284A",content:"#FFFFFF"},d={bg:"#FCEFEF",content:"#FB4444"},h={bg:"#FEF1EA",content:"#FF6B00"},p={bg:"#E6F1FF",content:"#0075FF"};const u={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}},m=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=u[o]??u.default,r=()=>this.showTooltip=!this.showTooltip;return s(i,{key:"097722e57d6a808193e8fc0d48cebc80ee13848a"},s("div",{key:"92c6fd83098faec1cfa405ace12530d0cb408395",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:"d05d011181a8c183690607c974208e708ccba184",parentRef:this.buttonEl,onSdClose:this.handleClose.bind(this),placement:e,offset:this.tooltipOffset},s("div",{key:"281c3994d52fcd1d6194edd12bd64ac9a42f5e71",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:"87374c0a423bc037decdc820e118c65ea7b3f75f",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${e}`},s(n,{key:"9cdd8215849973011a2339ed80bfb2863b1e374e"})),s("div",{key:"4f764958e07a8b2ed0ea093609f5a42d86fa3f3c",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),m);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{m as S,f as d}
1
+ import{p as t,H as e,h as s,F as i,t as o}from"./p-DuYi4aqj.js";import{T as n}from"./p-Cpu_hXwN.js";import{d as a}from"./p-BLC3AWW8.js";import{d as l}from"./p-DXtyg5eK.js";import{d as c}from"./p-CGssy8eb.js";var r={bg:"#07284A",content:"#FFFFFF"},d={bg:"#FCEFEF",content:"#FB4444"},h={bg:"#FEF1EA",content:"#FF6B00"},p={bg:"#E6F1FF",content:"#0075FF"};const u={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}},m=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=u[o]??u.default,r=()=>this.showTooltip=!this.showTooltip;return s(i,{key:"097722e57d6a808193e8fc0d48cebc80ee13848a"},s("div",{key:"92c6fd83098faec1cfa405ace12530d0cb408395",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:"d05d011181a8c183690607c974208e708ccba184",parentRef:this.buttonEl,onSdClose:this.handleClose.bind(this),placement:e,offset:this.tooltipOffset},s("div",{key:"281c3994d52fcd1d6194edd12bd64ac9a42f5e71",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:"87374c0a423bc037decdc820e118c65ea7b3f75f",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${e}`},s(n,{key:"9cdd8215849973011a2339ed80bfb2863b1e374e"})),s("div",{key:"4f764958e07a8b2ed0ea093609f5a42d86fa3f3c",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),m);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{m as S,f as d}
@@ -1 +1 @@
1
- import{p as t,H as s,c as i,h as e,t as n}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-CJwbBrt5.js";import{d as l}from"./p-BLC3AWW8.js";import{d}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d as u}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as p}from"./p-BZ7V5xV5.js";const c=a.textinput.sm,f=a.textinput.md,b={sm:{height:c.height,paddingX:c.paddingX,gap:c.gap,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight},md:{height:f.height,paddingX:f.paddingX,gap:f.gap,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight}},m={text:a.textinput.text,icon:a.textinput.icon},g=t(class extends s{constructor(t){super(),!1!==t&&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="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;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,s)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(s)):this.focus?.emit(s)};render(){const t=b[this.size]??b.sm;return e("sd-field",{key:"a72ce8674fb761de7cd188e99cc19d5f3731a899",name:this.name,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${t.fontSize}px`,"--sd-input-line-height":`${t.lineHeight}px`,"--sd-input-font-weight":t.fontWeight,"--sd-input-padding-x":`${t.paddingX}px`,"--sd-input-gap":`${t.gap}px`,"--sd-input-text-color":m.text.default,"--sd-input-placeholder-color":m.text.placeholder,"--sd-input-disabled-color":m.text.disabled,"--sd-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`}},e("label",{key:"e5cbdbc2b233bda57488ead19401d277891301ae",class:"sd-input__content"},e("slot",{key:"a327005770df94ef61f2e08071e77407a24b7b5c",name:"prefix"}),e("input",{key:"36301cd586151b8c607e14715b26fca467f68c13",name:this.name,ref:t=>this.nativeEl=t,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:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),e("slot",{key:"532e201860db0709572502aa4275fc9251e1aeb1",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&e("sd-ghost-button",{key:"cc6132852c65f0597cbe25751c7246b1cdad3096",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&&e("sd-ghost-button",{key:"fd3d567346cf5771ec28c73f15cdf0db15835766",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)}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[readonly]{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],labelWidth:[8,"label-width"],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((t=>{switch(t){case"sd-input":customElements.get(n(t))||customElements.define(n(t),g);break;case"sd-button":customElements.get(n(t))||l();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||r();break;case"sd-ghost-button":customElements.get(n(t))||u();break;case"sd-icon":customElements.get(n(t))||h();break;case"sd-tooltip":customElements.get(n(t))||p()}}))}export{g as S,_ as d}
1
+ import{p as t,H as s,c as i,h as e,t as n}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-CJwbBrt5.js";import{d as l}from"./p-BLC3AWW8.js";import{d}from"./p-HsTw_qYU.js";import{d as r}from"./p-DXtyg5eK.js";import{d as u}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as p}from"./p-Cc7ZBscb.js";const c=a.textinput.sm,f=a.textinput.md,b={sm:{height:c.height,paddingX:c.paddingX,gap:c.gap,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight},md:{height:f.height,paddingX:f.paddingX,gap:f.gap,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight}},m={text:a.textinput.text,icon:a.textinput.icon},g=t(class extends s{constructor(t){super(),!1!==t&&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="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;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,s)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(s)):this.focus?.emit(s)};render(){const t=b[this.size]??b.sm;return e("sd-field",{key:"a72ce8674fb761de7cd188e99cc19d5f3731a899",name:this.name,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${t.fontSize}px`,"--sd-input-line-height":`${t.lineHeight}px`,"--sd-input-font-weight":t.fontWeight,"--sd-input-padding-x":`${t.paddingX}px`,"--sd-input-gap":`${t.gap}px`,"--sd-input-text-color":m.text.default,"--sd-input-placeholder-color":m.text.placeholder,"--sd-input-disabled-color":m.text.disabled,"--sd-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`}},e("label",{key:"e5cbdbc2b233bda57488ead19401d277891301ae",class:"sd-input__content"},e("slot",{key:"a327005770df94ef61f2e08071e77407a24b7b5c",name:"prefix"}),e("input",{key:"36301cd586151b8c607e14715b26fca467f68c13",name:this.name,ref:t=>this.nativeEl=t,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:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),e("slot",{key:"532e201860db0709572502aa4275fc9251e1aeb1",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&e("sd-ghost-button",{key:"cc6132852c65f0597cbe25751c7246b1cdad3096",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&&e("sd-ghost-button",{key:"fd3d567346cf5771ec28c73f15cdf0db15835766",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)}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[readonly]{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],labelWidth:[8,"label-width"],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((t=>{switch(t){case"sd-input":customElements.get(n(t))||customElements.define(n(t),g);break;case"sd-button":customElements.get(n(t))||l();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||r();break;case"sd-ghost-button":customElements.get(n(t))||u();break;case"sd-icon":customElements.get(n(t))||h();break;case"sd-tooltip":customElements.get(n(t))||p()}}))}export{g as S,_ as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as n,c as o,h as i,t as e}from"./p-DuYi4aqj.js";const a=t(class t extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=o(this,"sdClose",7)}get el(){return this}to="body";parentRef=null;offset=[0,0];zIndex=1e4;placement="bottom";open=!1;close;container;wrapper;rafId;isInsideClick=!1;resizeObserver;mutationObserver;static ARROW_SIZE=11.2;componentDidLoad(){this.container=this.resolveContainer(),this.createWrapper(),this.moveSlotContent(),requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")})),this.observeParent()}componentDidRender(){this.wrapper&&(this.open?(this.wrapper.style.display="block",requestAnimationFrame((()=>{this.updatePosition(),this.wrapper&&(this.wrapper.style.visibility="visible")}))):(this.wrapper.style.display="none",this.wrapper.style.visibility="hidden"))}disconnectedCallback(){this.rafId&&cancelAnimationFrame(this.rafId),this.unobserveParent(),this.wrapper?.remove()}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof n?t:document.body}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"absolute",zIndex:(this.zIndex??1e4).toString(),transition:"opacity 0.4s",top:"-9999px",left:"-9999px"}),this.container.appendChild(this.wrapper)}moveSlotContent(){this.wrapper&&Array.from(this.el.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const n=this.parentRef.getBoundingClientRect();if(!n.width&&!n.height)return;const[o,i]=this.offset,e=t.ARROW_SIZE;let a=0,s=0;switch(this.placement){case"top":a=n.top+window.scrollY-this.wrapper.offsetHeight+i-e,s=n.left+window.scrollX+n.width/2-this.wrapper.offsetWidth/2+o;break;case"bottom":a=n.bottom+window.scrollY+i+e,s=n.left+window.scrollX+n.width/2-this.wrapper.offsetWidth/2+o;break;case"left":a=n.top+window.scrollY+n.height/2-this.wrapper.offsetHeight/2+i,s=n.left+window.scrollX-this.wrapper.offsetWidth-o-e;break;case"right":a=n.top+window.scrollY+n.height/2-this.wrapper.offsetHeight/2+i,s=n.right+window.scrollX+o+e}Object.assign(this.wrapper.style,{top:`${a}px`,left:`${s}px`})}))}observeParent(){this.parentRef&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef),this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0}))}unobserveParent(){this.resizeObserver?.disconnect(),this.mutationObserver?.disconnect()}handleMouseDown(t){this.isInsideClick=!!(this.wrapper&&this.wrapper.contains(t.target)||this.parentRef&&this.parentRef.contains(t.target))}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(t.target)||this.close.emit()}render(){return i("slot",{key:"4dafb853b2a82e541f59056d2fedf08a6fa040ba"})}static get style(){return".sd-floating-menu{width:fit-content;padding:12px 16px;border-radius:6px;font-size:12px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);animation:sd-floating-fade-in 0.35s ease-out}.sd-floating-menu--top{animation-name:sd-floating-slide-top}.sd-floating-menu--bottom{animation-name:sd-floating-slide-bottom}.sd-floating-menu--left{animation-name:sd-floating-slide-left}.sd-floating-menu--right{animation-name:sd-floating-slide-right}.sd-floating-menu .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--default{background:var(--sd-floating-bg, #07284A);color:var(--sd-floating-content, #FFFFFF);font-weight:500}.sd-floating-menu--default .sd-floating-menu__arrow{color:var(--sd-floating-bg, #07284A)}.sd-floating-menu--danger{background:var(--sd-floating-bg, #FCE6E6);color:var(--sd-floating-content, #FB4444);font-weight:700}.sd-floating-menu--danger .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FCE6E6)}.sd-floating-menu--warning{background:var(--sd-floating-bg, #FEF1EA);color:var(--sd-floating-content, #FF6B00);font-weight:700}.sd-floating-menu--warning .sd-floating-menu__arrow{color:var(--sd-floating-bg, #FEF1EA)}.sd-floating-menu--accent{background:var(--sd-floating-bg, #E6F1FF);color:var(--sd-floating-content, #0075FF);font-weight:700}.sd-floating-menu--accent .sd-floating-menu__arrow{color:var(--sd-floating-bg, #E6F1FF)}.sd-floating-menu__arrow{position:absolute;display:flex;width:16px;height:12px}.sd-floating-menu__arrow svg{width:100%;height:100%}.sd-floating-menu__arrow--top{bottom:-12px;left:50%;transform:translateX(-50%)}.sd-floating-menu__arrow--bottom{top:-12px;left:50%;transform:translateX(-50%) rotate(180deg)}.sd-floating-menu__arrow--left{right:-12px;top:50%;transform:translateY(-50%) rotate(-90deg)}.sd-floating-menu__arrow--right{left:-12px;top:50%;transform:translateY(-50%) rotate(90deg)}.sd-floating-menu__content{font-size:12px;line-height:20px}.sd-floating-menu__content .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px;margin-bottom:4px}.sd-floating-menu__content .sd-floating-menu__messages{font-weight:500}.sd-floating-menu__content .sd-floating-menu__buttons{margin-top:12px;display:flex;gap:8px;align-items:center}.sd-floating-menu__content .sd-floating-menu__buttons--1{justify-content:flex-end}.sd-floating-menu__content .sd-floating-menu__buttons--2{justify-content:space-between}.sd-floating-menu--popover{padding:16px 20px}.sd-floating-menu--popover .sd-floating-menu__content{gap:4px}.sd-floating-menu--popover .sd-floating-menu__title{font-size:14px;font-weight:700;line-height:24px}.sd-floating-menu--popover .sd-floating-menu__messages{font-size:12px;font-weight:500;line-height:20px}.sd-floating-menu--closing{animation:sd-floating-fade-out 0.15s ease-in forwards}.sd-floating-menu--closing.sd-floating-menu--top{animation-name:sd-floating-slide-out-top}.sd-floating-menu--closing.sd-floating-menu--bottom{animation-name:sd-floating-slide-out-bottom}.sd-floating-menu--closing.sd-floating-menu--left{animation-name:sd-floating-slide-out-left}.sd-floating-menu--closing.sd-floating-menu--right{animation-name:sd-floating-slide-out-right}.sd-floating-menu__close-button{position:absolute;top:12px;right:12px}@keyframes sd-floating-fade-out{from{opacity:1}to{opacity:0}}@keyframes sd-floating-slide-out-top{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes sd-floating-slide-out-bottom{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes sd-floating-slide-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes sd-floating-slide-out-right{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes sd-floating-fade-in{from{opacity:0}to{opacity:1}}@keyframes sd-floating-slide-top{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-bottom{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sd-floating-slide-left{from{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes sd-floating-slide-right{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}"}},[772,"sd-floating-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],placement:[1],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]]]);function s(){"undefined"!=typeof customElements&&["sd-floating-portal"].forEach((t=>{"sd-floating-portal"===t&&(customElements.get(e(t))||customElements.define(e(t),a))}))}export{a as S,s as d}
@@ -1 +1 @@
1
- import{p as e,H as d,h as s,t as i}from"./p-DuYi4aqj.js";import{d as t}from"./p-BLC3AWW8.js";import{d as l}from"./p-DxzgCf_d.js";import{d as r}from"./p-CGssy8eb.js";import{d as o}from"./p-BZ7V5xV5.js";var a={sm:{height:"28",gap:"6",icon:"12",typography:{fontWeight:"700",fontSize:"12",lineHeight:"20"}},md:{height:"36",gap:"8",icon:"16",typography:{fontWeight:"700",fontSize:"16",lineHeight:"26"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f=a.sm,h=a.md,p={sm:{height:f.height,gap:f.gap,icon:f.icon,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:h.height,gap:h.gap,icon:h.icon,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight}},c=["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","sd-date-picker","sd-date-range-picker"],b=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="";size="sm";label="";labelWidth="";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 c){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=this.size in p?this.size:"sm",i=p[d],t={"--sd-field-wrapper-height":`var(--sd-system-size-field-${d}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${d})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${d}-gap)`},l=this.label?{"--sd-field-label-height":`${i.height}px`,"--sd-field-label-gap":`${i.gap}px`,"--sd-field-label-font-size":`${i.fontSize}px`,"--sd-field-label-line-height":`${i.lineHeight}px`,"--sd-field-label-font-weight":i.fontWeight,...this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},r=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:"f12b2e13ac8152d1e688f903a60a8fa670e99065",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...t,...l,...r}},s("div",{key:"79f7a40b5e1ee95bb9075b0855e22261cd8adc6a",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"54b5bbfbe18df48c40cc30ec3d6761ccd8e446cc",class:"sd-field__main",style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"39542908287175ade4d6e0f1acd2cb1f03c9e2a1",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e}},e&&s("div",{key:"236650de53d1d1951f26586aa0d22f0f267fc411",class:"sd-field__addon"},e),s("slot",{key:"41df3dca21aa68d3324617891f2555f1c488a61b"})),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(p[this.size in p?this.size:"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.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;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;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-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus .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__error-message{color:var(--sd-textinput-textinput-text-error-message);font-size:var(--sd-textinput-textinput-error-message-typography-font-size);line-height:var(--sd-textinput-textinput-error-message-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-textinput-text-hint);font-size:var(--sd-textinput-textinput-hint-typography-font-size);line-height:var(--sd-textinput-textinput-hint-typography-line-height);margin-top:var(--sd-textinput-textinput-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],size:[513],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function g(){"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),b);break;case"sd-button":customElements.get(i(e))||t();break;case"sd-floating-portal":customElements.get(i(e))||l();break;case"sd-icon":customElements.get(i(e))||r();break;case"sd-tooltip":customElements.get(i(e))||o()}}))}export{b as S,g as d}
1
+ import{p as e,H as d,h as s,t as i}from"./p-DuYi4aqj.js";import{d as t}from"./p-BLC3AWW8.js";import{d as l}from"./p-DXtyg5eK.js";import{d as r}from"./p-CGssy8eb.js";import{d as o}from"./p-Cc7ZBscb.js";var a={sm:{height:"28",gap:"6",icon:"12",typography:{fontWeight:"700",fontSize:"12",lineHeight:"20"}},md:{height:"36",gap:"8",icon:"16",typography:{fontWeight:"700",fontSize:"16",lineHeight:"26"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f=a.sm,h=a.md,p={sm:{height:f.height,gap:f.gap,icon:f.icon,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:h.height,gap:h.gap,icon:h.icon,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight}},c=["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","sd-date-picker","sd-date-range-picker"],b=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="";size="sm";label="";labelWidth="";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 c){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=this.size in p?this.size:"sm",i=p[d],t={"--sd-field-wrapper-height":`var(--sd-system-size-field-${d}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${d})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${d}-gap)`},l=this.label?{"--sd-field-label-height":`${i.height}px`,"--sd-field-label-gap":`${i.gap}px`,"--sd-field-label-font-size":`${i.fontSize}px`,"--sd-field-label-line-height":`${i.lineHeight}px`,"--sd-field-label-font-weight":i.fontWeight,...this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},r=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:"f12b2e13ac8152d1e688f903a60a8fa670e99065",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...t,...l,...r}},s("div",{key:"79f7a40b5e1ee95bb9075b0855e22261cd8adc6a",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"54b5bbfbe18df48c40cc30ec3d6761ccd8e446cc",class:"sd-field__main",style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"39542908287175ade4d6e0f1acd2cb1f03c9e2a1",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e}},e&&s("div",{key:"236650de53d1d1951f26586aa0d22f0f267fc411",class:"sd-field__addon"},e),s("slot",{key:"41df3dca21aa68d3324617891f2555f1c488a61b"})),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(p[this.size in p?this.size:"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.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;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;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-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus .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__error-message{color:var(--sd-textinput-textinput-text-error-message);font-size:var(--sd-textinput-textinput-error-message-typography-font-size);line-height:var(--sd-textinput-textinput-error-message-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-textinput-text-hint);font-size:var(--sd-textinput-textinput-hint-typography-font-size);line-height:var(--sd-textinput-textinput-hint-typography-line-height);margin-top:var(--sd-textinput-textinput-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],size:[513],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function g(){"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),b);break;case"sd-button":customElements.get(i(e))||t();break;case"sd-floating-portal":customElements.get(i(e))||l();break;case"sd-icon":customElements.get(i(e))||r();break;case"sd-tooltip":customElements.get(i(e))||o()}}))}export{b as S,g as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as o}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{d as a}from"./p-BLC3AWW8.js";import{d as l}from"./p-TMuoVuhE.js";import{d as h}from"./p-BjjrNz4C.js";import{d}from"./p-DxzgCf_d.js";import{d as n}from"./p-CGssy8eb.js";import{d as c}from"./p-BgRPWxrz.js";import{d as p}from"./p-kZ5N_lFC.js";import{d as m}from"./p-DRY8HJ-T.js";import{d as u}from"./p-DpsDTjcN.js";import{d as f}from"./p-B6OgnOKC.js";import{d as b}from"./p-BZ7V5xV5.js";const g=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.dropDownShow=s(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return this}name="default";value=null;options=[];placeholder="선택";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";error=!1;hint="";errorMessage="";fieldName="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;triggerRef;closeAnimationTimer;internalName=r();watchIsOpen(t){this.focused=t,this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.name||"multi_depth"===this.name}get displayText(){if(this.isMulti){if(!this.value||!Array.isArray(this.value))return"";if(this.emitValue){const t=this.flattenOptions(this.options);return this.value.map((e=>t.find((t=>t.value===e))?.label??"")).filter(Boolean).join(", ")}const t=this.value;return 0===t.length?"":t.map((t=>t.label)).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options).find((t=>t.value===this.value));return t?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getSelectedOptions(){const t=this.value;return t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const e=this.triggerRef.getBoundingClientRect(),s=t.VIEWPORT_PADDING,i=t.PORTAL_OFFSET_Y,o=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),a=Math.max(window.innerHeight-e.bottom-s-i,0),l=Math.max(e.top-s-i,0),h=Math.max(a,l),d=Math.max(window.innerWidth-2*s,0);this.resolvedDropdownHeight=`${Math.min(o,h)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,d)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),t.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints(),this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),o=e.filter((e=>!t.has(e.value)));i=[...s,...o]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:t.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"c9f08598c8f9852ab4000f056621dfef238e16de",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"302103a425963e5d577b01ad179d5af82e6f30b1",class:"sd-select-v2",ref:t=>{this.triggerRef=t}},i("sd-select-v2-trigger",{key:"a22bca400e5d10ee29e569da04d36b9291a1dade",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"0df4ad35bb284298708a0c1e11ce0e3c28d16ed8",...e},i("sd-select-v2-listbox",{key:"90c18612d553342be091a30e05194bab91407c76",name:this.name,options:this.options,value:this.value,emitValue:this.emitValue,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-select-v2{display:inline-flex}sd-select-v2 sd-portal{display:none}sd-select-v2 .sd-select-v2{position:relative;width:100%;height:100%}"}},[512,"sd-select-v2",{name:[1],value:[1032],options:[16],placeholder:[1],maxDropdownWidth:[1,"max-dropdown-width"],dropdownHeight:[1,"dropdown-height"],disabled:[4],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],error:[1028],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],emitValue:[4,"emit-value"],width:[8],isOpen:[32],isAnimatingOut:[32],triggerWidth:[32],resolvedDropdownHeight:[32],resolvedMaxDropdownWidth:[32],focused:[32],hovered:[32]},void 0,{isOpen:[{watchIsOpen:0}]}]);function w(){"undefined"!=typeof customElements&&["sd-select-v2","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-icon","sd-portal","sd-select-v2-list-item","sd-select-v2-list-item-search","sd-select-v2-listbox","sd-select-v2-trigger","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-v2":customElements.get(o(t))||customElements.define(o(t),g);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-checkbox":customElements.get(o(t))||l();break;case"sd-field":customElements.get(o(t))||h();break;case"sd-floating-portal":customElements.get(o(t))||d();break;case"sd-icon":customElements.get(o(t))||n();break;case"sd-portal":customElements.get(o(t))||c();break;case"sd-select-v2-list-item":customElements.get(o(t))||p();break;case"sd-select-v2-list-item-search":customElements.get(o(t))||m();break;case"sd-select-v2-listbox":customElements.get(o(t))||u();break;case"sd-select-v2-trigger":customElements.get(o(t))||f();break;case"sd-tooltip":customElements.get(o(t))||b()}}))}export{g as S,w as d}
1
+ import{p as t,H as e,c as s,h as i,t as o}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{d as a}from"./p-BLC3AWW8.js";import{d as l}from"./p-TMuoVuhE.js";import{d as h}from"./p-HsTw_qYU.js";import{d}from"./p-DXtyg5eK.js";import{d as n}from"./p-CGssy8eb.js";import{d as c}from"./p-h6zSUtA2.js";import{d as p}from"./p-kZ5N_lFC.js";import{d as m}from"./p-DRY8HJ-T.js";import{d as u}from"./p-DpsDTjcN.js";import{d as b}from"./p-B6OgnOKC.js";import{d as f}from"./p-Cc7ZBscb.js";const g=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.dropDownShow=s(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return this}name="default";value=null;options=[];placeholder="선택";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";error=!1;hint="";errorMessage="";fieldName="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;triggerRef;closeAnimationTimer;internalName=r();watchIsOpen(t){this.focused=t,this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.name||"multi_depth"===this.name}get displayText(){if(this.isMulti){if(!this.value||!Array.isArray(this.value))return"";if(this.emitValue){const t=this.flattenOptions(this.options);return this.value.map((e=>t.find((t=>t.value===e))?.label??"")).filter(Boolean).join(", ")}const t=this.value;return 0===t.length?"":t.map((t=>t.label)).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options).find((t=>t.value===this.value));return t?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getSelectedOptions(){const t=this.value;return t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const e=this.triggerRef.getBoundingClientRect(),s=t.VIEWPORT_PADDING,i=t.PORTAL_OFFSET_Y,o=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),a=Math.max(window.innerHeight-e.bottom-s-i,0),l=Math.max(e.top-s-i,0),h=Math.max(a,l),d=Math.max(window.innerWidth-2*s,0);this.resolvedDropdownHeight=`${Math.min(o,h)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,d)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),t.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints(),this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),o=e.filter((e=>!t.has(e.value)));i=[...s,...o]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:t.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"c9f08598c8f9852ab4000f056621dfef238e16de",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"302103a425963e5d577b01ad179d5af82e6f30b1",class:"sd-select-v2",ref:t=>{this.triggerRef=t}},i("sd-select-v2-trigger",{key:"a22bca400e5d10ee29e569da04d36b9291a1dade",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"0df4ad35bb284298708a0c1e11ce0e3c28d16ed8",...e},i("sd-select-v2-listbox",{key:"90c18612d553342be091a30e05194bab91407c76",name:this.name,options:this.options,value:this.value,emitValue:this.emitValue,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-select-v2{display:inline-flex}sd-select-v2 sd-portal{display:none}sd-select-v2 .sd-select-v2{position:relative;width:100%;height:100%}"}},[512,"sd-select-v2",{name:[1],value:[1032],options:[16],placeholder:[1],maxDropdownWidth:[1,"max-dropdown-width"],dropdownHeight:[1,"dropdown-height"],disabled:[4],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],error:[1028],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],emitValue:[4,"emit-value"],width:[8],isOpen:[32],isAnimatingOut:[32],triggerWidth:[32],resolvedDropdownHeight:[32],resolvedMaxDropdownWidth:[32],focused:[32],hovered:[32]},void 0,{isOpen:[{watchIsOpen:0}]}]);function w(){"undefined"!=typeof customElements&&["sd-select-v2","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-icon","sd-portal","sd-select-v2-list-item","sd-select-v2-list-item-search","sd-select-v2-listbox","sd-select-v2-trigger","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-v2":customElements.get(o(t))||customElements.define(o(t),g);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-checkbox":customElements.get(o(t))||l();break;case"sd-field":customElements.get(o(t))||h();break;case"sd-floating-portal":customElements.get(o(t))||d();break;case"sd-icon":customElements.get(o(t))||n();break;case"sd-portal":customElements.get(o(t))||c();break;case"sd-select-v2-list-item":customElements.get(o(t))||p();break;case"sd-select-v2-list-item-search":customElements.get(o(t))||m();break;case"sd-select-v2-listbox":customElements.get(o(t))||u();break;case"sd-select-v2-trigger":customElements.get(o(t))||b();break;case"sd-tooltip":customElements.get(o(t))||f()}}))}export{g as S,w as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as s,c as i,h as e,t as o}from"./p-DuYi4aqj.js";const n=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=i(this,"sdClose",3)}get hostEl(){return this}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=1e4;open=!1;close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof s?t:document.body}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"absolute",top:"0",left:"0",zIndex:(this.zIndex??1e4).toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),s=window.innerWidth,i=window.innerHeight,e=this.offset??[0,4],o=Math.max(0,this.viewportPadding??0),n=Math.max(s-2*o,0),h=Math.max(i-2*o,0);this.wrapper.style.maxWidth=`${n}px`,this.wrapper.style.maxHeight=`${h}px`;const r=this.wrapper.getBoundingClientRect(),a=i-t.bottom-e[1]-o;let d=t.bottom+window.scrollY+e[1],l=t.left+window.scrollX+e[0];a<r.height&&t.top-e[1]-o>a&&(d=t.top+window.scrollY-r.height-e[1]);const c=window.scrollY+o,p=window.scrollY+i-o-r.height;d=p<c?c:Math.min(Math.max(d,c),p),t.left+r.width+e[0]>s-o&&(l=t.right+window.scrollX-r.width-e[0]);const u=window.scrollX+o,w=window.scrollX+s-o-r.width;l=w<u?u:Math.min(Math.max(l,u),w),this.wrapper.style.top=`${d}px`,this.wrapper.style.left=`${l}px`,this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const s=this.getScrollParents(t);s.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=s}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const s=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:e,overflowY:o}=getComputedStyle(i);[t,e,o].some((t=>/(auto|scroll|overlay)/.test(t)))&&s.push(i),i=i.parentElement}return s}handleMouseDown(t){this.isInsideClick=!(!this.wrapper||!this.wrapper.contains(t.target))}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(t.target)||this.close.emit()}render(){return e("slot",{key:"7213237baa73430dbf3d01aeb6f7a3e5fe173ecb"})}static get watchers(){return{open:[{handleOpenChange:0}]}}},[772,"sd-portal",{to:[1],parentRef:[16],offset:[16],viewportPadding:[2,"viewport-padding"],zIndex:[2,"z-index"],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]],{open:[{handleOpenChange:0}]}]);function h(){"undefined"!=typeof customElements&&["sd-portal"].forEach((t=>{"sd-portal"===t&&(customElements.get(o(t))||customElements.define(o(t),n))}))}export{n as S,h as d}
@@ -1 +1 @@
1
- import{p as o,t as a,H as d,c as t,h as e}from"./p-DuYi4aqj.js";import{m as i}from"./p-DOXMJi-V.js";import{d as s}from"./p-C2r48NLP.js";import{d as n}from"./p-B1S4ybd6.js";import{d as l}from"./p-CGssy8eb.js";const{modal:c}=i,m=c.action,r={radius:Number(c.radius),bg:c.bg,headerPaddingX:Number(m.header.paddingX),headerPaddingY:Number(m.header.paddingY),headerGap:Number(m.header.gap),bodyPaddingX:Number(m.body.paddingX),bodyPaddingBottom:Number(m.body.paddingBottom),footerPaddingX:Number(m.footer.paddingX),footerPaddingY:Number(m.footer.paddingY),footerGap:Number(m.footer.gap),footerBg:m.footer.bg,footerBorder:m.footer.border},b={color:m.title.color,fontFamily:m.title.typography.fontFamily,fontWeight:m.title.typography.fontWeight,fontSize:Number(m.title.typography.fontSize),lineHeight:Number(m.title.typography.lineHeight)},f={name:"primary_md",label:"확인"},p=o(class extends d{constructor(o){super(),!1!==o&&this.__registerHost(),this.close=t(this,"sdClose",7),this.ok=t(this,"sdOk",7)}modalTitle="";buttonProps={};close;ok;render(){return e("div",{key:"b306dc102137e9b76faeeb19587dce32d670163c",class:"sd-action-modal",style:{"--sd-action-modal-radius":r.radius+"px","--sd-action-modal-bg":r.bg,"--sd-action-modal-header-padding-x":r.headerPaddingX+"px","--sd-action-modal-header-padding-y":r.headerPaddingY+"px","--sd-action-modal-header-gap":r.headerGap+"px","--sd-action-modal-body-padding-x":r.bodyPaddingX+"px","--sd-action-modal-body-padding-bottom":r.bodyPaddingBottom+"px","--sd-action-modal-footer-padding-x":r.footerPaddingX+"px","--sd-action-modal-footer-padding-y":r.footerPaddingY+"px","--sd-action-modal-footer-gap":r.footerGap+"px","--sd-action-modal-footer-bg":r.footerBg,"--sd-action-modal-footer-border":r.footerBorder,"--sd-action-modal-title-color":b.color,"--sd-action-modal-title-font-family":b.fontFamily,"--sd-action-modal-title-font-weight":b.fontWeight,"--sd-action-modal-title-font-size":b.fontSize+"px","--sd-action-modal-title-line-height":b.lineHeight+"px"}},e("header",{key:"e6b9699e9943d1f4001b4cd23f99975474c3e86e",class:"sd-action-modal__header"},e("h2",{key:"4d30b98d01a191e4bdc3fb1ff772483dfd3a8397",class:"sd-action-modal__title"},this.modalTitle),e("div",{key:"f1083fe5c2643d09dc4bad4c50064ffda2db65ab",class:"sd-action-modal__header-sub"},e("slot",{key:"a11c9a13ae11569226ac11fb4be6b782667defeb",name:"header-sub-title"})),e("sd-ghost-button",{key:"e8a76ecd5d1388a79ac19705d634f40c05e6c2fc",class:"sd-action-modal__close",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()})),e("div",{key:"eb615713a8fbfdd1c40c805e3146fc8341686c72",class:"sd-action-modal__body"},e("slot",{key:"d56a3331bc2e94748f150c11dba9e5bd1fad8043",name:"body"})),e("footer",{key:"d80ad9de537846b01f79588e363bb40e76c64fba",class:"sd-action-modal__footer"},e("div",{key:"49187df32a64d18b2492995a80ce49df02e9303e",class:"sd-action-modal__footer-sub"},e("slot",{key:"d73e66710152c0718d7cab6bbcbd1ab2cebf1f87",name:"bottom-sub-content"})),e("sd-button-v2",{key:"03d2f2a0fa6960983c46e47460f623dfd42811a3",...f,...this.buttonProps,onSdClick:()=>this.ok.emit()})))}static get style(){return"sd-action-modal{display:block;width:fit-content;min-width:520px}sd-action-modal .sd-action-modal{position:relative;display:flex;flex-direction:column;border-radius:var(--sd-action-modal-radius);background:var(--sd-action-modal-bg);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2);overflow:hidden}sd-action-modal .sd-action-modal__header{display:flex;align-items:center;gap:var(--sd-action-modal-header-gap);padding:var(--sd-action-modal-header-padding-y) calc(var(--sd-action-modal-header-padding-x) + 20px) var(--sd-action-modal-header-padding-y) var(--sd-action-modal-header-padding-x)}sd-action-modal .sd-action-modal__title{margin:0;color:var(--sd-action-modal-title-color);font-family:var(--sd-action-modal-title-font-family);font-weight:var(--sd-action-modal-title-font-weight);font-size:var(--sd-action-modal-title-font-size);line-height:var(--sd-action-modal-title-line-height);white-space:nowrap}sd-action-modal .sd-action-modal__header-sub{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px}sd-action-modal .sd-action-modal__header-sub:empty{display:none}sd-action-modal .sd-action-modal__close{position:absolute;top:16px;right:16px;cursor:pointer}sd-action-modal .sd-action-modal__body{flex:1 1 auto;min-height:0;padding:0 var(--sd-action-modal-body-padding-x) var(--sd-action-modal-body-padding-bottom);overflow:auto}sd-action-modal .sd-action-modal__footer{display:flex;align-items:center;gap:var(--sd-action-modal-footer-gap);padding:var(--sd-action-modal-footer-padding-y) var(--sd-action-modal-footer-padding-x);background:var(--sd-action-modal-footer-bg);border-top:1px solid var(--sd-action-modal-footer-border)}sd-action-modal .sd-action-modal__footer>sd-button-v2{margin-left:auto}sd-action-modal .sd-action-modal__footer-sub{display:flex;align-items:center;gap:8px;min-width:0}sd-action-modal .sd-action-modal__footer-sub:empty{display:none}"}},[772,"sd-action-modal",{modalTitle:[1,"modal-title"],buttonProps:[16]}]),g=p,u=function(){"undefined"!=typeof customElements&&["sd-action-modal","sd-button-v2","sd-ghost-button","sd-icon"].forEach((o=>{switch(o){case"sd-action-modal":customElements.get(a(o))||customElements.define(a(o),p);break;case"sd-button-v2":customElements.get(a(o))||s();break;case"sd-ghost-button":customElements.get(a(o))||n();break;case"sd-icon":customElements.get(a(o))||l()}}))};export{g as SdActionModal,u as defineCustomElement}
1
+ import{p as a,t as o,H as d,c as t,h as e}from"./p-DuYi4aqj.js";import{m as i}from"./p-DOXMJi-V.js";import{d as s}from"./p-C2r48NLP.js";import{d as n}from"./p-B1S4ybd6.js";import{d as l}from"./p-CGssy8eb.js";const{modal:c}=i,r=c.action,m={radius:Number(c.radius),bg:c.bg,headerPaddingX:Number(r.header.paddingX),headerPaddingY:Number(r.header.paddingY),headerGap:Number(r.header.gap),bodyPaddingX:Number(r.body.paddingX),bodyPaddingBottom:Number(r.body.paddingBottom),footerPaddingX:Number(r.footer.paddingX),footerPaddingY:Number(r.footer.paddingY),footerGap:Number(r.footer.gap),footerBg:r.footer.bg,footerBorder:r.footer.border},b={color:r.title.color,fontFamily:r.title.typography.fontFamily,fontWeight:r.title.typography.fontWeight,fontSize:Number(r.title.typography.fontSize),lineHeight:Number(r.title.typography.lineHeight)},f={name:"primary_md",label:"확인"},p=a(class extends d{constructor(a){super(),!1!==a&&this.__registerHost(),this.close=t(this,"sdClose",7),this.ok=t(this,"sdOk",7)}modalTitle="";buttonProps;width;height;close;ok;render(){const a={"--sd-action-modal-radius":m.radius+"px","--sd-action-modal-bg":m.bg,"--sd-action-modal-header-padding-x":m.headerPaddingX+"px","--sd-action-modal-header-padding-y":m.headerPaddingY+"px","--sd-action-modal-header-gap":m.headerGap+"px","--sd-action-modal-body-padding-x":m.bodyPaddingX+"px","--sd-action-modal-body-padding-bottom":m.bodyPaddingBottom+"px","--sd-action-modal-footer-padding-x":m.footerPaddingX+"px","--sd-action-modal-footer-padding-y":m.footerPaddingY+"px","--sd-action-modal-footer-gap":m.footerGap+"px","--sd-action-modal-footer-bg":m.footerBg,"--sd-action-modal-footer-border":m.footerBorder,"--sd-action-modal-title-color":b.color,"--sd-action-modal-title-font-family":b.fontFamily,"--sd-action-modal-title-font-weight":b.fontWeight,"--sd-action-modal-title-font-size":b.fontSize+"px","--sd-action-modal-title-line-height":b.lineHeight+"px"},o={};return null!=this.width&&""!==this.width&&(o.width="number"==typeof this.width?this.width+"px":this.width,o.minWidth="0"),null!=this.height&&""!==this.height&&(o.height="number"==typeof this.height?this.height+"px":this.height),e("div",{key:"e741d601fd1c079ebee5b0c527bdf9ec62c43e65",class:"sd-action-modal",style:{...a,...o}},e("header",{key:"9a083fe0d0f8d2b9509cb80af2e8091f4cb23c26",class:"sd-action-modal__header"},e("h2",{key:"1c91eecc04e5c70267ab571a5a7e8dab8fc97fa4",class:"sd-action-modal__title"},this.modalTitle),e("div",{key:"67eba3fbada5580c5741387248d803d0299612e2",class:"sd-action-modal__header-sub"},e("slot",{key:"769583cdfdb8c5d1e2eb2bd1c240c9956f1530e3",name:"header-sub-title"})),e("sd-ghost-button",{key:"05cb596931da687dd2fbf961bdbe116b0a83ee87",class:"sd-action-modal__close",icon:"close",ariaLabel:"close",onClick:()=>this.close.emit()})),e("div",{key:"ecf3346b28bdf29d13fedb1d58f2119af73932a2",class:"sd-action-modal__body"},e("slot",{key:"276aa6ced63b887cda3b8a9790b4d5064763f556",name:"body"})),(null!=this.buttonProps||null!=this.buttonProps)&&e("footer",{key:"fcf62d04efe0cfa46c3ceadda2314606a1e3588c",class:"sd-action-modal__footer"},e("div",{key:"61948bdf02737aed99420533f5fb9ab4e28be676",class:"sd-action-modal__footer-sub"},e("slot",{key:"761a6a38ba2a86f932564a7d1e03e3277f9f917b",name:"bottom-sub-content"})),e("sd-button-v2",{key:"242531f04700bea06c93c25a7eaf3e0b03dd628d",...f,...this.buttonProps,onSdClick:()=>this.ok.emit()})))}static get style(){return"sd-action-modal{display:block}sd-action-modal .sd-action-modal{position:relative;display:flex;flex-direction:column;width:fit-content;min-width:520px;border-radius:var(--sd-action-modal-radius);background:var(--sd-action-modal-bg);box-shadow:4px 4px 24px 4px rgba(0, 0, 0, 0.2);overflow:hidden}sd-action-modal .sd-action-modal__header{display:flex;align-items:center;flex-shrink:0;gap:var(--sd-action-modal-header-gap);padding:var(--sd-action-modal-header-padding-y) calc(var(--sd-action-modal-header-padding-x) + 20px) var(--sd-action-modal-header-padding-y) var(--sd-action-modal-header-padding-x)}sd-action-modal .sd-action-modal__title{margin:0;color:var(--sd-action-modal-title-color);font-family:var(--sd-action-modal-title-font-family);font-weight:var(--sd-action-modal-title-font-weight);font-size:var(--sd-action-modal-title-font-size);line-height:var(--sd-action-modal-title-line-height);white-space:nowrap}sd-action-modal .sd-action-modal__header-sub{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px}sd-action-modal .sd-action-modal__header-sub:empty{display:none}sd-action-modal .sd-action-modal__close{position:absolute;top:16px;right:16px;cursor:pointer}sd-action-modal .sd-action-modal__body{flex:1 1 auto;min-height:0;padding:0 var(--sd-action-modal-body-padding-x) var(--sd-action-modal-body-padding-bottom);overflow:auto}sd-action-modal .sd-action-modal__footer{display:flex;align-items:center;flex-shrink:0;gap:var(--sd-action-modal-footer-gap);padding:var(--sd-action-modal-footer-padding-y) var(--sd-action-modal-footer-padding-x);background:var(--sd-action-modal-footer-bg);border-top:1px solid var(--sd-action-modal-footer-border)}sd-action-modal .sd-action-modal__footer>sd-button-v2{margin-left:auto}sd-action-modal .sd-action-modal__footer-sub{display:flex;align-items:center;gap:8px;min-width:0}sd-action-modal .sd-action-modal__footer-sub:empty{display:none}"}},[772,"sd-action-modal",{modalTitle:[1,"modal-title"],buttonProps:[16],width:[8],height:[8]}]),h=p,g=function(){"undefined"!=typeof customElements&&["sd-action-modal","sd-button-v2","sd-ghost-button","sd-icon"].forEach((a=>{switch(a){case"sd-action-modal":customElements.get(o(a))||customElements.define(o(a),p);break;case"sd-button-v2":customElements.get(o(a))||s();break;case"sd-ghost-button":customElements.get(o(a))||n();break;case"sd-icon":customElements.get(o(a))||l()}}))};export{h as SdActionModal,g as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as a}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as d}from"./p-CJwbBrt5.js";import{d as n}from"./p-BLC3AWW8.js";import{d as l}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as u}from"./p-CGssy8eb.js";import{d as h}from"./p-BZ7V5xV5.js";const p=d.textinput.sm,b=d.textinput.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:d.textinput.bg,text:d.textinput.text,icon:d.textinput.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="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){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:"bba439856e0cbaedc7b54411dac904f9c845b50c",name:this.name,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":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:"8553cfb4b5ef9535608abc1f2987ce08970c318a",class:"sd-barcode-input__content"},i("slot",{key:"93db2b38e8d674230f48e3b9496a7221d8477da6",name:"prefix"}),i("input",{key:"30997bea593052322a2d29fc1e517b00cf19b1fb",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:"690daa6c1daa6058713ee09b0efe976557cde3ab",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"8ab4e45a23d1b06dc415d969e25ed5ea59540643",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[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[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],labelWidth:[8,"label-width"],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))||n();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-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as d}from"./p-CJwbBrt5.js";import{d as n}from"./p-BLC3AWW8.js";import{d as l}from"./p-HsTw_qYU.js";import{d as r}from"./p-DXtyg5eK.js";import{d as c}from"./p-B1S4ybd6.js";import{d as u}from"./p-CGssy8eb.js";import{d as h}from"./p-Cc7ZBscb.js";const p=d.textinput.sm,b=d.textinput.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:d.textinput.bg,text:d.textinput.text,icon:d.textinput.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="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){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:"bba439856e0cbaedc7b54411dac904f9c845b50c",name:this.name,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":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:"8553cfb4b5ef9535608abc1f2987ce08970c318a",class:"sd-barcode-input__content"},i("slot",{key:"93db2b38e8d674230f48e3b9496a7221d8477da6",name:"prefix"}),i("input",{key:"30997bea593052322a2d29fc1e517b00cf19b1fb",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:"690daa6c1daa6058713ee09b0efe976557cde3ab",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"8ab4e45a23d1b06dc415d969e25ed5ea59540643",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[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[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],labelWidth:[8,"label-width"],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))||n();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 i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as c}from"./p-BdsI1E5l.js";import{d as h}from"./p-AKpbKrkW.js";import{d as n}from"./p-BjjrNz4C.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as f}from"./p-CGssy8eb.js";import{d as b}from"./p-BgRPWxrz.js";import{d as u}from"./p-BZ7V5xV5.js";const g=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"693c0c75e6b0a9ee8323f4be7ec101592e586372",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"ea7f506f0163119fac0c660ef1bef5781780a118",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"0109eb0326655018bc02cc373e766ffdada85ff0",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"65a628af43ae036a752f3511341fd8c9c82303a1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"21f574fc9551f9aaccfcb5d49a81952dbba72d7a",value:this.value,selectable:this.selectable,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=g,y=function(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-date-picker-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),g);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||n();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||f();break;case"sd-portal":customElements.get(a(e))||b();break;case"sd-tooltip":customElements.get(a(e))||u()}}))};export{k as SdDatePicker,y as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as c}from"./p-BdsI1E5l.js";import{d as h}from"./p-AKpbKrkW.js";import{d as n}from"./p-HsTw_qYU.js";import{d as p}from"./p-DXtyg5eK.js";import{d as m}from"./p-B1S4ybd6.js";import{d as f}from"./p-CGssy8eb.js";import{d as b}from"./p-h6zSUtA2.js";import{d as u}from"./p-Cc7ZBscb.js";const g=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"693c0c75e6b0a9ee8323f4be7ec101592e586372",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"ea7f506f0163119fac0c660ef1bef5781780a118",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"0109eb0326655018bc02cc373e766ffdada85ff0",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"65a628af43ae036a752f3511341fd8c9c82303a1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"21f574fc9551f9aaccfcb5d49a81952dbba72d7a",value:this.value,selectable:this.selectable,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=g,y=function(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-date-picker-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),g);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||n();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||f();break;case"sd-portal":customElements.get(a(e))||b();break;case"sd-tooltip":customElements.get(a(e))||u()}}))};export{k as SdDatePicker,y as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as n}from"./p-AKpbKrkW.js";import{d as h}from"./p-CRl8Anfr.js";import{d as c}from"./p-BjjrNz4C.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as b}from"./p-CGssy8eb.js";import{d as u}from"./p-BgRPWxrz.js";import{d as g}from"./p-BZ7V5xV5.js";const f=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD ~ YYYY-MM-DD";selectable;maxRange;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};get displayText(){return this.value&&this.value[0]&&this.value[1]?`${this.value[0]} ~ ${this.value[1]}`:""}disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"95ec666c91635d6b6b749d660b4495b7ebe48e6a",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"3051fda66e94d51208347ae2053173570d5f1ca9",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"71693b5a4cec562169d9427a4e19aed4d8b19a45",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"75b9f1c1ebdabcd1c1a33cad51189ba132274bb1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-range-picker-calendar",{key:"f158eead4f44bc452bf102b3324721df84fc3b0c",value:this.value,selectable:this.selectable,maxRange:this.maxRange,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-range-picker{display:inline-flex}sd-date-range-picker sd-portal{display:none}sd-date-range-picker .sd-date-range-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-range-picker",{value:[1040],size:[513],placeholder:[513],selectable:[16],maxRange:[2,"max-range"],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=f,y=function(){"undefined"!=typeof customElements&&["sd-date-range-picker","sd-button","sd-date-picker-trigger","sd-date-range-picker-calendar","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-range-picker":customElements.get(a(e))||customElements.define(a(e),f);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-trigger":customElements.get(a(e))||n();break;case"sd-date-range-picker-calendar":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||c();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tooltip":customElements.get(a(e))||g()}}))};export{k as SdDateRangePicker,y as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as n}from"./p-AKpbKrkW.js";import{d as h}from"./p-CRl8Anfr.js";import{d as c}from"./p-HsTw_qYU.js";import{d as p}from"./p-DXtyg5eK.js";import{d as m}from"./p-B1S4ybd6.js";import{d as b}from"./p-CGssy8eb.js";import{d as u}from"./p-h6zSUtA2.js";import{d as g}from"./p-Cc7ZBscb.js";const f=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD ~ YYYY-MM-DD";selectable;maxRange;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};get displayText(){return this.value&&this.value[0]&&this.value[1]?`${this.value[0]} ~ ${this.value[1]}`:""}disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"95ec666c91635d6b6b749d660b4495b7ebe48e6a",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,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,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"3051fda66e94d51208347ae2053173570d5f1ca9",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"71693b5a4cec562169d9427a4e19aed4d8b19a45",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"75b9f1c1ebdabcd1c1a33cad51189ba132274bb1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-range-picker-calendar",{key:"f158eead4f44bc452bf102b3324721df84fc3b0c",value:this.value,selectable:this.selectable,maxRange:this.maxRange,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-range-picker{display:inline-flex}sd-date-range-picker sd-portal{display:none}sd-date-range-picker .sd-date-range-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-range-picker",{value:[1040],size:[513],placeholder:[513],selectable:[16],maxRange:[2,"max-range"],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=f,y=function(){"undefined"!=typeof customElements&&["sd-date-range-picker","sd-button","sd-date-picker-trigger","sd-date-range-picker-calendar","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-range-picker":customElements.get(a(e))||customElements.define(a(e),f);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-trigger":customElements.get(a(e))||n();break;case"sd-date-range-picker-calendar":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||c();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tooltip":customElements.get(a(e))||g()}}))};export{k as SdDateRangePicker,y as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,c as o,h as n,t as d}from"./p-DuYi4aqj.js";import{B as r}from"./p-B6RvTdqt.js";import{B as e,g as s,P as i,a,b as u,c as b}from"./p-C-kw2p2a.js";import{b as p}from"./p-B1XBwjCW.js";import{d as c}from"./p-CGssy8eb.js";import{d as l}from"./p-BgRPWxrz.js";var h={accent:{default:"#0075FF"}},w={secondary:"#555555",inverse:"#FFFFFF"};const g=Object.keys(e).filter((t=>!t.endsWith("_lg"))),m=Object.fromEntries(g.map((t=>[t,e[t]]))),x=u,f=a,v=i,_={primary:p.button.brand.strong.dropdown.divider,secondary:p.button.brand.subtle.dropdown.divider,primary_outline:v.primary_outline,neutral_outline:v.neutral_outline,danger:p.button.danger.strong.dropdown.divider,danger_outline:v.danger_outline},y=w.secondary,k=h.accent.default,C=w.inverse,F={primary:y,secondary:y,primary_outline:y,neutral_outline:y,danger:y,danger_outline:y},z={primary:k,secondary:k,primary_outline:k,neutral_outline:k,danger:k,danger_outline:k},O={primary:C,secondary:C,primary_outline:C,neutral_outline:C,danger:C,danger_outline:C},E={xs:12,sm:12,md:16},D=p.button.bg.disabled,j=p.button.text.disabled,A=p.button.border.disabled,T=t(class t extends r{constructor(t){super(!1),!1!==t&&this.__registerHost(),this.click=o(this,"sdClick",7),this.dropDownShow=o(this,"sdDropDownShow",7)}get el(){return this}name="primary_sm";label="";items=[];disabled=!1;static CLOSE_ANIMATION_DURATION=150;isOpen=!1;isAnimatingOut=!1;itemIndex=-1;triggerRef;menuRef;closeAnimationTimer;click;dropDownShow;handleOpenChange(t){this.onDropdownToggle(t),this.dropDownShow.emit({isOpen:t}),t||(this.itemIndex=-1)}componentWillLoad(){this.initializeEvent()}disconnectedCallback(){this.cleanupEvent(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}async sdOpen(){this.disabled||0===this.items.length||(this.isOpen=!0)}async sdClose(){this.closeDropdown()}closeDropdown=()=>{this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),t.CLOSE_ANIMATION_DURATION))};handleDocumentClick(t){const o=t.target;o&&(this.el.contains(o)||this.menuRef?.contains(o)||this.closeDropdown())}handleDocumentKeydown(t){if(this.isOpen&&["ArrowDown","ArrowUp","Enter","Escape"].includes(t.key))switch(t.preventDefault(),t.stopPropagation(),t.key){case"ArrowDown":this.itemIndex=this.getNextEnabledIndex(1);break;case"ArrowUp":this.itemIndex=this.getNextEnabledIndex(-1);break;case"Enter":if(this.itemIndex<0)return;this.selectItem(this.items[this.itemIndex]);break;case"Escape":this.closeDropdown()}}get resolvedConfig(){if(!(()=>this.name in m)())throw Error("Invalid sd-dropdown-button name: "+this.name);return{config:m[this.name],preset:(()=>s(this.name))()}}getNextEnabledIndex(t){const o=this.items.reduce(((t,o,n)=>(o.disabled||t.push(n),t)),[]);if(0===o.length)return-1;const n=o.indexOf(this.itemIndex);return-1===n?1===t?o[0]:o[o.length-1]:o[(n+t+o.length)%o.length]}toggleDropdown=t=>{t.stopPropagation(),this.disabled||0===this.items.length||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};selectItem(t,o){o?.stopPropagation(),t&&!t.disabled&&(this.click.emit(t.value),this.closeDropdown())}getTriggerClasses(t,o,n,d){const r=["sd-dropdown-button__trigger","sd-dropdown-button__trigger--"+t,"sd-dropdown-button__trigger--"+o];return n&&r.push("sd-dropdown-button__trigger--disabled"),d&&r.push("sd-dropdown-button__trigger--open"),r.join(" ")}getMenuItemClasses(t,o){const n=["sd-dropdown-button__menu-item"];return t&&n.push("sd-dropdown-button__menu-item--active"),o&&n.push("sd-dropdown-button__menu-item--disabled"),n.join(" ")}renderDropdown(t){return(this.isOpen||this.isAnimatingOut)&&this.triggerRef?n("sd-portal",{open:this.isOpen,parentRef:this.triggerRef,onSdClose:this.closeDropdown},n("div",{style:{position:"absolute",width:"0px",height:"0px"}},n("div",{class:"sd-dropdown-button__menu",role:"menu",ref:t=>this.menuRef=t,style:{"--sd-dropdown-button-menu-min-width":this.triggerRef.offsetWidth+"px","--sd-dropdown-button-menu-item-color":F[t],"--sd-dropdown-button-menu-item-active-bg":z[t],"--sd-dropdown-button-menu-item-active-color":O[t],"--sd-dropdown-button-menu-border":"transparent"===v[t]?_[t]:v[t]}},this.items.map(((t,o)=>n("button",{type:"button",role:"menuitem",class:this.getMenuItemClasses(this.itemIndex===o&&!t.disabled,!!t.disabled),disabled:t.disabled,onClick:o=>this.selectItem(t,o),onMouseEnter:()=>{t.disabled||(this.itemIndex=o)}},t.icon&&n("sd-icon",{class:"sd-dropdown-button__menu-item-icon",name:t.icon,size:12,color:"var(--sd-dropdown-button-menu-item-current-color)"}),n("span",{class:"sd-dropdown-button__menu-item-label",innerHTML:t.label}))))))):null}render(){const{config:t,preset:o}=this.resolvedConfig;return n("div",{key:"1a6fa00329392de05526a50de55dcd620a43a2db",class:"sd-dropdown-button"},n("button",{key:"d73139863c8decca29079a8111e26ea5a2d21614",type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":this.isOpen+"",onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:{"--sd-dropdown-button-bg":t.color,"--sd-dropdown-button-bg-hover":x[o],"--sd-dropdown-button-border":v[o],"--sd-dropdown-button-content":f[o],"--sd-dropdown-button-divider":_[o],"--sd-dropdown-button-accent":b,"--sd-dropdown-button-disabled-bg":D,"--sd-dropdown-button-disabled-content":j,"--sd-dropdown-button-disabled-border":A}},n("span",{key:"52e30c7d5f55b2ed974944b23880a42fdf941e31",class:"sd-dropdown-button__trigger-label"},this.label),n("span",{key:"8d693a472783e552613b0c0503b85dc9b5ce0343",class:"sd-dropdown-button__trigger-divider","aria-hidden":"true"}),n("span",{key:"e9f0fc3980400150c8808e569904bee6c4629dc7",class:{"sd-dropdown-button__trigger-icon":!0,"sd-dropdown-button__trigger-icon--open":this.isOpen},"aria-hidden":"true"},n("sd-icon",{key:"13fda88989885a9096ed6ecf211b3aadad3f128a",name:"chevronDown",size:E[t.size],color:"var(--sd-dropdown-button-current-content)"}))),this.renderDropdown(o))}static get watchers(){return{isOpen:[{handleOpenChange:0}]}}static get style(){return"sd-dropdown-button{display:inline-flex;width:fit-content;height:fit-content}.sd-dropdown-button{display:inline-flex;position:relative}.sd-dropdown-button__trigger{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-md-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var(--sd-button-button-md-typography-text-decoration, none);--sd-dropdown-button-bg:#025497;--sd-dropdown-button-bg-hover:#004177;--sd-dropdown-button-border:transparent;--sd-dropdown-button-content:#FFFFFF;--sd-dropdown-button-current-content:var(--sd-dropdown-button-content);--sd-dropdown-button-divider:#006AC1;--sd-dropdown-button-accent:#0075FF;--sd-dropdown-button-disabled-bg:var(--sd-button-button-bg-disabled, #E1E1E1);--sd-dropdown-button-disabled-content:var(--sd-button-button-text-disabled, #888888);--sd-dropdown-button-disabled-border:var(--sd-button-button-border-disabled, #CCCCCC);display:inline-flex;align-items:stretch;justify-content:space-between;min-height:var(--sd-dropdown-button-height);padding:0;border:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-border);border-radius:var(--sd-button-button-radius-sm, 4px);background:var(--sd-dropdown-button-bg);color:var(--sd-dropdown-button-current-content);cursor:pointer;box-sizing:border-box;font-family:var(--sd-dropdown-button-font-family);font-size:var(--sd-dropdown-button-font-size);font-weight:var(--sd-dropdown-button-font-weight);line-height:1;text-decoration:var(--sd-dropdown-button-text-decoration);transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;white-space:nowrap}.sd-dropdown-button__trigger:hover:not(.sd-dropdown-button__trigger--disabled){background:var(--sd-dropdown-button-bg-hover)}.sd-dropdown-button__trigger:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-dropdown-button-accent)}.sd-dropdown-button__trigger--xs{--sd-dropdown-button-height:var(--sd-button-button-xs-height, 24px);--sd-dropdown-button-padding-x:var(--sd-button-button-xs-padding-x, 8px);--sd-dropdown-button-gap:var(--sd-button-button-xs-gap, 4px);--sd-dropdown-button-font-family:var(--sd-button-button-xs-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-xs-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-xs-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-xs-typography-text-decoration, none )}.sd-dropdown-button__trigger--sm{--sd-dropdown-button-height:var(--sd-button-button-sm-height, 28px);--sd-dropdown-button-padding-x:var(--sd-button-button-sm-padding-x, 12px);--sd-dropdown-button-gap:var(--sd-button-button-sm-gap, 6px);--sd-dropdown-button-font-family:var(--sd-button-button-sm-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-sm-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-sm-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-sm-typography-text-decoration, none )}.sd-dropdown-button__trigger--md{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-md-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 16px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-md-typography-text-decoration, none );border-radius:var(--sd-button-button-radius-md, 6px)}.sd-dropdown-button__trigger--disabled{border-color:var(--sd-dropdown-button-disabled-border);background:var(--sd-dropdown-button-disabled-bg);--sd-dropdown-button-current-content:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__trigger--disabled .sd-dropdown-button__trigger-divider{background:var(--sd-dropdown-button-disabled-border)}.sd-dropdown-button__trigger-label,.sd-dropdown-button__trigger-icon{display:inline-flex;align-items:center;justify-content:center}.sd-dropdown-button__trigger-label{flex:1 1 auto;min-width:0;padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button__trigger-divider{align-self:stretch;width:1px;height:auto;background:var(--sd-dropdown-button-divider);opacity:0.9}.sd-dropdown-button__trigger-icon{flex:0 0 auto;min-width:calc(var(--sd-dropdown-button-height) - 2px);padding:0 calc(var(--sd-dropdown-button-gap) + 2px);transition:transform 0.2s ease}.sd-dropdown-button__trigger-icon--open{transform:rotate(180deg)}.sd-dropdown-button__menu{position:relative;display:grid;width:max-content;min-width:var(--sd-dropdown-button-menu-min-width, max-content);max-width:calc(100vw - 24px);padding:4px 0;border:0;border-radius:4px;background:#FFFFFF;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1019607843);box-sizing:border-box;overflow:hidden}.sd-dropdown-button__menu-item{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-color);display:inline-flex;align-items:center;gap:8px;min-height:28px;width:100%;padding:0 12px;border:0;border-radius:0;background:transparent;color:var(--sd-dropdown-button-menu-item-current-color);cursor:pointer;box-sizing:border-box;font:inherit;text-align:left;transition:background-color 0.15s ease, color 0.15s ease}.sd-dropdown-button__menu-item--active{background:var(--sd-dropdown-button-menu-item-active-bg);--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-active-color)}.sd-dropdown-button__menu-item--disabled{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__menu-item-icon{flex:0 0 auto}.sd-dropdown-button__menu-item-label{display:inline-flex;align-items:center;min-width:0;white-space:nowrap;font-size:12px}"}},[512,"sd-dropdown-button",{name:[1],label:[1],items:[16],disabled:[4],isOpen:[32],isAnimatingOut:[32],itemIndex:[32],sdOpen:[64],sdClose:[64]},void 0,{isOpen:[{handleOpenChange:0}]}]),I=T,B=function(){"undefined"!=typeof customElements&&["sd-dropdown-button","sd-icon","sd-portal"].forEach((t=>{switch(t){case"sd-dropdown-button":customElements.get(d(t))||customElements.define(d(t),T);break;case"sd-icon":customElements.get(d(t))||c();break;case"sd-portal":customElements.get(d(t))||l()}}))};export{I as SdDropdownButton,B as defineCustomElement}
1
+ import{p as t,c as o,h as n,t as d}from"./p-DuYi4aqj.js";import{B as r}from"./p-B6RvTdqt.js";import{B as e,g as s,P as i,a,b as u,c as b}from"./p-C-kw2p2a.js";import{b as p}from"./p-B1XBwjCW.js";import{d as c}from"./p-CGssy8eb.js";import{d as l}from"./p-h6zSUtA2.js";var h={accent:{default:"#0075FF"}},w={secondary:"#555555",inverse:"#FFFFFF"};const g=Object.keys(e).filter((t=>!t.endsWith("_lg"))),m=Object.fromEntries(g.map((t=>[t,e[t]]))),x=u,f=a,v=i,_={primary:p.button.brand.strong.dropdown.divider,secondary:p.button.brand.subtle.dropdown.divider,primary_outline:v.primary_outline,neutral_outline:v.neutral_outline,danger:p.button.danger.strong.dropdown.divider,danger_outline:v.danger_outline},y=w.secondary,k=h.accent.default,C=w.inverse,F={primary:y,secondary:y,primary_outline:y,neutral_outline:y,danger:y,danger_outline:y},z={primary:k,secondary:k,primary_outline:k,neutral_outline:k,danger:k,danger_outline:k},O={primary:C,secondary:C,primary_outline:C,neutral_outline:C,danger:C,danger_outline:C},E={xs:12,sm:12,md:16},D=p.button.bg.disabled,j=p.button.text.disabled,A=p.button.border.disabled,T=t(class t extends r{constructor(t){super(!1),!1!==t&&this.__registerHost(),this.click=o(this,"sdClick",7),this.dropDownShow=o(this,"sdDropDownShow",7)}get el(){return this}name="primary_sm";label="";items=[];disabled=!1;static CLOSE_ANIMATION_DURATION=150;isOpen=!1;isAnimatingOut=!1;itemIndex=-1;triggerRef;menuRef;closeAnimationTimer;click;dropDownShow;handleOpenChange(t){this.onDropdownToggle(t),this.dropDownShow.emit({isOpen:t}),t||(this.itemIndex=-1)}componentWillLoad(){this.initializeEvent()}disconnectedCallback(){this.cleanupEvent(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}async sdOpen(){this.disabled||0===this.items.length||(this.isOpen=!0)}async sdClose(){this.closeDropdown()}closeDropdown=()=>{this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),t.CLOSE_ANIMATION_DURATION))};handleDocumentClick(t){const o=t.target;o&&(this.el.contains(o)||this.menuRef?.contains(o)||this.closeDropdown())}handleDocumentKeydown(t){if(this.isOpen&&["ArrowDown","ArrowUp","Enter","Escape"].includes(t.key))switch(t.preventDefault(),t.stopPropagation(),t.key){case"ArrowDown":this.itemIndex=this.getNextEnabledIndex(1);break;case"ArrowUp":this.itemIndex=this.getNextEnabledIndex(-1);break;case"Enter":if(this.itemIndex<0)return;this.selectItem(this.items[this.itemIndex]);break;case"Escape":this.closeDropdown()}}get resolvedConfig(){if(!(()=>this.name in m)())throw Error("Invalid sd-dropdown-button name: "+this.name);return{config:m[this.name],preset:(()=>s(this.name))()}}getNextEnabledIndex(t){const o=this.items.reduce(((t,o,n)=>(o.disabled||t.push(n),t)),[]);if(0===o.length)return-1;const n=o.indexOf(this.itemIndex);return-1===n?1===t?o[0]:o[o.length-1]:o[(n+t+o.length)%o.length]}toggleDropdown=t=>{t.stopPropagation(),this.disabled||0===this.items.length||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};selectItem(t,o){o?.stopPropagation(),t&&!t.disabled&&(this.click.emit(t.value),this.closeDropdown())}getTriggerClasses(t,o,n,d){const r=["sd-dropdown-button__trigger","sd-dropdown-button__trigger--"+t,"sd-dropdown-button__trigger--"+o];return n&&r.push("sd-dropdown-button__trigger--disabled"),d&&r.push("sd-dropdown-button__trigger--open"),r.join(" ")}getMenuItemClasses(t,o){const n=["sd-dropdown-button__menu-item"];return t&&n.push("sd-dropdown-button__menu-item--active"),o&&n.push("sd-dropdown-button__menu-item--disabled"),n.join(" ")}renderDropdown(t){return(this.isOpen||this.isAnimatingOut)&&this.triggerRef?n("sd-portal",{open:this.isOpen,parentRef:this.triggerRef,onSdClose:this.closeDropdown},n("div",{style:{position:"absolute",width:"0px",height:"0px"}},n("div",{class:"sd-dropdown-button__menu",role:"menu",ref:t=>this.menuRef=t,style:{"--sd-dropdown-button-menu-min-width":this.triggerRef.offsetWidth+"px","--sd-dropdown-button-menu-item-color":F[t],"--sd-dropdown-button-menu-item-active-bg":z[t],"--sd-dropdown-button-menu-item-active-color":O[t],"--sd-dropdown-button-menu-border":"transparent"===v[t]?_[t]:v[t]}},this.items.map(((t,o)=>n("button",{type:"button",role:"menuitem",class:this.getMenuItemClasses(this.itemIndex===o&&!t.disabled,!!t.disabled),disabled:t.disabled,onClick:o=>this.selectItem(t,o),onMouseEnter:()=>{t.disabled||(this.itemIndex=o)}},t.icon&&n("sd-icon",{class:"sd-dropdown-button__menu-item-icon",name:t.icon,size:12,color:"var(--sd-dropdown-button-menu-item-current-color)"}),n("span",{class:"sd-dropdown-button__menu-item-label",innerHTML:t.label}))))))):null}render(){const{config:t,preset:o}=this.resolvedConfig;return n("div",{key:"1a6fa00329392de05526a50de55dcd620a43a2db",class:"sd-dropdown-button"},n("button",{key:"d73139863c8decca29079a8111e26ea5a2d21614",type:"button",class:this.getTriggerClasses(o,t.size,this.disabled,this.isOpen),disabled:this.disabled,"aria-haspopup":"menu","aria-expanded":this.isOpen+"",onClick:this.toggleDropdown,ref:t=>this.triggerRef=t,style:{"--sd-dropdown-button-bg":t.color,"--sd-dropdown-button-bg-hover":x[o],"--sd-dropdown-button-border":v[o],"--sd-dropdown-button-content":f[o],"--sd-dropdown-button-divider":_[o],"--sd-dropdown-button-accent":b,"--sd-dropdown-button-disabled-bg":D,"--sd-dropdown-button-disabled-content":j,"--sd-dropdown-button-disabled-border":A}},n("span",{key:"52e30c7d5f55b2ed974944b23880a42fdf941e31",class:"sd-dropdown-button__trigger-label"},this.label),n("span",{key:"8d693a472783e552613b0c0503b85dc9b5ce0343",class:"sd-dropdown-button__trigger-divider","aria-hidden":"true"}),n("span",{key:"e9f0fc3980400150c8808e569904bee6c4629dc7",class:{"sd-dropdown-button__trigger-icon":!0,"sd-dropdown-button__trigger-icon--open":this.isOpen},"aria-hidden":"true"},n("sd-icon",{key:"13fda88989885a9096ed6ecf211b3aadad3f128a",name:"chevronDown",size:E[t.size],color:"var(--sd-dropdown-button-current-content)"}))),this.renderDropdown(o))}static get watchers(){return{isOpen:[{handleOpenChange:0}]}}static get style(){return"sd-dropdown-button{display:inline-flex;width:fit-content;height:fit-content}.sd-dropdown-button{display:inline-flex;position:relative}.sd-dropdown-button__trigger{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-md-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var(--sd-button-button-md-typography-text-decoration, none);--sd-dropdown-button-bg:#025497;--sd-dropdown-button-bg-hover:#004177;--sd-dropdown-button-border:transparent;--sd-dropdown-button-content:#FFFFFF;--sd-dropdown-button-current-content:var(--sd-dropdown-button-content);--sd-dropdown-button-divider:#006AC1;--sd-dropdown-button-accent:#0075FF;--sd-dropdown-button-disabled-bg:var(--sd-button-button-bg-disabled, #E1E1E1);--sd-dropdown-button-disabled-content:var(--sd-button-button-text-disabled, #888888);--sd-dropdown-button-disabled-border:var(--sd-button-button-border-disabled, #CCCCCC);display:inline-flex;align-items:stretch;justify-content:space-between;min-height:var(--sd-dropdown-button-height);padding:0;border:var(--sd-button-button-border-width-default, 1px) solid var(--sd-dropdown-button-border);border-radius:var(--sd-button-button-radius-sm, 4px);background:var(--sd-dropdown-button-bg);color:var(--sd-dropdown-button-current-content);cursor:pointer;box-sizing:border-box;font-family:var(--sd-dropdown-button-font-family);font-size:var(--sd-dropdown-button-font-size);font-weight:var(--sd-dropdown-button-font-weight);line-height:1;text-decoration:var(--sd-dropdown-button-text-decoration);transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;white-space:nowrap}.sd-dropdown-button__trigger:hover:not(.sd-dropdown-button__trigger--disabled){background:var(--sd-dropdown-button-bg-hover)}.sd-dropdown-button__trigger:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-dropdown-button-accent)}.sd-dropdown-button__trigger--xs{--sd-dropdown-button-height:var(--sd-button-button-xs-height, 24px);--sd-dropdown-button-padding-x:var(--sd-button-button-xs-padding-x, 8px);--sd-dropdown-button-gap:var(--sd-button-button-xs-gap, 4px);--sd-dropdown-button-font-family:var(--sd-button-button-xs-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-xs-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-xs-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-xs-typography-text-decoration, none )}.sd-dropdown-button__trigger--sm{--sd-dropdown-button-height:var(--sd-button-button-sm-height, 28px);--sd-dropdown-button-padding-x:var(--sd-button-button-sm-padding-x, 12px);--sd-dropdown-button-gap:var(--sd-button-button-sm-gap, 6px);--sd-dropdown-button-font-family:var(--sd-button-button-sm-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-sm-typography-font-size, 12px);--sd-dropdown-button-font-weight:var(--sd-button-button-sm-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-sm-typography-text-decoration, none )}.sd-dropdown-button__trigger--md{--sd-dropdown-button-height:var(--sd-button-button-md-height, 36px);--sd-dropdown-button-padding-x:var(--sd-button-button-md-padding-x, 20px);--sd-dropdown-button-gap:var(--sd-button-button-md-gap, 8px);--sd-dropdown-button-font-family:var(--sd-button-button-md-typography-font-family, inherit);--sd-dropdown-button-font-size:var(--sd-button-button-md-typography-font-size, 16px);--sd-dropdown-button-font-weight:var(--sd-button-button-md-typography-font-weight, 500);--sd-dropdown-button-text-decoration:var( --sd-button-button-md-typography-text-decoration, none );border-radius:var(--sd-button-button-radius-md, 6px)}.sd-dropdown-button__trigger--disabled{border-color:var(--sd-dropdown-button-disabled-border);background:var(--sd-dropdown-button-disabled-bg);--sd-dropdown-button-current-content:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__trigger--disabled .sd-dropdown-button__trigger-divider{background:var(--sd-dropdown-button-disabled-border)}.sd-dropdown-button__trigger-label,.sd-dropdown-button__trigger-icon{display:inline-flex;align-items:center;justify-content:center}.sd-dropdown-button__trigger-label{flex:1 1 auto;min-width:0;padding:0 var(--sd-dropdown-button-padding-x)}.sd-dropdown-button__trigger-divider{align-self:stretch;width:1px;height:auto;background:var(--sd-dropdown-button-divider);opacity:0.9}.sd-dropdown-button__trigger-icon{flex:0 0 auto;min-width:calc(var(--sd-dropdown-button-height) - 2px);padding:0 calc(var(--sd-dropdown-button-gap) + 2px);transition:transform 0.2s ease}.sd-dropdown-button__trigger-icon--open{transform:rotate(180deg)}.sd-dropdown-button__menu{position:relative;display:grid;width:max-content;min-width:var(--sd-dropdown-button-menu-min-width, max-content);max-width:calc(100vw - 24px);padding:4px 0;border:0;border-radius:4px;background:#FFFFFF;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1019607843);box-sizing:border-box;overflow:hidden}.sd-dropdown-button__menu-item{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-color);display:inline-flex;align-items:center;gap:8px;min-height:28px;width:100%;padding:0 12px;border:0;border-radius:0;background:transparent;color:var(--sd-dropdown-button-menu-item-current-color);cursor:pointer;box-sizing:border-box;font:inherit;text-align:left;transition:background-color 0.15s ease, color 0.15s ease}.sd-dropdown-button__menu-item--active{background:var(--sd-dropdown-button-menu-item-active-bg);--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-menu-item-active-color)}.sd-dropdown-button__menu-item--disabled{--sd-dropdown-button-menu-item-current-color:var(--sd-dropdown-button-disabled-content);cursor:not-allowed}.sd-dropdown-button__menu-item-icon{flex:0 0 auto}.sd-dropdown-button__menu-item-label{display:inline-flex;align-items:center;min-width:0;white-space:nowrap;font-size:12px}"}},[512,"sd-dropdown-button",{name:[1],label:[1],items:[16],disabled:[4],isOpen:[32],isAnimatingOut:[32],itemIndex:[32],sdOpen:[64],sdClose:[64]},void 0,{isOpen:[{handleOpenChange:0}]}]),I=T,B=function(){"undefined"!=typeof customElements&&["sd-dropdown-button","sd-icon","sd-portal"].forEach((t=>{switch(t){case"sd-dropdown-button":customElements.get(d(t))||customElements.define(d(t),T);break;case"sd-icon":customElements.get(d(t))||c();break;case"sd-portal":customElements.get(d(t))||l()}}))};export{I as SdDropdownButton,B as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as r}from"./p-BjjrNz4C.js";const s=o,j=r;export{s as SdField,j as defineCustomElement}
1
+ import{S as s,d as o}from"./p-HsTw_qYU.js";const p=s,r=o;export{p as SdField,r as defineCustomElement}