@sellmate/design-system 1.0.63 → 1.0.64

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 (112) 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 +11 -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-multiple-group.cjs.entry.js +2 -1
  13. package/dist/cjs/sd-select-multiple.cjs.entry.js +2 -1
  14. package/dist/cjs/sd-select.cjs.entry.js +2 -1
  15. package/dist/cjs/sd-textarea.cjs.entry.js +2 -1
  16. package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +22 -1
  17. package/dist/collection/components/sd-date-picker/sd-date-picker.js +23 -2
  18. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +23 -2
  19. package/dist/collection/components/sd-field/sd-field.css +7 -0
  20. package/dist/collection/components/sd-field/sd-field.js +30 -4
  21. package/dist/collection/components/sd-file-picker/sd-file-picker.js +22 -1
  22. package/dist/collection/components/sd-input/sd-input.js +23 -2
  23. package/dist/collection/components/sd-number-input/sd-number-input.js +24 -3
  24. package/dist/collection/components/sd-select/sd-select.js +22 -1
  25. package/dist/collection/components/sd-select-group/sd-select-group.js +22 -1
  26. package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +22 -1
  27. package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js +22 -1
  28. package/dist/collection/components/sd-select-v2/sd-select-v2.js +24 -3
  29. package/dist/collection/components/sd-textarea/sd-textarea.js +22 -1
  30. package/dist/components/p-BjjrNz4C.js +1 -0
  31. package/dist/components/{p-DUqX35W_.js → p-BkUclgga.js} +1 -1
  32. package/dist/components/p-CKU8CeW3.js +1 -0
  33. package/dist/components/p-DC9KYl3L.js +1 -0
  34. package/dist/components/{p-DgYBr7xb.js → p-xmvTLf74.js} +1 -1
  35. package/dist/components/sd-barcode-input.js +1 -1
  36. package/dist/components/sd-date-picker.js +1 -1
  37. package/dist/components/sd-date-range-picker.js +1 -1
  38. package/dist/components/sd-field.js +1 -1
  39. package/dist/components/sd-file-picker.js +1 -1
  40. package/dist/components/sd-input.js +1 -1
  41. package/dist/components/sd-number-input.js +1 -1
  42. package/dist/components/sd-select-dropdown.js +1 -1
  43. package/dist/components/sd-select-group.js +1 -1
  44. package/dist/components/sd-select-multiple-group.js +1 -1
  45. package/dist/components/sd-select-multiple.js +1 -1
  46. package/dist/components/sd-select-search-input.js +1 -1
  47. package/dist/components/sd-select-v2.js +1 -1
  48. package/dist/components/sd-select.js +1 -1
  49. package/dist/components/sd-table.js +1 -1
  50. package/dist/components/sd-textarea.js +1 -1
  51. package/dist/design-system/design-system.esm.js +1 -1
  52. package/dist/design-system/p-010e4f47.entry.js +1 -0
  53. package/dist/design-system/p-2ae97b1c.entry.js +1 -0
  54. package/dist/design-system/p-6644c4a0.entry.js +1 -0
  55. package/dist/design-system/p-96b14db1.entry.js +1 -0
  56. package/dist/design-system/p-a983560d.entry.js +1 -0
  57. package/dist/design-system/p-b3279f07.entry.js +1 -0
  58. package/dist/design-system/p-b81e0493.entry.js +1 -0
  59. package/dist/design-system/p-cb65a9e4.entry.js +1 -0
  60. package/dist/design-system/p-cf1156cb.entry.js +1 -0
  61. package/dist/design-system/p-d040ec6f.entry.js +1 -0
  62. package/dist/design-system/p-d8eb17a8.entry.js +1 -0
  63. package/dist/design-system/p-ed61fe19.entry.js +1 -0
  64. package/dist/design-system/p-f3d082c8.entry.js +1 -0
  65. package/dist/esm/design-system.js +1 -1
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/sd-barcode-input.entry.js +2 -1
  68. package/dist/esm/sd-button_4.entry.js +11 -5
  69. package/dist/esm/sd-date-picker.entry.js +3 -2
  70. package/dist/esm/sd-date-range-picker.entry.js +3 -2
  71. package/dist/esm/sd-file-picker.entry.js +2 -1
  72. package/dist/esm/sd-input_2.entry.js +3 -2
  73. package/dist/esm/sd-number-input.entry.js +4 -3
  74. package/dist/esm/sd-pagination_2.entry.js +4 -3
  75. package/dist/esm/sd-select-group.entry.js +2 -1
  76. package/dist/esm/sd-select-multiple-group.entry.js +2 -1
  77. package/dist/esm/sd-select-multiple.entry.js +2 -1
  78. package/dist/esm/sd-select.entry.js +2 -1
  79. package/dist/esm/sd-textarea.entry.js +2 -1
  80. package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +1 -0
  81. package/dist/types/components/sd-date-picker/sd-date-picker.d.ts +1 -0
  82. package/dist/types/components/sd-date-range-picker/sd-date-range-picker.d.ts +1 -0
  83. package/dist/types/components/sd-field/sd-field.d.ts +1 -0
  84. package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +1 -0
  85. package/dist/types/components/sd-input/sd-input.d.ts +1 -0
  86. package/dist/types/components/sd-number-input/sd-number-input.d.ts +1 -0
  87. package/dist/types/components/sd-select/sd-select.d.ts +1 -0
  88. package/dist/types/components/sd-select-group/sd-select-group.d.ts +1 -0
  89. package/dist/types/components/sd-select-multiple/sd-select-multiple.d.ts +1 -0
  90. package/dist/types/components/sd-select-multiple-group/sd-select-multiple-group.d.ts +1 -0
  91. package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +1 -0
  92. package/dist/types/components/sd-textarea/sd-textarea.d.ts +1 -0
  93. package/dist/types/components.d.ts +117 -0
  94. package/hydrate/index.js +55 -24
  95. package/hydrate/index.mjs +55 -24
  96. package/package.json +1 -1
  97. package/dist/components/p-aC4HJHug.js +0 -1
  98. package/dist/components/p-e35Du7-7.js +0 -1
  99. package/dist/components/p-e8HA30H_.js +0 -1
  100. package/dist/design-system/p-0ca594a4.entry.js +0 -1
  101. package/dist/design-system/p-1b9e427e.entry.js +0 -1
  102. package/dist/design-system/p-1cbe4b22.entry.js +0 -1
  103. package/dist/design-system/p-656acb07.entry.js +0 -1
  104. package/dist/design-system/p-748ece8e.entry.js +0 -1
  105. package/dist/design-system/p-9af7e19a.entry.js +0 -1
  106. package/dist/design-system/p-a24c3431.entry.js +0 -1
  107. package/dist/design-system/p-c2f3470f.entry.js +0 -1
  108. package/dist/design-system/p-c98ed6ae.entry.js +0 -1
  109. package/dist/design-system/p-ca80379a.entry.js +0 -1
  110. package/dist/design-system/p-e9f24d23.entry.js +0 -1
  111. package/dist/design-system/p-ec79fefd.entry.js +0 -1
  112. package/dist/design-system/p-f3a60f61.entry.js +0 -1
