@solid-design-system/components 5.15.11 → 5.15.13
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.
- package/cdn/chunks/chunk.HAL7R4WT.js +1 -0
- package/cdn/chunks/chunk.K7JNBY7N.js +1 -0
- package/cdn/chunks/chunk.US3OB3XU.js +1 -0
- package/cdn/components/tab-group/tab-group.d.ts +1 -0
- package/cdn/components/tab-group/tab-group.js +1 -1
- package/cdn/custom-elements.json +1 -1
- package/cdn/solid-components.bundle.js +1 -1
- package/cdn/solid-components.iife.js +1 -1
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/chunks/chunk.2KRS2HQF.js +1 -1
- package/cdn-versioned/chunks/chunk.2UNWLMKE.js +1 -1
- package/cdn-versioned/chunks/chunk.2YG34O7F.js +1 -1
- package/cdn-versioned/chunks/chunk.35PQ7S2O.js +1 -1
- package/cdn-versioned/chunks/chunk.3JOVDAJX.js +1 -1
- package/cdn-versioned/chunks/chunk.3UAOIDF2.js +1 -1
- package/cdn-versioned/chunks/chunk.4RHXHQ7H.js +1 -1
- package/cdn-versioned/chunks/chunk.5CAMYQMD.js +1 -1
- package/cdn-versioned/chunks/chunk.5HQBAJ66.js +1 -1
- package/cdn-versioned/chunks/chunk.AEVPJRUQ.js +1 -1
- package/cdn-versioned/chunks/chunk.ALSSHD3Q.js +1 -1
- package/cdn-versioned/chunks/chunk.ARYMSO7N.js +1 -1
- package/cdn-versioned/chunks/chunk.AVUZZRFT.js +1 -1
- package/cdn-versioned/chunks/chunk.BFDYLZMG.js +1 -1
- package/cdn-versioned/chunks/chunk.BZJ7O5ES.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.CJ53PV6X.js +1 -1
- package/cdn-versioned/chunks/chunk.CODHT433.js +1 -1
- package/cdn-versioned/chunks/chunk.CVNGM52W.js +1 -1
- package/cdn-versioned/chunks/chunk.CWOKJQSQ.js +1 -1
- package/cdn-versioned/chunks/chunk.DKN2DIAH.js +1 -1
- package/cdn-versioned/chunks/chunk.EGDPRSOF.js +1 -1
- package/cdn-versioned/chunks/chunk.ET34FEK2.js +2 -2
- package/cdn-versioned/chunks/chunk.FAPJVEMZ.js +1 -1
- package/cdn-versioned/chunks/chunk.FSATHYQT.js +1 -1
- package/cdn-versioned/chunks/chunk.GEOVNECI.js +1 -1
- package/cdn-versioned/chunks/chunk.HAL7R4WT.js +1 -0
- package/cdn-versioned/chunks/chunk.HJ4O4XQA.js +1 -1
- package/cdn-versioned/chunks/chunk.HX23UDYZ.js +1 -1
- package/cdn-versioned/chunks/chunk.HYCWRAJB.js +1 -1
- package/cdn-versioned/chunks/chunk.ISZAAZUB.js +1 -1
- package/cdn-versioned/chunks/chunk.IWPBSEAW.js +1 -1
- package/cdn-versioned/chunks/chunk.JCU3EXPE.js +1 -1
- package/cdn-versioned/chunks/chunk.JXQJUYEC.js +1 -1
- package/cdn-versioned/chunks/chunk.K7JNBY7N.js +1 -0
- package/cdn-versioned/chunks/chunk.KOERGSAL.js +1 -1
- package/cdn-versioned/chunks/chunk.MRAHMGRF.js +1 -1
- package/cdn-versioned/chunks/chunk.NRBNWX7R.js +1 -1
- package/cdn-versioned/chunks/chunk.O4L5OULX.js +1 -1
- package/cdn-versioned/chunks/chunk.OG46JDG7.js +2 -2
- package/cdn-versioned/chunks/chunk.P6QOQEIF.js +1 -1
- package/cdn-versioned/chunks/chunk.PZC43SIH.js +1 -1
- package/cdn-versioned/chunks/chunk.R3WH26GI.js +1 -1
- package/cdn-versioned/chunks/chunk.R5PJYTZQ.js +4 -4
- package/cdn-versioned/chunks/chunk.RXMJRA5Q.js +1 -1
- package/cdn-versioned/chunks/chunk.SGXM6Y2P.js +1 -1
- package/cdn-versioned/chunks/chunk.SJLZKEAQ.js +1 -1
- package/cdn-versioned/chunks/chunk.SX2XEIQL.js +1 -1
- package/cdn-versioned/chunks/chunk.TJ7ZA5LO.js +1 -1
- package/cdn-versioned/chunks/chunk.TL3K6WJI.js +1 -1
- package/cdn-versioned/chunks/chunk.TUU3QZXR.js +1 -1
- package/cdn-versioned/chunks/chunk.UBEW2PY5.js +1 -1
- package/cdn-versioned/chunks/chunk.US3OB3XU.js +1 -0
- package/cdn-versioned/chunks/chunk.UXY3AL7C.js +1 -1
- package/cdn-versioned/chunks/chunk.VFOVKA46.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.XEK5QKES.js +1 -1
- package/cdn-versioned/chunks/chunk.Y7AL7I2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.YFGMDOCE.js +1 -1
- package/cdn-versioned/chunks/chunk.YHHVM7YY.js +1 -1
- package/cdn-versioned/chunks/chunk.ZA3AQWM7.js +4 -4
- package/cdn-versioned/chunks/chunk.ZNWCIW62.js +1 -1
- package/cdn-versioned/chunks/chunk.ZQBF4WJL.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/loader/loader.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/menu/menu.d.ts +1 -1
- package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/cdn-versioned/components/range/range.d.ts +1 -1
- package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +2 -1
- package/cdn-versioned/components/tab-group/tab-group.js +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +238 -238
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +14 -14
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +14 -14
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +91 -91
- package/cdn-versioned/web-types.json +154 -154
- package/dist/chunks/{chunk.U6R2MYFD.js → chunk.4D3N4MVV.js} +6 -1
- package/dist/chunks/chunk.HAL7R4WT.js +1 -0
- package/dist/components/tab-group/tab-group.d.ts +1 -0
- package/dist/components/tab-group/tab-group.js +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/solid-components.js +1 -1
- package/dist/web-types.json +1 -1
- package/dist-versioned/chunks/chunk.23KFQ6DK.js +2 -2
- package/dist-versioned/chunks/chunk.34OZXOJP.js +1 -1
- package/dist-versioned/chunks/chunk.45BEUHRF.js +2 -2
- package/dist-versioned/chunks/{chunk.U6R2MYFD.js → chunk.4D3N4MVV.js} +20 -15
- package/dist-versioned/chunks/chunk.5YOGUSPL.js +26 -26
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6ITI3HNP.js +3 -3
- package/dist-versioned/chunks/chunk.6MHK4U6F.js +12 -12
- package/dist-versioned/chunks/chunk.7UTPAUSQ.js +2 -2
- package/dist-versioned/chunks/chunk.A2M7C3CD.js +1 -1
- package/dist-versioned/chunks/chunk.AKPCSVRG.js +1 -1
- package/dist-versioned/chunks/chunk.AKX7VXML.js +6 -6
- package/dist-versioned/chunks/chunk.AYDMEA3C.js +4 -4
- package/dist-versioned/chunks/chunk.BUFXMACO.js +2 -2
- package/dist-versioned/chunks/chunk.CFBWKOJD.js +1 -1
- package/dist-versioned/chunks/chunk.DHRQZSXG.js +8 -8
- package/dist-versioned/chunks/chunk.DQ6G3W3V.js +2 -2
- package/dist-versioned/chunks/chunk.E57K3AFR.js +1 -1
- package/dist-versioned/chunks/chunk.HAL7R4WT.js +1 -0
- package/dist-versioned/chunks/chunk.HOXI77KQ.js +3 -3
- package/dist-versioned/chunks/chunk.HP7WJYO4.js +2 -2
- package/dist-versioned/chunks/chunk.HYPCYXQP.js +1 -1
- package/dist-versioned/chunks/chunk.I7VRBYGO.js +2 -2
- package/dist-versioned/chunks/chunk.IAL4GVA4.js +5 -5
- package/dist-versioned/chunks/chunk.IRZ3M2OA.js +1 -1
- package/dist-versioned/chunks/chunk.IUS3S54L.js +2 -2
- package/dist-versioned/chunks/chunk.JM3YRKVA.js +3 -3
- package/dist-versioned/chunks/chunk.JMHQQHEP.js +2 -2
- package/dist-versioned/chunks/chunk.JOYITBGJ.js +2 -2
- package/dist-versioned/chunks/chunk.JTKHYOJO.js +12 -12
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.KVLD4JWK.js +5 -5
- package/dist-versioned/chunks/chunk.M5FO7PXK.js +4 -4
- package/dist-versioned/chunks/chunk.MBFZWG5H.js +3 -3
- package/dist-versioned/chunks/chunk.NVXUSMMW.js +2 -2
- package/dist-versioned/chunks/chunk.PEAIITW7.js +5 -5
- package/dist-versioned/chunks/chunk.PHHK74M7.js +6 -6
- package/dist-versioned/chunks/chunk.PPVX563E.js +2 -2
- package/dist-versioned/chunks/chunk.PRTWW2BW.js +1 -1
- package/dist-versioned/chunks/chunk.Q44CB3ZY.js +2 -2
- package/dist-versioned/chunks/chunk.QAJG6PYM.js +1 -1
- package/dist-versioned/chunks/chunk.QDZS6M4T.js +3 -3
- package/dist-versioned/chunks/chunk.QZBSHWMK.js +5 -5
- package/dist-versioned/chunks/chunk.R735ROML.js +1 -1
- package/dist-versioned/chunks/chunk.RAYANOK2.js +4 -4
- package/dist-versioned/chunks/chunk.RRNLIX2S.js +3 -3
- package/dist-versioned/chunks/chunk.S3BSVYPB.js +1 -1
- package/dist-versioned/chunks/chunk.SDWNASDC.js +3 -3
- package/dist-versioned/chunks/chunk.SE4CTFYY.js +1 -1
- package/dist-versioned/chunks/chunk.SJPDNEHE.js +3 -3
- package/dist-versioned/chunks/chunk.T2AOG5F2.js +24 -24
- package/dist-versioned/chunks/chunk.T6DXPJAI.js +1 -1
- package/dist-versioned/chunks/chunk.TIBLXIJV.js +6 -6
- package/dist-versioned/chunks/chunk.TKJFMHFU.js +2 -2
- package/dist-versioned/chunks/chunk.TMWT3ROD.js +2 -2
- package/dist-versioned/chunks/chunk.UAVNEMEF.js +1 -1
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.VMVBXZ2U.js +1 -1
- package/dist-versioned/chunks/chunk.WWBNZDY7.js +11 -11
- package/dist-versioned/chunks/chunk.WZZP5YIS.js +1 -1
- package/dist-versioned/chunks/chunk.XCQC3F3H.js +3 -3
- package/dist-versioned/chunks/chunk.Z2RQUXP5.js +2 -2
- package/dist-versioned/components/accordion/accordion.d.ts +1 -1
- package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist-versioned/components/animation/animation.d.ts +1 -1
- package/dist-versioned/components/audio/audio.d.ts +1 -1
- package/dist-versioned/components/badge/badge.d.ts +1 -1
- package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/dist-versioned/components/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +1 -1
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/loader/loader.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/menu/menu.d.ts +1 -1
- package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/dist-versioned/components/range/range.d.ts +1 -1
- package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- package/dist-versioned/components/spinner/spinner.d.ts +1 -1
- package/dist-versioned/components/step/step.d.ts +1 -1
- package/dist-versioned/components/step-group/step-group.d.ts +1 -1
- package/dist-versioned/components/switch/switch.d.ts +1 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +2 -1
- package/dist-versioned/components/tab-group/tab-group.js +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +238 -238
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +1 -1
- package/dist-versioned/vscode.html-custom-data.json +91 -91
- package/dist-versioned/web-types.json +154 -154
- package/package.json +1 -1
- package/cdn/chunks/chunk.ON26SYWV.js +0 -1
- package/cdn-versioned/chunks/chunk.ON26SYWV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as c,c as _}from"./chunk.IVHEBGOY.js";import{a as A}from"./chunk.EJI65G6N.js";import{b as E}from"./chunk.NRBNWX7R.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as b}from"./chunk.CHU57RUD.js";import{a as m}from"./chunk.YEDQWNIV.js";import{a as w}from"./chunk.Y7NVH75J.js";import{a as C,b as h,d as f,e as D,h as T}from"./chunk.TJ7ZA5LO.js";import{b as I,e as v}from"./chunk.RZUTJ36B.js";import{e as n}from"./chunk.TJOCV4DC.js";var l=class extends T{constructor(){super();this.formControlController=new E(this);this.hasSlotController=new M(this,"label","help-text");this.localize=new w(this);this.name="";this.label="";this.helpText="";this.min=0;this.max=100;this.step=1;this.disabled=!1;this.visuallyDisabled=!1;this.noTrackBar=!1;this.noTooltip=!1;this.defaultValue="";this._value=[0];this._rangeValues=new Map;this._lastChangeValue=[];this._hasFocus=!1;this.tooltipFormatter=this.localize.number.bind(this.localize)}set value(e){this._value=e?e.split(" ").map(Number).sort(p):[]}get value(){return this._value.slice().sort(p).join(" ")}set valueAsArray(e){let t=this._value;this._value=Array.isArray(e)?e.slice().sort(p):e||[],c(t,this._value)&&this.requestUpdate("value",t.join(" "))}get valueAsArray(){return[...this._value].sort(p)}get rtl(){return this.localize.dir()==="rtl"}firstUpdated(){this.formControlController.updateValidity(),this._lastChangeValue=Array.from(this._value)}willUpdate(e){super.willUpdate(e),this.min>this.max&&([this.min,this.max]=[this.max,this.min]),this.step>this.max-this.min&&(this.step=this.max-this.min),this.step<=0&&(this.step=1);let t=this._value.map(i=>{if(i<=this.min)return this.min;if(i>=this.max)return this.max;let a=this.min+this.step*Math.round((i-this.min)/this.step);return a>this.max?this.max:a});c(this._value,t)&&(this._value=t)}updated(e){super.updated(e);for(let t of this.thumbs){let i=+t.dataset.rangeId;this._rangeValues.has(i)&&this.moveThumb(t,this._rangeValues.get(i))}this.updateActiveTrack()}focus(e){let t=this.thumbs.item(0);t?t.focus(e):super.focus(e)}get validity(){return this.input.validity}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}updateTooltip(e){let t=+e.dataset.rangeId;if(!this._rangeValues.has(t))return;let i=this._rangeValues.get(t),a=e.parentElement;a.content=this.tooltipFormatter(i)}updateActiveTrack(){let{activeTrack:e}=this;if(!e)return;if(this.min===this.max){e.style.insetInlineStart="0%",e.style.insetInlineEnd="0%";return}if(this._value.length===1){let s=getComputedStyle(this).getPropertyValue("--track-active-offset")||"0%",o=100*(this._value[0]-this.min)/(this.max-this.min);e.style.insetInlineStart=`min(${s}, ${o}%)`,e.style.insetInlineEnd=`min(calc(100% - ${s}), calc(100% - ${o}%))`;return}let t=this._value.slice().sort(p),i=100*(t[0]-this.min)/(this.max-this.min),a=100*(t[t.length-1]-this.min)/(this.max-this.min);e.style.insetInlineStart=`${i}%`,e.style.insetInlineEnd=`calc(100% - ${a}%)`}moveThumb(e,t){e.setAttribute("aria-valuenow",t.toString()),e.setAttribute("aria-valuetext",this.tooltipFormatter(t));let i=(t-this.min)/(this.max-this.min);e.style.insetInlineStart=`calc(${100*i}% - 8px)`,this.updateTooltip(e)}movementBoundariesForThumb(e,t){let i=this.valueAsArray,s=Array.from(this.thumbs).indexOf(e),o=i[s-1]||this.min,r=i[s+1]||this.max,u=t<o||t>r;return{finalValue:Math.max(o,Math.min(r,t)),isRestricted:u,nextValue:r,prevValue:o}}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}onClickTrack(e,t=!0){if(this.disabled||this.visuallyDisabled)return;let{clientX:i}=e,a=Array.from(this.thumbs),s=_(this.inputWrapper,i),o=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/o),u=a.reduce((g,x)=>{let V=this._rangeValues.get(+x.dataset.rangeId),L=this._rangeValues.get(+g.dataset.rangeId),$=Math.abs(V-r),k=Math.abs(L-r);return $===k?V<r?x:g:$<k?x:g}),d=+u.dataset.rangeId;if(!d)return;this._rangeValues.set(d,r),this.moveThumb(u,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),c(y,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change"));let F=new PointerEvent("pointerdown",e);t&&u.dispatchEvent(F)&&this.updateTooltip(u)}onClickTrackItem(e){this.onClickTrack(e,!1)}async onClickThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target;this.updateTooltip(t),t.dataset.pointerId&&t.releasePointerCapture(+t.dataset.pointerId),t.dataset.pointerId=e.pointerId.toString(),t.setPointerCapture(e.pointerId),t.classList.add("grabbed"),await t.parentElement.show()}onDragThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target,i=+t.dataset.rangeId;if(!this._rangeValues.has(i)||(t.dataset.pointerId?+t.dataset.pointerId:null)!==e.pointerId)return;let s=_(this.inputWrapper,e.clientX),o=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/o);if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:r}}).defaultPrevented)return;let d=this.movementBoundariesForThumb(t,r);d.isRestricted?(r=d.finalValue,t.style.zIndex=(3+this.thumbs.length).toFixed(0)):t.style.zIndex="3",this._rangeValues.set(i,r),this.moveThumb(t,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),c(y,this._value)&&this.emit("sd-input")}async onReleaseThumb(e){let t=e.target;!t.dataset.pointerId||e.pointerId!==+t.dataset.pointerId||(t.classList.remove("grabbed"),t.releasePointerCapture(e.pointerId),delete t.dataset.pointerId,c(this._lastChangeValue,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-change")),await t.parentElement.hide())}onKeyPress(e){let t=e.target,i=+t.dataset.rangeId,a=this._rangeValues.get(i);if(a===void 0)return;let s=a;switch(e.key){case"ArrowUp":case"Up":s=Math.min(a+this.step,this.max);break;case"ArrowDown":case"Down":s=Math.max(a-this.step,this.min);break;case"ArrowLeft":case"Left":s=this.rtl?Math.min(a+this.step,this.max):Math.max(a-this.step,this.min);break;case"ArrowRight":case"Right":s=this.rtl?Math.max(a-this.step,this.min):Math.min(a+this.step,this.max);break;case"PageUp":s=Math.min(a+(this.max-this.min)/5,this.max);break;case"PageDown":s=Math.max(a-(this.max-this.min)/5,this.min);break;case"Home":s=this.min;break;case"End":s=this.max;break;default:return}if(s!==a){if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:s}}).defaultPrevented)return;let r=this.movementBoundariesForThumb(t,s);r.isRestricted&&(s=r.finalValue),this.moveThumb(t,s),this._rangeValues.set(i,s),this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),this.updateTooltip(t),this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change")}e.preventDefault()}onBlur(e){var t;e.relatedTarget&&((t=this.shadowRoot)!=null&&t.contains(e.relatedTarget))||(this.emit("sd-blur"),this._hasFocus=!1)}onFocusThumb(e){var i;if(this.disabled||this.visuallyDisabled)return;this._hasFocus||(this._hasFocus=!0,this.emit("sd-focus"));let t=e.target;(i=t==null?void 0:t.dataset)!=null&&i.rangeId&&this.updateTooltip(t)}renderThumbs(e){let t=this._value.length>1;return this._rangeValues.clear(),this._value.map((i,a)=>{let s=a+1;this._rangeValues.set(s,i);let o=`thumb-${s}`,r="",u="";return t?(u=e?`label aria-label-hidden ${o}`:`aria-label-hidden ${o}`,a===0?r=`${this.localize.term("minimum")} (${this.tooltipFormatter(i)})`:a===this._value.length-1?r=`${this.localize.term("maximum")} (${this.tooltipFormatter(i)})`:r=this.tooltipFormatter(i)):u=e?"label aria-label-hidden":"",v`<sd-5-15-11-tooltip hoist trigger="focus" disabled="${b(this.disabled||this.visuallyDisabled||this.noTooltip?!0:void 0)}"><div id="${o}" part="thumb" role="slider" tabindex="${this.disabled||this.visuallyDisabled?-1:0}" aria-disabled="${b(this.disabled||this.visuallyDisabled?"true":void 0)}" aria-labelledby="${u}" aria-label="${r}" aria-valuemax="${this.max}" aria-valuemin="${this.min}" aria-valuenow="${i}" aria-valuetext="${this.tooltipFormatter(i)}" data-range-id="${s}" @pointerdown="${this.onClickThumb}" @pointermove="${this.onDragThumb}" @pointerup="${this.onReleaseThumb}" @pointercancel="${this.onReleaseThumb}" @pointerleave="${this.onReleaseThumb}" @keydown="${this.onKeyPress}" @focus="${this.onFocusThumb}" class="${m("rounded-full absolute top-0 size-4 hover:cursor-grab after:-inset-2",this.disabled||this.visuallyDisabled?"bg-neutral-500 outline-none":"bg-primary hover:bg-primary-500 cursor-pointer focus-visible:focus-outline")}"></div></sd-5-15-11-tooltip>`})}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text")},t=!!(this.label||e.label),i=!!(this.helpText||e.helpText);return v`<div part="form-control" @focusout="${this.onBlur}" class="flex flex-col">${t?v`<div class="flex items-center gap-1"><label id="label" part="form-control-label" aria-hidden="${t?"false":"true"}" class="${m("w-full",t?"inline-block":"hidden")}" @click="${this.focus}"><slot name="label">${this.label}</slot></label></div>`:null} <label id="aria-label-hidden" class="sr-only">(${this._value.map(this.tooltipFormatter).join(" - ")})</label><div part="base" class="${m("inline-flex w-full",this.visuallyDisabled&&"focus-visible:focus-outline")}" tabindex="${b(this.visuallyDisabled?"0":void 0)}"><div part="input-wrapper" class="relative flex-1 mx-2 mb-[10px]"><input id="input" tabindex="-1" hidden @invalid="${this.handleInvalid}"><div part="track-wrapper" role="presentation" @pointerdown="${this.onClickTrack}" class="relative cursor-pointer -mx-2"><div part="track-click-helper" class="absolute -inset-y-2 inset-x-0"></div><div part="track" class="${m("h-1 my-[6px]",this.disabled||this.visuallyDisabled?"bg-neutral-500":"bg-neutral-400")}"></div><div part="active-track" hidden="${b(this.noTrackBar?!0:void 0)}" class="${m("absolute top-0 h-1",this.disabled||this.visuallyDisabled?"bg-neutral-500":"bg-primary")}"></div></div>${this.renderThumbs(t)}<div class="-mt-[10px]" part="scale-ticks" @pointerdown="${this.onClickTrackItem}" role="presentation"><slot name="scale-ticks"></slot></div></div></div><slot></slot><slot name="help-text" part="form-control-help-text" id="help-text" class="${m("text-sm text-neutral-700 mt-1",i?"block":"hidden")}" aria-hidden="${!i}">${this.helpText}</slot></div>`}};l.styles=[...T.styles,I`[part=base]{touch-action:none;-webkit-touch-callout:none}[part=thumb].grabbed{--tw-bg-opacity:1!important;background-color:rgb(var(--sd-color-primary-800,5 21 48)/var(--tw-bg-opacity,1))!important}`],n([f("#input")],l.prototype,"input",2),n([f('[part="active-track"]')],l.prototype,"activeTrack",2),n([f('[part="input-wrapper"]')],l.prototype,"inputWrapper",2),n([D('[part="thumb"]')],l.prototype,"thumbs",2),n([h({attribute:!1})],l.prototype,"tooltipFormatter",2),n([h({type:String,reflect:!0})],l.prototype,"name",2),n([h({type:String,reflect:!0})],l.prototype,"label",2),n([h({attribute:"help-text",reflect:!0})],l.prototype,"helpText",2),n([h({type:Number,reflect:!0})],l.prototype,"min",2),n([h({type:Number,reflect:!0})],l.prototype,"max",2),n([h({type:Number,reflect:!0})],l.prototype,"step",2),n([h({type:Boolean,reflect:!0})],l.prototype,"disabled",2),n([h({attribute:"visually-disabled",type:Boolean,reflect:!0})],l.prototype,"visuallyDisabled",2),n([h({attribute:"no-track-bar",type:Boolean,reflect:!0})],l.prototype,"noTrackBar",2),n([h({attribute:"no-tooltip",type:Boolean,reflect:!0})],l.prototype,"noTooltip",2),n([A()],l.prototype,"defaultValue",2),n([h({type:String})],l.prototype,"value",1),l=n([C("sd-5-15-11-range")],l);export{l as a};
|
|
1
|
+
import{a as p,b as c,c as _}from"./chunk.IVHEBGOY.js";import{a as A}from"./chunk.EJI65G6N.js";import{b as E}from"./chunk.NRBNWX7R.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as b}from"./chunk.CHU57RUD.js";import{a as m}from"./chunk.YEDQWNIV.js";import{a as w}from"./chunk.Y7NVH75J.js";import{a as C,b as h,d as f,e as D,h as T}from"./chunk.TJ7ZA5LO.js";import{b as I,e as v}from"./chunk.RZUTJ36B.js";import{e as n}from"./chunk.TJOCV4DC.js";var l=class extends T{constructor(){super();this.formControlController=new E(this);this.hasSlotController=new M(this,"label","help-text");this.localize=new w(this);this.name="";this.label="";this.helpText="";this.min=0;this.max=100;this.step=1;this.disabled=!1;this.visuallyDisabled=!1;this.noTrackBar=!1;this.noTooltip=!1;this.defaultValue="";this._value=[0];this._rangeValues=new Map;this._lastChangeValue=[];this._hasFocus=!1;this.tooltipFormatter=this.localize.number.bind(this.localize)}set value(e){this._value=e?e.split(" ").map(Number).sort(p):[]}get value(){return this._value.slice().sort(p).join(" ")}set valueAsArray(e){let t=this._value;this._value=Array.isArray(e)?e.slice().sort(p):e||[],c(t,this._value)&&this.requestUpdate("value",t.join(" "))}get valueAsArray(){return[...this._value].sort(p)}get rtl(){return this.localize.dir()==="rtl"}firstUpdated(){this.formControlController.updateValidity(),this._lastChangeValue=Array.from(this._value)}willUpdate(e){super.willUpdate(e),this.min>this.max&&([this.min,this.max]=[this.max,this.min]),this.step>this.max-this.min&&(this.step=this.max-this.min),this.step<=0&&(this.step=1);let t=this._value.map(i=>{if(i<=this.min)return this.min;if(i>=this.max)return this.max;let a=this.min+this.step*Math.round((i-this.min)/this.step);return a>this.max?this.max:a});c(this._value,t)&&(this._value=t)}updated(e){super.updated(e);for(let t of this.thumbs){let i=+t.dataset.rangeId;this._rangeValues.has(i)&&this.moveThumb(t,this._rangeValues.get(i))}this.updateActiveTrack()}focus(e){let t=this.thumbs.item(0);t?t.focus(e):super.focus(e)}get validity(){return this.input.validity}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}updateTooltip(e){let t=+e.dataset.rangeId;if(!this._rangeValues.has(t))return;let i=this._rangeValues.get(t),a=e.parentElement;a.content=this.tooltipFormatter(i)}updateActiveTrack(){let{activeTrack:e}=this;if(!e)return;if(this.min===this.max){e.style.insetInlineStart="0%",e.style.insetInlineEnd="0%";return}if(this._value.length===1){let s=getComputedStyle(this).getPropertyValue("--track-active-offset")||"0%",o=100*(this._value[0]-this.min)/(this.max-this.min);e.style.insetInlineStart=`min(${s}, ${o}%)`,e.style.insetInlineEnd=`min(calc(100% - ${s}), calc(100% - ${o}%))`;return}let t=this._value.slice().sort(p),i=100*(t[0]-this.min)/(this.max-this.min),a=100*(t[t.length-1]-this.min)/(this.max-this.min);e.style.insetInlineStart=`${i}%`,e.style.insetInlineEnd=`calc(100% - ${a}%)`}moveThumb(e,t){e.setAttribute("aria-valuenow",t.toString()),e.setAttribute("aria-valuetext",this.tooltipFormatter(t));let i=(t-this.min)/(this.max-this.min);e.style.insetInlineStart=`calc(${100*i}% - 8px)`,this.updateTooltip(e)}movementBoundariesForThumb(e,t){let i=this.valueAsArray,s=Array.from(this.thumbs).indexOf(e),o=i[s-1]||this.min,r=i[s+1]||this.max,u=t<o||t>r;return{finalValue:Math.max(o,Math.min(r,t)),isRestricted:u,nextValue:r,prevValue:o}}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}onClickTrack(e,t=!0){if(this.disabled||this.visuallyDisabled)return;let{clientX:i}=e,a=Array.from(this.thumbs),s=_(this.inputWrapper,i),o=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/o),u=a.reduce((g,x)=>{let V=this._rangeValues.get(+x.dataset.rangeId),L=this._rangeValues.get(+g.dataset.rangeId),$=Math.abs(V-r),k=Math.abs(L-r);return $===k?V<r?x:g:$<k?x:g}),d=+u.dataset.rangeId;if(!d)return;this._rangeValues.set(d,r),this.moveThumb(u,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),c(y,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change"));let F=new PointerEvent("pointerdown",e);t&&u.dispatchEvent(F)&&this.updateTooltip(u)}onClickTrackItem(e){this.onClickTrack(e,!1)}async onClickThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target;this.updateTooltip(t),t.dataset.pointerId&&t.releasePointerCapture(+t.dataset.pointerId),t.dataset.pointerId=e.pointerId.toString(),t.setPointerCapture(e.pointerId),t.classList.add("grabbed"),await t.parentElement.show()}onDragThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target,i=+t.dataset.rangeId;if(!this._rangeValues.has(i)||(t.dataset.pointerId?+t.dataset.pointerId:null)!==e.pointerId)return;let s=_(this.inputWrapper,e.clientX),o=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/o);if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:r}}).defaultPrevented)return;let d=this.movementBoundariesForThumb(t,r);d.isRestricted?(r=d.finalValue,t.style.zIndex=(3+this.thumbs.length).toFixed(0)):t.style.zIndex="3",this._rangeValues.set(i,r),this.moveThumb(t,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),c(y,this._value)&&this.emit("sd-input")}async onReleaseThumb(e){let t=e.target;!t.dataset.pointerId||e.pointerId!==+t.dataset.pointerId||(t.classList.remove("grabbed"),t.releasePointerCapture(e.pointerId),delete t.dataset.pointerId,c(this._lastChangeValue,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-change")),await t.parentElement.hide())}onKeyPress(e){let t=e.target,i=+t.dataset.rangeId,a=this._rangeValues.get(i);if(a===void 0)return;let s=a;switch(e.key){case"ArrowUp":case"Up":s=Math.min(a+this.step,this.max);break;case"ArrowDown":case"Down":s=Math.max(a-this.step,this.min);break;case"ArrowLeft":case"Left":s=this.rtl?Math.min(a+this.step,this.max):Math.max(a-this.step,this.min);break;case"ArrowRight":case"Right":s=this.rtl?Math.max(a-this.step,this.min):Math.min(a+this.step,this.max);break;case"PageUp":s=Math.min(a+(this.max-this.min)/5,this.max);break;case"PageDown":s=Math.max(a-(this.max-this.min)/5,this.min);break;case"Home":s=this.min;break;case"End":s=this.max;break;default:return}if(s!==a){if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:s}}).defaultPrevented)return;let r=this.movementBoundariesForThumb(t,s);r.isRestricted&&(s=r.finalValue),this.moveThumb(t,s),this._rangeValues.set(i,s),this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),this.updateTooltip(t),this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change")}e.preventDefault()}onBlur(e){var t;e.relatedTarget&&((t=this.shadowRoot)!=null&&t.contains(e.relatedTarget))||(this.emit("sd-blur"),this._hasFocus=!1)}onFocusThumb(e){var i;if(this.disabled||this.visuallyDisabled)return;this._hasFocus||(this._hasFocus=!0,this.emit("sd-focus"));let t=e.target;(i=t==null?void 0:t.dataset)!=null&&i.rangeId&&this.updateTooltip(t)}renderThumbs(e){let t=this._value.length>1;return this._rangeValues.clear(),this._value.map((i,a)=>{let s=a+1;this._rangeValues.set(s,i);let o=`thumb-${s}`,r="",u="";return t?(u=e?`label aria-label-hidden ${o}`:`aria-label-hidden ${o}`,a===0?r=`${this.localize.term("minimum")} (${this.tooltipFormatter(i)})`:a===this._value.length-1?r=`${this.localize.term("maximum")} (${this.tooltipFormatter(i)})`:r=this.tooltipFormatter(i)):u=e?"label aria-label-hidden":"",v`<sd-5-15-13-tooltip hoist trigger="focus" disabled="${b(this.disabled||this.visuallyDisabled||this.noTooltip?!0:void 0)}"><div id="${o}" part="thumb" role="slider" tabindex="${this.disabled||this.visuallyDisabled?-1:0}" aria-disabled="${b(this.disabled||this.visuallyDisabled?"true":void 0)}" aria-labelledby="${u}" aria-label="${r}" aria-valuemax="${this.max}" aria-valuemin="${this.min}" aria-valuenow="${i}" aria-valuetext="${this.tooltipFormatter(i)}" data-range-id="${s}" @pointerdown="${this.onClickThumb}" @pointermove="${this.onDragThumb}" @pointerup="${this.onReleaseThumb}" @pointercancel="${this.onReleaseThumb}" @pointerleave="${this.onReleaseThumb}" @keydown="${this.onKeyPress}" @focus="${this.onFocusThumb}" class="${m("rounded-full absolute top-0 size-4 hover:cursor-grab after:-inset-2",this.disabled||this.visuallyDisabled?"bg-neutral-500 outline-none":"bg-primary hover:bg-primary-500 cursor-pointer focus-visible:focus-outline")}"></div></sd-5-15-13-tooltip>`})}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text")},t=!!(this.label||e.label),i=!!(this.helpText||e.helpText);return v`<div part="form-control" @focusout="${this.onBlur}" class="flex flex-col">${t?v`<div class="flex items-center gap-1"><label id="label" part="form-control-label" aria-hidden="${t?"false":"true"}" class="${m("w-full",t?"inline-block":"hidden")}" @click="${this.focus}"><slot name="label">${this.label}</slot></label></div>`:null} <label id="aria-label-hidden" class="sr-only">(${this._value.map(this.tooltipFormatter).join(" - ")})</label><div part="base" class="${m("inline-flex w-full",this.visuallyDisabled&&"focus-visible:focus-outline")}" tabindex="${b(this.visuallyDisabled?"0":void 0)}"><div part="input-wrapper" class="relative flex-1 mx-2 mb-[10px]"><input id="input" tabindex="-1" hidden @invalid="${this.handleInvalid}"><div part="track-wrapper" role="presentation" @pointerdown="${this.onClickTrack}" class="relative cursor-pointer -mx-2"><div part="track-click-helper" class="absolute -inset-y-2 inset-x-0"></div><div part="track" class="${m("h-1 my-[6px]",this.disabled||this.visuallyDisabled?"bg-neutral-500":"bg-neutral-400")}"></div><div part="active-track" hidden="${b(this.noTrackBar?!0:void 0)}" class="${m("absolute top-0 h-1",this.disabled||this.visuallyDisabled?"bg-neutral-500":"bg-primary")}"></div></div>${this.renderThumbs(t)}<div class="-mt-[10px]" part="scale-ticks" @pointerdown="${this.onClickTrackItem}" role="presentation"><slot name="scale-ticks"></slot></div></div></div><slot></slot><slot name="help-text" part="form-control-help-text" id="help-text" class="${m("text-sm text-neutral-700 mt-1",i?"block":"hidden")}" aria-hidden="${!i}">${this.helpText}</slot></div>`}};l.styles=[...T.styles,I`[part=base]{touch-action:none;-webkit-touch-callout:none}[part=thumb].grabbed{--tw-bg-opacity:1!important;background-color:rgb(var(--sd-color-primary-800,5 21 48)/var(--tw-bg-opacity,1))!important}`],n([f("#input")],l.prototype,"input",2),n([f('[part="active-track"]')],l.prototype,"activeTrack",2),n([f('[part="input-wrapper"]')],l.prototype,"inputWrapper",2),n([D('[part="thumb"]')],l.prototype,"thumbs",2),n([h({attribute:!1})],l.prototype,"tooltipFormatter",2),n([h({type:String,reflect:!0})],l.prototype,"name",2),n([h({type:String,reflect:!0})],l.prototype,"label",2),n([h({attribute:"help-text",reflect:!0})],l.prototype,"helpText",2),n([h({type:Number,reflect:!0})],l.prototype,"min",2),n([h({type:Number,reflect:!0})],l.prototype,"max",2),n([h({type:Number,reflect:!0})],l.prototype,"step",2),n([h({type:Boolean,reflect:!0})],l.prototype,"disabled",2),n([h({attribute:"visually-disabled",type:Boolean,reflect:!0})],l.prototype,"visuallyDisabled",2),n([h({attribute:"no-track-bar",type:Boolean,reflect:!0})],l.prototype,"noTrackBar",2),n([h({attribute:"no-tooltip",type:Boolean,reflect:!0})],l.prototype,"noTooltip",2),n([A()],l.prototype,"defaultValue",2),n([h({type:String})],l.prototype,"value",1),l=n([C("sd-5-15-13-range")],l);export{l as a};
|
|
@@ -8,4 +8,4 @@ import{b as y,c as g}from"./chunk.NRBNWX7R.js";import{a as x}from"./chunk.CGQ2BP
|
|
|
8
8
|
disabled:text-neutral-500 disabled:border-neutral-500`,tertiary:this.inverted?`border-transparent ${this.visuallyDisabled?"text-neutral-600 hover:text-neutral-600 active:text-neutral-600":"text-white hover:text-primary-100 active:text-primary-200"}
|
|
9
9
|
disabled:text-neutral-600`:`border-transparent ${this.visuallyDisabled?"text-neutral-500 hover:text-neutral-500 active:text-neutral-500":"text-primary hover:text-primary-500 active:text-primary-800"}
|
|
10
10
|
disabled:text-neutral-500`,cta:`text-white ${this.visuallyDisabled?"bg-neutral-500 border-neutral-500 hover:bg-neutral-500 active:bg-neutral-500":"bg-accent-500 border-transparent"}
|
|
11
|
-
${this.inverted?"disabled:bg-neutral-600 disabled:border-neutral-600":"disabled:bg-neutral-500 disabled:border-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${a(r?void 0:this.disabled)}" type="${a(r?void 0:this.type)}" title="${this.title}" name="${a(r?void 0:this.name)}" value="${a(r?void 0:this.value)}" href="${a(r?this.href:void 0)}" target="${a(r?this.target:void 0)}" download="${a(r?this.download:void 0)}" rel="${a(r&&this.target?"noreferrer noopener":void 0)}" role="${a(r?void 0:"button")}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-labelledby="content" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><div part="motion-wrapper" class="${l("absolute inset-0 rounded-default -z-10 overflow-hidden pointer-events-none ",(this.disabled||this.visuallyDisabled)&&"hidden")}"><div class="absolute inset-0 w-full h-full transition-all duration-fast translate-y-full group-hover:translate-y-0 group-hover:mt-[-22%] mt-[11%]"><div class="${l("absolute right-0 min-w-full min-h-full aspect-square skew-y-[-11deg] mt-[11%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div><div class="${l("absolute w-full h-full mt-[22%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div></div></div><slot name="icon-left" part="icon-left" class="${l("flex flex-auto items-center justify-end pointer-events-none",s["icon-only"]&&"hidden",this.loading&&"invisible",s["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${l("inline-flex items-center justify-center",s["icon-only"]&&"pointer-events-none",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${l("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",s["icon-only"]&&"hidden",s["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?m`<sd-5-15-
|
|
11
|
+
${this.inverted?"disabled:bg-neutral-600 disabled:border-neutral-600":"disabled:bg-neutral-500 disabled:border-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${a(r?void 0:this.disabled)}" type="${a(r?void 0:this.type)}" title="${this.title}" name="${a(r?void 0:this.name)}" value="${a(r?void 0:this.value)}" href="${a(r?this.href:void 0)}" target="${a(r?this.target:void 0)}" download="${a(r?this.download:void 0)}" rel="${a(r&&this.target?"noreferrer noopener":void 0)}" role="${a(r?void 0:"button")}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-labelledby="content" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><div part="motion-wrapper" class="${l("absolute inset-0 rounded-default -z-10 overflow-hidden pointer-events-none ",(this.disabled||this.visuallyDisabled)&&"hidden")}"><div class="absolute inset-0 w-full h-full transition-all duration-fast translate-y-full group-hover:translate-y-0 group-hover:mt-[-22%] mt-[11%]"><div class="${l("absolute right-0 min-w-full min-h-full aspect-square skew-y-[-11deg] mt-[11%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div><div class="${l("absolute w-full h-full mt-[22%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div></div></div><slot name="icon-left" part="icon-left" class="${l("flex flex-auto items-center justify-end pointer-events-none",s["icon-only"]&&"hidden",this.loading&&"invisible",s["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${l("inline-flex items-center justify-center",s["icon-only"]&&"pointer-events-none",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${l("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",s["icon-only"]&&"hidden",s["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?m`<sd-5-15-13-loader class="${l("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-5-15-13-loader>`:""}</${o}>`}};t.styles=[...d.styles,p`:host{cursor:pointer;display:inline-block;position:relative;width:var(--sd-spacing-auto,auto);z-index:0}::slotted(sd-5-15-13-badge){pointer-events:none;position:absolute;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);--tw-translate-x:50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}::slotted(sd-5-15-13-icon),sd-5-15-13-loader{font-size:calc(var(--tw-varspacing)/2)}`],e([b("a, button")],t.prototype,"button",2),e([v({selector:"sd-5-15-13-icon"})],t.prototype,"_iconsInDefaultSlot",2),e([c()],t.prototype,"invalid",2),e([i({type:String,reflect:!0})],t.prototype,"title",2),e([i({type:String,reflect:!0})],t.prototype,"variant",2),e([i({type:Boolean,reflect:!0})],t.prototype,"inverted",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([i({type:Boolean,reflect:!0})],t.prototype,"loading",2),e([i({type:String,reflect:!0})],t.prototype,"type",2),e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i()],t.prototype,"value",2),e([i({type:String,reflect:!0})],t.prototype,"href",2),e([i({type:String,reflect:!0})],t.prototype,"target",2),e([i({reflect:!0})],t.prototype,"download",2),e([i({reflect:!0})],t.prototype,"form",2),e([i({attribute:"formaction"})],t.prototype,"formAction",2),e([i({attribute:"formenctype"})],t.prototype,"formEnctype",2),e([i({attribute:"formmethod"})],t.prototype,"formMethod",2),e([i({attribute:"formnovalidate",type:Boolean})],t.prototype,"formNoValidate",2),e([i({attribute:"formtarget"})],t.prototype,"formTarget",2),e([f("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=e([h("sd-5-15-13-button")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./chunk.LIO6LMTQ.js";import{a as C}from"./chunk.EJI65G6N.js";import{b as g}from"./chunk.NRBNWX7R.js";import{a as x}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.CHU57RUD.js";import{a as s}from"./chunk.YEDQWNIV.js";import{a as d}from"./chunk.E2DRD2OX.js";import{a as y,b as i,c as h,d as p,h as m}from"./chunk.TJ7ZA5LO.js";import{b as v,e as n}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends m{constructor(){super(...arguments);this.formControlController=new g(this);this.hasSlotController=new x(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.visuallyDisabled=!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(){if(this.visuallyDisabled){this.textarea.value=this.value;return}this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(l){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(l),this.invalidMessage.textContent=l.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(l){this.textarea.focus(l)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(l){if(l){typeof l.top=="number"&&(this.textarea.scrollTop=l.top),typeof l.left=="number"&&(this.textarea.scrollLeft=l.left);return}return{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(l,a,o="none"){this.textarea.setSelectionRange(l,a,o)}setRangeText(l,a,o,u){this.textarea.setRangeText(l,a,o,u),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var l;return(l=this.textarea)==null?void 0:l.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(l){this.textarea.setCustomValidity(l),this.formControlController.updateValidity()}render(){let l={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},a=this.label?!0:!!l.label,o=this.helpText?!0:!!l.helpText,u=!!l.tooltip,c=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",f=this.size==="sm"?"text-sm":"text-base",b={sm:"text-base top-1",md:"text-lg top-2",lg:"text-xl top-2"}[this.size];return n`<div part="form-control" class="flex flex-col h-full text-left">${a||u?n`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${s(a?"inline-block":"hidden",f)}" for="input" aria-hidden="${a?"false":"true"}"><slot name="label">${this.label}</slot></label> ${l.tooltip?n`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${s("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${s("absolute w-full h-full pointer-events-none border rounded-default transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"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"}[c])}"></div><div part="base" class="${s("textarea h-full flex items-top rounded-default group transition-colors duration-medium hover:duration-fast ease-in-out",{sm:"textarea-sm",md:"textarea-md",lg:"textarea-lg"}[this.size],!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",c==="disabled"||c==="visuallyDisabled"?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${s("ps-4 flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none group-has-[sd-5-15-
|
|
1
|
+
import{a as $}from"./chunk.LIO6LMTQ.js";import{a as C}from"./chunk.EJI65G6N.js";import{b as g}from"./chunk.NRBNWX7R.js";import{a as x}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.CHU57RUD.js";import{a as s}from"./chunk.YEDQWNIV.js";import{a as d}from"./chunk.E2DRD2OX.js";import{a as y,b as i,c as h,d as p,h as m}from"./chunk.TJ7ZA5LO.js";import{b as v,e as n}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends m{constructor(){super(...arguments);this.formControlController=new g(this);this.hasSlotController=new x(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.visuallyDisabled=!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(){if(this.visuallyDisabled){this.textarea.value=this.value;return}this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(l){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(l),this.invalidMessage.textContent=l.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(l){this.textarea.focus(l)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(l){if(l){typeof l.top=="number"&&(this.textarea.scrollTop=l.top),typeof l.left=="number"&&(this.textarea.scrollLeft=l.left);return}return{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(l,a,o="none"){this.textarea.setSelectionRange(l,a,o)}setRangeText(l,a,o,u){this.textarea.setRangeText(l,a,o,u),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var l;return(l=this.textarea)==null?void 0:l.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(l){this.textarea.setCustomValidity(l),this.formControlController.updateValidity()}render(){let l={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},a=this.label?!0:!!l.label,o=this.helpText?!0:!!l.helpText,u=!!l.tooltip,c=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",f=this.size==="sm"?"text-sm":"text-base",b={sm:"text-base top-1",md:"text-lg top-2",lg:"text-xl top-2"}[this.size];return n`<div part="form-control" class="flex flex-col h-full text-left">${a||u?n`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${s(a?"inline-block":"hidden",f)}" for="input" aria-hidden="${a?"false":"true"}"><slot name="label">${this.label}</slot></label> ${l.tooltip?n`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${s("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${s("absolute w-full h-full pointer-events-none border rounded-default transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"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"}[c])}"></div><div part="base" class="${s("textarea h-full flex items-top rounded-default group transition-colors duration-medium hover:duration-fast ease-in-out",{sm:"textarea-sm",md:"textarea-md",lg:"textarea-lg"}[this.size],!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",c==="disabled"||c==="visuallyDisabled"?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${s("ps-4 flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none group-has-[sd-5-15-13-icon]:pe-8",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size],this.disabled&&"cursor-not-allowed",f)}" title="${this.title}" name="${r(this.name)}" .value="${$(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" ?visually-disabled="${this.visuallyDisabled}" placeholder="${r(this.placeholder)}" minlength="${r(this.minlength)}" maxlength="${r(this.maxlength)}" rows="${r(this.rows)}" autocapitalize="${r(this.autocapitalize)}" autocorrect="${r(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${r(this.spellcheck)}" enterkeyhint="${r(this.enterkeyhint)}" inputmode="${r(this.inputmode)}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?n`<sd-5-15-13-icon class="${s("text-error absolute right-4 pointer-events-none",b)}" library="_internal" name="risk" part="invalid-icon"></sd-5-15-13-icon>`:""} ${this.styleOnValid&&this.showValidStyle?n`<sd-5-15-13-icon class="${s("text-success absolute right-4 pointer-events-none",b)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-5-15-13-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${s("text-sm text-neutral-700 mt-1",o?"block":"hidden")}" aria-hidden="${o?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...m.styles,v`:host{display:block;height:100%}:host textarea{scrollbar-gutter:stable}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([required]) #label:after{content:" *"}:host([visually-disabled]) textarea{caret-color:transparent}.no-scrollbar::-webkit-scrollbar{display:none}`],e([p("#input")],t.prototype,"textarea",2),e([p("#invalid-message")],t.prototype,"invalidMessage",2),e([h()],t.prototype,"hasFocus",2),e([h()],t.prototype,"showValidStyle",2),e([h()],t.prototype,"showInvalidStyle",2),e([i({type:String,reflect:!0})],t.prototype,"title",2),e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i()],t.prototype,"value",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:String,reflect:!0})],t.prototype,"label",2),e([i({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),e([i({type:String,reflect:!0})],t.prototype,"placeholder",2),e([i({type:Number,reflect:!0})],t.prototype,"rows",2),e([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([i({type:Boolean,reflect:!0})],t.prototype,"readonly",2),e([i({type:String,reflect:!0})],t.prototype,"form",2),e([i({type:Boolean,reflect:!0})],t.prototype,"required",2),e([i({type:Number,reflect:!0})],t.prototype,"minlength",2),e([i({type:Number,reflect:!0})],t.prototype,"maxlength",2),e([i({type:String,reflect:!0})],t.prototype,"autocapitalize",2),e([i({type:String,reflect:!0})],t.prototype,"autocorrect",2),e([i({reflect:!0})],t.prototype,"autocomplete",2),e([i({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),e([i({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),e([i({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),e([i({type:Boolean,converter:{fromAttribute:l=>!(!l||l==="false"),toAttribute:l=>l?"true":"false"}})],t.prototype,"spellcheck",2),e([i({type:String,reflect:!0})],t.prototype,"inputmode",2),e([C()],t.prototype,"defaultValue",2),e([d("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),e([d("rows",{waitUntilFirstUpdate:!0})],t.prototype,"handleRowsChange",1),e([d("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=e([y("sd-5-15-13-textarea")],t);export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk.YEDQWNIV.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.TJ7ZA5LO.js";import{b as l,e as t}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-15-
|
|
1
|
+
import{a}from"./chunk.YEDQWNIV.js";import{a as p,b as o,c as d,d as v,h as n}from"./chunk.TJ7ZA5LO.js";import{b as l,e as t}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var r=class extends n{constructor(){super(...arguments);this.variant="primary";this.shapes=["top","middle","bottom"];this.componentBreakpoint=0}getSvg(e,s){return{0:this.smallSvg(s),414:this.mediumSvg(s),640:this.largeSvg(s)}[e]}largeSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(e){return e==="top"?t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>this.setBreakpoint()),this.updateComplete.then(()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return t`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return t`<div class="${a({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="${a("z-10 relative",this.variant==="image"&&"invisible opacity-0")}" part="content"><slot>${this.variant==="image"?"":t`<div class="h-8"></div>`}</slot></div></div>`}renderBottomBrandshape(){return t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${a({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return t`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${a(this.variant!=="image"&&"hidden")}" name="image"></slot></div>`}renderShapes(){return t`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){let e=this.variant.startsWith("border-")||this.variant==="image";return t`<div class="${a({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${e?this.renderStylizedVariant():""} ${this.renderShapes()}</div>`}};r.styles=[...n.styles,l`:host{container-type:inline-size;display:block;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan)*var(--adjacent));--curve:calc((var(--opposite) - (var(--radius)/3))*0.5)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{border-radius:0 var(--radius);height:calc(100% - var(--curve)*2);left:var(--sd-spacing-0,0);margin-top:calc(var(--curve));position:absolute;top:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle)*-1))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:calc(100% + var(--curve)*2)!important;-o-object-fit:cover;object-fit:cover;position:absolute!important;transform:translateY(calc(var(--curve)*-1)) skewY(var(--angle));width:100%}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]:before{height:100%;margin-top:0;transform:unset}slot[name=image]::slotted(img),slot[name=image]::slotted(video){height:100%!important;transform:unset}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary,0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white,#fff)}:host([variant^=border-]) [part=stylized-container]:before{border-color:var(--internal-border-color,#000);border-style:solid;border-width:2px;content:"";right:var(--sd-spacing-0,0)}`],i([v("[part=base]")],r.prototype,"containerElem",2),i([o({type:String,reflect:!0})],r.prototype,"variant",2),i([o({type:Array})],r.prototype,"shapes",2),i([d()],r.prototype,"componentBreakpoint",2),r=i([p("sd-5-15-13-brandshape")],r);export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as o}from"./chunk.CHU57RUD.js";import{a as u,b as s}from"./chunk.PVM2WKMA.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as b}from"./chunk.Y7NVH75J.js";import{a as m,b as i,d as p,h as f}from"./chunk.TJ7ZA5LO.js";import{b as v}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends f{constructor(){super(...arguments);this.hasSlotController=new y(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.separated&&!this.href&&this.hasSlotController.test("children")}get isIconOnly(){if(!this.defaultSlot)return!1;let e=this.defaultSlot.assignedNodes({flatten:!0});return e.length>0&&e.every(a=>{var d;return a.nodeType===Node.TEXT_NODE?!((d=a.textContent)!=null&&d.trim()):a.nodeType===Node.ELEMENT_NODE?a.tagName.toLowerCase()==="sd-5-15-
|
|
1
|
+
import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as o}from"./chunk.CHU57RUD.js";import{a as u,b as s}from"./chunk.PVM2WKMA.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as b}from"./chunk.Y7NVH75J.js";import{a as m,b as i,d as p,h as f}from"./chunk.TJ7ZA5LO.js";import{b as v}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends f{constructor(){super(...arguments);this.hasSlotController=new y(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.separated&&!this.href&&this.hasSlotController.test("children")}get isIconOnly(){if(!this.defaultSlot)return!1;let e=this.defaultSlot.assignedNodes({flatten:!0});return e.length>0&&e.every(a=>{var d;return a.nodeType===Node.TEXT_NODE?!((d=a.textContent)!=null&&d.trim()):a.nodeType===Node.ELEMENT_NODE?a.tagName.toLowerCase()==="sd-5-15-13-icon":!1})}handleClickButton(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}handleClickSummary(e){e.preventDefault(),e.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.separated&&!this.isLink?u`div`:this.isAccordion&&!this.isLink?u`summary`:this.isLink?u`a`:u`button`}focus(){var e;this.disabled||(e=this.button)==null||e.focus()}blur(){var e;(e=this.button)==null||e.blur()}render(){let e=this.tag,a=this.isLink,d=this.isButton,n=this.isAccordion,w=this.isIconOnly,c={label:this.hasSlotController.test("[default]"),main:this.hasSlotController.test("main"),description:this.hasSlotController.test("description"),children:this.hasSlotController.test("children")},x=this.vertical?"py-3":"py-2",h=s`<${e} part="base" class="${l("flex items-center cursor-pointer relative focus-visible:focus-outline group hover:bg-neutral-200 transition-colors duration-fast ease-in-out min-h-[48px]",{md:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",this.current&&"font-bold",!n&&"w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px]",w?"justify-center aspect-square p-3":"px-4")}" aria-current="${o(this.current?"page":void 0)}" aria-disabled="${this.disabled}" aria-labelledby="content" aria-describedby="description" ?disabled="${o(d?this.disabled:void 0)}" href="${o(a?this.href:void 0)}" target="${o(a?this.target:void 0)}" download="${o(a?this.download:void 0)}" rel="${o(a&&this.target?"noreferrer noopener":void 0)}" tabindex="${this.disabled?"-1":"0"}" @click="${this.separated?void 0:n?this.handleClickSummary:d?this.handleClickButton:void 0}"><div part="current-indicator" class="${l("absolute bg-accent left-0 pointer-events-none",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-[calc(100%-16px)] bottom-0 left-2 group-hover:w-full group-hover:left-0",this.disabled&&"bg-neutral-500")}"></div><div class="inline-flex flex-col justify-center gap-1 w-full h-full"><span part="content-area" class="${l("relative inline-flex justify-between items-center",n?"grow":"w-full",c.description&&"pt-3",!c.description&&!this.separated&&x,this.calculatePaddingX)}">${this.divider&&this.vertical?s`<sd-5-15-13-divider part="divider" class="${l("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-5-15-13-divider>`:""} <span id="content" part="content-container" class="inline-flex items-center flex-auto"><slot part="content" class="inline-flex text-start"></slot></span>${this.chevron||c.children&&this.vertical&&!this.separated?s`<sd-5-15-13-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("h-6 w-6 ml-2 transition-all",n?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-13-icon>`:""} </span>${c.description&&this.vertical?s`<slot id="description" name="description" part="description" class="${l("inline-block text-sm text-left font-normal text-black pb-3",n||this.separated?"grow":"w-full",this.calculatePaddingX)}"></slot>`:""}</div></${e}>`;return this.separated?s`<div part="details" id="navigation-item-details" class="relative flex flex-col"><div class="flex items-start">${h} ${c.children&&this.vertical?s`<button type="button" title="${this.open?this.localize.term("collapseNavigationItem"):this.localize.term("expandNavigationItem")}" class="sd-interactive sd-interactive--reset -mt-1" @click="${this.handleClickSummary}"><sd-5-15-13-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${l("m-4 h-6 w-6 transition-all",n||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-15-13-icon></button>`:""}</div>${this.open?s`<slot name="children"></slot>`:""}</div>`:n?s`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative">${h}<slot name="children"></slot></details>`:s`${h}`}};t.styles=[...f.styles,v`:host{box-sizing:border-box;display:inline-block;position:relative}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}[part=current-indicator]{--tw-scale-x:0;--tw-scale-y:0;opacity:var(--sd-opacity-0,0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:var(--sd-duration-fast,.15s);transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,opacity var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out var(--sd-duration-fast)}:host([current]) [part=current-indicator]{--tw-scale-x:1;--tw-scale-y:1;opacity:var(--sd-opacity-100,1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out}`],r([p('[part="base"]')],t.prototype,"button",2),r([p("slot:not([name])")],t.prototype,"defaultSlot",2),r([i({type:Boolean,reflect:!0})],t.prototype,"vertical",2),r([i({type:String,reflect:!0})],t.prototype,"size",2),r([i({reflect:!0})],t.prototype,"href",2),r([i({type:String,reflect:!0})],t.prototype,"target",2),r([i({reflect:!0})],t.prototype,"download",2),r([i({type:Boolean,reflect:!0})],t.prototype,"current",2),r([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i({type:Boolean,reflect:!0})],t.prototype,"chevron",2),r([i({type:Boolean,reflect:!0})],t.prototype,"relaxed",2),r([i({type:Boolean,reflect:!0})],t.prototype,"divider",2),r([i({type:Boolean,reflect:!0})],t.prototype,"indented",2),r([i({type:Boolean,reflect:!0})],t.prototype,"open",2),r([i({type:Boolean,reflect:!0})],t.prototype,"separated",2),t=r([m("sd-5-15-13-navigation-item")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=t=>Array.from(t.assignedElements({flatten:!0})),o=t=>t.tagName.toLocaleLowerCase()==="sd-5-15-
|
|
1
|
+
var p=t=>Array.from(t.assignedElements({flatten:!0})),o=t=>t.tagName.toLocaleLowerCase()==="sd-5-15-13-option"?t:Array.from(t.querySelectorAll(":scope > sd-5-15-13-option")),e=t=>t.tagName.toLocaleLowerCase()==="sd-5-15-13-optgroup",r=t=>t.map(o),n=t=>t.filter(e),s=t=>t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();export{p as a,o as b,e as c,r as d,n as e,s as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk.Y3GIPFVP.js";import{a as z}from"./chunk.LIO6LMTQ.js";import{a as L}from"./chunk.EJI65G6N.js";import{b as F}from"./chunk.NRBNWX7R.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as P,b as V}from"./chunk.D6LAH53B.js";import{a}from"./chunk.YEDQWNIV.js";import{a as T}from"./chunk.Y7NVH75J.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.TJ7ZA5LO.js";import{b as C,e as r,h as k,i as D}from"./chunk.RZUTJ36B.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",x=this.size==="sm"?"text-sm":"text-base",H={disabled:"border-neutral-500",visuallyDisabled:"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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",this.size==="lg"?"py-2":"py-1",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder-neutral-500 cursor-not-allowed":"placeholder-neutral-700",this.size==="sm"?"h-6":"h-8",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-11-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-15-11-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-15-11-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-15-11-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-15-11-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-15-11-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-15-11-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-15-11-icon>`:""} ${this.type==="time"?r`<sd-5-15-11-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-15-11-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-15-11-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-11-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-15-11-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-15-11-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-15-11-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-5-15-11-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-15-11-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-11-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-15-11-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-11-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`:host{box-sizing:border-box;display:inline-block;position:relative;text-align:left;width:100%}:host([vertical]){display:block}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-5-15-11-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-15-11-input")],t);export{t as a};
|
|
1
|
+
import{a as A}from"./chunk.Y3GIPFVP.js";import{a as z}from"./chunk.LIO6LMTQ.js";import{a as L}from"./chunk.EJI65G6N.js";import{b as F}from"./chunk.NRBNWX7R.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as P,b as V}from"./chunk.D6LAH53B.js";import{a}from"./chunk.YEDQWNIV.js";import{a as T}from"./chunk.Y7NVH75J.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.TJ7ZA5LO.js";import{b as C,e as r,h as k,i as D}from"./chunk.RZUTJ36B.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",x=this.size==="sm"?"text-sm":"text-base",H={disabled:"border-neutral-500",visuallyDisabled:"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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",this.size==="lg"?"py-2":"py-1",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder-neutral-500 cursor-not-allowed":"placeholder-neutral-700",this.size==="sm"?"h-6":"h-8",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-13-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-15-13-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-15-13-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-15-13-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-15-13-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-15-13-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-15-13-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-15-13-icon>`:""} ${this.type==="time"?r`<sd-5-15-13-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-15-13-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-15-13-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-13-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-15-13-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-15-13-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-15-13-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-5-15-13-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-15-13-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-13-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-15-13-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-15-13-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`:host{box-sizing:border-box;display:inline-block;position:relative;text-align:left;width:100%}:host([vertical]){display:block}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-5-15-13-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-15-13-input")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as d,b as o,h as n}from"./chunk.TJ7ZA5LO.js";import{b as m,e as s}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends n{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","help-text");this.size="lg";this.orientation="vertical";this.label="";this.helpText=""}getAllCheckboxes(){return[...this.querySelectorAll("sd-5-15-
|
|
1
|
+
import{a as p}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as d,b as o,h as n}from"./chunk.TJ7ZA5LO.js";import{b as m,e as s}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends n{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","help-text");this.size="lg";this.orientation="vertical";this.label="";this.helpText=""}getAllCheckboxes(){return[...this.querySelectorAll("sd-5-15-13-checkbox")]}async syncCheckboxElements(){let i=this.getAllCheckboxes();await Promise.all(i.map(async l=>{await l.updateComplete,l.size=this.size}))}syncCheckboxes(){customElements.get("sd-5-15-13-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-5-15-13-checkbox").then(()=>this.syncCheckboxes())}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){let i=this.hasSlotController.test("label"),l=this.label?!0:i,b=this.hasSlotController.test("help-text"),c=this.helpText?!0:b,x=s`<slot @slotchange="${this.syncCheckboxes}"></slot>`,h=this.hasSlotController.test("tooltip");return s`<fieldset part="form-control" class="${a("border-0 p-0 m-0",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label">${l||h?s`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a("p-0 font-bold leading-normal text-black",l?"flex":"hidden")}" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${h?s`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a({vertical:"flex flex-col",horizontal:"flex flex-row"}[this.orientation])}">${x}</div></fieldset><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-2",c?"block":"hidden")}" aria-hidden="${!c}">${this.helpText}</slot>`}};t.styles=[...n.styles,m`:host{display:block}:host([orientation=vertical]) ::slotted(sd-5-15-13-checkbox){display:flex;margin-bottom:var(--sd-spacing-2,.5rem)}:host([orientation=vertical]) ::slotted(sd-5-15-13-checkbox:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-5-15-13-checkbox){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-5-15-13-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-5-15-13-checkbox){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-5-15-13-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}`],e([o({type:String,reflect:!0})],t.prototype,"size",2),e([o({type:String,reflect:!0})],t.prototype,"orientation",2),e([o({type:String,reflect:!0})],t.prototype,"label",2),e([o({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),e([r("size",{waitUntilFirstUpdate:!0})],t.prototype,"handleSizeChange",1),e([r("invalid",{waitUntilFirstUpdate:!0})],t.prototype,"handleInvalid",1),t=e([d("sd-5-15-13-checkbox-group")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.Y7NVH75J.js";import{a as c,b as o,d,h as l}from"./chunk.TJ7ZA5LO.js";import{b as p,e as i}from"./chunk.RZUTJ36B.js";import{e as a}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.localize=new v(this);this.playing=!1;this.isBelowBreakpoint=!1;this.hasSlotController=new h(this,"[default]","play-icon","poster")}get poster(){let t=this.shadowRoot.querySelector("slot[name=poster]");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}get video(){return this.querySelector("video")}async hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-medium",300))),this.poster.style.display="none")}setVideoInert(t){var s,n;t?(s=this.video)==null||s.setAttribute("inert",""):(n=this.video)==null||n.removeAttribute("inert")}play(){var t;this.emit("sd-play"),this.playing=!0,(t=this.video)==null||t.play(),this.hidePoster(),this.setVideoInert(!1)}handleKeydown(t){t instanceof KeyboardEvent&&(t.key==="Enter"||t.key===" ")&&(this.play(),setTimeout(()=>{var s;(s=this.video)==null||s.focus()}))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.setVideoInert(!0),this.resizeObserver=new ResizeObserver(()=>this.handleButtonResize()),this.updateComplete.then(()=>{this.resizeObserver.observe(this.hostEl)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return i`<div part="base" class="cursor-pointer"><button part="play-button" aria-label="${this.localize.term("playVideo")}" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","group w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition outline-2 outline-offset-2 group-focus-visible:outline")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-5-15-
|
|
1
|
+
import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.Y7NVH75J.js";import{a as c,b as o,d,h as l}from"./chunk.TJ7ZA5LO.js";import{b as p,e as i}from"./chunk.RZUTJ36B.js";import{e as a}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.localize=new v(this);this.playing=!1;this.isBelowBreakpoint=!1;this.hasSlotController=new h(this,"[default]","play-icon","poster")}get poster(){let t=this.shadowRoot.querySelector("slot[name=poster]");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}get video(){return this.querySelector("video")}async hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-medium",300))),this.poster.style.display="none")}setVideoInert(t){var s,n;t?(s=this.video)==null||s.setAttribute("inert",""):(n=this.video)==null||n.removeAttribute("inert")}play(){var t;this.emit("sd-play"),this.playing=!0,(t=this.video)==null||t.play(),this.hidePoster(),this.setVideoInert(!1)}handleKeydown(t){t instanceof KeyboardEvent&&(t.key==="Enter"||t.key===" ")&&(this.play(),setTimeout(()=>{var s;(s=this.video)==null||s.focus()}))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.setVideoInert(!0),this.resizeObserver=new ResizeObserver(()=>this.handleButtonResize()),this.updateComplete.then(()=>{this.resizeObserver.observe(this.hostEl)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return i`<div part="base" class="cursor-pointer"><button part="play-button" aria-label="${this.localize.term("playVideo")}" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","group w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition outline-2 outline-offset-2 group-focus-visible:outline")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-5-15-13-icon id="default-play-icon" library="_internal" name="start"></sd-5-15-13-icon></slot></div></button> ${this.hasSlotController.test("poster")?i`<div part="poster-wrapper" class="absolute left-0 top-0 w-full z-10 overflow-hidden"><slot name="poster" role="presentation"></slot></div>`:null}<slot></slot></div>`}};e.styles=[...l.styles,p`:host{display:inline-block;overflow:hidden;position:relative}.play-pause-transition,::slotted([slot=poster]){--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:var(--sd-duration-medium,.3s);transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}#default-play-icon,::slotted([slot=play-icon]){left:50%;position:absolute;top:50%;--tw-translate-x:-50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:has([part=play-button]:hover) ::slotted([slot=poster]){--tw-scale-x:1.1!important;--tw-scale-y:1.1!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}`],a([d("[part=base]")],e.prototype,"hostEl",2),a([o({type:Boolean,reflect:!0})],e.prototype,"playing",2),a([o({type:Boolean})],e.prototype,"isBelowBreakpoint",2),e=a([c("sd-5-15-13-video")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk.YEDQWNIV.js";import{a as l,b as e,h as o}from"./chunk.TJ7ZA5LO.js";import{b as a,e as i}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return i`<hr part="main" aria-orientation="${this.orientation}" class="${n(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};t.styles=[...o.styles,a`:host{margin:var(--sd-spacing-0,0)}:host(sd-5-15-
|
|
1
|
+
import{a as n}from"./chunk.YEDQWNIV.js";import{a as l,b as e,h as o}from"./chunk.TJ7ZA5LO.js";import{b as a,e as i}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return i`<hr part="main" aria-orientation="${this.orientation}" class="${n(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};t.styles=[...o.styles,a`:host{margin:var(--sd-spacing-0,0)}:host(sd-5-15-13-divider[orientation=horizontal]){display:block}:host(sd-5-15-13-divider[orientation=vertical]){display:inline-block}`],r([e({type:String,reflect:!0})],t.prototype,"orientation",2),r([e({type:Boolean,reflect:!0})],t.prototype,"inverted",2),t=r([l("sd-5-15-13-divider")],t);export{t as a};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{a as P}from"./chunk.EJI65G6N.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as R,e as K,f as w}from"./chunk.W7A3TU2Z.js";import{c as A}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.NRBNWX7R.js";import{a as F}from"./chunk.CGQ2BPPZ.js";import{a as M}from"./chunk.CHU57RUD.js";import{a as E,c as C}from"./chunk.SKUMYG4O.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as $}from"./chunk.BOIDC3L5.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as V}from"./chunk.Y7NVH75J.js";import{a as g}from"./chunk.E2DRD2OX.js";import{a as k,b as r,c as u,d as c,h as T}from"./chunk.TJ7ZA5LO.js";import{b as D,e as p}from"./chunk.RZUTJ36B.js";import{b as S,e as I}from"./chunk.6OTM3PE5.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends T{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-
|
|
1
|
+
import{a as P}from"./chunk.EJI65G6N.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as R,e as K,f as w}from"./chunk.W7A3TU2Z.js";import{c as A}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.NRBNWX7R.js";import{a as F}from"./chunk.CGQ2BPPZ.js";import{a as M}from"./chunk.CHU57RUD.js";import{a as E,c as C}from"./chunk.SKUMYG4O.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as $}from"./chunk.BOIDC3L5.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as V}from"./chunk.Y7NVH75J.js";import{a as g}from"./chunk.E2DRD2OX.js";import{a as k,b as r,c as u,d as c,h as T}from"./chunk.TJ7ZA5LO.js";import{b as D,e as p}from"./chunk.RZUTJ36B.js";import{b as S,e as I}from"./chunk.6OTM3PE5.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends T{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-15-13-input"]});this.hasSlotController=new F(this,"help-text","label");this.localize=new V(this);this.hasFocus=!1;this.displayInputValue="";this.selectedTextLabel="";this.selectedOptions=[];this.filteredOptions=[];this.allOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.deletedTagLabel="";this.name="";this.value="";this.defaultValue="";this.size="lg";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.clearable=!1;this.open=!1;this.hoist=!1;this.label="";this.placement="bottom";this.helpText="";this.form="";this.required=!1;this.type="text";this.currentPlacement=this.placement;this.getOption=H;this.multiple=!1;this.useTags=!0;this.maxOptionsVisible=3;this.styleOnValid=!1;this.filter=(t,e)=>{let i=w(t.value),a=w(t.getTextLabel()),n=w(e);return i.includes(n)||a.includes(n)};this.getTag=t=>p`<sd-5-15-13-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
2
|
base:tag__base,
|
|
3
3
|
content:tag__content,
|
|
4
4
|
removable-indicator:tag__removable-indicator,
|
|
5
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-
|
|
5
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-15-13-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let i=t.composedPath().some(o=>o instanceof HTMLButtonElement&&o.classList.contains("combobox-button"));if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}if(!(i||t.target.closest(".combobox__clear")!==null)){if(t.key==="Escape"&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),t.key==="Backspace"&&this.multiple&&this.displayInput.value===""){this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0}));return}if(t.key==="Enter"){let o=this.getCurrentOption(),f=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!f){setTimeout(()=>{t.defaultPrevented||this.formControlController.submit()});return}if(!this.open||o!=null&&o.disabled)return;if(o&&!o.disabled){let h=this.value;this.multiple?(this.toggleOptionSelection(o),this.lastOption=o,this.setOrderedSelectedOptions(o),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(o),this.setSelectedOptions(o)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==h&&(this.emit("sd-input"),this.emit("sd-change"))})}this.displayInput.focus({preventScroll:!0}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));return}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption(t.key==="ArrowDown")),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),t.key==="Home"?this.displayInput.setSelectionRange(0,0):t.key==="End"&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){let t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(t==null?void 0:t.getTextLabel())||""}this.formControlController.updateValidity()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){let t=e=>{let i=this.displayInput.value,a=this.getOption(e,i);return e.tabIndex=0,p`${typeof a=="string"?$(a):a}`};return this.filteredOptions.map(e=>e.tagName.toLowerCase()==="sd-5-15-13-optgroup"?(Array.from(e.children).forEach(i=>{i.tagName.toLowerCase()==="sd-5-15-13-option"&&t(i)}),e):t(e))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let i=this.getTag(t,e);return p`<div @sd-remove="${a=>this.handleTagRemove(a,t)}">${typeof i=="string"?$(i):i}</div>`}return[p``]}):[p`<sd-5-15-13-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
6
6
|
base:tag__base,
|
|
7
7
|
content:tag__content,
|
|
8
8
|
removable-indicator:tag__removable-indicator,
|
|
9
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-15-11-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-5-15-11-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),A(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-5-15-11-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,b,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((b=i.parentElement)==null?void 0:b.tagName.toLowerCase())==="sd-5-15-11-optgroup"))return a;let o=i.parentElement,f=(m=o.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),h=e.find(O=>O.id===o.id);if(h){h==null||h.appendChild(a),f&&(h==null||h.appendChild(f));return}let v=o.cloneNode();return v.appendChild(a),f&&v.appendChild(f),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-5-15-11-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await I(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=C(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await I(this);let{keyframes:t,options:e}=C(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.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()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return R(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return K(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-5-15-11-option")){customElements.whenDefined("sd-5-15-11-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-5-15-11-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-5-15-11-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",h=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",h,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"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"}[f],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-11-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-15-13-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-5-15-13-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),A(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-5-15-13-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,b,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((b=i.parentElement)==null?void 0:b.tagName.toLowerCase())==="sd-5-15-13-optgroup"))return a;let o=i.parentElement,f=(m=o.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),h=e.find(O=>O.id===o.id);if(h){h==null||h.appendChild(a),f&&(h==null||h.appendChild(f));return}let v=o.cloneNode();return v.appendChild(a),f&&v.appendChild(f),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-5-15-13-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await I(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=C(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await I(this);let{keyframes:t,options:e}=C(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.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()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return R(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return K(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-5-15-13-option")){customElements.whenDefined("sd-5-15-13-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-5-15-13-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-5-15-13-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":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",h=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",h,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"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"}[f],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-15-13-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
10
10
|
popup:popup__content,
|
|
11
|
-
"><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{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}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",b,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",b)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",h,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(O=>O==null?void 0:O.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",h)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",y,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-11-icon class="${d("text-neutral-700",m)}" name="closing-round" library="_internal"></sd-5-15-11-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-11-icon part="invalid-icon" class="${d(y,m,"text-error")}" library="_internal" name="risk"></sd-5-15-11-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-11-icon part="valid-icon" class="${d("flex-shrink-0 text-success",y,m)}" library="_internal" name="confirm-circle"></sd-5-15-11-icon>`:""}<slot name="right" part="right" class="${d("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",m)}">${this.type!=="search"?p`<sd-5-15-11-icon class="${d("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-5-15-11-icon>`:""}</slot>${this.type==="search"?p`<button class="${d("flex items-center sd-interactive",y)}" type="button"><sd-5-15-11-icon class="${d(v,m)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-11-icon></button>`:p`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${M(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"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" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?p`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-5-15-11-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-1" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.styles=[...T.styles,D`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-5-15-11-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-11-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-5-15-11-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-11-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-11-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,1))}[part=filtered-listbox] sd-5-15-11-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],l([c("sd-5-15-11-popup")],s.prototype,"popup",2),l([c('[part="combobox"]')],s.prototype,"combobox",2),l([c('[part="display-input"]')],s.prototype,"displayInput",2),l([c(".value-input")],s.prototype,"valueInput",2),l([c('[part="listbox"]')],s.prototype,"listbox",2),l([c('[part="tags"]')],s.prototype,"tagWrapper",2),l([c('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([c("slot:not([name])")],s.prototype,"defaultSlot",2),l([c("#invalid-message")],s.prototype,"invalidMessage",2),l([u()],s.prototype,"hasFocus",2),l([u()],s.prototype,"displayInputValue",2),l([u()],s.prototype,"selectedTextLabel",2),l([u()],s.prototype,"selectedOptions",2),l([u()],s.prototype,"filteredOptions",2),l([u()],s.prototype,"allOptions",2),l([u()],s.prototype,"lastOption",2),l([u()],s.prototype,"showValidStyle",2),l([u()],s.prototype,"showInvalidStyle",2),l([u()],s.prototype,"deletedTagLabel",2),l([r({reflect:!0})],s.prototype,"name",2),l([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([P()],s.prototype,"defaultValue",2),l([r({type:String,reflect:!0})],s.prototype,"size",2),l([r({type:String,reflect:!0})],s.prototype,"placeholder",2),l([r({type:String,attribute:"max-options-tag-label",reflect:!0})],s.prototype,"maxOptionsTagLabel",2),l([r({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],s.prototype,"visuallyDisabled",2),l([r({type:Boolean,reflect:!0})],s.prototype,"clearable",2),l([r({type:Boolean,reflect:!0})],s.prototype,"open",2),l([r({type:Boolean,reflect:!0})],s.prototype,"hoist",2),l([r({type:String,reflect:!0})],s.prototype,"label",2),l([r({type:String,reflect:!0})],s.prototype,"placement",2),l([r({type:String,attribute:"help-text",reflect:!0})],s.prototype,"helpText",2),l([r({type:String,reflect:!0})],s.prototype,"form",2),l([r({type:Boolean,reflect:!0})],s.prototype,"required",2),l([r({type:String,reflect:!0})],s.prototype,"type",2),l([u()],s.prototype,"currentPlacement",2),l([r()],s.prototype,"getOption",2),l([r({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([r({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([r({type:Number,reflect:!0,attribute:"max-options-visible"})],s.prototype,"maxOptionsVisible",2),l([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([r()],s.prototype,"filter",2),l([r()],s.prototype,"getTag",2),l([g("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([g("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([g("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([g(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([g("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([g("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([g("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([k("sd-5-15-11-combobox")],s);E("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});E("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{s as a};
|
|
11
|
+
"><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{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}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",b,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",b)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",h,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(O=>O==null?void 0:O.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",h)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",y,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-15-13-icon class="${d("text-neutral-700",m)}" name="closing-round" library="_internal"></sd-5-15-13-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-15-13-icon part="invalid-icon" class="${d(y,m,"text-error")}" library="_internal" name="risk"></sd-5-15-13-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-15-13-icon part="valid-icon" class="${d("flex-shrink-0 text-success",y,m)}" library="_internal" name="confirm-circle"></sd-5-15-13-icon>`:""}<slot name="right" part="right" class="${d("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",m)}">${this.type!=="search"?p`<sd-5-15-13-icon class="${d("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-5-15-13-icon>`:""}</slot>${this.type==="search"?p`<button class="${d("flex items-center sd-interactive",y)}" type="button"><sd-5-15-13-icon class="${d(v,m)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-15-13-icon></button>`:p`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${M(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"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" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?p`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-5-15-13-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-1" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.styles=[...T.styles,D`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-5-15-13-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-15-13-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-5-15-13-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-15-13-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-15-13-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,1))}[part=filtered-listbox] sd-5-15-13-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],l([c("sd-5-15-13-popup")],s.prototype,"popup",2),l([c('[part="combobox"]')],s.prototype,"combobox",2),l([c('[part="display-input"]')],s.prototype,"displayInput",2),l([c(".value-input")],s.prototype,"valueInput",2),l([c('[part="listbox"]')],s.prototype,"listbox",2),l([c('[part="tags"]')],s.prototype,"tagWrapper",2),l([c('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([c("slot:not([name])")],s.prototype,"defaultSlot",2),l([c("#invalid-message")],s.prototype,"invalidMessage",2),l([u()],s.prototype,"hasFocus",2),l([u()],s.prototype,"displayInputValue",2),l([u()],s.prototype,"selectedTextLabel",2),l([u()],s.prototype,"selectedOptions",2),l([u()],s.prototype,"filteredOptions",2),l([u()],s.prototype,"allOptions",2),l([u()],s.prototype,"lastOption",2),l([u()],s.prototype,"showValidStyle",2),l([u()],s.prototype,"showInvalidStyle",2),l([u()],s.prototype,"deletedTagLabel",2),l([r({reflect:!0})],s.prototype,"name",2),l([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([P()],s.prototype,"defaultValue",2),l([r({type:String,reflect:!0})],s.prototype,"size",2),l([r({type:String,reflect:!0})],s.prototype,"placeholder",2),l([r({type:String,attribute:"max-options-tag-label",reflect:!0})],s.prototype,"maxOptionsTagLabel",2),l([r({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],s.prototype,"visuallyDisabled",2),l([r({type:Boolean,reflect:!0})],s.prototype,"clearable",2),l([r({type:Boolean,reflect:!0})],s.prototype,"open",2),l([r({type:Boolean,reflect:!0})],s.prototype,"hoist",2),l([r({type:String,reflect:!0})],s.prototype,"label",2),l([r({type:String,reflect:!0})],s.prototype,"placement",2),l([r({type:String,attribute:"help-text",reflect:!0})],s.prototype,"helpText",2),l([r({type:String,reflect:!0})],s.prototype,"form",2),l([r({type:Boolean,reflect:!0})],s.prototype,"required",2),l([r({type:String,reflect:!0})],s.prototype,"type",2),l([u()],s.prototype,"currentPlacement",2),l([r()],s.prototype,"getOption",2),l([r({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([r({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([r({type:Number,reflect:!0,attribute:"max-options-visible"})],s.prototype,"maxOptionsVisible",2),l([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([r()],s.prototype,"filter",2),l([r()],s.prototype,"getTag",2),l([g("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([g("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([g("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([g(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([g("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([g("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([g("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([k("sd-5-15-13-combobox")],s);E("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});E("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{s as a};
|