@sellmate/design-system 1.0.68 → 1.0.69

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 (101) hide show
  1. package/dist/cjs/design-system.cjs.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sd-barcode-input.cjs.entry.js +2 -1
  4. package/dist/cjs/sd-button_4.cjs.entry.js +17 -5
  5. package/dist/cjs/sd-date-picker.cjs.entry.js +3 -2
  6. package/dist/cjs/sd-date-range-picker.cjs.entry.js +3 -2
  7. package/dist/cjs/sd-file-picker.cjs.entry.js +2 -1
  8. package/dist/cjs/sd-input_2.cjs.entry.js +3 -2
  9. package/dist/cjs/sd-number-input.cjs.entry.js +4 -3
  10. package/dist/cjs/sd-pagination_2.cjs.entry.js +4 -3
  11. package/dist/cjs/sd-select-group.cjs.entry.js +2 -1
  12. package/dist/cjs/sd-select.cjs.entry.js +2 -1
  13. package/dist/cjs/sd-textarea.cjs.entry.js +2 -1
  14. package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +29 -1
  15. package/dist/collection/components/sd-date-picker/sd-date-picker.js +30 -2
  16. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +30 -2
  17. package/dist/collection/components/sd-field/sd-field.config.js +5 -0
  18. package/dist/collection/components/sd-field/sd-field.css +4 -0
  19. package/dist/collection/components/sd-field/sd-field.js +39 -5
  20. package/dist/collection/components/sd-file-picker/sd-file-picker.js +29 -1
  21. package/dist/collection/components/sd-input/sd-input.js +30 -2
  22. package/dist/collection/components/sd-number-input/sd-number-input.js +31 -3
  23. package/dist/collection/components/sd-select/sd-select.js +29 -1
  24. package/dist/collection/components/sd-select-group/sd-select-group.js +29 -1
  25. package/dist/collection/components/sd-select-v2/sd-select-v2.js +31 -3
  26. package/dist/collection/components/sd-textarea/sd-textarea.js +29 -1
  27. package/dist/components/{p-BPXQ6DXz.js → p-BJshZele.js} +1 -1
  28. package/dist/components/p-CEnwrYaY.js +1 -0
  29. package/dist/components/p-D99-lhhk.js +1 -0
  30. package/dist/components/{p-CEeNVTzW.js → p-DoSEK0_q.js} +1 -1
  31. package/dist/components/p-DukibDDA.js +1 -0
  32. package/dist/components/sd-barcode-input.js +1 -1
  33. package/dist/components/sd-date-picker.js +1 -1
  34. package/dist/components/sd-date-range-picker.js +1 -1
  35. package/dist/components/sd-field.js +1 -1
  36. package/dist/components/sd-file-picker.js +1 -1
  37. package/dist/components/sd-input.js +1 -1
  38. package/dist/components/sd-number-input.js +1 -1
  39. package/dist/components/sd-select-dropdown.js +1 -1
  40. package/dist/components/sd-select-group.js +1 -1
  41. package/dist/components/sd-select-multiple-group.js +1 -1
  42. package/dist/components/sd-select-multiple.js +1 -1
  43. package/dist/components/sd-select-search-input.js +1 -1
  44. package/dist/components/sd-select-v2.js +1 -1
  45. package/dist/components/sd-select.js +1 -1
  46. package/dist/components/sd-table.js +1 -1
  47. package/dist/components/sd-textarea.js +1 -1
  48. package/dist/design-system/design-system.esm.js +1 -1
  49. package/dist/design-system/p-06080355.entry.js +1 -0
  50. package/dist/design-system/p-1389a68e.entry.js +1 -0
  51. package/dist/design-system/p-5442b4b4.entry.js +1 -0
  52. package/dist/design-system/p-609b3748.entry.js +1 -0
  53. package/dist/design-system/p-71897864.entry.js +1 -0
  54. package/dist/design-system/p-731429da.entry.js +1 -0
  55. package/dist/design-system/p-9dd7befe.entry.js +1 -0
  56. package/dist/design-system/{p-ebc72b3f.entry.js → p-a7ef7465.entry.js} +1 -1
  57. package/dist/design-system/p-ac9f7551.entry.js +1 -0
  58. package/dist/design-system/p-b3d959b0.entry.js +1 -0
  59. package/dist/design-system/p-d668fd71.entry.js +1 -0
  60. package/dist/esm/design-system.js +1 -1
  61. package/dist/esm/loader.js +1 -1
  62. package/dist/esm/sd-barcode-input.entry.js +2 -1
  63. package/dist/esm/sd-button_4.entry.js +17 -5
  64. package/dist/esm/sd-date-picker.entry.js +3 -2
  65. package/dist/esm/sd-date-range-picker.entry.js +3 -2
  66. package/dist/esm/sd-file-picker.entry.js +2 -1
  67. package/dist/esm/sd-input_2.entry.js +3 -2
  68. package/dist/esm/sd-number-input.entry.js +4 -3
  69. package/dist/esm/sd-pagination_2.entry.js +4 -3
  70. package/dist/esm/sd-select-group.entry.js +2 -1
  71. package/dist/esm/sd-select.entry.js +2 -1
  72. package/dist/esm/sd-textarea.entry.js +2 -1
  73. package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +2 -0
  74. package/dist/types/components/sd-date-picker/sd-date-picker.d.ts +2 -0
  75. package/dist/types/components/sd-date-range-picker/sd-date-range-picker.d.ts +2 -0
  76. package/dist/types/components/sd-field/sd-field.config.d.ts +2 -0
  77. package/dist/types/components/sd-field/sd-field.d.ts +2 -1
  78. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +2 -0
  79. package/dist/types/components/sd-input/sd-input.d.ts +2 -0
  80. package/dist/types/components/sd-number-input/sd-number-input.d.ts +2 -0
  81. package/dist/types/components/sd-select/sd-select.d.ts +2 -0
  82. package/dist/types/components/sd-select-group/sd-select-group.d.ts +2 -0
  83. package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +2 -0
  84. package/dist/types/components/sd-textarea/sd-textarea.d.ts +2 -0
  85. package/dist/types/components.d.ts +101 -2
  86. package/hydrate/index.js +55 -22
  87. package/hydrate/index.mjs +55 -22
  88. package/package.json +1 -1
  89. package/dist/components/p-DQLyH3dr.js +0 -1
  90. package/dist/components/p-DWW5xr6r.js +0 -1
  91. package/dist/components/p-N_EbEY8s.js +0 -1
  92. package/dist/design-system/p-07736d67.entry.js +0 -1
  93. package/dist/design-system/p-0c98676e.entry.js +0 -1
  94. package/dist/design-system/p-16eae7ae.entry.js +0 -1
  95. package/dist/design-system/p-23ff6bee.entry.js +0 -1
  96. package/dist/design-system/p-2a663b3b.entry.js +0 -1
  97. package/dist/design-system/p-33713805.entry.js +0 -1
  98. package/dist/design-system/p-6ca6dfaf.entry.js +0 -1
  99. package/dist/design-system/p-8281dc36.entry.js +0 -1
  100. package/dist/design-system/p-ca6b4d4a.entry.js +0 -1
  101. package/dist/design-system/p-e1b307ee.entry.js +0 -1
