@solid-design-system/components 3.22.4 → 3.22.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. package/dist/components/es/select.js +1 -1
  2. package/dist/components/es/tag.js +1 -1
  3. package/dist/components/es/textarea.js +1 -1
  4. package/dist/components/umd/solid-components.js +2 -2
  5. package/dist/custom-elements.json +1 -1
  6. package/dist/package/components/select/select.js +1 -1
  7. package/dist/package/components/tag/tag.d.ts +1 -0
  8. package/dist/package/components/tag/tag.js +5 -1
  9. package/dist/package/components/textarea/textarea.js +1 -1
  10. package/dist/versioned-components/es/accordion-group.js +1 -1
  11. package/dist/versioned-components/es/accordion.js +1 -1
  12. package/dist/versioned-components/es/audio.js +1 -1
  13. package/dist/versioned-components/es/badge.js +1 -1
  14. package/dist/versioned-components/es/brandshape.js +1 -1
  15. package/dist/versioned-components/es/button.js +1 -1
  16. package/dist/versioned-components/es/carousel-item.js +1 -1
  17. package/dist/versioned-components/es/carousel.js +3 -3
  18. package/dist/versioned-components/es/checkbox-group.js +1 -1
  19. package/dist/versioned-components/es/checkbox.js +1 -1
  20. package/dist/versioned-components/es/dialog.js +1 -1
  21. package/dist/versioned-components/es/divider.js +1 -1
  22. package/dist/versioned-components/es/drawer.js +1 -1
  23. package/dist/versioned-components/es/dropdown.js +1 -1
  24. package/dist/versioned-components/es/expandable.js +1 -1
  25. package/dist/versioned-components/es/flipcard.js +1 -1
  26. package/dist/versioned-components/es/form.js +1 -1
  27. package/dist/versioned-components/es/header.js +1 -1
  28. package/dist/versioned-components/es/icon.js +1 -1
  29. package/dist/versioned-components/es/include.js +1 -1
  30. package/dist/versioned-components/es/input.js +1 -1
  31. package/dist/versioned-components/es/link.js +1 -1
  32. package/dist/versioned-components/es/map-marker.js +1 -1
  33. package/dist/versioned-components/es/navigation-item.js +1 -1
  34. package/dist/versioned-components/es/notification.js +1 -1
  35. package/dist/versioned-components/es/option.js +1 -1
  36. package/dist/versioned-components/es/quickfact.js +1 -1
  37. package/dist/versioned-components/es/radio-button.js +1 -1
  38. package/dist/versioned-components/es/radio-group.js +1 -1
  39. package/dist/versioned-components/es/radio.js +1 -1
  40. package/dist/versioned-components/es/scrollable.js +1 -1
  41. package/dist/versioned-components/es/select.js +3 -3
  42. package/dist/versioned-components/es/solid-components2.js +1 -1
  43. package/dist/versioned-components/es/spinner.js +1 -1
  44. package/dist/versioned-components/es/step-group.js +1 -1
  45. package/dist/versioned-components/es/step.js +1 -1
  46. package/dist/versioned-components/es/switch.js +1 -1
  47. package/dist/versioned-components/es/tab-group.js +1 -1
  48. package/dist/versioned-components/es/tab-panel.js +1 -1
  49. package/dist/versioned-components/es/tab.js +1 -1
  50. package/dist/versioned-components/es/tag.js +1 -1
  51. package/dist/versioned-components/es/teaser-media.js +1 -1
  52. package/dist/versioned-components/es/teaser.js +1 -1
  53. package/dist/versioned-components/es/textarea.js +1 -1
  54. package/dist/versioned-components/es/tooltip.js +2 -2
  55. package/dist/versioned-components/es/video.js +1 -1
  56. package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
  57. package/dist/versioned-package/_components/button-group/button-group.js +11 -11
  58. package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
  59. package/dist/versioned-package/components/accordion/accordion.js +2 -2
  60. package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
  61. package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
  62. package/dist/versioned-package/components/audio/audio.d.ts +1 -1
  63. package/dist/versioned-package/components/audio/audio.js +6 -6
  64. package/dist/versioned-package/components/badge/badge.d.ts +1 -1
  65. package/dist/versioned-package/components/badge/badge.js +1 -1
  66. package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
  67. package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
  68. package/dist/versioned-package/components/button/button.d.ts +1 -1
  69. package/dist/versioned-package/components/button/button.js +4 -4
  70. package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
  71. package/dist/versioned-package/components/carousel/carousel.js +6 -6
  72. package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
  73. package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
  74. package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
  75. package/dist/versioned-package/components/checkbox/checkbox.js +3 -3
  76. package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
  77. package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
  78. package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
  79. package/dist/versioned-package/components/dialog/dialog.js +2 -2
  80. package/dist/versioned-package/components/divider/divider.d.ts +1 -1
  81. package/dist/versioned-package/components/divider/divider.js +2 -2
  82. package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
  83. package/dist/versioned-package/components/drawer/drawer.js +2 -2
  84. package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
  85. package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
  86. package/dist/versioned-package/components/expandable/expandable.d.ts +1 -1
  87. package/dist/versioned-package/components/expandable/expandable.js +2 -2
  88. package/dist/versioned-package/components/flipcard/flipcard.d.ts +1 -1
  89. package/dist/versioned-package/components/flipcard/flipcard.js +1 -1
  90. package/dist/versioned-package/components/header/header.d.ts +1 -1
  91. package/dist/versioned-package/components/header/header.js +4 -4
  92. package/dist/versioned-package/components/icon/icon.d.ts +1 -1
  93. package/dist/versioned-package/components/icon/icon.js +1 -1
  94. package/dist/versioned-package/components/include/include.d.ts +1 -1
  95. package/dist/versioned-package/components/include/include.js +1 -1
  96. package/dist/versioned-package/components/input/input.d.ts +1 -1
  97. package/dist/versioned-package/components/input/input.js +3 -3
  98. package/dist/versioned-package/components/link/link.d.ts +1 -1
  99. package/dist/versioned-package/components/link/link.js +2 -2
  100. package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
  101. package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
  102. package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
  103. package/dist/versioned-package/components/navigation-item/navigation-item.js +5 -5
  104. package/dist/versioned-package/components/notification/notification.d.ts +1 -1
  105. package/dist/versioned-package/components/notification/notification.js +5 -5
  106. package/dist/versioned-package/components/option/option.d.ts +1 -1
  107. package/dist/versioned-package/components/option/option.js +2 -2
  108. package/dist/versioned-package/components/popup/popup.d.ts +1 -1
  109. package/dist/versioned-package/components/popup/popup.js +1 -1
  110. package/dist/versioned-package/components/quickfact/quickfact.d.ts +1 -1
  111. package/dist/versioned-package/components/quickfact/quickfact.js +2 -2
  112. package/dist/versioned-package/components/radio/radio.d.ts +1 -1
  113. package/dist/versioned-package/components/radio/radio.js +2 -2
  114. package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
  115. package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
  116. package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
  117. package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
  118. package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
  119. package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
  120. package/dist/versioned-package/components/select/select.d.ts +4 -4
  121. package/dist/versioned-package/components/select/select.js +26 -26
  122. package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
  123. package/dist/versioned-package/components/spinner/spinner.js +1 -1
  124. package/dist/versioned-package/components/step/step.d.ts +1 -1
  125. package/dist/versioned-package/components/step/step.js +2 -2
  126. package/dist/versioned-package/components/step-group/step-group.d.ts +1 -1
  127. package/dist/versioned-package/components/step-group/step-group.js +2 -2
  128. package/dist/versioned-package/components/switch/switch.d.ts +1 -1
  129. package/dist/versioned-package/components/switch/switch.js +1 -1
  130. package/dist/versioned-package/components/tab/tab.d.ts +1 -1
  131. package/dist/versioned-package/components/tab/tab.js +2 -2
  132. package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
  133. package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
  134. package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
  135. package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
  136. package/dist/versioned-package/components/tag/tag.d.ts +2 -1
  137. package/dist/versioned-package/components/tag/tag.js +7 -3
  138. package/dist/versioned-package/components/teaser/teaser.js +1 -1
  139. package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
  140. package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
  141. package/dist/versioned-package/components/textarea/textarea.js +2 -2
  142. package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
  143. package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
  144. package/dist/versioned-package/components/video/video.d.ts +1 -1
  145. package/dist/versioned-package/components/video/video.js +2 -2
  146. package/dist/versioned-package/internal/form.js +3 -3
  147. package/dist/versioned-package/styles/headline/headline.css.js +1 -1
  148. package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
  149. package/dist/versioned-styles/solid-styles.css +1 -1
  150. package/dist/vscode.html-custom-data.json +55 -45
  151. package/dist/web-types.json +74 -46
  152. package/package.json +1 -1
