@solid-design-system/components 5.17.0 → 5.17.2
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.KVJJEMOI.js → chunk.UVN2WVI6.js} +1 -1
- package/cdn/components/checkbox/checkbox.js +1 -1
- package/cdn/components/datepicker/datepicker.d.ts +3 -0
- package/cdn/components/datepicker/datepicker.js +1 -1
- package/cdn/custom-elements.json +1 -1
- package/cdn/solid-components.bundle.js +3 -3
- package/cdn/solid-components.iife.js +2 -2
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/chunks/chunk.23JJBCLW.js +1 -1
- package/cdn-versioned/chunks/chunk.2D3B6W4C.js +1 -1
- package/cdn-versioned/chunks/chunk.2RPN4LHN.js +4 -4
- package/cdn-versioned/chunks/chunk.2YMJV2KL.js +1 -1
- package/cdn-versioned/chunks/{chunk.NZFGKV2I.js → chunk.37O5FAM6.js} +1 -1
- package/cdn-versioned/chunks/chunk.3PTWVC7K.js +1 -1
- package/cdn-versioned/chunks/chunk.4HEDUSC5.js +1 -1
- package/cdn-versioned/chunks/chunk.4THKQ4PC.js +1 -1
- package/cdn-versioned/chunks/chunk.4USO2EJG.js +2 -2
- package/cdn-versioned/chunks/chunk.5GPPZUNF.js +1 -1
- package/cdn-versioned/chunks/chunk.6QNQMWSQ.js +2 -2
- package/cdn-versioned/chunks/chunk.6XOV6LQS.js +1 -1
- package/cdn-versioned/chunks/chunk.72JQHJ3G.js +1 -1
- package/cdn-versioned/chunks/chunk.75UMJKQC.js +1 -1
- package/cdn-versioned/chunks/chunk.7FMD6ZWC.js +1 -1
- package/cdn-versioned/chunks/chunk.7NHEEBDB.js +1 -1
- package/cdn-versioned/chunks/chunk.7SJXKLVN.js +1 -1
- package/cdn-versioned/chunks/chunk.ADTHFKFC.js +1 -1
- package/cdn-versioned/chunks/chunk.AKJ7U3Y3.js +1 -1
- package/cdn-versioned/chunks/chunk.BV42CEWL.js +1 -1
- package/cdn-versioned/chunks/chunk.CARQ25VA.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.CTOV3B4T.js +1 -1
- package/cdn-versioned/chunks/chunk.EIGW4PKE.js +1 -1
- package/cdn-versioned/chunks/chunk.EIRHQEOO.js +1 -1
- package/cdn-versioned/chunks/chunk.FYOUHXBZ.js +1 -1
- package/cdn-versioned/chunks/chunk.H3W4J4F4.js +1 -1
- package/cdn-versioned/chunks/chunk.H7I6O5HE.js +1 -1
- package/cdn-versioned/chunks/chunk.HJ4O4XQA.js +1 -1
- package/cdn-versioned/chunks/chunk.HXUQZXCZ.js +1 -1
- package/cdn-versioned/chunks/chunk.LLJ2OCGM.js +4 -4
- package/cdn-versioned/chunks/chunk.M6XINJ52.js +1 -1
- package/cdn-versioned/chunks/chunk.MGCXOSRH.js +1 -1
- package/cdn-versioned/chunks/chunk.MMM4IMJD.js +1 -1
- package/cdn-versioned/chunks/chunk.N4RSYGAV.js +1 -1
- package/cdn-versioned/chunks/chunk.NRBNWX7R.js +1 -1
- package/cdn-versioned/chunks/chunk.NTP4LLF3.js +1 -1
- package/cdn-versioned/chunks/chunk.OCIA2UJP.js +1 -1
- package/cdn-versioned/chunks/chunk.OIOXSZHI.js +1 -1
- package/cdn-versioned/chunks/chunk.OPMX2Q3A.js +1 -1
- package/cdn-versioned/chunks/chunk.OQSPWMNR.js +1 -1
- package/cdn-versioned/chunks/chunk.PCAKJGIV.js +1 -1
- package/cdn-versioned/chunks/chunk.PIAYQI7K.js +1 -1
- package/cdn-versioned/chunks/chunk.QJAN6R4E.js +1 -1
- package/cdn-versioned/chunks/chunk.QJFZKBPG.js +1 -1
- package/cdn-versioned/chunks/chunk.QJVPLDR4.js +1 -1
- package/cdn-versioned/chunks/chunk.RCMXIAQV.js +1 -1
- package/cdn-versioned/chunks/chunk.RIOXBQBC.js +1 -1
- package/cdn-versioned/chunks/chunk.ROIKKEJQ.js +1 -1
- package/cdn-versioned/chunks/chunk.SQ7OLI7Q.js +1 -1
- package/cdn-versioned/chunks/chunk.TDRPE2QQ.js +1 -1
- package/cdn-versioned/chunks/chunk.TFKNNQ5S.js +1 -1
- package/cdn-versioned/chunks/chunk.TTG6Y6QJ.js +1 -1
- package/cdn-versioned/chunks/{chunk.KVJJEMOI.js → chunk.UVN2WVI6.js} +1 -1
- package/cdn-versioned/chunks/chunk.W2JKI6K3.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.XAIFQKHV.js +1 -1
- package/cdn-versioned/chunks/chunk.YMTUR575.js +1 -1
- package/cdn-versioned/chunks/chunk.YVU7BES7.js +1 -1
- package/cdn-versioned/chunks/chunk.Z4V7WPTW.js +1 -1
- package/cdn-versioned/chunks/chunk.ZENM3WVO.js +1 -1
- package/cdn-versioned/chunks/chunk.ZKBX734R.js +1 -1
- package/cdn-versioned/chunks/chunk.ZZAPDP7V.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/checkbox.js +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/datepicker/datepicker.d.ts +4 -1
- package/cdn-versioned/components/datepicker/datepicker.js +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/skeleton/skeleton.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 +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 +248 -248
- 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 +94 -94
- package/cdn-versioned/web-types.json +163 -163
- package/dist/chunks/{chunk.ZBDFCFOP.js → chunk.CA5LQ5RH.js} +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/datepicker/datepicker.d.ts +3 -0
- package/dist/components/datepicker/datepicker.js +10 -1
- package/dist/custom-elements.json +1 -1
- package/dist/solid-components.js +5 -5
- package/dist/web-types.json +1 -1
- package/dist-versioned/chunks/chunk.22DM7THN.js +2 -2
- package/dist-versioned/chunks/chunk.246LUIGB.js +1 -1
- package/dist-versioned/chunks/chunk.2EN4CJ2E.js +1 -1
- package/dist-versioned/chunks/chunk.3CUXBZXY.js +1 -1
- package/dist-versioned/chunks/chunk.4D5SPJ27.js +1 -1
- package/dist-versioned/chunks/chunk.4VSYGWIQ.js +2 -2
- package/dist-versioned/chunks/chunk.5L52M55A.js +3 -3
- package/dist-versioned/chunks/chunk.63D5DO3S.js +2 -2
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6KCL3YWT.js +3 -3
- package/dist-versioned/chunks/chunk.6OGLZOU3.js +1 -1
- package/dist-versioned/chunks/chunk.A5GKQZGQ.js +2 -2
- package/dist-versioned/chunks/chunk.AAK5STGD.js +2 -2
- package/dist-versioned/chunks/chunk.ATKLZZWE.js +2 -2
- package/dist-versioned/chunks/chunk.AUMWRORX.js +6 -6
- package/dist-versioned/chunks/chunk.AWVURKQ3.js +8 -8
- package/dist-versioned/chunks/chunk.AZ5YCFXX.js +2 -2
- package/dist-versioned/chunks/{chunk.ZBDFCFOP.js → chunk.CA5LQ5RH.js} +3 -3
- package/dist-versioned/chunks/chunk.DOGMVREV.js +3 -3
- package/dist-versioned/chunks/chunk.E4O3LVAZ.js +1 -1
- package/dist-versioned/chunks/chunk.FPIRMH7R.js +4 -4
- package/dist-versioned/chunks/chunk.FWDG6KMC.js +1 -1
- package/dist-versioned/chunks/chunk.HTEXYS4A.js +26 -26
- package/dist-versioned/chunks/chunk.IKDVBWFR.js +2 -2
- package/dist-versioned/chunks/chunk.J2MPIUT5.js +1 -1
- package/dist-versioned/chunks/chunk.JUZY76ML.js +1 -1
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.KHS7FSFX.js +5 -5
- package/dist-versioned/chunks/chunk.KMU4KABG.js +2 -2
- package/dist-versioned/chunks/chunk.MCUIYSD6.js +2 -2
- package/dist-versioned/chunks/chunk.NBHVDDUK.js +4 -4
- package/dist-versioned/chunks/chunk.NYOWE72U.js +1 -1
- package/dist-versioned/chunks/chunk.OH3W4PGL.js +24 -24
- package/dist-versioned/chunks/chunk.OWYDTY46.js +2 -2
- package/dist-versioned/chunks/chunk.P2JBJQH6.js +1 -1
- package/dist-versioned/chunks/chunk.PKG3F2KC.js +1 -1
- package/dist-versioned/chunks/chunk.Q4HWX7FF.js +5 -5
- package/dist-versioned/chunks/chunk.QP27BG3Y.js +1 -1
- package/dist-versioned/chunks/chunk.QPBHKXL6.js +3 -3
- package/dist-versioned/chunks/chunk.QPBJEOPN.js +12 -12
- package/dist-versioned/chunks/chunk.QTQEKSJS.js +1 -1
- package/dist-versioned/chunks/chunk.QVNC3EJB.js +1 -1
- package/dist-versioned/chunks/chunk.RZLBIMEH.js +1 -1
- package/dist-versioned/chunks/chunk.S253T7LE.js +11 -11
- package/dist-versioned/chunks/chunk.SJZCQ5SU.js +12 -12
- package/dist-versioned/chunks/chunk.TD5EDBVC.js +2 -2
- package/dist-versioned/chunks/{chunk.3FCBHDPH.js → chunk.TJKIQ2ZR.js} +5 -5
- package/dist-versioned/chunks/chunk.TMJN75ST.js +6 -6
- package/dist-versioned/chunks/chunk.U5L4ZATG.js +5 -5
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.URTB3C7J.js +3 -3
- package/dist-versioned/chunks/chunk.VDSIXERI.js +2 -2
- package/dist-versioned/chunks/chunk.VUTMPKYK.js +3 -3
- package/dist-versioned/chunks/chunk.W6RMEFFR.js +2 -2
- package/dist-versioned/chunks/chunk.WRP3NGPP.js +4 -4
- package/dist-versioned/chunks/chunk.WTG2WY6X.js +5 -5
- package/dist-versioned/chunks/chunk.WUB4VSXU.js +2 -2
- package/dist-versioned/chunks/chunk.XCQC3F3H.js +3 -3
- package/dist-versioned/chunks/chunk.XRKSJCLQ.js +6 -6
- package/dist-versioned/chunks/chunk.YBAAPYHP.js +14 -14
- package/dist-versioned/chunks/chunk.YGHO5R3O.js +3 -3
- package/dist-versioned/chunks/chunk.ZAQS4XFO.js +2 -2
- package/dist-versioned/chunks/chunk.ZUL25WD4.js +1 -1
- 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/checkbox.js +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/datepicker/datepicker.d.ts +4 -1
- package/dist-versioned/components/datepicker/datepicker.js +10 -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/skeleton/skeleton.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 +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 +248 -248
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +5 -5
- package/dist-versioned/vscode.html-custom-data.json +94 -94
- package/dist-versioned/web-types.json +163 -163
- package/package.json +1 -1
- /package/cdn/chunks/{chunk.NZFGKV2I.js → chunk.37O5FAM6.js} +0 -0
- /package/dist/chunks/{chunk.3FCBHDPH.js → chunk.TJKIQ2ZR.js} +0 -0
|
@@ -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.L6MCOH7T.js";import{a as C,b as h,d as f,e as D,h as T}from"./chunk.M6XINJ52.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-17-0-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-17-0-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-17-0-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.L6MCOH7T.js";import{a as C,b as h,d as f,e as D,h as T}from"./chunk.M6XINJ52.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-17-2-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-17-2-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-17-2-range")],l);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk.HJ4O4XQA.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.M6XINJ52.js";import{b as c,e as i}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-17-
|
|
1
|
+
import{a as p}from"./chunk.HJ4O4XQA.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.M6XINJ52.js";import{b as c,e as i}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-17-2-icon name="status-check" library="sd-status-assets" aria-hidden="true"></sd-5-17-2-icon></span>`:""} ${b.iconIndent?i`<slot name="icon-indent" part="icon-indent" class="flex items-center grow-0 shrink-0 basis-auto mr-2"></slot>`:""}<slot part="label" class="inline-flex grow shrink basis-auto text-ellipsis overflow-hidden" @slotchange="${this.handleDefaultSlotChange}"></slot>${this.chevron||this.isSubmenu()?i`<span part="submenu-icon" class="flex items-center justify-center grow-0 shrink-0 basis-auto ml-3"><sd-5-17-2-icon name="chevron-right" library="_internal" aria-hidden="true" class="h-6 w-6"></sd-5-17-2-icon></span>`:""} ${this.submenuController.renderSubmenu()}</div>`}};e.styles=[...n.styles,c`:host{--submenu-offset:-6px;display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}::slotted(sd-5-17-2-icon){height:var(--sd-spacing-6,1.5rem);width:var(--sd-spacing-6,1.5rem)}[part=checked-icon]{margin-right:var(--sd-spacing-3,.75rem)}.submenu-expanded:after{bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);position:fixed;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:calc(var(z-dropdown) - 1);--tw-content:"";clip-path:polygon(var(--safe-triangle-cursor-x,0) var(--safe-triangle-cursor-y,0),var(--safe-triangle-submenu-start-x,0) var(--safe-triangle-submenu-start-y,0),var(--safe-triangle-submenu-end-x,0) var(--safe-triangle-submenu-end-y,0));content:var(--tw-content)}:host(:hover:not([aria-disabled=true],:focus-visible)) [part=base]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}:host(:focus-visible:not([aria-disabled=true])) [part=base]{outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:-2px;outline-style:solid;outline-width:2px}:host(:hover) [part=base]{outline:2px solid transparent;outline-offset:2px}sd-5-17-2-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));margin-left:var(--submenu-offset)}::slotted(sd-5-17-2-menu){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important}`],t([o("slot:not([name])")],e.prototype,"defaultSlot",2),t([o('part="base"')],e.prototype,"menuItem",2),t([a()],e.prototype,"type",2),t([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([a()],e.prototype,"value",2),t([a({type:Boolean,reflect:!0})],e.prototype,"chevron",2),t([r("checked")],e.prototype,"handleCheckedChange",1),t([r("disabled")],e.prototype,"handleDisabledChange",1),t([r("type")],e.prototype,"handleTypeChange",1),e=t([h("sd-5-17-2-menu-item")],e);export{e as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as T,b as M}from"./chunk.G7HKVXLR.js";import{c as L}from"./chunk.3L472FD4.js";import{a as h,c as u}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.L6MCOH7T.js";import{a as E}from"./chunk.E2DRD2OX.js";import{a as w,b as o,d as r,h as d}from"./chunk.M6XINJ52.js";import{b as y,e as b}from"./chunk.RZUTJ36B.js";import{b as l,e as p}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";function A(c,f){let e=c;for(;e;){if(e.matches(f))return e;if(e.parentElement)e=e.parentElement;else if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else break}return null}var n=class extends d{constructor(){super(...arguments);this.localize=new v(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let t=this.trigger.assignedElements({flatten:!0}).find(a=>M(a).start),s=null;if(t)switch(t.tagName.toLowerCase()){case"sd-5-17-
|
|
1
|
+
import{a as T,b as M}from"./chunk.G7HKVXLR.js";import{c as L}from"./chunk.3L472FD4.js";import{a as h,c as u}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.L6MCOH7T.js";import{a as E}from"./chunk.E2DRD2OX.js";import{a as w,b as o,d as r,h as d}from"./chunk.M6XINJ52.js";import{b as y,e as b}from"./chunk.RZUTJ36B.js";import{b as l,e as p}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";function A(c,f){let e=c;for(;e;){if(e.matches(f))return e;if(e.parentElement)e=e.parentElement;else if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else break}return null}var n=class extends d{constructor(){super(...arguments);this.localize=new v(this);this.open=!1;this.rounded=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.noAutoSize=!1;this.noFlip=!1;this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}getAccessibleTrigger(){let t=this.trigger.assignedElements({flatten:!0}).find(a=>M(a).start),s=null;if(t)switch(t.tagName.toLowerCase()){case"sd-5-17-2-button":case"sd-5-17-2-icon-button":s=t.button;break;case"sd-5-17-2-navigation-item":s=t.button;break;default:s=t}return s}updateAccessibleTrigger(){let e=this.getAccessibleTrigger();e&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded",this.open?"true":"false"))}focusOnTrigger(){let e=this.getAccessibleTrigger();typeof(e==null?void 0:e.focus)=="function"&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find(e=>e.tagName.toLowerCase()==="sd-5-17-2-menu")}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if(e.key==="Tab"){if(this.open&&((t=document.activeElement)==null?void 0:t.tagName.toLowerCase())==="sd-5-17-2-menu-item"){e.preventDefault(),this.hide(),this.focusOnTrigger();return}setTimeout(()=>{let s=T();(!s||!this.containingElement||A(s,this.containingElement.tagName.toLowerCase())!==this.containingElement)&&this.hide()})}}handleDocumentMouseDown(e){let t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){let t=e.target;L(t,this.panel)}handlePanelSelect(e){let t=e.target;!this.stayOpenOnSelect&&t.tagName.toLowerCase()==="sd-5-17-2-menu"&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if(e.key==="Escape"&&this.open){e.stopPropagation(),this.focusOnTrigger(),this.hide();return}if([" ","Enter"].includes(e.key)){e.preventDefault(),this.handleTriggerClick();return}let t=this.getMenu();if(t){let s=t.defaultSlot.assignedElements({flatten:!0}),a=s.find(C=>!C.disabled)||s[0],g=s[s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),s.length>0&&requestAnimationFrame(()=>{(e.key==="ArrowDown"||e.key==="Home")&&(t.setCurrentItem(a),a.focus()),(e.key==="ArrowUp"||e.key==="End")&&(t.setCurrentItem(g),g.focus())}))}}handleTriggerKeyUp(e){e.key===" "&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}async show(){if(!this.open)return this.open=!0,m(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-5-17-2-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-5-17-2-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await p(this),this.panel.hidden=!1,this.popup.active=!0;let{keyframes:e,options:t}=u(this,"dropdown.show",{dir:this.localize.dir()});await l(this.popup.popup,e,t),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await p(this);let{keyframes:e,options:t}=u(this,"dropdown.hide",{dir:this.localize.dir()});await l(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return b`<sd-5-17-2-popup part="base" id="dropdown" exportparts="
|
|
2
2
|
popup:base__popup,
|
|
3
|
-
" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${k("shadow bg-white block",this.open?"pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-5-17-
|
|
3
|
+
" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${k("shadow bg-white block",this.open?"pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-5-17-2-popup>`}};n.styles=[...d.styles,y`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown,900)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],i([r("#dropdown")],n.prototype,"popup",2),i([r("[part=trigger]")],n.prototype,"trigger",2),i([r("[part=panel]")],n.prototype,"panel",2),i([o({type:Boolean,reflect:!0})],n.prototype,"open",2),i([o({type:Boolean,reflect:!0})],n.prototype,"rounded",2),i([o({type:String,reflect:!0})],n.prototype,"placement",2),i([o({type:Boolean,reflect:!0})],n.prototype,"disabled",2),i([o({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],n.prototype,"stayOpenOnSelect",2),i([o({type:Object})],n.prototype,"containingElement",2),i([o({type:Number,reflect:!0})],n.prototype,"distance",2),i([o({type:Number,reflect:!0})],n.prototype,"skidding",2),i([o({type:Boolean,reflect:!0,attribute:"no-auto-size"})],n.prototype,"noAutoSize",2),i([o({type:Boolean,reflect:!0,attribute:"no-flip"})],n.prototype,"noFlip",2),i([o({type:Boolean,reflect:!0})],n.prototype,"hoist",2),i([E("open",{waitUntilFirstUpdate:!0})],n.prototype,"handleOpenChange",1),n=i([w("sd-5-17-2-dropdown")],n);h("dropdown.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});h("dropdown.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk.YEDQWNIV.js";import{a}from"./chunk.L6MCOH7T.js";import{a as i,b as s,h as l}from"./chunk.M6XINJ52.js";import{b as t,e as o}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.color="currentColor";this.localize=new a(this)}render(){return o`<svg role="progressbar" viewBox="0 0 24 24" class="${m("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};e.styles=[...l.styles,t`:host{display:inline-block;height:1em;width:1em}`],r([s({type:String,reflect:!0})],e.prototype,"color",2),e=r([i("sd-5-17-
|
|
1
|
+
import{a as m}from"./chunk.YEDQWNIV.js";import{a}from"./chunk.L6MCOH7T.js";import{a as i,b as s,h as l}from"./chunk.M6XINJ52.js";import{b as t,e as o}from"./chunk.RZUTJ36B.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.color="currentColor";this.localize=new a(this)}render(){return o`<svg role="progressbar" viewBox="0 0 24 24" class="${m("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};e.styles=[...l.styles,t`:host{display:inline-block;height:1em;width:1em}`],r([s({type:String,reflect:!0})],e.prototype,"color",2),e=r([i("sd-5-17-2-spinner")],e);export{e as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as m,c as f}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.KLRPP4NQ.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.L6MCOH7T.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as b,b as o,d as n,h as c}from"./chunk.M6XINJ52.js";import{b as g,e as r}from"./chunk.RZUTJ36B.js";import{b as p,c as l,e as u}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new x(this);this.hasSlotController=new k(this,"[default]","content");this.size="lg";this.content="";this.placement="top";this.disabled=!1;this.open=!1;this.trigger="click focus";this.hoist=!1;this.handleMouseInteraction=()=>{this.interactionType="mouse"};this.handleKeyboardInteraction=()=>{this.interactionType="keyboard"}}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),document.addEventListener("mousedown",this.handleMouseInteraction),document.addEventListener("keydown",this.handleKeyboardInteraction),this.updateComplete.then(()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)})}firstUpdated(){this.body.hidden=!this.open,this.formatDefaultSlot(this.defaultSlot),this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("mousedown",this.handleMouseInteraction),document.removeEventListener("keydown",this.handleKeyboardInteraction)}get hasCustomTrigger(){return this.hasSlotController.test("[default]")}formatDefaultSlot(e){if(!e)return;e.assignedNodes({flatten:!0}).forEach(s=>{var w,y;s.nodeType===Node.TEXT_NODE&&!((w=s==null?void 0:s.textContent)!=null&&w.trim())&&((y=s==null?void 0:s.parentNode)==null||y.removeChild(s))})}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.interactionType==="keyboard"&&this.show()}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),e)}}handleMouseOut(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),e)}}hasTrigger(e){return this.trigger.split(" ").includes(e)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await u(this.body),this.body.hidden=!1,this.popup.active=!0;let{keyframes:e,options:a}=f(this,"tooltip.show",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.emit("sd-after-show")}else{this.emit("sd-hide"),await u(this.body);let{keyframes:e,options:a}=f(this,"tooltip.hide",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,v(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,this.trigger==="click"||this.trigger==="click focus"?this.focus():this.blur(),v(this,"sd-after-hide")}render(){let e=this.placement.endsWith("-start"),a=this.placement.endsWith("-end");return r`<sd-5-17-
|
|
1
|
+
import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as m,c as f}from"./chunk.SKUMYG4O.js";import{a as v}from"./chunk.KLRPP4NQ.js";import{a as d}from"./chunk.YEDQWNIV.js";import{a as x}from"./chunk.L6MCOH7T.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as b,b as o,d as n,h as c}from"./chunk.M6XINJ52.js";import{b as g,e as r}from"./chunk.RZUTJ36B.js";import{b as p,c as l,e as u}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.localize=new x(this);this.hasSlotController=new k(this,"[default]","content");this.size="lg";this.content="";this.placement="top";this.disabled=!1;this.open=!1;this.trigger="click focus";this.hoist=!1;this.handleMouseInteraction=()=>{this.interactionType="mouse"};this.handleKeyboardInteraction=()=>{this.interactionType="keyboard"}}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),document.addEventListener("mousedown",this.handleMouseInteraction),document.addEventListener("keydown",this.handleKeyboardInteraction),this.updateComplete.then(()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)})}firstUpdated(){this.body.hidden=!this.open,this.formatDefaultSlot(this.defaultSlot),this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("mousedown",this.handleMouseInteraction),document.removeEventListener("keydown",this.handleKeyboardInteraction)}get hasCustomTrigger(){return this.hasSlotController.test("[default]")}formatDefaultSlot(e){if(!e)return;e.assignedNodes({flatten:!0}).forEach(s=>{var w,y;s.nodeType===Node.TEXT_NODE&&!((w=s==null?void 0:s.textContent)!=null&&w.trim())&&((y=s==null?void 0:s.parentNode)==null||y.removeChild(s))})}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.interactionType==="keyboard"&&this.show()}handleKeyDown(e){this.open&&e.key==="Escape"&&(e.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),e)}}handleMouseOut(){if(this.hasTrigger("hover")){let e=l(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),e)}}hasTrigger(e){return this.trigger.split(" ").includes(e)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await u(this.body),this.body.hidden=!1,this.popup.active=!0;let{keyframes:e,options:a}=f(this,"tooltip.show",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.emit("sd-after-show")}else{this.emit("sd-hide"),await u(this.body);let{keyframes:e,options:a}=f(this,"tooltip.hide",{dir:this.localize.dir()});await p(this.popup.popup,e,a),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,v(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,this.trigger==="click"||this.trigger==="click focus"?this.focus():this.blur(),v(this,"sd-after-hide")}render(){let e=this.placement.endsWith("-start"),a=this.placement.endsWith("-end");return r`<sd-5-17-2-popup part="base" exportparts="
|
|
2
2
|
popup:base__popup,
|
|
3
3
|
arrow:base__arrow
|
|
4
|
-
" class="${d(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[e?"start":a?"end":"default"]*(this.size==="sm"?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0">${this.hasCustomTrigger?r`<slot slot="anchor"></slot>`:r`<button slot="anchor" aria-describedby="tooltip" class="${d("flex sd-interactive rounded-full",this.size==="lg"?"text-xl":"text-base")}" ?disabled="${this.disabled}" aria-expanded="${this.open}" aria-controls="tooltip"><sd-5-17-
|
|
4
|
+
" class="${d(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[e?"start":a?"end":"default"]*(this.size==="sm"?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0">${this.hasCustomTrigger?r`<slot slot="anchor"></slot>`:r`<button slot="anchor" aria-describedby="tooltip" class="${d("flex sd-interactive rounded-full",this.size==="lg"?"text-xl":"text-base")}" ?disabled="${this.disabled}" aria-expanded="${this.open}" aria-controls="tooltip"><sd-5-17-2-icon library="_internal" name="info-circle" label="Tooltip" class="${d(this.disabled&&"sd-interactive--disabled")}"></sd-5-17-2-icon></button>`}<slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="${this.content}" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-5-17-2-popup>`}};t.styles=[...c.styles,g`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-5-17-2-popup{--arrow-color:rgb(var(--sd-color-primary,0 53 142)/1);--arrow-size:10px}sd-5-17-2-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-17-2-popup::part(arrow){--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-17-2-popup[placement^=top]::part(popup){transform-origin:bottom}sd-5-17-2-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important;overflow:auto}`],i([n("slot:not([name])")],t.prototype,"defaultSlot",2),i([n("#tooltip")],t.prototype,"body",2),i([n("sd-5-17-2-popup")],t.prototype,"popup",2),i([o({type:String,reflect:!0})],t.prototype,"size",2),i([o({type:String,reflect:!0})],t.prototype,"content",2),i([o({type:String,reflect:!0})],t.prototype,"placement",2),i([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([o({type:Boolean,reflect:!0})],t.prototype,"open",2),i([o({type:String,reflect:!0})],t.prototype,"trigger",2),i([o({type:Boolean,reflect:!0})],t.prototype,"hoist",2),i([h("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([h(["content","hoist","placement"])],t.prototype,"handleOptionsChange",1),i([h("disabled")],t.prototype,"handleDisabledChange",1),t=i([b("sd-5-17-2-tooltip")],t);m("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});m("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk.CHU57RUD.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as k}from"./chunk.L6MCOH7T.js";import{a as T,b as h,c as b,d as u,h as y}from"./chunk.M6XINJ52.js";import{b as S,e as c}from"./chunk.RZUTJ36B.js";import{e as o}from"./chunk.TJOCV4DC.js";var n=class extends y{constructor(){super(...arguments);this.localize=new k(this);this.orientation="horizontal";this.scrollbars=!1;this.buttons=!1;this.shadows=!1;this.inset=!1;this.step=150;this.canScroll={left:!1,right:!1,up:!1,down:!1};this.isScrollHorizontalEnabled=!1;this.isScrollVerticalEnabled=!1}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver(()=>{this.handleContainerScroll()}),this.updateComplete.then(()=>{this.container&&this.resizeObserver.observe(this.container)})}disconnectedCallback(){super.disconnectedCallback(),this.container&&this.resizeObserver.unobserve(this.container)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.handleContainerScroll())}updateScrollEnabledFlags(){let t=this.orientation;this.isScrollHorizontalEnabled=t==="horizontal"||t==="auto",this.isScrollVerticalEnabled=t==="vertical"||t==="auto"}get scrollButtons(){return{left:this.leftButton,right:this.rightButton,up:this.upButton,down:this.downButton}}handleContainerScroll(){if(!this.container)return;let t=this.container.scrollLeft>0,i=this.container.scrollLeft+this.container.clientWidth<this.container.scrollWidth-1,e=this.container.scrollTop>0,d=this.container.scrollTop+this.container.clientHeight<this.container.scrollHeight-1,a=this.canScroll,r={left:this.isScrollHorizontalEnabled&&t,right:this.isScrollHorizontalEnabled&&i,up:this.isScrollVerticalEnabled&&e,down:this.isScrollVerticalEnabled&&d},m=a.left&&!r.left,v=a.up&&!r.up,E=a.right&&!r.right,f=a.down&&!r.down;(m||v)&&this.dispatchEvent(new CustomEvent("start")),(E||f)&&this.dispatchEvent(new CustomEvent("end")),this.canScroll=r}handleScroll(t,i){var z,x,B;let e=["left","up"].includes(t)?-this.step:this.step,d=["left","right"].includes(t)?"horizontal":"vertical",a=["left","up"].includes(t)?"start":"end",r=!["mouse","touch"].includes((z=i==null?void 0:i.pointerType)!=null?z:""),m=d==="horizontal"?"left":"top";(x=this.container)==null||x.scrollBy({behavior:"smooth",[m]:e});let v=`button-${t}`;this.dispatchEvent(new CustomEvent(v,{bubbles:!0,composed:!0}));let f=(d==="horizontal"?this.container.scrollLeft:this.container.scrollTop)+e,C=d==="horizontal"?this.container.scrollWidth-this.container.clientWidth:this.container.scrollHeight-this.container.clientHeight,$=a==="start"&&f<=0,H=a==="end"&&f>=C-1;if(!($||H)){let w=this.localize.term("scrolled");this.announcementContainer.textContent=this.announcementContainer.textContent===w?`${w}\u200B`:w;return}let g=this.scrollButtons[t],p={left:this.rightButton,right:this.leftButton,up:this.downButton,down:this.upButton}[t],L=$?`${this.localize.term("scrolled")}. ${this.localize.term("scrollToEnd")}`:`${this.localize.term("scrolled")}. ${this.localize.term("scrollToStart")}`;(B=p==null?void 0:p.querySelector("sd-5-17-
|
|
1
|
+
import{a as s}from"./chunk.CHU57RUD.js";import{a as l}from"./chunk.YEDQWNIV.js";import{a as k}from"./chunk.L6MCOH7T.js";import{a as T,b as h,c as b,d as u,h as y}from"./chunk.M6XINJ52.js";import{b as S,e as c}from"./chunk.RZUTJ36B.js";import{e as o}from"./chunk.TJOCV4DC.js";var n=class extends y{constructor(){super(...arguments);this.localize=new k(this);this.orientation="horizontal";this.scrollbars=!1;this.buttons=!1;this.shadows=!1;this.inset=!1;this.step=150;this.canScroll={left:!1,right:!1,up:!1,down:!1};this.isScrollHorizontalEnabled=!1;this.isScrollVerticalEnabled=!1}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver(()=>{this.handleContainerScroll()}),this.updateComplete.then(()=>{this.container&&this.resizeObserver.observe(this.container)})}disconnectedCallback(){super.disconnectedCallback(),this.container&&this.resizeObserver.unobserve(this.container)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.handleContainerScroll())}updateScrollEnabledFlags(){let t=this.orientation;this.isScrollHorizontalEnabled=t==="horizontal"||t==="auto",this.isScrollVerticalEnabled=t==="vertical"||t==="auto"}get scrollButtons(){return{left:this.leftButton,right:this.rightButton,up:this.upButton,down:this.downButton}}handleContainerScroll(){if(!this.container)return;let t=this.container.scrollLeft>0,i=this.container.scrollLeft+this.container.clientWidth<this.container.scrollWidth-1,e=this.container.scrollTop>0,d=this.container.scrollTop+this.container.clientHeight<this.container.scrollHeight-1,a=this.canScroll,r={left:this.isScrollHorizontalEnabled&&t,right:this.isScrollHorizontalEnabled&&i,up:this.isScrollVerticalEnabled&&e,down:this.isScrollVerticalEnabled&&d},m=a.left&&!r.left,v=a.up&&!r.up,E=a.right&&!r.right,f=a.down&&!r.down;(m||v)&&this.dispatchEvent(new CustomEvent("start")),(E||f)&&this.dispatchEvent(new CustomEvent("end")),this.canScroll=r}handleScroll(t,i){var z,x,B;let e=["left","up"].includes(t)?-this.step:this.step,d=["left","right"].includes(t)?"horizontal":"vertical",a=["left","up"].includes(t)?"start":"end",r=!["mouse","touch"].includes((z=i==null?void 0:i.pointerType)!=null?z:""),m=d==="horizontal"?"left":"top";(x=this.container)==null||x.scrollBy({behavior:"smooth",[m]:e});let v=`button-${t}`;this.dispatchEvent(new CustomEvent(v,{bubbles:!0,composed:!0}));let f=(d==="horizontal"?this.container.scrollLeft:this.container.scrollTop)+e,C=d==="horizontal"?this.container.scrollWidth-this.container.clientWidth:this.container.scrollHeight-this.container.clientHeight,$=a==="start"&&f<=0,H=a==="end"&&f>=C-1;if(!($||H)){let w=this.localize.term("scrolled");this.announcementContainer.textContent=this.announcementContainer.textContent===w?`${w}\u200B`:w;return}let g=this.scrollButtons[t],p={left:this.rightButton,right:this.leftButton,up:this.downButton,down:this.upButton}[t],L=$?`${this.localize.term("scrolled")}. ${this.localize.term("scrollToEnd")}`:`${this.localize.term("scrolled")}. ${this.localize.term("scrollToStart")}`;(B=p==null?void 0:p.querySelector("sd-5-17-2-icon"))==null||B.setAttribute("label",L),r?p==null||p.focus():g==null||g.blur()}handleButtonBlur(t,i){var r;let d=(["left","up"].includes(t)?"start":"end")==="start"?this.localize.term("scrollToStart"):this.localize.term("scrollToEnd");(r=i.target.querySelector("sd-5-17-2-icon"))==null||r.setAttribute("label",d)}render(){let t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",i="scroll-shadow absolute z-10 pointer-events-none transition-opacity duration-medium ease-in-out";return c`<div part="base" class="${l("scroll-container flex overflow-hidden flex-1",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset&&"p-4",{horizontal:"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden",vertical:"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden",auto:"scroll-auto overflow-auto"}[this.orientation])}" @scroll="${this.handleContainerScroll}" tabindex="0"><div id="announcement-container" role="status" class="sr-only"></div><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?c`${this.isScrollHorizontalEnabled?c`<div part="button-left" class="${l("absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8 transition-opacity duration-medium ease-in-out",!this.canScroll.left&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${l(t)}" aria-hidden="${s(!this.canScroll.left||void 0)}" tabindex="${s(this.canScroll.left?void 0:-1)}" @click="${e=>this.handleScroll("left",e)}" @blur="${e=>this.handleButtonBlur("left",e)}"><slot name="icon-start"><sd-5-17-2-icon library="_internal" name="chevron-up" class="rotate-[-90deg]" label="${this.localize.term("scrollToStart")}"></sd-5-17-2-icon></slot></button></div><div part="button-right" class="${l("absolute z-10 flex items-center justify-center top-0 right-0 h-full w-8 transition-opacity duration-medium ease-in-out",!this.canScroll.right&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${l(t)}" aria-hidden="${s(!this.canScroll.right||void 0)}" tabindex="${s(this.canScroll.right?void 0:-1)}" @click="${e=>this.handleScroll("right",e)}" @blur="${e=>this.handleButtonBlur("right",e)}"><slot name="icon-end"><sd-5-17-2-icon library="_internal" name="chevron-down" class="rotate-[-90deg]" label="${this.localize.term("scrollToEnd")}"></sd-5-17-2-icon></slot></button></div>`:null} ${this.isScrollVerticalEnabled?c`<div part="button-top" class="${l("absolute z-10 flex items-center justify-center top-0 left-0 w-full h-8 transition-opacity duration-medium ease-in-out",!this.canScroll.up&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${l(t)}" aria-hidden="${s(!this.canScroll.up||void 0)}" tabindex="${s(this.canScroll.up?void 0:-1)}" @click="${e=>this.handleScroll("up",e)}" @blur="${e=>this.handleButtonBlur("up",e)}"><slot name="icon-start"><sd-5-17-2-icon library="_internal" name="chevron-up" label="${this.localize.term("scrollToStart")}"></sd-5-17-2-icon></slot></button></div><div part="button-bottom" class="${l("absolute z-10 flex items-center justify-center bottom-0 left-0 w-full h-8 transition-opacity duration-medium ease-in-out",!this.canScroll.down&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${l(t)}" aria-hidden="${s(!this.canScroll.down||void 0)}" tabindex="${s(this.canScroll.down?void 0:-1)}" @click="${e=>this.handleScroll("down",e)}" @blur="${e=>this.handleButtonBlur("down",e)}"><slot name="icon-end"><sd-5-17-2-icon library="_internal" name="chevron-down" label="${this.localize.term("scrollToEnd")}"></sd-5-17-2-icon></slot></button></div>`:null}`:null} ${this.shadows?c`${this.isScrollHorizontalEnabled?c`<div part="shadow-left" class="${l("left top-0 left-0 w-[6px] h-full",i,this.canScroll.left?"opacity-100":"opacity-0")}"></div><div part="shadow-right" class="${l("right top-0 right-0 w-[6px] h-full",i,this.canScroll.right?"opacity-100":"opacity-0")}"></div>`:null} ${this.isScrollVerticalEnabled?c`<div part="shadow-top" class="${l("top top-0 left-0 w-full h-[6px]",i,this.canScroll.up?"opacity-100":"opacity-0")}"></div><div part="shadow-bottom" class="${l("bottom bottom-0 left-0 w-full h-[6px]",i,this.canScroll.down?"opacity-100":"opacity-0")}"></div>`:null}`:null}`}};n.styles=[...y.styles,S`:host{--gradient-color:hsla(0,0%,100%,0);--gradient:var(--gradient-color) 0%,#fff 80%,#fff 100%;display:flex;overflow:hidden;position:relative}.hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{display:none}.scroll-container::-webkit-scrollbar-thumb{background-color:transparent}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--background-neutral-400,#c3c3c3);border-radius:var(--sd-border-radius-sm,.125rem)}.scroll-container::-webkit-scrollbar{height:var(--sd-spacing-1,.25rem);width:var(--sd-spacing-1,.25rem)}.scroll-auto{overflow:auto}[part=button-left]{background:linear-gradient(270deg,var(--gradient))}[part=button-right]{background:linear-gradient(90deg,var(--gradient))}[part=button-top]{background:linear-gradient(0deg,var(--gradient))}[part=button-bottom]{background:linear-gradient(180deg,var(--gradient))}[part=shadow-left]{background:linear-gradient(270deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-right]{background:linear-gradient(90deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-top]{background:linear-gradient(0deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-bottom]{background:linear-gradient(180deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}.sd-5-17-2-icon--top{align-self:flex-start}.sd-5-17-2-icon--down{align-self:flex-end}`],o([u('[part="button-right"] button')],n.prototype,"rightButton",2),o([u('[part="button-left"] button')],n.prototype,"leftButton",2),o([u('[part="button-bottom"] button')],n.prototype,"downButton",2),o([u('[part="button-top"] button')],n.prototype,"upButton",2),o([u(".scroll-container")],n.prototype,"container",2),o([u("#announcement-container")],n.prototype,"announcementContainer",2),o([h({type:String,reflect:!0})],n.prototype,"orientation",2),o([h({type:Boolean,reflect:!0})],n.prototype,"scrollbars",2),o([h({type:Boolean,reflect:!0})],n.prototype,"buttons",2),o([h({type:Boolean,reflect:!0})],n.prototype,"shadows",2),o([h({type:Boolean,reflect:!0})],n.prototype,"inset",2),o([h({type:Number,reflect:!0})],n.prototype,"step",2),o([b()],n.prototype,"canScroll",2),o([b()],n.prototype,"isScrollHorizontalEnabled",2),o([b()],n.prototype,"isScrollVerticalEnabled",2),n=o([T("sd-5-17-2-scrollable")],n);export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk.CGQ2BPPZ.js";import{a as i}from"./chunk.YEDQWNIV.js";import{a as o}from"./chunk.E2DRD2OX.js";import{a as h,b as a,c as r,d,h as n}from"./chunk.M6XINJ52.js";import{b as c,e as l}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.hasSlotController=new u(this,"default","left","right");this.current=!1;this.selected=!1;this.hasHover=!1;this.isKeyboardFocus=!1;this.size="lg";this.checkbox=!1;this.disabled=!1;this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){var s;return((s=this.textContent)!=null?s:"").trim()}render(){let s={default:this.hasSlotController.test("default"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")};return l`<div part="base" class="${i("px-4 flex items-center w-full transition-colors duration-fast ease-in-out text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-700 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.isKeyboardFocus?"focus-outline focus-outline-offset":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${i("absolute w-full left-0 top-0 pointer-events-none transition-[height,top] duration-fast ease-in-out border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?l`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${i("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"bg-white border-neutral-800")}">${this.selected?l`<sd-5-17-
|
|
1
|
+
import{a as u}from"./chunk.CGQ2BPPZ.js";import{a as i}from"./chunk.YEDQWNIV.js";import{a as o}from"./chunk.E2DRD2OX.js";import{a as h,b as a,c as r,d,h as n}from"./chunk.M6XINJ52.js";import{b as c,e as l}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.hasSlotController=new u(this,"default","left","right");this.current=!1;this.selected=!1;this.hasHover=!1;this.isKeyboardFocus=!1;this.size="lg";this.checkbox=!1;this.disabled=!1;this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){var s;return((s=this.textContent)!=null?s:"").trim()}render(){let s={default:this.hasSlotController.test("default"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")};return l`<div part="base" class="${i("px-4 flex items-center w-full transition-colors duration-fast ease-in-out text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-700 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.isKeyboardFocus?"focus-outline focus-outline-offset":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${i("absolute w-full left-0 top-0 pointer-events-none transition-[height,top] duration-fast ease-in-out border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?l`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${i("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"bg-white border-neutral-800")}">${this.selected?l`<sd-5-17-2-icon part="checked-icon" class="text-white w-3 h-3" library="_internal" name="status-check"></sd-5-17-2-icon>`:""}</span>`:""} ${s.left?l`<slot name="left" part="left" class="inline-flex mr-2"></slot>`:""}<slot part="label" class="inline-block flex-grow" @slotchange="${this.handleDefaultSlotChange}"></slot>${s.right?l`<slot name="right" part="right" class="inline-flex ml-2"></slot>`:""}</div>`}};e.styles=[...n.styles,c`:host{display:block;outline:2px solid transparent!important;outline-offset:2px!important;position:relative;width:100%}.focus-outline-offset{outline-offset:-2px}`],t([d('[part="base"]')],e.prototype,"defaultSlot",2),t([r()],e.prototype,"current",2),t([r()],e.prototype,"selected",2),t([r()],e.prototype,"hasHover",2),t([r()],e.prototype,"isKeyboardFocus",2),t([a({type:String,reflect:!0})],e.prototype,"size",2),t([a({type:Boolean,reflect:!0})],e.prototype,"checkbox",2),t([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"value",2),t([o("disabled")],e.prototype,"handleDisabledChange",1),t([o("selected")],e.prototype,"handleSelectedChange",1),t([o("value")],e.prototype,"handleValueChange",1),e=t([h("sd-5-17-2-option")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.YEDQWNIV.js";import{a as b}from"./chunk.L6MCOH7T.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as c,b as r,d as s,h as n}from"./chunk.M6XINJ52.js";import{b as d,e as o}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var v=0,t=class extends n{constructor(){super(...arguments);this.attrId=++v;this.componentId=`sd-5-17-
|
|
1
|
+
import{a as u}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.YEDQWNIV.js";import{a as b}from"./chunk.L6MCOH7T.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as c,b as r,d as s,h as n}from"./chunk.M6XINJ52.js";import{b as d,e as o}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var v=0,t=class extends n{constructor(){super(...arguments);this.attrId=++v;this.componentId=`sd-5-17-2-tab-${this.attrId}`;this.hasSlotController=new u(this,"left");this.localize=new b(this);this.variant="default";this.active=!1;this.disabled=!1;this.visuallyDisabled=!1;this.panel=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){let i=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",i?"true":"false")}focus(i){this.tab.focus(i)}blur(){this.tab.blur()}render(){this.id=this.id.length>0?this.id:this.componentId;let i={left:this.hasSlotController.test("left")};return o`<div part="base" class="${a("inline-flex justify-center min-w-max items-center h-12 px-3 leading-none select-none cursor-pointer group relative","focus-visible:focus-outline outline-2 !-outline-offset-2 transition-all duration-fast ease-in-out",this.variant==="container"&&"tab-container-border bg-white rounded-[4px_4px_0_0]",this.variant==="container"&&this.active&&"tab--active-container-border bg-white",this.disabled||this.visuallyDisabled?"!cursor-not-allowed":"hover:bg-neutral-200",this.active&&"z-20")}" tabindex="${!this.active||this.disabled?"-1":"0"}"><div class="${a("flex h-full items-center justify-center whitespace-nowrap",this.disabled||this.visuallyDisabled&&"opacity-50 ")}"><slot name="left" class="${a(i.left&&"block pr-2",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary")}"></slot><slot class="${a(this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary")}"></slot>${this.variant==="container"?o`<div part="active-tab-indicator" class="${a("absolute bottom-0 h-1 bg-accent w-3/4 bottom-0 group-hover:w-full")}"></div>`:""}<div part="hover-bottom-border" class="${a(!this.active&&!this.disabled&&"absolute bottom-0 left-0 w-full h-0.25 border-b border-transparent group-hover:border-b-neutral-400 transition-[border] duration-fast ease-in-out")}"></div></div></div>`}};t.styles=[...n.styles,d`:host{box-sizing:border-box;display:inline-block}:host(:hover)::part(hover-bottom-border){--tw-border-opacity:1;border-bottom-color:rgb(var(--sd-color-neutral-400,195 195 195)/var(--tw-border-opacity,1))}.tab-container-border:after{border-color:transparent;border-width:1px;--tw-content:""}.tab--active-container-border:after,.tab-container-border:after{content:var(--tw-content);height:100%;position:absolute;width:100%}.tab--active-container-border:after{border-width:1px;--tw-border-opacity:1;border-color:rgb(var(--sd-color-neutral-400,195 195 195)/var(--tw-border-opacity,1));transition-duration:.15s;transition-duration:var(--sd-duration-medium,.3s);transition-property:border;transition-timing-function:cubic-bezier(.4,0,.2,1);--tw-content:"";border-bottom:none;border-radius:4px 4px 0 0}[part=active-tab-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,opacity var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out var(--sd-duration-fast)}:host([active]) [part=active-tab-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,transform var(--sd-duration-fast) ease-in-out}`],e([s("[part=base]")],t.prototype,"tab",2),e([s("[part=active-tab-indicator]")],t.prototype,"currentIndicator",2),e([r({type:String,reflect:!0})],t.prototype,"variant",2),e([r({type:Boolean,reflect:!0})],t.prototype,"active",2),e([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([r({type:String,reflect:!0})],t.prototype,"panel",2),e([l("active")],t.prototype,"handleActiveChange",1),e([l(["disabled","visually-disabled"])],t.prototype,"handleDisabledChange",1),t=e([c("sd-5-17-2-tab")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk.MWDEA25W.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as m,b as o,h as a}from"./chunk.M6XINJ52.js";import{b as l,e as c}from"./chunk.RZUTJ36B.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends a{constructor(){super(...arguments);this.mode="cors";this.allowScripts=!1}executeScript(e){let r=document.createElement("script");[...e.attributes].forEach(i=>r.setAttribute(i.name,i.value)),r.textContent=e.textContent,e.parentNode.replaceChild(r,e)}async handleSrcChange(){try{let e=this.src,r=await n(e,this.mode);if(e!==this.src)return;if(!r.ok){this.emit("sd-error",{detail:{status:r.status}});return}this.innerHTML=r.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach(i=>this.executeScript(i)),this.emit("sd-load")}catch(e){this.emit("sd-error",{detail:{status:-1}})}}render(){return c`<slot></slot>`}};t.styles=[...a.styles,l`:host{display:block}`],s([o({reflect:!0})],t.prototype,"src",2),s([o({type:String,reflect:!0})],t.prototype,"mode",2),s([o({attribute:"allow-scripts",type:Boolean,reflect:!0})],t.prototype,"allowScripts",2),s([p("src")],t.prototype,"handleSrcChange",1),t=s([m("sd-5-17-
|
|
1
|
+
import{a as n}from"./chunk.MWDEA25W.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as m,b as o,h as a}from"./chunk.M6XINJ52.js";import{b as l,e as c}from"./chunk.RZUTJ36B.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends a{constructor(){super(...arguments);this.mode="cors";this.allowScripts=!1}executeScript(e){let r=document.createElement("script");[...e.attributes].forEach(i=>r.setAttribute(i.name,i.value)),r.textContent=e.textContent,e.parentNode.replaceChild(r,e)}async handleSrcChange(){try{let e=this.src,r=await n(e,this.mode);if(e!==this.src)return;if(!r.ok){this.emit("sd-error",{detail:{status:r.status}});return}this.innerHTML=r.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach(i=>this.executeScript(i)),this.emit("sd-load")}catch(e){this.emit("sd-error",{detail:{status:-1}})}}render(){return c`<slot></slot>`}};t.styles=[...a.styles,l`:host{display:block}`],s([o({reflect:!0})],t.prototype,"src",2),s([o({type:String,reflect:!0})],t.prototype,"mode",2),s([o({attribute:"allow-scripts",type:Boolean,reflect:!0})],t.prototype,"allowScripts",2),s([p("src")],t.prototype,"handleSrcChange",1),t=s([m("sd-5-17-2-include")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,b as i,g as c,h as o}from"./chunk.M6XINJ52.js";import{b as a,e as l}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-5-17-
|
|
1
|
+
import{a as n,b as i,g as c,h as o}from"./chunk.M6XINJ52.js";import{b as a,e as l}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-5-17-2-accordion:not(:first-of-type)){margin-top:-1px}`],t([c({selector:"sd-5-17-2-accordion"})],e.prototype,"_accordionsInDefaultSlot",2),t([i({attribute:"close-others",type:Boolean,reflect:!0})],e.prototype,"closeOthers",2),e=t([n("sd-5-17-2-accordion-group")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as h,b as a}from"./chunk.PVM2WKMA.js";import{a as e}from"./chunk.YEDQWNIV.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as m,b as r,h as d}from"./chunk.M6XINJ52.js";import{b}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends d{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","[default]");this.size="lg";this.orientation="horizontal";this.horizontalInline=!1;this.waiting=!1;this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1,this.waiting=!1)}handleDisabledChange(){this.disabled&&(this.current=!1,this.waiting=!1)}handleWaitingChange(){this.waiting&&(this.current=!1,this.disabled=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1,this.waiting=!1)}render(){let f=this.isLink(),u=this.notInteractive||this.waiting?h`div`:f?h`a`:h`button`,g=this.hasSlotController.test("label"),c=this.label?!0:g,v=this.hasSlotController.test("[default]"),s=this.description?!0:v,o=this.horizontalInline&&this.orientation==="horizontal",w=e("flex shrink-0 gap-2",this.noTail&&!o&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",o&&"items-start",this.orientation==="horizontal"&&!this.horizontalInline?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3"),x=e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":!this.notInteractive&&!this.waiting?"focus-visible:focus-outline hover:cursor-pointer":"",this.notInteractive?this.size==="lg"?"not-interactive-lg":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-500 text-neutral-500",this.waiting&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"border-primary hover:bg-primary-100 hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white");return a`<div role="listitem" part="base" class="${e("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-full overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${w}"><${u} part="circle" href="${n(f?this.href:void 0)}" aria-disabled="${n(this.disabled||this.waiting||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${n(this.notInteractive||this.waiting||!c?void 0:"label")}" aria-describedby="${n(this.notInteractive||this.waiting||!s?void 0:"description")}" class="${x}"><slot name="circle-content" class="${e("text-lg",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"text-primary hover:text-primary-500 hover:fill-primary-500",this.notInteractive&&"text-primary")}">${!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?a`<sd-5-17-
|
|
1
|
+
import{a as p}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.CHU57RUD.js";import{a as h,b as a}from"./chunk.PVM2WKMA.js";import{a as e}from"./chunk.YEDQWNIV.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as m,b as r,h as d}from"./chunk.M6XINJ52.js";import{b}from"./chunk.RZUTJ36B.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends d{constructor(){super(...arguments);this.hasSlotController=new p(this,"label","[default]");this.size="lg";this.orientation="horizontal";this.horizontalInline=!1;this.waiting=!1;this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1,this.waiting=!1)}handleDisabledChange(){this.disabled&&(this.current=!1,this.waiting=!1)}handleWaitingChange(){this.waiting&&(this.current=!1,this.disabled=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1,this.waiting=!1)}render(){let f=this.isLink(),u=this.notInteractive||this.waiting?h`div`:f?h`a`:h`button`,g=this.hasSlotController.test("label"),c=this.label?!0:g,v=this.hasSlotController.test("[default]"),s=this.description?!0:v,o=this.horizontalInline&&this.orientation==="horizontal",w=e("flex shrink-0 gap-2",this.noTail&&!o&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",o&&"items-start",this.orientation==="horizontal"&&!this.horizontalInline?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3"),x=e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":!this.notInteractive&&!this.waiting?"focus-visible:focus-outline hover:cursor-pointer":"",this.notInteractive?this.size==="lg"?"not-interactive-lg":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-500 text-neutral-500",this.waiting&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"border-primary hover:bg-primary-100 hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white");return a`<div role="listitem" part="base" class="${e("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-full overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${w}"><${u} part="circle" href="${n(f?this.href:void 0)}" aria-disabled="${n(this.disabled||this.waiting||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${n(this.notInteractive||this.waiting||!c?void 0:"label")}" aria-describedby="${n(this.notInteractive||this.waiting||!s?void 0:"description")}" class="${x}"><slot name="circle-content" class="${e("text-lg",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting&&"text-primary hover:text-primary-500 hover:fill-primary-500",this.notInteractive&&"text-primary")}">${!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?a`<sd-5-17-2-icon name="status-check" library="_internal" class="${e(this.size==="sm"&&"text-sm")}"></sd-5-17-2-icon>`:a`${this.index}`}</slot></${u}>${o?a`<div class="${e(!this.noTail&&"flex-1","flex flex-col gap-1")}"><div class="${e("flex w-full",c&&"gap-2",this.size==="sm"&&!s?"mt-1":"mt-3")}">${c&&a`<div part="label" id="label" class="${e("font-bold sd-paragraph whitespace-nowrap",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div>`} ${this.noTail?"":a`<div part="tail" class="${e("border-t flex-1 mr-2 mt-3",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-500")}"></div>`}</div>${s?a`<div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm break-words",s?"flex-1":"w-0 h-0 overflow-hidden",s&&!this.noTail&&"pr-4",(this.disabled||this.waiting)&&"!text-neutral-700")}">${this.description||a`<slot></slot>`}</div>`:""}</div>`:this.noTail?"":a`<div part="tail" class="${e(this.orientation==="horizontal"?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"border-primary":"border-neutral-400")}"></div>`}</div>${o?"":a`<div part="text-container" class="${e("mt-4 break-words flex flex-col gap-2",this.orientation==="horizontal"?"text-center w-40":"text-left",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",this.notInteractive?"ml-2":"mr-4")}"><div part="label" id="label" class="${e("!font-bold sd-paragraph",this.disabled&&"text-neutral-500",this.waiting&&"text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&!this.waiting?"text-primary":"text-black")}"><slot name="label">${this.label}</slot></div><div part="description" id="description" class="${e("sd-paragraph sd-paragraph--size-sm",(this.disabled||this.waiting)&&"text-neutral-700")}">${this.description||a`<slot></slot>`}</div></div>`}</div>`}};t.styles=[...d.styles,b`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}:host([horizontal-inline]):has([part=description]){flex:1 1 0%;min-width:var(--sd-spacing-0,0)}.translateLg{transform:translateX(3.438rem)}.translateSm{transform:translateX(4rem)}.not-interactive-lg{width:4.5rem}`],i([r({type:String,reflect:!0})],t.prototype,"size",2),i([r({type:String,reflect:!0})],t.prototype,"orientation",2),i([r({type:Boolean,reflect:!0,attribute:"horizontal-inline"})],t.prototype,"horizontalInline",2),i([r({type:Boolean,reflect:!0})],t.prototype,"waiting",2),i([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([r({type:Boolean,reflect:!0})],t.prototype,"current",2),i([r({reflect:!0,type:Boolean,attribute:"no-tail"})],t.prototype,"noTail",2),i([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),i([r({type:String,reflect:!0})],t.prototype,"label",2),i([r({type:String,reflect:!0})],t.prototype,"description",2),i([r({type:Number,reflect:!0,attribute:"index"})],t.prototype,"index",2),i([r({type:String,reflect:!0})],t.prototype,"href",2),i([l("current")],t.prototype,"handleCurrentChange",1),i([l("disabled")],t.prototype,"handleDisabledChange",1),i([l("waiting")],t.prototype,"handleWaitingChange",1),i([l("notInteractive")],t.prototype,"handleInteractivityChange",1),t=i([m("sd-5-17-2-step")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk.XR2KNB36.js";import{a as s}from"./chunk.E2DRD2OX.js";import{a as y,b as a,f,h as r}from"./chunk.M6XINJ52.js";import{b as c,e as d}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends r{constructor(){super(...arguments);this.hasStarted=!1;this.name="none";this.play=!1;this.delay=0;this.direction="normal";this.duration=1e3;this.easing="linear";this.endDelay=0;this.fill="auto";this.iterations=1/0;this.iterationStart=0;this.playbackRate=1}get currentTime(){var i,n;return(n=(i=this.animation)==null?void 0:i.currentTime)!=null?n:0}set currentTime(i){this.animation&&(this.animation.currentTime=i)}connectedCallback(){super.connectedCallback(),this.createAnimation(),this.handleAnimationCancel=this.handleAnimationCancel.bind(this),this.handleAnimationFinish=this.handleAnimationFinish.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.destroyAnimation()}handleAnimationFinish(){this.play=!1,this.hasStarted=!1,this.emit("sd-finish")}handleAnimationCancel(){this.play=!1,this.hasStarted=!1,this.emit("sd-cancel")}handleSlotChange(){this.destroyAnimation(),this.createAnimation()}async createAnimation(){var o,m;let i=(o=l.easings[this.easing])!=null?o:this.easing,n=(m=this.keyframes)!=null?m:l[this.name],h=(await this.defaultSlot).assignedElements()[0];return!h||!n?!1:(this.destroyAnimation(),this.animation=h.animate(n,{delay:this.delay,direction:this.direction,duration:this.duration,easing:i,endDelay:this.endDelay,fill:this.fill,iterationStart:this.iterationStart,iterations:this.iterations}),this.animation.playbackRate=this.playbackRate,this.animation.addEventListener("cancel",this.handleAnimationCancel),this.animation.addEventListener("finish",this.handleAnimationFinish),this.play?(this.hasStarted=!0,this.emit("sd-start")):this.animation.pause(),!0)}destroyAnimation(){this.animation&&(this.animation.cancel(),this.animation.removeEventListener("cancel",this.handleAnimationCancel),this.animation.removeEventListener("finish",this.handleAnimationFinish),this.hasStarted=!1)}handleAnimationChange(){this.hasUpdated&&this.createAnimation()}handlePlayChange(){return this.animation?(this.play&&!this.hasStarted&&(this.hasStarted=!0,this.emit("sd-start")),this.play?this.animation.play():this.animation.pause(),!0):!1}handlePlaybackRateChange(){this.animation&&(this.animation.playbackRate=this.playbackRate)}cancel(){var i;(i=this.animation)==null||i.cancel()}finish(){var i;(i=this.animation)==null||i.finish()}render(){return d`<slot @slotchange="${this.handleSlotChange}"></slot>`}};t.styles=[...r.styles,c`:host{display:contents}`],e([f("slot")],t.prototype,"defaultSlot",2),e([a()],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"play",2),e([a({type:Number})],t.prototype,"delay",2),e([a()],t.prototype,"direction",2),e([a({type:Number})],t.prototype,"duration",2),e([a()],t.prototype,"easing",2),e([a({attribute:"end-delay",type:Number})],t.prototype,"endDelay",2),e([a()],t.prototype,"fill",2),e([a({type:Number})],t.prototype,"iterations",2),e([a({attribute:"iteration-start",type:Number})],t.prototype,"iterationStart",2),e([a({attribute:!1})],t.prototype,"keyframes",2),e([a({attribute:"playback-rate",type:Number})],t.prototype,"playbackRate",2),e([s(["name","delay","direction","duration","easing","endDelay","fill","iterations","iterationsStart","keyframes"])],t.prototype,"handleAnimationChange",1),e([s("play")],t.prototype,"handlePlayChange",1),e([s("playbackRate")],t.prototype,"handlePlaybackRateChange",1),t=e([y("sd-5-17-
|
|
1
|
+
import{a as l}from"./chunk.XR2KNB36.js";import{a as s}from"./chunk.E2DRD2OX.js";import{a as y,b as a,f,h as r}from"./chunk.M6XINJ52.js";import{b as c,e as d}from"./chunk.RZUTJ36B.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends r{constructor(){super(...arguments);this.hasStarted=!1;this.name="none";this.play=!1;this.delay=0;this.direction="normal";this.duration=1e3;this.easing="linear";this.endDelay=0;this.fill="auto";this.iterations=1/0;this.iterationStart=0;this.playbackRate=1}get currentTime(){var i,n;return(n=(i=this.animation)==null?void 0:i.currentTime)!=null?n:0}set currentTime(i){this.animation&&(this.animation.currentTime=i)}connectedCallback(){super.connectedCallback(),this.createAnimation(),this.handleAnimationCancel=this.handleAnimationCancel.bind(this),this.handleAnimationFinish=this.handleAnimationFinish.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.destroyAnimation()}handleAnimationFinish(){this.play=!1,this.hasStarted=!1,this.emit("sd-finish")}handleAnimationCancel(){this.play=!1,this.hasStarted=!1,this.emit("sd-cancel")}handleSlotChange(){this.destroyAnimation(),this.createAnimation()}async createAnimation(){var o,m;let i=(o=l.easings[this.easing])!=null?o:this.easing,n=(m=this.keyframes)!=null?m:l[this.name],h=(await this.defaultSlot).assignedElements()[0];return!h||!n?!1:(this.destroyAnimation(),this.animation=h.animate(n,{delay:this.delay,direction:this.direction,duration:this.duration,easing:i,endDelay:this.endDelay,fill:this.fill,iterationStart:this.iterationStart,iterations:this.iterations}),this.animation.playbackRate=this.playbackRate,this.animation.addEventListener("cancel",this.handleAnimationCancel),this.animation.addEventListener("finish",this.handleAnimationFinish),this.play?(this.hasStarted=!0,this.emit("sd-start")):this.animation.pause(),!0)}destroyAnimation(){this.animation&&(this.animation.cancel(),this.animation.removeEventListener("cancel",this.handleAnimationCancel),this.animation.removeEventListener("finish",this.handleAnimationFinish),this.hasStarted=!1)}handleAnimationChange(){this.hasUpdated&&this.createAnimation()}handlePlayChange(){return this.animation?(this.play&&!this.hasStarted&&(this.hasStarted=!0,this.emit("sd-start")),this.play?this.animation.play():this.animation.pause(),!0):!1}handlePlaybackRateChange(){this.animation&&(this.animation.playbackRate=this.playbackRate)}cancel(){var i;(i=this.animation)==null||i.cancel()}finish(){var i;(i=this.animation)==null||i.finish()}render(){return d`<slot @slotchange="${this.handleSlotChange}"></slot>`}};t.styles=[...r.styles,c`:host{display:contents}`],e([f("slot")],t.prototype,"defaultSlot",2),e([a()],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"play",2),e([a({type:Number})],t.prototype,"delay",2),e([a()],t.prototype,"direction",2),e([a({type:Number})],t.prototype,"duration",2),e([a()],t.prototype,"easing",2),e([a({attribute:"end-delay",type:Number})],t.prototype,"endDelay",2),e([a()],t.prototype,"fill",2),e([a({type:Number})],t.prototype,"iterations",2),e([a({attribute:"iteration-start",type:Number})],t.prototype,"iterationStart",2),e([a({attribute:!1})],t.prototype,"keyframes",2),e([a({attribute:"playback-rate",type:Number})],t.prototype,"playbackRate",2),e([s(["name","delay","direction","duration","easing","endDelay","fill","iterations","iterationsStart","keyframes"])],t.prototype,"handleAnimationChange",1),e([s("play")],t.prototype,"handlePlayChange",1),e([s("playbackRate")],t.prototype,"handlePlaybackRateChange",1),t=e([y("sd-5-17-2-animation")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.L6MCOH7T.js";import{a as g,b as l,c as o,d as u,h as c}from"./chunk.M6XINJ52.js";import{b as m,e as a}from"./chunk.RZUTJ36B.js";import{a as d}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var e=class extends c{constructor(){super();this.localize=new v(this);this.hasSlotController=new y(this,"transcript");this.reversedLayout=!1;this.hideTimestamps=!1;this.animated=!1;this.inverted=!1;this.speed=1;this.currentTime=this.formatTime(0);this.duration="";this.isPlaying=!1;this.isMuted=!1;this.isTranscriptOpen=!1;this.progress=0;this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this),this.handleTranscriptDrawerToggle=this.handleTranscriptDrawerToggle.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),document.addEventListener("sd-after-hide",this.handleTranscriptDrawerToggle),this.audioElement.playbackRate=this.speed,this.progressSlider.tooltipFormatter=t=>this.localize.term("seconds",Number(t).toFixed(0)),this.animated&&this.initAnimation())}updated(t){if(t.has("animated")){let s=t.get("animated");!s&&this.animated?this.initAnimation():s&&!this.animated&&this.clear()}}get audioElement(){let t=this.shadowRoot.querySelector("slot");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;let t=this.audioElement.currentTime;this.currentTime=this.formatTime(t),this.progress=t,this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration)){setTimeout(()=>{this.updateAudioDuration()},100);return}this.duration=this.formatTime(this.audioElement.duration),this.progressSlider.max=this.audioElement.duration}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(t){t.key==="Enter"&&(t.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=this.speed===1.5?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(t){t.key==="Enter"&&(t.preventDefault(),this.togglePlaybackSpeed())}formatTime(t){let s=Math.floor(t/60).toString().padStart(2,"0"),h=Math.floor(t%60).toString().padStart(2,"0");return`${s}:${h}`}handleAudioProgress(){if(!this.audioElement)return;let t=Number(this.progressSlider.value);this.audioElement.currentTime=t,this.progress=t,this.currentTime=this.formatTime(t)}handleAudioProgressKeydown(t){t.key==="ArrowRight"&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),t.key==="ArrowLeft"&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}handleTranscriptDrawerToggle(){this.isTranscriptOpen=!this.isTranscriptOpen}handleThumbGrab(){var t;(t=this.audioElement)==null||t.pause()}handleThumbRelease(){var t;this.isPlaying&&((t=this.audioElement)==null||t.play())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0,this.handleTranscriptDrawerToggle()}showTranscriptKeydown(t){(t.key==="Enter"||t.key===" ")&&this.showTranscript()}rgbToHex(t){let s=t.match(/\d+/g);if(s&&s.length===3){let h=parseInt(s[0]),r=parseInt(s[1]),b=parseInt(s[2]),p=f=>f.toString(16).padStart(2,"0");return`#${p(h)}${p(r)}${p(b)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");let t=this.audioPlayerContainer.querySelector(".playback-speed"),h=window.getComputedStyle(t).color,r;this.inverted?r="#FFFFFF33":r=this.rgbToHex(h)+"33",this.waveList=[new d({canvas:this.canvas,color:r,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach(t=>{t.redraw()})}stopAnimation(){this.isPlaying=!1}clear(){!this.context||!this.canvas||this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}async draw(){!this.isPlaying||!this.animated||(this.clear(),this.waveList.forEach(t=>{t.redraw()}),await new Promise(t=>{setTimeout(t,1e3/30)}),await this.draw())}render(){let t=a`<div class="${n("controls grid grid-cols-3 justify-items-center items-center",this.reversedLayout?"mt-2":"mb-2",!this.animated&&"relative",this.animated&&!this.reversedLayout&&"absolute -top-4 left-0 w-full")}" part="audio-controls"><button class="${n("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")} (${this.speed}x)" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-5-17-0-button ?inverted="${!!this.inverted}" part="play-button" size="lg" @click="${this.isPlaying?this.pauseAudio:this.playAudio}" aria-label="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" title="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="mb-4">${this.isPlaying?a`<slot name="pause-icon"><sd-5-17-0-icon class="text-xl" name="pause" library="_internal"></sd-5-17-0-icon></slot>`:a`<slot name="play-icon"><sd-5-17-0-icon class="text-xl" name="start" library="_internal"></sd-5-17-0-icon></slot>`}</sd-5-17-0-button><div class="flex items-center gap-6 justify-self-end">${this.hasSlotController.test("transcript")?a`<button class="${n("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.isTranscriptOpen?this.localize.term("transcriptIsOpen"):this.localize.term("openTranscript")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" part="transcript"><sd-5-17-0-icon class="w-6 h-6" name="transcript" library="_internal"></sd-5-17-0-icon></button>`:null} <button class="${n("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-5-17-0-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="_internal"></sd-5-17-0-icon></button></div></div>`,s=a`<div class="${n("w-full flex justify-between",this.reversedLayout?"mb-0.5":"mt-0.5",this.animated&&this.reversedLayout&&"absolute bottom-0 left-0 !mb-4")}" part="timestamps"><div class="${n("current-time text-sm",this.inverted?"text-primary-400":"text-black")}">${this.currentTime}</div><div class="${n("current-time text-sm",this.inverted?"text-primary-400":"text-black")}">${this.duration}</div></div>`;return a`<div class="${n("w-full flex relative",this.reversedLayout?"flex-col-reverse":"flex-col")}" aria-label="${this.localize.term("audioPlayer")}" part="audio-player"><slot @slotchange="${this.updateAudioDuration}"></slot>${!this.animated||this.animated&&this.reversedLayout?t:null}<div class="relative">${this.animated&&!this.reversedLayout?a`${t}`:null} ${this.animated?a`<canvas class="w-full h-16 -mb-2"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?s:null}<sd-5-17-0-range part="progress-slider" no-tooltip min="0" max="100" step="0.001" label="${this.localize.term("seekBar")}" @mousedown="${this.handleThumbGrab}" @touchstart="${this.handleThumbGrab}" @mouseup="${this.handleThumbRelease}" @touchend="${this.handleThumbRelease}" @sd-5-17-0-input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}"></sd-5-17-0-range></div>${this.hasSlotController.test("transcript")?a`<sd-5-17-0-drawer><slot name="transcript"></slot></sd-5-17-0-drawer>`:null} ${!this.hideTimestamps&&(!this.animated||!this.reversedLayout)?s:null}</div>`}};e.styles=[...c.styles,m`sd-5-17-0-button::part(base){align-items:center;border-radius:var(--sd-border-radius-full,9999px);display:flex;height:var(--sd-spacing-12,3rem);justify-content:center;width:var(--sd-spacing-12,3rem)}sd-5-17-0-button::part(motion-wrapper){border-radius:var(--sd-border-radius-full,9999px)}sd-5-17-0-button::part(label){align-items:center;display:flex;flex-grow:0}sd-5-17-0-range::part(form-control-label){display:none}:host([inverted]) sd-5-17-0-range::part(thumb){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));outline-color:rgb(var(--sd-color-white,255 255 255)/1)}:host([animated]) sd-5-17-0-range::part(track){background-color:transparent}:host([inverted]:not([animated])) sd-5-17-0-range::part(track){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-400,153 171 208)/var(--tw-bg-opacity,1))}:host([inverted]:not([animated])) sd-5-17-0-range::part(active-track){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1))}`],i([l({type:Boolean,reflect:!0,attribute:"reversed-layout"})],e.prototype,"reversedLayout",2),i([l({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],e.prototype,"hideTimestamps",2),i([l({type:Boolean,reflect:!0})],e.prototype,"animated",2),i([l({type:Boolean,reflect:!0})],e.prototype,"inverted",2),i([l({type:Number,reflect:!0})],e.prototype,"speed",2),i([o()],e.prototype,"currentTime",2),i([o()],e.prototype,"duration",2),i([o()],e.prototype,"isPlaying",2),i([o()],e.prototype,"isMuted",2),i([o()],e.prototype,"isTranscriptOpen",2),i([o()],e.prototype,"progress",2),i([u('[part="progress-slider"]')],e.prototype,"progressSlider",2),i([u('[part="audio-player"]')],e.prototype,"audioPlayerContainer",2),i([u("sd-5-17-0-drawer")],e.prototype,"drawer",2),i([u("canvas")],e.prototype,"canvas",2),e=i([g("sd-5-17-0-audio")],e);export{e as a};
|
|
1
|
+
import{a as y}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.YEDQWNIV.js";import{a as v}from"./chunk.L6MCOH7T.js";import{a as g,b as l,c as o,d as u,h as c}from"./chunk.M6XINJ52.js";import{b as m,e as a}from"./chunk.RZUTJ36B.js";import{a as d}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var e=class extends c{constructor(){super();this.localize=new v(this);this.hasSlotController=new y(this,"transcript");this.reversedLayout=!1;this.hideTimestamps=!1;this.animated=!1;this.inverted=!1;this.speed=1;this.currentTime=this.formatTime(0);this.duration="";this.isPlaying=!1;this.isMuted=!1;this.isTranscriptOpen=!1;this.progress=0;this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this),this.handleTranscriptDrawerToggle=this.handleTranscriptDrawerToggle.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),document.addEventListener("sd-after-hide",this.handleTranscriptDrawerToggle),this.audioElement.playbackRate=this.speed,this.progressSlider.tooltipFormatter=t=>this.localize.term("seconds",Number(t).toFixed(0)),this.animated&&this.initAnimation())}updated(t){if(t.has("animated")){let s=t.get("animated");!s&&this.animated?this.initAnimation():s&&!this.animated&&this.clear()}}get audioElement(){let t=this.shadowRoot.querySelector("slot");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;let t=this.audioElement.currentTime;this.currentTime=this.formatTime(t),this.progress=t,this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration)){setTimeout(()=>{this.updateAudioDuration()},100);return}this.duration=this.formatTime(this.audioElement.duration),this.progressSlider.max=this.audioElement.duration}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(t){t.key==="Enter"&&(t.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=this.speed===1.5?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(t){t.key==="Enter"&&(t.preventDefault(),this.togglePlaybackSpeed())}formatTime(t){let s=Math.floor(t/60).toString().padStart(2,"0"),h=Math.floor(t%60).toString().padStart(2,"0");return`${s}:${h}`}handleAudioProgress(){if(!this.audioElement)return;let t=Number(this.progressSlider.value);this.audioElement.currentTime=t,this.progress=t,this.currentTime=this.formatTime(t)}handleAudioProgressKeydown(t){t.key==="ArrowRight"&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),t.key==="ArrowLeft"&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}handleTranscriptDrawerToggle(){this.isTranscriptOpen=!this.isTranscriptOpen}handleThumbGrab(){var t;(t=this.audioElement)==null||t.pause()}handleThumbRelease(){var t;this.isPlaying&&((t=this.audioElement)==null||t.play())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0,this.handleTranscriptDrawerToggle()}showTranscriptKeydown(t){(t.key==="Enter"||t.key===" ")&&this.showTranscript()}rgbToHex(t){let s=t.match(/\d+/g);if(s&&s.length===3){let h=parseInt(s[0]),r=parseInt(s[1]),b=parseInt(s[2]),p=f=>f.toString(16).padStart(2,"0");return`#${p(h)}${p(r)}${p(b)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");let t=this.audioPlayerContainer.querySelector(".playback-speed"),h=window.getComputedStyle(t).color,r;this.inverted?r="#FFFFFF33":r=this.rgbToHex(h)+"33",this.waveList=[new d({canvas:this.canvas,color:r,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new d({canvas:this.canvas,color:r,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach(t=>{t.redraw()})}stopAnimation(){this.isPlaying=!1}clear(){!this.context||!this.canvas||this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}async draw(){!this.isPlaying||!this.animated||(this.clear(),this.waveList.forEach(t=>{t.redraw()}),await new Promise(t=>{setTimeout(t,1e3/30)}),await this.draw())}render(){let t=a`<div class="${n("controls grid grid-cols-3 justify-items-center items-center",this.reversedLayout?"mt-2":"mb-2",!this.animated&&"relative",this.animated&&!this.reversedLayout&&"absolute -top-4 left-0 w-full")}" part="audio-controls"><button class="${n("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")} (${this.speed}x)" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-5-17-2-button ?inverted="${!!this.inverted}" part="play-button" size="lg" @click="${this.isPlaying?this.pauseAudio:this.playAudio}" aria-label="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" title="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="mb-4">${this.isPlaying?a`<slot name="pause-icon"><sd-5-17-2-icon class="text-xl" name="pause" library="_internal"></sd-5-17-2-icon></slot>`:a`<slot name="play-icon"><sd-5-17-2-icon class="text-xl" name="start" library="_internal"></sd-5-17-2-icon></slot>`}</sd-5-17-2-button><div class="flex items-center gap-6 justify-self-end">${this.hasSlotController.test("transcript")?a`<button class="${n("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.isTranscriptOpen?this.localize.term("transcriptIsOpen"):this.localize.term("openTranscript")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" part="transcript"><sd-5-17-2-icon class="w-6 h-6" name="transcript" library="_internal"></sd-5-17-2-icon></button>`:null} <button class="${n("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-5-17-2-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="_internal"></sd-5-17-2-icon></button></div></div>`,s=a`<div class="${n("w-full flex justify-between",this.reversedLayout?"mb-0.5":"mt-0.5",this.animated&&this.reversedLayout&&"absolute bottom-0 left-0 !mb-4")}" part="timestamps"><div class="${n("current-time text-sm",this.inverted?"text-primary-400":"text-black")}">${this.currentTime}</div><div class="${n("current-time text-sm",this.inverted?"text-primary-400":"text-black")}">${this.duration}</div></div>`;return a`<div class="${n("w-full flex relative",this.reversedLayout?"flex-col-reverse":"flex-col")}" aria-label="${this.localize.term("audioPlayer")}" part="audio-player"><slot @slotchange="${this.updateAudioDuration}"></slot>${!this.animated||this.animated&&this.reversedLayout?t:null}<div class="relative">${this.animated&&!this.reversedLayout?a`${t}`:null} ${this.animated?a`<canvas class="w-full h-16 -mb-2"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?s:null}<sd-5-17-2-range part="progress-slider" no-tooltip min="0" max="100" step="0.001" label="${this.localize.term("seekBar")}" @mousedown="${this.handleThumbGrab}" @touchstart="${this.handleThumbGrab}" @mouseup="${this.handleThumbRelease}" @touchend="${this.handleThumbRelease}" @sd-5-17-2-input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}"></sd-5-17-2-range></div>${this.hasSlotController.test("transcript")?a`<sd-5-17-2-drawer><slot name="transcript"></slot></sd-5-17-2-drawer>`:null} ${!this.hideTimestamps&&(!this.animated||!this.reversedLayout)?s:null}</div>`}};e.styles=[...c.styles,m`sd-5-17-2-button::part(base){align-items:center;border-radius:var(--sd-border-radius-full,9999px);display:flex;height:var(--sd-spacing-12,3rem);justify-content:center;width:var(--sd-spacing-12,3rem)}sd-5-17-2-button::part(motion-wrapper){border-radius:var(--sd-border-radius-full,9999px)}sd-5-17-2-button::part(label){align-items:center;display:flex;flex-grow:0}sd-5-17-2-range::part(form-control-label){display:none}:host([inverted]) sd-5-17-2-range::part(thumb){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));outline-color:rgb(var(--sd-color-white,255 255 255)/1)}:host([animated]) sd-5-17-2-range::part(track){background-color:transparent}:host([inverted]:not([animated])) sd-5-17-2-range::part(track){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-400,153 171 208)/var(--tw-bg-opacity,1))}:host([inverted]:not([animated])) sd-5-17-2-range::part(active-track){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1))}`],i([l({type:Boolean,reflect:!0,attribute:"reversed-layout"})],e.prototype,"reversedLayout",2),i([l({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],e.prototype,"hideTimestamps",2),i([l({type:Boolean,reflect:!0})],e.prototype,"animated",2),i([l({type:Boolean,reflect:!0})],e.prototype,"inverted",2),i([l({type:Number,reflect:!0})],e.prototype,"speed",2),i([o()],e.prototype,"currentTime",2),i([o()],e.prototype,"duration",2),i([o()],e.prototype,"isPlaying",2),i([o()],e.prototype,"isMuted",2),i([o()],e.prototype,"isTranscriptOpen",2),i([o()],e.prototype,"progress",2),i([u('[part="progress-slider"]')],e.prototype,"progressSlider",2),i([u('[part="audio-player"]')],e.prototype,"audioPlayerContainer",2),i([u("sd-5-17-2-drawer")],e.prototype,"drawer",2),i([u("canvas")],e.prototype,"canvas",2),e=i([g("sd-5-17-2-audio")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk.CHU57RUD.js";import{a as h,c as p}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as o}from"./chunk.YEDQWNIV.js";import{a as y}from"./chunk.L6MCOH7T.js";import{a as v}from"./chunk.E2DRD2OX.js";import{a as f,b as a,d as n,h as c}from"./chunk.M6XINJ52.js";import{b as g,e as u}from"./chunk.RZUTJ36B.js";import{b as r,e as l,f as d}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.open=!1;this.inverted=!1;this.localize=new y(this)}updateMaxHeight(){var s;let e=(s=this.contentPreview)==null?void 0:s.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${e}px`),this.style.setProperty("--max-height",e)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}async onOpenChange(){if(this.body.classList.add("transitioning"),this.open){this.emit("sd-show"),await l(this.body);let{keyframes:e,options:s}=p(this,"expandable.show",{dir:this.localize.dir()});await r(this.body,d(e,this.body.scrollHeight),s),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-show")})}else{this.emit("sd-hide"),await l(this.body);let{keyframes:e,options:s}=p(this,"expandable.hide",{dir:this.localize.dir()});await r(this.body,d(e,this.body.scrollHeight),s),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-hide")})}this.details.setAttribute("open",this.open.toString()),this.body.classList.remove("transitioning")}async show(){if(!this.open)return this.onToggleClick(),m(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),m(this,"sd-after-hide")}render(){return u`<div part="base" class="flex flex-col-reverse gap-4"><button part="toggle" class="${o("sd-interactive sd-interactive--reset",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}" aria-expanded="${this.open}"><div class="${o("h-full justify-center w-full text-base flex items-center toggle")}"><span part="toggle-icon" class="${o("flex items-center mr-2 transition-transform duration-medium ease-in-out",this.open&&"rotate-180")}"><slot name="expand-icon" class="${o(this.open&&"hidden")}"><sd-5-17-
|
|
1
|
+
import{a as b}from"./chunk.CHU57RUD.js";import{a as h,c as p}from"./chunk.SKUMYG4O.js";import{a as m}from"./chunk.KLRPP4NQ.js";import{a as o}from"./chunk.YEDQWNIV.js";import{a as y}from"./chunk.L6MCOH7T.js";import{a as v}from"./chunk.E2DRD2OX.js";import{a as f,b as a,d as n,h as c}from"./chunk.M6XINJ52.js";import{b as g,e as u}from"./chunk.RZUTJ36B.js";import{b as r,e as l,f as d}from"./chunk.6OTM3PE5.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends c{constructor(){super(...arguments);this.open=!1;this.inverted=!1;this.localize=new y(this)}updateMaxHeight(){var s;let e=(s=this.contentPreview)==null?void 0:s.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${e}px`),this.style.setProperty("--max-height",e)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}async onOpenChange(){if(this.body.classList.add("transitioning"),this.open){this.emit("sd-show"),await l(this.body);let{keyframes:e,options:s}=p(this,"expandable.show",{dir:this.localize.dir()});await r(this.body,d(e,this.body.scrollHeight),s),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-show")})}else{this.emit("sd-hide"),await l(this.body);let{keyframes:e,options:s}=p(this,"expandable.hide",{dir:this.localize.dir()});await r(this.body,d(e,this.body.scrollHeight),s),this.body.style.height="auto",this.updateComplete.then(()=>{this.emit("sd-after-hide")})}this.details.setAttribute("open",this.open.toString()),this.body.classList.remove("transitioning")}async show(){if(!this.open)return this.onToggleClick(),m(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),m(this,"sd-after-hide")}render(){return u`<div part="base" class="flex flex-col-reverse gap-4"><button part="toggle" class="${o("sd-interactive sd-interactive--reset",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}" aria-expanded="${this.open}"><div class="${o("h-full justify-center w-full text-base flex items-center toggle")}"><span part="toggle-icon" class="${o("flex items-center mr-2 transition-transform duration-medium ease-in-out",this.open&&"rotate-180")}"><slot name="expand-icon" class="${o(this.open&&"hidden")}"><sd-5-17-2-icon library="_internal" name="chevron-down" class="text-xl"></sd-5-17-2-icon></slot><slot name="collapse-icon" class="${o(!this.open&&"hidden")}"><sd-5-17-2-icon library="_internal" name="chevron-down" class="text-xl"></sd-5-17-2-icon></slot></span><slot name="toggle-closed" class="${o(this.open&&"hidden")}">${this.localize.term("showMore")}</slot><slot name="toggle-open" class="${o(!this.open&&"hidden")}">${this.localize.term("showLess")}</slot></div></button><details part="details" ?inert="${b(!this.open)}"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details></div>`}firstUpdated(){this.cloneContentToLightDOM(),this.details.setAttribute("open",this.open.toString())}cloneContentToLightDOM(){let e=document.createElement("div");e.setAttribute("slot","clone"),Array.from(this.childNodes).forEach(x=>{let w=x.cloneNode(!0);e.appendChild(w)}),this.appendChild(e)}};t.styles=[...c.styles,g`:host{--component-expandable-max-block-size:90px;--gradient-height:24px;--gradient:var(--gradient-color-start,hsla(0,0%,100%,0)) 0%,var(--gradient-color-end,#fff) 80%,var(--gradient-color-end,#fff) 100%;display:inline-block;position:relative;width:100%}.toggle::-moz-focus-inner{border-style:none;padding:var(--sd-spacing-0,0)}details>summary::-webkit-details-marker,details[open] summary{display:none}summary{max-block-size:var(--component-expandable-max-block-size)}:host([open]) summary{max-block-size:var(--max-height-pixel,1000vh)}.content{max-block-size:var(--component-expandable-max-block-size)}:host([open]) .content,:host:has(.transitioning) .content{max-block-size:var(--max-height-pixel,1000vh)}.content:after{background:linear-gradient(180deg,var(--gradient));bottom:var(--sd-spacing-0,0);content:" ";display:block;height:var(--gradient-height);left:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);position:absolute;transition-duration:.15s;transition-duration:var(--sd-duration-medium,.3s);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%}:host([inverted]){--color-primary-rgb:0,53,142;--gradient-color-start:rgba(var(--color-primary-rgb),0);--gradient-color-end:rgba(var(--color-primary-rgb),1)}:host([inverted]) .content:after{background:var(--gradient-vertical-transparent-primary,linear-gradient(180deg,var(--gradient)))}:host(:not([open])) .content:after{opacity:var(--sd-opacity-100,1)}`],i([n(".content-preview")],t.prototype,"contentPreview",2),i([n("details")],t.prototype,"details",2),i([n('[part="content"]')],t.prototype,"body",2),i([a({type:Boolean,reflect:!0})],t.prototype,"open",2),i([a({type:Boolean,reflect:!0})],t.prototype,"inverted",2),i([v("open",{waitUntilFirstUpdate:!0})],t.prototype,"onOpenChange",1),t=i([f("sd-5-17-2-expandable")],t);h("expandable.show",{keyframes:[{height:"var(--component-expandable-max-block-size, 90px)"},{height:"auto"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});h("expandable.hide",{keyframes:[{height:"auto"},{height:"var(--component-expandable-max-block-size, 90px)"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk.YEDQWNIV.js";import{a as i,b as s,h as e}from"./chunk.M6XINJ52.js";import{b as l,e as a}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var r=class extends e{constructor(){super(...arguments);this.variant="rectangular"}render(){return a`<div part="base" aria-hidden="true" class="${o("bg-neutral-200 w-full h-full animate-pulse",{rectangular:"rounded-sm",circular:"rounded-full inline-block"}[this.variant])}"><slot></slot></div>`}};r.styles=[...e.styles,l`:host{display:block}::slotted(*){visibility:hidden}`],t([s({type:String,reflect:!0})],r.prototype,"variant",2),r=t([i("sd-5-17-
|
|
1
|
+
import{a as o}from"./chunk.YEDQWNIV.js";import{a as i,b as s,h as e}from"./chunk.M6XINJ52.js";import{b as l,e as a}from"./chunk.RZUTJ36B.js";import{e as t}from"./chunk.TJOCV4DC.js";var r=class extends e{constructor(){super(...arguments);this.variant="rectangular"}render(){return a`<div part="base" aria-hidden="true" class="${o("bg-neutral-200 w-full h-full animate-pulse",{rectangular:"rounded-sm",circular:"rounded-full inline-block"}[this.variant])}"><slot></slot></div>`}};r.styles=[...e.styles,l`:host{display:block}::slotted(*){visibility:hidden}`],t([s({type:String,reflect:!0})],r.prototype,"variant",2),r=t([i("sd-5-17-2-skeleton")],r);export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-5-17-
|
|
1
|
+
function w(n,{setValueOnSelection:p,scrollSelectionIntoView:c}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){let r=n?typeof n=="string"?document.querySelector(n):n:document.querySelector("#autoComplete"),i=r.shadowRoot.querySelector("input"),l=o=>o[0];return i.addEventListener("init",()=>{var a,s;let o=(a=r.shadowRoot)==null?void 0:a.querySelector("ul");o==null||o.setAttribute("part","listbox");let t=document.createElement("sd-5-17-2-popup");t.appendChild(o),(s=r.shadowRoot)==null||s.appendChild(t),t==null||t.setAttribute("exportparts","popup__content"),t&&(t.active=!1,t.autoSize="vertical",t.autoSizePadding=16,t.placement="bottom-start",t.anchor=r,t.sync="width");let d=l`sd-5-17-2-popup::part(popup){border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-width:0 2px 2px;overflow-y:scroll;z-index:var(--sd-z-index-dropdown,900);--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-5-17-2-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-5-17-2-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity,1))}sd-5-17-2-popup li{list-style-type:""}sd-5-17-2-popup li mark{background-color:transparent;font-weight:700}sd-5-17-2-popup li:not(:has(sd-5-17-2-option)){cursor:pointer;font-size:var(--sd-font-size-base,1rem);padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-4,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity,1))}sd-5-17-2-popup li:not(:has(sd-5-17-2-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-5-17-2-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}`,e=new CSSStyleSheet;e.replaceSync(d),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,e]}),p&&i.addEventListener("selection",o=>{var t;r.value=(t=o==null?void 0:o.detail)==null?void 0:t.selection.value}),i.addEventListener("open",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-17-2-popup"))==null||t.setAttribute("active","true"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.add("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.add("z-50")}),i.addEventListener("close",()=>{var o,t,d,e,a,s;(t=(o=r.shadowRoot)==null?void 0:o.querySelector("sd-5-17-2-popup"))==null||t.removeAttribute("active"),(e=(d=r.shadowRoot)==null?void 0:d.querySelector('[part="border"]'))==null||e.classList.remove("rounded-b-none"),(s=(a=r.shadowRoot)==null?void 0:a.querySelector('[part="form-control"]'))==null||s.classList.remove("z-50")}),c&&i.addEventListener("navigate",()=>{let o=r.shadowRoot.querySelector('[aria-selected="true"]');o==null||o.scrollIntoView({block:"nearest"})}),{config:{selector:()=>i,resultsList:{tag:"ul"},wrapper:!1}}}export{w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.M6XINJ52.js";import{b as d,e as c}from"./chunk.RZUTJ36B.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends i{constructor(){super(...arguments);this.disableRole=!1;this.label=""}handleFocus(e){let t=a(e.target);t==null||t.classList.add("sd-5-17-
|
|
1
|
+
import{a as g,b as m,c as b,d as h,h as i}from"./chunk.M6XINJ52.js";import{b as d,e as c}from"./chunk.RZUTJ36B.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends i{constructor(){super(...arguments);this.disableRole=!1;this.label=""}handleFocus(e){let t=a(e.target);t==null||t.classList.add("sd-5-17-2-button-group__button--focus")}handleBlur(e){let t=a(e.target);t==null||t.classList.remove("sd-5-17-2-button-group__button--focus")}handleMouseOver(e){let t=a(e.target);t==null||t.classList.add("sd-5-17-2-button-group__button--hover")}handleMouseOut(e){let t=a(e.target);t==null||t.classList.remove("sd-5-17-2-button-group__button--hover")}handleSlotChange(){let e=[...this.defaultSlot.assignedElements({flatten:!0})];e.forEach(t=>{let n=e.indexOf(t),o=a(t);o!==null&&(o.classList.add("sd-5-17-2-button-group__button"),o.classList.toggle("sd-5-17-2-button-group__button--first",n===0),o.classList.toggle("sd-5-17-2-button-group__button--inner",n>0&&n<e.length-1),o.classList.toggle("sd-5-17-2-button-group__button--last",n===e.length-1),o.classList.toggle("sd-5-17-2-button-group__button--radio",o.tagName.toLowerCase()==="sd-5-17-2-radio-button"))})}render(){return c`<slot part="base" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};s.styles=[...i.styles,d`:host{display:inline-block}[part=base]{display:flex;flex-wrap:nowrap}`],l([h("slot")],s.prototype,"defaultSlot",2),l([b()],s.prototype,"disableRole",2),l([m({type:String,reflect:!0})],s.prototype,"label",2),s=l([g("sd-5-17-2-button-group")],s);function a(r){var e;let u="sd-5-17-2-button, sd-5-17-2-radio-button";return(e=r.closest(u))!=null?e:r.querySelector(u)}export{s as a};
|