@@ -25,6 +25,7 @@ export class SdSelectGroup extends BaseDropdownEvent {
25
25
  label = '';
26
26
  labelWidth = '';
27
27
  addonLabel = '';
28
+ addonAlign = 'start';
28
29
  icon = undefined;
29
30
  labelTooltip = '';
30
31
  labelTooltipProps = null;
@@ -271,7 +272,7 @@ export class SdSelectGroup extends BaseDropdownEvent {
271
272
  });
272
273
  }
273
274
  render() {
274
- return (h("sd-field", { key: 'c3d2a4365ba2594d3e0dca138ff63a335171125c', label: this.label, labelWidth: this.labelWidth, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: 'b527250fecc69b8f5d4c88aa3f6090c2b291efc9', class: {
275
+ return (h("sd-field", { key: '698b76ed0785f475a099fac99e3564b20c252c01', label: this.label, labelWidth: this.labelWidth, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, addonAlign: this.addonAlign, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: 'aa449fda5e32d0519792dc2e713d3c59658c86fa', class: {
275
276
  'sd-select-group': true,
276
277
  'sd-select-group--open': this.isOpen,
277
278
  'sd-select-group--disabled': this.disabled,
@@ -584,6 +585,33 @@ export class SdSelectGroup extends BaseDropdownEvent {
584
585
  "attribute": "addon-label",
585
586
  "defaultValue": "''"
586
587
  },
588
+ "addonAlign": {
589
+ "type": "string",
590
+ "mutable": false,
591
+ "complexType": {
592
+ "original": "FieldAddonAlign",
593
+ "resolved": "\"center\" | \"end\" | \"start\"",
594
+ "references": {
595
+ "FieldAddonAlign": {
596
+ "location": "import",
597
+ "path": "../sd-field/sd-field.config",
598
+ "id": "src/components/sd-field/sd-field.config.ts::FieldAddonAlign",
599
+ "referenceLocation": "FieldAddonAlign"
600
+ }
601
+ }
602
+ },
603
+ "required": false,
604
+ "optional": false,
605
+ "docs": {
606
+ "tags": [],
607
+ "text": ""
608
+ },
609
+ "getter": false,
610
+ "setter": false,
611
+ "reflect": false,
612
+ "attribute": "addon-align",
613
+ "defaultValue": "'start'"
614
+ },
587
615
  "icon": {
588
616
  "type": "unknown",
589
617
  "mutable": false,
@@ -15,6 +15,7 @@ export class SdSelectV2 {
15
15
  label = '';
16
16
  labelWidth = '';
17
17
  addonLabel = '';
18
+ addonAlign = 'start';
18
19
  error = false;
19
20
  hint = '';
20
21
  errorMessage = '';
@@ -207,13 +208,13 @@ export class SdSelectV2 {
207
208
  this.closeDropdown();
208
209
  },
209
210
  };
210
- return (h("sd-field", { key: 'ffca1287cefaeedf867a6b86a752942a1c8d1703', 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: () => {
211
+ return (h("sd-field", { key: '6074cfea700e1f3ea03aaedb0146d7dffdaa7101', name: this.fieldName || this.internalName, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
211
212
  this.hovered = true;
212
213
  }, onMouseLeave: () => {
213
214
  this.hovered = false;
214
- } }, h("div", { key: 'f53f38543b165040eb48236e2a25e43b78444350', class: "sd-select-v2", ref: el => {
215
+ } }, h("div", { key: '4840cfcf19e262903110245f88b73f3f03713624', class: "sd-select-v2", ref: el => {
215
216
  this.triggerRef = el;
216
- } }, h("sd-select-v2-trigger", { key: 'afd60ef0b492d9179318a5187565b45a58ef1ed5', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: 'e482c1fffc24e893fe1c04f136a116bac6c1b2e9', ...portalProps }, h("sd-select-v2-listbox", { key: 'c864fdef604eee7cea7c946de970e78b59e8b0da', name: this.name, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
217
+ } }, h("sd-select-v2-trigger", { key: '4b34dd8007864623d17c80b4e5cea02aa4db954a', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '7ec2c4ca8e32f877a894f9f766d3558c10d66596', ...portalProps }, h("sd-select-v2-listbox", { key: 'c804a19a142d2978d8fb4eaa33ad2a6a7028e7d3', name: this.name, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
217
218
  }
218
219
  static get is() { return "sd-select-v2"; }
219
220
  static get originalStyleUrls() {
@@ -447,6 +448,33 @@ export class SdSelectV2 {
447
448
  "attribute": "addon-label",
448
449
  "defaultValue": "''"
449
450
  },
451
+ "addonAlign": {
452
+ "type": "string",
453
+ "mutable": false,
454
+ "complexType": {
455
+ "original": "FieldAddonAlign",
456
+ "resolved": "\"center\" | \"end\" | \"start\"",
457
+ "references": {
458
+ "FieldAddonAlign": {
459
+ "location": "import",
460
+ "path": "../sd-field/sd-field.config",
461
+ "id": "src/components/sd-field/sd-field.config.ts::FieldAddonAlign",
462
+ "referenceLocation": "FieldAddonAlign"
463
+ }
464
+ }
465
+ },
466
+ "required": false,
467
+ "optional": false,
468
+ "docs": {
469
+ "tags": [],
470
+ "text": ""
471
+ },
472
+ "getter": false,
473
+ "setter": false,
474
+ "reflect": false,
475
+ "attribute": "addon-align",
476
+ "defaultValue": "'start'"
477
+ },
450
478
  "error": {
451
479
  "type": "boolean",
452
480
  "mutable": true,
@@ -18,6 +18,7 @@ export class SdTextarea {
18
18
  label = '';
19
19
  labelWidth = '';
20
20
  addonLabel = '';
21
+ addonAlign = 'start';
21
22
  hint = '';
22
23
  errorMessage = '';
23
24
  icon = undefined;
@@ -104,7 +105,7 @@ export class SdTextarea {
104
105
  '--sd-system-size-field-sm-height': 'auto',
105
106
  '--sd-system-radius-field-sm': `${TEXTAREA_TOKENS.radius}px`,
106
107
  };
107
- return (h("sd-field", { key: '4c93d887429d6790d2d49c951be64e4be1496fd4', 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, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: 'b64aa1b2f02c1f68db57e5e36e0a7146257629e1', class: "sd-textarea__content" }, h("textarea", { key: 'b2baff1d99b9c2347f0b0bb751fc51268d2c48c7', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, autofocus: this.autoFocus, maxLength: this.maxLength, rows: this.rows, spellcheck: this.spellcheck, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.textareaStyle }))));
108
+ return (h("sd-field", { key: '9f456eb1b18d0d83fb40f0b6b66125d587bcb4c6', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: 'f201962ed64908c97d24923b62e97c33b356170a', class: "sd-textarea__content" }, h("textarea", { key: '826e4b3c4743dbf16387b68317bd09ca7c75746d', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, autofocus: this.autoFocus, maxLength: this.maxLength, rows: this.rows, spellcheck: this.spellcheck, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.textareaStyle }))));
108
109
  }
109
110
  static get is() { return "sd-textarea"; }
110
111
  static get originalStyleUrls() {
@@ -395,6 +396,33 @@ export class SdTextarea {
395
396
  "attribute": "addon-label",
396
397
  "defaultValue": "''"
397
398
  },
399
+ "addonAlign": {
400
+ "type": "string",
401
+ "mutable": false,
402
+ "complexType": {
403
+ "original": "FieldAddonAlign",
404
+ "resolved": "\"center\" | \"end\" | \"start\"",
405
+ "references": {
406
+ "FieldAddonAlign": {
407
+ "location": "import",
408
+ "path": "../sd-field/sd-field.config",
409
+ "id": "src/components/sd-field/sd-field.config.ts::FieldAddonAlign",
410
+ "referenceLocation": "FieldAddonAlign"
411
+ }
412
+ }
413
+ },
414
+ "required": false,
415
+ "optional": false,
416
+ "docs": {
417
+ "tags": [],
418
+ "text": ""
419
+ },
420
+ "getter": false,
421
+ "setter": false,
422
+ "reflect": false,
423
+ "attribute": "addon-align",
424
+ "defaultValue": "'start'"
425
+ },
398
426
  "hint": {
399
427
  "type": "string",
400
428
  "mutable": false,
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as o,t as i}from"./p-C0VkfKIA.js";import{d}from"./p-Csfk-CtX.js";import{d as n}from"./p-D6C4-apu.js";import{d as r}from"./p-DWW5xr6r.js";import{d as c}from"./p-Diis5oCN.js";import{d as a}from"./p-D21iKAp7.js";import{d as h}from"./p-YgnF5oje.js";import{d as l}from"./p-N_EbEY8s.js";import{d as p}from"./p-CsVPC3FD.js";import{d as m}from"./p-CEeNVTzW.js";import{d as u}from"./p-z9MoRjYX.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"),c=r?r.offsetHeight:0,a=d+n;o<d+c?s.scrollTo({top:o-c,behavior:e}):o+i>a&&s.scrollTo({top:o+i-n+c,behavior:e})}handleDropdownScroll=t=>{this.isScrolled=t.target.scrollTop>0};render(){return o("div",{key:"4d593edbf6e4480e171963aad54ceb2f489f189b",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:"ecea9b4ba816c6b0dcc8303f957f4b297251f65c",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))||c();break;case"sd-ghost-button":customElements.get(i(t))||a();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-C0VkfKIA.js";import{d}from"./p-Csfk-CtX.js";import{d as n}from"./p-D6C4-apu.js";import{d as r}from"./p-D99-lhhk.js";import{d as a}from"./p-Diis5oCN.js";import{d as c}from"./p-D21iKAp7.js";import{d as h}from"./p-YgnF5oje.js";import{d as l}from"./p-CEnwrYaY.js";import{d as p}from"./p-CsVPC3FD.js";import{d as m}from"./p-DoSEK0_q.js";import{d as u}from"./p-z9MoRjYX.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:"4d593edbf6e4480e171963aad54ceb2f489f189b",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:"ecea9b4ba816c6b0dcc8303f957f4b297251f65c",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}
@@ -0,0 +1 @@
1
+ import{p as t,H as s,c as i,h as e,t as n}from"./p-C0VkfKIA.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-ByhWX2NK.js";import{d as l}from"./p-Csfk-CtX.js";import{d}from"./p-D99-lhhk.js";import{d as r}from"./p-Diis5oCN.js";import{d as h}from"./p-D21iKAp7.js";import{d as u}from"./p-YgnF5oje.js";import{d as p}from"./p-z9MoRjYX.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="";addonAlign="start";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:"3b607f0075786647d48ce470d40745e4d5fdcdc1",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-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:"02902d50bbc3275860e814a5d354e83eeed72373",class:"sd-input__content"},e("slot",{key:"4fb6e53a98853c67e847cdd38b8ddbb606e3f0a1",name:"prefix"}),e("input",{key:"291841a908b8502790f09833f1a30dc56f24ff52",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:"13e21f184a9dcee81a1b6d3c11b9137a0ac7203e",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&e("sd-ghost-button",{key:"4e708928b8465d6e8d5c1b6f4a983a9d8c1c8784",icon:"close",ariaLabel:"clear",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:"cc87104d0c9ef69659041fe233b3e432b62ed0b8",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"],addonAlign:[1,"addon-align"],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))||h();break;case"sd-icon":customElements.get(n(t))||u();break;case"sd-tooltip":customElements.get(n(t))||p()}}))}export{g as S,_ as d}
@@ -0,0 +1 @@
1
+ import{p as e,H as d,h as s,t as i}from"./p-C0VkfKIA.js";import{d as t}from"./p-Csfk-CtX.js";import{d as l}from"./p-Diis5oCN.js";import{d as o}from"./p-YgnF5oje.js";import{d as r}from"./p-z9MoRjYX.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:"14",lineHeight:"24"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f={start:"flex-start",center:"center",end:"flex-end"},h=a.sm,p=a.md,c={sm:{height:h.height,gap:h.gap,icon:h.icon,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:p.height,gap:p.gap,icon:p.icon,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight}},b=["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"],g=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="";addonAlign="start";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.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 b){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 c?this.size:"sm",i=c[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}:{}}:{},o=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`,"--sd-field-addon-justify":f[this.addonAlign]??f.start,...this.labelWidth?{"--sd-field-addon-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{};return s("div",{key:"967c6e44e514001350f0ca7eedf97e12ec8bac89",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...t,...l,...o}},s("div",{key:"238c06bb4ea963c5e7b1ee31dfc7f4b7f4b88af1",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"2144211ec7096b3a36dab1bd494b633604fe942b",class:"sd-field__main",style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"8f5e0e010b5fe4ec60c6cae29a9a4510ba0f34a5",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e}},e&&s("div",{key:"853c73197999da0f753335a06e38aa850d0e9230",class:"sd-field__addon"},e),s("slot",{key:"7e6d1d965d83df16e6294d259d1e25b2fab864cd"})),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(c[this.size in c?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;justify-content:var(--sd-field-addon-justify, flex-start);white-space:nowrap;box-sizing:border-box;flex-shrink:0;width:var(--sd-field-addon-width, auto);padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled) .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"],addonAlign:[1,"addon-align"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function u(){"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),g);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))||o();break;case"sd-tooltip":customElements.get(i(e))||r()}}))}export{g as S,u as d}
@@ -1 +1 @@
1
- import{p as s,H as e,c as t,h as c,t as o}from"./p-C0VkfKIA.js";import{d as i}from"./p-Csfk-CtX.js";import{d as a}from"./p-DWW5xr6r.js";import{d as r}from"./p-Diis5oCN.js";import{d}from"./p-D21iKAp7.js";import{d as n}from"./p-YgnF5oje.js";import{d as l}from"./p-N_EbEY8s.js";import{d as p}from"./p-z9MoRjYX.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:"2629fd8c13f67bc89c3b66f5f8aa14f2fb2e5fcd",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"f49cccdb49d0b2b861b0836dd654b7ab353b48ce",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:"773f5638821c73c20435f747c3dea5b6684b89eb",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(o(s))||customElements.define(o(s),u);break;case"sd-button":customElements.get(o(s))||i();break;case"sd-field":customElements.get(o(s))||a();break;case"sd-floating-portal":customElements.get(o(s))||r();break;case"sd-ghost-button":customElements.get(o(s))||d();break;case"sd-icon":customElements.get(o(s))||n();break;case"sd-input":customElements.get(o(s))||l();break;case"sd-tooltip":customElements.get(o(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 o}from"./p-C0VkfKIA.js";import{d as a}from"./p-Csfk-CtX.js";import{d as i}from"./p-D99-lhhk.js";import{d as r}from"./p-Diis5oCN.js";import{d as n}from"./p-D21iKAp7.js";import{d}from"./p-YgnF5oje.js";import{d as l}from"./p-CEnwrYaY.js";import{d as p}from"./p-z9MoRjYX.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:"2629fd8c13f67bc89c3b66f5f8aa14f2fb2e5fcd",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"f49cccdb49d0b2b861b0836dd654b7ab353b48ce",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:"773f5638821c73c20435f747c3dea5b6684b89eb",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(o(s))||customElements.define(o(s),u);break;case"sd-button":customElements.get(o(s))||a();break;case"sd-field":customElements.get(o(s))||i();break;case"sd-floating-portal":customElements.get(o(s))||r();break;case"sd-ghost-button":customElements.get(o(s))||n();break;case"sd-icon":customElements.get(o(s))||d();break;case"sd-input":customElements.get(o(s))||l();break;case"sd-tooltip":customElements.get(o(s))||p()}}))}export{u as S,h as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as e,c as s,h as i,t as o}from"./p-C0VkfKIA.js";import{n as a}from"./p-CCwNgVmC.js";import{d as r}from"./p-Csfk-CtX.js";import{d as l}from"./p-D6C4-apu.js";import{d}from"./p-D99-lhhk.js";import{d as h}from"./p-Diis5oCN.js";import{d as n}from"./p-YgnF5oje.js";import{d as c}from"./p-DIro-Wat.js";import{d as p}from"./p-BBluw-CU.js";import{d as m}from"./p-COM91Bya.js";import{d as u}from"./p-D_lyw4rN.js";import{d as f}from"./p-CsPyZohK.js";import{d as b}from"./p-z9MoRjYX.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="";addonAlign="start";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=a();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),a=this.parsePixelValue(this.maxDropdownWidth,640),r=Math.max(window.innerHeight-e.bottom-s-i,0),l=Math.max(e.top-s-i,0),d=Math.max(r,l),h=Math.max(window.innerWidth-2*s,0);this.resolvedDropdownHeight=`${Math.min(o,d)}px`,this.resolvedMaxDropdownWidth=`${Math.min(a,h)}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:"6074cfea700e1f3ea03aaedb0146d7dffdaa7101",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"4840cfcf19e262903110245f88b73f3f03713624",class:"sd-select-v2",ref:t=>{this.triggerRef=t}},i("sd-select-v2-trigger",{key:"4b34dd8007864623d17c80b4e5cea02aa4db954a",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"7ec2c4ca8e32f877a894f9f766d3558c10d66596",...e},i("sd-select-v2-listbox",{key:"c804a19a142d2978d8fb4eaa33ad2a6a7028e7d3",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"],addonAlign:[1,"addon-align"],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))||r();break;case"sd-checkbox":customElements.get(o(t))||l();break;case"sd-field":customElements.get(o(t))||d();break;case"sd-floating-portal":customElements.get(o(t))||h();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 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as a}from"./p-C0VkfKIA.js";import{n as o}from"./p-CCwNgVmC.js";import{i as n}from"./p-ByhWX2NK.js";import{d}from"./p-Csfk-CtX.js";import{d as l}from"./p-DWW5xr6r.js";import{d as r}from"./p-Diis5oCN.js";import{d as c}from"./p-D21iKAp7.js";import{d as u}from"./p-YgnF5oje.js";import{d as h}from"./p-z9MoRjYX.js";const p=n.textinput.sm,b=n.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:n.textinput.bg,text:n.textinput.text,icon:n.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:"11079233784a85ec20bae4653155a9820d878681",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:"592fcb675607d57d7372abac967eb1c1a1e27212",class:"sd-barcode-input__content"},i("slot",{key:"a035ed3825360f81e669c3ef9099a479bbb69fd0",name:"prefix"}),i("input",{key:"7ffffa2b085050d05d1439cac1c90901144da410",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:"cc9a0e5b0b367c5c443bfe132408d834d74c16b3",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"a5a06ef58a7f38ffbafb56038ff8321e66184da5",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}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))||d();break;case"sd-field":customElements.get(a(t))||l();break;case"sd-floating-portal":customElements.get(a(t))||r();break;case"sd-ghost-button":customElements.get(a(t))||c();break;case"sd-icon":customElements.get(a(t))||u();break;case"sd-tooltip":customElements.get(a(t))||h()}}))};export{v as SdBarcodeInput,x as defineCustomElement}
1
+ import{p as t,H as e,c as s,h as i,t as o}from"./p-C0VkfKIA.js";import{n as a}from"./p-CCwNgVmC.js";import{i as n}from"./p-ByhWX2NK.js";import{d}from"./p-Csfk-CtX.js";import{d as l}from"./p-D99-lhhk.js";import{d as r}from"./p-Diis5oCN.js";import{d as c}from"./p-D21iKAp7.js";import{d as u}from"./p-YgnF5oje.js";import{d as h}from"./p-z9MoRjYX.js";const p=n.textinput.sm,b=n.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}},g={bg:n.textinput.bg,text:n.textinput.text,icon:n.textinput.icon},m=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="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=a();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){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:"876c4e2cd41e62cd5486b7dec5ca1b34d10704b9",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":g.text.default,"--sd-barcode-input-placeholder-color":g.text.placeholder,"--sd-barcode-input-disabled-color":g.text.disabled,"--sd-barcode-input-icon-color":g.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":g.bg.barcode}},i("label",{key:"e01920c2565e1f4487ccd516f864b9f68fa0cfd8",class:"sd-barcode-input__content"},i("slot",{key:"d7be8745d6b0f510a11c88e1ca629f78fbc77348",name:"prefix"}),i("input",{key:"f214f2930fc54a0466a10ce295e46885352e0e88",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:"a226a2c7ec43951ab9f048f8da25542784233e65",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"ff7f8853b43401f3bf4be051e69d8c459ca418aa",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}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"],addonAlign:[1,"addon-align"],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=m,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(o(t))||customElements.define(o(t),m);break;case"sd-button":customElements.get(o(t))||d();break;case"sd-field":customElements.get(o(t))||l();break;case"sd-floating-portal":customElements.get(o(t))||r();break;case"sd-ghost-button":customElements.get(o(t))||c();break;case"sd-icon":customElements.get(o(t))||u();break;case"sd-tooltip":customElements.get(o(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-C0VkfKIA.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as o}from"./p-bYCOh35g.js";import{d as l}from"./p-Csfk-CtX.js";import{d as h}from"./p-DlkxQ9Jn.js";import{d as n}from"./p-DPCj-bFr.js";import{d as c}from"./p-DWW5xr6r.js";import{d as p}from"./p-Diis5oCN.js";import{d as m}from"./p-D21iKAp7.js";import{d as f}from"./p-YgnF5oje.js";import{d as b}from"./p-DIro-Wat.js";import{d as u}from"./p-z9MoRjYX.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=o[this.size]??o.md;return i("sd-field",{key:"1a84754cdc67bd6603e1fb48479f9d3ac6424d6a",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:"e4d8e05b04ac7bd4f2f96809b33d67125fe7c6d8",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"244924af2c3ea207b2a90c5aef5064755da3ae52",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"f3d882d3450f629b6ed501b984d89ffd9633531f",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"a0f47851a27dd777f77da40f3258638a0fbc37a5",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))||l();break;case"sd-date-picker-calendar":customElements.get(a(e))||h();break;case"sd-date-picker-trigger":customElements.get(a(e))||n();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))||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-C0VkfKIA.js";import{n as d}from"./p-CCwNgVmC.js";import{D as o,a as r}from"./p-bYCOh35g.js";import{d as l}from"./p-Csfk-CtX.js";import{d as n}from"./p-DlkxQ9Jn.js";import{d as h}from"./p-DPCj-bFr.js";import{d as c}from"./p-D99-lhhk.js";import{d as p}from"./p-Diis5oCN.js";import{d as m}from"./p-D21iKAp7.js";import{d as b}from"./p-YgnF5oje.js";import{d as f}from"./p-DIro-Wat.js";import{d as u}from"./p-z9MoRjYX.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="";addonAlign="start";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=r[this.size]??r.md;return i("sd-field",{key:"1e0bdacf53850916778544e63ce11d5aab06eafc",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":o.border.default,"--sd-system-color-field-border-focus":o.border.focus,"--sd-system-color-field-bg-default":o.bg.default}},i("div",{key:"63795f75a1b3723c2af166343dce5fd33afd5be2",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"adea2cbad36285f546d3c29b66f2c74044427736",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"4da6ec2a3644201b6579fc2e9838d03ef22b7e57",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"4b7e3757b7232110ec9865346fcd68868ac68081",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"],addonAlign:[1,"addon-align"],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))||l();break;case"sd-date-picker-calendar":customElements.get(a(e))||n();break;case"sd-date-picker-trigger":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))||f();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-C0VkfKIA.js";import{n as r}from"./p-CCwNgVmC.js";import{D as d,a as o}from"./p-bYCOh35g.js";import{d as l}from"./p-Csfk-CtX.js";import{d as n}from"./p-DPCj-bFr.js";import{d as h}from"./p-CtrDZYN5.js";import{d as c}from"./p-DWW5xr6r.js";import{d as p}from"./p-Diis5oCN.js";import{d as m}from"./p-D21iKAp7.js";import{d as b}from"./p-YgnF5oje.js";import{d as u}from"./p-DIro-Wat.js";import{d as g}from"./p-z9MoRjYX.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=r();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=o[this.size]??o.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":d.border.default,"--sd-system-color-field-border-focus":d.border.focus,"--sd-system-color-field-bg-default":d.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))||l();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-C0VkfKIA.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as o}from"./p-bYCOh35g.js";import{d as l}from"./p-Csfk-CtX.js";import{d as n}from"./p-DPCj-bFr.js";import{d as h}from"./p-CtrDZYN5.js";import{d as c}from"./p-D99-lhhk.js";import{d as p}from"./p-Diis5oCN.js";import{d as m}from"./p-D21iKAp7.js";import{d as g}from"./p-YgnF5oje.js";import{d as f}from"./p-DIro-Wat.js";import{d as u}from"./p-z9MoRjYX.js";const b=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="";addonAlign="start";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=o[this.size]??o.md;return i("sd-field",{key:"34c4d9ef2ba50f951fc6b6b09215e750ac61cd87",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"c92ab61d144c893077a9c81922ac24eff93314dd",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"487b8a1af6e8dee063d70ffc030c314037741d74",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"f22c979943cebcc82e8d4d9f86037621e8c3983a",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-range-picker-calendar",{key:"c19548d0074556f90c740b6ba35338ea4d41dd18",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"],addonAlign:[1,"addon-align"],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=b,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),b);break;case"sd-button":customElements.get(a(e))||l();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))||g();break;case"sd-portal":customElements.get(a(e))||f();break;case"sd-tooltip":customElements.get(a(e))||u()}}))};export{k as SdDateRangePicker,y as defineCustomElement}
@@ -1 +1 @@
1
- import{S as r,d as o}from"./p-DWW5xr6r.js";const s=r,p=o;export{s as SdField,p as defineCustomElement}
1
+ import{S as o,d as s}from"./p-D99-lhhk.js";const p=o,r=s;export{p as SdField,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as i,c as t,h as s,t as l}from"./p-C0VkfKIA.js";import{d as r}from"./p-Csfk-CtX.js";import{d as o}from"./p-DWW5xr6r.js";import{d as a}from"./p-Diis5oCN.js";import{d}from"./p-D21iKAp7.js";import{d as n}from"./p-YgnF5oje.js";import{d as c}from"./p-z9MoRjYX.js";var p={height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},size:{icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const h={height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight,iconSize:p.size.icon},f={text:p.text,icon:{default:"#888888",disabled:p.icon.disabled}},u=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.reject=t(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdReset())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e){const i=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),s=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=s&&e.length>s)return{accepted:[],rejected:e,reason:"max-files"};if(null!=i){const t=e.filter((e=>e.size>i));if(t.length>0)return{accepted:[],rejected:t,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const t=Array.from(i),{accepted:s,rejected:l,reason:r}=this.validateFiles(t);if(r)return this.reject?.emit({files:l,reason:r}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=this.multiple?s:s[0],this.value=this.internalValue,this.update?.emit(this.value)};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}getDisplayText(){return this.hasFiles()?Array.isArray(this.internalValue)?this.internalValue.map((e=>e.name)).join(", "):this.internalValue?.name||this.placeholder:this.placeholder}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?f.icon.disabled:f.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),t={"--sd-file-picker-font-size":h.fontSize+"px","--sd-file-picker-line-height":h.lineHeight+"px","--sd-file-picker-font-weight":h.fontWeight,"--sd-file-picker-padding-x":h.paddingX+"px","--sd-file-picker-gap":h.gap+"px","--sd-file-picker-text-color":f.text.default,"--sd-file-picker-placeholder-color":f.text.placeholder,"--sd-file-picker-disabled-color":f.text.disabled,"--sd-system-size-field-sm-height":h.height+"px","--sd-system-radius-field-sm":h.radius+"px"},l=s("div",{class:"sd-file-picker__content",onClick:this.handleClick},s("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder}),s("sd-icon",{name:"attachFile",size:Number(h.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),s("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&s("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&s("div",{class:"sd-file-picker__tooltip"},i));return this.inline?s("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l):s("sd-field",{name:this.name,label:this.label,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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:t},l)}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:inline-flex;width:100%}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]),k=u,m=function(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),u);break;case"sd-button":customElements.get(l(e))||r();break;case"sd-field":customElements.get(l(e))||o();break;case"sd-floating-portal":customElements.get(l(e))||a();break;case"sd-ghost-button":customElements.get(l(e))||d();break;case"sd-icon":customElements.get(l(e))||n();break;case"sd-tooltip":customElements.get(l(e))||c()}}))};export{k as SdFilePicker,m as defineCustomElement}
1
+ import{p as e,H as i,c as t,h as s,t as l}from"./p-C0VkfKIA.js";import{d as r}from"./p-Csfk-CtX.js";import{d as o}from"./p-D99-lhhk.js";import{d as a}from"./p-Diis5oCN.js";import{d}from"./p-D21iKAp7.js";import{d as n}from"./p-YgnF5oje.js";import{d as c}from"./p-z9MoRjYX.js";var p={height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},size:{icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const h={height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight,iconSize:p.size.icon},f={text:p.text,icon:{default:"#888888",disabled:p.icon.disabled}},u=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.reject=t(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdReset())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e){const i=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),s=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=s&&e.length>s)return{accepted:[],rejected:e,reason:"max-files"};if(null!=i){const t=e.filter((e=>e.size>i));if(t.length>0)return{accepted:[],rejected:t,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const t=Array.from(i),{accepted:s,rejected:l,reason:r}=this.validateFiles(t);if(r)return this.reject?.emit({files:l,reason:r}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=this.multiple?s:s[0],this.value=this.internalValue,this.update?.emit(this.value)};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}getDisplayText(){return this.hasFiles()?Array.isArray(this.internalValue)?this.internalValue.map((e=>e.name)).join(", "):this.internalValue?.name||this.placeholder:this.placeholder}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?f.icon.disabled:f.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),t={"--sd-file-picker-font-size":h.fontSize+"px","--sd-file-picker-line-height":h.lineHeight+"px","--sd-file-picker-font-weight":h.fontWeight,"--sd-file-picker-padding-x":h.paddingX+"px","--sd-file-picker-gap":h.gap+"px","--sd-file-picker-text-color":f.text.default,"--sd-file-picker-placeholder-color":f.text.placeholder,"--sd-file-picker-disabled-color":f.text.disabled,"--sd-system-size-field-sm-height":h.height+"px","--sd-system-radius-field-sm":h.radius+"px"},l=s("div",{class:"sd-file-picker__content",onClick:this.handleClick},s("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder}),s("sd-icon",{name:"attachFile",size:Number(h.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),s("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&s("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&s("div",{class:"sd-file-picker__tooltip"},i));return this.inline?s("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l):s("sd-field",{name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:t},l)}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:inline-flex;width:100%}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]),k=u,m=function(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),u);break;case"sd-button":customElements.get(l(e))||r();break;case"sd-field":customElements.get(l(e))||o();break;case"sd-floating-portal":customElements.get(l(e))||a();break;case"sd-ghost-button":customElements.get(l(e))||d();break;case"sd-icon":customElements.get(l(e))||n();break;case"sd-tooltip":customElements.get(l(e))||c()}}))};export{k as SdFilePicker,m as defineCustomElement}
@@ -1 +1 @@
1
- import{S as s,d as o}from"./p-N_EbEY8s.js";const p=s,r=o;export{p as SdInput,r as defineCustomElement}
1
+ import{S as o,d as r}from"./p-CEnwrYaY.js";const s=o,a=r;export{s as SdInput,a as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as n}from"./p-C0VkfKIA.js";import{n as r}from"./p-CCwNgVmC.js";import{d}from"./p-Csfk-CtX.js";import{d as u}from"./p-DWW5xr6r.js";import{d as a}from"./p-Diis5oCN.js";import{d as o}from"./p-YgnF5oje.js";import{d as l}from"./p-z9MoRjYX.js";var h={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"16",lineHeight:"26"}},contents:{gap:"4"},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},hint:{color:"#555555",typography:{fontSize:"12",lineHeight:"20"}},errorMessage:{color:"#E30000",typography:{fontSize:"12",lineHeight:"20"}},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const p=h.numberInput.sm,c=h.numberInput.md,b={sm:{height:p.height,paddingX:p.paddingX,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight},md:{height:c.height,paddingX:c.paddingX,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight}},m={border:h.numberInput.border,bg:h.numberInput.bg,text:h.numberInput.text},f={sm:{size:h.numberInput.stepper.sm.size},md:{size:h.numberInput.stepper.md.size},radius:h.numberInput.stepper.radius,bg:h.numberInput.stepper.bg,icon:h.numberInput.stepper.icon},g=h.numberInput.hint,y=h.numberInput.errorMessage,x=h.numberInput.contents.gap,_=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}size="sm";min=-1/0;max=1/0;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";addonLabel="";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=(""+s).split("."),r=(+i).toLocaleString(),d=e?"-"+r:r;return n?d+"."+n:d+""}parseInput(t){if(!t||""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=b[this.size]??b.sm,e="md"===this.size?14:12;return i("sd-field",{key:"edb2eaf473ba53fa340e39a350624e0a9e8b566e",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,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-number-input-font-size":t.fontSize+"px","--sd-number-input-line-height":t.lineHeight+"px","--sd-number-input-font-weight":t.fontWeight,"--sd-number-input-padding-x":t.paddingX+"px","--sd-number-input-text-color":m.text.default,"--sd-number-input-placeholder-color":m.text.placeholder,"--sd-number-input-disabled-color":m.text.disabled,"--sd-number-input-stepper-size":(f[this.size]?.size??f.sm.size)+"px","--sd-number-input-stepper-radius":f.radius+"px","--sd-number-input-stepper-bg":f.bg.default,"--sd-number-input-stepper-bg-disabled":f.bg.disabled,"--sd-number-input-stepper-icon-color":f.icon.default,"--sd-number-input-stepper-icon-disabled":f.icon.disabled,"--sd-system-size-field-sm-height":t.height+"px","--sd-system-radius-field-sm":t.radius+"px","--sd-system-color-field-border-default":m.border.default,"--sd-system-color-field-border-focus":m.border.focus,"--sd-system-color-field-border-danger":m.border.danger,"--sd-system-color-field-bg-default":m.bg.default,"--sd-textinput-input-text-error-message":y.color,"--sd-textinput-input-error-message-typography-font-size":y.typography.fontSize+"px","--sd-textinput-input-error-message-typography-line-height":y.typography.lineHeight+"px","--sd-textinput-input-text-hint":g.color,"--sd-textinput-input-hint-typography-font-size":g.typography.fontSize+"px","--sd-textinput-input-hint-typography-line-height":g.typography.lineHeight+"px","--sd-textinput-input-contents-gap":x+"px"}},i("div",{key:"408b984ca5c7f3edaf0afe4c56fab2901824b2de",class:"sd-number-input__content"},this.useButton&&i("button",{key:"da29f621914cbb7cac4c83f55056f52ef918f7c7",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"a60c99bd949c2791608d269bc478b490dd4335e0",name:"minus",size:e,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"3eae6cb2d277f3f830f7cb122b72cdcdedf57e10",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"19e42ab159a9df7721ca6ea5505d3a0aca2517c4",name:this.name,ref:t=>this.nativeEl=t,class:"sd-number-input__native "+this.inputClass,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&i("span",{key:"5f9dc1e294a081cede120d9466d70910a9b1d6bb",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"50d96dd2556071480b17210b8db307ab4082c92b",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"1821a77886ac9dc169c8e2697282e813a334df35",name:"add",size:e,color:this.isIncrementDisabled()?f.icon.disabled:f.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}"}},[512,"sd-number-input",{size:[1],min:[2],max:[2],step:[2],useButton:[4,"use-button"],useDecimal:[4,"use-decimal"],value:[1032],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=_,w=function(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||d();break;case"sd-field":customElements.get(n(t))||u();break;case"sd-floating-portal":customElements.get(n(t))||a();break;case"sd-icon":customElements.get(n(t))||o();break;case"sd-tooltip":customElements.get(n(t))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
1
+ import{p as t,H as e,c as s,h as i,t as n}from"./p-C0VkfKIA.js";import{n as r}from"./p-CCwNgVmC.js";import{d}from"./p-Csfk-CtX.js";import{d as u}from"./p-D99-lhhk.js";import{d as a}from"./p-Diis5oCN.js";import{d as o}from"./p-YgnF5oje.js";import{d as l}from"./p-z9MoRjYX.js";var h={numberInput:{sm:{height:"28",paddingX:"6",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"}},md:{height:"36",paddingX:"8",radius:"6",typography:{fontWeight:"400",fontSize:"16",lineHeight:"26"}},contents:{gap:"4"},border:{default:"#AAAAAA",focus:"#0075FF",danger:"#FB4444"},bg:{default:"#FFFFFF"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},hint:{color:"#555555",typography:{fontSize:"12",lineHeight:"20"}},errorMessage:{color:"#E30000",typography:{fontSize:"12",lineHeight:"20"}},stepper:{sm:{size:"20"},md:{size:"24"},radius:"4",bg:{default:"#EFF6FF",disabled:"#EEEEEE"},icon:{default:"#0075FF",disabled:"#BBBBBB"}}}};const p=h.numberInput.sm,c=h.numberInput.md,b={sm:{height:p.height,paddingX:p.paddingX,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight},md:{height:c.height,paddingX:c.paddingX,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight}},m={border:h.numberInput.border,bg:h.numberInput.bg,text:h.numberInput.text},f={sm:{size:h.numberInput.stepper.sm.size},md:{size:h.numberInput.stepper.md.size},radius:h.numberInput.stepper.radius,bg:h.numberInput.stepper.bg,icon:h.numberInput.stepper.icon},g=h.numberInput.hint,y=h.numberInput.errorMessage,x=h.numberInput.contents.gap,_=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}size="sm";min=-1/0;max=1/0;step=1;useButton=!1;useDecimal=!1;value=null;label;labelWidth="";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=(""+s).split("."),r=(+i).toLocaleString(),d=e?"-"+r:r;return n?d+"."+n:d+""}parseInput(t){if(!t||""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=b[this.size]??b.sm,e="md"===this.size?14:12;return i("sd-field",{key:"a9512622774c930c8b70b3d739a405e2434f22a7",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-number-input-font-size":t.fontSize+"px","--sd-number-input-line-height":t.lineHeight+"px","--sd-number-input-font-weight":t.fontWeight,"--sd-number-input-padding-x":t.paddingX+"px","--sd-number-input-text-color":m.text.default,"--sd-number-input-placeholder-color":m.text.placeholder,"--sd-number-input-disabled-color":m.text.disabled,"--sd-number-input-stepper-size":(f[this.size]?.size??f.sm.size)+"px","--sd-number-input-stepper-radius":f.radius+"px","--sd-number-input-stepper-bg":f.bg.default,"--sd-number-input-stepper-bg-disabled":f.bg.disabled,"--sd-number-input-stepper-icon-color":f.icon.default,"--sd-number-input-stepper-icon-disabled":f.icon.disabled,"--sd-system-size-field-sm-height":t.height+"px","--sd-system-radius-field-sm":t.radius+"px","--sd-system-color-field-border-default":m.border.default,"--sd-system-color-field-border-focus":m.border.focus,"--sd-system-color-field-border-danger":m.border.danger,"--sd-system-color-field-bg-default":m.bg.default,"--sd-textinput-input-text-error-message":y.color,"--sd-textinput-input-error-message-typography-font-size":y.typography.fontSize+"px","--sd-textinput-input-error-message-typography-line-height":y.typography.lineHeight+"px","--sd-textinput-input-text-hint":g.color,"--sd-textinput-input-hint-typography-font-size":g.typography.fontSize+"px","--sd-textinput-input-hint-typography-line-height":g.typography.lineHeight+"px","--sd-textinput-input-contents-gap":x+"px"}},i("div",{key:"f068ab7a042a97dfac7aaf160508757306dddc14",class:"sd-number-input__content"},this.useButton&&i("button",{key:"37341e813e7902f07c2731c708e1aadc53411653",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"740b2715518534b0ece5aa3b3f6dfd0dfafd6368",name:"minus",size:e,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"9b16f311a1408dfc84124ec938a98b13635f6dc6",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"572e2a8a1d7283e3568a85ba6c1bd506c3ec4453",name:this.name,ref:t=>this.nativeEl=t,class:"sd-number-input__native "+this.inputClass,type:"text",inputMode:"numeric",value:this.displayValue,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{textAlign:this.useButton?"center":"right",...this.inputStyle}}),this.inputSuffix&&i("span",{key:"13a07217ee34c793669b061c240062805a40db60",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"c3557737be6cc5dc6c5ab171bcc078cf564fb2b0",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"530cf50331768df5be16639e46ce3f7f438ffe02",name:"add",size:e,color:this.isIncrementDisabled()?f.icon.disabled:f.icon.default}))))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}"}},[512,"sd-number-input",{size:[1],min:[2],max:[2],step:[2],useButton:[4,"use-button"],useDecimal:[4,"use-decimal"],value:[1032],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=_,w=function(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||d();break;case"sd-field":customElements.get(n(t))||u();break;case"sd-floating-portal":customElements.get(n(t))||a();break;case"sd-icon":customElements.get(n(t))||o();break;case"sd-tooltip":customElements.get(n(t))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p-BPXQ6DXz.js";const p=o,r=s;export{p as SdSelectDropdown,r as defineCustomElement}
1
+ import{S as s,d as o}from"./p-BJshZele.js";const e=s,p=o;export{e as SdSelectDropdown,p as defineCustomElement}