@@ -4,4 +4,4 @@ import{s as t,a as e}from"./animate.js";import{S as s,L as i,x as o,t as l,j as
4
4
  removable-indicator:tag__removable-indicator,
5
5
  " size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-option")]}getFirstOption(){return this.querySelector("sd-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?x(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=m(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&g(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=m(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,O(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,O(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,a=this.clearable&&!this.disabled&&this.value.length>0,n=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",r=this.disabled?"cursor-not-allowed":"cursor-pointer",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],p={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${l("relative text-left",r,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${s&&"inline-block"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${l("relative w-full bg-white","disabled"===n?"text-neutral-500":"text-black")}"><div part="border" class="${l("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[n],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${l("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
6
6
  popup:popup__content,
7
- "><div part="combobox" class="${l("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${l("appearance-none outline-none flex-grow bg-transparent w-full",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text invalid-message" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${l("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${a?o`<button part="clear-button" class="${l("select__clear flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${l("text-icon-fill-neutral-800",p)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-icon part="invalid-icon" class="${l(h,p,"text-error")}" library="system" name="risk"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-icon part="valid-icon" class="${l("flex-shrink-0 text-success",h,p)}" library="system" name="status-check"></sd-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${l("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",p)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${l("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-icon":w,"sd-popup":a,"sd-tag":S},I.styles=[n,s.styles,r`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([f({selector:"sd-option"})],I.prototype,"_optionsInDefaultSlot",2),D([h("sd-popup")],I.prototype,"popup",2),D([h('[part="combobox"]')],I.prototype,"combobox",2),D([h('[part="display-input"]')],I.prototype,"displayInput",2),D([h(".value-input")],I.prototype,"valueInput",2),D([h('[part="listbox"]')],I.prototype,"listbox",2),D([h("#invalid-message")],I.prototype,"invalidMessage",2),D([v()],I.prototype,"hasHover",2),D([v()],I.prototype,"displayLabel",2),D([v()],I.prototype,"hasFocus",2),D([v()],I.prototype,"currentOption",2),D([v()],I.prototype,"selectedOptions",2),D([v()],I.prototype,"showValidStyle",2),D([v()],I.prototype,"showInvalidStyle",2),D([c()],I.prototype,"defaultValue",2),D([p({type:Boolean,reflect:!0})],I.prototype,"open",2),D([p({reflect:!0})],I.prototype,"size",2),D([p({reflect:!0})],I.prototype,"placement",2),D([p()],I.prototype,"label",2),D([p()],I.prototype,"placeholder",2),D([p({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([p({attribute:"help-text"})],I.prototype,"helpText",2),D([v()],I.prototype,"currentPlacement",2),D([p({type:Boolean})],I.prototype,"clearable",2),D([p({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([p({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([p({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([p({reflect:!0})],I.prototype,"form",2),D([p()],I.prototype,"name",2),D([p({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([p({type:Boolean,reflect:!0})],I.prototype,"required",2),D([p({type:Boolean,reflect:!0,attribute:"style-on-valid"})],I.prototype,"styleOnValid",2),D([p({type:Boolean})],I.prototype,"hoist",2),D([p()],I.prototype,"getTag",2),D([C("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([C("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([C("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([C("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([C("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([d("sd-select")],I),y("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),y("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
7
+ "><div part="combobox" class="${l("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${l("appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text invalid-message" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${l("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${a?o`<button part="clear-button" class="${l("select__clear flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${l("text-icon-fill-neutral-800",p)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-icon part="invalid-icon" class="${l(h,p,"text-error")}" library="system" name="risk"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-icon part="valid-icon" class="${l("flex-shrink-0 text-success",h,p)}" library="system" name="status-check"></sd-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${l("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",p)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${l("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-icon":w,"sd-popup":a,"sd-tag":S},I.styles=[n,s.styles,r`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([f({selector:"sd-option"})],I.prototype,"_optionsInDefaultSlot",2),D([h("sd-popup")],I.prototype,"popup",2),D([h('[part="combobox"]')],I.prototype,"combobox",2),D([h('[part="display-input"]')],I.prototype,"displayInput",2),D([h(".value-input")],I.prototype,"valueInput",2),D([h('[part="listbox"]')],I.prototype,"listbox",2),D([h("#invalid-message")],I.prototype,"invalidMessage",2),D([v()],I.prototype,"hasHover",2),D([v()],I.prototype,"displayLabel",2),D([v()],I.prototype,"hasFocus",2),D([v()],I.prototype,"currentOption",2),D([v()],I.prototype,"selectedOptions",2),D([v()],I.prototype,"showValidStyle",2),D([v()],I.prototype,"showInvalidStyle",2),D([c()],I.prototype,"defaultValue",2),D([p({type:Boolean,reflect:!0})],I.prototype,"open",2),D([p({reflect:!0})],I.prototype,"size",2),D([p({reflect:!0})],I.prototype,"placement",2),D([p()],I.prototype,"label",2),D([p()],I.prototype,"placeholder",2),D([p({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([p({attribute:"help-text"})],I.prototype,"helpText",2),D([v()],I.prototype,"currentPlacement",2),D([p({type:Boolean})],I.prototype,"clearable",2),D([p({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([p({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([p({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([p({reflect:!0})],I.prototype,"form",2),D([p()],I.prototype,"name",2),D([p({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([p({type:Boolean,reflect:!0})],I.prototype,"required",2),D([p({type:Boolean,reflect:!0,attribute:"style-on-valid"})],I.prototype,"styleOnValid",2),D([p({type:Boolean})],I.prototype,"hoist",2),D([p()],I.prototype,"getTag",2),D([C("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([C("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([C("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([C("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([C("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([d("sd-select")],I),y("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),y("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
@@ -1 +1 @@
1
- import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-icon library="system" name="close" label="remove"></sd-icon></slot>`:""}</${r}>`}};b.styles=[e.styles,r`:host{display:inline-block}`],h([s("a, button")],b.prototype,"tag",2),h([o({reflect:!0})],b.prototype,"size",2),h([o({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([o({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([o()],b.prototype,"href",2),h([o()],b.prototype,"target",2),h([o()],b.prototype,"download",2),b=h([i("sd-tag")],b);export{b as default};
1
+ import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.toggleable=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" aria-pressed="${d(this.toggleable?this.selected:void 0)}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-icon library="system" name="close" label="remove"></sd-icon></slot>`:""}</${r}>`}};b.styles=[e.styles,r`:host{display:inline-block}`],h([s("a, button")],b.prototype,"tag",2),h([o({reflect:!0})],b.prototype,"size",2),h([o({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([o({type:Boolean,reflect:!0})],b.prototype,"toggleable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([o()],b.prototype,"href",2),h([o()],b.prototype,"target",2),h([o()],b.prototype,"download",2),b=h([i("sd-tag")],b);export{b as default};
@@ -1 +1 @@
1
- import{S as t,x as e,t as a,c as l,i as s,e as i,n as o,a as r}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,i=l>1?void 0:l?b(e,a):e,o=t.length-1;o>=0;o--)(s=t[o])&&(i=(l?s(e,a,i):s(i))||i);return l&&i&&m(e,a,i),i};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,i=!!this.helpText||!!l,o=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",r="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(s?"inline-block":"hidden",r)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[o])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===o?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",r)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text invalid-message" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-icon class="${a("text-error absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-icon class="${a("text-success absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="status-check" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",i?"block":"hidden")}" aria-hidden="${i?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};v.styles=[l,t.styles,s`:host{display:block;height:100%}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],f([i("#input")],v.prototype,"textarea",2),f([i("#invalid-message")],v.prototype,"invalidMessage",2),f([c()],v.prototype,"hasFocus",2),f([c()],v.prototype,"showValidStyle",2),f([c()],v.prototype,"showInvalidStyle",2),f([o()],v.prototype,"title",2),f([o()],v.prototype,"name",2),f([o()],v.prototype,"value",2),f([o({reflect:!0})],v.prototype,"size",2),f([o()],v.prototype,"label",2),f([o({attribute:"help-text"})],v.prototype,"helpText",2),f([o()],v.prototype,"placeholder",2),f([o({type:Number})],v.prototype,"rows",2),f([o({type:Boolean,reflect:!0})],v.prototype,"disabled",2),f([o({type:Boolean,reflect:!0})],v.prototype,"readonly",2),f([o({reflect:!0})],v.prototype,"form",2),f([o({type:Boolean,reflect:!0})],v.prototype,"required",2),f([o({type:Number})],v.prototype,"minlength",2),f([o({type:Number})],v.prototype,"maxlength",2),f([o()],v.prototype,"autocapitalize",2),f([o()],v.prototype,"autocorrect",2),f([o()],v.prototype,"autocomplete",2),f([o({type:Boolean})],v.prototype,"autofocus",2),f([o()],v.prototype,"enterkeyhint",2),f([o({type:Boolean,reflect:!0,attribute:"style-on-valid"})],v.prototype,"styleOnValid",2),f([o({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],v.prototype,"spellcheck",2),f([o()],v.prototype,"inputmode",2),f([h()],v.prototype,"defaultValue",2),f([y("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"handleDisabledChange",1),f([y("rows",{waitUntilFirstUpdate:!0})],v.prototype,"handleRowsChange",1),f([y("value",{waitUntilFirstUpdate:!0})],v.prototype,"handleValueChange",1),v=f([r("sd-textarea")],v);export{v as default};
1
+ import{S as t,x as e,t as a,c as l,i as s,e as i,n as o,a as r}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,i=l>1?void 0:l?b(e,a):e,o=t.length-1;o>=0;o--)(s=t[o])&&(i=(l?s(e,a,i):s(i))||i);return l&&i&&m(e,a,i),i};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,i=!!this.helpText||!!l,o=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",r="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(s?"inline-block":"hidden",r)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[o])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===o?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",r)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-icon class="${a("text-error absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-icon class="${a("text-success absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="status-check" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",i?"block":"hidden")}" aria-hidden="${i?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};v.styles=[l,t.styles,s`:host{display:block;height:100%}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],f([i("#input")],v.prototype,"textarea",2),f([i("#invalid-message")],v.prototype,"invalidMessage",2),f([c()],v.prototype,"hasFocus",2),f([c()],v.prototype,"showValidStyle",2),f([c()],v.prototype,"showInvalidStyle",2),f([o()],v.prototype,"title",2),f([o()],v.prototype,"name",2),f([o()],v.prototype,"value",2),f([o({reflect:!0})],v.prototype,"size",2),f([o()],v.prototype,"label",2),f([o({attribute:"help-text"})],v.prototype,"helpText",2),f([o()],v.prototype,"placeholder",2),f([o({type:Number})],v.prototype,"rows",2),f([o({type:Boolean,reflect:!0})],v.prototype,"disabled",2),f([o({type:Boolean,reflect:!0})],v.prototype,"readonly",2),f([o({reflect:!0})],v.prototype,"form",2),f([o({type:Boolean,reflect:!0})],v.prototype,"required",2),f([o({type:Number})],v.prototype,"minlength",2),f([o({type:Number})],v.prototype,"maxlength",2),f([o()],v.prototype,"autocapitalize",2),f([o()],v.prototype,"autocorrect",2),f([o()],v.prototype,"autocomplete",2),f([o({type:Boolean})],v.prototype,"autofocus",2),f([o()],v.prototype,"enterkeyhint",2),f([o({type:Boolean,reflect:!0,attribute:"style-on-valid"})],v.prototype,"styleOnValid",2),f([o({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],v.prototype,"spellcheck",2),f([o()],v.prototype,"inputmode",2),f([h()],v.prototype,"defaultValue",2),f([y("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"handleDisabledChange",1),f([y("rows",{waitUntilFirstUpdate:!0})],v.prototype,"handleRowsChange",1),f([y("value",{waitUntilFirstUpdate:!0})],v.prototype,"handleValueChange",1),v=f([r("sd-textarea")],v);export{v as default};