@@ -26,6 +26,7 @@ export class SdSelectMultiple extends BaseDropdownEvent {
26
26
  useCheckbox = false;
27
27
  // props - label
28
28
  label = '';
29
+ labelWidth = '';
29
30
  icon = undefined;
30
31
  labelTooltip = '';
31
32
  labelTooltipProps = null;
@@ -150,7 +151,7 @@ export class SdSelectMultiple extends BaseDropdownEvent {
150
151
  this.handleOptionSelection(option);
151
152
  };
152
153
  render() {
153
- return (h("sd-field", { key: 'e372aab1dafc730f22c6d58cbd39d651e65a66dc', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, h("div", { key: 'a73dc6abd9a05f888c39d2176f72275a329ccae0', class: {
154
+ return (h("sd-field", { key: 'f5dda40563661955aa194d841ca89628afd496cb', label: this.label, labelWidth: this.labelWidth, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, h("div", { key: '81541d9adabfea7c3af1c22ed419036f56e1a353', class: {
154
155
  'sd-select-multiple': true,
155
156
  'sd-select-multiple--open': this.isOpen,
156
157
  'sd-select-multiple--disabled': this.disabled,
@@ -457,6 +458,26 @@ export class SdSelectMultiple extends BaseDropdownEvent {
457
458
  "attribute": "label",
458
459
  "defaultValue": "''"
459
460
  },
461
+ "labelWidth": {
462
+ "type": "any",
463
+ "mutable": false,
464
+ "complexType": {
465
+ "original": "string | number",
466
+ "resolved": "number | string",
467
+ "references": {}
468
+ },
469
+ "required": false,
470
+ "optional": false,
471
+ "docs": {
472
+ "tags": [],
473
+ "text": ""
474
+ },
475
+ "getter": false,
476
+ "setter": false,
477
+ "reflect": false,
478
+ "attribute": "label-width",
479
+ "defaultValue": "''"
480
+ },
460
481
  "icon": {
461
482
  "type": "unknown",
462
483
  "mutable": false,
@@ -26,6 +26,7 @@ export class SdSelectMultipleGroup extends BaseDropdownEvent {
26
26
  allCheckOptionLabel = '전체';
27
27
  // props - label
28
28
  label = '';
29
+ labelWidth = '';
29
30
  icon = undefined;
30
31
  labelTooltip = '';
31
32
  labelTooltipProps = null;
@@ -392,7 +393,7 @@ export class SdSelectMultipleGroup extends BaseDropdownEvent {
392
393
  });
393
394
  }
394
395
  render() {
395
- return (h("sd-field", { key: '3cc9e5b2f1062e216a0dd738dff6918084c5e3b4', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: '60be94c561be252d6cc822e6be60a5e31390a15f', class: {
396
+ return (h("sd-field", { key: 'e7d00571a19a83e8d243d0c4f7433d931d4a2304', label: this.label, labelWidth: this.labelWidth, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: '8c7288d853fed5bb829f1ef90af5e96a512c11b3', class: {
396
397
  'sd-select-multiple-group': true,
397
398
  'sd-select-multiple-group--open': this.isOpen,
398
399
  'sd-select-multiple-group--disabled': this.disabled,
@@ -730,6 +731,26 @@ export class SdSelectMultipleGroup extends BaseDropdownEvent {
730
731
  "attribute": "label",
731
732
  "defaultValue": "''"
732
733
  },
734
+ "labelWidth": {
735
+ "type": "any",
736
+ "mutable": false,
737
+ "complexType": {
738
+ "original": "string | number",
739
+ "resolved": "number | string",
740
+ "references": {}
741
+ },
742
+ "required": false,
743
+ "optional": false,
744
+ "docs": {
745
+ "tags": [],
746
+ "text": ""
747
+ },
748
+ "getter": false,
749
+ "setter": false,
750
+ "reflect": false,
751
+ "attribute": "label-width",
752
+ "defaultValue": "''"
753
+ },
733
754
  "icon": {
734
755
  "type": "unknown",
735
756
  "mutable": false,
@@ -13,6 +13,7 @@ export class SdSelectV2 {
13
13
  dropdownHeight = '260px';
14
14
  disabled = false;
15
15
  label = '';
16
+ labelWidth = '';
16
17
  addonLabel = '';
17
18
  error = false;
18
19
  hint = '';
@@ -206,13 +207,13 @@ export class SdSelectV2 {
206
207
  this.closeDropdown();
207
208
  },
208
209
  };
209
- return (h("sd-field", { key: 'b2a7f6ff2b4844069703400d68e9e736689d130a', name: this.fieldName || this.internalName, label: this.label, addonLabel: this.addonLabel, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
210
+ return (h("sd-field", { key: 'c9f08598c8f9852ab4000f056621dfef238e16de', name: this.fieldName || this.internalName, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
210
211
  this.hovered = true;
211
212
  }, onMouseLeave: () => {
212
213
  this.hovered = false;
213
- } }, h("div", { key: 'f832e4df90c6874c56e1f0ec5b109a7a77f3d0d1', class: "sd-select-v2", ref: el => {
214
+ } }, h("div", { key: '302103a425963e5d577b01ad179d5af82e6f30b1', class: "sd-select-v2", ref: el => {
214
215
  this.triggerRef = el;
215
- } }, h("sd-select-v2-trigger", { key: '9f2eaff8ca1ece8bec8fe635372e961a42ec0f80', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '2b8c31b66ac81a51dbd7657d5bbeeeaeb3ff0c83', ...portalProps }, h("sd-select-v2-listbox", { key: '8d16190fff39d403c74966e197c09afb55e9b9f8', 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) })))));
216
+ } }, h("sd-select-v2-trigger", { key: 'a22bca400e5d10ee29e569da04d36b9291a1dade', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '0df4ad35bb284298708a0c1e11ce0e3c28d16ed8', ...portalProps }, h("sd-select-v2-listbox", { key: '90c18612d553342be091a30e05194bab91407c76', name: this.name, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
216
217
  }
217
218
  static get is() { return "sd-select-v2"; }
218
219
  static get originalStyleUrls() {
@@ -406,6 +407,26 @@ export class SdSelectV2 {
406
407
  "attribute": "label",
407
408
  "defaultValue": "''"
408
409
  },
410
+ "labelWidth": {
411
+ "type": "any",
412
+ "mutable": false,
413
+ "complexType": {
414
+ "original": "string | number",
415
+ "resolved": "number | string",
416
+ "references": {}
417
+ },
418
+ "required": false,
419
+ "optional": false,
420
+ "docs": {
421
+ "tags": [],
422
+ "text": ""
423
+ },
424
+ "getter": false,
425
+ "setter": false,
426
+ "reflect": false,
427
+ "attribute": "label-width",
428
+ "defaultValue": "''"
429
+ },
409
430
  "addonLabel": {
410
431
  "type": "string",
411
432
  "mutable": false,
@@ -16,6 +16,7 @@ export class SdTextarea {
16
16
  width = '';
17
17
  // props - sd-field
18
18
  label = '';
19
+ labelWidth = '';
19
20
  addonLabel = '';
20
21
  hint = '';
21
22
  errorMessage = '';
@@ -103,7 +104,7 @@ export class SdTextarea {
103
104
  '--sd-system-size-field-sm-height': 'auto',
104
105
  '--sd-system-radius-field-sm': `${TEXTAREA_TOKENS.radius}px`,
105
106
  };
106
- return (h("sd-field", { key: '4525a68094b0655721c1d8679ee32bc041cf9677', name: this.name, label: this.label, addonLabel: this.addonLabel, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: '8a7724f1ff423b44dd9017f0446cfeb1220fda95', class: "sd-textarea__content" }, h("textarea", { key: '3eb2bafbbd31cd36ba5626aa9e0069d24d4634ec', 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 }))));
107
+ return (h("sd-field", { key: '6b2360f01a356db14659e1ebc53d8c4d8c4f671f', 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: 'f43279ee861d3502c9130f1de0c47cba61ad0866', class: "sd-textarea__content" }, h("textarea", { key: '0600b577417019ae36a0daba637168ebc5685220', 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 }))));
107
108
  }
108
109
  static get is() { return "sd-textarea"; }
109
110
  static get originalStyleUrls() {
@@ -354,6 +355,26 @@ export class SdTextarea {
354
355
  "attribute": "label",
355
356
  "defaultValue": "''"
356
357
  },
358
+ "labelWidth": {
359
+ "type": "any",
360
+ "mutable": false,
361
+ "complexType": {
362
+ "original": "string | number",
363
+ "resolved": "number | string",
364
+ "references": {}
365
+ },
366
+ "required": false,
367
+ "optional": false,
368
+ "docs": {
369
+ "tags": [],
370
+ "text": ""
371
+ },
372
+ "getter": false,
373
+ "setter": false,
374
+ "reflect": false,
375
+ "attribute": "label-width",
376
+ "defaultValue": "''"
377
+ },
357
378
  "addonLabel": {
358
379
  "type": "string",
359
380
  "mutable": false,
@@ -0,0 +1 @@
1
+ import{p as e,H as d,h as s,t as i}from"./p-DuYi4aqj.js";import{d as t}from"./p-BLC3AWW8.js";import{d as l}from"./p-DxzgCf_d.js";import{d as r}from"./p-CGssy8eb.js";import{d as o}from"./p-BZ7V5xV5.js";var a={sm:{height:"28",gap:"6",icon:"12",typography:{fontWeight:"700",fontSize:"12",lineHeight:"20"}},md:{height:"36",gap:"8",icon:"16",typography:{fontWeight:"700",fontSize:"16",lineHeight:"26"}}},n={gap:"6",paddingX:"12",typography:{fontWeight:"500",fontSize:"12",lineHeight:"20"},bg:"#F6F6F6",border:{default:"#AAAAAA",disabled:"#CCCCCC",width:"1"}};const f=a.sm,h=a.md,p={sm:{height:f.height,gap:f.gap,icon:f.icon,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:h.height,gap:h.gap,icon:h.icon,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight}},c=["sd-select","sd-select-multiple","sd-select-multiple-group","sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select-v2","sd-file-picker","sd-date-picker","sd-date-range-picker"],b=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}get el(){return this}name="";rules=[];error=!1;disabled=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";size="sm";label="";labelWidth="";addonLabel="";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),this.status&&(e=this.status),this.error&&(e="error"),e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of c){const d=this.el.closest(e);if(d&&"value"in d)return d}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(!this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this.name)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const d=e(this.value??"");if(!0!==d)return this.setError(!0,d),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,d){this.errorMsg=d,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,d=this.size in p?this.size:"sm",i=p[d],t={"--sd-field-wrapper-height":`var(--sd-system-size-field-${d}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${d})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${d}-gap)`},l=this.label?{"--sd-field-label-height":`${i.height}px`,"--sd-field-label-gap":`${i.gap}px`,"--sd-field-label-font-size":`${i.fontSize}px`,"--sd-field-label-line-height":`${i.lineHeight}px`,"--sd-field-label-font-weight":i.fontWeight,...this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},r=e?{"--sd-field-addon-padding-x":`${n.paddingX}px`,"--sd-field-addon-font-size":`${n.typography.fontSize}px`,"--sd-field-addon-line-height":`${n.typography.lineHeight}px`,"--sd-field-addon-font-weight":n.typography.fontWeight,"--sd-field-addon-bg":n.bg,"--sd-field-addon-border-color":this.disabled?n.border.disabled:n.border.default,"--sd-field-addon-gap":`${n.gap}px`,"--sd-field-addon-border-width":`${n.border.width}px`}:{};return s("div",{key:"f12b2e13ac8152d1e688f903a60a8fa670e99065",class:{"sd-field":!0,"sd-field--has-label":!!this.label,"sd-field--has-addon":!!e,[this.fieldStatus]:!!this.fieldStatus},style:{...t,...l,...r}},s("div",{key:"79f7a40b5e1ee95bb9075b0855e22261cd8adc6a",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"54b5bbfbe18df48c40cc30ec3d6761ccd8e446cc",class:"sd-field__main",style:this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"39542908287175ade4d6e0f1acd2cb1f03c9e2a1",class:{"sd-field__control":!0,"sd-field__control--has-addon":!!e}},e&&s("div",{key:"236650de53d1d1951f26586aa0d22f0f267fc411",class:"sd-field__addon"},e),s("slot",{key:"41df3dca21aa68d3324617891f2555f1c488a61b"})),this.errorMsg||this.errorMessage?s("div",{class:"sd-field__error-message"},this.errorMsg||this.errorMessage):this.hint&&s("div",{class:"sd-field__hint"},this.hint))))}renderLabel(e){return e?s("label",{class:"sd-field__label"},this.icon&&s("sd-icon",{name:this.icon.name,size:this.icon.size??Number(p[this.size in p?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),s("div",{class:"sd-field__label__text"},e),this.labelTooltip&&s("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip)):null}static get style(){return"sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;white-space:nowrap;padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field .sd-field__error-message{color:var(--sd-textinput-textinput-text-error-message);font-size:var(--sd-textinput-textinput-error-message-typography-font-size);line-height:var(--sd-textinput-textinput-error-message-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-textinput-text-hint);font-size:var(--sd-textinput-textinput-hint-typography-font-size);line-height:var(--sd-textinput-textinput-hint-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}"}},[772,"sd-field",{name:[1],rules:[16],error:[1028],disabled:[1028],hovered:[1028],focused:[1028],status:[1],hint:[1],errorMessage:[1,"error-message"],width:[8],size:[513],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function g(){"undefined"!=typeof customElements&&["sd-field","sd-button","sd-floating-portal","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-field":customElements.get(i(e))||customElements.define(i(e),b);break;case"sd-button":customElements.get(i(e))||t();break;case"sd-floating-portal":customElements.get(i(e))||l();break;case"sd-icon":customElements.get(i(e))||r();break;case"sd-tooltip":customElements.get(i(e))||o()}}))}export{b as S,g as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as o,t as i}from"./p-DuYi4aqj.js";import{d}from"./p-BLC3AWW8.js";import{d as n}from"./p-TMuoVuhE.js";import{d as r}from"./p-aC4HJHug.js";import{d as a}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as l}from"./p-e8HA30H_.js";import{d as p}from"./p-Bh548Ckv.js";import{d as m}from"./p-DgYBr7xb.js";import{d as u}from"./p-BZ7V5xV5.js";const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.optionClick=s(this,"sdOptionClick",7),this.optionFiltered=s(this,"sdOptionFiltered",7),this.scroll=s(this,"sdScroll",7)}itemIndex;value=null;options;width;dropdownHeight;searchable;optionPlaceholder;useCheckbox=!1;useAll=!1;filteredOptions=[];searchText=null;isScrolled=!1;isDropdownReady=!1;optionClick;optionFiltered;scroll;filteredOptionsChanged(t){this.optionFiltered.emit(t)}searchTextChanged(){this.filterOptions()}async itemIndexChanged(t,e){if(this.searchable){const t=await this.getNativeInputElement();if(-1===this.itemIndex)return void t?.focus({preventScroll:!0});t?.matches(":focus")&&t?.blur()}const s=this.dropdownRef?.querySelectorAll(".sd-select-dropdown sd-select-option")||[],o=s?.[this.itemIndex];o&&(this.optionRef=o,await this.optionRef.sdIsDisabled()?t>e?this.itemIndex++:this.itemIndex--:this.scrollToOption(o))}componentWillLoad(){this.filteredOptions=this.options,requestAnimationFrame((()=>{requestAnimationFrame((async()=>{const t=this.getSelectedOption();if(t){const e=Array.isArray(t)?this.options.indexOf(t[0]):this.options.indexOf(t),s=Array.from(this.dropdownRef?.querySelectorAll("sd-select-option")||[]),o=Math.min((this.useAll?e+1:e)+4,s.length-1),i=s?.[o];i&&this.scrollToOption(i,"instant")}if(this.isDropdownReady=!0,this.searchable){const t=await this.getNativeInputElement();t&&requestAnimationFrame((()=>{t.focus({preventScroll:!0})}))}}))}))}dropdownRef;searchRef;optionRef;get dropdownSize(){return{"--select-dropdown-width":this.width||"200px","--select-dropdown-height":this.dropdownHeight||"260px"}}filterOptions(){this.filteredOptions=this.searchText&&""!==this.searchText.trim()?this.options.filter((t=>t.label.toLowerCase().includes(this.searchText.toLowerCase()))):this.options}getSelectedOption(){return"object"!=typeof this.value?this.options.find((t=>t.value===this.value)):this.options.filter((t=>this.value?.includes(t)))}isOptionSelected(t){return Array.isArray(this.value)?this.value.some((e=>e.value===t)):t===this.value}async getNativeInputElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}scrollToOption(t,e="smooth"){if(!this.dropdownRef||!t)return;const s=this.dropdownRef,o=t.offsetTop,i=t.offsetHeight,d=s.scrollTop,n=s.clientHeight,r=s.querySelector(".sd-select-search-input"),a=r?r.offsetHeight:0,c=d+n;o<d+a?s.scrollTo({top:o-a,behavior:e}):o+i>c&&s.scrollTo({top:o+i-n+a,behavior:e})}handleDropdownScroll=t=>{this.isScrolled=t.target.scrollTop>0};render(){return o("div",{key:"fdfad8ab2f1f6a26da8ad0ca0dcd17bfed7dcf9d",class:{"sd-select-dropdown":!0,"sd-select-dropdown--ready":this.isDropdownReady},style:this.dropdownSize,onScroll:this.handleDropdownScroll,ref:t=>this.dropdownRef=t},this.searchable&&o("sd-select-search-input",{key:"74cfba89d85a980c6c8074150bdba91387b9c115",ref:t=>this.searchRef=t,isScrolled:this.isScrolled,searchText:this.searchText,onSdSearchInput:t=>this.searchText=t.detail||"",onSdSearchFocus:()=>this.itemIndex=-1}),this.filteredOptions.length>0?this.filteredOptions.map(((t,e)=>o("slot",{name:`option-${t.value}`},o("sd-select-option",{option:t,index:e,isSelected:this.isOptionSelected(t.value),isFocused:e===this.itemIndex,onOptionClick:({detail:t})=>this.optionClick.emit(t),useCheckbox:this.useCheckbox})))):o("slot",{name:"option-placeholder"},o("div",{class:"sd-select-option-placeholder"},this.optionPlaceholder)))}static get watchers(){return{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}}static get style(){return".sd-select-dropdown .sd-select-option-placeholder{height:48px;display:flex;align-items:center;padding:8px 16px;font-size:12px;line-height:0;text-align:left;color:#888888}.sd-select-dropdown{overflow:auto;min-width:fit-content;width:var(--select-dropdown-width, 200px);max-height:var(--select-dropdown-height, 260px);padding-bottom:2px;background-color:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);border-radius:4px;overflow-y:auto;color:#333333;display:flex;flex-direction:column;opacity:0.5;transition:opacity 0.15s ease-in}.sd-select-dropdown--ready{opacity:1}"}},[772,"sd-select-dropdown",{itemIndex:[1026,"item-index"],value:[8],options:[16],width:[1],dropdownHeight:[1,"dropdown-height"],searchable:[4],optionPlaceholder:[1,"option-placeholder"],useCheckbox:[4,"use-checkbox"],useAll:[4,"use-all"],filteredOptions:[32],searchText:[32],isScrolled:[32],isDropdownReady:[32]},void 0,{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-select-dropdown","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-dropdown":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||d();break;case"sd-checkbox":customElements.get(i(t))||n();break;case"sd-field":customElements.get(i(t))||r();break;case"sd-floating-portal":customElements.get(i(t))||a();break;case"sd-ghost-button":customElements.get(i(t))||c();break;case"sd-icon":customElements.get(i(t))||h();break;case"sd-input":customElements.get(i(t))||l();break;case"sd-select-option":customElements.get(i(t))||p();break;case"sd-select-search-input":customElements.get(i(t))||m();break;case"sd-tooltip":customElements.get(i(t))||u()}}))}export{f as S,x as d}
1
+ import{p as t,H as e,c as s,h as o,t as i}from"./p-DuYi4aqj.js";import{d}from"./p-BLC3AWW8.js";import{d as n}from"./p-TMuoVuhE.js";import{d as r}from"./p-BjjrNz4C.js";import{d as a}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as l}from"./p-DC9KYl3L.js";import{d as p}from"./p-Bh548Ckv.js";import{d as m}from"./p-xmvTLf74.js";import{d as u}from"./p-BZ7V5xV5.js";const f=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.optionClick=s(this,"sdOptionClick",7),this.optionFiltered=s(this,"sdOptionFiltered",7),this.scroll=s(this,"sdScroll",7)}itemIndex;value=null;options;width;dropdownHeight;searchable;optionPlaceholder;useCheckbox=!1;useAll=!1;filteredOptions=[];searchText=null;isScrolled=!1;isDropdownReady=!1;optionClick;optionFiltered;scroll;filteredOptionsChanged(t){this.optionFiltered.emit(t)}searchTextChanged(){this.filterOptions()}async itemIndexChanged(t,e){if(this.searchable){const t=await this.getNativeInputElement();if(-1===this.itemIndex)return void t?.focus({preventScroll:!0});t?.matches(":focus")&&t?.blur()}const s=this.dropdownRef?.querySelectorAll(".sd-select-dropdown sd-select-option")||[],o=s?.[this.itemIndex];o&&(this.optionRef=o,await this.optionRef.sdIsDisabled()?t>e?this.itemIndex++:this.itemIndex--:this.scrollToOption(o))}componentWillLoad(){this.filteredOptions=this.options,requestAnimationFrame((()=>{requestAnimationFrame((async()=>{const t=this.getSelectedOption();if(t){const e=Array.isArray(t)?this.options.indexOf(t[0]):this.options.indexOf(t),s=Array.from(this.dropdownRef?.querySelectorAll("sd-select-option")||[]),o=Math.min((this.useAll?e+1:e)+4,s.length-1),i=s?.[o];i&&this.scrollToOption(i,"instant")}if(this.isDropdownReady=!0,this.searchable){const t=await this.getNativeInputElement();t&&requestAnimationFrame((()=>{t.focus({preventScroll:!0})}))}}))}))}dropdownRef;searchRef;optionRef;get dropdownSize(){return{"--select-dropdown-width":this.width||"200px","--select-dropdown-height":this.dropdownHeight||"260px"}}filterOptions(){this.filteredOptions=this.searchText&&""!==this.searchText.trim()?this.options.filter((t=>t.label.toLowerCase().includes(this.searchText.toLowerCase()))):this.options}getSelectedOption(){return"object"!=typeof this.value?this.options.find((t=>t.value===this.value)):this.options.filter((t=>this.value?.includes(t)))}isOptionSelected(t){return Array.isArray(this.value)?this.value.some((e=>e.value===t)):t===this.value}async getNativeInputElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}scrollToOption(t,e="smooth"){if(!this.dropdownRef||!t)return;const s=this.dropdownRef,o=t.offsetTop,i=t.offsetHeight,d=s.scrollTop,n=s.clientHeight,r=s.querySelector(".sd-select-search-input"),a=r?r.offsetHeight:0,c=d+n;o<d+a?s.scrollTo({top:o-a,behavior:e}):o+i>c&&s.scrollTo({top:o+i-n+a,behavior:e})}handleDropdownScroll=t=>{this.isScrolled=t.target.scrollTop>0};render(){return o("div",{key:"fdfad8ab2f1f6a26da8ad0ca0dcd17bfed7dcf9d",class:{"sd-select-dropdown":!0,"sd-select-dropdown--ready":this.isDropdownReady},style:this.dropdownSize,onScroll:this.handleDropdownScroll,ref:t=>this.dropdownRef=t},this.searchable&&o("sd-select-search-input",{key:"74cfba89d85a980c6c8074150bdba91387b9c115",ref:t=>this.searchRef=t,isScrolled:this.isScrolled,searchText:this.searchText,onSdSearchInput:t=>this.searchText=t.detail||"",onSdSearchFocus:()=>this.itemIndex=-1}),this.filteredOptions.length>0?this.filteredOptions.map(((t,e)=>o("slot",{name:`option-${t.value}`},o("sd-select-option",{option:t,index:e,isSelected:this.isOptionSelected(t.value),isFocused:e===this.itemIndex,onOptionClick:({detail:t})=>this.optionClick.emit(t),useCheckbox:this.useCheckbox})))):o("slot",{name:"option-placeholder"},o("div",{class:"sd-select-option-placeholder"},this.optionPlaceholder)))}static get watchers(){return{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}}static get style(){return".sd-select-dropdown .sd-select-option-placeholder{height:48px;display:flex;align-items:center;padding:8px 16px;font-size:12px;line-height:0;text-align:left;color:#888888}.sd-select-dropdown{overflow:auto;min-width:fit-content;width:var(--select-dropdown-width, 200px);max-height:var(--select-dropdown-height, 260px);padding-bottom:2px;background-color:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);border-radius:4px;overflow-y:auto;color:#333333;display:flex;flex-direction:column;opacity:0.5;transition:opacity 0.15s ease-in}.sd-select-dropdown--ready{opacity:1}"}},[772,"sd-select-dropdown",{itemIndex:[1026,"item-index"],value:[8],options:[16],width:[1],dropdownHeight:[1,"dropdown-height"],searchable:[4],optionPlaceholder:[1,"option-placeholder"],useCheckbox:[4,"use-checkbox"],useAll:[4,"use-all"],filteredOptions:[32],searchText:[32],isScrolled:[32],isDropdownReady:[32]},void 0,{filteredOptions:[{filteredOptionsChanged:0}],searchText:[{searchTextChanged:0}],itemIndex:[{itemIndexChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["sd-select-dropdown","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-select-option","sd-select-search-input","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-dropdown":customElements.get(i(t))||customElements.define(i(t),f);break;case"sd-button":customElements.get(i(t))||d();break;case"sd-checkbox":customElements.get(i(t))||n();break;case"sd-field":customElements.get(i(t))||r();break;case"sd-floating-portal":customElements.get(i(t))||a();break;case"sd-ghost-button":customElements.get(i(t))||c();break;case"sd-icon":customElements.get(i(t))||h();break;case"sd-input":customElements.get(i(t))||l();break;case"sd-select-option":customElements.get(i(t))||p();break;case"sd-select-search-input":customElements.get(i(t))||m();break;case"sd-tooltip":customElements.get(i(t))||u()}}))}export{f as S,x as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as e,c as s,h as i,t as o}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{d as a}from"./p-BLC3AWW8.js";import{d as l}from"./p-TMuoVuhE.js";import{d as h}from"./p-BjjrNz4C.js";import{d}from"./p-DxzgCf_d.js";import{d as n}from"./p-CGssy8eb.js";import{d as c}from"./p-BgRPWxrz.js";import{d as p}from"./p-kZ5N_lFC.js";import{d as m}from"./p-DRY8HJ-T.js";import{d as u}from"./p-DpsDTjcN.js";import{d as f}from"./p-B6OgnOKC.js";import{d as b}from"./p-BZ7V5xV5.js";const g=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.dropDownShow=s(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return this}name="default";value=null;options=[];placeholder="선택";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";error=!1;hint="";errorMessage="";fieldName="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;triggerRef;closeAnimationTimer;internalName=r();watchIsOpen(t){this.focused=t,this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.name||"multi_depth"===this.name}get displayText(){if(this.isMulti){if(!this.value||!Array.isArray(this.value))return"";if(this.emitValue){const t=this.flattenOptions(this.options);return this.value.map((e=>t.find((t=>t.value===e))?.label??"")).filter(Boolean).join(", ")}const t=this.value;return 0===t.length?"":t.map((t=>t.label)).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options).find((t=>t.value===this.value));return t?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getSelectedOptions(){const t=this.value;return t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const e=this.triggerRef.getBoundingClientRect(),s=t.VIEWPORT_PADDING,i=t.PORTAL_OFFSET_Y,o=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),a=Math.max(window.innerHeight-e.bottom-s-i,0),l=Math.max(e.top-s-i,0),h=Math.max(a,l),d=Math.max(window.innerWidth-2*s,0);this.resolvedDropdownHeight=`${Math.min(o,h)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,d)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),t.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints(),this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),o=e.filter((e=>!t.has(e.value)));i=[...s,...o]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:t.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"c9f08598c8f9852ab4000f056621dfef238e16de",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"302103a425963e5d577b01ad179d5af82e6f30b1",class:"sd-select-v2",ref:t=>{this.triggerRef=t}},i("sd-select-v2-trigger",{key:"a22bca400e5d10ee29e569da04d36b9291a1dade",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"0df4ad35bb284298708a0c1e11ce0e3c28d16ed8",...e},i("sd-select-v2-listbox",{key:"90c18612d553342be091a30e05194bab91407c76",name:this.name,options:this.options,value:this.value,emitValue:this.emitValue,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-select-v2{display:inline-flex}sd-select-v2 sd-portal{display:none}sd-select-v2 .sd-select-v2{position:relative;width:100%;height:100%}"}},[512,"sd-select-v2",{name:[1],value:[1032],options:[16],placeholder:[1],maxDropdownWidth:[1,"max-dropdown-width"],dropdownHeight:[1,"dropdown-height"],disabled:[4],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],error:[1028],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],emitValue:[4,"emit-value"],width:[8],isOpen:[32],isAnimatingOut:[32],triggerWidth:[32],resolvedDropdownHeight:[32],resolvedMaxDropdownWidth:[32],focused:[32],hovered:[32]},void 0,{isOpen:[{watchIsOpen:0}]}]);function w(){"undefined"!=typeof customElements&&["sd-select-v2","sd-button","sd-checkbox","sd-field","sd-floating-portal","sd-icon","sd-portal","sd-select-v2-list-item","sd-select-v2-list-item-search","sd-select-v2-listbox","sd-select-v2-trigger","sd-tooltip"].forEach((t=>{switch(t){case"sd-select-v2":customElements.get(o(t))||customElements.define(o(t),g);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-checkbox":customElements.get(o(t))||l();break;case"sd-field":customElements.get(o(t))||h();break;case"sd-floating-portal":customElements.get(o(t))||d();break;case"sd-icon":customElements.get(o(t))||n();break;case"sd-portal":customElements.get(o(t))||c();break;case"sd-select-v2-list-item":customElements.get(o(t))||p();break;case"sd-select-v2-list-item-search":customElements.get(o(t))||m();break;case"sd-select-v2-listbox":customElements.get(o(t))||u();break;case"sd-select-v2-trigger":customElements.get(o(t))||f();break;case"sd-tooltip":customElements.get(o(t))||b()}}))}export{g as S,w as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as s,c as i,h as e,t as n}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-CJwbBrt5.js";import{d as l}from"./p-BLC3AWW8.js";import{d}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d as u}from"./p-B1S4ybd6.js";import{d as h}from"./p-CGssy8eb.js";import{d as p}from"./p-BZ7V5xV5.js";const c=a.textinput.sm,f=a.textinput.md,b={sm:{height:c.height,paddingX:c.paddingX,gap:c.gap,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight},md:{height:f.height,paddingX:f.paddingX,gap:f.gap,radius:f.radius,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight}},m={text:a.textinput.text,icon:a.textinput.icon},g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return this}value=null;type="text";size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,s)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(s)):this.focus?.emit(s)};render(){const t=b[this.size]??b.sm;return e("sd-field",{key:"a72ce8674fb761de7cd188e99cc19d5f3731a899",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${t.fontSize}px`,"--sd-input-line-height":`${t.lineHeight}px`,"--sd-input-font-weight":t.fontWeight,"--sd-input-padding-x":`${t.paddingX}px`,"--sd-input-gap":`${t.gap}px`,"--sd-input-text-color":m.text.default,"--sd-input-placeholder-color":m.text.placeholder,"--sd-input-disabled-color":m.text.disabled,"--sd-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`}},e("label",{key:"e5cbdbc2b233bda57488ead19401d277891301ae",class:"sd-input__content"},e("slot",{key:"a327005770df94ef61f2e08071e77407a24b7b5c",name:"prefix"}),e("input",{key:"36301cd586151b8c607e14715b26fca467f68c13",name:this.name,ref:t=>this.nativeEl=t,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type,value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),e("slot",{key:"532e201860db0709572502aa4275fc9251e1aeb1",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&e("sd-ghost-button",{key:"cc6132852c65f0597cbe25751c7246b1cdad3096",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&e("sd-ghost-button",{key:"fd3d567346cf5771ec28c73f15cdf0db15835766",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled,class:"sd-input__password-icon",onClick:()=>{this.disabled||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native[readonly]{color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-input",{value:[1032],type:[1],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],autocomplete:[1],maxlength:[2],minlength:[2],inputmode:[1],enterkeyhint:[1],spellcheck:[4],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],passwordVisible:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function _(){"undefined"!=typeof customElements&&["sd-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-input":customElements.get(n(t))||customElements.define(n(t),g);break;case"sd-button":customElements.get(n(t))||l();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||r();break;case"sd-ghost-button":customElements.get(n(t))||u();break;case"sd-icon":customElements.get(n(t))||h();break;case"sd-tooltip":customElements.get(n(t))||p()}}))}export{g as S,_ as d}
@@ -1 +1 @@
1
- import{p as s,H as e,c as t,h as c,t as a}from"./p-DuYi4aqj.js";import{d as o}from"./p-BLC3AWW8.js";import{d as i}from"./p-aC4HJHug.js";import{d}from"./p-DxzgCf_d.js";import{d as r}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as l}from"./p-e8HA30H_.js";import{d as p}from"./p-BZ7V5xV5.js";const u=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.searchInput=t(this,"sdSearchInput",7),this.searchFocus=t(this,"sdSearchFocus",7)}isScrolled=!1;searchText="";searchInput;searchFocus;searchRef;async sdGetNativeElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}async sdSearchInputFocus(){const s=await this.sdGetNativeElement();s?.focus({preventScroll:!0})}render(){return c("div",{key:"36003b7e0e7d8a3df224b18257d4d6b1712d47da",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"3b6f80d033a7903cb8e3692a2eebe0ab991e8d68",ref:s=>this.searchRef=s,value:this.searchText,placeholder:"검색",clearable:!0,inputStyle:{"padding-left":"8px"},autofocus:!0,onSdUpdate:s=>{this.searchInput.emit(String(s?.detail))},onSdFocus:()=>{this.searchFocus.emit()},onKeyDown:s=>{"Enter"===s.code&&s.stopPropagation()}},c("sd-icon",{key:"7c453e87ba6b384c5be7bb142697ba43c0d1a20b",name:"search",size:16,color:"#737373",style:{marginRight:"4px"},slot:"prefix"})))}static get style(){return"sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center}sd-select-search-input .sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center;padding:4px 8px}sd-select-search-input .sd-select-search-input sd-input{width:100%}sd-select-search-input .sd-select-search-input--scrolled{box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}"}},[512,"sd-select-search-input",{isScrolled:[4,"is-scrolled"],searchText:[1,"search-text"],sdGetNativeElement:[64],sdSearchInputFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-search-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select-search-input":customElements.get(a(s))||customElements.define(a(s),u);break;case"sd-button":customElements.get(a(s))||o();break;case"sd-field":customElements.get(a(s))||i();break;case"sd-floating-portal":customElements.get(a(s))||d();break;case"sd-ghost-button":customElements.get(a(s))||r();break;case"sd-icon":customElements.get(a(s))||n();break;case"sd-input":customElements.get(a(s))||l();break;case"sd-tooltip":customElements.get(a(s))||p()}}))}export{u as S,h as d}
1
+ import{p as s,H as e,c as t,h as c,t as a}from"./p-DuYi4aqj.js";import{d as o}from"./p-BLC3AWW8.js";import{d as i}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as l}from"./p-DC9KYl3L.js";import{d as p}from"./p-BZ7V5xV5.js";const u=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.searchInput=t(this,"sdSearchInput",7),this.searchFocus=t(this,"sdSearchFocus",7)}isScrolled=!1;searchText="";searchInput;searchFocus;searchRef;async sdGetNativeElement(){return this.searchRef?this.searchRef.sdGetNativeElement():null}async sdSearchInputFocus(){const s=await this.sdGetNativeElement();s?.focus({preventScroll:!0})}render(){return c("div",{key:"36003b7e0e7d8a3df224b18257d4d6b1712d47da",class:{"sd-select-search-input":!0,"sd-select-search-input--scrolled":!!this.isScrolled},onClick:s=>s.stopPropagation()},c("sd-input",{key:"3b6f80d033a7903cb8e3692a2eebe0ab991e8d68",ref:s=>this.searchRef=s,value:this.searchText,placeholder:"검색",clearable:!0,inputStyle:{"padding-left":"8px"},autofocus:!0,onSdUpdate:s=>{this.searchInput.emit(String(s?.detail))},onSdFocus:()=>{this.searchFocus.emit()},onKeyDown:s=>{"Enter"===s.code&&s.stopPropagation()}},c("sd-icon",{key:"7c453e87ba6b384c5be7bb142697ba43c0d1a20b",name:"search",size:16,color:"#737373",style:{marginRight:"4px"},slot:"prefix"})))}static get style(){return"sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center}sd-select-search-input .sd-select-search-input{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center;padding:4px 8px}sd-select-search-input .sd-select-search-input sd-input{width:100%}sd-select-search-input .sd-select-search-input--scrolled{box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}"}},[512,"sd-select-search-input",{isScrolled:[4,"is-scrolled"],searchText:[1,"search-text"],sdGetNativeElement:[64],sdSearchInputFocus:[64]}]);function h(){"undefined"!=typeof customElements&&["sd-select-search-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-input","sd-tooltip"].forEach((s=>{switch(s){case"sd-select-search-input":customElements.get(a(s))||customElements.define(a(s),u);break;case"sd-button":customElements.get(a(s))||o();break;case"sd-field":customElements.get(a(s))||i();break;case"sd-floating-portal":customElements.get(a(s))||r();break;case"sd-ghost-button":customElements.get(a(s))||d();break;case"sd-icon":customElements.get(a(s))||n();break;case"sd-input":customElements.get(a(s))||l();break;case"sd-tooltip":customElements.get(a(s))||p()}}))}export{u as S,h as d}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as a}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as n}from"./p-CJwbBrt5.js";import{d}from"./p-BLC3AWW8.js";import{d as l}from"./p-aC4HJHug.js";import{d as r}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as u}from"./p-CGssy8eb.js";import{d as p}from"./p-BZ7V5xV5.js";const h=n.textinput.sm,b=n.textinput.md,f={sm:{height:h.height,paddingX:h.paddingX,gap:h.gap,radius:h.radius,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={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="";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:"ea17ae1c54890e57be4f582b3e993f370646b81a",name:this.name,label:this.label,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,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:"c96462ac8db261a31681744585a4f396b6561abb",class:"sd-barcode-input__content"},i("slot",{key:"fde26b71059c79ef6911ab7a185bacda19b2800a",name:"prefix"}),i("input",{key:"a015944a0396a2fc3ab1c1ea401f79f25a260764",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:"45958b98d96ad527cfb9b59491e48e6f5c75e990",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"7bf3f5e3ffcb35def3576e5f07d2af6392ce0c59",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-barcode-input",{value:[1032],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],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))||p()}}))};export{v as SdBarcodeInput,x as defineCustomElement}
1
+ import{p as t,H as e,c as s,h as i,t as a}from"./p-DuYi4aqj.js";import{n as o}from"./p-CCwNgVmC.js";import{i as d}from"./p-CJwbBrt5.js";import{d as n}from"./p-BLC3AWW8.js";import{d as l}from"./p-BjjrNz4C.js";import{d as r}from"./p-DxzgCf_d.js";import{d as c}from"./p-B1S4ybd6.js";import{d as u}from"./p-CGssy8eb.js";import{d as h}from"./p-BZ7V5xV5.js";const p=d.textinput.sm,b=d.textinput.md,f={sm:{height:p.height,paddingX:p.paddingX,gap:p.gap,radius:p.radius,fontSize:p.typography.fontSize,lineHeight:p.typography.lineHeight,fontWeight:p.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={bg:d.textinput.bg,text:d.textinput.text,icon:d.textinput.icon},g=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=s(this,"sdUpdate",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get host(){return this}value=null;size="sm";addonLabel="";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,e)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(e)):this.focus?.emit(e)};render(){const t=f[this.size]??f.sm;return i("sd-field",{key:"bba439856e0cbaedc7b54411dac904f9c845b50c",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-barcode-input-font-size":t.fontSize+"px","--sd-barcode-input-line-height":t.lineHeight+"px","--sd-barcode-input-font-weight":t.fontWeight,"--sd-barcode-input-padding-x":t.paddingX+"px","--sd-barcode-input-gap":t.gap+"px","--sd-barcode-input-text-color":m.text.default,"--sd-barcode-input-placeholder-color":m.text.placeholder,"--sd-barcode-input-disabled-color":m.text.disabled,"--sd-barcode-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":t.height+"px","--sd-system-radius-field-sm":t.radius+"px","--sd-system-color-field-bg-default":m.bg.barcode}},i("label",{key:"8553cfb4b5ef9535608abc1f2987ce08970c318a",class:"sd-barcode-input__content"},i("slot",{key:"93db2b38e8d674230f48e3b9496a7221d8477da6",name:"prefix"}),i("input",{key:"30997bea593052322a2d29fc1e517b00cf19b1fb",name:this.name,ref:t=>this.nativeEl=t,class:"sd-barcode-input__native "+this.inputClass,type:"text",value:this.internalValue||"",placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),i("slot",{key:"690daa6c1daa6058713ee09b0efe976557cde3ab",name:"suffix"}),this.clearable&&this.internalValue&&i("sd-ghost-button",{key:"8ab4e45a23d1b06dc415d969e25ed5ea59540643",icon:"close",ariaLabel:"close",size:"xxs",disabled:this.disabled,class:"sd-barcode-input__clear-icon",onClick:async()=>{this.disabled||(this.internalValue="",await(this.formField?.sdValidate()))}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fafaa1 inset;box-shadow:0 0 0px 1000px #fafaa1 inset;transition:background-color 5000s ease-in-out 0s}sd-barcode-input{display:inline-flex}sd-barcode-input .sd-barcode-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-barcode-input-text-color);font-size:var(--sd-barcode-input-font-size);line-height:var(--sd-barcode-input-line-height);font-weight:var(--sd-barcode-input-font-weight);padding:0 var(--sd-barcode-input-padding-x);gap:var(--sd-barcode-input-gap)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]{cursor:not-allowed;color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[readonly]{color:var(--sd-barcode-input-disabled-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native::placeholder{color:var(--sd-barcode-input-placeholder-color)}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__clear-icon{flex-shrink:0}sd-barcode-input .sd-barcode-input__content .sd-barcode-input__native[disabled]~.sd-barcode-input__clear-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-barcode-input",{value:[1032],size:[1],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],internalValue:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=g,x=function(){"undefined"!=typeof customElements&&["sd-barcode-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-barcode-input":customElements.get(a(t))||customElements.define(a(t),g);break;case"sd-button":customElements.get(a(t))||n();break;case"sd-field":customElements.get(a(t))||l();break;case"sd-floating-portal":customElements.get(a(t))||r();break;case"sd-ghost-button":customElements.get(a(t))||c();break;case"sd-icon":customElements.get(a(t))||u();break;case"sd-tooltip":customElements.get(a(t))||h()}}))};export{v as SdBarcodeInput,x as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as o}from"./p-bYCOh35g.js";import{d as l}from"./p-BLC3AWW8.js";import{d as c}from"./p-BdsI1E5l.js";import{d as n}from"./p-AKpbKrkW.js";import{d as h}from"./p-aC4HJHug.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as f}from"./p-CGssy8eb.js";import{d as u}from"./p-BgRPWxrz.js";import{d as b}from"./p-BZ7V5xV5.js";const g=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";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:"cfbaa89a7e07ff2d8994f3e8faa16bc55decce0f",name:this.fieldName||this.internalName,label:this.label,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,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:"674cc78bc3a3cda15a1cff07c36d0d5adbcfa2ef",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"1491cea4ff657631b3dc197fa39981c2c4df96c7",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"9a759a3470bc077a52efbd4718cf11f3b67ef477",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"a14a447fbf28d95173eca5fae3baa73319c0bc37",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],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))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||n();break;case"sd-field":customElements.get(a(e))||h();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||f();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tooltip":customElements.get(a(e))||b()}}))};export{k as SdDatePicker,y as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as c}from"./p-BdsI1E5l.js";import{d as h}from"./p-AKpbKrkW.js";import{d as n}from"./p-BjjrNz4C.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as f}from"./p-CGssy8eb.js";import{d as b}from"./p-BgRPWxrz.js";import{d as u}from"./p-BZ7V5xV5.js";const g=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"693c0c75e6b0a9ee8323f4be7ec101592e586372",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"ea7f506f0163119fac0c660ef1bef5781780a118",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"0109eb0326655018bc02cc373e766ffdada85ff0",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"65a628af43ae036a752f3511341fd8c9c82303a1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-picker-calendar",{key:"21f574fc9551f9aaccfcb5d49a81952dbba72d7a",value:this.value,selectable:this.selectable,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=g,y=function(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-date-picker-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),g);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||n();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||f();break;case"sd-portal":customElements.get(a(e))||b();break;case"sd-tooltip":customElements.get(a(e))||u()}}))};export{k as SdDatePicker,y as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{D as d,a as o}from"./p-bYCOh35g.js";import{d as l}from"./p-BLC3AWW8.js";import{d as n}from"./p-AKpbKrkW.js";import{d as h}from"./p-CRl8Anfr.js";import{d as c}from"./p-aC4HJHug.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as b}from"./p-CGssy8eb.js";import{d as f}from"./p-BgRPWxrz.js";import{d as u}from"./p-BZ7V5xV5.js";const g=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD ~ YYYY-MM-DD";selectable;maxRange;disabled=!1;width="";label="";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:"c3ce7e19d317939c193b6d1481b78ce599b0ffb1",name:this.fieldName||this.internalName,label:this.label,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,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:"a3b48e2f79359620aabe01cfb32ac6a066acf567",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"3b2a963d29e93fe2ef82d1cd466ebd079c31ee30",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"5e51463ffdaf21c67a796b8a4418a287b48f7528",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-range-picker-calendar",{key:"820176f7e03e9aab97e8b1f7752a535385918e46",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],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-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),g);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))||f();break;case"sd-tooltip":customElements.get(a(e))||u()}}))};export{k as SdDateRangePicker,y as defineCustomElement}
1
+ import{p as e,H as s,c as t,h as i,t as a}from"./p-DuYi4aqj.js";import{n as d}from"./p-CCwNgVmC.js";import{D as r,a as l}from"./p-bYCOh35g.js";import{d as o}from"./p-BLC3AWW8.js";import{d as n}from"./p-AKpbKrkW.js";import{d as h}from"./p-CRl8Anfr.js";import{d as c}from"./p-BjjrNz4C.js";import{d as p}from"./p-DxzgCf_d.js";import{d as m}from"./p-B1S4ybd6.js";import{d as b}from"./p-CGssy8eb.js";import{d as u}from"./p-BgRPWxrz.js";import{d as g}from"./p-BZ7V5xV5.js";const f=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD ~ YYYY-MM-DD";selectable;maxRange;disabled=!1;width="";label="";labelWidth="";addonLabel="";hint="";errorMessage="";fieldName="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;internalName=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};get displayText(){return this.value&&this.value[0]&&this.value[1]?`${this.value[0]} ~ ${this.value[1]}`:""}disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.md;return i("sd-field",{key:"95ec666c91635d6b6b749d660b4495b7ebe48e6a",name:this.fieldName||this.internalName,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":e.height+"px","--sd-system-radius-field-sm":e.radius+"px","--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"3051fda66e94d51208347ae2053173570d5f1ca9",class:"sd-date-range-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"71693b5a4cec562169d9427a4e19aed4d8b19a45",displayText:this.displayText,placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"75b9f1c1ebdabcd1c1a33cad51189ba132274bb1",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-date-range-picker-calendar",{key:"f158eead4f44bc452bf102b3324721df84fc3b0c",value:this.value,selectable:this.selectable,maxRange:this.maxRange,onSdSelect:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-range-picker{display:inline-flex}sd-date-range-picker sd-portal{display:none}sd-date-range-picker .sd-date-range-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-range-picker",{value:[1040],size:[513],placeholder:[513],selectable:[16],maxRange:[2,"max-range"],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],hint:[1],errorMessage:[1,"error-message"],fieldName:[1,"field-name"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]),k=f,y=function(){"undefined"!=typeof customElements&&["sd-date-range-picker","sd-button","sd-date-picker-trigger","sd-date-range-picker-calendar","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-range-picker":customElements.get(a(e))||customElements.define(a(e),f);break;case"sd-button":customElements.get(a(e))||o();break;case"sd-date-picker-trigger":customElements.get(a(e))||n();break;case"sd-date-range-picker-calendar":customElements.get(a(e))||h();break;case"sd-field":customElements.get(a(e))||c();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tooltip":customElements.get(a(e))||g()}}))};export{k as SdDateRangePicker,y as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p-aC4HJHug.js";const a=o,p=s;export{a as SdField,p as defineCustomElement}
1
+ import{S as o,d as r}from"./p-BjjrNz4C.js";const s=o,j=r;export{s as SdField,j as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as i,c as s,h as t,t as l}from"./p-DuYi4aqj.js";import{d as r}from"./p-BLC3AWW8.js";import{d as o}from"./p-aC4HJHug.js";import{d as a}from"./p-DxzgCf_d.js";import{d}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as c}from"./p-BZ7V5xV5.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=s(this,"sdUpdate",7),this.reject=s(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name="";label="";addonLabel="";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdReset())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e){const i=this.toBytes(this.maxFileSize),s=this.toBytes(this.maxTotalSize),t=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=t&&e.length>t)return{accepted:[],rejected:e,reason:"max-files"};if(null!=i){const s=e.filter((e=>e.size>i));if(s.length>0)return{accepted:[],rejected:s,reason:"max-file-size"}}return null!=s&&e.reduce(((e,i)=>e+i.size),0)>s?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const s=Array.from(i),{accepted:t,rejected:l,reason:r}=this.validateFiles(s);if(r)return this.reject?.emit({files:l,reason:r}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=this.multiple?t:t[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(),s={"--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=t("div",{class:"sd-file-picker__content",onClick:this.handleClick},t("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder}),t("sd-icon",{name:"attachFile",size:Number(h.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),t("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&t("sd-ghost-button",{icon:"close",size:"xxs",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&t("div",{class:"sd-file-picker__tooltip"},i));return this.inline?t("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:s,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l):t("sd-field",{name:this.name,label:this.label,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:s},l)}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:inline-flex;width:100%}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:1000;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[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],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-DuYi4aqj.js";import{d as r}from"./p-BLC3AWW8.js";import{d as o}from"./p-BjjrNz4C.js";import{d as a}from"./p-DxzgCf_d.js";import{d}from"./p-B1S4ybd6.js";import{d as n}from"./p-CGssy8eb.js";import{d as c}from"./p-BZ7V5xV5.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",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:1000;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[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 +1 @@
1
- import{S as o,d as s}from"./p-e8HA30H_.js";const p=o,r=s;export{p as SdInput,r as defineCustomElement}
1
+ import{S as o,d as s}from"./p-DC9KYl3L.js";const p=o,r=s;export{p as SdInput,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,c as s,h as i,t as n}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{d as u}from"./p-BLC3AWW8.js";import{d}from"./p-aC4HJHug.js";import{d as a}from"./p-DxzgCf_d.js";import{d as o}from"./p-CGssy8eb.js";import{d as l}from"./p-BZ7V5xV5.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;addonLabel="";placeholder="입력해 주세요.";disabled=!1;width;rules=[];autoFocus=!1;status;hint="";errorMessage="";inputPrefix="";inputSuffix="";inputClass="";readonly=!1;inputStyle={};error=!1;focused=!1;hovered=!1;internalValue=null;displayValue="";nativeEl=void 0;formField;name=r();update;focus;blur;toNumber(t){if(null==t||""===t)return null;if("number"==typeof t)return isNaN(t)?null:t;if("string"==typeof t)return this.parseInput(t);const e=Number(t);return isNaN(e)?null:e}formatWithCommas(t){if(null==t||isNaN(t))return"";const e=t<0,s=Math.abs(t),[i,n]=(""+s).split("."),r=(+i).toLocaleString(),u=e?"-"+r:r;return n?u+"."+n:u+""}parseInput(t){if(!t||""===t.trim())return null;const e=t.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(e))return null;const s=parseFloat(e);return isNaN(s)||!this.useDecimal&&e.includes(".")?null:s}clampMinMax(t){return isNaN(t)?0:Math.min(Math.max(t,this.min),this.max)}updateDisplay(){this.displayValue=this.formatWithCommas(this.internalValue)}isIncrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue>=this.max}isDecrementDisabled(){return!(!this.disabled&&!this.readonly)||null!==this.internalValue&&this.internalValue<=this.min}valueChanged(t){const e=this.toNumber(t);this.internalValue=null!==e?this.clampMinMax(e):null,this.updateDisplay()}internalValueChanged(t){this.updateDisplay(),t!==this.value&&(this.value=t,this.update?.emit(t))}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}async sdGetNativeElement(){return this.nativeEl||null}componentWillLoad(){const t=this.toNumber(this.value);null!==t&&(this.internalValue=this.clampMinMax(t)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{const e=t.target,s=e.value;if(""===s)return this.internalValue=null,void(this.displayValue="");const i=s.replace(/,/g,""),n=(i.match(/\./g)||[]).length;if(n>1)return void(e.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(e.value=i);if(i.endsWith(".")&&1===n){const t=i.slice(0,-1),s=this.parseInput(t);if(null!==s){const t=this.formatWithCommas(s);return void(e.value=t+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(e.value=this.displayValue);if(r>this.max)return void(e.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),e.value=this.displayValue}else e.value=this.displayValue};handleFocus=t=>{this.focused=!0,this.focus?.emit(t)};handleBlur=async t=>{this.updateDisplay(),this.nativeEl&&(this.nativeEl.value=this.displayValue),this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.focused=!1,this.blur?.emit(t)};handleKeyDown=t=>{"ArrowUp"===t.key?(t.preventDefault(),this.handleIncrement()):"ArrowDown"===t.key&&(t.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const t=this.internalValue??this.min??0;let e=t+this.step;e>this.max&&(e=this.max),e!==t&&(this.internalValue=e)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const t=this.internalValue??this.min??0;let e=t-this.step;e<this.min&&(e=this.min),e!==t&&(this.internalValue=e)};render(){const t=b[this.size]??b.sm,e="md"===this.size?14:12;return i("sd-field",{key:"e05cc16f4dde4fd82d11a811b578723af2f5b092",name:this.name,label:this.label,addonLabel:this.addonLabel,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,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:"db4f02b5f882acfe481698745ca374874643efbd",class:"sd-number-input__content"},this.useButton&&i("button",{key:"c83df0e915849792427b2f3609937bb0b62aae15",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"b7ea0704c9d114b5e1b8eca29a408efb5e532b7e",name:"minus",size:e,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"57ed4229c30d52b6925ebaccd816cd8496ab60c0",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"b018a810ca085218beb7acbba0187543c8369236",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:"5db549a3cc81b98123cdec69b866b25d961f210f",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"8b0b8c4ba46cf1cc5fba21f7fa8c113ca215b265",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"77012f79ba5a3a5550af844149bb35fa1e165533",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],addonLabel:[1,"addon-label"],placeholder:[1],disabled:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],status:[1],hint:[1],errorMessage:[1,"error-message"],inputPrefix:[1,"input-prefix"],inputSuffix:[1,"input-suffix"],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],error:[1028],focused:[1028],hovered:[1028],internalValue:[32],displayValue:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]),v=_,w=function(){"undefined"!=typeof customElements&&["sd-number-input","sd-button","sd-field","sd-floating-portal","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-number-input":customElements.get(n(t))||customElements.define(n(t),_);break;case"sd-button":customElements.get(n(t))||u();break;case"sd-field":customElements.get(n(t))||d();break;case"sd-floating-portal":customElements.get(n(t))||a();break;case"sd-icon":customElements.get(n(t))||o();break;case"sd-tooltip":customElements.get(n(t))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
1
+ import{p as e,H as t,c as s,h as i,t as n}from"./p-DuYi4aqj.js";import{n as r}from"./p-CCwNgVmC.js";import{d}from"./p-BLC3AWW8.js";import{d as u}from"./p-BjjrNz4C.js";import{d as a}from"./p-DxzgCf_d.js";import{d as o}from"./p-CGssy8eb.js";import{d as l}from"./p-BZ7V5xV5.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,_=e(class extends t{constructor(e){super(),!1!==e&&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(e){if(null==e||""===e)return null;if("number"==typeof e)return isNaN(e)?null:e;if("string"==typeof e)return this.parseInput(e);const t=Number(e);return isNaN(t)?null:t}formatWithCommas(e){if(null==e||isNaN(e))return"";const t=e<0,s=Math.abs(e),[i,n]=(""+s).split("."),r=(+i).toLocaleString(),d=t?"-"+r:r;return n?d+"."+n:d+""}parseInput(e){if(!e||""===e.trim())return null;const t=e.replace(/,/g,"").trim();if(!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(t))return null;const s=parseFloat(t);return isNaN(s)||!this.useDecimal&&t.includes(".")?null:s}clampMinMax(e){return isNaN(e)?0:Math.min(Math.max(e,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(e){const t=this.toNumber(e);this.internalValue=null!==t?this.clampMinMax(t):null,this.updateDisplay()}internalValueChanged(e){this.updateDisplay(),e!==this.value&&(this.value=e,this.update?.emit(e))}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 e=this.toNumber(this.value);null!==e&&(this.internalValue=this.clampMinMax(e)),this.updateDisplay()}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=e=>{const t=e.target,s=t.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(t.value=this.displayValue);if("-"===i||"."===i||"-."===i)return void(t.value=i);if(i.endsWith(".")&&1===n){const e=i.slice(0,-1),s=this.parseInput(e);if(null!==s){const e=this.formatWithCommas(s);return void(t.value=e+".")}}const r=this.parseInput(i);if(null!==r){if(r<this.min)return void(t.value=this.displayValue);if(r>this.max)return void(t.value=this.displayValue);this.internalValue=r,this.displayValue=this.formatWithCommas(r),t.value=this.displayValue}else t.value=this.displayValue};handleFocus=e=>{this.focused=!0,this.focus?.emit(e)};handleBlur=async e=>{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(e)};handleKeyDown=e=>{"ArrowUp"===e.key?(e.preventDefault(),this.handleIncrement()):"ArrowDown"===e.key&&(e.preventDefault(),this.handleDecrement())};handleIncrement=()=>{if(this.isIncrementDisabled())return;const e=this.internalValue??this.min??0;let t=e+this.step;t>this.max&&(t=this.max),t!==e&&(this.internalValue=t)};handleDecrement=()=>{if(this.isDecrementDisabled())return;const e=this.internalValue??this.min??0;let t=e-this.step;t<this.min&&(t=this.min),t!==e&&(this.internalValue=t)};render(){const e=b[this.size]??b.sm,t="md"===this.size?14:12;return i("sd-field",{key:"f81b01b27960130cbf6b37a29fc0ddc11750768e",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:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-number-input-font-size":e.fontSize+"px","--sd-number-input-line-height":e.lineHeight+"px","--sd-number-input-font-weight":e.fontWeight,"--sd-number-input-padding-x":e.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":e.height+"px","--sd-system-radius-field-sm":e.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:"0f9b5a0b966c7d51d5913c61a585ff789fa4973f",class:"sd-number-input__content"},this.useButton&&i("button",{key:"b037ee3062253bf229f9639dd04c7475657fabb6",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--decrement",disabled:this.isDecrementDisabled(),onClick:this.handleDecrement,tabindex:-1},i("sd-icon",{key:"39a9f73a15008a481e758e663e027cd4f6454146",name:"minus",size:t,color:this.isDecrementDisabled()?f.icon.disabled:f.icon.default})),this.inputPrefix&&i("span",{key:"050334ce25bb767e7f11dca886d4aeecaa1ed3dc",class:"sd-number-input__prefix"},this.inputPrefix),i("input",{key:"a72697d136eeee52ef23fee6ee2017b6dd37e54c",name:this.name,ref:e=>this.nativeEl=e,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:"845202622b3377add18782d96d0af0c49caf95ec",class:"sd-number-input__suffix"},this.inputSuffix),this.useButton&&i("button",{key:"208c976c1b755bec0cd7efb5ceacb3e07dce3a7d",type:"button",class:"sd-number-input__stepper sd-number-input__stepper--increment",disabled:this.isIncrementDisabled(),onClick:this.handleIncrement,tabindex:-1},i("sd-icon",{key:"fe9848c8f044d01378dc183a80d3f81eb56a67f9",name:"add",size:t,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((e=>{switch(e){case"sd-number-input":customElements.get(n(e))||customElements.define(n(e),_);break;case"sd-button":customElements.get(n(e))||d();break;case"sd-field":customElements.get(n(e))||u();break;case"sd-floating-portal":customElements.get(n(e))||a();break;case"sd-icon":customElements.get(n(e))||o();break;case"sd-tooltip":customElements.get(n(e))||l()}}))};export{v as SdNumberInput,w as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p-DUqX35W_.js";const p=o,r=s;export{p as SdSelectDropdown,r as defineCustomElement}
1
+ import{S as o,d as s}from"./p-BkUclgga.js";const a=o,p=s;export{a as SdSelectDropdown,p as defineCustomElement}