@solid-design-system/components 6.7.0 → 6.7.1
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.3G2JTYRD.js +2 -0
- package/cdn/components/range/range.d.ts +6 -0
- package/cdn/components/range/range.js +1 -1
- package/cdn/custom-elements.json +1 -1
- package/cdn/solid-components.bundle.js +25 -25
- package/cdn/solid-components.iife.js +29 -29
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/chunks/chunk.3G2JTYRD.js +2 -0
- package/cdn-versioned/chunks/chunk.3GKNX2TO.js +3 -3
- package/cdn-versioned/chunks/chunk.4CHW5IDN.js +2 -2
- package/cdn-versioned/chunks/chunk.4KRNPHHH.js +2 -2
- package/cdn-versioned/chunks/chunk.5I4NSTZK.js +2 -2
- package/cdn-versioned/chunks/chunk.5QEBITWI.js +2 -2
- package/cdn-versioned/chunks/chunk.5ZY4FRPG.js +2 -2
- package/cdn-versioned/chunks/chunk.6MYDGBJD.js +2 -2
- package/cdn-versioned/chunks/chunk.7HAKRUIU.js +1 -1
- package/cdn-versioned/chunks/chunk.7JM7OSND.js +1 -1
- package/cdn-versioned/chunks/chunk.7JU65HUG.js +2 -2
- package/cdn-versioned/chunks/chunk.7NQHT75O.js +2 -2
- package/cdn-versioned/chunks/chunk.7NVWBDY2.js +1 -1
- package/cdn-versioned/chunks/chunk.A62VHDIL.js +2 -2
- package/cdn-versioned/chunks/chunk.AC25BNNG.js +2 -2
- package/cdn-versioned/chunks/chunk.AHB36YEA.js +2 -2
- package/cdn-versioned/chunks/chunk.AXNMKWZO.js +2 -2
- package/cdn-versioned/chunks/chunk.CDP46OS4.js +1 -1
- package/cdn-versioned/chunks/chunk.CJ34NUTS.js +1 -1
- package/cdn-versioned/chunks/chunk.CMXQRUFT.js +1 -1
- package/cdn-versioned/chunks/chunk.DFJ6FD7J.js +2 -2
- package/cdn-versioned/chunks/chunk.DZHWN7RR.js +2 -2
- package/cdn-versioned/chunks/chunk.EENTRXWD.js +2 -2
- package/cdn-versioned/chunks/chunk.GZBVPA7S.js +2 -2
- package/cdn-versioned/chunks/chunk.HXNGWXXV.js +5 -5
- package/cdn-versioned/chunks/chunk.JKUZ7I52.js +2 -2
- package/cdn-versioned/chunks/chunk.JMTPGFJB.js +1 -1
- package/cdn-versioned/chunks/chunk.K3YVYEAO.js +2 -2
- package/cdn-versioned/chunks/chunk.KUNV4ZC6.js +2 -2
- package/cdn-versioned/chunks/chunk.LCB6IWY2.js +2 -2
- package/cdn-versioned/chunks/chunk.LPKXOADQ.js +2 -2
- package/cdn-versioned/chunks/chunk.LQCY4Q4V.js +2 -2
- package/cdn-versioned/chunks/chunk.LS2NAENW.js +1 -1
- package/cdn-versioned/chunks/chunk.MB7AGGLX.js +2 -2
- package/cdn-versioned/chunks/chunk.N6MWNUFJ.js +2 -2
- package/cdn-versioned/chunks/chunk.N6YWZXZL.js +1 -1
- package/cdn-versioned/chunks/chunk.NOEVVOED.js +2 -2
- package/cdn-versioned/chunks/chunk.NQFJN2CW.js +1 -1
- package/cdn-versioned/chunks/chunk.NTUMACZ6.js +9 -9
- package/cdn-versioned/chunks/chunk.NZ66E5AS.js +2 -2
- package/cdn-versioned/chunks/chunk.O2JYWK2X.js +2 -2
- package/cdn-versioned/chunks/chunk.OGH2CT55.js +2 -2
- package/cdn-versioned/chunks/chunk.PE5TZWM3.js +2 -2
- package/cdn-versioned/chunks/chunk.QFIY7MLK.js +2 -2
- package/cdn-versioned/chunks/chunk.QGV3BXCE.js +2 -2
- package/cdn-versioned/chunks/chunk.QLW3GMT7.js +2 -2
- package/cdn-versioned/chunks/chunk.QVVATD5X.js +1 -1
- package/cdn-versioned/chunks/chunk.R4ZOSKCW.js +2 -2
- package/cdn-versioned/chunks/chunk.R5D5IAKJ.js +1 -1
- package/cdn-versioned/chunks/chunk.REKTRG7S.js +2 -2
- package/cdn-versioned/chunks/chunk.RXJ46J4Q.js +2 -2
- package/cdn-versioned/chunks/chunk.S7ONP6BO.js +1 -1
- package/cdn-versioned/chunks/chunk.TZPXBIUB.js +2 -2
- package/cdn-versioned/chunks/chunk.UDRTTV56.js +5 -5
- package/cdn-versioned/chunks/chunk.UFCNOC3N.js +3 -3
- package/cdn-versioned/chunks/chunk.UJL7MHVM.js +2 -2
- package/cdn-versioned/chunks/chunk.UOLF3Z2F.js +1 -1
- package/cdn-versioned/chunks/chunk.VTDQOKJM.js +2 -2
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.XDXK4RJJ.js +2 -2
- package/cdn-versioned/chunks/chunk.XGRIXEAE.js +2 -2
- package/cdn-versioned/chunks/chunk.XNIBBYE6.js +2 -2
- package/cdn-versioned/chunks/chunk.XVE3HUDP.js +2 -2
- package/cdn-versioned/chunks/chunk.ZO3H5C7X.js +2 -2
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
- package/cdn-versioned/components/datepicker/datepicker.d.ts +1 -1
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/loader/loader.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/menu/menu.d.ts +1 -1
- package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/cdn-versioned/components/range/range.d.ts +7 -1
- package/cdn-versioned/components/range/range.js +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/theme-listener/theme-listener.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 +244 -244
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +85 -85
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +85 -85
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +94 -94
- package/cdn-versioned/web-types.json +157 -157
- package/{dist-versioned/chunks/chunk.TGZE77AF.js → dist/chunks/chunk.7UUYNJS5.js} +39 -6
- package/dist/components/range/range.d.ts +6 -0
- package/dist/components/range/range.js +13 -1
- package/dist/custom-elements.json +1 -1
- package/dist/solid-components.js +4 -4
- package/dist/web-types.json +1 -1
- package/dist-versioned/chunks/chunk.34FNDYY2.js +2 -2
- package/dist-versioned/chunks/chunk.35O2UVGB.js +1 -1
- package/dist-versioned/chunks/chunk.36PZ2ZYY.js +7 -7
- package/dist-versioned/chunks/chunk.37TQP26W.js +1 -1
- package/dist-versioned/chunks/chunk.3JA6XC66.js +5 -5
- package/dist-versioned/chunks/chunk.46HLMURY.js +4 -4
- package/dist-versioned/chunks/chunk.66BLBC6H.js +24 -24
- package/dist-versioned/chunks/chunk.6OQST4MV.js +10 -10
- package/dist-versioned/chunks/chunk.7TNM3KIX.js +2 -2
- package/{dist/chunks/chunk.TGZE77AF.js → dist-versioned/chunks/chunk.7UUYNJS5.js} +39 -6
- package/dist-versioned/chunks/chunk.7UVXJDH2.js +3 -3
- package/dist-versioned/chunks/chunk.7WUGACZI.js +3 -3
- package/dist-versioned/chunks/chunk.ADLNODYZ.js +4 -4
- package/dist-versioned/chunks/chunk.BMSVBL74.js +2 -2
- package/dist-versioned/chunks/chunk.C3WIBDGG.js +3 -3
- package/dist-versioned/chunks/chunk.CBC4EZWD.js +4 -4
- package/dist-versioned/chunks/chunk.CECM7HKR.js +11 -11
- package/dist-versioned/chunks/chunk.CGQHCRPP.js +5 -5
- package/dist-versioned/chunks/chunk.CTZIFPPT.js +6 -6
- package/dist-versioned/chunks/chunk.DKXRGYTS.js +5 -5
- package/dist-versioned/chunks/chunk.EFL7UGJF.js +3 -3
- package/dist-versioned/chunks/chunk.EP3FJ6UU.js +4 -4
- package/dist-versioned/chunks/chunk.EY7UK2BZ.js +6 -6
- package/dist-versioned/chunks/chunk.F5PRJGBD.js +3 -3
- package/dist-versioned/chunks/chunk.FC3YSKGL.js +1 -1
- package/dist-versioned/chunks/chunk.FDRFLSGY.js +2 -2
- package/dist-versioned/chunks/chunk.FH7IYLFW.js +14 -14
- package/dist-versioned/chunks/chunk.FHD6XY2M.js +3 -3
- package/dist-versioned/chunks/chunk.FJ3FPGND.js +1 -1
- package/dist-versioned/chunks/chunk.GAZNGQ6X.js +5 -5
- package/dist-versioned/chunks/chunk.GMYIZ3J2.js +28 -28
- package/dist-versioned/chunks/chunk.H7FDVZRQ.js +1 -1
- package/dist-versioned/chunks/chunk.IM7UBJL2.js +1 -1
- package/dist-versioned/chunks/chunk.JHGB2ZMH.js +1 -1
- package/dist-versioned/chunks/chunk.JXJ5ABVB.js +8 -8
- package/dist-versioned/chunks/chunk.KB7VIBAE.js +3 -3
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.KFH26OT3.js +1 -1
- package/dist-versioned/chunks/chunk.KGN4OSJS.js +8 -8
- package/dist-versioned/chunks/chunk.MA3U64BI.js +1 -1
- package/dist-versioned/chunks/chunk.MRI5QQUM.js +4 -4
- package/dist-versioned/chunks/chunk.NJMHI5UM.js +12 -12
- package/dist-versioned/chunks/chunk.O75UK37Y.js +3 -3
- package/dist-versioned/chunks/chunk.PBVPL25D.js +6 -6
- package/dist-versioned/chunks/chunk.QH2KMZDB.js +5 -5
- package/dist-versioned/chunks/chunk.QXENWV2D.js +4 -4
- package/dist-versioned/chunks/chunk.RS56W46S.js +26 -26
- package/dist-versioned/chunks/chunk.RVIQ642S.js +1 -1
- package/dist-versioned/chunks/chunk.SAOVIYDI.js +2 -2
- package/dist-versioned/chunks/chunk.TUSC7AK7.js +8 -8
- package/dist-versioned/chunks/chunk.U2BN2DBY.js +4 -4
- package/dist-versioned/chunks/chunk.UHNAADFP.js +4 -4
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UVGX2XYL.js +2 -2
- package/dist-versioned/chunks/chunk.V5OZWLLA.js +3 -3
- package/dist-versioned/chunks/chunk.VOPJWC6H.js +2 -2
- package/dist-versioned/chunks/chunk.W7QB7KQG.js +5 -5
- package/dist-versioned/chunks/chunk.WR3SE4O5.js +12 -12
- package/dist-versioned/chunks/chunk.WU5L6FE5.js +2 -2
- package/dist-versioned/chunks/chunk.WZQBNRPA.js +2 -2
- package/dist-versioned/chunks/chunk.XCFDPNXY.js +5 -5
- package/dist-versioned/chunks/chunk.XYDUW4SZ.js +9 -9
- package/dist-versioned/chunks/chunk.ZQFW6FCT.js +3 -3
- package/dist-versioned/chunks/chunk.ZULS2JUR.js +2 -2
- package/dist-versioned/components/accordion/accordion.d.ts +1 -1
- package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist-versioned/components/animation/animation.d.ts +1 -1
- package/dist-versioned/components/audio/audio.d.ts +1 -1
- package/dist-versioned/components/badge/badge.d.ts +1 -1
- package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/dist-versioned/components/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +1 -1
- package/dist-versioned/components/datepicker/datepicker.d.ts +1 -1
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/loader/loader.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/menu/menu.d.ts +1 -1
- package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/dist-versioned/components/range/range.d.ts +7 -1
- package/dist-versioned/components/range/range.js +13 -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/theme-listener/theme-listener.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 +244 -244
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +4 -4
- package/dist-versioned/vscode.html-custom-data.json +94 -94
- package/dist-versioned/web-types.json +157 -157
- package/package.json +2 -2
- package/cdn/chunks/chunk.G7D3WBTA.js +0 -2
- package/cdn-versioned/chunks/chunk.G7D3WBTA.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk.VYBQ3X2B.js";import{a as b}from"./chunk.N3WG3NAL.js";import{b as m}from"./chunk.CJ34NUTS.js";import{a as p}from"./chunk.PV6UYBMY.js";import{a as r}from"./chunk.YFQFOIEM.js";import{a as n}from"./chunk.NYKJXI3Q.js";import{a as h,b as l,c as u,d as a,h as o}from"./chunk.CMXQRUFT.js";import{b as c,e as s}from"./chunk.763RLJEK.js";import{e as i}from"./chunk.6EV4YU6C.js";var t=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,v)=>e.checked=v});this.title="";this.name="";this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(e){if(this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false"),this.formControlController.setValidity(e)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.visuallyDisabled?"visuallyDisabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return s`<div class="flex flex-col"><label part="base" class="${r("sd-6-7-
|
|
2
|
-
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-style:var(--tw-outline-style);outline-width:0}:host([required]) #label::after{content:' *'}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}`],i([a('input[type="checkbox"]')],t.prototype,"input",2),i([a("#invalid-message")],t.prototype,"invalidMessage",2),i([l({type:String,reflect:!0})],t.prototype,"title",2),i([l({type:String,reflect:!0})],t.prototype,"name",2),i([l()],t.prototype,"value",2),i([l({type:String,reflect:!0})],t.prototype,"size",2),i([l({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([l({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([l({type:Boolean,reflect:!0})],t.prototype,"checked",2),i([l({type:Boolean,reflect:!0})],t.prototype,"indeterminate",2),i([b("checked")],t.prototype,"defaultChecked",2),i([l({type:String,reflect:!0})],t.prototype,"form",2),i([l({type:Boolean,reflect:!0})],t.prototype,"required",2),i([u()],t.prototype,"showInvalidStyle",2),i([n(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([n(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],t.prototype,"handleStateChange",1),t=i([h("sd-6-7-
|
|
1
|
+
import{a as d}from"./chunk.VYBQ3X2B.js";import{a as b}from"./chunk.N3WG3NAL.js";import{b as m}from"./chunk.CJ34NUTS.js";import{a as p}from"./chunk.PV6UYBMY.js";import{a as r}from"./chunk.YFQFOIEM.js";import{a as n}from"./chunk.NYKJXI3Q.js";import{a as h,b as l,c as u,d as a,h as o}from"./chunk.CMXQRUFT.js";import{b as c,e as s}from"./chunk.763RLJEK.js";import{e as i}from"./chunk.6EV4YU6C.js";var t=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,v)=>e.checked=v});this.title="";this.name="";this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(e){if(this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false"),this.formControlController.setValidity(e)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.visuallyDisabled?"visuallyDisabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return s`<div class="flex flex-col"><label part="base" class="${r("sd-6-7-1-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",(this.disabled||this.visuallyDisabled)&&"hover:cursor-not-allowed",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${p(this.value)}" .indeterminate="${d(this.indeterminate)}" .checked="${d(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.indeterminate?"mixed":this.checked}" aria-describedby="invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${r("relative flex flex-shrink-0 items-center justify-center border sd-6-7-1-checkbox-border-width rounded-sm h-4 w-4","transition-colors ease-in-out duration-medium group-hover:duration-fast","peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-primary",{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"form-control-color-border hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"><div part="checkbox" class="${r("absolute h-3 transition-[width] right-0 duration-medium",this.checked||this.indeterminate?"w-0":"w-3")}"><div class="${r("w-full h-full transition-colors duration-medium ease-in-out group-hover:duration-fast",{disabledIndeterminate:"bg-neutral-500",disabledChecked:" bg-neutral-500",disabled:"",visuallyDisabled:"",invalidIndeterminate:" bg-error group-hover:bg-error-400",invalid:"group-hover:bg-neutral-200",filled:"bg-accent group-hover:bg-accent-550",default:"hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"></div></div>${this.checked?s`<sd-6-7-1-icon part="checked-icon" class="text-white w-3 h-3" library="sd-status-assets" name="status-check"></sd-6-7-1-icon>`:""} ${!this.checked&&this.indeterminate?s`<sd-6-7-1-icon part="indeterminate-icon" class="text-white w-3 h-3" library="sd-status-assets" name="status-minus"></sd-6-7-1-icon>`:""} </span><span part="label" id="label" class="${r("select-none inline-block ml-2",this.disabled||this.visuallyDisabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label><div id="invalid-icon-message" part="invalid-icon-message" class="${r("flex items-center gap-2",this.showInvalidStyle&&"mt-2")}">${this.showInvalidStyle?s`<sd-6-7-1-icon id="invalid-icon" part="invalid-icon" class="${r("text-error")}" library="_internal" name="risk"></sd-6-7-1-icon>`:""} ${this.formControlController.renderInvalidMessage(this.size)}</div></div>`}};t.styles=[...o.styles,c`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
|
|
2
|
+
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-style:var(--tw-outline-style);outline-width:0}:host([required]) #label::after{content:' *'}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}`],i([a('input[type="checkbox"]')],t.prototype,"input",2),i([a("#invalid-message")],t.prototype,"invalidMessage",2),i([l({type:String,reflect:!0})],t.prototype,"title",2),i([l({type:String,reflect:!0})],t.prototype,"name",2),i([l()],t.prototype,"value",2),i([l({type:String,reflect:!0})],t.prototype,"size",2),i([l({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([l({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([l({type:Boolean,reflect:!0})],t.prototype,"checked",2),i([l({type:Boolean,reflect:!0})],t.prototype,"indeterminate",2),i([b("checked")],t.prototype,"defaultChecked",2),i([l({type:String,reflect:!0})],t.prototype,"form",2),i([l({type:Boolean,reflect:!0})],t.prototype,"required",2),i([u()],t.prototype,"showInvalidStyle",2),i([n(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([n(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],t.prototype,"handleStateChange",1),t=i([h("sd-6-7-1-checkbox")],t);export{t as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk.YFQFOIEM.js";import{a as l}from"./chunk.NYKJXI3Q.js";import{a as c,b as i,c as r,h as a}from"./chunk.CMXQRUFT.js";import{b as o,e as d}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends a{constructor(){super(...arguments);this.checked=!1;this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.invalid=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){!this.disabled&&!this.visuallyDisabled&&(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled||this.visuallyDisabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return d`<span part="base" class="${s("sd-6-7-
|
|
2
|
-
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){--tw-outline-style:none;outline-style:none}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-width:1px;outline-style:var(--tw-outline-style);outline-width:2px;outline-offset:2px;outline-color:var(--sd-color-border-primary,var(--sd-color-primary))}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}`],t([r()],e.prototype,"checked",2),t([r()],e.prototype,"hasFocus",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],e.prototype,"visuallyDisabled",2),t([i()],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"invalid",2),t([l("checked")],e.prototype,"handleCheckedChange",1),t([l(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([c("sd-6-7-
|
|
1
|
+
import{a as s}from"./chunk.YFQFOIEM.js";import{a as l}from"./chunk.NYKJXI3Q.js";import{a as c,b as i,c as r,h as a}from"./chunk.CMXQRUFT.js";import{b as o,e as d}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends a{constructor(){super(...arguments);this.checked=!1;this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.invalid=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){!this.disabled&&!this.visuallyDisabled&&(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled||this.visuallyDisabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return d`<span part="base" class="${s("sd-6-7-1-radio group flex items-center text-base leading-normal text-black cursor-pointer",(this.disabled||this.visuallyDisabled)&&"hover:cursor-not-allowed",{sm:"small-size text-sm",md:"text-base",lg:"text-base"}[this.size])}"><span part="${`${this.checked?"control--checked":"control--unchecked"}`}" class="${s("flex-initial shrink-0 relative inline-flex items-center justify-center border sd-6-7-1-radio-border-width rounded-full bg-white h-4 w-4 duration-fast ease-in-out",this.disabled||this.visuallyDisabled?"border-neutral-500":this.invalid?s("border-error hover:border-error-400 group-hover:border-error-400",this.checked?"sd-6-7-1-radio--checked--invalid--default-color-background":"sd-6-7-1-radio--default--invalid-color-background"):this.checked?"sd-6-7-1-radio--checked--default-color-background hover:sd-6-7-1-radio--checked--hover-color-background group-hover:sd-6-7-1-radio--checked--hover-color-background border-accent hover:border-accent-550 group-hover:border-accent-550":"form-control-color-border hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span part="checked" class="${s("rounded-full inline-flex text-white sd-6-7-1-radio--checked--default__icon-color-background h-2.5 w-2.5 transition-[transform, colors] duration-medium ease-in-out",this.checked?"scale-100":"scale-0",this.disabled?"bg-neutral-500":this.visuallyDisabled?"bg-white":this.invalid?"sd-6-7-1-radio--checked--invalid--default__icon-color-background hover:sd-6-7-1-radio--checked--invalid--hover__icon-color-background group-hover:sd-6-7-1-radio--checked--invalid--hover__icon-color-background":this.checked?"sd-6-7-1-radio--checked--default__icon-color-background hover:sd-6-7-1-radio--checked--hover__icon-color-background group-hover:sd-6-7-1-radio--checked--hover__icon-color-background":"bg-neutral-800")}"></span></span><slot part="label" class="${s("ml-2 select-none inline-block",this.disabled||this.visuallyDisabled?"text-neutral-500":this.invalid?"text-error":"text-black")}"></slot></span>`}};e.styles=[...a.styles,o`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
|
|
2
|
+
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){--tw-outline-style:none;outline-style:none}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-width:1px;outline-style:var(--tw-outline-style);outline-width:2px;outline-offset:2px;outline-color:var(--sd-color-border-primary,var(--sd-color-primary))}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}`],t([r()],e.prototype,"checked",2),t([r()],e.prototype,"hasFocus",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],e.prototype,"visuallyDisabled",2),t([i()],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"invalid",2),t([l("checked")],e.prototype,"handleCheckedChange",1),t([l(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([c("sd-6-7-1-radio")],e);export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as m}from"./chunk.PJ7JCMQF.js";import{a as b}from"./chunk.IQPMMUES.js";import{a as o}from"./chunk.YFQFOIEM.js";import{a as p}from"./chunk.NYKJXI3Q.js";import{a as d,b as a,d as n,h as s}from"./chunk.CMXQRUFT.js";import{b as r}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends s{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:i}=this;this.defaultSlot.assignedElements().filter(l=>l.tagName.toLowerCase()==="sd-6-7-
|
|
2
|
-
:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([d("sd-6-7-
|
|
1
|
+
import{b as m}from"./chunk.PJ7JCMQF.js";import{a as b}from"./chunk.IQPMMUES.js";import{a as o}from"./chunk.YFQFOIEM.js";import{a as p}from"./chunk.NYKJXI3Q.js";import{a as d,b as a,d as n,h as s}from"./chunk.CMXQRUFT.js";import{b as r}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends s{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:i}=this;this.defaultSlot.assignedElements().filter(l=>l.tagName.toLowerCase()==="sd-6-7-1-option").forEach(l=>{l.disabled=i})}handleDisabledChange(){this.handleDisableOptions()}render(){let{disabled:i}=this;return m`<div role="${i?"presentation":"group"}" class="${o(this.disabled?"text-neutral-500":"")}" part="base" aria-labelledby="group-label"><sd-6-7-1-divider id="divider" class="pt-2 pb-4" part="divider"></sd-6-7-1-divider><div part="label-container" class="${o(this.disabled?"text-neutral-500":"text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="listbox" part="options" aria-label="${this.localize.term("optionGroup")}"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`}};e.styles=[...s.styles,r`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([d("sd-6-7-1-optgroup")],e);export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk.3MADQ6HK.js";import{b as K}from"./chunk.CJ34NUTS.js";import{a as G}from"./chunk.CGQ2BPPZ.js";import{a as U}from"./chunk.IQPMMUES.js";import{a as $}from"./chunk.YFQFOIEM.js";import{a as k}from"./chunk.NYKJXI3Q.js";import{a as N,b as y,c as x,d as R,h as H}from"./chunk.CMXQRUFT.js";import{b as W,e as V,i as q}from"./chunk.763RLJEK.js";import{e as h}from"./chunk.6EV4YU6C.js";var B={fromAttribute(E){if(!E)return null;let t=E.trim().replace(/[./]/g,"-").match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return null;let e=`${t[1]}-${t[2]}-${t[3]}`,s=new Date(+t[1],+t[2]-1,+t[3]);return s.getFullYear()!==+t[1]||s.getMonth()!==+t[2]-1||s.getDate()!==+t[3]?null:e},toAttribute(E){return E!=null?E:""}},_={fromAttribute(E){if(!E)return[];let Y=[],t=E.trim();if(t.startsWith("["))try{let s=JSON.parse(t);Array.isArray(s)&&(Y=s.map(String))}catch(s){return[]}else Y=t.split(/[\s,]+/).map(s=>s.trim()).filter(Boolean);let e=[];for(let s of Y){let n=s.replace(/[-/]/g,".").split(".");if(n.length!==3)continue;let[l,u,f]=n.map(Number);if(!l||!u||!f)continue;let b=new Date(l,u-1,f);if(b.getFullYear()!==l||b.getMonth()!==u-1||b.getDate()!==f)continue;let m=`${l}-${String(u).padStart(2,"0")}-${String(f).padStart(2,"0")}`;e.push(m)}return e},toAttribute(E){return E?E.join(","):""}},r=class extends H{constructor(){super();this.localize=new U(this);this.hasSlotController=new G(this,"label","help-text","tooltip");this.formControlController=new K(this,{assumeInteractionOn:["sd-blur","sd-6-7-0-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.floatingLabel=!1;this.disabled=!1;this.required=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=a.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(i=>{var n,l;return i instanceof HTMLElement&&(((n=i.classList)==null?void 0:n.contains("nav"))||((l=i.classList)==null?void 0:l.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var l,u,f,b,m;if(this.disabled||this.visuallyDisabled||this.readonly){(l=t.preventDefault)==null||l.call(t),(u=t.stopPropagation)==null||u.call(t);return}let e=t.target,s=e.value,i=(f=e.selectionStart)!=null?f:s.length,n=(b=t.inputType)==null?void 0:b.startsWith("delete");if(this.range){let o=s.replace(/\D/g,""),c=o.slice(0,8),d=o.slice(8,16),p=this.buildDmyFromDigits(c),I=this.buildDmyFromDigits(d),S;c.length===0?S="":c.length<8?S=p:d.length>0?S=`${p} - ${I}`:S=n?p:`${p} -`;let w=this.countDigitsBeforeCaret(s,i),D;if(w<=8){let g=this.digitIndexToDmyCaretPos(Math.min(w,8));D=Math.min(g,p.length)}else{let g=c.length<8?p.length:p.length+3,v=Math.min(w-8,8),M=this.digitIndexToDmyCaretPos(v);D=g+Math.min(M,I.length)}this.inputValue=S;let O=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(p)){let g=this.dmyToIso(p),v=g?a.parseLocalISO(g):null;!!v&&!this.isDisabled(v)&&this.inMinMax(v)&&this.rangeStart!==g&&(this.rangeStart=g,this.previewEnd=null,this.viewMonth=new Date(v.getFullYear(),v.getMonth(),1),this.focusedDate=a.startOfDayLocal(v),O=!0)}else this.rangeStart&&(this.rangeStart=null,O=!0),this.rangeEnd&&(this.rangeEnd=null,O=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(I)&&this.rangeStart){let g=a.parseLocalISO(this.rangeStart),v=this.dmyToIso(I),M=v?a.parseLocalISO(v):null;if(!!M&&!this.isDisabled(M)&&this.inMinMax(M)){let[F,T]=a.compareDates(g,M)<=0?[g,M]:[M,g],P=a.isSameDay(F,T);if((this.allowSameDayRange||!P)&&!this.wouldRangeContainDisabled(F,T)){let C=a.toLocalISODate(a.startOfDayLocal(F)),z=a.toLocalISODate(a.startOfDayLocal(T));(this.rangeStart!==C||this.rangeEnd!==z)&&(this.rangeStart=C,this.rangeEnd=z,this.viewMonth=new Date(T.getFullYear(),T.getMonth(),1),this.focusedDate=a.startOfDayLocal(T),O=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,O=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),O&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var v;let g=(v=this.input)!=null?v:e;g&&(g.value=this.inputValue,g.setSelectionRange(D,D))})})}else{let o=e,c=o.value,d=(m=o.selectionStart)!=null?m:c.length,p=c.replace(/\D/g,"").slice(0,8),I=p.slice(0,2),S=p.slice(2,4),w=p.slice(4,8),D="";I.length>0&&(D+=I,I.length===2&&(D+=".")),S.length>0&&I.length===2&&(D+=S,S.length===2&&(D+=".")),w.length>0&&I.length===2&&S.length===2&&(D+=w),D=D.replace(/\.\.+/g,".");let O=this.inputValue||"";this.inputValue=D;let g=d,v=L=>{let C=[];for(let z=0;z<L.length;z++)L[z]==="."&&C.push(z);return C},M=v(O),A=v(D),F=M.filter(L=>L<d).length,P=A.filter(L=>L<d).length-F;if(P>0?g+=P:!M.includes(d)&&A.includes(d)&&(g+=1),g=Math.min(Math.max(0,g),D.length),requestAnimationFrame(()=>{var C;let L=(C=this.input)!=null?C:o;L&&(L.value=this.inputValue,L.setSelectionRange(g,g))}),/^\d{2}\.\d{2}\.\d{4}$/.test(D)){let L=this.parseInputText(D);this.applyParsedInput(L)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let o=this.rangeStart?a.parseLocalISO(this.rangeStart):null,c=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;o&&!c?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(o)}`):o&&c&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(o)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(c)}`)}else if(this.value){let o=a.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(o)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{let e=t.detail;e&&(this.currentPlacement=e)};this.handleHeaderKeyDown=(t,e,s,i)=>{if(!(this.disabled||this.visuallyDisabled||this.readonly)){if(t.key==="Tab"&&!t.shiftKey){i&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(s):this.setYear(s))}};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled||this.readonly){t.preventDefault(),t.stopPropagation();return}let e=t.key,s=!0,i=new Date(this.focusedDate);switch(e){case"ArrowLeft":i.setDate(i.getDate()-1);break;case"ArrowRight":i.setDate(i.getDate()+1);break;case"ArrowUp":i.setDate(i.getDate()-7);break;case"ArrowDown":i.setDate(i.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:s=!1}if(s){if(t.preventDefault(),i.getMonth()!==this.viewMonth.getMonth()||i.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(i.getFullYear(),i.getMonth(),1);let f=this.formatMonthYear(this.viewMonth);this.setNavStatus(f)}let l=a.startOfDayLocal(i);(!this.focusedDate||l.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=l);let u=l.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(u),this.requestUpdate(),requestAnimationFrame(()=>{let f=this.shadowRoot,b=f==null?void 0:f.querySelector("button.day.focused");b==null||b.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled||this.readonly)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&!this.readonly&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?a.parseLocalISO(this.value):null,e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.range&&e?e:t!=null?t:a.startOfDayLocal(new Date);this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.clampDateToMonth(s,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}handleOpenChange(){this.popup&&(this.popup.active=this.open&&!this.disabled&&!this.visuallyDisabled)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?a.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=a.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var s;let e=this.input;if(e){e.value=(s=this.inputValue)!=null?s:"";let i=e.value.length;e.setSelectionRange(i,i)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?a.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null,s=t!=null?t:e;s&&(this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.startOfDayLocal(s)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let i=this.input;if(i){i.value=(n=this.inputValue)!=null?n:"";let l=i.value.length;i.setSelectionRange(l,l)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}handleSizeChange(){this.size=this.floatingLabel&&this.size==="sm"?"md":this.size}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return a.parseLocalISO(t)}inMinMax(t){let e=this.min===null?null:this.parseISO(String(this.min)),s=this.max===null?null:this.parseISO(String(this.max));return!(e&&t<e||s&&t>s)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),n=`${e}-${s}-${i}`;return this.disabledDatesSet.has(n)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let s="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+s},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),s=this.ordinal(e),i=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${s} of ${i} ${n}`}ordinal(t){let e=["th","st","nd","rd"],s=t%100,i=e[(s-20)%10]||e[s]||e[0];return t+i}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let s=JSON.parse(e);Array.isArray(s)&&(t=s)}catch(s){t=[]}else e.length>0&&(t=e.split(",").map(s=>s.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let s=a.compareDates(t,e)<=0?a.startOfDayLocal(t):a.startOfDayLocal(e),i=a.compareDates(t,e)<=0?a.startOfDayLocal(e):a.startOfDayLocal(t),n=new Date(s);for(;a.compareDates(n,i)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=a.parseLocalISO(t);if(e||(e=a.parseLocalISO(t.replace(/-/g,"."))),!e)return"";let s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${s}.${i}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let s=Number(e[1]),i=Number(e[2]),n=Number(e[3]),l=new Date(n,i-1,s);if(l.getFullYear()!==n||l.getMonth()!==i-1||l.getDate()!==s)return null;let u=a.startOfDayLocal(l);return a.toLocalISODate(u)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),i=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),l=this.isoToDmy(this.rangeEnd);return n&&l?`${n} ${i} ${l}`:n&&!l?`${n} ${i}`:""}parseInputText(t){var i,n;let e=t.trim();if(this.range){let l=e.split(/\s*-\s*/);if(l.length===1){let u=l[0];if(!u)return{start:null,end:null,valid:!0};let f=this.dmyToIso(u);return f?{start:f,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(l.length>=2){let u=(i=l[0])!=null?i:"",f=(n=l[1])!=null?n:"",b=u?this.dmyToIso(u):null,m=f?this.dmyToIso(f):null;return u&&!b?{start:null,end:null,valid:!1}:f&&!m?{start:null,end:null,valid:!1}:{start:b,end:m,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let s=this.dmyToIso(e);return s?{single:s,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var u,f,b,m;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=o=>{if(!o)return!0;let c=a.parseLocalISO(o);return!(!this.inMinMax(c)||this.isDisabled(c))},s=!1;if(this.range){let o=(u=t.start)!=null?u:null,c=(f=t.end)!=null?f:null;if(!e(o)||c&&!e(c))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let d=o?a.parseLocalISO(o):null,p=c?a.parseLocalISO(c):null;if(d&&p){if(a.compareDates(d,p)>0){let w=d;d=p,p=w}if(!this.allowSameDayRange&&a.isSameDay(d,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(d,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let I=d?a.toLocalISODate(a.startOfDayLocal(d)):null,S=p?a.toLocalISODate(a.startOfDayLocal(p)):null;if(this.rangeStart!==I||this.rangeEnd!==S){this.rangeStart=I,this.rangeEnd=S,this.previewEnd=null,s=!0;let w=(b=d!=null?d:p)!=null?b:this.today;this.viewMonth=new Date(w.getFullYear(),w.getMonth(),1),this.focusedDate=a.startOfDayLocal(w),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let i=(m=t.single)!=null?m:null;if(!e(i))return this.input.setCustomValidity(this.localize.term("datePickerRange")),this.formControlController.setValidity(!1),this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=i?a.parseLocalISO(i):null,l=n?a.toLocalISODate(a.startOfDayLocal(n)):null;return this.value!==l&&(this.value=l,s=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=a.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),s}buildDmyFromDigits(t){let e=t.slice(0,8),s=e.slice(0,2),i=e.slice(2,4),n=e.slice(4,8),l=s;return i.length&&(l+="."+i),n.length&&(l+="."+n),l}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var s,i;((i=(s=t.composedPath)==null?void 0:s.call(t))!=null?i:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled||this.readonly){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled||this.readonly){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&!this.readonly&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let s=a.parseLocalISO(this.value);s&&(t=a.startOfDayLocal(s))}if(this.range){let s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;i?t=a.startOfDayLocal(i):s&&(t=a.startOfDayLocal(s))}if(!(s=>s?s.getFullYear()===this.viewMonth.getFullYear()&&s.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(s):!1)(t)){let{weeks:s}=this.getMonthMatrix(this.viewMonth),i=s.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(n,this.today)&&!this.isDisabled(n));if(i)t=a.startOfDayLocal(i);else{let n=s.flat().find(l=>l.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(l));t=n?a.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let s=this.shadowRoot,i=(s==null?void 0:s.querySelector("button.day.selected"))||(s==null?void 0:s.querySelector("button.day.focused"))||(s==null?void 0:s.querySelector('button.day[tabindex="0"]'))||(s==null?void 0:s.querySelector("button.day"));i==null||i.focus({preventScroll:!0})})}selectSingleDate(t){if(this.readonly||this.isDisabled(t))return;let e=a.startOfDayLocal(t),s=a.toLocalISODate(e);if(this.value===s)return;this.value=s;let i=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(i),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var l;let n=this.input;n&&(n.value=(l=this.inputValue)!=null?l:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let u=n.value.length;n.setSelectionRange(u,u)})}))})}selectRangeDate(t){if(this.readonly)return;let e=a.startOfDayLocal(t),s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(!s&&!i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))});return}if(s&&!i){if(this.isDisabled(e))return;if(a.isSameDay(s,e)){if(!this.allowSameDayRange){this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let o=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${o}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var d;let c=this.input;c&&(c.value=(d=this.inputValue)!=null?d:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=c.value.length;c.setSelectionRange(p,p)})}))});return}this.rangeStart=a.toLocalISODate(e),this.rangeEnd=a.toLocalISODate(e),this.previewEnd=null;let m=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${m}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let o=this.input;o&&(o.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let d=o.value.length;o.setSelectionRange(d,d)})}))});return}let n=a.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[l,u]=a.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=a.toLocalISODate(l),this.rangeEnd=a.toLocalISODate(u),this.previewEnd=null;let f=this.formatSelectionLabel(l),b=this.formatSelectionLabel(u);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${b}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var o;let m=this.input;m&&(m.value=(o=this.inputValue)!=null?o:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let c=m.value.length;m.setSelectionRange(c,c)})}))});return}if(s&&i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))})}}selectDate(t){this.readonly||(this.range?this.selectRangeDate(t):this.selectSingleDate(t))}getMonthMatrix(t){var b;let e=(b=this.firstDayOfWeek)!=null?b:1,s=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(s),n=(s.getDay()-e+7)%7;i.setDate(s.getDate()-n);let l=[],u=i;for(let m=0;m<6;m++){let o=[];for(let c=0;c<7;c++)o.push(new Date(u)),u.setDate(u.getDate()+1);l.push(o)}let f=m=>m.every(o=>o.getMonth()!==t.getMonth());for(;l.length>0&&f(l[l.length-1]);)l.pop();return{weeks:l}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var i;let t=(i=this.firstDayOfWeek)!=null?i:1,e=new Date(2021,7,1),s=[];for(let n=0;n<7;n++){let l=new Date(e);l.setDate(e.getDate()+(t+n)%7);try{s.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(l))}catch(u){s.push(l.toLocaleDateString(void 0,{weekday:"short"}))}}return s}getTabTargetDayForCurrentView(t){let e=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(i,this.today)&&!this.isDisabled(i));if(e)return a.startOfDayLocal(e);let s=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(i));return s?a.startOfDayLocal(s):null}onDayMouseEnter(t){if(!this.range||this.readonly)return;let e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(e&&!s){let i=a.startOfDayLocal(t);this.previewEnd=this.isDisabled(i)?null:i,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){var m;let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),s=this.weekdayLabels(),i=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,l=this.rangeEnd?this.parseISO(this.rangeEnd):null,u=this.previewEnd,f=o=>!this.range||!n||l||!u?!1:a.isBetweenInclusive(o,n,u),b=this.getTabTargetDayForCurrentView(t);return V`<div part="datepicker" class="${$("w-[284px] z-50 bg-white py-3 px-4",this.open?"block":"hidden",(m=this.currentPlacement)!=null&&m.startsWith("bottom")?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default","border-primary")}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-6-7-0-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-6-7-0-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-6-7-0-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-6-7-0-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-6-7-0-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-6-7-0-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-6-7-0-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-6-7-0-icon></button></div></div><sd-6-7-0-divider></sd-6-7-0-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${s.map((o,c)=>V`<div role="columnheader" aria-colindex="${c+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${o}" title="${o}" id="${"col-"+(c+1)}">${o}</div>`)}</div>${t.map((o,c)=>V`<div class="grid-row grid grid-cols-7 ${c===0?"mt-2":""}" role="row" aria-rowindex="${c+2}">${o.map((d,p)=>{let I=d.getMonth()===this.viewMonth.getMonth(),S=this.isDisabled(d)||!this.inMinMax(d),w=a.isSameDay(d,this.focusedDate),D=a.isSameDay(d,this.today),O=!this.range&&i?a.isSameDay(d,i):!1,g=this.range&&n?a.isSameDay(d,n):!1,v=this.range&&l?a.isSameDay(d,l):!1,M=this.range&&n&&l?a.isBetweenInclusive(d,n,l):!1,A=f(d)&&!S,F=-1,T=b&&a.isSameDay(d,b);(this.tabbingIntoGrid&&T||!this.tabbingIntoGrid&&w)&&(F=0);let P=this.isWeekend(d),L=d.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),C=g?this.localize.term("startDateSelected"):v?this.localize.term("endDateSelected"):void 0;return V`<button type="button" part="day" class="${$("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",g||v?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",I?this.isInDisabledDates(d)||!this.inMinMax(d)?"out-month text-neutral-500":this.disabledWeekends&&P?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&P?"out-month weekend-day text-neutral-500":P?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",O?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",g?"bg-primary text-white rounded-l-md rounded-r-none":"",v?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",M&&!g&&!v?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!M&&A&&!g&&!v?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",D&&!O&&!g&&!v&&w?"today border-[1px] border-primary font-bold":"",S?"disabled cursor-not-allowed hover:bg-transparent":"cursor-pointer",w&&!D?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${p+1}" aria-labelledby="${"col-"+(p+1)}" .tabIndex="${F}" ?disabled="${S||this.disabled||this.readonly}" aria-disabled="${S||this.visuallyDisabled||this.disabled||this.readonly?"true":"false"}" aria-selected="${O||M||g||v?"true":"false"}" aria-current="${D?"date":q}" aria-label="${L}" aria-roledescription="${C!=null?C:q}" @focus="${()=>this.focusedDate=a.startOfDayLocal(d)}" @mouseenter="${()=>this.onDayMouseEnter(d)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=a.startOfDayLocal(d),this.selectDate(d)}}">${d.getDate()}</button>`})}</div>`)}</div></div>`}render(){var d,p;let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,s=this.helpText?!0:!!t.helpText,i=!!t.tooltip,n=this.value!==null&&String(this.value).length>0||this.range&&this.rangeStart!==null||this.rangeEnd!==null,l=this.floatingLabel&&e&&(this.hasFocus||this.open||n)&&!this.disabled&&!this.visuallyDisabled,u=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],m=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",o={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[m],c=this.size==="sm"?"text-sm":"text-base";return V`<div part="form-control" class="${$("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e&&!this.floatingLabel||i?V`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${$(e?"inline-block form-control-color-text":"hidden",c)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?V`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${$("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}">${e&&this.floatingLabel?V`<label id="label" part="form-control-floating-label" class="${$("absolute left-4 z-20 pointer-events-none transition-all duration-200",l?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2",l&&"mt-1")}" for="input"><span class="${$("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",l&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}<div part="border" class="${$("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",o,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"",this.open&&((d=this.currentPlacement)!=null&&d.startsWith("bottom")?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-6-7-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${$("inline-flex relative w-full",(p=this.currentPlacement)!=null&&p.startsWith("bottom")?"origin-top":"origin-bottom")}" placement="${this.alignment==="left"?`${this.placement}-start`:`${this.placement}-end`}" flip shift auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${$("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",m==="disabled"||m==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${s?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${$("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer form-control-color-text",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],c,this.floatingLabel&&"mt-4")}" autocomplete="off" spellcheck="false" placeholder="${!this.floatingLabel||l?this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder"):""}" ?disabled="${this.disabled}" ?required="${this.required}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?V`<sd-6-7-0-icon part="invalid-icon" class="${$("text-error",f,b)}" library="_internal" name="risk"></sd-6-7-0-icon>`:""} ${this.showValidStyle&&this.styleOnValid?V`<sd-6-7-0-icon class="${$("text-success flex-shrink-0",f,b)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-6-7-0-icon>`:""}<sd-6-7-0-icon class="${$(u,f,b,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-6-7-0-icon></div>${this.renderCalendar()}</sd-6-7-0-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${$("text-sm text-neutral-700 mt-1",s?"block":"hidden")}" aria-hidden="${!s}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};r.styles=[...H.styles,W`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
-
:host{position:relative;display:inline-block;width:100%;--tw-outline-style:none;outline-style:none}:host([required]) #label::after{content:' *'}:host([visually-disabled]) input{caret-color:transparent}`],h([y({type:String,reflect:!0})],r.prototype,"locale",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"value",2),h([y({type:Boolean,reflect:!0})],r.prototype,"range",2),h([y({attribute:"range-start",converter:B,reflect:!0})],r.prototype,"rangeStart",2),h([y({attribute:"range-end",converter:B,reflect:!0})],r.prototype,"rangeEnd",2),h([y({type:Boolean})],r.prototype,"allowSameDayRange",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"min",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"max",2),h([y({type:Number})],r.prototype,"firstDayOfWeek",2),h([y({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],r.prototype,"disabledWeekends",2),h([y({attribute:"disabled-dates",converter:_})],r.prototype,"disabledDates",2),h([y({attribute:!1})],r.prototype,"isDateDisabled",2),h([y({type:String,reflect:!0})],r.prototype,"size",2),h([y({type:String})],r.prototype,"alignment",2),h([y({type:String,reflect:!0})],r.prototype,"label",2),h([y({type:String,attribute:"help-text",reflect:!0})],r.prototype,"helpText",2),h([y({attribute:"floating-label",type:Boolean,reflect:!0})],r.prototype,"floatingLabel",2),h([y({type:Boolean,reflect:!0})],r.prototype,"disabled",2),h([y({type:Boolean,reflect:!0})],r.prototype,"required",2),h([y({type:Boolean,attribute:"visually-disabled"})],r.prototype,"visuallyDisabled",2),h([y({type:Boolean,reflect:!0,attribute:"style-on-valid"})],r.prototype,"styleOnValid",2),h([y({type:Boolean,reflect:!0})],r.prototype,"readonly",2),h([y({type:String,reflect:!0})],r.prototype,"placement",2),h([y({type:String,reflect:!0})],r.prototype,"placeholder",2),h([y({reflect:!0})],r.prototype,"name",2),h([y({type:String,reflect:!0})],r.prototype,"form",2),h([x()],r.prototype,"open",2),h([x()],r.prototype,"viewMonth",2),h([x()],r.prototype,"focusedDate",2),h([x()],r.prototype,"today",2),h([x()],r.prototype,"disabledDatesSet",2),h([x()],r.prototype,"previewEnd",2),h([x()],r.prototype,"statusNavText",2),h([x()],r.prototype,"statusSelectText",2),h([x()],r.prototype,"hasFocus",2),h([x()],r.prototype,"showValidStyle",2),h([x()],r.prototype,"showInvalidStyle",2),h([x()],r.prototype,"currentPlacement",2),h([x()],r.prototype,"inputValue",2),h([R("sd-6-7-
|
|
1
|
+
import{a}from"./chunk.3MADQ6HK.js";import{b as K}from"./chunk.CJ34NUTS.js";import{a as G}from"./chunk.CGQ2BPPZ.js";import{a as U}from"./chunk.IQPMMUES.js";import{a as $}from"./chunk.YFQFOIEM.js";import{a as k}from"./chunk.NYKJXI3Q.js";import{a as N,b as y,c as x,d as R,h as H}from"./chunk.CMXQRUFT.js";import{b as W,e as V,i as q}from"./chunk.763RLJEK.js";import{e as h}from"./chunk.6EV4YU6C.js";var B={fromAttribute(E){if(!E)return null;let t=E.trim().replace(/[./]/g,"-").match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return null;let e=`${t[1]}-${t[2]}-${t[3]}`,s=new Date(+t[1],+t[2]-1,+t[3]);return s.getFullYear()!==+t[1]||s.getMonth()!==+t[2]-1||s.getDate()!==+t[3]?null:e},toAttribute(E){return E!=null?E:""}},_={fromAttribute(E){if(!E)return[];let Y=[],t=E.trim();if(t.startsWith("["))try{let s=JSON.parse(t);Array.isArray(s)&&(Y=s.map(String))}catch(s){return[]}else Y=t.split(/[\s,]+/).map(s=>s.trim()).filter(Boolean);let e=[];for(let s of Y){let n=s.replace(/[-/]/g,".").split(".");if(n.length!==3)continue;let[l,u,f]=n.map(Number);if(!l||!u||!f)continue;let b=new Date(l,u-1,f);if(b.getFullYear()!==l||b.getMonth()!==u-1||b.getDate()!==f)continue;let m=`${l}-${String(u).padStart(2,"0")}-${String(f).padStart(2,"0")}`;e.push(m)}return e},toAttribute(E){return E?E.join(","):""}},r=class extends H{constructor(){super();this.localize=new U(this);this.hasSlotController=new G(this,"label","help-text","tooltip");this.formControlController=new K(this,{assumeInteractionOn:["sd-blur","sd-6-7-1-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.floatingLabel=!1;this.disabled=!1;this.required=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=a.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(i=>{var n,l;return i instanceof HTMLElement&&(((n=i.classList)==null?void 0:n.contains("nav"))||((l=i.classList)==null?void 0:l.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var l,u,f,b,m;if(this.disabled||this.visuallyDisabled||this.readonly){(l=t.preventDefault)==null||l.call(t),(u=t.stopPropagation)==null||u.call(t);return}let e=t.target,s=e.value,i=(f=e.selectionStart)!=null?f:s.length,n=(b=t.inputType)==null?void 0:b.startsWith("delete");if(this.range){let o=s.replace(/\D/g,""),c=o.slice(0,8),d=o.slice(8,16),p=this.buildDmyFromDigits(c),I=this.buildDmyFromDigits(d),S;c.length===0?S="":c.length<8?S=p:d.length>0?S=`${p} - ${I}`:S=n?p:`${p} -`;let w=this.countDigitsBeforeCaret(s,i),D;if(w<=8){let g=this.digitIndexToDmyCaretPos(Math.min(w,8));D=Math.min(g,p.length)}else{let g=c.length<8?p.length:p.length+3,v=Math.min(w-8,8),M=this.digitIndexToDmyCaretPos(v);D=g+Math.min(M,I.length)}this.inputValue=S;let O=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(p)){let g=this.dmyToIso(p),v=g?a.parseLocalISO(g):null;!!v&&!this.isDisabled(v)&&this.inMinMax(v)&&this.rangeStart!==g&&(this.rangeStart=g,this.previewEnd=null,this.viewMonth=new Date(v.getFullYear(),v.getMonth(),1),this.focusedDate=a.startOfDayLocal(v),O=!0)}else this.rangeStart&&(this.rangeStart=null,O=!0),this.rangeEnd&&(this.rangeEnd=null,O=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(I)&&this.rangeStart){let g=a.parseLocalISO(this.rangeStart),v=this.dmyToIso(I),M=v?a.parseLocalISO(v):null;if(!!M&&!this.isDisabled(M)&&this.inMinMax(M)){let[F,T]=a.compareDates(g,M)<=0?[g,M]:[M,g],P=a.isSameDay(F,T);if((this.allowSameDayRange||!P)&&!this.wouldRangeContainDisabled(F,T)){let C=a.toLocalISODate(a.startOfDayLocal(F)),z=a.toLocalISODate(a.startOfDayLocal(T));(this.rangeStart!==C||this.rangeEnd!==z)&&(this.rangeStart=C,this.rangeEnd=z,this.viewMonth=new Date(T.getFullYear(),T.getMonth(),1),this.focusedDate=a.startOfDayLocal(T),O=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,O=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),O&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var v;let g=(v=this.input)!=null?v:e;g&&(g.value=this.inputValue,g.setSelectionRange(D,D))})})}else{let o=e,c=o.value,d=(m=o.selectionStart)!=null?m:c.length,p=c.replace(/\D/g,"").slice(0,8),I=p.slice(0,2),S=p.slice(2,4),w=p.slice(4,8),D="";I.length>0&&(D+=I,I.length===2&&(D+=".")),S.length>0&&I.length===2&&(D+=S,S.length===2&&(D+=".")),w.length>0&&I.length===2&&S.length===2&&(D+=w),D=D.replace(/\.\.+/g,".");let O=this.inputValue||"";this.inputValue=D;let g=d,v=L=>{let C=[];for(let z=0;z<L.length;z++)L[z]==="."&&C.push(z);return C},M=v(O),A=v(D),F=M.filter(L=>L<d).length,P=A.filter(L=>L<d).length-F;if(P>0?g+=P:!M.includes(d)&&A.includes(d)&&(g+=1),g=Math.min(Math.max(0,g),D.length),requestAnimationFrame(()=>{var C;let L=(C=this.input)!=null?C:o;L&&(L.value=this.inputValue,L.setSelectionRange(g,g))}),/^\d{2}\.\d{2}\.\d{4}$/.test(D)){let L=this.parseInputText(D);this.applyParsedInput(L)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let o=this.rangeStart?a.parseLocalISO(this.rangeStart):null,c=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;o&&!c?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(o)}`):o&&c&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(o)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(c)}`)}else if(this.value){let o=a.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(o)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{let e=t.detail;e&&(this.currentPlacement=e)};this.handleHeaderKeyDown=(t,e,s,i)=>{if(!(this.disabled||this.visuallyDisabled||this.readonly)){if(t.key==="Tab"&&!t.shiftKey){i&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(s):this.setYear(s))}};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled||this.readonly){t.preventDefault(),t.stopPropagation();return}let e=t.key,s=!0,i=new Date(this.focusedDate);switch(e){case"ArrowLeft":i.setDate(i.getDate()-1);break;case"ArrowRight":i.setDate(i.getDate()+1);break;case"ArrowUp":i.setDate(i.getDate()-7);break;case"ArrowDown":i.setDate(i.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:s=!1}if(s){if(t.preventDefault(),i.getMonth()!==this.viewMonth.getMonth()||i.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(i.getFullYear(),i.getMonth(),1);let f=this.formatMonthYear(this.viewMonth);this.setNavStatus(f)}let l=a.startOfDayLocal(i);(!this.focusedDate||l.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=l);let u=l.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(u),this.requestUpdate(),requestAnimationFrame(()=>{let f=this.shadowRoot,b=f==null?void 0:f.querySelector("button.day.focused");b==null||b.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled||this.readonly)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&!this.readonly&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?a.parseLocalISO(this.value):null,e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.range&&e?e:t!=null?t:a.startOfDayLocal(new Date);this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.clampDateToMonth(s,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}handleOpenChange(){this.popup&&(this.popup.active=this.open&&!this.disabled&&!this.visuallyDisabled)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?a.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=a.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var s;let e=this.input;if(e){e.value=(s=this.inputValue)!=null?s:"";let i=e.value.length;e.setSelectionRange(i,i)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?a.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null,s=t!=null?t:e;s&&(this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.startOfDayLocal(s)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let i=this.input;if(i){i.value=(n=this.inputValue)!=null?n:"";let l=i.value.length;i.setSelectionRange(l,l)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}handleSizeChange(){this.size=this.floatingLabel&&this.size==="sm"?"md":this.size}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return a.parseLocalISO(t)}inMinMax(t){let e=this.min===null?null:this.parseISO(String(this.min)),s=this.max===null?null:this.parseISO(String(this.max));return!(e&&t<e||s&&t>s)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),n=`${e}-${s}-${i}`;return this.disabledDatesSet.has(n)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let s="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+s},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),s=this.ordinal(e),i=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${s} of ${i} ${n}`}ordinal(t){let e=["th","st","nd","rd"],s=t%100,i=e[(s-20)%10]||e[s]||e[0];return t+i}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let s=JSON.parse(e);Array.isArray(s)&&(t=s)}catch(s){t=[]}else e.length>0&&(t=e.split(",").map(s=>s.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let s=a.compareDates(t,e)<=0?a.startOfDayLocal(t):a.startOfDayLocal(e),i=a.compareDates(t,e)<=0?a.startOfDayLocal(e):a.startOfDayLocal(t),n=new Date(s);for(;a.compareDates(n,i)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=a.parseLocalISO(t);if(e||(e=a.parseLocalISO(t.replace(/-/g,"."))),!e)return"";let s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${s}.${i}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let s=Number(e[1]),i=Number(e[2]),n=Number(e[3]),l=new Date(n,i-1,s);if(l.getFullYear()!==n||l.getMonth()!==i-1||l.getDate()!==s)return null;let u=a.startOfDayLocal(l);return a.toLocalISODate(u)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),i=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),l=this.isoToDmy(this.rangeEnd);return n&&l?`${n} ${i} ${l}`:n&&!l?`${n} ${i}`:""}parseInputText(t){var i,n;let e=t.trim();if(this.range){let l=e.split(/\s*-\s*/);if(l.length===1){let u=l[0];if(!u)return{start:null,end:null,valid:!0};let f=this.dmyToIso(u);return f?{start:f,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(l.length>=2){let u=(i=l[0])!=null?i:"",f=(n=l[1])!=null?n:"",b=u?this.dmyToIso(u):null,m=f?this.dmyToIso(f):null;return u&&!b?{start:null,end:null,valid:!1}:f&&!m?{start:null,end:null,valid:!1}:{start:b,end:m,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let s=this.dmyToIso(e);return s?{single:s,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var u,f,b,m;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=o=>{if(!o)return!0;let c=a.parseLocalISO(o);return!(!this.inMinMax(c)||this.isDisabled(c))},s=!1;if(this.range){let o=(u=t.start)!=null?u:null,c=(f=t.end)!=null?f:null;if(!e(o)||c&&!e(c))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let d=o?a.parseLocalISO(o):null,p=c?a.parseLocalISO(c):null;if(d&&p){if(a.compareDates(d,p)>0){let w=d;d=p,p=w}if(!this.allowSameDayRange&&a.isSameDay(d,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(d,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let I=d?a.toLocalISODate(a.startOfDayLocal(d)):null,S=p?a.toLocalISODate(a.startOfDayLocal(p)):null;if(this.rangeStart!==I||this.rangeEnd!==S){this.rangeStart=I,this.rangeEnd=S,this.previewEnd=null,s=!0;let w=(b=d!=null?d:p)!=null?b:this.today;this.viewMonth=new Date(w.getFullYear(),w.getMonth(),1),this.focusedDate=a.startOfDayLocal(w),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let i=(m=t.single)!=null?m:null;if(!e(i))return this.input.setCustomValidity(this.localize.term("datePickerRange")),this.formControlController.setValidity(!1),this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=i?a.parseLocalISO(i):null,l=n?a.toLocalISODate(a.startOfDayLocal(n)):null;return this.value!==l&&(this.value=l,s=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=a.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),s}buildDmyFromDigits(t){let e=t.slice(0,8),s=e.slice(0,2),i=e.slice(2,4),n=e.slice(4,8),l=s;return i.length&&(l+="."+i),n.length&&(l+="."+n),l}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var s,i;((i=(s=t.composedPath)==null?void 0:s.call(t))!=null?i:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled||this.readonly){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled||this.readonly){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&!this.readonly&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let s=a.parseLocalISO(this.value);s&&(t=a.startOfDayLocal(s))}if(this.range){let s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;i?t=a.startOfDayLocal(i):s&&(t=a.startOfDayLocal(s))}if(!(s=>s?s.getFullYear()===this.viewMonth.getFullYear()&&s.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(s):!1)(t)){let{weeks:s}=this.getMonthMatrix(this.viewMonth),i=s.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(n,this.today)&&!this.isDisabled(n));if(i)t=a.startOfDayLocal(i);else{let n=s.flat().find(l=>l.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(l));t=n?a.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let s=this.shadowRoot,i=(s==null?void 0:s.querySelector("button.day.selected"))||(s==null?void 0:s.querySelector("button.day.focused"))||(s==null?void 0:s.querySelector('button.day[tabindex="0"]'))||(s==null?void 0:s.querySelector("button.day"));i==null||i.focus({preventScroll:!0})})}selectSingleDate(t){if(this.readonly||this.isDisabled(t))return;let e=a.startOfDayLocal(t),s=a.toLocalISODate(e);if(this.value===s)return;this.value=s;let i=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(i),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var l;let n=this.input;n&&(n.value=(l=this.inputValue)!=null?l:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let u=n.value.length;n.setSelectionRange(u,u)})}))})}selectRangeDate(t){if(this.readonly)return;let e=a.startOfDayLocal(t),s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(!s&&!i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))});return}if(s&&!i){if(this.isDisabled(e))return;if(a.isSameDay(s,e)){if(!this.allowSameDayRange){this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let o=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${o}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var d;let c=this.input;c&&(c.value=(d=this.inputValue)!=null?d:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=c.value.length;c.setSelectionRange(p,p)})}))});return}this.rangeStart=a.toLocalISODate(e),this.rangeEnd=a.toLocalISODate(e),this.previewEnd=null;let m=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${m}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let o=this.input;o&&(o.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let d=o.value.length;o.setSelectionRange(d,d)})}))});return}let n=a.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[l,u]=a.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=a.toLocalISODate(l),this.rangeEnd=a.toLocalISODate(u),this.previewEnd=null;let f=this.formatSelectionLabel(l),b=this.formatSelectionLabel(u);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${b}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var o;let m=this.input;m&&(m.value=(o=this.inputValue)!=null?o:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let c=m.value.length;m.setSelectionRange(c,c)})}))});return}if(s&&i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))})}}selectDate(t){this.readonly||(this.range?this.selectRangeDate(t):this.selectSingleDate(t))}getMonthMatrix(t){var b;let e=(b=this.firstDayOfWeek)!=null?b:1,s=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(s),n=(s.getDay()-e+7)%7;i.setDate(s.getDate()-n);let l=[],u=i;for(let m=0;m<6;m++){let o=[];for(let c=0;c<7;c++)o.push(new Date(u)),u.setDate(u.getDate()+1);l.push(o)}let f=m=>m.every(o=>o.getMonth()!==t.getMonth());for(;l.length>0&&f(l[l.length-1]);)l.pop();return{weeks:l}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var i;let t=(i=this.firstDayOfWeek)!=null?i:1,e=new Date(2021,7,1),s=[];for(let n=0;n<7;n++){let l=new Date(e);l.setDate(e.getDate()+(t+n)%7);try{s.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(l))}catch(u){s.push(l.toLocaleDateString(void 0,{weekday:"short"}))}}return s}getTabTargetDayForCurrentView(t){let e=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(i,this.today)&&!this.isDisabled(i));if(e)return a.startOfDayLocal(e);let s=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(i));return s?a.startOfDayLocal(s):null}onDayMouseEnter(t){if(!this.range||this.readonly)return;let e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(e&&!s){let i=a.startOfDayLocal(t);this.previewEnd=this.isDisabled(i)?null:i,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){var m;let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),s=this.weekdayLabels(),i=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,l=this.rangeEnd?this.parseISO(this.rangeEnd):null,u=this.previewEnd,f=o=>!this.range||!n||l||!u?!1:a.isBetweenInclusive(o,n,u),b=this.getTabTargetDayForCurrentView(t);return V`<div part="datepicker" class="${$("w-[284px] z-50 bg-white py-3 px-4",this.open?"block":"hidden",(m=this.currentPlacement)!=null&&m.startsWith("bottom")?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default","border-primary")}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-6-7-1-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-6-7-1-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-6-7-1-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-6-7-1-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-6-7-1-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-6-7-1-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${o=>this.handleHeaderKeyDown(o,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-6-7-1-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-6-7-1-icon></button></div></div><sd-6-7-1-divider></sd-6-7-1-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${s.map((o,c)=>V`<div role="columnheader" aria-colindex="${c+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${o}" title="${o}" id="${"col-"+(c+1)}">${o}</div>`)}</div>${t.map((o,c)=>V`<div class="grid-row grid grid-cols-7 ${c===0?"mt-2":""}" role="row" aria-rowindex="${c+2}">${o.map((d,p)=>{let I=d.getMonth()===this.viewMonth.getMonth(),S=this.isDisabled(d)||!this.inMinMax(d),w=a.isSameDay(d,this.focusedDate),D=a.isSameDay(d,this.today),O=!this.range&&i?a.isSameDay(d,i):!1,g=this.range&&n?a.isSameDay(d,n):!1,v=this.range&&l?a.isSameDay(d,l):!1,M=this.range&&n&&l?a.isBetweenInclusive(d,n,l):!1,A=f(d)&&!S,F=-1,T=b&&a.isSameDay(d,b);(this.tabbingIntoGrid&&T||!this.tabbingIntoGrid&&w)&&(F=0);let P=this.isWeekend(d),L=d.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),C=g?this.localize.term("startDateSelected"):v?this.localize.term("endDateSelected"):void 0;return V`<button type="button" part="day" class="${$("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",g||v?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",I?this.isInDisabledDates(d)||!this.inMinMax(d)?"out-month text-neutral-500":this.disabledWeekends&&P?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&P?"out-month weekend-day text-neutral-500":P?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",O?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",g?"bg-primary text-white rounded-l-md rounded-r-none":"",v?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",M&&!g&&!v?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!M&&A&&!g&&!v?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",D&&!O&&!g&&!v&&w?"today border-[1px] border-primary font-bold":"",S?"disabled cursor-not-allowed hover:bg-transparent":"cursor-pointer",w&&!D?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${p+1}" aria-labelledby="${"col-"+(p+1)}" .tabIndex="${F}" ?disabled="${S||this.disabled||this.readonly}" aria-disabled="${S||this.visuallyDisabled||this.disabled||this.readonly?"true":"false"}" aria-selected="${O||M||g||v?"true":"false"}" aria-current="${D?"date":q}" aria-label="${L}" aria-roledescription="${C!=null?C:q}" @focus="${()=>this.focusedDate=a.startOfDayLocal(d)}" @mouseenter="${()=>this.onDayMouseEnter(d)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=a.startOfDayLocal(d),this.selectDate(d)}}">${d.getDate()}</button>`})}</div>`)}</div></div>`}render(){var d,p;let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,s=this.helpText?!0:!!t.helpText,i=!!t.tooltip,n=this.value!==null&&String(this.value).length>0||this.range&&this.rangeStart!==null||this.rangeEnd!==null,l=this.floatingLabel&&e&&(this.hasFocus||this.open||n)&&!this.disabled&&!this.visuallyDisabled,u=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],m=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",o={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[m],c=this.size==="sm"?"text-sm":"text-base";return V`<div part="form-control" class="${$("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e&&!this.floatingLabel||i?V`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${$(e?"inline-block form-control-color-text":"hidden",c)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?V`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${$("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}">${e&&this.floatingLabel?V`<label id="label" part="form-control-floating-label" class="${$("absolute left-4 z-20 pointer-events-none transition-all duration-200",l?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2",l&&"mt-1")}" for="input"><span class="${$("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",l&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}<div part="border" class="${$("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",o,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"",this.open&&((d=this.currentPlacement)!=null&&d.startsWith("bottom")?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-6-7-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${$("inline-flex relative w-full",(p=this.currentPlacement)!=null&&p.startsWith("bottom")?"origin-top":"origin-bottom")}" placement="${this.alignment==="left"?`${this.placement}-start`:`${this.placement}-end`}" flip shift auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${$("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",m==="disabled"||m==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${s?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${$("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer form-control-color-text",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],c,this.floatingLabel&&"mt-4")}" autocomplete="off" spellcheck="false" placeholder="${!this.floatingLabel||l?this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder"):""}" ?disabled="${this.disabled}" ?required="${this.required}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?V`<sd-6-7-1-icon part="invalid-icon" class="${$("text-error",f,b)}" library="_internal" name="risk"></sd-6-7-1-icon>`:""} ${this.showValidStyle&&this.styleOnValid?V`<sd-6-7-1-icon class="${$("text-success flex-shrink-0",f,b)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-6-7-1-icon>`:""}<sd-6-7-1-icon class="${$(u,f,b,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-6-7-1-icon></div>${this.renderCalendar()}</sd-6-7-1-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${$("text-sm text-neutral-700 mt-1",s?"block":"hidden")}" aria-hidden="${!s}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};r.styles=[...H.styles,W`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{position:relative;display:inline-block;width:100%;--tw-outline-style:none;outline-style:none}:host([required]) #label::after{content:' *'}:host([visually-disabled]) input{caret-color:transparent}`],h([y({type:String,reflect:!0})],r.prototype,"locale",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"value",2),h([y({type:Boolean,reflect:!0})],r.prototype,"range",2),h([y({attribute:"range-start",converter:B,reflect:!0})],r.prototype,"rangeStart",2),h([y({attribute:"range-end",converter:B,reflect:!0})],r.prototype,"rangeEnd",2),h([y({type:Boolean})],r.prototype,"allowSameDayRange",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"min",2),h([y({type:String,converter:B,reflect:!0})],r.prototype,"max",2),h([y({type:Number})],r.prototype,"firstDayOfWeek",2),h([y({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],r.prototype,"disabledWeekends",2),h([y({attribute:"disabled-dates",converter:_})],r.prototype,"disabledDates",2),h([y({attribute:!1})],r.prototype,"isDateDisabled",2),h([y({type:String,reflect:!0})],r.prototype,"size",2),h([y({type:String})],r.prototype,"alignment",2),h([y({type:String,reflect:!0})],r.prototype,"label",2),h([y({type:String,attribute:"help-text",reflect:!0})],r.prototype,"helpText",2),h([y({attribute:"floating-label",type:Boolean,reflect:!0})],r.prototype,"floatingLabel",2),h([y({type:Boolean,reflect:!0})],r.prototype,"disabled",2),h([y({type:Boolean,reflect:!0})],r.prototype,"required",2),h([y({type:Boolean,attribute:"visually-disabled"})],r.prototype,"visuallyDisabled",2),h([y({type:Boolean,reflect:!0,attribute:"style-on-valid"})],r.prototype,"styleOnValid",2),h([y({type:Boolean,reflect:!0})],r.prototype,"readonly",2),h([y({type:String,reflect:!0})],r.prototype,"placement",2),h([y({type:String,reflect:!0})],r.prototype,"placeholder",2),h([y({reflect:!0})],r.prototype,"name",2),h([y({type:String,reflect:!0})],r.prototype,"form",2),h([x()],r.prototype,"open",2),h([x()],r.prototype,"viewMonth",2),h([x()],r.prototype,"focusedDate",2),h([x()],r.prototype,"today",2),h([x()],r.prototype,"disabledDatesSet",2),h([x()],r.prototype,"previewEnd",2),h([x()],r.prototype,"statusNavText",2),h([x()],r.prototype,"statusSelectText",2),h([x()],r.prototype,"hasFocus",2),h([x()],r.prototype,"showValidStyle",2),h([x()],r.prototype,"showInvalidStyle",2),h([x()],r.prototype,"currentPlacement",2),h([x()],r.prototype,"inputValue",2),h([R("sd-6-7-1-popup")],r.prototype,"popup",2),h([R("#invalid-message")],r.prototype,"invalidMessage",2),h([R("#input")],r.prototype,"input",2),h([k("open",{waitUntilFirstUpdate:!0})],r.prototype,"handleOpenChange",1),h([k("locale")],r.prototype,"handleLocaleChange",1),h([k("disabledDates")],r.prototype,"handleDisabledDatesChange",1),h([k("value")],r.prototype,"handleValueChange",1),h([k("rangeStart"),k("rangeEnd")],r.prototype,"handleRangeChange",1),h([k(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],r.prototype,"handleDisabledChange",1),h([k(["size","floatingLabel"])],r.prototype,"handleSizeChange",1),r=h([N("sd-6-7-1-datepicker")],r);export{r as a};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as F}from"./chunk.N3WG3NAL.js";import{c as A}from"./chunk.3L472FD4.js";import{b as I}from"./chunk.CJ34NUTS.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as C,c as $}from"./chunk.B2NUKX6G.js";import{a as T}from"./chunk.KLRPP4NQ.js";import{a as L}from"./chunk.MP6XEXRW.js";import{a as z}from"./chunk.IQPMMUES.js";import{a as h}from"./chunk.YFQFOIEM.js";import{a as m}from"./chunk.NYKJXI3Q.js";import{a as D,b as r,c as u,d as c,g as k,h as O}from"./chunk.CMXQRUFT.js";import{b as E,e as p}from"./chunk.763RLJEK.js";import{b as x,e as w}from"./chunk.W4QBFD6E.js";import{e as s}from"./chunk.6EV4YU6C.js";var i=class extends O{constructor(){super(...arguments);this.formControlController=new I(this,{assumeInteractionOn:["sd-blur","sd-6-7-
|
|
1
|
+
import{a as F}from"./chunk.N3WG3NAL.js";import{c as A}from"./chunk.3L472FD4.js";import{b as I}from"./chunk.CJ34NUTS.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as C,c as $}from"./chunk.B2NUKX6G.js";import{a as T}from"./chunk.KLRPP4NQ.js";import{a as L}from"./chunk.MP6XEXRW.js";import{a as z}from"./chunk.IQPMMUES.js";import{a as h}from"./chunk.YFQFOIEM.js";import{a as m}from"./chunk.NYKJXI3Q.js";import{a as D,b as r,c as u,d as c,g as k,h as O}from"./chunk.CMXQRUFT.js";import{b as E,e as p}from"./chunk.763RLJEK.js";import{b as x,e as w}from"./chunk.W4QBFD6E.js";import{e as s}from"./chunk.6EV4YU6C.js";var i=class extends O{constructor(){super(...arguments);this.formControlController=new I(this,{assumeInteractionOn:["sd-blur","sd-6-7-1-input"]});this.hasSlotController=new M(this,"help-text","label");this.localize=new z(this);this.typeToSelectString="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.floatingLabel=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-6-7-1-tag class="relative z-10 min-w-0 max-w-full" ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
2
|
base:tag__base,
|
|
3
3
|
content:tag__content,
|
|
4
4
|
removable-indicator:tag__removable-indicator,
|
|
5
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-6-7-
|
|
5
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-6-7-1-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,o=e.closest(".select__clear")!==null,l=e.closest("sd-6-7-1-icon-button")!==null;if(!(o||l)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let d=this.getAllOptions(),n=d.indexOf(this.currentOption),a=Math.max(0,n);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(a=n+1,a>d.length-1&&(a=0)):t.key==="ArrowUp"?(a=n-1,a<0&&(a=d.length-1)):t.key==="Home"?a=0:t.key==="End"&&(a=d.length-1),this.setCurrentOption(d[a],t)}if(t.key.length===1||t.key==="Backspace"){let d=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let n of d)if(n.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(n);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var o,l,d;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let n=(o=t.currentTarget)==null?void 0:o.parentElement,a=(l=n==null?void 0:n.previousElementSibling)==null?void 0:l.querySelector("sd-6-7-1-tag"),f=(d=n==null?void 0:n.nextElementSibling)==null?void 0:d.querySelector("sd-6-7-1-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{f?f.focus():a?a.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var o;let e=(o=this.shadowRoot)==null?void 0:o.querySelectorAll("sd-6-7-1-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let o=t.composedPath().some(l=>l instanceof HTMLSlotElement&&l.name==="removable-indicator");this.disabled||o||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let o=t.target.closest("sd-6-7-1-option"),l=this.value;o&&!o.disabled&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==l&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],o=[];customElements.get("sd-6-7-1-option")?(t.forEach(l=>{this.multiple&&(l.checkbox=!0),o.push(l.value)}),this.setSelectedOptions(t.filter(l=>e.includes(l.value)))):customElements.whenDefined("sd-6-7-1-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-6-7-1-option")]}getFirstOption(){return this.querySelector("sd-6-7-1-option")}setCurrentOption(t,e){this.getAllOptions().forEach(l=>{l.current=!1,l.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(l.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(l=>l.selected=!1),o.length&&o.forEach(l=>l.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}get displayLabel(){var t,e;return this.multiple?this.useTags||this.value.length===0?"":this.localize.term("numOptionsSelected",this.selectedOptions.length):(e=(t=this.selectedOptions[0])==null?void 0:t.getTextLabel())!=null?e:""}selectionChanged(t){var e,o;t&&this.multiple?this.selectedOptions.find(l=>l.value===t.value)?this.selectedOptions=this.selectedOptions.filter(l=>l.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(l=>l.selected),this.multiple?this.value=this.selectedOptions.map(l=>l.value):this.value=(o=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?o:"",this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let o=this.getTag(t,e);return p`<div @sd-remove="${l=>this.handleTagRemove(l,t)}" class="max-w-full">${typeof o=="string"?L(o):o}</div>`}return[p``]}):[p`<sd-6-7-1-tag class="z-10 min-w-0 max-w-full" ?disabled="${this.disabled}" part="tag" exportparts="
|
|
6
6
|
base:tag__base,
|
|
7
7
|
content:tag__content,
|
|
8
8
|
removable-indicator:tag__removable-indicator,
|
|
9
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-6-7-
|
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-6-7-1-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-6-7-1-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await w(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=$(this,"select.show",{dir:this.localize.dir()});await x(this.popup.popup,t,e),this.currentOption&&A(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await w(this);let{keyframes:t,options:e}=$(this,"select.hide",{dir:this.localize.dir()});await x(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){let t=this.value,e=Array.isArray(t)?t:[t],o=this.selectedOptions.map(n=>n.value);if(e.length===o.length&&e.every(n=>o.includes(n)))return;let l=this.getAllOptions(),d=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(l.filter(n=>d.includes(n.value))),this.value=t}handleSizeChange(){this.size=this.floatingLabel&&this.size==="sm"?"md":this.size}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,T(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,T(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,o=this.helpText?!0:!!t.helpText,l=this.clearable&&!this.disabled,d=!!t.tooltip,n=this.value!==null&&String(this.value).length>0,a=this.floatingLabel&&e&&(this.hasFocus&&!this.visuallyDisabled||this.open||n)&&!(this.disabled&&!n),f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",b=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",v={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],g={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],V=this.size==="lg"?this.floatingLabel?a?"py-3":"py-4":"py-2":this.floatingLabel?a?"py-2":"py-3":"py-1";return p`<div part="form-control" class="${h("relative text-left",b,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e&&!this.floatingLabel||d?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block form-control-color-text"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${h("relative w-full bg-white",f==="disabled"?"text-neutral-500":"form-control-color-text")}">${e&&this.floatingLabel?p`<label id="label" part="form-control-floating-label" class="${h("absolute left-4 z-20 pointer-events-none transition-all duration-200",a?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2",a&&"mt-1")}" for="input"><span class="${h("leading-none",a&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}<div part="border" class="${h("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"form-control-color-border",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"form-control-color-border"}[f],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-6-7-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${h("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
10
10
|
popup:popup__content,
|
|
11
|
-
"><div class="${h("relative w-full h-full grid rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",["invalid","activeInvalid"].includes(f)&&"form-control--invalid-color-background")}" slot="anchor"><div class="${h("input-container items-center w-full h-full px-4 flex min-w-0",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size],V)}"><input name="${this.name}" form="${this.form}" part="display-input" class="${h("top-0 left-0 appearance-none outline-none flex-grow bg-transparent flex-1 placeholder:text-neutral-700 min-w-0",b,this.multiple&&this.useTags&&this.value.length>0?"hidden":"",this.size==="sm"?a?"h-4":"h-6":a?"h-6":"h-8",a&&"leading-none mt-4")}" type="text" .disabled="${this.disabled}" placeholder="${!this.floatingLabel||a?this.placeholder||this.localize.term("selectDefaultPlaceholder"):""}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags&&this.tags&&this.tags.length>0?p`<div part="tags" class="${h("flex-grow flex flex-wrap items-center gap-1 min-w-0",this.floatingLabel&&"pt-4")}">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(y=>y==null?void 0:y.getTextLabel()).join(", ")}</div><input class="${h("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",b)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?p`<button part="clear-button" class="${h("select__clear flex justify-center",v,this.value.length>0?"visible":"hidden")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-6-7-
|
|
12
|
-
:host{position:relative;display:block;width:auto}:host([required]) #label::after{content:' *'}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{color:rgba(var(--sd-color-text-neutral-500))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{color:rgba(var(--sd-color-text-neutral-500))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-6-7-
|
|
11
|
+
"><div class="${h("relative w-full h-full grid rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",["invalid","activeInvalid"].includes(f)&&"form-control--invalid-color-background")}" slot="anchor"><div class="${h("input-container items-center w-full h-full px-4 flex min-w-0",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size],V)}"><input name="${this.name}" form="${this.form}" part="display-input" class="${h("top-0 left-0 appearance-none outline-none flex-grow bg-transparent flex-1 placeholder:text-neutral-700 min-w-0",b,this.multiple&&this.useTags&&this.value.length>0?"hidden":"",this.size==="sm"?a?"h-4":"h-6":a?"h-6":"h-8",a&&"leading-none mt-4")}" type="text" .disabled="${this.disabled}" placeholder="${!this.floatingLabel||a?this.placeholder||this.localize.term("selectDefaultPlaceholder"):""}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags&&this.tags&&this.tags.length>0?p`<div part="tags" class="${h("flex-grow flex flex-wrap items-center gap-1 min-w-0",this.floatingLabel&&"pt-4")}">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(y=>y==null?void 0:y.getTextLabel()).join(", ")}</div><input class="${h("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",b)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?p`<button part="clear-button" class="${h("select__clear flex justify-center",v,this.value.length>0?"visible":"hidden")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-6-7-1-icon class="${h("text-neutral-700 z-10",g)}" library="_internal" name="closing-round"></sd-6-7-1-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-6-7-1-icon part="invalid-icon" class="${h(v,g,"text-error")}" library="_internal" name="risk"></sd-6-7-1-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-6-7-1-icon part="valid-icon" class="${h("flex-shrink-0 text-success",v,g)}" library="_internal" name="confirm-circle"></sd-6-7-1-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${h("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",g)}"><sd-6-7-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-6-7-1-icon></slot></div><button part="combobox" class="${h("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",b,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${h("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-6-7-1-popup></div><div class="text-sm text-neutral-700 mt-1" part="form-control-help-text" id="help-text" aria-hidden="${o?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage(this.size)}`}};i.styles=[...O.styles,E`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
12
|
+
:host{position:relative;display:block;width:auto}:host([required]) #label::after{content:' *'}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{color:rgba(var(--sd-color-text-neutral-500))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{color:rgba(var(--sd-color-text-neutral-500))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-6-7-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-6-7-1-tag::part(base){border-radius:var(--sd-radius);padding-inline:var(--sd-spacing-1)}sd-6-7-1-tag::part(content){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:var(--tag-max-width,15ch)}sd-6-7-1-tag[size=lg]::part(base){padding-inline:var(--sd-spacing-2)}sd-6-7-1-tag[disabled=false]::part(base):hover{background-color:rgba(var(--sd-color-background-primary-100))}`],s([k({selector:"sd-6-7-1-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-6-7-1-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([F()],i.prototype,"defaultValue",2),s([r({type:Boolean,reflect:!0})],i.prototype,"open",2),s([r({type:String,reflect:!0})],i.prototype,"size",2),s([r({type:String,reflect:!0})],i.prototype,"placement",2),s([r({type:String,reflect:!0})],i.prototype,"label",2),s([r({type:String,reflect:!0})],i.prototype,"placeholder",2),s([r({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([r({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([r({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([r({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([r({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([r({reflect:!0})],i.prototype,"form",2),s([r({reflect:!0})],i.prototype,"name",2),s([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([r({type:Boolean,reflect:!0})],i.prototype,"required",2),s([r({attribute:"floating-label",type:Boolean,reflect:!0})],i.prototype,"floatingLabel",2),s([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([r({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([r()],i.prototype,"getTag",2),s([m("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([m(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([m("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([m("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([m("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),s([m(["size","floatingLabel"])],i.prototype,"handleSizeChange",1),i=s([D("sd-6-7-1-select")],i);C("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});C("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk.YFQFOIEM.js";import{a,b as r,h as s}from"./chunk.CMXQRUFT.js";import{b as n,e as d}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends s{constructor(){super(...arguments);this.size="lg";this.variant="blue";this.inverted=!1}render(){return d`<span part="base" aria-labelledby="content" class="${i("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{blue:this.inverted?"sd-6-7-
|
|
2
|
-
:host{display:inline-flex;align-items:center;justify-content:center}:host([size=md]){height:var(--sd-spacing-4);min-width:var(--sd-spacing-4);font-size:.625rem}:host([size=lg]){height:calc(var(--sd-spacing-1) * 5);min-width:calc(var(--sd-spacing-1) * 5);font-size:.75rem}:host([size=sm])::part(base){height:var(--sd-spacing-2);min-width:var(--sd-spacing-2)}:host([size=md])::part(base){padding-inline:var(--sd-spacing-1)}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],t([r({type:String,reflect:!0})],e.prototype,"size",2),t([r({type:String,reflect:!0})],e.prototype,"variant",2),t([r({type:Boolean,reflect:!0})],e.prototype,"inverted",2),e=t([a("sd-6-7-
|
|
1
|
+
import{a as i}from"./chunk.YFQFOIEM.js";import{a,b as r,h as s}from"./chunk.CMXQRUFT.js";import{b as n,e as d}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends s{constructor(){super(...arguments);this.size="lg";this.variant="blue";this.inverted=!1}render(){return d`<span part="base" aria-labelledby="content" class="${i("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{blue:this.inverted?"sd-6-7-1-badge--blue--inverted-color-text sd-6-7-1-badge--blue--inverted-color-background sd-6-7-1-badge--inverted-color-border":"text-white bg-primary-500 border-white",green:this.inverted?"sd-6-7-1-badge--green-color--inverted-text sd-6-7-1-badge--green-color--inverted-background sd-6-7-1-badge--inverted-color-border":"text-white sd-6-7-1-badge--green-color-background border-white",red:this.inverted?"sd-6-7-1-badge--red--inverted-text sd-6-7-1-badge--red--inverted-background sd-6-7-1-badge--inverted-color-border":"text-white sd-6-7-1-badge--red-color-background border-white"}[this.variant])}"><span id="content" part="content" class="${i(this.size==="sm"&&"sr-only")}"><slot></slot></span></span>`}};e.styles=[...s.styles,n`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{display:inline-flex;align-items:center;justify-content:center}:host([size=md]){height:var(--sd-spacing-4);min-width:var(--sd-spacing-4);font-size:.625rem}:host([size=lg]){height:calc(var(--sd-spacing-1) * 5);min-width:calc(var(--sd-spacing-1) * 5);font-size:.75rem}:host([size=sm])::part(base){height:var(--sd-spacing-2);min-width:var(--sd-spacing-2)}:host([size=md])::part(base){padding-inline:var(--sd-spacing-1)}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],t([r({type:String,reflect:!0})],e.prototype,"size",2),t([r({type:String,reflect:!0})],e.prototype,"variant",2),t([r({type:Boolean,reflect:!0})],e.prototype,"inverted",2),e=t([a("sd-6-7-1-badge")],e);export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as n}from"./chunk.YFQFOIEM.js";import{a as i,b as a,h as r}from"./chunk.CMXQRUFT.js";import{b as l,e as s}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends r{constructor(){super(...arguments);this.variant="rectangular"}render(){return s`<div part="base" aria-hidden="true" class="${n("bg-neutral-200 w-full h-full animate-pulse",{rectangular:"rounded-sm",circular:"rounded-full inline-block"}[this.variant])}"><slot></slot></div>`}};t.styles=[...r.styles,l`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
-
:host{display:block}::slotted(*){visibility:hidden}`],e([a({type:String,reflect:!0})],t.prototype,"variant",2),t=e([i("sd-6-7-
|
|
2
|
+
:host{display:block}::slotted(*){visibility:hidden}`],e([a({type:String,reflect:!0})],t.prototype,"variant",2),t=e([i("sd-6-7-1-skeleton")],t);export{t as a};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as s}from"./chunk.PV6UYBMY.js";import{a as t}from"./chunk.YFQFOIEM.js";import{a as c,b as e,c as m,d as o,h as n}from"./chunk.CMXQRUFT.js";import{b as l,e as d}from"./chunk.763RLJEK.js";import{e as a}from"./chunk.6EV4YU6C.js";var r=class extends n{constructor(){super(...arguments);this.flipDirection="horizontal";this.placement="top";this.frontVariant="primary";this.backVariant="primary";this.activeSide="front"}connectedCallback(){super.connectedCallback()}flipFront(){this.activeSide="back",this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),setTimeout(()=>{this.back.focus()})}flipBack(){this.activeSide="front",this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),setTimeout(()=>{this.front.focus()})}handleFrontKeydown(i){i.code==="Enter"&&this.front===i.target&&this.flipFront()}handleBackKeydown(i){i.code==="Enter"&&this.back===i.target&&this.flipBack()}render(){return d`<div part="base" class="${t("flip-card relative h-full w-full")}"><div part="front" tabindex="0" aria-hidden="${this.activeSide==="back"}" inert="${s(this.activeSide==="back"||void 0)}" class="${t("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left",this.frontVariant==="primary"&&"bg-primary",this.frontVariant==="primary-100"&&"bg-primary-100",this.placement==="top"?"flex-col":"flex-col-reverse",this.flipDirection==="vertical"&&"vertical")}"><div part="media-front" class="${t("absolute h-full w-full -z-20",(this.frontVariant==="primary"||this.frontVariant==="primary-100")&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${t("flex relative",{primary:"text-white","primary-100":"text-black","gradient-light":"text-black","gradient-dark":"text-white"}[this.frontVariant])}"><div class="${t("absolute inset-0",{primary:"","primary-100":"","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/75 to-white/60":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/75 to-primary-800/60":"bg-gradient-to-b from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"></div><slot name="front"></slot></div><div part="front-secondary-gradient" class="${t("flip-card__gradient",{primary:"mb-auto","primary-100":"mb-auto","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/60 to-white/0 mb-auto":"bg-gradient-to-t from-white/60 to-white/0 mt-auto","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/60 to-primary-800/0 mt-auto":"bg-gradient-to-b from-primary-800/60 to-primary-800/0 mb-auto"}[this.frontVariant])}"></div><sd-6-7-
|
|
1
|
+
import{a as s}from"./chunk.PV6UYBMY.js";import{a as t}from"./chunk.YFQFOIEM.js";import{a as c,b as e,c as m,d as o,h as n}from"./chunk.CMXQRUFT.js";import{b as l,e as d}from"./chunk.763RLJEK.js";import{e as a}from"./chunk.6EV4YU6C.js";var r=class extends n{constructor(){super(...arguments);this.flipDirection="horizontal";this.placement="top";this.frontVariant="primary";this.backVariant="primary";this.activeSide="front"}connectedCallback(){super.connectedCallback()}flipFront(){this.activeSide="back",this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),setTimeout(()=>{this.back.focus()})}flipBack(){this.activeSide="front",this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),setTimeout(()=>{this.front.focus()})}handleFrontKeydown(i){i.code==="Enter"&&this.front===i.target&&this.flipFront()}handleBackKeydown(i){i.code==="Enter"&&this.back===i.target&&this.flipBack()}render(){return d`<div part="base" class="${t("flip-card relative h-full w-full")}"><div part="front" tabindex="0" aria-hidden="${this.activeSide==="back"}" inert="${s(this.activeSide==="back"||void 0)}" class="${t("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left",this.frontVariant==="primary"&&"bg-primary",this.frontVariant==="primary-100"&&"bg-primary-100",this.placement==="top"?"flex-col":"flex-col-reverse",this.flipDirection==="vertical"&&"vertical")}"><div part="media-front" class="${t("absolute h-full w-full -z-20",(this.frontVariant==="primary"||this.frontVariant==="primary-100")&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${t("flex relative",{primary:"text-white","primary-100":"text-black","gradient-light":"text-black","gradient-dark":"text-white"}[this.frontVariant])}"><div class="${t("absolute inset-0",{primary:"","primary-100":"","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/75 to-white/60":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/75 to-primary-800/60":"bg-gradient-to-b from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"></div><slot name="front"></slot></div><div part="front-secondary-gradient" class="${t("flip-card__gradient",{primary:"mb-auto","primary-100":"mb-auto","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/60 to-white/0 mb-auto":"bg-gradient-to-t from-white/60 to-white/0 mt-auto","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/60 to-primary-800/0 mt-auto":"bg-gradient-to-b from-primary-800/60 to-primary-800/0 mb-auto"}[this.frontVariant])}"></div><sd-6-7-1-button part="front-button" size="md" variant="${{primary:"tertiary","primary-100":"tertiary","gradient-light":"primary","gradient-dark":"primary"}[this.frontVariant]}" ?inverted="${{primary:!0,"primary-100":!1,"gradient-light":!0,"gradient-dark":!0}[this.frontVariant]}" class="${t("absolute right-0 p-2 flex-shrink-0",this.placement==="top"?"bottom-0":"top-0")}" @click="${this.flipFront}" @keydown="${this.handleFrontKeydown}"><sd-6-7-1-icon library="_internal" name="reload" label="Flip to Back"></sd-6-7-1-icon></sd-6-7-1-button></div><div part="back" tabindex="0" aria-hidden="${this.activeSide==="front"}" inert="${s(this.activeSide==="front"||void 0)}" class="${t("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left",this.backVariant==="primary"&&"bg-primary",this.backVariant==="primary-100"&&"bg-primary-100",this.placement==="top"?"flex-col":"flex-col-reverse",this.flipDirection==="vertical"&&"vertical")}"><div part="media-back" class="${t("absolute h-full w-full -z-20",(this.backVariant==="primary"||this.backVariant==="primary-100")&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${t("flex",{primary:"text-white","primary-100":"text-black","gradient-light":"text-black","gradient-dark":"text-white"}[this.backVariant],{primary:"","primary-100":"","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/75 to-white/60":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/75 to-primary-800/60":"bg-gradient-to-b from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${t("flip-card__gradient",{primary:"mb-auto","primary-100":"mb-auto","gradient-light":this.placement==="top"?"bg-gradient-to-b from-white/60 to-white/0 mb-auto":"bg-gradient-to-t from-white/60 to-white/0 mt-auto","gradient-dark":this.placement==="bottom"?"bg-gradient-to-t from-primary-800/60 to-primary-800/0 mt-auto":"bg-gradient-to-b from-primary-800/60 to-primary-800/0 mb-auto"}[this.backVariant])}"></div><sd-6-7-1-button size="md" part="back-button" variant="${{primary:"tertiary","primary-100":"tertiary","gradient-light":"primary","gradient-dark":"primary"}[this.backVariant]}" ?inverted="${{primary:!0,"primary-100":!1,"gradient-light":!0,"gradient-dark":!0}[this.backVariant]}" class="${t("absolute right-0 p-2 flex-shrink-0",this.placement==="top"?"bottom-0":"top-0")}" @click="${this.flipBack}" @keydown="${this.handleBackKeydown}"><sd-6-7-1-icon library="_internal" name="reload" label="Flip to Front"></sd-6-7-1-icon></sd-6-7-1-button></div></div>`}};r.styles=[...n.styles,l`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
2
|
:host{display:block;aspect-ratio:var(--sd-aspect-3\\/4);--name:'';--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}:host([front-variant=gradient-light]) [part=front-secondary-gradient],:host([front-variant=gradient-light]) [part=front-slot-container] .bg-gradient-to-b{--sd-color-background-white:rgba(
|
|
3
3
|
var(--sd-informational-gradient--white-color-background, rgba(var(--sd-color-white)))
|
|
4
4
|
)}:host([front-variant=gradient-dark]) [part=front-secondary-gradient],:host([front-variant=gradient-dark]) [part=front-slot-container] .bg-gradient-to-b{--sd-color-background-primary-800:rgba(
|
|
5
5
|
var(--sd-informational-gradient--primary-800-color-background, rgba(var(--sd-color-primary-800)))
|
|
6
|
-
)}`],a([o('[part="front"]')],r.prototype,"front",2),a([o('[part="back"]')],r.prototype,"back",2),a([e({reflect:!0,attribute:"flip-direction"})],r.prototype,"flipDirection",2),a([e({reflect:!0})],r.prototype,"placement",2),a([e({type:String,reflect:!0,attribute:"front-variant"})],r.prototype,"frontVariant",2),a([e({type:String,reflect:!0,attribute:"back-variant"})],r.prototype,"backVariant",2),a([m()],r.prototype,"activeSide",2),r=a([c("sd-6-7-
|
|
6
|
+
)}`],a([o('[part="front"]')],r.prototype,"front",2),a([o('[part="back"]')],r.prototype,"back",2),a([e({reflect:!0,attribute:"flip-direction"})],r.prototype,"flipDirection",2),a([e({reflect:!0})],r.prototype,"placement",2),a([e({type:String,reflect:!0,attribute:"front-variant"})],r.prototype,"frontVariant",2),a([e({type:String,reflect:!0,attribute:"back-variant"})],r.prototype,"backVariant",2),a([m()],r.prototype,"activeSide",2),r=a([c("sd-6-7-1-flipcard")],r);export{r as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{a as v}from"./chunk.VYBQ3X2B.js";import{a as b}from"./chunk.N3WG3NAL.js";import{b as u}from"./chunk.CJ34NUTS.js";import{a as m}from"./chunk.PV6UYBMY.js";import{a as p}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.YFQFOIEM.js";import{a}from"./chunk.NYKJXI3Q.js";import{a as c,b as o,c as h,d as s,h as n}from"./chunk.CMXQRUFT.js";import{b as d,e as i}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends n{constructor(){super(...arguments);this.hasSlotController=new p(this,"tooltip");this.formControlController=new u(this,{value:r=>r.checked?r.value||"on":void 0,defaultValue:r=>r.defaultChecked,setValue:(r,f)=>r.checked=f});this.showInvalidStyle=!1;this.title="";this.name="";this.disabled=!1;this.checked=!1;this.defaultChecked=!1;this.form="";this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(r){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(r),this.invalidMessage.textContent=r.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(r){this.input.focus(r)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(r){this.input.setCustomValidity(r),this.formControlController.updateValidity()}render(){return i`<div class="flex flex-row items-center gap-2"><label part="base" class="${l("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" role="switch" title="${this.title}" name="${this.name}" value="${m(this.value)}" .checked="${v(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="invalid-message" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${l(`relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100
|
|
2
2
|
peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2
|
|
3
|
-
peer-focus-visible:outline-primary transition-colors ease-in-out duration-medium hover:duration-fast`,this.disabled&&this.checked?"bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?this.checked?"border-error bg-error hover:bg-error-400 hover:border-error-400 group-hover:border-error-400 group-hover:bg-error-400":"border-error bg-white hover:border-error-400 hover:bg-white group-hover:border-error-400 group-hover:bg-white":this.checked?"border-accent hover:sd-6-7-
|
|
4
|
-
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){--tw-outline-style:none;outline-style:none}:host([required]) #label::after{content:' *'}:host([disabled][checked]) #control{border-color:rgba(var(--sd-color-background-neutral-500,rgba(var(--sd-color-neutral-500))))}:host([checked]) [part=thumb]{background-color:rgba(var(--sd-color-icon-fill-white,rgba(var(--sd-color-white))))}:host([disabled]:not([checked])) [part=thumb]{background-color:rgba(var(--sd-color-icon-fill-neutral-500,rgba(var(--sd-color-neutral-500))))}`],t([s("input")],e.prototype,"input",2),t([s("#invalid-message")],e.prototype,"invalidMessage",2),t([h()],e.prototype,"showInvalidStyle",2),t([o({type:String,reflect:!0})],e.prototype,"title",2),t([o({type:String,reflect:!0})],e.prototype,"name",2),t([o()],e.prototype,"value",2),t([o({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([o({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([b("checked")],e.prototype,"defaultChecked",2),t([o({reflect:!0})],e.prototype,"form",2),t([o({type:Boolean,reflect:!0})],e.prototype,"required",2),t([a("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),t([a(["checked"],{waitUntilFirstUpdate:!0})],e.prototype,"handleStateChange",1),e=t([c("sd-6-7-
|
|
3
|
+
peer-focus-visible:outline-primary transition-colors ease-in-out duration-medium hover:duration-fast`,this.disabled&&this.checked?"bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?this.checked?"border-error bg-error hover:bg-error-400 hover:border-error-400 group-hover:border-error-400 group-hover:bg-error-400":"border-error bg-white hover:border-error-400 hover:bg-white group-hover:border-error-400 group-hover:bg-white":this.checked?"border-accent hover:sd-6-7-1-switch--checked--hover-color-background bg-accent hover:border-accent-550 group-hover:sd-6-7-1-switch--checked--hover-color-background":"sd-6-7-1-switch--unchecked-color-border bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${l("w-2.5 h-2.5 rounded-full transition[transform,colors] ease-in-out duration-medium",this.disabled&&this.checked?"translate-x-2":this.disabled?"-translate-x-2":this.showInvalidStyle?this.checked?"translate-x-2":"bg-error -translate-x-2 hover:bg-error-400 hover:border-error-400 group-hover:border-error-400 group-hover:bg-error-400":this.checked?"translate-x-2":"-translate-x-2 sd-6-7-1-switch--unchecked__icon-color-background")}"></span> </span><span part="label" id="label" class="${l("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"sd-6-7-1-switch-color-text")}"><slot></slot></span></label> ${this.hasSlotController.test("tooltip")?i`<slot name="tooltip"></slot>`:null}</div><div part="invalid-icon-message" class="flex items-center gap-2 mt-2">${this.showInvalidStyle?i`<sd-6-7-1-icon part="invalid-icon" class="${l("text-error")}" library="_internal" name="risk"></sd-6-7-1-icon>`:""} ${this.formControlController.renderInvalidMessage("lg")}</div>`}};e.styles=[...n.styles,d`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
4
|
+
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){--tw-outline-style:none;outline-style:none}:host([required]) #label::after{content:' *'}:host([disabled][checked]) #control{border-color:rgba(var(--sd-color-background-neutral-500,rgba(var(--sd-color-neutral-500))))}:host([checked]) [part=thumb]{background-color:rgba(var(--sd-color-icon-fill-white,rgba(var(--sd-color-white))))}:host([disabled]:not([checked])) [part=thumb]{background-color:rgba(var(--sd-color-icon-fill-neutral-500,rgba(var(--sd-color-neutral-500))))}`],t([s("input")],e.prototype,"input",2),t([s("#invalid-message")],e.prototype,"invalidMessage",2),t([h()],e.prototype,"showInvalidStyle",2),t([o({type:String,reflect:!0})],e.prototype,"title",2),t([o({type:String,reflect:!0})],e.prototype,"name",2),t([o()],e.prototype,"value",2),t([o({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([o({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([b("checked")],e.prototype,"defaultChecked",2),t([o({reflect:!0})],e.prototype,"form",2),t([o({type:Boolean,reflect:!0})],e.prototype,"required",2),t([a("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),t([a(["checked"],{waitUntilFirstUpdate:!0})],e.prototype,"handleStateChange",1),e=t([c("sd-6-7-1-switch")],e);export{e as a};
|